fix(kernel,tools,validation): unblock role_pipeline end-to-end + QA audit

Live QA audit of role_pipeline against a sample repo surfaced and fixed a
chain of defects that prevented any tool+artifact workflow from running
end-to-end. The pipeline now completes cleanly with a real, validated,
reviewed file change.

- F-008 workflow: propagate stage token_budget -> generationConfig.maxTokens
  (TomlWorkflowLoader) so large stages stop truncating at the 2048 default.
- F-009 tools/kernel: file_read missing-file is recoverable; recoverable tool
  errors feed back into the loop instead of aborting the stage.
- F-010/F-018 kernel: reject premature stage_complete and nudge the model to
  emit the owed artifact / invoke a write tool (bounded by MAX_TOOL_ROUNDS).
- F-011 schemas: list-typed artifact fields string -> array (analysis/design/
  impl_plan) to match model output.
- F-012 kernel: strip an outer markdown code fence from LLM artifacts.
- F-013 validation: payload-validation failures are retryable; structural
  failures stay terminal (wires the invariant-#7 reject+retry contract).
- F-014 tools: file_edit schema matches its real params; edits emit a diff.
- F-015 kernel: record tool-execution events + materialise a real file_written
  artifact from the on-disk write; gate validation so a no-write stage cannot
  be rubber-stamped (no more false-success runs).
- F-016 server: raise stageTimeoutMs 60s -> 180s for slow local models.
- F-019 artifacts/kernel: file_written artifact carries the unified diff so the
  reviewer can verify the change (shared DiffUtil; file_write emits a diff too).
- F-020 tools: model-correctable file_edit failures are recoverable + steer
  toward replace/file_write over the fragile patch op.

Full findings register (F-001..F-021, incl. open F-021 resume rehydrate bug)
in qa/audit-report-2026-06-08.md. All module tests green.
This commit is contained in:
2026-06-08 21:51:21 +04:00
parent d518400b5f
commit b407b47503
16 changed files with 664 additions and 45 deletions
+4 -4
View File
@@ -6,12 +6,12 @@
"description": "what the request is asking for, in your own words"
},
"requirements": {
"type": "string",
"description": "concrete requirements / acceptance criteria, newline-separated"
"type": "array",
"description": "concrete requirements / acceptance criteria, one per item"
},
"affected_areas": {
"type": "string",
"description": "files, modules, or subsystems likely involved, newline-separated"
"type": "array",
"description": "files, modules, or subsystems likely involved, one per item"
}
},
"required": ["summary", "requirements"],
+4 -4
View File
@@ -6,12 +6,12 @@
"description": "the chosen approach and why"
},
"components": {
"type": "string",
"description": "components/files to add or change, newline-separated"
"type": "array",
"description": "components/files to add or change, one per item"
},
"risks": {
"type": "string",
"description": "risks, trade-offs, or open questions, newline-separated"
"type": "array",
"description": "risks, trade-offs, or open questions, one per item"
}
},
"required": ["approach", "components"],
+4 -4
View File
@@ -2,12 +2,12 @@
"type": "object",
"properties": {
"steps": {
"type": "string",
"description": "ordered, individually verifiable implementation steps, newline-separated"
"type": "array",
"description": "ordered, individually verifiable implementation steps, one per item"
},
"verification": {
"type": "string",
"description": "how completion is checked (commands, tests), newline-separated"
"type": "array",
"description": "how completion is checked (commands, tests), one per item"
}
},
"required": ["steps"],