diff --git a/codev-skeleton/protocols/aspir/consult-types/spec-review.md b/codev-skeleton/protocols/aspir/consult-types/spec-review.md index 4eba02a0d..349916716 100644 --- a/codev-skeleton/protocols/aspir/consult-types/spec-review.md +++ b/codev-skeleton/protocols/aspir/consult-types/spec-review.md @@ -16,7 +16,7 @@ If the baked decisions themselves contradict each other (e.g., two different lan - **Correctness** — the requirements are technically sound and internally consistent; the problem statement is accurate. - **Feasibility** — implementable within the stated tools and constraints, with no obvious blockers. - **Clarity** — a builder would know what to build; acceptance criteria are testable; terminology is consistent. -- **Structure** — the spec follows the delivered template (`protocols/spir/templates/spec.md`), which the specify prompt inlines. A spec that ignores the template's headings — usually because the builder pattern-matched an older spec in `codev/specs/` — is a defect: `REQUEST_CHANGES` for a wholesale departure (most headings missing or renamed). A single genuinely-inapplicable section reduced to a one-line "N/A — [reason]" with its heading kept is fine, not grounds for `REQUEST_CHANGES`. +- **Structure** — the spec follows the SPIR spec template that the specify prompt inlines. A spec that ignores the template's headings — usually because the builder pattern-matched an older spec in `codev/specs/` — is a defect: `REQUEST_CHANGES` for a wholesale departure (most headings missing or renamed). A single genuinely-inapplicable section reduced to a one-line "N/A — [reason]" with its heading kept is fine, not grounds for `REQUEST_CHANGES`. You are reviewing the specification (WHAT is built), not code or implementation (HOW) — that is the plan and implementation reviews. Be constructive: name the issue and suggest a fix. diff --git a/codev-skeleton/protocols/aspir/protocol.json b/codev-skeleton/protocols/aspir/protocol.json index ccebd2eb3..93019edec 100644 --- a/codev-skeleton/protocols/aspir/protocol.json +++ b/codev-skeleton/protocols/aspir/protocol.json @@ -34,7 +34,7 @@ }, "spec_has_required_sections": { "command": "grep -qF '## Problem Statement' codev/specs/${PROJECT_TITLE}.md && grep -qF '## Current State' codev/specs/${PROJECT_TITLE}.md && grep -qF '## Desired State' codev/specs/${PROJECT_TITLE}.md && grep -qF '## Success Criteria' codev/specs/${PROJECT_TITLE}.md", - "description": "Spec must follow the canonical template delivered by the specify prompt (protocols/spir/templates/spec.md). Required headings: ## Problem Statement, ## Current State, ## Desired State, ## Success Criteria" + "description": "Spec must follow the canonical template the specify prompt inlines. Required headings: ## Problem Statement, ## Current State, ## Desired State, ## Success Criteria" } }, "max_iterations": 3, diff --git a/codev-skeleton/protocols/spir/consult-types/spec-review.md b/codev-skeleton/protocols/spir/consult-types/spec-review.md index 48f0c495b..6f5dc926d 100644 --- a/codev-skeleton/protocols/spir/consult-types/spec-review.md +++ b/codev-skeleton/protocols/spir/consult-types/spec-review.md @@ -16,7 +16,7 @@ If the baked decisions themselves contradict each other (e.g., two different lan - **Correctness** — the requirements are technically sound and internally consistent; the problem statement is accurate. - **Feasibility** — implementable within the stated tools and constraints, with no obvious blockers. - **Clarity** — a builder would know what to build; acceptance criteria are testable; terminology is consistent. -- **Structure** — the spec follows the delivered template (`protocols/spir/templates/spec.md`), which the specify prompt inlines. A spec that ignores the template's headings — usually because the builder pattern-matched an older spec in `codev/specs/` — is a defect: `REQUEST_CHANGES` for a wholesale departure (most headings missing or renamed). A single genuinely-inapplicable section reduced to a one-line "N/A — [reason]" with its heading kept is fine, not grounds for `REQUEST_CHANGES`. +- **Structure** — the spec follows the SPIR spec template that the specify prompt inlines. A spec that ignores the template's headings — usually because the builder pattern-matched an older spec in `codev/specs/` — is a defect: `REQUEST_CHANGES` for a wholesale departure (most headings missing or renamed). A single genuinely-inapplicable section reduced to a one-line "N/A — [reason]" with its heading kept is fine, not grounds for `REQUEST_CHANGES`. You are reviewing the specification (WHAT is built), not code or implementation (HOW) — that is the plan and implementation reviews. Be constructive: name the issue and suggest a fix. diff --git a/codev-skeleton/protocols/spir/protocol.json b/codev-skeleton/protocols/spir/protocol.json index 0e043aa70..758cc262a 100644 --- a/codev-skeleton/protocols/spir/protocol.json +++ b/codev-skeleton/protocols/spir/protocol.json @@ -35,7 +35,7 @@ }, "spec_has_required_sections": { "command": "grep -qF '## Problem Statement' codev/specs/${PROJECT_TITLE}.md && grep -qF '## Current State' codev/specs/${PROJECT_TITLE}.md && grep -qF '## Desired State' codev/specs/${PROJECT_TITLE}.md && grep -qF '## Success Criteria' codev/specs/${PROJECT_TITLE}.md", - "description": "Spec must follow the canonical template delivered by the specify prompt (protocols/spir/templates/spec.md). Required headings: ## Problem Statement, ## Current State, ## Desired State, ## Success Criteria" + "description": "Spec must follow the canonical template the specify prompt inlines. Required headings: ## Problem Statement, ## Current State, ## Desired State, ## Success Criteria" } }, "max_iterations": 3, diff --git a/codev-skeleton/roles/architect.md b/codev-skeleton/roles/architect.md index cf9162ef7..39bed7710 100644 --- a/codev-skeleton/roles/architect.md +++ b/codev-skeleton/roles/architect.md @@ -96,6 +96,7 @@ regardless of what the tests say. - Run `afx` commands only from the main workspace root, never from inside a builder worktree — spawning from a worktree nests builders and breaks the workspace. - **Use PR comments for anything long** — `afx send` is for short messages. - **Let builders own their work** — guide, don't take over. +- **Finding files.** Never search from the filesystem root (`find /`, a whole-drive search): search within the project directory or use your built-in file search tools. A framework file (protocol, prompt, template, role) that is not in the project is delivered to you another way, so do not go looking for it. - **Make sure the issue closes when the PR merges.** The PR body's `Fixes #` / `Closes #` closes it on merge; close it yourself when no keyword did (a partial fix, a forge without close keywords). Builders never close issues by hand. diff --git a/codev-skeleton/roles/builder.md b/codev-skeleton/roles/builder.md index cd38e2d26..b28a08fb8 100644 --- a/codev-skeleton/roles/builder.md +++ b/codev-skeleton/roles/builder.md @@ -109,6 +109,10 @@ reads succeed, writes succeed, and nothing corrects you until a later `git add` - In Bash, prefer relative paths — `cwd` is your worktree, so a relative path cannot be anchored to the wrong root. +## Finding files + +Never search from the filesystem root (`find /`, a whole-drive search): search within the project directory or use your built-in file search tools. A framework file (protocol, prompt, template, role) that is not in the project is delivered to you another way, so do not go looking for it. + ## Scope Build what the spec says. If part of it is blocked, finish everything else and say plainly what diff --git a/codev-skeleton/templates/AGENTS.md b/codev-skeleton/templates/AGENTS.md index 4f0bd80dc..e9a59796a 100644 --- a/codev-skeleton/templates/AGENTS.md +++ b/codev-skeleton/templates/AGENTS.md @@ -24,15 +24,15 @@ This project uses **Codev** for AI-assisted development. ## Available Protocols -- **SPIR**: Multi-phase development with consultation (`codev/protocols/spir/protocol.md`) -- **ASPIR**: Autonomous SPIR — no human gates on spec/plan (`codev/protocols/aspir/protocol.md`) -- **AIR**: Autonomous Implement & Review for small features (`codev/protocols/air/protocol.md`) -- **BUGFIX**: Bug fixes from GitHub issues (`codev/protocols/bugfix/protocol.md`) -- **PIR**: Plan / Implement / Review — issue-driven with three human gates (plan-approval, dev-approval, pr) (`codev/protocols/pir/protocol.md`) -- **EXPERIMENT**: Disciplined experimentation (`codev/protocols/experiment/protocol.md`) -- **MAINTAIN**: Codebase maintenance (`codev/protocols/maintain/protocol.md`) -- **RESEARCH**: Multi-agent research with 3-way investigation, synthesis, and critique (`codev/protocols/research/protocol.md`) -- **SPIKE**: Time-boxed feasibility investigation — findings, not shipped code (`codev/protocols/spike/protocol.md`) +- **SPIR**: Multi-phase development with consultation +- **ASPIR**: Autonomous SPIR — no human gates on spec/plan +- **AIR**: Autonomous Implement & Review for small features +- **BUGFIX**: Bug fixes from GitHub issues +- **PIR**: Plan / Implement / Review — issue-driven with three human gates (plan-approval, dev-approval, pr) +- **EXPERIMENT**: Disciplined experimentation +- **MAINTAIN**: Codebase maintenance +- **RESEARCH**: Multi-agent research with 3-way investigation, synthesis, and critique +- **SPIKE**: Time-boxed feasibility investigation — findings, not shipped code ## File Resolution (How Codev Finds Protocols and Templates) @@ -45,6 +45,8 @@ Codev resolves protocol files, prompts, agent definitions, and roles through a f **The absence of `codev/protocols//` on disk is not a missing reference** — it's the normal case for any protocol you haven't customized. The protocol resolves from the installed package's skeleton at runtime. Only protocols you want to customize need to live in your repo's `codev/protocols/`. +**Finding files:** Never search from the filesystem root (`find /`, a whole-drive search): search within the project directory or use your built-in file search tools. A framework file (protocol, prompt, template, role) that is not in the project is delivered to you another way, so do not go looking for it. + **Implication for `codev update` and CLAUDE.md / AGENTS.md merges:** when an updated template references a protocol, do NOT drop the reference because `codev/protocols//` is absent locally. The protocol resolves via the package skeleton, and dropping the reference removes it from your available-protocol list while it's still callable from the CLI. ## Protocol Names You Don't Recognize @@ -157,4 +159,4 @@ Agent Farm is configured via `.codev/config.json` at the project root. Created d ## For More Info -Read the full protocol documentation in `codev/protocols/`. +Porch and `afx spawn` give each agent the full text of the protocol it is running. diff --git a/codev-skeleton/templates/CLAUDE.md b/codev-skeleton/templates/CLAUDE.md index 76bbf4ef2..00f6f2296 100644 --- a/codev-skeleton/templates/CLAUDE.md +++ b/codev-skeleton/templates/CLAUDE.md @@ -22,15 +22,15 @@ This project uses **Codev** for AI-assisted development. ## Available Protocols -- **SPIR**: Multi-phase development with consultation (`codev/protocols/spir/protocol.md`) -- **ASPIR**: Autonomous SPIR — no human gates on spec/plan (`codev/protocols/aspir/protocol.md`) -- **AIR**: Autonomous Implement & Review for small features (`codev/protocols/air/protocol.md`) -- **BUGFIX**: Bug fixes from GitHub issues (`codev/protocols/bugfix/protocol.md`) -- **PIR**: Plan / Implement / Review — issue-driven with three human gates (plan-approval, dev-approval, pr) (`codev/protocols/pir/protocol.md`) -- **EXPERIMENT**: Disciplined experimentation (`codev/protocols/experiment/protocol.md`) -- **MAINTAIN**: Codebase maintenance (`codev/protocols/maintain/protocol.md`) -- **RESEARCH**: Multi-agent research with 3-way investigation, synthesis, and critique (`codev/protocols/research/protocol.md`) -- **SPIKE**: Time-boxed feasibility investigation — findings, not shipped code (`codev/protocols/spike/protocol.md`) +- **SPIR**: Multi-phase development with consultation +- **ASPIR**: Autonomous SPIR — no human gates on spec/plan +- **AIR**: Autonomous Implement & Review for small features +- **BUGFIX**: Bug fixes from GitHub issues +- **PIR**: Plan / Implement / Review — issue-driven with three human gates (plan-approval, dev-approval, pr) +- **EXPERIMENT**: Disciplined experimentation +- **MAINTAIN**: Codebase maintenance +- **RESEARCH**: Multi-agent research with 3-way investigation, synthesis, and critique +- **SPIKE**: Time-boxed feasibility investigation — findings, not shipped code ## File Resolution (How Codev Finds Protocols and Templates) @@ -43,6 +43,8 @@ Codev resolves protocol files, prompts, agent definitions, and roles through a f **The absence of `codev/protocols//` on disk is not a missing reference** — it's the normal case for any protocol you haven't customized. The protocol resolves from the installed package's skeleton at runtime. Only protocols you want to customize need to live in your repo's `codev/protocols/`. +**Finding files:** Never search from the filesystem root (`find /`, a whole-drive search): search within the project directory or use your built-in file search tools. A framework file (protocol, prompt, template, role) that is not in the project is delivered to you another way, so do not go looking for it. + **Implication for `codev update` and CLAUDE.md / AGENTS.md merges:** when an updated template references a protocol, do NOT drop the reference because `codev/protocols//` is absent locally. The protocol resolves via the package skeleton, and dropping the reference removes it from your available-protocol list while it's still callable from the CLI. ## Protocol Names You Don't Recognize @@ -155,4 +157,4 @@ Agent Farm is configured via `.codev/config.json` at the project root. Created d ## For More Info -Read the full protocol documentation in `codev/protocols/`. +Porch and `afx spawn` give each agent the full text of the protocol it is running. diff --git a/codev/projects/bugfix-1910-prompts-name-framework-paths-t/status.yaml b/codev/projects/bugfix-1910-prompts-name-framework-paths-t/status.yaml new file mode 100644 index 000000000..cfc93c102 --- /dev/null +++ b/codev/projects/bugfix-1910-prompts-name-framework-paths-t/status.yaml @@ -0,0 +1,16 @@ +id: bugfix-1910 +title: prompts-name-framework-paths-t +protocol: bugfix +phase: pr +plan_phases: [] +current_plan_phase: null +gates: + pr: + status: pending + requested_at: '2026-11-22T23:54:03.751Z' +iteration: 1 +build_complete: false +history: [] +started_at: '2026-11-22T23:29:54.501Z' +updated_at: '2026-11-22T23:54:03.752Z' +pr_ready_for_human: true diff --git a/codev/protocols/aspir/consult-types/spec-review.md b/codev/protocols/aspir/consult-types/spec-review.md index 4eba02a0d..349916716 100644 --- a/codev/protocols/aspir/consult-types/spec-review.md +++ b/codev/protocols/aspir/consult-types/spec-review.md @@ -16,7 +16,7 @@ If the baked decisions themselves contradict each other (e.g., two different lan - **Correctness** — the requirements are technically sound and internally consistent; the problem statement is accurate. - **Feasibility** — implementable within the stated tools and constraints, with no obvious blockers. - **Clarity** — a builder would know what to build; acceptance criteria are testable; terminology is consistent. -- **Structure** — the spec follows the delivered template (`protocols/spir/templates/spec.md`), which the specify prompt inlines. A spec that ignores the template's headings — usually because the builder pattern-matched an older spec in `codev/specs/` — is a defect: `REQUEST_CHANGES` for a wholesale departure (most headings missing or renamed). A single genuinely-inapplicable section reduced to a one-line "N/A — [reason]" with its heading kept is fine, not grounds for `REQUEST_CHANGES`. +- **Structure** — the spec follows the SPIR spec template that the specify prompt inlines. A spec that ignores the template's headings — usually because the builder pattern-matched an older spec in `codev/specs/` — is a defect: `REQUEST_CHANGES` for a wholesale departure (most headings missing or renamed). A single genuinely-inapplicable section reduced to a one-line "N/A — [reason]" with its heading kept is fine, not grounds for `REQUEST_CHANGES`. You are reviewing the specification (WHAT is built), not code or implementation (HOW) — that is the plan and implementation reviews. Be constructive: name the issue and suggest a fix. diff --git a/codev/protocols/aspir/protocol.json b/codev/protocols/aspir/protocol.json index ccebd2eb3..93019edec 100644 --- a/codev/protocols/aspir/protocol.json +++ b/codev/protocols/aspir/protocol.json @@ -34,7 +34,7 @@ }, "spec_has_required_sections": { "command": "grep -qF '## Problem Statement' codev/specs/${PROJECT_TITLE}.md && grep -qF '## Current State' codev/specs/${PROJECT_TITLE}.md && grep -qF '## Desired State' codev/specs/${PROJECT_TITLE}.md && grep -qF '## Success Criteria' codev/specs/${PROJECT_TITLE}.md", - "description": "Spec must follow the canonical template delivered by the specify prompt (protocols/spir/templates/spec.md). Required headings: ## Problem Statement, ## Current State, ## Desired State, ## Success Criteria" + "description": "Spec must follow the canonical template the specify prompt inlines. Required headings: ## Problem Statement, ## Current State, ## Desired State, ## Success Criteria" } }, "max_iterations": 3, diff --git a/codev/protocols/spir/consult-types/spec-review.md b/codev/protocols/spir/consult-types/spec-review.md index 48f0c495b..6f5dc926d 100644 --- a/codev/protocols/spir/consult-types/spec-review.md +++ b/codev/protocols/spir/consult-types/spec-review.md @@ -16,7 +16,7 @@ If the baked decisions themselves contradict each other (e.g., two different lan - **Correctness** — the requirements are technically sound and internally consistent; the problem statement is accurate. - **Feasibility** — implementable within the stated tools and constraints, with no obvious blockers. - **Clarity** — a builder would know what to build; acceptance criteria are testable; terminology is consistent. -- **Structure** — the spec follows the delivered template (`protocols/spir/templates/spec.md`), which the specify prompt inlines. A spec that ignores the template's headings — usually because the builder pattern-matched an older spec in `codev/specs/` — is a defect: `REQUEST_CHANGES` for a wholesale departure (most headings missing or renamed). A single genuinely-inapplicable section reduced to a one-line "N/A — [reason]" with its heading kept is fine, not grounds for `REQUEST_CHANGES`. +- **Structure** — the spec follows the SPIR spec template that the specify prompt inlines. A spec that ignores the template's headings — usually because the builder pattern-matched an older spec in `codev/specs/` — is a defect: `REQUEST_CHANGES` for a wholesale departure (most headings missing or renamed). A single genuinely-inapplicable section reduced to a one-line "N/A — [reason]" with its heading kept is fine, not grounds for `REQUEST_CHANGES`. You are reviewing the specification (WHAT is built), not code or implementation (HOW) — that is the plan and implementation reviews. Be constructive: name the issue and suggest a fix. diff --git a/codev/protocols/spir/protocol.json b/codev/protocols/spir/protocol.json index 0e043aa70..758cc262a 100644 --- a/codev/protocols/spir/protocol.json +++ b/codev/protocols/spir/protocol.json @@ -35,7 +35,7 @@ }, "spec_has_required_sections": { "command": "grep -qF '## Problem Statement' codev/specs/${PROJECT_TITLE}.md && grep -qF '## Current State' codev/specs/${PROJECT_TITLE}.md && grep -qF '## Desired State' codev/specs/${PROJECT_TITLE}.md && grep -qF '## Success Criteria' codev/specs/${PROJECT_TITLE}.md", - "description": "Spec must follow the canonical template delivered by the specify prompt (protocols/spir/templates/spec.md). Required headings: ## Problem Statement, ## Current State, ## Desired State, ## Success Criteria" + "description": "Spec must follow the canonical template the specify prompt inlines. Required headings: ## Problem Statement, ## Current State, ## Desired State, ## Success Criteria" } }, "max_iterations": 3, diff --git a/codev/resources/1280-retirements.md b/codev/resources/1280-retirements.md index 1ceb2ad01..5a7ea192e 100644 --- a/codev/resources/1280-retirements.md +++ b/codev/resources/1280-retirements.md @@ -472,3 +472,30 @@ pre-existing flakiness". 2. **Guard kept, not retired.** Only the baselines move. 3. **Audit trail.** This entry and `bugfix-1902-prompt-sweep.test.ts`, which asserts no agent-facing file (PIR included) tells a builder to skip a flaky test. + +## R9 — re-baseline spir/aspir spec-review.md for Bugfix #1910 (framework path named by location) + +**Status: APPROVED by the owner, 2026-11-23, for issue #1910 (relayed by the architect, main). Applied +in PR #1949.** + +| | | +|---|---| +| **Assertion** | `spec-1280-prompt-deletion-guard.test.ts` → *"no baseline line has been deleted"* (kept, not retired) | +| **Files (2)** | `codev/protocols/{spir,aspir}/consult-types/spec-review.md` | +| **Originating issue** | #1910 (Spec 1658 finding M14) | +| **Baselines** | `fixtures/spec-1280-baselines/{spir,aspir}-spec-review.md.baseline`, re-captured | + +### What was removed + +One line per file, the Structure bullet, replaced in place. "the spec follows the delivered +template (`protocols/spir/templates/spec.md`), which the specify prompt inlines" now reads "the +spec follows the SPIR spec template that the specify prompt inlines". In an adopter workspace that +path exists only inside the installed package, so a reviewer that read it literally searched the +disk for it. + +### Class-invariant compliance + +1. **Behaviour grep green.** Both keep `Baked Decisions` and `do not autonomously`; mirror parity + holds. +2. **Guard kept, not retired.** Only the baselines move. +3. **Audit trail.** This entry and `bugfix-1910-framework-paths.test.ts`. diff --git a/codev/roles/architect.md b/codev/roles/architect.md index cf9162ef7..39bed7710 100644 --- a/codev/roles/architect.md +++ b/codev/roles/architect.md @@ -96,6 +96,7 @@ regardless of what the tests say. - Run `afx` commands only from the main workspace root, never from inside a builder worktree — spawning from a worktree nests builders and breaks the workspace. - **Use PR comments for anything long** — `afx send` is for short messages. - **Let builders own their work** — guide, don't take over. +- **Finding files.** Never search from the filesystem root (`find /`, a whole-drive search): search within the project directory or use your built-in file search tools. A framework file (protocol, prompt, template, role) that is not in the project is delivered to you another way, so do not go looking for it. - **Make sure the issue closes when the PR merges.** The PR body's `Fixes #` / `Closes #` closes it on merge; close it yourself when no keyword did (a partial fix, a forge without close keywords). Builders never close issues by hand. diff --git a/codev/roles/builder.md b/codev/roles/builder.md index cd38e2d26..b28a08fb8 100644 --- a/codev/roles/builder.md +++ b/codev/roles/builder.md @@ -109,6 +109,10 @@ reads succeed, writes succeed, and nothing corrects you until a later `git add` - In Bash, prefer relative paths — `cwd` is your worktree, so a relative path cannot be anchored to the wrong root. +## Finding files + +Never search from the filesystem root (`find /`, a whole-drive search): search within the project directory or use your built-in file search tools. A framework file (protocol, prompt, template, role) that is not in the project is delivered to you another way, so do not go looking for it. + ## Scope Build what the spec says. If part of it is blocked, finish everything else and say plainly what diff --git a/codev/state/bugfix-1910_thread.md b/codev/state/bugfix-1910_thread.md new file mode 100644 index 000000000..86fb1e137 --- /dev/null +++ b/codev/state/bugfix-1910_thread.md @@ -0,0 +1,57 @@ +# bugfix-1910 thread + +## Investigate (2026-11-23) + +- Reproduced by grep: shipped text names framework files by location (`protocols/spir/templates/spec.md`, + `codev/protocols//protocol.md`, `../protocols/spir/protocol.md`, `codev/roles/.md`). In an + adopter workspace those resolve from the installed package and are not on disk, so an agent that + reads them literally searches for them (`find /` on Windows — Spec 1658 M14). +- Architect scope (2026-11-22): cause 1 only (wording); cause 2 (orphaned children on Windows) is #1915. + Re-grep both trees, not just the issue's list. +- Sites beyond the issue's list: `resources/workflow-reference.md`, `resources/commands/overview.md`, + `resources/commands/consult.md`, `resources/risk-triage.md` (both trees). They are framework + files `codev update` treats as updatable. + +## Fix + +- Reworded every site in both trees; CLAUDE.md/AGENTS.md templates keep their shared body and the + two trees stay byte-identical. +- The spec-review edit trips the Spec 1280 deletion guard by design: re-baselined the two + spec-review fixtures and logged R9 in `codev/resources/1280-retirements.md`. +- `framework-ref-audit.ts` comment called the protocol-path list "intentional"; corrected. +- New guard: `packages/codev/src/__tests__/bugfix-1910-framework-paths.test.ts`. + +## PR #1949 — CMAP iter 1 + +- gemini: skipped (agy CLI not installed on this host, non-blocking). codex: APPROVE. +- claude: REQUEST_CHANGES, all valid. The templates still ended with "Read the full protocol + documentation in `codev/protocols/`" (and three cheatsheet copies), which contradicted the new + line. The guard missed directory and `` forms, and it allowed any line containing + the word "local". Fixed: reworded those sites, the templates' Key Locations line, consult.md's + prompt-load sentence and the consult SKILL line (all four copies). The guard now flags any + `codev/protocols|roles/` mention unless the line explains customization or resolution, or is a + risk-triage table row. + +## Owner scope addition (2026-11-22, via architect) + +- Added one rule, worded the same everywhere: never search from the filesystem root; search the + project or use built-in file search; a framework file not in the project is delivered another + way. Placed in builder.md (new "Finding files" section), architect.md (Boundaries), + consultant.md (File Access Rules) and the CLAUDE/AGENTS templates (File Resolution), both + trees. The guard test pins it. +- The second full run caught the consult SKILL edit against the shipped-skill hash history. + Regenerated with `generate-skill-hashes`. + +## Trim (2026-11-23, owner review of the PR) + +- The owner judged the PR too broad, and agreed that resolver jargon ("through the four-tier lookup") and + disclaimers ("delivered content, not a file to look for") add nothing an agent can act on. + The four-tier wording partly existed to satisfy the guard's keyword allow-list, which is a smell. +- Reverted to main: the consult skill (4 copies) and shipped-skill-hashes.ts, consult.md, + overview.md, workflow-reference.md, risk-triage.md, the cheatsheets, the consultant role, and + the templates' Key Locations line. +- Kept: the issue's sites (plain wording), the templates' protocol list and closing line, and the + owner's rule in the builder/architect roles and the CLAUDE/AGENTS templates (the owner named + templates). The keyword-allow-list guard is replaced by a short test that pins the exact sites. +- R9 is marked as needing the owner's sign-off at the gate (R7/R8 were architect-approved + before they were applied; this one was not). diff --git a/codev/templates/AGENTS.md b/codev/templates/AGENTS.md index 4f0bd80dc..e9a59796a 100644 --- a/codev/templates/AGENTS.md +++ b/codev/templates/AGENTS.md @@ -24,15 +24,15 @@ This project uses **Codev** for AI-assisted development. ## Available Protocols -- **SPIR**: Multi-phase development with consultation (`codev/protocols/spir/protocol.md`) -- **ASPIR**: Autonomous SPIR — no human gates on spec/plan (`codev/protocols/aspir/protocol.md`) -- **AIR**: Autonomous Implement & Review for small features (`codev/protocols/air/protocol.md`) -- **BUGFIX**: Bug fixes from GitHub issues (`codev/protocols/bugfix/protocol.md`) -- **PIR**: Plan / Implement / Review — issue-driven with three human gates (plan-approval, dev-approval, pr) (`codev/protocols/pir/protocol.md`) -- **EXPERIMENT**: Disciplined experimentation (`codev/protocols/experiment/protocol.md`) -- **MAINTAIN**: Codebase maintenance (`codev/protocols/maintain/protocol.md`) -- **RESEARCH**: Multi-agent research with 3-way investigation, synthesis, and critique (`codev/protocols/research/protocol.md`) -- **SPIKE**: Time-boxed feasibility investigation — findings, not shipped code (`codev/protocols/spike/protocol.md`) +- **SPIR**: Multi-phase development with consultation +- **ASPIR**: Autonomous SPIR — no human gates on spec/plan +- **AIR**: Autonomous Implement & Review for small features +- **BUGFIX**: Bug fixes from GitHub issues +- **PIR**: Plan / Implement / Review — issue-driven with three human gates (plan-approval, dev-approval, pr) +- **EXPERIMENT**: Disciplined experimentation +- **MAINTAIN**: Codebase maintenance +- **RESEARCH**: Multi-agent research with 3-way investigation, synthesis, and critique +- **SPIKE**: Time-boxed feasibility investigation — findings, not shipped code ## File Resolution (How Codev Finds Protocols and Templates) @@ -45,6 +45,8 @@ Codev resolves protocol files, prompts, agent definitions, and roles through a f **The absence of `codev/protocols//` on disk is not a missing reference** — it's the normal case for any protocol you haven't customized. The protocol resolves from the installed package's skeleton at runtime. Only protocols you want to customize need to live in your repo's `codev/protocols/`. +**Finding files:** Never search from the filesystem root (`find /`, a whole-drive search): search within the project directory or use your built-in file search tools. A framework file (protocol, prompt, template, role) that is not in the project is delivered to you another way, so do not go looking for it. + **Implication for `codev update` and CLAUDE.md / AGENTS.md merges:** when an updated template references a protocol, do NOT drop the reference because `codev/protocols//` is absent locally. The protocol resolves via the package skeleton, and dropping the reference removes it from your available-protocol list while it's still callable from the CLI. ## Protocol Names You Don't Recognize @@ -157,4 +159,4 @@ Agent Farm is configured via `.codev/config.json` at the project root. Created d ## For More Info -Read the full protocol documentation in `codev/protocols/`. +Porch and `afx spawn` give each agent the full text of the protocol it is running. diff --git a/codev/templates/CLAUDE.md b/codev/templates/CLAUDE.md index 76bbf4ef2..00f6f2296 100644 --- a/codev/templates/CLAUDE.md +++ b/codev/templates/CLAUDE.md @@ -22,15 +22,15 @@ This project uses **Codev** for AI-assisted development. ## Available Protocols -- **SPIR**: Multi-phase development with consultation (`codev/protocols/spir/protocol.md`) -- **ASPIR**: Autonomous SPIR — no human gates on spec/plan (`codev/protocols/aspir/protocol.md`) -- **AIR**: Autonomous Implement & Review for small features (`codev/protocols/air/protocol.md`) -- **BUGFIX**: Bug fixes from GitHub issues (`codev/protocols/bugfix/protocol.md`) -- **PIR**: Plan / Implement / Review — issue-driven with three human gates (plan-approval, dev-approval, pr) (`codev/protocols/pir/protocol.md`) -- **EXPERIMENT**: Disciplined experimentation (`codev/protocols/experiment/protocol.md`) -- **MAINTAIN**: Codebase maintenance (`codev/protocols/maintain/protocol.md`) -- **RESEARCH**: Multi-agent research with 3-way investigation, synthesis, and critique (`codev/protocols/research/protocol.md`) -- **SPIKE**: Time-boxed feasibility investigation — findings, not shipped code (`codev/protocols/spike/protocol.md`) +- **SPIR**: Multi-phase development with consultation +- **ASPIR**: Autonomous SPIR — no human gates on spec/plan +- **AIR**: Autonomous Implement & Review for small features +- **BUGFIX**: Bug fixes from GitHub issues +- **PIR**: Plan / Implement / Review — issue-driven with three human gates (plan-approval, dev-approval, pr) +- **EXPERIMENT**: Disciplined experimentation +- **MAINTAIN**: Codebase maintenance +- **RESEARCH**: Multi-agent research with 3-way investigation, synthesis, and critique +- **SPIKE**: Time-boxed feasibility investigation — findings, not shipped code ## File Resolution (How Codev Finds Protocols and Templates) @@ -43,6 +43,8 @@ Codev resolves protocol files, prompts, agent definitions, and roles through a f **The absence of `codev/protocols//` on disk is not a missing reference** — it's the normal case for any protocol you haven't customized. The protocol resolves from the installed package's skeleton at runtime. Only protocols you want to customize need to live in your repo's `codev/protocols/`. +**Finding files:** Never search from the filesystem root (`find /`, a whole-drive search): search within the project directory or use your built-in file search tools. A framework file (protocol, prompt, template, role) that is not in the project is delivered to you another way, so do not go looking for it. + **Implication for `codev update` and CLAUDE.md / AGENTS.md merges:** when an updated template references a protocol, do NOT drop the reference because `codev/protocols//` is absent locally. The protocol resolves via the package skeleton, and dropping the reference removes it from your available-protocol list while it's still callable from the CLI. ## Protocol Names You Don't Recognize @@ -155,4 +157,4 @@ Agent Farm is configured via `.codev/config.json` at the project root. Created d ## For More Info -Read the full protocol documentation in `codev/protocols/`. +Porch and `afx spawn` give each agent the full text of the protocol it is running. diff --git a/packages/codev/src/__tests__/bugfix-1910-framework-paths.test.ts b/packages/codev/src/__tests__/bugfix-1910-framework-paths.test.ts new file mode 100644 index 000000000..6b91d1f5c --- /dev/null +++ b/packages/codev/src/__tests__/bugfix-1910-framework-paths.test.ts @@ -0,0 +1,42 @@ +/** + * Regression guard for cluesmith/codev#1910: shipped text named framework files by an on-disk + * path that adopter workspaces do not have (the files live only in the installed package), and + * agents searched the disk for them with `find /`. + * + * Pins the sites the issue found, in both trees, and the owner's rule that agents never search + * from the filesystem root. + */ +import { describe, it, expect } from 'vitest'; +import * as fs from 'node:fs'; +import * as path from 'node:path'; + +const repoRoot = path.resolve(import.meta.dirname, '../../../..'); +const read = (rel: string) => fs.readFileSync(path.join(repoRoot, rel), 'utf-8'); +const TREES = ['codev-skeleton', 'codev']; + +/** An on-disk framework path that is not a `{{> … }}` resolver include. */ +const linesNamingPath = (body: string, re: RegExp) => + body.split('\n').filter((l) => re.test(l) && !/\{\{>/.test(l)).map((l) => l.trim()); + +describe.each(TREES)('#1910 (%s)', (tree) => { + it.each(['spir', 'aspir'])('%s spec-review.md and protocol.json do not name the spec template path', (p) => { + for (const f of [`protocols/${p}/consult-types/spec-review.md`, `protocols/${p}/protocol.json`]) { + expect(linesNamingPath(read(`${tree}/${f}`), /protocols\/spir\/templates\/spec\.md/), f).toEqual([]); + } + }); + + it.each(['CLAUDE.md', 'AGENTS.md'])('templates/%s does not point at codev/protocols/ for protocol text', (t) => { + const body = read(`${tree}/templates/${t}`); + expect(linesNamingPath(body, /codev\/protocols\/[a-z]+\/protocol\.md/)).toEqual([]); + expect(body).not.toContain('Read the full protocol documentation in `codev/protocols/`'); + }); + + it.each(['roles/builder.md', 'roles/architect.md', 'templates/CLAUDE.md', 'templates/AGENTS.md'])( + '%s says never to search from the filesystem root (owner ruling)', + (f) => { + const body = read(`${tree}/${f}`); + expect(body).toContain('Never search from the filesystem root'); + expect(body).toContain('is delivered to you another way, so do not go looking for it'); + }, + ); +}); diff --git a/packages/codev/src/__tests__/fixtures/spec-1280-baselines/aspir-spec-review.md.baseline b/packages/codev/src/__tests__/fixtures/spec-1280-baselines/aspir-spec-review.md.baseline index 4eba02a0d..349916716 100644 --- a/packages/codev/src/__tests__/fixtures/spec-1280-baselines/aspir-spec-review.md.baseline +++ b/packages/codev/src/__tests__/fixtures/spec-1280-baselines/aspir-spec-review.md.baseline @@ -16,7 +16,7 @@ If the baked decisions themselves contradict each other (e.g., two different lan - **Correctness** — the requirements are technically sound and internally consistent; the problem statement is accurate. - **Feasibility** — implementable within the stated tools and constraints, with no obvious blockers. - **Clarity** — a builder would know what to build; acceptance criteria are testable; terminology is consistent. -- **Structure** — the spec follows the delivered template (`protocols/spir/templates/spec.md`), which the specify prompt inlines. A spec that ignores the template's headings — usually because the builder pattern-matched an older spec in `codev/specs/` — is a defect: `REQUEST_CHANGES` for a wholesale departure (most headings missing or renamed). A single genuinely-inapplicable section reduced to a one-line "N/A — [reason]" with its heading kept is fine, not grounds for `REQUEST_CHANGES`. +- **Structure** — the spec follows the SPIR spec template that the specify prompt inlines. A spec that ignores the template's headings — usually because the builder pattern-matched an older spec in `codev/specs/` — is a defect: `REQUEST_CHANGES` for a wholesale departure (most headings missing or renamed). A single genuinely-inapplicable section reduced to a one-line "N/A — [reason]" with its heading kept is fine, not grounds for `REQUEST_CHANGES`. You are reviewing the specification (WHAT is built), not code or implementation (HOW) — that is the plan and implementation reviews. Be constructive: name the issue and suggest a fix. diff --git a/packages/codev/src/__tests__/fixtures/spec-1280-baselines/spir-spec-review.md.baseline b/packages/codev/src/__tests__/fixtures/spec-1280-baselines/spir-spec-review.md.baseline index 48f0c495b..6f5dc926d 100644 --- a/packages/codev/src/__tests__/fixtures/spec-1280-baselines/spir-spec-review.md.baseline +++ b/packages/codev/src/__tests__/fixtures/spec-1280-baselines/spir-spec-review.md.baseline @@ -16,7 +16,7 @@ If the baked decisions themselves contradict each other (e.g., two different lan - **Correctness** — the requirements are technically sound and internally consistent; the problem statement is accurate. - **Feasibility** — implementable within the stated tools and constraints, with no obvious blockers. - **Clarity** — a builder would know what to build; acceptance criteria are testable; terminology is consistent. -- **Structure** — the spec follows the delivered template (`protocols/spir/templates/spec.md`), which the specify prompt inlines. A spec that ignores the template's headings — usually because the builder pattern-matched an older spec in `codev/specs/` — is a defect: `REQUEST_CHANGES` for a wholesale departure (most headings missing or renamed). A single genuinely-inapplicable section reduced to a one-line "N/A — [reason]" with its heading kept is fine, not grounds for `REQUEST_CHANGES`. +- **Structure** — the spec follows the SPIR spec template that the specify prompt inlines. A spec that ignores the template's headings — usually because the builder pattern-matched an older spec in `codev/specs/` — is a defect: `REQUEST_CHANGES` for a wholesale departure (most headings missing or renamed). A single genuinely-inapplicable section reduced to a one-line "N/A — [reason]" with its heading kept is fine, not grounds for `REQUEST_CHANGES`. You are reviewing the specification (WHAT is built), not code or implementation (HOW) — that is the plan and implementation reviews. Be constructive: name the issue and suggest a fix. diff --git a/packages/codev/src/lib/framework-ref-audit.ts b/packages/codev/src/lib/framework-ref-audit.ts index bb49557a3..e25468d14 100644 --- a/packages/codev/src/lib/framework-ref-audit.ts +++ b/packages/codev/src/lib/framework-ref-audit.ts @@ -23,8 +23,7 @@ * user-evolved files (`arch.md`, `lessons-learned.md`) that builders and * architects reference and write by path legitimately. * - Plain documentation references (backtick mentions, "see codev/…") are - * NOT flagged. The rule is about *fetching*, not *referencing* — the - * protocol list in CLAUDE.md/AGENTS.md, for example, is intentional. + * NOT flagged. The rule is about *fetching*, not *referencing*. */ import { existsSync, readdirSync, readFileSync } from 'node:fs'; import { join, relative } from 'node:path';