Skip to content

fix: per-context SCTR output files + fixed Q3.2 constraints sub-level (#531, #532)#610

Merged
rdmueller merged 2 commits into
LLM-Coding:mainfrom
raifdmueller:fix/531-532-sctr-phase1
Jun 12, 2026
Merged

fix: per-context SCTR output files + fixed Q3.2 constraints sub-level (#531, #532)#610
rdmueller merged 2 commits into
LLM-Coding:mainfrom
raifdmueller:fix/531-532-sctr-phase1

Conversation

@raifdmueller

@raifdmueller raifdmueller commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

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:

  • Phase 1 writes QUESTION_TREE-[context-name].adoc / OPEN_QUESTIONS-[context-name].adoc (kebab-cased context name, consistent with Phase 2's existing prd-[context-name].adoc scheme)
  • Phase 2 reads the context-specific tree
  • ADRs get a context prefix: docs/specs/adrs/[context-name]-adr-NNN-*.adoc — closes the secondary collision in the shared adrs/ folder
  • All filename references updated: SKILL.md (incl. workflow diagram), both prompts, references/output-schema.md, and the website doc page (EN + DE). Grep-verified: no un-parameterized QUESTION_TREE.adoc/OPEN_QUESTIONS.adoc reference 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:

  • Q3.2.1 technical constraints (language, runtime, mandated frameworks/libraries)
  • Q3.2.2 organizational/process constraints (git workflow, branching, release, review rules)
  • Q3.2.3 conventional constraints (naming, file layout, code style, commit conventions)

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.md carries the same note.

Versioning

Skill 0.20.3, plugin 0.3.00.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

  • Grep: zero remaining fixed-name references outside parameterized forms
  • node scripts/render-docs.js: website doc pages (EN + DE) render clean

Fixes #531, fixes #532

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation

    • Workflow und Output-Dateien zu kontextspezifischen Namen geändert (QUESTION_TREE-<context-name>.adoc, OPEN_QUESTIONS-<context-name>.adoc) — verhindert Überschreiben zwischen Läufen; Phase‑1 stoppt bis Teamantwort/(deferred)-Marker.
    • Q3.2 (Architecture Constraints) auf fixe dritte Ebene erweitert: technische, organisatorische/prozessuale, konventionelle Constraints.
    • Explizite Zulassung von Nicht‑Code‑Evidenz (z. B. CLAUDE.md, AGENTS.md, CONTRIBUTING, CI-/Linter‑Configs).
  • Chores

    • Skill-Version auf 0.3; Plugin‑Metadaten auf 0.4 aktualisiert.

…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>
@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 84f967cc-76cd-4f06-8449-343ca8be36d0

📥 Commits

Reviewing files that changed from the base of the PR and between 215baf8 and edbdb8a.

📒 Files selected for processing (2)
  • plugins/semantic-anchors/skills/socratic-code-theory-recovery/SKILL.md
  • skill/socratic-code-theory-recovery/SKILL.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • plugins/semantic-anchors/skills/socratic-code-theory-recovery/SKILL.md
  • skill/socratic-code-theory-recovery/SKILL.md

Walkthrough

Die Ä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.

Changes

Socratic Code-Theory Recovery v0.3: Multi-Bounded-Context-Workflow

Layer / File(s) Summary
Version und Changelog
plugins/semantic-anchors/plugin.json, plugins/semantic-anchors/skills/socratic-code-theory-recovery/SKILL.md, skill/socratic-code-theory-recovery/SKILL.md, docs/changelog.adoc
Plugin-Version zu 0.4.0, Skill-Versionen zu 0.3 angehoben. Changelog ergänzt Eintrag für 2026-06-12 zu kontext-suffixed Phase‑1-Ausgaben und deterministischer Q3.2-Unterebenenerzeugung.
Skill-Invocation und Kontexterfassung
plugins/semantic-anchors/skills/socratic-code-theory-recovery/SKILL.md, skill/socratic-code-theory-recovery/SKILL.md
„On invocation“-Abschnitte fordern jetzt Verzeichnis‑Pfad und context-name (kebab-case) wenn kein Bounded Context angegeben ist; Phase‑1 stoppt explizit bis Teamantworten vorliegen.
Phase 1: Kontextspezifische Output-Dateinamen
docs/socratic-recovery-skill.adoc, docs/socratic-recovery-skill.de.adoc, plugins/semantic-anchors/skills/socratic-code-theory-recovery/SKILL.md, skill/socratic-code-theory-recovery/SKILL.md, plugins/semantic-anchors/skills/socratic-code-theory-recovery/prompts/phase-1-question-tree.md, skill/socratic-code-theory-recovery/prompts/phase-1-question-tree.md
Phase‑1 Prompt‑Header ergänzt [context-name]; Outputs wechseln von QUESTION_TREE.adoc/OPEN_QUESTIONS.adoc zu QUESTION_TREE-[context-name].adoc / OPEN_QUESTIONS-[context-name].adoc.
Phase 1: Feste Q3.2-Constraint-Zerlegung und Evidenzquellen
plugins/semantic-anchors/skills/socratic-code-theory-recovery/SKILL.md, skill/socratic-code-theory-recovery/SKILL.md, plugins/semantic-anchors/skills/socratic-code-theory-recovery/prompts/phase-1-question-tree.md, skill/socratic-code-theory-recovery/prompts/phase-1-question-tree.md, plugins/semantic-anchors/skills/socratic-code-theory-recovery/references/arc42.md, skill/socratic-code-theory-recovery/references/arc42.md
Q3.2 hat nun feste Subknoten Q3.2.1 (technical), Q3.2.2 (organizational/process), Q3.2.3 (conventional). Zulässige Belege erweitern sich explizit auf Non‑code‑Artefakte (z. B. CLAUDE.md, AGENTS.md, CONTRIBUTING, CI/Linter‑Configs) mit file:line‑Zitation.
Phase 1: Sanity-Checks und Rollenweitergabe
plugins/semantic-anchors/skills/socratic-code-theory-recovery/prompts/phase-1-question-tree.md, skill/socratic-code-theory-recovery/prompts/phase-1-question-tree.md
„What to do after the prompt completes“ und Sanity‑Checks verweisen jetzt auf QUESTION_TREE-[context-name].adoc und OPEN_QUESTIONS-[context-name].adoc; (deferred)‑Markerverhalten dokumentiert.
Phase 2: Kontextspezifisches Lesen und Artefakt-Quellen
plugins/semantic-anchors/skills/socratic-code-theory-recovery/prompts/phase-2-synthesize.md, skill/socratic-code-theory-recovery/prompts/phase-2-synthesize.md
Phase‑2‑Prompts lesen OPEN_QUESTIONS-[context-name].adoc und QUESTION_TREE-[context-name].adoc; PRD/Use‑Cases/arc42‑Quellen verweisen auf Q1/Q2/Q3‑Branches innerhalb des kontextspezifischen Trees.
Phase 2: Kontextpräfixierter ADR-Pfad
plugins/semantic-anchors/skills/socratic-code-theory-recovery/prompts/phase-2-synthesize.md, skill/socratic-code-theory-recovery/prompts/phase-2-synthesize.md
ADR‑Ausgabepfad ändert sich zu docs/specs/adrs/[context-name]-adr-NNN-*.adoc (Kontextpräfix verhindert Kollisionen); ADR‑Quelle auf Q3.9 des kontextspezifischen Trees gesetzt.
Phase 2: Traceability-Regeln für kontextspezifische Quellen
plugins/semantic-anchors/skills/socratic-code-theory-recovery/prompts/phase-2-synthesize.md, skill/socratic-code-theory-recovery/prompts/phase-2-synthesize.md
Traceability‑Regel „Do not introduce facts“ explizit auf QUESTION_TREE-[context-name].adoc und OPEN_QUESTIONS-[context-name].adoc beschränkt; Regel gegen Erfassen nicht belegter Fakten bleibt erhalten.
Output-Schema und Referenzdokumentation
plugins/semantic-anchors/skills/socratic-code-theory-recovery/references/output-schema.md, skill/socratic-code-theory-recovery/references/output-schema.md, docs/socratic-recovery-skill.adoc, docs/socratic-recovery-skill.de.adoc
output‑schema.md und Referenzen aktualisiert: Headliner und Abschnitt für OPEN_QUESTIONS-<context-name>.adoc ergänzt; Pflichtblockregel (*Your answer:*) und Phase‑2 Leseregeln auf kontextspezifische Benennung angepasst.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Der Titel beschreibt präzise die zwei Hauptänderungen: kontextspezifische SCTR-Output-Dateien und die fehlende dritte Ebene bei Q3.2-Constraints.
Linked Issues check ✅ Passed Alle Ziele aus #531 und #532 sind implementiert: kontextspezifische Dateinamen, ADR-Präfixe, Q3.2-Subebenen und Nicht-Code-Evidenz.
Out of Scope Changes check ✅ Passed Alle Änderungen adressieren direkt die beiden verlinkten Probleme; keine unerwünschten Erweiterungen außerhalb des Scope.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 win

Einheitliches Evidenzformat erzwingen. In beiden Phase-1-Prompt-Kopien erlauben Schritt 3/4 noch file::function, während der spätere Sanity-Check nur file:line prüft. Bitte nur file:line zulassen, 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 win

Gemeinsame Traceability-Regel für beide Phase-2-Prompts anpassen.

plugins/semantic-anchors/skills/socratic-code-theory-recovery/prompts/phase-2-synthesize.md und skill/socratic-code-theory-recovery/prompts/phase-2-synthesize.md behandeln [ANSWERED]-Leaves noch als reine „code evidence“. Für Q3.2 müssen beide Prompts Nicht-Code-Belege als file:line zulassen, sonst gehen gültige Architektur-Constraints aus CLAUDE.md, AGENTS.md, CONTRIBUTING.md oder 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

📥 Commits

Reviewing files that changed from the base of the PR and between b65910b and 215baf8.

📒 Files selected for processing (14)
  • docs/changelog.adoc
  • docs/socratic-recovery-skill.adoc
  • docs/socratic-recovery-skill.de.adoc
  • plugins/semantic-anchors/plugin.json
  • plugins/semantic-anchors/skills/socratic-code-theory-recovery/SKILL.md
  • plugins/semantic-anchors/skills/socratic-code-theory-recovery/prompts/phase-1-question-tree.md
  • plugins/semantic-anchors/skills/socratic-code-theory-recovery/prompts/phase-2-synthesize.md
  • plugins/semantic-anchors/skills/socratic-code-theory-recovery/references/arc42.md
  • plugins/semantic-anchors/skills/socratic-code-theory-recovery/references/output-schema.md
  • skill/socratic-code-theory-recovery/SKILL.md
  • skill/socratic-code-theory-recovery/prompts/phase-1-question-tree.md
  • skill/socratic-code-theory-recovery/prompts/phase-2-synthesize.md
  • skill/socratic-code-theory-recovery/references/arc42.md
  • skill/socratic-code-theory-recovery/references/output-schema.md

Comment thread plugins/semantic-anchors/skills/socratic-code-theory-recovery/SKILL.md Outdated
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>
@rdmueller rdmueller merged commit d2b835c into LLM-Coding:main Jun 12, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants