Repository navigation
feat(aidd-pm): refuse a write to a locked spec before it happens - #1343
Merged
Merged
Conversation
…nd check the spec it writes The router keeps only its diagram and transversal rules, each action step is one sentence, and build and refine run validate-spec.cjs on the spec they write. SPEC-01 holds spec.md to its template; the aidd-pm turn-end hook applies it too. The weighted spec-validator.yml, read by no file, is removed. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RY5w5YEbGF6DpKkbU9uyJS
… respects A spec now carries status: draft or locked in its front matter, and SPEC-01 refuses any other value. Refine reads it first and writes nothing on a locked spec; only the person who approves a spec locks it. Build maps a PRD's headings to the spec's sections and takes a hard constraint only from its Dependencies. The vague "few acceptance criteria" rule is dropped, and the argument hint names the findings refine needs. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RY5w5YEbGF6DpKkbU9uyJS
…ailure case A locked spec must have no open question left, checked by SPEC-02. Build asks at most three questions on the gaps that change the target most, and goes on with the gaps when no user can answer. Every hard constraint is proven by a Done-when condition, Done-when covers a refused or failed case, and a request holding several outcomes keeps one and lists the others as Non-goals. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RY5w5YEbGF6DpKkbU9uyJS
A spec whose status is locked was protected by the skill's instruction only, and a small model rewrote one. spec-lock.cjs runs before a write and refuses it when the file already on disk declares status: locked. It reads the file, never the content being written, so a draft is never blocked. ARCHITECTURE.md gains a third level, Refuse, and the refuse(reason) entry of the neutral host interface. Until the adapters report the moment before a tool, the hook does nothing. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RY5w5YEbGF6DpKkbU9uyJS
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RY5w5YEbGF6DpKkbU9uyJS
…g the files written Each host names its write tools differently; a Claude-named matcher missed Copilot's create and every Antigravity write. A call writing several files is refused when any one is a locked spec. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RY5w5YEbGF6DpKkbU9uyJS
Adds the session start, prompt and session end moments, and folds the placement prose into the level and moment rows. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RY5w5YEbGF6DpKkbU9uyJS
…nterface calls Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RY5w5YEbGF6DpKkbU9uyJS
…ne content reference The description names both modes, build writes the spec first and asks its open questions after, and the per-section judgment moves to references/spec-content.md, replacing the TBD marker reference. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A model wrote the empty marker as a bullet, `- None`, which a locked spec then failed on. Omitting the section leaves nothing to spell. A refine now answers with each changed line as a diff and names any other section that breaks the content reference, without changing it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A refine trial added a bare question to Open Questions and the contract let it through, since the template checks headings, not lines. SPEC-03 holds every line of that section to `- TBD: <question>`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
An SDLC trial on a small model wrote `node --test` passes as a Done-when condition. SPEC-04 refuses a test runner or a tests-pass phrase there: the plan and the assert step own how a condition is checked. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01XeK3mDBqVCeeSgD36xKnAf
A list of test runners can never be complete. The contract checks only a spec's shape; whether Done-when names a command stays a judgment in spec-content.md. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01XeK3mDBqVCeeSgD36xKnAf
…answer template Build no longer maps a PRD's headings: spec-content.md says what each section holds, whatever the source calls it. Refine fills assets/refine-answer.md, a diff of the changed lines. The gap definition moves into the Open Questions row, and the locked-spec sentence goes, since SPEC-02 checks it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01XeK3mDBqVCeeSgD36xKnAf
docs/ARCHITECTURE.md § Hooks keeps the table form and folds in next's facts: aidd-telemetry under the contract, its event.raw and detached-ingest exceptions, the person channel per host, a silent level 0 and an inert level 3. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01XeK3mDBqVCeeSgD36xKnAf
… one The skill no longer tells a request from a document, or review findings from answers: build reads the need wherever it is written, and refine applies the changes it is given. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01XeK3mDBqVCeeSgD36xKnAf
Build asks only when no outcome can be named, and writes to the first folder that exists in an ordered list. Refine stops before writing when no change applies, and its answer template carries the open questions the transversal rule asks for. The template's title slot holds one name, and a non-goal is decided, while an undecided item is a gap. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01XeK3mDBqVCeeSgD36xKnAf
Both trial models refused to rewrite a locked spec, then offered to flip its status on confirmation. The rule now forbids changing that status or offering to. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01XeK3mDBqVCeeSgD36xKnAf
…r, already listed as a gap Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01XeK3mDBqVCeeSgD36xKnAf
… rechecks it Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01XeK3mDBqVCeeSgD36xKnAf
… feat/spec-lock-guard
1 of 8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 What & why
A spec whose status is
lockedwas protected only by the skill's instruction, and a small model rewrote one through its file-edit tool (Kilo, free nemotron, trial on #1338). This adds a deterministic guard: before a write,spec-lock.cjsrefuses it when the spec already on disk declaresstatus: locked.Refs #1342: the guard does nothing until the CLI adapters report the moment before a tool and can deny. Stacked on #1338, which introduces the spec's
status.🛠️ How it works
plugins/aidd-pm/hooks/spec-lock.cjsreadsreadEvent().filesand refuses throughrefuse(reason)when any file is a spec underaidd_docs/tasks/whose front matter holdsstatus: locked(quoted or not, CRLF too).hooks.jsonregisters it underPreToolUsewith no matcher: each host names its write tools differently, and the adapters givefiles: []for any other tool.docs/ARCHITECTURE.mdgains level 3, Refuse, and the moment Before the write. "No level stops a write" becomes: a refusal never judges the content being written. Rule 2 listsrefuse(reason)in the neutral interface.🧪 How to verify
node scripts/check-tests-leave-git-alone.js -- node --test scripts/__tests__/spec-lock-hook.test.js: 6 pass, against a stand-in adapter speaking the shape agreed in feat(cli): let a plugin hook refuse a file write on every host #1342.---ignored, thelockedmatch removed, the path filter widened, the refusal made unconditional, only the first file checked. Each turns at least one test red.check-architecture-rules.jspasses; catalogs regenerated (3 → 4 hooks).🤖 Generated with Claude Code
https://claude.ai/code/session_01RY5w5YEbGF6DpKkbU9uyJS