fix: per-context SCTR output files + fixed Q3.2 constraints sub-level (#531, #532)#610
Conversation
…el (LLM-Coding#531, LLM-Coding#532) LLM-Coding#531 — Phase 1 wrote fixed filenames (QUESTION_TREE.adoc, OPEN_QUESTIONS.adoc), so sequential bounded-context runs silently overwrote each other while the skill itself documents "one bounded context at a time". Phase 1 outputs are now suffixed with the kebab-cased context name, Phase 2 reads the context-specific tree, and ADRs get a context prefix (adrs/[context-name]-adr-NNN-*.adoc) so two contexts cannot produce colliding decision-record files. All references to the old fixed names updated (SKILL.md, both prompts, output-schema reference, website doc EN+DE). LLM-Coding#532 — the adaptive, code-density-driven decomposition under Q3.2 (Architecture Constraints) walked past constraints that do not live in dense code: process constraints (git workflow), convention constraints (naming, mandated libraries), runtime constraints. Q3.2 now carries a fixed third level mirroring arc42 Chapter 2's constraint kinds — Q3.2.1 technical, Q3.2.2 organizational/process, Q3.2.3 conventional — and the prompt explicitly admits CLAUDE.md/AGENTS.md, CONTRIBUTING, CI workflows, and linter configs as evidence sources for this branch. This closes the untraceable-claim gap where Phase 2 picked such constraints up from the repo without any tree leaf to cite. Skill version 0.2 -> 0.3, plugin 0.3.0 -> 0.4.0. Fixes LLM-Coding#531, fixes LLM-Coding#532 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
WalkthroughDie Änderungen bringen Phase‑1/Phase‑2 Prompts, Skill‑Metadaten und Referenzdokumentation auf kontextspezifische Ausgabe‑Dateinamen und fügen unter Q3.2 eine feste dritte Ebene (Q3.2.1–Q3.2.3) plus ausdrücklich erlaubte Nicht‑Code‑Evidenzquellen hinzu. ChangesSocratic Code-Theory Recovery v0.3: Multi-Bounded-Context-Workflow
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
plugins/semantic-anchors/skills/socratic-code-theory-recovery/prompts/phase-1-question-tree.md (1)
51-123:⚠️ Potential issue | 🟠 Major | ⚡ Quick winEinheitliches Evidenzformat erzwingen. In beiden Phase-1-Prompt-Kopien erlauben Schritt 3/4 noch
file::function, während der spätere Sanity-Check nurfile:lineprüft. Bitte nurfile:linezulassen, damit[ANSWERED]-Leaves in beiden Prompts verlässlich prüfbar bleiben.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@plugins/semantic-anchors/skills/socratic-code-theory-recovery/prompts/phase-1-question-tree.md` around lines 51 - 123, The prompt currently allows evidence in two formats (`file::function` and `file:line`) in steps 3/4 but the Sanity-check only validates `file:line`; update both Phase‑1 prompt copies to accept and require only the `file:line` evidence format (remove any mention of `file::function` from the decomposition and leaf classification rules and the examples), and also adjust the Sanity-check instructions to assert/verify only `file:line` citations for `[ANSWERED]` leaves (affecting text around "For each leaf, classify it" and the "What to do after the prompt completes" sanity checks and the references to QUESTION_TREE-[context-name].adoc / OPEN_QUESTIONS-[context-name].adoc).plugins/semantic-anchors/skills/socratic-code-theory-recovery/prompts/phase-2-synthesize.md (1)
72-78:⚠️ Potential issue | 🟠 Major | ⚡ Quick winGemeinsame Traceability-Regel für beide Phase-2-Prompts anpassen.
plugins/semantic-anchors/skills/socratic-code-theory-recovery/prompts/phase-2-synthesize.mdundskill/socratic-code-theory-recovery/prompts/phase-2-synthesize.mdbehandeln[ANSWERED]-Leaves noch als reine „code evidence“. Für Q3.2 müssen beide Prompts Nicht-Code-Belege alsfile:linezulassen, sonst gehen gültige Architektur-Constraints ausCLAUDE.md,AGENTS.md,CONTRIBUTING.mdoder CI-/Lint-Konfigurationen verloren.🔧 Vorschlag
- A claim backed by an [ANSWERED] leaf cites the code evidence from that - leaf — the reference to the code, the only durable, canonical artifact: + A claim backed by an [ANSWERED] leaf cites the evidence from that leaf + as `file:line` — code and non-code sources are both valid:Basierend auf dem PR-Ziel
#532: Nicht-Code-Evidenz muss in Phase 2 ausdrücklich erlaubt bleiben.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@plugins/semantic-anchors/skills/socratic-code-theory-recovery/prompts/phase-2-synthesize.md` around lines 72 - 78, Die Regel in both prompts currently treats [ANSWERED] leaves as only "code evidence"; update the text in plugins/semantic-anchors/skills/socratic-code-theory-recovery/prompts/phase-2-synthesize.md and skill/socratic-code-theory-recovery/prompts/phase-2-synthesize.md to allow non-code evidence by permitting Evidence lines that reference non-source files in the form file:line (e.g., CLAUDE.md:12, AGENTS.md:5, CONTRIBUTING.md:3, or CI/LINT config paths), while still requiring the Evidence line be copied verbatim from the leaf and preserving the [ANSWERED] semantics for Q3.2; keep the instruction to not invent/shorten paths and add an explicit example or phrase that non-code artifacts (docs/configs/MD files) are valid file:line evidence.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@plugins/semantic-anchors/skills/socratic-code-theory-recovery/SKILL.md`:
- Line 27: Aktualisiere beide SKILL-Kopien: ersetze den aktuellen Phase-2-Guard,
der auf die Ausnahme "unless the user explicitly asks" basiert, durch eine
Prüfung der OPEN-Blätter in der Datei OPEN_QUESTIONS-<context-name>.adoc und
lasse Phase 2 nur starten, wenn alle `[OPEN]`-Leaves entweder beantwortet sind
oder explizit mit `(deferred)` markiert wurden; passe die Nutzerhinweise (die
Phase‑1‑Abschlussmeldung) in denselben Dateien an, damit sie eindeutig
mitteilen, wo die zwei Ausgabedateien liegen und dass Phase 2 erst nach
beantworteten/`(deferred)`-markierten OPEN-Blättern ausgeführt wird.
---
Outside diff comments:
In
`@plugins/semantic-anchors/skills/socratic-code-theory-recovery/prompts/phase-1-question-tree.md`:
- Around line 51-123: The prompt currently allows evidence in two formats
(`file::function` and `file:line`) in steps 3/4 but the Sanity-check only
validates `file:line`; update both Phase‑1 prompt copies to accept and require
only the `file:line` evidence format (remove any mention of `file::function`
from the decomposition and leaf classification rules and the examples), and also
adjust the Sanity-check instructions to assert/verify only `file:line` citations
for `[ANSWERED]` leaves (affecting text around "For each leaf, classify it" and
the "What to do after the prompt completes" sanity checks and the references to
QUESTION_TREE-[context-name].adoc / OPEN_QUESTIONS-[context-name].adoc).
In
`@plugins/semantic-anchors/skills/socratic-code-theory-recovery/prompts/phase-2-synthesize.md`:
- Around line 72-78: Die Regel in both prompts currently treats [ANSWERED]
leaves as only "code evidence"; update the text in
plugins/semantic-anchors/skills/socratic-code-theory-recovery/prompts/phase-2-synthesize.md
and skill/socratic-code-theory-recovery/prompts/phase-2-synthesize.md to allow
non-code evidence by permitting Evidence lines that reference non-source files
in the form file:line (e.g., CLAUDE.md:12, AGENTS.md:5, CONTRIBUTING.md:3, or
CI/LINT config paths), while still requiring the Evidence line be copied
verbatim from the leaf and preserving the [ANSWERED] semantics for Q3.2; keep
the instruction to not invent/shorten paths and add an explicit example or
phrase that non-code artifacts (docs/configs/MD files) are valid file:line
evidence.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: 6e8b9a41-4635-4d4e-ae05-97c03503153a
📒 Files selected for processing (14)
docs/changelog.adocdocs/socratic-recovery-skill.adocdocs/socratic-recovery-skill.de.adocplugins/semantic-anchors/plugin.jsonplugins/semantic-anchors/skills/socratic-code-theory-recovery/SKILL.mdplugins/semantic-anchors/skills/socratic-code-theory-recovery/prompts/phase-1-question-tree.mdplugins/semantic-anchors/skills/socratic-code-theory-recovery/prompts/phase-2-synthesize.mdplugins/semantic-anchors/skills/socratic-code-theory-recovery/references/arc42.mdplugins/semantic-anchors/skills/socratic-code-theory-recovery/references/output-schema.mdskill/socratic-code-theory-recovery/SKILL.mdskill/socratic-code-theory-recovery/prompts/phase-1-question-tree.mdskill/socratic-code-theory-recovery/prompts/phase-2-synthesize.mdskill/socratic-code-theory-recovery/references/arc42.mdskill/socratic-code-theory-recovery/references/output-schema.md
Step 4 of the invocation flow allowed Phase 2 "unless the user explicitly asks", contradicting the Between-Phases rule and the Phase 2 prompt header, which both require every [OPEN] leaf to carry a team answer or an explicit (deferred) marker. Phase 2 is now gated on that file check — even an explicit user request first verifies OPEN_QUESTIONS-<context-name>.adoc and lists the unanswered leaves instead of proceeding. Found by CodeRabbit review. Refs LLM-Coding#531, LLM-Coding#532 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Summary
Fixes the two Socratic Code-Theory Recovery bugs found during the Mistral Vibe brownfield runs.
#531 — Phase 1 output collision
Phase 1 wrote two fixed filenames, so the documented "one bounded context at a time" workflow silently destroyed earlier runs. Now:
QUESTION_TREE-[context-name].adoc/OPEN_QUESTIONS-[context-name].adoc(kebab-cased context name, consistent with Phase 2's existingprd-[context-name].adocscheme)docs/specs/adrs/[context-name]-adr-NNN-*.adoc— closes the secondary collision in the sharedadrs/folderreferences/output-schema.md, and the website doc page (EN + DE). Grep-verified: no un-parameterizedQUESTION_TREE.adoc/OPEN_QUESTIONS.adocreference remains.#532 — Q3.2 constraints under-decomposition
The code-density-driven decomposition walked past constraints that do not live in dense code (git workflow, naming conventions, mandated libraries, runtime choices) — Phase 2 then picked them up from the repo with no tree leaf to cite, producing exactly the untraceable claims the two-phase design exists to prevent. Now Q3.2 carries a fixed third level, mirroring arc42 Chapter 2's constraint kinds:
For this branch specifically, the prompt admits non-code evidence sources —
CLAUDE.md/AGENTS.md, CONTRIBUTING, CI workflows, linter/formatter configs — cited file:line like any other evidence.references/arc42.mdcarries the same note.Versioning
Skill
0.2→0.3, plugin0.3.0→0.4.0(same PR, per convention).Note on the contract
The Socratic Code Theory Recovery contract text (CLAUDE.md / contracts.json) states "the second level of the tree is FIXED" — the fixed Q3.2.x third level is an extension of that idea. If the contract should mirror it, that is a separate edit to contracts.json (and your CLAUDE.md); happy to follow up.
Verification
node scripts/render-docs.js: website doc pages (EN + DE) render cleanFixes #531, fixes #532
🤖 Generated with Claude Code
Summary by CodeRabbit
Documentation
QUESTION_TREE-<context-name>.adoc,OPEN_QUESTIONS-<context-name>.adoc) — verhindert Überschreiben zwischen Läufen; Phase‑1 stoppt bis Teamantwort/(deferred)-Marker.Chores