contract-driven-delivery 2.0.2 → 2.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,239 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.0.7] - 2026-05-04
4
+
5
+ Comprehensive cross-consistency audit fixes. Targets the #1 root cause of
6
+ agent ↔ gate friction: prompts that teach a format the gate cannot recognize.
7
+ All 12 drifts surfaced by an opus-model audit are addressed; new gate
8
+ enforcement is added where prompts described policy that was previously
9
+ documented-only.
10
+
11
+ ### Fixed (BLOCKING)
12
+
13
+ - **CER pending detection**: gate now correctly recognises Context Expansion
14
+ Requests written by `cdd-kit context request`. Previously the regex
15
+ required `-` immediately before `status:`, but the canonical writer puts
16
+ `status:` on its own indented line — every real-world pending CER was
17
+ silently bypassed. Replaced with a per-block parser mirroring
18
+ `src/commands/context.ts`.
19
+ - **`pointer: "n/a (...)"` false rejection**: gate skips path-existence checks
20
+ for pointers starting with `n/a` (case-insensitive). Previously, a natural
21
+ reason text like `"n/a (no contracts/ files touched)"` was treated as a
22
+ path because of the `/` and produced a spurious "artifact pointer not
23
+ found" error.
24
+ - **Per-agent `model:` policy drift**: synced `.cdd/model-policy.json` with
25
+ the actual `model:` frontmatter on three agent prompts (spec-drift-auditor,
26
+ visual-reviewer, repo-context-scanner). `cdd-kit doctor` no longer emits
27
+ drift warnings for these three. Same fix applied to the doctor `--fix`
28
+ defaults so newly-initialized projects start in sync.
29
+ - **4 review agents had no `## Read scope`**: dependency-security-reviewer,
30
+ spec-drift-auditor, ui-ux-reviewer, visual-reviewer now point at
31
+ `context-manifest.md → ## Allowed Paths`, matching the 10 already-scoped
32
+ agents. Each prompt also lists the agent's typical extra reads (lockfiles,
33
+ screenshots, contracts) so users know what to add to the manifest up
34
+ front.
35
+ - **qa-reviewer code-map discipline check**: now lists the full extension set
36
+ `(.py, .js, .jsx, .mjs, .cjs, .ts, .tsx, .vue)` instead of the 2.0.5
37
+ three-extension subset that effectively disabled the check on TS-heavy
38
+ repos.
39
+
40
+ ### Fixed (RISK)
41
+
42
+ - **`.cdd/code-map-config.yml` errors surface in gate / doctor**: a malformed
43
+ config no longer silently degrades to "greenfield". `freshness.ts` returns
44
+ a `config-error` status and gate emits a hard error; doctor reports it as
45
+ a warning.
46
+ - **`next-action` validation tightened**: gate now rejects placeholder values
47
+ the agent-log-protocol already disallowed (`tbd`, `n/a`, `investigate`,
48
+ `unknown`, `todo`) — previously only `none` was rejected.
49
+ - **Allowed-Paths glob grammar upgraded to picomatch**: patterns like
50
+ `src/**/*.ts`, `lib/{a,b}/**`, `?(...)` now match correctly. The previous
51
+ hand-rolled matcher only supported trailing `/**` and `/*`. Special
52
+ `specs/changes/*` exception preserved.
53
+ - **Engineer agent prompts (`backend-engineer`, `frontend-engineer`) now
54
+ list `.mjs` and `.cjs`** in the code-map "READ FIRST" extension list,
55
+ matching `BUILTIN_INCLUDE` and `references/code-map-protocol.md`.
56
+ - **`change-classification.md` template aligned with classifier output**:
57
+ added the `## Inferred Acceptance Criteria` and `## Tasks Not Applicable`
58
+ sections; renamed `## Required Test Families` → `## Required Tests` and
59
+ `## Assumptions / Clarifications` → `## Clarifications or Assumptions`
60
+ to match what `change-classifier` actually produces.
61
+ - **`.claude/worktrees/` added to all agent forbidden lists** to match
62
+ `.cdd/context-policy.json` defaults (documentation drift only — runtime
63
+ behaviour was already correct).
64
+
65
+ ### Added
66
+
67
+ - **Per-agent required-artifact-types enforcement**: gate now reads each
68
+ agent's prompt file (resolution: `<cwd>/.claude/agents/<name>.md` →
69
+ `~/.claude/agents/<name>.md`) and extracts the "Minimum required `type`
70
+ values" bullet list. Every listed type must appear at least once in the
71
+ agent log's `artifacts:` array (a `pointer: "n/a (<reason>)"` item still
72
+ counts as present — only type membership is checked). Missing types
73
+ produce an actionable error naming the agent and the missing types. When
74
+ no prompt file is found, the check is skipped (back-compat).
75
+
76
+ ### Migration
77
+
78
+ - Existing 2.0.6 projects: `cdd-kit update --yes` to refresh the agent
79
+ prompts and `references/code-map-protocol.md`. Then re-run `cdd-kit code-map`.
80
+ - Manifests using literal paths continue to work unchanged. Manifests using
81
+ the new picomatch grammar (`src/**/*.ts`) start working correctly.
82
+ - The new per-agent required-types check may surface previously-silent
83
+ gaps. Each error message is actionable and tells you which type to add.
84
+
85
+ ## [2.0.6] - 2026-05-04
86
+
87
+ ### Added
88
+
89
+ - TypeScript scanner for `cdd-kit code-map`: `.ts` and `.tsx` files are
90
+ now indexed alongside `.py` / `.js` / `.vue`. `.jsx` / `.mjs` / `.cjs`
91
+ also routed through the JS scanner. Real-world scan of a React 19 +
92
+ TS 5.9 frontend (137 files / 20,119 src lines) compresses to 1,675
93
+ map lines (12.0x) in ~140 ms.
94
+ - New code-map schema fields for TS files: `interfaces:`, `types:`,
95
+ `enums:` — each entry carries `name`, `lines`, and an `# local`
96
+ annotation when the symbol is not exported. Enum entries also list
97
+ their members.
98
+ - User-overridable `.cdd/code-map-config.yml`: optional file with
99
+ `include:` / `exclude:` glob lists. When set, each list REPLACES the
100
+ matching built-in default (replacement semantics keep the mental
101
+ model simple — copy the built-in list and edit it for partial
102
+ overrides). CLI `--include` / `--exclude` flags continue to stack on
103
+ top of whichever lists won. Schema errors produce a clear message
104
+ and a non-zero exit.
105
+ - `lint-agents` Rule A is now stricter: parses the YAML inside each
106
+ agent prompt's `artifacts:` fence and rejects stray top-level keys
107
+ (e.g. a stray `pointer:` or `type:` sibling alongside `artifacts:`).
108
+ This catches the residual format drift that the runtime gate
109
+ already rejects but that previously slipped through prompt review.
110
+
111
+ ### Changed
112
+
113
+ - `backend-engineer` and `frontend-engineer` agent prompts: the
114
+ `## Code map (READ FIRST)` section now lists `.ts` / `.tsx` /
115
+ `.jsx` as covered extensions and points agents at the new
116
+ `interfaces:` / `types:` / `enums:` sections for TS files.
117
+ - `references/code-map-protocol.md` documents the TS schema additions
118
+ and the `.cdd/code-map-config.yml` override format.
119
+ - Variable-declaration heuristic in the JS/TS scanner now treats an
120
+ uppercase const initialised by a `CallExpression` (e.g.
121
+ `const Button = forwardRef(...)`, `const X = memo(...)`) as a
122
+ function entry, so React HOC-wrapped components show up in the map.
123
+ Single-letter uppercase identifiers (`X`, `T`, `Y`) are no longer
124
+ classified as ALL_CAPS constants — they fall through to the
125
+ function-heuristic branch.
126
+
127
+ ### Fixed
128
+
129
+ - `build.js` no longer ships `.cdd/code-map.yml` inside `assets/cdd/`.
130
+ The map is a per-repo runtime artifact; shipping a pre-built copy
131
+ caused fresh `cdd-kit init` repos to inherit a stale snapshot that
132
+ fooled freshness checks.
133
+
134
+ ### Migration
135
+
136
+ - Existing 2.0.5 projects: nothing to do. The TS scanner activates
137
+ automatically on the next `cdd-kit code-map` run if `.ts` / `.tsx`
138
+ files are present. Re-run `cdd-kit code-map` to pick them up.
139
+ - To customise scan scope: create `.cdd/code-map-config.yml`. Without
140
+ it, all built-in defaults apply.
141
+ - `cdd-kit update --yes` to refresh agent prompts in `~/.claude/`.
142
+
143
+ ## [2.0.5] - 2026-05-04
144
+
145
+ ### Added
146
+
147
+ - `cdd-kit code-map` subcommand: scans `.py`, `.js`, `.vue` source files
148
+ via per-language AST parsers and emits a deterministic structural index
149
+ at `.cdd/code-map.yml`. The map is committed to git and refreshed on
150
+ demand.
151
+ - `cdd-kit init --hooks` (opt-in): installs a pre-commit hook that
152
+ regenerates `.cdd/code-map.yml` whenever staged changes touch source
153
+ files, then re-stages the map. Coexists with `cdd-kit install-hooks`.
154
+ - `cdd-kit gate <change-id>` now hard-fails when any source file is
155
+ newer than `.cdd/code-map.yml`, naming up to 5 stale files. Emits a
156
+ warning (not error) when the map is missing but source files exist.
157
+ - `cdd-kit doctor` reports code-map status (missing / stale / compression
158
+ ratio) and `doctor --fix` regenerates a stale map.
159
+ - New skill reference doc:
160
+ `.claude/skills/contract-driven-delivery/references/code-map-protocol.md`
161
+ documenting the map format and the read-first protocol.
162
+
163
+ ### Changed
164
+
165
+ - `backend-engineer` and `frontend-engineer` agent prompts now require
166
+ `Read .cdd/code-map.yml` BEFORE reading any source file. The 300-line
167
+ rule directs agents to use `Read offset:N limit:M` for files larger
168
+ than 300 lines, eliminating whole-file Reads of large modules.
169
+ - `qa-reviewer` now flags any agent log whose `files-read` lists a
170
+ source file without listing `.cdd/code-map.yml` first.
171
+
172
+ ### Migration
173
+
174
+ After upgrading existing projects:
175
+
176
+ 1. Run `cdd-kit code-map` once to create `.cdd/code-map.yml`. Commit it.
177
+ 2. (Optional but recommended) Run `cdd-kit init --hooks` to install the
178
+ auto-regenerate pre-commit hook.
179
+ 3. Run `cdd-kit update --yes` to refresh agent prompts in `~/.claude/`.
180
+
181
+ Greenfield projects with no `.py`/`.js`/`.vue` files yet are unaffected.
182
+
183
+ ### Dependencies
184
+
185
+ Added: `@babel/parser ^7.25.0`, `@vue/compiler-sfc ^3.4.0`,
186
+ `picomatch ^4.0.2`. Python scanning shells out to the system `python3`
187
+ or `python` interpreter (Python 3.9+); if neither is on PATH, `.py`
188
+ files are skipped with a warning.
189
+
190
+ ## [2.0.4] - 2026-05-04
191
+
192
+ ### Fixed
193
+
194
+ - All 16 agent prompts now describe the `Required artifacts` block as a
195
+ `{type, pointer}` YAML array (matching `src/schemas/agent-log.schema.ts`)
196
+ instead of a flat key list. Previously agents copied the prompt verbatim
197
+ and emitted top-level `files-changed:` / `tests-added:` keys, which
198
+ `cdd-kit gate` correctly rejected as `missing required artifacts`.
199
+ - Removed duplicate `## Read scope` sections from 10 agents
200
+ (backend-engineer, frontend-engineer, qa-reviewer, contract-reviewer,
201
+ ci-cd-gatekeeper, spec-architect, test-strategist, e2e-resilience-engineer,
202
+ monkey-test-engineer, stress-soak-engineer).
203
+ - Read scope in those 10 agents now points to
204
+ `specs/changes/<change-id>/context-manifest.md → ## Allowed Paths` as the
205
+ single source of truth (matching what `cdd-kit gate` already enforces),
206
+ and instructs agents to file a Context Expansion Request rather than
207
+ reading outside the manifest. Eliminates the most common
208
+ `read unauthorized path` gate failure.
209
+
210
+ ### Added
211
+
212
+ - `cdd-kit lint-agents` subcommand: validates every `.claude/agents/*.md`
213
+ has the new artifacts shape, at most one `## Read scope`, a
214
+ `context-manifest.md` reference where applicable, and a pointer to
215
+ `references/agent-log-protocol.md`. Wired into `cdd-kit doctor`.
216
+ - Optional `note:` field on tasks in `tasks.yml` (schema and template) for
217
+ recording per-task context without breaking the existing `pending |
218
+ done | skipped` status enum.
219
+
220
+ ### Migration
221
+
222
+ No project-side migration required — the fix is to the bundled agent
223
+ prompts. After upgrading run `cdd-kit update --yes` to refresh the agents
224
+ in `~/.claude/`.
225
+
226
+ ## [2.0.3] - 2026-04-30
227
+
228
+ ### Fixed
229
+
230
+ - `cdd-kit update` now syncs all installed skills (`cdd-new`, `cdd-close`,
231
+ `cdd-resume`, `cdd-init`, `contract-driven-delivery`) instead of only
232
+ `contract-driven-delivery`. Previously the four standalone skills were silently
233
+ left stale after an npm upgrade.
234
+ - Backup path corrected from `.cdd-kit-backup/<ts>/skill/` to `.../skills/`
235
+ to cover all skill directories.
236
+
3
237
  ## [2.0.2] - 2026-04-30
4
238
 
5
239
  ### Added
@@ -9,6 +9,24 @@ You are the backend engineer.
9
9
 
10
10
  Before editing production code, read the change artifacts, API/env/data/business contracts, and test plan.
11
11
 
12
+ ## Code map (READ FIRST)
13
+
14
+ Before reading ANY source file (`.py`, `.js`, `.jsx`, `.mjs`, `.cjs`, `.ts`, `.tsx`, `.vue`), FIRST `Read .cdd/code-map.yml`.
15
+
16
+ The map is the size oracle. For each file you intend to read:
17
+
18
+ - The header `<path>: # N lines` tells you how big it is.
19
+ - If `N <= 300`: do a full `Read`.
20
+ - If `N > 300`: use the map's `classes:` / `functions:` (and for TS files,
21
+ `interfaces:` / `types:` / `enums:`) `lines: A-B` field and
22
+ `Read <path> offset:A limit:(B-A+1)`.
23
+
24
+ If `.cdd/code-map.yml` is missing or `cdd-kit gate` reports it stale,
25
+ do NOT proceed by reading whole files. Emit an agent-log with
26
+ `status: needs-review` and `next-action: "regenerate code-map (run cdd-kit code-map)"`.
27
+
28
+ See `references/code-map-protocol.md` for the full protocol.
29
+
12
30
  ## Rules
13
31
 
14
32
  - Do not change API response shape without contract updates.
@@ -32,9 +50,12 @@ Before editing production code, read the change artifacts, API/env/data/business
32
50
 
33
51
  ## Read scope
34
52
 
35
- - Allowed: `contracts/`, `tests/`, `src/`, and the change directory provided in `CURRENT_CHANGE_ID` at the top of your prompt
36
- - **Before reading any file**: confirm the CURRENT_CHANGE_ID from your prompt header. If not provided, ask the caller: "What is the current change-id?" before proceeding.
37
- - Forbidden: other `specs/changes/` directories, `specs/archive/`
53
+ Source of truth: `specs/changes/<change-id>/context-manifest.md` `## Allowed Paths`.
54
+ Read it first (your prompt header has `CURRENT_CHANGE_ID`). Read only paths it lists or paths under `## Approved Expansions`. `cdd-kit gate` validates `files-read:` against this list and rejects unauthorized paths.
55
+
56
+ Need a path not listed? File a `## Context Expansion Requests` entry (see `specs/templates/context-manifest.md`) with `status: pending` and stop until the user approves via `cdd-kit context approve <change-id> <CER-id>`.
57
+
58
+ Forbidden by default (enforced by `.cdd/context-policy.json`): `specs/archive/`, sibling `specs/changes/*`, `assets/`, `node_modules/`, `dist/`, `build/`, `.git/`, `.claude/worktrees/`.
38
59
 
39
60
  ## Handoff
40
61
 
@@ -53,14 +74,31 @@ field rules, and gate-enforcement behavior are defined once in
53
74
  `references/agent-log-protocol.md` — do not duplicate them in this prompt.
54
75
 
55
76
  ### Required artifacts for this agent
56
- - `files-changed`: list of `path/to/file.ts:line-range`
57
- - `tests-added`: list of `test-file.ts::test-name`
58
- - `test-output`: last 10 lines of `npm test` or equivalent stdout
59
- - `contracts-touched`: list of contract file paths or "none"
60
-
61
- ## Read scope
62
-
63
- - Allowed: `contracts/`, `tests/`, `src/`, `specs/changes/<current-change-id>/`
64
- - Forbidden: other `specs/changes/` directories, `specs/archive/`
65
77
 
66
- Read only the current change's directory. Do NOT glob `specs/changes/**` it pulls historical data into context and wastes tokens.
78
+ `artifacts` is a YAML array of `{type, pointer}` items in your agent log
79
+ (see `references/agent-log-protocol.md` for the full schema and self-validation
80
+ checklist). Do NOT write top-level `files-changed:` / `tests-added:` keys —
81
+ those are `type` values, not log keys.
82
+
83
+ Minimum required `type` values for this agent (each must appear at least once
84
+ in your `artifacts:` array; add more items per type as needed):
85
+
86
+ - `files-changed`: source files modified
87
+ - `tests-added`: new or updated test cases
88
+ - `test-output`: last 10 lines of `npm test` (or equivalent) stdout
89
+ - `contracts-touched`: contract files updated, or "none"
90
+
91
+ Copy this exact shape into your agent log; replace each `<pointer>` with a
92
+ concrete pointer (path:line-range, test-id, URL, or pass/fail string):
93
+
94
+ ```yaml
95
+ artifacts:
96
+ - { type: files-changed, pointer: "src/api/users.ts:10-45" }
97
+ - { type: tests-added, pointer: "tests/api/users.test.ts::should reject empty body" }
98
+ - { type: test-output, pointer: "5 passed (last 10 lines: …)" }
99
+ - { type: contracts-touched, pointer: "contracts/api/api-contract.md#endpoints" }
100
+ ```
101
+
102
+ If a required `type` does not apply to your run, emit one item with
103
+ `pointer: "n/a (<one-line reason>)"` rather than omitting the type — the gate
104
+ counts presence, qa-reviewer audits the reason.
@@ -232,11 +232,36 @@ field rules, and gate-enforcement behavior are defined once in
232
232
  `references/agent-log-protocol.md` — do not duplicate them in this prompt.
233
233
 
234
234
  ### Required artifacts for this agent
235
- - `tier`: Tier 0-5
236
- - `risk`: low|medium|high|critical
237
- - `required-artifacts`: list
238
- - `required-reviewers`: list of agent names
239
- - `context-manifest-draft`: allowed paths and agent work packets based only on `project-map.md` and `contracts-index.md`
235
+
236
+ `artifacts` is a YAML array of `{type, pointer}` items in your agent log
237
+ (see `references/agent-log-protocol.md` for the full schema and self-validation
238
+ checklist). Do NOT write top-level `files-changed:` / `tests-added:` keys
239
+ those are `type` values, not log keys.
240
+
241
+ Minimum required `type` values for this agent (each must appear at least once
242
+ in your `artifacts:` array; add more items per type as needed):
243
+
244
+ - `tier`: tier assigned to the change
245
+ - `risk`: risk level
246
+ - `required-artifacts`: artifacts the change must produce
247
+ - `required-reviewers`: reviewers the change requires
248
+ - `context-manifest-draft`: pointer to draft Allowed Paths
249
+
250
+ Copy this exact shape into your agent log; replace each `<pointer>` with a
251
+ concrete pointer (path:line-range, test-id, URL, or pass/fail string):
252
+
253
+ ```yaml
254
+ artifacts:
255
+ - { type: tier, pointer: "Tier 2" }
256
+ - { type: risk, pointer: "medium" }
257
+ - { type: required-artifacts, pointer: "change-request, classification, test-plan, ci-gates, tasks" }
258
+ - { type: required-reviewers, pointer: "contract-reviewer, qa-reviewer" }
259
+ - { type: context-manifest-draft, pointer: "specs/changes/<id>/context-manifest.md#allowed-paths" }
260
+ ```
261
+
262
+ If a required `type` does not apply to your run, emit one item with
263
+ `pointer: "n/a (<one-line reason>)"` rather than omitting the type — the gate
264
+ counts presence, qa-reviewer audits the reason.
240
265
 
241
266
  ## Mixed and edge cases
242
267
 
@@ -58,9 +58,12 @@ mergeable / blocked / informational-risk
58
58
 
59
59
  ## Read scope
60
60
 
61
- - Allowed: `contracts/`, `tests/`, `src/`, and the change directory provided in `CURRENT_CHANGE_ID` at the top of your prompt
62
- - **Before reading any file**: confirm the CURRENT_CHANGE_ID from your prompt header. If not provided, ask the caller: "What is the current change-id?" before proceeding.
63
- - Forbidden: other `specs/changes/` directories, `specs/archive/`
61
+ Source of truth: `specs/changes/<change-id>/context-manifest.md` `## Allowed Paths`.
62
+ Read it first (your prompt header has `CURRENT_CHANGE_ID`). Read only paths it lists or paths under `## Approved Expansions`. `cdd-kit gate` validates `files-read:` against this list and rejects unauthorized paths.
63
+
64
+ Need a path not listed? File a `## Context Expansion Requests` entry (see `specs/templates/context-manifest.md`) with `status: pending` and stop until the user approves via `cdd-kit context approve <change-id> <CER-id>`.
65
+
66
+ Forbidden by default (enforced by `.cdd/context-policy.json`): `specs/archive/`, sibling `specs/changes/*`, `assets/`, `node_modules/`, `dist/`, `build/`, `.git/`, `.claude/worktrees/`.
64
67
 
65
68
  ## Machine-Verifiable Evidence
66
69
 
@@ -70,14 +73,31 @@ field rules, and gate-enforcement behavior are defined once in
70
73
  `references/agent-log-protocol.md` — do not duplicate them in this prompt.
71
74
 
72
75
  ### Required artifacts for this agent
73
- - `tiers-modified`: list of tier numbers
74
- - `gate-promotions`: list of `<gate>: <from-tier> → <to-tier>` or "none"
75
- - `workflow-files-changed`: list of paths
76
- - `required-status-checks`: list of check names
77
76
 
78
- ## Read scope
77
+ `artifacts` is a YAML array of `{type, pointer}` items in your agent log
78
+ (see `references/agent-log-protocol.md` for the full schema and self-validation
79
+ checklist). Do NOT write top-level `files-changed:` / `tests-added:` keys —
80
+ those are `type` values, not log keys.
81
+
82
+ Minimum required `type` values for this agent (each must appear at least once
83
+ in your `artifacts:` array; add more items per type as needed):
79
84
 
80
- - Allowed: `contracts/`, `tests/`, `src/`, `specs/changes/<current-change-id>/`
81
- - Forbidden: other `specs/changes/` directories, `specs/archive/`
85
+ - `tiers-modified`: gate tiers touched
86
+ - `gate-promotions`: gate moves between tiers or "none"
87
+ - `workflow-files-changed`: workflow files edited
88
+ - `required-status-checks`: PR-required gates after change
89
+
90
+ Copy this exact shape into your agent log; replace each `<pointer>` with a
91
+ concrete pointer (path:line-range, test-id, URL, or pass/fail string):
92
+
93
+ ```yaml
94
+ artifacts:
95
+ - { type: tiers-modified, pointer: "1, 3" }
96
+ - { type: gate-promotions, pointer: "e2e: 3 → 1" }
97
+ - { type: workflow-files-changed, pointer: ".github/workflows/ci.yml" }
98
+ - { type: required-status-checks, pointer: "lint, unit-tests, contract-tests" }
99
+ ```
82
100
 
83
- Read only the current change's directory. Do NOT glob `specs/changes/**` it pulls historical data into context and wastes tokens.
101
+ If a required `type` does not apply to your run, emit one item with
102
+ `pointer: "n/a (<one-line reason>)"` rather than omitting the type — the gate
103
+ counts presence, qa-reviewer audits the reason.
@@ -57,9 +57,12 @@ approved / changes-required
57
57
 
58
58
  ## Read scope
59
59
 
60
- - Allowed: `contracts/`, `tests/`, `src/`, and the change directory provided in `CURRENT_CHANGE_ID` at the top of your prompt
61
- - **Before reading any file**: confirm the CURRENT_CHANGE_ID from your prompt header. If not provided, ask the caller: "What is the current change-id?" before proceeding.
62
- - Forbidden: other `specs/changes/` directories, `specs/archive/`
60
+ Source of truth: `specs/changes/<change-id>/context-manifest.md` `## Allowed Paths`.
61
+ Read it first (your prompt header has `CURRENT_CHANGE_ID`). Read only paths it lists or paths under `## Approved Expansions`. `cdd-kit gate` validates `files-read:` against this list and rejects unauthorized paths.
62
+
63
+ Need a path not listed? File a `## Context Expansion Requests` entry (see `specs/templates/context-manifest.md`) with `status: pending` and stop until the user approves via `cdd-kit context approve <change-id> <CER-id>`.
64
+
65
+ Forbidden by default (enforced by `.cdd/context-policy.json`): `specs/archive/`, sibling `specs/changes/*`, `assets/`, `node_modules/`, `dist/`, `build/`, `.git/`, `.claude/worktrees/`.
63
66
 
64
67
  ## Machine-Verifiable Evidence
65
68
 
@@ -70,14 +73,31 @@ field rules, and gate-enforcement behavior are defined once in
70
73
  `references/agent-log-protocol.md` — do not duplicate them in this prompt.
71
74
 
72
75
  ### Required artifacts for this agent
73
- - `contracts-reviewed`: list of contract file paths
74
- - `version-bumps`: list of `<contract>: <old> → <new>` or "none"
75
- - `breaking-changes`: list or "none"
76
- - `consumers-impacted`: list or "none"
77
76
 
78
- ## Read scope
77
+ `artifacts` is a YAML array of `{type, pointer}` items in your agent log
78
+ (see `references/agent-log-protocol.md` for the full schema and self-validation
79
+ checklist). Do NOT write top-level `files-changed:` / `tests-added:` keys —
80
+ those are `type` values, not log keys.
81
+
82
+ Minimum required `type` values for this agent (each must appear at least once
83
+ in your `artifacts:` array; add more items per type as needed):
79
84
 
80
- - Allowed: `contracts/`, `tests/`, `src/`, `specs/changes/<current-change-id>/`
81
- - Forbidden: other `specs/changes/` directories, `specs/archive/`
85
+ - `contracts-reviewed`: contract files reviewed
86
+ - `version-bumps`: version changes per contract or "none"
87
+ - `breaking-changes`: list of breaking items or "none"
88
+ - `consumers-impacted`: downstream consumers affected or "none"
89
+
90
+ Copy this exact shape into your agent log; replace each `<pointer>` with a
91
+ concrete pointer (path:line-range, test-id, URL, or pass/fail string):
92
+
93
+ ```yaml
94
+ artifacts:
95
+ - { type: contracts-reviewed, pointer: "contracts/api/api-contract.md" }
96
+ - { type: version-bumps, pointer: "api-contract: 0.1.0 → 0.2.0" }
97
+ - { type: breaking-changes, pointer: "none" }
98
+ - { type: consumers-impacted, pointer: "frontend/web, mobile-ios" }
99
+ ```
82
100
 
83
- Read only the current change's directory. Do NOT glob `specs/changes/**` it pulls historical data into context and wastes tokens.
101
+ If a required `type` does not apply to your run, emit one item with
102
+ `pointer: "n/a (<one-line reason>)"` rather than omitting the type — the gate
103
+ counts presence, qa-reviewer audits the reason.
@@ -38,6 +38,7 @@ For any change that adds or modifies a database migration:
38
38
  - Post-install scripts — flag any new dependency that runs `postinstall`, `preinstall`, or arbitrary build hooks; require justification.
39
39
  - Maintenance signal — last commit > 24 months, single maintainer, no test suite — escalate even when no CVE is known.
40
40
  - License families — permissive (MIT, BSD, Apache-2): generally OK; weak copyleft (LGPL, MPL): OK with isolation; strong copyleft (GPL, AGPL): proprietary code conflict — block unless legal-approved.
41
+ - cdd-kit 2.0.5 added three new direct dependencies: `@babel/parser ^7.25.0` (MIT), `@vue/compiler-sfc ^3.4.0` (MIT), `picomatch ^4.0.2` (MIT) — included for the `code-map` subcommand AST scanning feature.
41
42
 
42
43
  ## Output
43
44
 
@@ -62,6 +63,17 @@ For any change that adds or modifies a database migration:
62
63
  approved / changes-required / blocked
63
64
  ```
64
65
 
66
+ ## Read scope
67
+
68
+ Source of truth: `specs/changes/<change-id>/context-manifest.md` → `## Allowed Paths`.
69
+ Read it first (your prompt header has `CURRENT_CHANGE_ID`). Read only paths it lists or paths under `## Approved Expansions`. `cdd-kit gate` validates `files-read:` against this list and rejects unauthorized paths.
70
+
71
+ This agent typically also needs to read lockfiles (`package-lock.json`, `yarn.lock`, `requirements*.txt`, `go.sum`) and migration directories — make sure the manifest's Allowed Paths includes them, or file a `## Context Expansion Requests` entry.
72
+
73
+ Need a path not listed? File a `## Context Expansion Requests` entry (see `specs/templates/context-manifest.md`) with `status: pending` and stop until the user approves via `cdd-kit context approve <change-id> <CER-id>`.
74
+
75
+ Forbidden by default (enforced by `.cdd/context-policy.json`): `specs/archive/`, sibling `specs/changes/*`, `assets/`, `node_modules/`, `dist/`, `build/`, `.git/`, `.claude/worktrees/`.
76
+
65
77
  ## Machine-Verifiable Evidence
66
78
 
67
79
  After completing your task, end your response with an `Agent Log` YAML block
@@ -71,7 +83,31 @@ field rules, and gate-enforcement behavior are defined once in
71
83
  `references/agent-log-protocol.md` — do not duplicate them in this prompt.
72
84
 
73
85
  ### Required artifacts for this agent
74
- - `packages-reviewed`: list of `<name>@<version>`
75
- - `cve-findings`: count + severity buckets
76
- - `license-issues`: list or "none"
77
- - `lockfile-changes`: list of files
86
+
87
+ `artifacts` is a YAML array of `{type, pointer}` items in your agent log
88
+ (see `references/agent-log-protocol.md` for the full schema and self-validation
89
+ checklist). Do NOT write top-level `files-changed:` / `tests-added:` keys —
90
+ those are `type` values, not log keys.
91
+
92
+ Minimum required `type` values for this agent (each must appear at least once
93
+ in your `artifacts:` array; add more items per type as needed):
94
+
95
+ - `packages-reviewed`: packages assessed
96
+ - `cve-findings`: CVE findings count by severity
97
+ - `license-issues`: license-compliance findings or "none"
98
+ - `lockfile-changes`: lockfile files changed
99
+
100
+ Copy this exact shape into your agent log; replace each `<pointer>` with a
101
+ concrete pointer (path:line-range, test-id, URL, or pass/fail string):
102
+
103
+ ```yaml
104
+ artifacts:
105
+ - { type: packages-reviewed, pointer: "axios@1.7.0, jose@5.2.1" }
106
+ - { type: cve-findings, pointer: "0 high, 1 medium" }
107
+ - { type: license-issues, pointer: "none" }
108
+ - { type: lockfile-changes, pointer: "package-lock.json" }
109
+ ```
110
+
111
+ If a required `type` does not apply to your run, emit one item with
112
+ `pointer: "n/a (<one-line reason>)"` rather than omitting the type — the gate
113
+ counts presence, qa-reviewer audits the reason.
@@ -35,9 +35,12 @@ Record test files, scenarios, fixtures/mocks, commands, screenshots/videos, and
35
35
 
36
36
  ## Read scope
37
37
 
38
- - Allowed: `contracts/`, `tests/`, `src/`, and the change directory provided in `CURRENT_CHANGE_ID` at the top of your prompt
39
- - **Before reading any file**: confirm the CURRENT_CHANGE_ID from your prompt header. If not provided, ask the caller: "What is the current change-id?" before proceeding.
40
- - Forbidden: other `specs/changes/` directories, `specs/archive/`
38
+ Source of truth: `specs/changes/<change-id>/context-manifest.md` `## Allowed Paths`.
39
+ Read it first (your prompt header has `CURRENT_CHANGE_ID`). Read only paths it lists or paths under `## Approved Expansions`. `cdd-kit gate` validates `files-read:` against this list and rejects unauthorized paths.
40
+
41
+ Need a path not listed? File a `## Context Expansion Requests` entry (see `specs/templates/context-manifest.md`) with `status: pending` and stop until the user approves via `cdd-kit context approve <change-id> <CER-id>`.
42
+
43
+ Forbidden by default (enforced by `.cdd/context-policy.json`): `specs/archive/`, sibling `specs/changes/*`, `assets/`, `node_modules/`, `dist/`, `build/`, `.git/`, `.claude/worktrees/`.
41
44
 
42
45
  ## Machine-Verifiable Evidence
43
46
 
@@ -47,14 +50,31 @@ field rules, and gate-enforcement behavior are defined once in
47
50
  `references/agent-log-protocol.md` — do not duplicate them in this prompt.
48
51
 
49
52
  ### Required artifacts for this agent
50
- - `test-files`: list of paths under `tests/e2e/` or `tests/resilience/`
51
- - `scenarios-covered`: list of scenario names
52
- - `mutation-checks`: list or "none"
53
- - `trace-artifacts`: paths or "none"
54
-
55
- ## Read scope
56
-
57
- - Allowed: `contracts/`, `tests/`, `src/`, `specs/changes/<current-change-id>/`
58
- - Forbidden: other `specs/changes/` directories, `specs/archive/`
59
53
 
60
- Read only the current change's directory. Do NOT glob `specs/changes/**` it pulls historical data into context and wastes tokens.
54
+ `artifacts` is a YAML array of `{type, pointer}` items in your agent log
55
+ (see `references/agent-log-protocol.md` for the full schema and self-validation
56
+ checklist). Do NOT write top-level `files-changed:` / `tests-added:` keys —
57
+ those are `type` values, not log keys.
58
+
59
+ Minimum required `type` values for this agent (each must appear at least once
60
+ in your `artifacts:` array; add more items per type as needed):
61
+
62
+ - `test-files`: E2E/resilience test files written
63
+ - `scenarios-covered`: list of scenarios (happy-path, failure-injection, etc.)
64
+ - `mutation-checks`: mutation test result or "none"
65
+ - `trace-artifacts`: path to traces/recordings
66
+
67
+ Copy this exact shape into your agent log; replace each `<pointer>` with a
68
+ concrete pointer (path:line-range, test-id, URL, or pass/fail string):
69
+
70
+ ```yaml
71
+ artifacts:
72
+ - { type: test-files, pointer: "tests/e2e/login.spec.ts" }
73
+ - { type: scenarios-covered, pointer: "happy-path, slow-network, 503" }
74
+ - { type: mutation-checks, pointer: "none" }
75
+ - { type: trace-artifacts, pointer: "specs/changes/<id>/traces/login-503.zip" }
76
+ ```
77
+
78
+ If a required `type` does not apply to your run, emit one item with
79
+ `pointer: "n/a (<one-line reason>)"` rather than omitting the type — the gate
80
+ counts presence, qa-reviewer audits the reason.