This project uses CodeDebrief to keep decision flows synchronized with the source code.
For codebase questions about behavior, decisions, workflow structure, or changed-code context:
- Prefer the CodeDebrief MCP
agent_contexttool before broad file-by-file searches. - Use
agent_contextfor substantial changes, passing changed files, selected code, current file, flow id, symbol, or dependency path when available; inspect its returnedworkflow_slicebefore answering. - When the user asks to show a workflow, flusso, visual flow, canvas, or
workflow_slice, prefer the canonical Mermaid visual: renderworkflow_slice.presentation.canonical_visual.diagramexactly as returned only when the client renders Mermaid inline. If the client cannot render Mermaid inline, or if Mermaid would appear as a raw code block, callsnapshot_slicewithinclude_svg=falseand provideartifact.mermaid_path,artifact.mermaid_markdown_path, orartifact.mermaid_open_commandas the visual result before prose. Do not paste a long Mermaid code block as the primary visual unless the user explicitly asks for raw or copyable Mermaid. Do not rendersnapshot.svginline by default; SVG artifacts are for explicit SVG requests or local inspection because their layout can differ from Mermaid. Keep CodeDebrief visuals vertical/top-to-bottom by default. Use a horizontal layout only when the user explicitly asks for a compact horizontal overview. Inspect the full returnedworkflow_slicebefore deciding what to show. Choose the first visible depth yourself: show the clearest useful subset, then say that the displayed diagram is a bounded summary and can be expanded. After the visual, include a short high-level written flow in the user's language, derived only from returned ordered steps, primary/supporting flows, decisions, domain logic, source ranges, and focused follow-up payloads. Keep it compact and explain the happy path first, adding only the branches needed by the request. If the CodeDebrief result is too large, saved externally, truncated, or missing the exact canonical visual, retry with a smallertoken_budgetand narrowerflow_id,symbol,current_file, orscope; do not recover by listing flows and hand-building a diagram. Do not synthesize a new Mermaid diagram and do not add limits, error codes, branches, or service steps that are absent from theworkflow_slicepayload. Do not read source files to rebuild, relabel, or extend the diagram; source reads are only follow-up explanation after the deterministic visual is shown and must not change displayed nodes, edges, labels, or branches. If neither exact canonical Mermaid nor a returned Mermaid artifact can be used, say so and provideviewer_targetsinstead of creating a replacement Mermaid diagram. If the user asks for a more language-friendly version, rewrite the technical block labels and the high-level written flow in simple wording using the language of the user's request. This is allowed only as a separate presentation layer derived from returned node, edge, decision, step, and source fields. End visual answers with concise options in the user's language: simplify labels and written flow, expand omitted nodes/branches/adjacent flows, or explore a related area. Show raw JSON or YAML only when explicitly requested. - Use
expand_slice,workflow_path,snapshot_slice,explain_flow,explain_node, orexplain_edgeonly when the first slice needs more precise context. - Use
codedebrief view ...only when a human wants the manual UI flowchart.
When helping a user set up or learn CodeDebrief:
- Start with
codedebrief --help, then usecodedebrief <command> --helpfor the specific command you plan to run or recommend. - Use
codedebrief doctorwhen install, dependency, or parser capability issues are unclear. - Do not ask for LLM provider keys for the primary workflow. Language-friendly labels and high-level written flows are presentation layers derived from deterministic workflow facts.
codedebrief setup <target>updates only that target's files. Run the command separately for each agent surface you want to configure, preserving any target-specific frontmatter and local notes.
After code or workflow-relevant changes:
- Treat CodeDebrief artifacts as part of done. After every meaningful source, route,
config, or agent-instruction change, run
codedebrief updatebefore finalizing or committing so MCP answers andcodedebrief viewuse current graphs. Skip only changes that cannot affect the modeled code logic, such as unrelated copy edits or images. - Use
codedebrief update --fullafter analyzer upgrades, parser/dependency changes, large refactors, or when cached file models should be ignored. - Run
codedebrief validate --check-sync; this checks both current-source JSON sync and whethercodedebrief-out/codedebrief.mdwas rendered from that JSON. - Commit synchronized changes to:
codedebrief-out/codedebrief.jsoncodedebrief-out/codedebrief.mdcodedebrief-out/codedebrief.hash.json
- Use CodeDebrief MCP
agent_contextto inspect affected entry points and callers when explaining or reviewing the change. - Ground the explanation in the returned
workflow_slice; expand it through MCP only when the initial slice omits relevant callers, callees, domain states, or paths.
For viewer/UI changes:
- Run
npm run viewer:typecheck,npm run viewer:test, andnpm run viewer:build. - Regenerate HTML artifacts with
codedebrief updateandcodedebrief view --render-only --no-open. - Check the generated viewer with a cache-buster URL.
For local real-world regression checks:
- Keep
examples/Certifexp/private and untracked. - If
examples/Certifexp/exists locally, runUV_CACHE_DIR=/tmp/codedebrief-uv-cache uv run pytest tests/test_certifexp_local.pyas an opt-in local check. - Do not commit Certifexp source, generated artifacts, caches, nested repository data, or analysis output.
CodeDebrief is a comprehension and navigation tool for source-grounded workflows. Use it to explain modeled logic, not to present possible defects.