feat(context): reasoning-thread continuity, L3 doc filtering, and gate hardening

Threads reasoning_content across inference calls and journal renders, filters
markdown noise out of L3 repo-knowledge retrieval, adds PlanLinter H3 checks,
and tightens filesystem tool output/dir-listing behavior surfaced by prior
live QA (see project_readloop_campaign memory).
This commit is contained in:
2026-07-10 11:13:43 +04:00
parent f51a8dada4
commit 3d5e05c1fb
32 changed files with 742 additions and 85 deletions
@@ -85,6 +85,27 @@ Emit a JSON object that validates against the `execution_plan` schema:
Those fetch remote code and prompt on stdin; the run is unattended (no TTY) so they hang, and
`shell` rejects them outright. `shell` in a scaffold stage is for `npm install` / `npm run
build` on files that already exist, not for generating the project.
- **Every stage prompt must describe its exact JSON output structure when using a
structured kind.** The model that runs the stage never sees the raw JSON schema — it only sees
the kind's name (e.g. `analysis`, `research_report`, `review_report`) and the prompt you write
here. Therefore each stage prompt must:
- Conclude with a `Call \`emit_artifact\` with a JSON object matching this shape:` line
followed by the literal JSON structure the kind expects (fields, types, required vs
optional).
- When the kind is `file_written` no `emit_artifact` is needed — the stage writes files
directly. For all other kinds, the prompt must spell out the exact JSON schema inline.
- Include at least one concrete example JSON object matching the schema, so the model has
a template to follow.
- For reference, the available JSON schemas and their shapes are: `discovery`
(`{ready: boolean, questions: [{prompt, options?, multiSelect?, header?}]}`),
`analysis` (`{goal, constraints: [{description, severity}], risks:
[{description, severity, mitigation?}], open_questions: [{question, answered?}]}`),
`design` (`{approach, architecture: [{component, responsibility, interfaces}],
plan: [{step, action, files: [path]}]}`),
`impl_plan` (`{overview, steps: [{action, target, details}]}`),
`research_report` (`{summary, findings: [string], sources: [string]}`),
`review_report` (`{verdict, notes}`). Use these shapes verbatim in the
prompt — do not paraphrase or omit fields.
**edges** — describe every transition between stages. Rules:
- `from` and `to` must each be a declared stage `id` or the literal string `"done"`.