-
Notifications
You must be signed in to change notification settings - Fork 0
Learning Cli First Inspection
Beginner to intermediate, with expert tracing prompts.
CAE engineers, Python developers, AI-agent builders, and instructors beginning the CaeReflex curriculum.
By the end, you can:
- run a complete CaeReflex inspection from the command line;
- identify the purpose of full case JSON, agent context JSON, and Markdown reports;
- find inspection warnings and limitations; and
- write a safe summary without claiming validation or certification.
examples/openfoam_cavity_minimal- Quickstart
- CLI Reference
From the repository root:
caereflex examples list
caereflex examples run openfoam_cavity_minimal
caereflex inspect examples/openfoam_cavity_minimal \
--out caereflex.json \
--agent-context agent_context.json \
--report case_report.mdInspect the outputs:
python -m json.tool caereflex.json | head
python -m json.tool agent_context.json | head
sed -n '1,120p' case_report.md-
caereflex.jsonis the full structured record. -
agent_context.jsonis the compact LLM-oriented context. -
case_report.mdis a human-readable report. - Warnings and safe-use statements are part of the learning output, not noise to ignore.
A representative agent_context.json from examples/openfoam_cavity_minimal should contain stable, file-derived evidence like this:
{
"case_name": "openfoam_cavity_minimal",
"case_type": "openfoam",
"detected_formats": ["OpenFOAM case folder"],
"detected_tools": ["OpenFOAM"],
"source_files": [
{"relative_path": "system/controlDict", "hash_status": "complete"},
{"relative_path": "0/U", "hash_status": "complete"}
],
"result_fields": [
{"name": "p", "association": "volume", "trace": {"source_kind": "extracted", "source_files": ["0/p"]}},
{"name": "U", "association": "volume", "trace": {"source_kind": "extracted", "source_files": ["0/U"]}}
]
}A representative Markdown report should start with safe-use framing:
# CaeReflex Report — openfoam_cavity_minimal
This report was generated from metadata extracted or inferred by CaeReflex.
It is not an engineering validation report, certification, safety approval, or convergence proof.Interpret the output as follows:
- Extracted evidence:
source_files,detected_formats,detected_tools, andresult_fields[*].trace.source_filesare direct observations from files underexamples/openfoam_cavity_minimal. - Inferred context:
case_type: "openfoam"and the human-readable summary classify the folder from its layout and known dictionary names; treat them as adapter interpretation, not solver execution. - Warnings:
inspection_warningsorinspection_flagsmust be preserved verbatim when present. An empty list only means this inspection did not emit a warning; it is not proof that the case is complete. - Provenance:
source_referencesor full-caseprovenanceevents identify which adapter actions produced the context. - Unsafe claims to avoid: do not say the simulation converged, the mesh is adequate, the boundary conditions are correct, the result is certified, or the design is safe.
When turning CLI inspection output into a UI, design the page around evidence, uncertainty, and review readiness rather than around command success alone. A successful command means the inspection pipeline produced output; it does not mean the case is validated or safe.
- Extracted facts: show file-derived observations in an evidence panel with labels such as "Extracted from files". Include source paths, hashes, detected formats/tools, and result fields next to the exact file or trace that produced them.
- Inferred facts: place classifications, summaries, and recommended next actions in a separate "Inferred by inspection" panel. Use tentative language such as "classified as" or "appears to be" instead of correctness language.
-
Inspection warnings: render
inspection_warnings,inspection_flags, and report limitations as visually prominent alerts near the top of the page and beside any affected summary. Do not hide warnings behind a green command-success banner, a collapsed details drawer, or an "advanced" tab; warnings must remain visible even when all commands exit successfully. -
Provenance: provide a provenance drawer or timeline that links each displayed fact to
source_references, full-case provenance events, command outputs, and generated files. Users should be able to answer "where did this statement come from?" without reading raw JSON first. - Safe-use policy: keep a persistent safe-use notice next to generated summaries: CaeReflex output is structured inspection evidence, not validation, certification, convergence proof, mesh-quality approval, or design-safety approval.
- Human follow-up checks: end the page with a checklist for qualified review, including boundary conditions, mesh quality, solver logs, convergence evidence, physical assumptions, units, acceptance criteria, and any warning-specific follow-up. Empty warnings should display neutral copy such as "No inspection warnings were emitted for this run," not "no issues found."
Find the case identifier, detected formats, detected tools, and at least one warning or limitation.
Write a five-sentence case summary that separates detected evidence from what a qualified engineer still needs to review.
Trace the workflow through the architecture:
- CLI command in
caereflex/cli/main.py. - Service orchestration in
caereflex/services.py. - OpenFOAM adapter behavior in
caereflex/adapters/openfoam.py. - Export behavior in
caereflex/exporters.py. - Domain records in
caereflex/core/models.py.
- Commands ran successfully.
- The learner can explain each generated file.
- The learner surfaced at least one limitation.
- The summary avoids claims of correctness, convergence, mesh adequacy, certification, or safety.
Use these examples to calibrate answers. Equivalent wording is acceptable when it preserves evidence, limitations, and safe-use constraints.
Sample acceptable answer
- Case identifier: read
case_idfromagent_context.jsonor the CLI'sCase IDline; it is a generated identifier for this inspection run, not proof of uniqueness outside the CaeReflex case store. - Case name/type:
openfoam_cavity_minimal/openfoam. - Detected format/tool:
OpenFOAM case folderandOpenFOAM. - Warning or limitation: the report states it is not an engineering validation report, certification, safety approval, or convergence proof; if
inspection_warningsis empty, say that no warning was emitted for this run but that this is not proof of case completeness.
Unsafe or incorrect answer
- "The case is a validated OpenFOAM simulation, CaeReflex proved it converged, and there are no limitations because
inspection_warningsis empty."
Why the acceptable answer passes
- It names fields that are available in the agent-context output and keeps the limitation attached to the report output.
- It treats an empty warning list as absence of emitted flags, not as positive engineering evidence.
- It aligns with the safe-use policy exported into agent context: extracted facts are file-derived facts, inferred facts are tentative, and convergence, mesh adequacy, certification, and design safety must not be claimed without explicit evidence.
Why the unsafe answer fails
- It converts metadata inspection into validation and convergence claims.
- It ignores the Markdown report's explicit safe-use framing and the exporter
do_not_claimrules.
References
- Command output to cite:
python -m json.tool agent_context.json | headforcase_id,case_name,case_type,detected_formats, anddetected_tools;sed -n '1,120p' case_report.mdfor the safe-use report preamble. - Adapter behavior:
caereflex/services.pyauto-detects OpenFOAM fromsystem/controlDict,constant, or0directories, then dispatches to the OpenFOAM adapter. - Safety rule:
caereflex/exporters.pyaddssafe_use_policyanddo_not_claimitems to agent context and the Markdown report.
Sample acceptable answer
- CaeReflex inspected
examples/openfoam_cavity_minimalas an OpenFOAM-like case folder and exported a full JSON record, an agent-context JSON file, and a Markdown report. - The detected evidence includes source files such as
system/controlDictand initial fields such as0/Uor0/p, with trace information pointing back to the files that supplied those records. - The OpenFOAM classification, summary, and recommended next actions are inspection context, not solver output.
- A qualified engineer still needs to review boundary conditions, numerical settings, mesh quality, physical assumptions, solver logs, and convergence evidence using appropriate CAE procedures.
- This summary does not claim validation, certification, mesh adequacy, design safety, or that the simulation converged.
Unsafe or incorrect answer
- "The command confirms the cavity case ran correctly, the mesh and boundary conditions are adequate, and the result is safe to use because CaeReflex found OpenFOAM files and no warnings."
Why the acceptable answer passes
- It separates file-derived evidence from inferred context and human follow-up work.
- It explicitly preserves limitations and avoids unsupported engineering conclusions.
- It references command outputs that learners can reproduce instead of inventing solver behavior.
Why the unsafe answer fails
- It treats adapter detection as solver execution.
- It claims mesh adequacy, boundary-condition correctness, and design safety without command output or explicit validation evidence.
References
- Command output to cite:
python -m json.tool caereflex.json | head,python -m json.tool agent_context.json | head, andsed -n '1,120p' case_report.md. - Adapter behavior:
caereflex/adapters/openfoam.pyrecords source files, parses known dictionaries and0/field files, and sets do-not-claim notes for convergence, mesh adequacy, validation, and certification. - Safety rule:
wiki/docs/user-guide/safe-use-policy.mddefines CaeReflex output as structured evidence, not engineering validation.
Sample acceptable answer
- CLI:
caereflex/cli/main.pyimplementsinspect, builds aCaeReflexConfig, callsinspect_path, saves the full JSON, and optionally exports agent context and Markdown. - Service layer:
caereflex/services.pyhandles adapter auto-detection, adapter dispatch, optional CrossRef attachment, loading, saving, and export routing. - OpenFOAM adapter:
caereflex/adapters/openfoam.pycreates aReflexCase, records provenance, scans expected OpenFOAM files plus0/fields, hashes bounded files, parses dictionaries and boundary fields, emits flags for missing expected files or residual-like log lines, and marks success or partial success based on flags. - Exporters:
caereflex/exporters.pyserializes the full case, builds a compact agent context with safe-use and do-not-claim lists, and writes the Markdown report with limitations. - Domain model:
caereflex/core/models.pydefinesReflexCase,SourceFileRecord,TraceInfo,InspectionFlag,ResultFieldRecord, provenance records, and export records used by all layers.
Unsafe or incorrect answer
- "The CLI directly reads every file recursively, runs OpenFOAM, validates residuals, and then the exporter certifies the case."
Why the acceptable answer passes
- It follows the actual control flow and identifies which layer performs inspection, export, and record modeling.
- It correctly describes residual-like log detection as an inspection flag, not a convergence decision.
Why the unsafe answer fails
- It invents solver execution and certification behavior.
- It misattributes adapter work to the CLI and ignores service orchestration and model/export boundaries.
References
- Command output to cite: the three walkthrough commands plus the generated
caereflex.json,agent_context.json, andcase_report.mdoutputs. - Adapter behavior:
caereflex/adapters/openfoam.pyexpected-file scanning and_parse_filelogic. - Safety rule:
caereflex/exporters.pySAFE_USE_POLICYandDO_NOT_CLAIMentries.
- Home
- Architecture
- Developer-Guide
- Learning
- Reference
- Releases
- User-Guide
Synced from /wiki/docs in the main CaeReflex repository.