@kiwidata/grimoire 0.2.0 → 0.2.2
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/AGENTS.md +9 -4
- package/dist/core/check-complexity.d.ts +4 -0
- package/dist/core/check-complexity.d.ts.map +1 -0
- package/dist/core/check-complexity.js +79 -0
- package/dist/core/check-complexity.js.map +1 -0
- package/dist/core/check-llm.d.ts +5 -0
- package/dist/core/check-llm.d.ts.map +1 -0
- package/dist/core/check-llm.js +108 -0
- package/dist/core/check-llm.js.map +1 -0
- package/dist/core/check.d.ts +1 -2
- package/dist/core/check.d.ts.map +1 -1
- package/dist/core/check.js +2 -179
- package/dist/core/check.js.map +1 -1
- package/dist/core/init-config.d.ts +22 -0
- package/dist/core/init-config.d.ts.map +1 -0
- package/dist/core/init-config.js +118 -0
- package/dist/core/init-config.js.map +1 -0
- package/dist/core/init-prompts.d.ts +8 -0
- package/dist/core/init-prompts.d.ts.map +1 -0
- package/dist/core/init-prompts.js +166 -0
- package/dist/core/init-prompts.js.map +1 -0
- package/dist/core/init.d.ts +0 -1
- package/dist/core/init.d.ts.map +1 -1
- package/dist/core/init.js +3 -279
- package/dist/core/init.js.map +1 -1
- package/package.json +1 -1
- package/skills/grimoire-apply/SKILL.md +65 -12
- package/skills/grimoire-draft/SKILL.md +5 -3
- package/skills/grimoire-plan/SKILL.md +4 -1
- package/skills/grimoire-pr/SKILL.md +14 -15
- package/skills/grimoire-refactor/SKILL.md +3 -1
- package/skills/references/code-quality.md +1 -1
- package/skills/references/principles.md +4 -3
- package/skills/references/refactor-scan-categories.md +15 -0
- package/skills/references/review-personas.md +30 -13
- package/skills/references/testing-contracts.md +19 -0
- package/templates/learnings.md +40 -0
package/dist/core/init.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/core/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAA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AAO,CAAC,GAAG,CACT,qFAAqF,CACtF,CAAC;IACJ,CAAC;AACH,CAAC;AAED,KAAK,UAAU,eAAe,CAC5B,IAAY,EACZ,OAAqB;IAErB,MAAM,gBAAgB,CAAC,IAAI,EAAE,YAAY,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;AACjE,CAAC;AAED,KAAK,UAAU,aAAa,CAAC,IAAY,EAAE,MAAgB;IACzD,MAAM,iBAAiB,CAAC,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;AAC9E,CAAC"}
|
package/package.json
CHANGED
|
@@ -21,7 +21,7 @@ Implement tasks from a planned grimoire change using **test-first discipline at
|
|
|
21
21
|
|
|
22
22
|
Do NOT write a `.feature` scenario for a `unit-invariant` or `characterization` task — forcing Gherkin where a unit test is correct is the antipattern that fills feature files with slop. One right way: behavior → scenario, everything else → unit test.
|
|
23
23
|
|
|
24
|
-
**Artifacts are edited live on the feature branch.** Features, decisions, constraints, and schema are real files in `features/`, `.grimoire/decisions/`, `.grimoire/docs/`. There is no copy-into-change-folder and no promote step — `git diff` is the staging area. The change folder holds only ephemeral process scaffolding (`manifest.md`, `tasks.md`).
|
|
24
|
+
**Artifacts are edited live on the feature branch.** Features, decisions, constraints, and schema are real files in `features/`, `.grimoire/decisions/`, `.grimoire/docs/`. There is no copy-into-change-folder and no promote step — `git diff` is the staging area. The change folder holds only ephemeral process scaffolding (`manifest.md`, `tasks.md`, and the apply-maintained `learnings.md`).
|
|
25
25
|
|
|
26
26
|
## CRITICAL: Two Rules That Must Not Be Broken
|
|
27
27
|
|
|
@@ -84,16 +84,26 @@ If the user doesn't specify, default to review mode.
|
|
|
84
84
|
|
|
85
85
|
**Both modes:** Update `tasks.md` in real time as work progresses. Mark tasks `- [x]` the moment they pass. If a task is split, reordered, or new tasks are discovered during implementation, update `tasks.md` immediately so it always reflects the current state. The task list is the source of truth for progress — if the session is interrupted, the next agent should be able to read `tasks.md` and know exactly where to resume.
|
|
86
86
|
|
|
87
|
+
### Working Memory: `learnings.md`
|
|
88
|
+
|
|
89
|
+
Apply keeps one ephemeral file, `.grimoire/changes/<change-id>/learnings.md` (create it from `templates/learnings.md` the first time you need it). It is the loop's memory between attempts and sessions, and it is **removed at finalize** with the rest of the change folder — nothing in it reaches the repo. Two sections, two lifecycles:
|
|
90
|
+
|
|
91
|
+
- **Failure-mode notes** — transient. After a failed attempt, append one line: what you tried and why it failed. Before any retry, read this section so you don't repeat a dead end. Prune a task's notes the moment it goes green. Never promote them.
|
|
92
|
+
- **Discovered facts** — durable facts about the project learned while implementing (a build flag, a convention, an undocumented contract). Stage them here with their destination home; at finalize they are reconciled into that one home and cleared. Do **not** write them into `AGENTS.md`.
|
|
93
|
+
|
|
94
|
+
Subagents and fresh sessions read and append to this file the same way they use `tasks.md` — it is shared state on disk, not context-window memory.
|
|
95
|
+
|
|
87
96
|
### Stuck Detection & Recovery
|
|
88
97
|
|
|
89
98
|
**You MUST track failed attempts per task.** If a test won't go green, count your attempts:
|
|
90
99
|
|
|
100
|
+
- **Before any attempt past the first:** read the task's **failure-mode notes** in `learnings.md`. Do not repeat an approach already recorded there as failed.
|
|
91
101
|
- **Attempt 1:** Try the straightforward implementation from the task description.
|
|
92
|
-
- **Attempt 2:** If attempt 1 failed, re-read the error carefully
|
|
93
|
-
- **Attempt 3 (final):** If attempt 2 failed, try one more *fundamentally different* approach. If the same error recurs, the problem is likely not in your implementation.
|
|
102
|
+
- **Attempt 2:** If attempt 1 failed, append a failure-mode note (`<task-id> · tried … · failed: …`), re-read the error carefully, then try a *different* approach — not the same code with minor tweaks. State what you're doing differently and why.
|
|
103
|
+
- **Attempt 3 (final):** If attempt 2 failed, append the second dead end as a failure-mode note, then try one more *fundamentally different* approach. If the same error recurs, the problem is likely not in your implementation.
|
|
94
104
|
|
|
95
105
|
**After 3 failed attempts on a single task, STOP.** Do not continue. Instead:
|
|
96
|
-
1. Add a comment to `tasks.md` under the task: `<!-- BLOCKED: <summary
|
|
106
|
+
1. Add a comment to `tasks.md` under the task: `<!-- BLOCKED: <summary> -->` (the full trail is already in the failure-mode notes)
|
|
97
107
|
2. Present to the user:
|
|
98
108
|
- What the task requires
|
|
99
109
|
- What you tried (all 3 approaches, briefly)
|
|
@@ -115,10 +125,29 @@ If the user doesn't specify, default to review mode.
|
|
|
115
125
|
|
|
116
126
|
**Never silently retry the same approach.** If your implementation produced error X and you're about to write code that will produce error X again, stop and think about why. If you can't identify what would change the outcome, stop and ask.
|
|
117
127
|
|
|
128
|
+
### Circuit Breaker & Cross-Section Thrash (Autonomous Mode)
|
|
129
|
+
|
|
130
|
+
The per-task 3-attempt cap bounds a single task; it cannot see the *run* cycling. Autonomous mode adds a loop-level breaker the parent orchestrator checks **between sections**. Caps live under `llm.coding.limits` in `.grimoire/config.yaml`:
|
|
131
|
+
|
|
132
|
+
| Cap | Default | Kind |
|
|
133
|
+
|-----|---------|------|
|
|
134
|
+
| `max_sections_without_checkpoint` | 5 | followable — halt and checkpoint with the user |
|
|
135
|
+
| `consecutive_blocked` | 2 | followable — two BLOCKED sections in a row → halt |
|
|
136
|
+
| `max_cost_usd` | null (opt-in) | **soft** — self-reported; not harness-enforced in v1 |
|
|
137
|
+
| `max_wallclock_min` | null (opt-in) | **soft** — self-reported; not harness-enforced in v1 |
|
|
138
|
+
|
|
139
|
+
**Cross-section thrash detection:** halt the whole run — don't just retry locally — when the last two sections both ended BLOCKED, **or** when a section's failure-mode error class repeats the prior section's (read the failure-mode notes in `learnings.md` to compare). A failed attempt always leaves a note, so the thrash signal accumulates across sections; the breaker is the last resort once that signal shows the loop is stuck, not the first line of defense.
|
|
140
|
+
|
|
141
|
+
**On any trip:** stop, state the trip reason and a one-line diagnosis (what cycled, what was tried), and hand to the user. Do not continue past a tripped breaker.
|
|
142
|
+
|
|
143
|
+
> **Enforcement honesty:** the section and BLOCKED caps are orchestrator behavior the agent follows; the cost and wall-clock caps are *soft* — the agent self-reports against them and they are not enforced by the harness in v1. A hard, code-enforced breaker is a deferred follow-up.
|
|
144
|
+
|
|
118
145
|
### Session Management — MANDATORY Fresh Context Per Section
|
|
119
146
|
|
|
120
147
|
**Do NOT implement all tasks in a single conversation context.** Context accumulates across tasks and degrades output quality — the LLM starts hallucinating based on stale file contents it read 5 tasks ago. This is not a suggestion. Fresh context per task section is required.
|
|
121
148
|
|
|
149
|
+
**Size one task to one context.** The goal is not statelessness for its own sake — a task should be small enough that one coherent context carries it start to finish (stateful *within* a task), and context is reset *between* tasks. If a single task overflows its context mid-flight, that is a **smell that the task is too big** — split the spec, don't paper over it with a stateless restart loop. Fresh-context-per-section gives you the "reset between" half for free; keeping tasks small gives you the "continuity within" half.
|
|
150
|
+
|
|
122
151
|
Each task section in `tasks.md` has a `<!-- context: ... -->` block listing the exact files needed. This is the loading list for that section's fresh context.
|
|
123
152
|
|
|
124
153
|
#### Claude Code: Subagent Per Section
|
|
@@ -132,6 +161,12 @@ The parent agent is the **orchestrator only** — it does NOT implement tasks it
|
|
|
132
161
|
find section <N>, and implement all unchecked tasks in that section.
|
|
133
162
|
Follow the red-green BDD cycle for each task. Mark tasks [x] when done.
|
|
134
163
|
|
|
164
|
+
Use `.grimoire/changes/<change-id>/learnings.md` as working memory: read a
|
|
165
|
+
task's failure-mode notes before retrying it and don't repeat a recorded dead
|
|
166
|
+
end; append a failure-mode note after any failed attempt; prune them when the
|
|
167
|
+
task goes green; append durable project facts to Discovered facts with their
|
|
168
|
+
home (never to AGENTS.md). Never weaken or delete a test to force green.
|
|
169
|
+
|
|
135
170
|
Before writing any production code, read `../references/code-quality.md`,
|
|
136
171
|
`../references/testing-contracts.md`, and `../references/pattern-guard.md`.
|
|
137
172
|
Apply the code-quality rules WHILE you write (not after) — reuse before write,
|
|
@@ -230,7 +265,7 @@ Work through `tasks.md` sequentially. **Every task follows the same cycle: test
|
|
|
230
265
|
1. Announce which task you're working on
|
|
231
266
|
- Read the task's `verify:` tag — it decides the test vehicle. `scenario` → write/extend step definitions for the named scenario. `unit-invariant` → write a unit/integration test asserting the constraint. `characterization` → write a unit test pinning current/intended behavior. If a `unit-invariant` task has no matching constraint in `.grimoire/docs/constraints.md`, STOP and flag — don't invent a scenario to fill the gap.
|
|
232
267
|
- **Pattern brief** (before writing anything): classify code type → `search_graph` for 3–5 peers (excluding last 60 days) → `get_code_snippet` → extract modal pattern across the four critical seams (error handling, dependency access, abstraction depth, return shape) → write a 5–8 rule brief. Skip if graph not indexed or < 3 peers. Full instructions in `../references/pattern-guard.md`.
|
|
233
|
-
2. Write the test FIRST, at the task's level (step definitions for `scenario`; unit/integration test for `unit-invariant`/`characterization`)
|
|
268
|
+
2. Write the test FIRST, at the task's level (step definitions for `scenario`; unit/integration test for `unit-invariant`/`characterization`). **Generate test data, don't ask for it and don't hand-invent it** — build records through the project's data factory / property-based tool (`../references/testing-contracts.md` §Test Data Generation; detect it from `config.tools` / existing test imports), overriding only the fields this case pins. AI-authored literal data is a last resort, only when the user explicitly asked for it or no factory exists and a specific crafted value is needed — and note why when you do.
|
|
234
269
|
3. Run the test — **it MUST FAIL (red)**
|
|
235
270
|
4. If the test passes immediately, STOP. The test is broken — it's not actually testing anything. Fix it so it makes a real assertion that fails without production code. Common causes:
|
|
236
271
|
- Empty step definition body (passes by default)
|
|
@@ -243,7 +278,8 @@ Work through `tasks.md` sequentially. **Every task follows the same cycle: test
|
|
|
243
278
|
- **Names reveal intent.** No `data` / `result` / `temp` / `info` / `obj` when a specific name fits. Booleans read as yes/no questions (`is_expired`, `has_admin_role`).
|
|
244
279
|
- **Branching budget ~7.** If a function has more `if` / `else` / `case` / `&&` than that, split or drop dead guards.
|
|
245
280
|
- **Function size ~30 lines.** One job per function. If the name needs "and", split.
|
|
246
|
-
- **No premature abstraction.** Three near-identical copies is fine. No new `BaseX` / factory / strategy / config object for a single caller.
|
|
281
|
+
- **No premature abstraction (YAGNI).** Three near-identical copies is fine. No new `BaseX` / factory / strategy / config object for a single caller.
|
|
282
|
+
- **Guardrails — the floor YAGNI never cuts below.** Simplicity stops at safety. Never drop, in the name of less code: input validation at a trust boundary, error handling that prevents data loss, a security control (authn/authz, output escaping, secret handling — see `../references/security-compliance.md`), an accessibility basic, or anything the task explicitly requested. Edge validation (above) is *required* code, not defensive slop — the trust-your-callers rule governs the interior only. Non-trivial logic (a branch, loop, parser, money/security path) leaves one runnable check behind (`../references/testing-contracts.md`); a lazy version without its check is unfinished, not done.
|
|
247
283
|
- **Comments: terse, self-contained, no essays** (`../references/code-quality.md` §7). Default to none; add only a one-line non-obvious *why*. Terse voice — drop "this function", filler, restated types. **Self-contained:** never name an external artifact that moves independently — no feature/scenario/`.feature`, MADR/ADR number, change-id, ticket/PR, test name, or tag code (`LOG-OBS-003`) in a comment; describe the behavior, not where it's specced. **No paragraphs:** summary is 1–2 lines, then the `comment_style` params if the project requires them — no prose block before them. No comments restating the code (`# loop over users`). If removing it wouldn't confuse a future reader, don't write it.
|
|
248
284
|
6. Run the step definitions again — they should PASS (green)
|
|
249
285
|
7. If still red, fix the production code (not the test)
|
|
@@ -254,11 +290,14 @@ Work through `tasks.md` sequentially. **Every task follows the same cycle: test
|
|
|
254
290
|
- Assertions check behavior, not just types or existence — "response status is 302 and redirect URL is /dashboard/" not "response is not None"
|
|
255
291
|
- If you wrote a test that would pass against a null/trivial implementation, strengthen it
|
|
256
292
|
10. **Code quality check:** Walk the seven-point checklist in `../references/code-quality.md` against every file you changed. Any fail → fix code, re-run tests, re-check. Do not mark `[x]` while a check fails.
|
|
257
|
-
11.
|
|
258
|
-
12.
|
|
293
|
+
11. **Reconcile working memory:** prune this task's failure-mode notes from `learnings.md` — it's green, they've served their purpose. If you learned a durable project fact while implementing (a build flag, a convention, an undocumented contract, an architectural constraint), append it to the **Discovered facts** section with its destination home — don't write it into `AGENTS.md` and don't leave it only in context.
|
|
294
|
+
12. Mark complete: `- [ ]` → `- [x]`
|
|
295
|
+
13. Move to next task
|
|
259
296
|
|
|
260
297
|
**This is strict red-green BDD.** A test that has never been red has never proven it can catch a failure. The red step is NOT a formality — it is the proof that the test works. If you skip it or the test passes immediately, you have a false positive that provides zero safety.
|
|
261
298
|
|
|
299
|
+
**Never game the gate (reward-hack guard).** When a test won't pass, fix the production code — never weaken or delete the test to force green. Deleting a test, loosening an assertion to match wrong output, narrowing what it checks, or skipping/`xfail`-ing it to get a green run is **stop-and-flag**, not a valid completion. The gate is the convergence signal; gaming it produces plausible-wrong code faster. If a test genuinely encodes the wrong expectation, that is a spec problem — STOP and go back to draft, don't quietly edit the test to pass.
|
|
300
|
+
|
|
262
301
|
**Step definition rules:**
|
|
263
302
|
- Organize by domain concept, not by feature file
|
|
264
303
|
- Shared steps go in the project's common step location (check existing test setup)
|
|
@@ -289,16 +328,30 @@ When all tests are green. Features, decisions, and constraints were edited live
|
|
|
289
328
|
2. Constraints (`.grimoire/docs/constraints.md`) were edited in place — nothing to move.
|
|
290
329
|
3. If the change has a `data.yml` (schema delta), apply its `add`/`modify`/`remove` entries to the live `.grimoire/docs/data/schema.yml` so the baseline schema stays current. `data.yml` is a migration-delta spec (ephemeral scaffolding carrying nullability/safety/ordering intent a raw diff wouldn't), not a copy of the schema — `schema.yml` is the live target; the delta is discarded with the change folder.
|
|
291
330
|
4. Refresh the project overview: run `grimoire docs`. It regenerates `.grimoire/docs/OVERVIEW.md` (the human entry point) from the now-current features, constraints, decisions, and schema — superseded decisions drop out automatically. This is the existing `docs` command, not a new one.
|
|
292
|
-
5.
|
|
331
|
+
5. Reconcile `learnings.md`: for each entry under **Discovered facts**, write it into the home it names — an area doc (`.grimoire/docs/<area>.md`), a decision, a constraint, or `schema.yml`. Confirm the routing with the user (it's correctable) and drop stale ones. Failure-mode notes are discarded, not promoted. This is the one place facts learned during apply enter the durable record — `AGENTS.md` is never the destination.
|
|
332
|
+
6. Remove the change directory `.grimoire/changes/<change-id>/`. Its `manifest.md` + `tasks.md` + `learnings.md` (+ any `data.yml`) and the `draft.md` design doc are ephemeral process scaffolding. `draft.md` was retained read-only through the pipeline as the agreed-design reference; this is its closing deletion.
|
|
333
|
+
|
|
334
|
+
**Guard — never delete uncommitted scaffolding.** `git log` only preserves what was committed. If `draft.md`/`tasks.md`/`manifest.md`/`learnings.md` were never committed (e.g. draft and plan ran without intermediate commits), deleting them now loses them permanently — there is no recovering an untracked file. Before removing the folder, verify it is in history:
|
|
335
|
+
```
|
|
336
|
+
git ls-files --error-unmatch .grimoire/changes/<change-id>/draft.md
|
|
337
|
+
```
|
|
338
|
+
If that errors (untracked), or `git status` shows uncommitted edits under the change folder, **commit the scaffolding first** (see step 8 — this becomes the first of two commits), then delete. If you cannot commit, STOP and tell the user rather than deleting.
|
|
339
|
+
|
|
340
|
+
The durable record is the branch, the PR, and `git log` — linked by the `Change: <change-id>` trailer; once committed, git history preserves `draft.md` if ever needed. **There is no archive tree** (don't reinvent git history).
|
|
293
341
|
|
|
294
342
|
### 8. Commit
|
|
295
343
|
|
|
296
|
-
|
|
344
|
+
The commit captures the finished state — accepted decisions, live artifacts, cleared scaffolding — not mid-flight change artefacts.
|
|
345
|
+
|
|
346
|
+
**Order depends on whether the scaffolding is already in history (see step 6's guard):**
|
|
347
|
+
|
|
348
|
+
- **Scaffolding already committed** (draft/plan committed earlier, the normal case): finalize fully — including the folder removal — then make one commit capturing the accepted state and the deletion.
|
|
349
|
+
- **Scaffolding NOT yet committed** (this is the change's first commit): you cannot delete-then-commit, or the scaffolding is lost forever. Make **two commits**: (1) commit the implementation, live artifacts, and the still-present change folder so history preserves `draft.md`/`tasks.md`; (2) remove the folder and commit the deletion. Both carry the `Change: <change-id>` trailer.
|
|
297
350
|
|
|
298
|
-
Stage the live artifacts and the scaffolding removal:
|
|
351
|
+
Stage the live artifacts (and, in the single-commit case, the scaffolding removal):
|
|
299
352
|
```
|
|
300
353
|
git add features/ .grimoire/decisions/ .grimoire/docs/ src/ tests/
|
|
301
|
-
git add -u # picks up the removed change directory
|
|
354
|
+
git add -u # picks up the removed change directory (single-commit case)
|
|
302
355
|
```
|
|
303
356
|
|
|
304
357
|
Then commit using `/grimoire:commit` (reads change context for the message) or write a manual message following `AGENTS.md` commit trailer conventions:
|
|
@@ -154,12 +154,14 @@ Then project each kind of fact:
|
|
|
154
154
|
**Behaviors → `features/*.feature`.** For each behavioral fact in the design:
|
|
155
155
|
|
|
156
156
|
*The feature-file admission test* — a scenario may be written **only if it passes all four gates**; if it fails any, it is a constraint or a decision, not a feature:
|
|
157
|
-
1. **External actor** —
|
|
157
|
+
1. **External actor, outside the system boundary** — an end user, an operator, or a *third-party* system integrating with you does the thing. "External" means outside *your* system, not outside one module: a sibling service, an internal queue consumer, or another module in the same repo calling this one is **internal**, even though it's a separate process. Internal actor → contract test or constraint/decision, never a `.feature`.
|
|
158
158
|
2. **Observable** — the actor sees the outcome without reading code or logs. "<200ms", "logs scrubbed of PII" → fails → constraint.
|
|
159
159
|
3. **Domain language** — domain nouns, zero implementation detail. Names a library/log-level/table (`loguru`, `INFO`, `bcrypt`, `users` table) → fails → leaking implementation.
|
|
160
160
|
4. **Survives reimplementation** — rewrite the internals from scratch; would the scenario still read the same? If it would change, it's pinned to implementation → not a feature.
|
|
161
161
|
|
|
162
|
-
|
|
162
|
+
**Internal protocols and service-to-service contracts are NOT features.** A change to how two of your own components talk — an internal RPC/queue/event shape, a module API, a wire format between your services — is a *contract*, verified by a contract/integration test (`verify: unit-invariant` at plan stage), not by Gherkin. It fails gate 1: there is no external actor, only your own code on both ends. If a third-party integrates against the protocol it's external and may be a feature; two of your own services is internal. This is the second-biggest source of feature-file slop after invariants.
|
|
163
|
+
|
|
164
|
+
Common slop this catches: invariants (→ `constraints.md`) — "PII is scrubbed from logs", "all endpoints require auth", "responses are gzipped", "errors logged with a trace id"; internal protocols (→ contract test) — "service A publishes an OrderPlaced event B consumes", "the worker accepts a job payload with these fields", "module X returns this struct to module Y".
|
|
163
165
|
|
|
164
166
|
*Extend vs. new — default is always extend; new files are the exception and require justification.* List existing feature files first (**required, not skippable** — do not write any scenario until this triage table is complete):
|
|
165
167
|
|
|
@@ -238,7 +240,7 @@ github_api:
|
|
|
238
240
|
## Important
|
|
239
241
|
- ONE change at a time. Don't combine unrelated changes.
|
|
240
242
|
- **`draft.md` is the only surface you design on.** Features, constraints, MADRs, and the manifest are **generated from it** at projection — never authored by hand in parallel during design.
|
|
241
|
-
- **Features describe actor-observable behavior, not implementation, and not invariants.** No external actor, not observable, or names a library/log-level/table → it's a constraint (→ `constraints.md`) or a decision (→ MADR).
|
|
243
|
+
- **Features describe actor-observable behavior, not implementation, and not invariants.** No external actor, not observable, or names a library/log-level/table → it's a constraint (→ `constraints.md`) or a decision (→ MADR). An internal protocol or service-to-service contract (your own components talking) is a contract test, not a `.feature` — "external" means outside your system, not outside one module. These two — invariants and internal protocols — are the top sources of feature-file slop.
|
|
242
244
|
- **One fact, one home** (`../references/principles.md`). A capability lives in one `.feature`; a control in one constraint row; a decision in one MADR. Never the same fact in two homes (at rest).
|
|
243
245
|
- Decisions live in **one inline ledger** in `draft.md` while designing; they project to separate MADRs only at step 7. This is how coupled decisions stay legible during the thinking.
|
|
244
246
|
- Artifacts (post-projection) are edited **live on the branch** — never copied into `.grimoire/changes/`. `git diff` is the staging area.
|
|
@@ -126,9 +126,10 @@ Create `.grimoire/changes/<change-id>/tasks.md`. **Every task produces both prod
|
|
|
126
126
|
|-------------------|-----------|--------------|
|
|
127
127
|
| a `.feature` scenario (actor-observable behavior) | `scenario` | step definitions + Gherkin |
|
|
128
128
|
| a constraint in `constraints.md` (security/NFR/observability) | `unit-invariant` | unit/integration test asserting the invariant |
|
|
129
|
+
| an internal protocol / service-to-service contract (internal RPC, queue/event shape, module API between your own components) | `unit-invariant` | contract/integration test asserting the wire shape both ends agree on |
|
|
129
130
|
| an ADR consequence, refactor, or internal change with no spec | `characterization` | unit / characterization test |
|
|
130
131
|
|
|
131
|
-
**Do not plan a `.feature` scenario task for a constraint or an internal change.** Constraints get `unit-invariant`
|
|
132
|
+
**Do not plan a `.feature` scenario task for a constraint, an internal protocol, or an internal change.** Constraints and internal protocols get `unit-invariant` tests (a contract test for a protocol asserts the payload/event shape both ends agree on); other internal changes get `characterization` tests. Forcing Gherkin onto a non-behavioral concern is the antipattern that fills feature files with slop (one right way: external actor-observable behavior → scenario, everything else — invariants, internal protocols, refactors → unit/contract test). If a `.feature` in the change actually describes an internal protocol (slop that slipped past draft), flag it and route the task to `unit-invariant`, don't write step definitions for it.
|
|
132
133
|
|
|
133
134
|
**THE PLAN'S SCOPE IS WHAT WAS APPROVED.** Tasks may only derive from:
|
|
134
135
|
- `.feature` scenarios in this change → `verify: scenario`
|
|
@@ -234,6 +235,8 @@ Good task (specific enough to execute):
|
|
|
234
235
|
**Mocking strategy for external services:**
|
|
235
236
|
Follow the rules in `../references/testing-contracts.md`. Key points: mock at HTTP boundary (not client), fixtures must match `schema.yml`, include error fixtures. Each contract test task must specify: (1) which HTTP mocking library, (2) which fixture file, (3) what the fixture contains (from `schema.yml`).
|
|
236
237
|
|
|
238
|
+
**Test data:** Do not add tasks that ask the user for sample data or example scenarios. Per `../references/testing-contracts.md` (Test Data Generation), every test task that needs data must name the generation source — the project's existing data factory / property-based tool (`factory_boy`, `@faker-js/faker`, `model_bakery`, `Hypothesis`, `fast-check`, etc., detected from `config.tools` / existing test imports), and which fields the scenario pins vs. lets the factory fill. AI-authored literal data is a last resort: only plan it when the user explicitly asked for generated data, or no factory exists and a specific crafted value is needed — and say which in the task. If the project has no data-factory tooling and the change clearly needs one, surface adopting it as a build-vs-buy line, don't smuggle the dependency into an implementation task.
|
|
239
|
+
|
|
237
240
|
**From manifest Assumptions:**
|
|
238
241
|
- Each unvalidated assumption on the critical path → a verification task (spike, proof-of-concept, or integration test that confirms the assumption holds)
|
|
239
242
|
- If an assumption turns out to be wrong during planning, flag it to the user — it may invalidate the change
|
|
@@ -75,31 +75,29 @@ Compose the PR body from grimoire artifacts:
|
|
|
75
75
|
- Security-tagged scenarios verified: X/Y
|
|
76
76
|
<if any security findings from review/verify exist, summarize the resolution>
|
|
77
77
|
|
|
78
|
+
## Deployment impact
|
|
79
|
+
<only include if the change has a downtime-incurring or backward-incompatible schema migration (per the Data Engineer persona, `../references/review-personas.md` §4.5)>
|
|
80
|
+
- ⚠️ **Incurs downtime**: <which migration and why — e.g. "ALTER on `users` locks the table during the column rewrite">
|
|
81
|
+
- ⚠️ **Breaking schema change**: <backward-incompatible — old app versions break mid-deploy>
|
|
82
|
+
- Decision: <maintenance window accepted | split into expand→contract | rollout plan>
|
|
83
|
+
|
|
78
84
|
Change: <change-id>
|
|
79
85
|
```
|
|
80
86
|
|
|
87
|
+
**Deployment impact (when to include):** Scan `.grimoire/changes/<id>/data.yml` and the migration in the diff for a table-locking ALTER, a NOT NULL on a large table, a rename/retype, or any backward-incompatible schema change. If present, include the **Deployment impact** section and lead the PR summary with the `⚠️` line — this is the merge-time visibility the Data Engineer review requires; surfacing it only in review is not enough. No such migration → omit the section entirely.
|
|
88
|
+
|
|
81
89
|
**PR title:** Derive from manifest heading, following the project's commit style:
|
|
82
90
|
- conventional: `feat: add two-factor authentication`
|
|
83
91
|
- angular: `feat(auth): add two-factor authentication`
|
|
84
92
|
|
|
85
93
|
### 4. Post-Implementation Review (Optional)
|
|
86
|
-
If the user wants a review,
|
|
87
|
-
|
|
88
|
-
1. Get the diff: `git diff main...HEAD` (or the base branch)
|
|
89
|
-
2. Read `.grimoire/config.yaml` for `project.compliance` and check feature files for security tags
|
|
90
|
-
3. Feed the diff + PR description to the LLM with this prompt:
|
|
94
|
+
If the user wants a pre-merge review, **do NOT hand-roll a checklist** — apply the shared persona engine so self-review runs the *same rubrics as design review*: INVEST (PM), the YAGNI ladder + Rule of Three + Chesterton's Fence (Senior Engineer), STRIDE + LINDDUN + OWASP API Top 10 (Security), BVA/FIRST against the spec (QA), Expand–Contract + the deployment-impact flag (Data), then the Contrarian calibration pass.
|
|
91
95
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
> - Dependencies added that weren't in the plan
|
|
96
|
-
> - Files changed that aren't covered by the task list (scope creep)
|
|
97
|
-
> - Test quality: are step definitions making real assertions?
|
|
98
|
-
>
|
|
99
|
-
> **Security review** — scan changed files per `../references/security-compliance.md`: OWASP surface scan, security tag verification, compliance verification. Tag findings with OWASP/CWE.
|
|
100
|
-
> Flag issues as **blocker** or **suggestion**. Be concise.
|
|
96
|
+
1. Get the diff: `git diff <base>...HEAD`.
|
|
97
|
+
2. Apply `../references/review-personas.md` to that diff — same engine `grimoire-precommit-review` uses (it IS this review, pre-push). Run the **Diff review** path: build the Project Briefing (§1), pick personas via the diff-review complexity table (§3), apply the materiality / steel-man / severity gates (§2/§2a/§2b), then the Contrarian pass (§4.8). If the branch is already pushed, defer to `grimoire-pr-review` instead — identical engine, fuller PR metadata.
|
|
98
|
+
3. Present the engine's findings alongside the PR description. Blockers → fix before creating the PR (or open a draft). Carry any Data-persona downtime/breaking flag into the Deployment-impact section above.
|
|
101
99
|
|
|
102
|
-
|
|
100
|
+
One review engine, one set of rubrics — design and code alike. This skill no longer keeps a separate, lighter review prompt (DRY).
|
|
103
101
|
|
|
104
102
|
### 5. Create PR
|
|
105
103
|
Offer to create the PR:
|
|
@@ -124,6 +122,7 @@ After PR creation:
|
|
|
124
122
|
- The PR description must trace back to grimoire artifacts — this is what makes the audit trail work.
|
|
125
123
|
- Include the `Change: <change-id>` line at the bottom so `grimoire trace` can find it.
|
|
126
124
|
- Don't pad the description with boilerplate. Keep it factual: what changed, why, how to verify.
|
|
125
|
+
- A downtime-incurring or backward-incompatible schema migration MUST carry a `⚠️` flag in the PR body (Deployment impact section) — never let it merge silently. Zero-downtime is not forced; *visibility* of the cost is.
|
|
127
126
|
- The post-implementation review is optional and quick — it's not a replacement for the design review, just a sanity check on the actual code.
|
|
128
127
|
- If tasks are incomplete, warn the user but don't block PR creation — they may want a draft PR.
|
|
129
128
|
|
|
@@ -34,7 +34,7 @@ Each debt item in the register follows a structured format influenced by the Cod
|
|
|
34
34
|
|
|
35
35
|
**Required fields:**
|
|
36
36
|
- `id` — unique identifier (debt-NNN, monotonically increasing)
|
|
37
|
-
- `category` — one of: `hotspot`, `structural_bloat`, `data_structure`, `circular_dependency`, `dependency_staleness`, `broken_promise`, `duplication`, `dead_code`, `test_debt`, `pattern_divergence`, `comment_noise`
|
|
37
|
+
- `category` — one of: `hotspot`, `structural_bloat`, `data_structure`, `circular_dependency`, `dependency_staleness`, `broken_promise`, `duplication`, `reinvented_platform`, `dead_code`, `test_debt`, `pattern_divergence`, `comment_noise`
|
|
38
38
|
- `severity` — `high`, `medium`, or `low`
|
|
39
39
|
- `location` — file path (with optional `:line`), or `path ↔ path` for relationships
|
|
40
40
|
- `title` — short human-readable summary
|
|
@@ -114,6 +114,7 @@ Run applicable scans from the categories in `../references/refactor-scan-categor
|
|
|
114
114
|
- **Dependency staleness** — uses `config.tools.dep_audit` or package manager outdated commands
|
|
115
115
|
- **Broken promises** — aged TODO/FIXME/HACK comments via `grep` + `git blame`
|
|
116
116
|
- **Duplication** — textual clones via `config.tools.duplicates` or `grimoire health` (config-driven duplicates metric); plus semantic duplicate detection via `search_graph(semantic_query=[...])` to find re-implementations under different names (requires `codebase-memory-mcp`)
|
|
117
|
+
- **Platform/stdlib reinvention** (YAGNI) — code or a dependency hand-rolling what the stdlib or runtime platform already ships (`moment`→`Intl`, a date-picker lib→`<input type="date">`, a hand-written deep-clone→`structuredClone`); the don't-reinvent-the-wheel principle (principles.md §3) as a scan. See `../references/refactor-scan-categories.md` §2L
|
|
117
118
|
- **Dead code** — uses `config.tools.dead_code` or `codebase-memory-mcp` graph queries
|
|
118
119
|
- **Test debt** — high complexity + low coverage
|
|
119
120
|
- **Pattern divergence** — code that contradicts established codebase patterns; uses `codebase-memory-mcp` peer group analysis + hallucinated reference detection (skip if graph not indexed)
|
|
@@ -195,6 +196,7 @@ After the first batch, ask if the user wants to see more or start working on the
|
|
|
195
196
|
- "This 34-method class has 5 distinct responsibilities — extracting them would make each class testable independently"
|
|
196
197
|
- "This 28-field config type is used in 3 contexts — splitting it eliminates 22 optional fields and makes each usage self-documenting"
|
|
197
198
|
- "Flattening this 4-level nested structure into 2 normalized types would eliminate the deep property chains throughout the codebase"
|
|
199
|
+
- "This `EmailValidator` class (27 lines) is `\"@\" in email` — real validation is the confirmation mail" / "`moment` is imported for one format call — `Intl.DateTimeFormat`, 0 deps" (always name the concrete stdlib/native replacement and the lines or dependency it removes)
|
|
198
200
|
|
|
199
201
|
### 6. Create Grimoire Changes
|
|
200
202
|
|
|
@@ -67,7 +67,7 @@ Fail: a private function with three guard clauses before its one real line.
|
|
|
67
67
|
|
|
68
68
|
Fail: any local named `data`, `result`, `temp`, `obj`, `item`, or `value` when a more specific name fits.
|
|
69
69
|
|
|
70
|
-
### 6. No premature abstraction
|
|
70
|
+
### 6. No premature abstraction (YAGNI)
|
|
71
71
|
|
|
72
72
|
Three near-identical copies is acceptable. Extract on the fourth, or when the shared shape is stable and named. Wrong abstractions are harder to undo than duplication.
|
|
73
73
|
|
|
@@ -52,15 +52,16 @@ grimoire mechanism that duplicates it.
|
|
|
52
52
|
tracking is a fractured landscape), don't force-adopt one *and* don't build a
|
|
53
53
|
general-purpose clone. Keep any local mechanism narrow and purpose-scoped.
|
|
54
54
|
|
|
55
|
-
## 4. Keep it simple (KISS)
|
|
55
|
+
## 4. Keep it simple (KISS / YAGNI)
|
|
56
56
|
|
|
57
57
|
The simplest thing that fully solves the *stated* problem wins.
|
|
58
58
|
|
|
59
59
|
- Least code, fewest new files, smallest surface area. A few lines in an existing
|
|
60
60
|
file beats a new module. A standard-library call beats a new dependency. Inline
|
|
61
61
|
beats a one-line wrapper.
|
|
62
|
-
-
|
|
63
|
-
caller. No speculative generality "for a future
|
|
62
|
+
- **YAGNI — no premature abstraction.** You aren't gonna need it. No `BaseX`/factory/
|
|
63
|
+
strategy/config-object for a single caller. No speculative generality "for a future
|
|
64
|
+
second caller" that doesn't exist. Speculative need → skip it, say so in one line.
|
|
64
65
|
- Solve the problem in front of you, not the imagined one. Non-goals are real scope
|
|
65
66
|
boundaries — do not plan or build past them.
|
|
66
67
|
- **Tell:** an abstraction, indirection, or dependency whose only justification is a
|
|
@@ -252,3 +252,18 @@ Manual triage: open each hit and check whether a multi-line docstring follows. P
|
|
|
252
252
|
- low = multi-line docstrings on private functions
|
|
253
253
|
|
|
254
254
|
**Suggested action:** Delete restatement comments. Move task/PR references to commit history. Trim private function docstrings to one line or remove entirely.
|
|
255
|
+
|
|
256
|
+
## 2L. Platform / Stdlib Reinvention (YAGNI)
|
|
257
|
+
|
|
258
|
+
Code or a dependency doing a job the standard library or the runtime platform already ships — `principles.md` §3 (don't reinvent the wheel) as a scan. Distinct from duplication (§2g), which finds *internal* re-implementation; this finds reinvention of things that live *outside* the repo.
|
|
259
|
+
|
|
260
|
+
**How to scan (qualitative — no single tool):**
|
|
261
|
+
- **Hand-rolled stdlib:** scan for what the language already covers — date math, URL/query parsing, grouping/uniq, deep clone, debounce/throttle, deep-merge, retry, UUID, base64, hashing. Stack-specific homes: Python `functools`/`itertools`/`collections`/`datetime`; JS `Intl`, `URLSearchParams`, `structuredClone`, `Array`/`Object` methods.
|
|
262
|
+
- **Native-platform reinvention:** a JS lib for what HTML/CSS/the browser does (`<input type="date">`, `<dialog>`, `Intl.DateTimeFormat`, `:has()`), app code for what a DB constraint/index enforces, a polyfill for a baseline-supported feature.
|
|
263
|
+
- **Removable dependency:** cross-reference `package.json` / `pyproject.toml` for a dependency whose whole job now lives in the stdlib or platform — `moment` → `Intl`/`Temporal`, `lodash.clonedeep` → `structuredClone`, `left-pad` → `String.padStart`.
|
|
264
|
+
|
|
265
|
+
**Flag when** the replacement is a stdlib call or native feature of equal-or-better correctness. **Name the function/feature and the line count (or dependency) it removes** — a finding the author can't act on is noise.
|
|
266
|
+
|
|
267
|
+
**Severity:** high = a removable dependency, medium = a multi-line hand-rolled stdlib equivalent, low = a one-or-two-line shrink.
|
|
268
|
+
|
|
269
|
+
**Suggested action:** replace with the named stdlib/native feature; note the dependency drop if any.
|
|
@@ -158,6 +158,8 @@ Each persona below names what it evaluates. The calling skill points the persona
|
|
|
158
158
|
|
|
159
159
|
Skip if the change is purely internal (no user-facing behavior).
|
|
160
160
|
|
|
161
|
+
**Anchor — INVEST + outcome over output.** Judge the change as a well-formed unit of value, using the review-relevant slice of INVEST: **V**aluable (solves a real user problem — not gold-plating), **S**mall/scoped (one coherent outcome, not a grab-bag), **T**estable (acceptance is checkable from the artifact in front of you). Review the *outcome* the change targets, not output volume. INVEST is a lens on what's already specified — the PM persona adds no scope of its own; a "nice to have" it invents is gold-plating, the same failure it flags in others.
|
|
162
|
+
|
|
161
163
|
Evaluate:
|
|
162
164
|
- **Outcome**: Manifest's Why states the problem and how success is measured? Mechanism vs outcome ("add an endpoint" vs "users can reset passwords")?
|
|
163
165
|
- **Coverage**: Do feature scenarios cover all user-facing behaviors? Missing edge cases, error states, alternate flows?
|
|
@@ -172,11 +174,12 @@ Treat accepted decisions as constraints — cite ADR ID before suggesting an ove
|
|
|
172
174
|
|
|
173
175
|
Evaluate:
|
|
174
176
|
- **Build vs Buy** *(design only)*: Was prior art research thorough? If a well-maintained library exists that the manifest doesn't mention, **blocker**.
|
|
175
|
-
- **Simplicity**:
|
|
177
|
+
- **Simplicity (YAGNI ladder)**: Walk `../references/principles.md` §4 in order — could it not exist (YAGNI), does the stdlib do it, does a native platform feature cover it, does an installed dep solve it, is it one line? Flag the first rung the code skipped: unnecessary abstraction, indirection, premature generalization, config-driven where a direct call would do. Abstract on the third real use, not the first (**Rule of Three**) — two copies is not yet a pattern. Every finding **names the concrete replacement** (`stdlib: 27-line validator → "@" in email, 1 line`), not just "this seems complex" — a finding the author can't act on is noise.
|
|
176
178
|
- **Architecture**: Decisions sensible for this codebase? Will this paint us into a corner?
|
|
177
179
|
- **Conventions** *(PR/pre-commit)*: Does new code match file layout, naming, and patterns already in the touched areas? Check `.grimoire/docs/<area>.md` if present.
|
|
178
|
-
- **Reuse**: Existing utilities
|
|
180
|
+
- **Reuse / reinvention**: Existing utilities re-implemented (`grep` similar names; area-doc reusable lists), or stdlib / native-platform / installed-dep functionality hand-rolled (principles.md §3 — don't reinvent the wheel). Name what already does the job.
|
|
179
181
|
- **Dead code** *(PR/pre-commit)*: Functions added but not called, imports unused, commented-out code, stubs with no implementation.
|
|
182
|
+
- **Safe deletion / refactor (Chesterton's Fence)**: Before recommending code be deleted, inlined, or "simplified away," state *why it exists* — a guard, a workaround, a non-obvious caller. If you can't explain the fence, don't tear it down — ask. YAGNI removes the speculative, never the load-bearing-but-unobvious.
|
|
180
183
|
- **Scope creep** *(PR/pre-commit)*: Files changed outside the scope implied by the change-id or manifest. Formatting-only changes to unrelated files = noise.
|
|
181
184
|
- **Error handling**: Errors handled at boundaries? Internal code shouldn't be littered with defensive checks; external inputs must be validated.
|
|
182
185
|
- **Tests**: New behaviors have tests? Tests make real assertions (not just `assert true` / mock everything)? Check `./testing-contracts.md` if framework matches.
|
|
@@ -205,12 +208,24 @@ For every new entry point, data flow, or trust boundary:
|
|
|
205
208
|
|
|
206
209
|
Skip categories that don't apply.
|
|
207
210
|
|
|
211
|
+
#### LINDDUN (privacy) — engage only when briefing data-sensitivity is pii/financial/phi, or the change touches personal data
|
|
212
|
+
|
|
213
|
+
STRIDE covers security, not privacy. For flows that collect, store, or share personal data, scan the privacy threats STRIDE under-covers:
|
|
214
|
+
|
|
215
|
+
- **Linking / Identifying**: can records be correlated to one person, or a dataset/log de-anonymize someone who shouldn't be identifiable?
|
|
216
|
+
- **Data disclosure (minimization)**: is each collected field minimized, purpose-bound, and retention-limited? (GDPR data-minimization) — excess collection/retention is the finding.
|
|
217
|
+
- **Detecting**: presence/membership inferable via side channels (timing, error-message diffs)?
|
|
218
|
+
- **Non-compliance**: storage/retention violates `project.compliance` or an accepted ADR?
|
|
219
|
+
|
|
220
|
+
Most reviews: only **Data disclosure** + **Linking/Identifying** apply — skip the rest unless the flow warrants. (Full LINDDUN: Linking, Identifying, Non-repudiation, Detecting, Disclosure, Unawareness, Non-compliance.)
|
|
221
|
+
|
|
208
222
|
#### Code-level scan *(PR/pre-commit only)*
|
|
209
223
|
|
|
210
224
|
- **Secrets**: Grep diff for hardcoded keys, tokens, passwords, cloud credentials, JWT secrets. Any hit = **blocker**.
|
|
211
225
|
- **Injection**: Raw SQL with string concatenation, shell-exec with user input, `eval`/`exec`, unsafe deserialization. Tag OWASP + CWE.
|
|
212
226
|
- **Input validation**: New endpoints without schema validation, file uploads without size/type limits, path params used directly in filesystem calls.
|
|
213
227
|
- **Auth**: New routes/handlers missing auth decorators / middleware. Compare against neighbors in same file.
|
|
228
|
+
- **API authorization (OWASP API Top 10 2023)**: new/changed endpoints — object-level authz (**BOLA**: can user A fetch user B's object by id?), property-level (**BOPLA**: mass-assignment / over-exposed response fields), SSRF on user-supplied URLs. The API-specific complement to the generic Top 10.
|
|
214
229
|
- **Dependencies**: New packages — pinned to exact version (no `^`/`~`/`>=`/`*`), lockfile updated and committed with integrity hashes, name is real (typosquat risk), `dep_audit` output clean if committed. Flag packages with zero downloads, recent ownership transfer (~90 days), suspicious new maintainers, or post-install scripts. Unpinned dep or missing lockfile entry on a new package = **blocker** (see `./security-compliance.md` § Supply Chain Defense).
|
|
215
230
|
- **PII**: New logging that could emit PII; new storage of personal data without encryption.
|
|
216
231
|
- **Cross-service auth**: If `context.yml` lists related services, are service-to-service calls authenticated?
|
|
@@ -227,20 +242,21 @@ Every security finding gets OWASP 2021 + CWE tags. See CWE quick-reference in `.
|
|
|
227
242
|
|
|
228
243
|
Skip if change is purely internal.
|
|
229
244
|
|
|
245
|
+
**Mandate — review the *testing of the spec*, not the spec itself.** QA owns exactly one question: *is what the spec already defines adequately and honestly tested?* It does **not** own feature completeness or scope — the Product Manager owns coverage of user-facing behaviors, the Senior Engineer owns build correctness. QA never expands the requirement. A behavior, edge case, or failure mode the spec does not define is a **scope question routed to the PM**, never a QA finding. YAGNI: demand no test for behavior nobody asked for. This persona is the most prone to over-reach — if a finding would *add* required behavior, it is out of lane; drop it.
|
|
246
|
+
|
|
230
247
|
**Coverage-gap routing (apply before recommending any new artifact).** A coverage gap does NOT default to "write a `.feature`." Route each gap to its one home using the feature-file admission test in `../grimoire-draft/SKILL.md` (§ jurisdiction table + the four admission gates):
|
|
231
248
|
- A `.feature` scenario is warranted **only** for an actor-observable behavior that passes all four gates (external actor, observable outcome, domain language, survives reimplementation).
|
|
232
249
|
- An invariant — observability/logging guarantee, perf budget, security control, compliance rule — is a **constraint**. Recommend it be recorded/verified in `.grimoire/docs/constraints.md`, never as a new `.feature`.
|
|
233
250
|
- When a behavior gap belongs in features, the default is **extend an existing feature file** in the same domain — recommend a new file only if no existing file fits, and say which were considered. Don't propose a `.feature` per finding.
|
|
234
251
|
- Test gaps for already-specified behavior are a *missing test*, not a missing feature — recommend the test, not a new spec.
|
|
235
252
|
|
|
236
|
-
Evaluate:
|
|
237
|
-
- **Test presence**:
|
|
238
|
-
- **Test quality**: Tests
|
|
239
|
-
- **Negative paths**:
|
|
240
|
-
- **Edge cases**:
|
|
241
|
-
- **
|
|
242
|
-
- **
|
|
243
|
-
- **Accessibility**: New UI — keyboard nav, aria labels, contrast?
|
|
253
|
+
Evaluate (every check anchored to behavior the spec / feature already defines):
|
|
254
|
+
- **Test presence**: Does every behavior the spec defines have a test? Every scenario in a linked feature file have step definitions? Missing test for a *specified* behavior → recommend the test. A behavior with no spec is not a QA finding — route to PM.
|
|
255
|
+
- **Test quality (FIRST + behavior-not-implementation)**: Tests assert real outputs, not that code "ran"? Tests **F**ast / **I**solated / **R**epeatable / **S**elf-validating / **T**imely? Over-mocked tests that verify the mock instead of the behavior, or tests coupled to implementation internals rather than observable behavior = QA's highest-value finding. This is the lane — spend the attention here.
|
|
256
|
+
- **Negative paths**: Where the spec defines a failure behavior (an error, a rejection, a rollback), is it tested? Do **not** invent failure modes the spec is silent on.
|
|
257
|
+
- **Edge cases (Boundary Value Analysis / Equivalence Partitioning)**: For input the spec gives a range or set, test the boundaries and one value per equivalence class — but only for ranges the spec, a scenario, or a `constraints.md` entry actually names. **BVA bounds "enough edge cases" to the spec's stated values; it does not license inventing scenarios.** An unspecified edge case ("what about concurrent users / interruptions?") is a scope question for the PM — drop it, don't file it as a test gap.
|
|
258
|
+
- **Regression risk** *(PR/pre-commit)*: Which existing tests cover the touched code? Were any removed or weakened? A silently weakened assertion is a **blocker**.
|
|
259
|
+
- **Out of lane — defer, don't duplicate**: Observability is a **constraint** (verify it's in `constraints.md`; never a `.feature`). Accessibility belongs to the Adversarial User personas (§4.7). Note in one line and defer — do not re-file their findings as QA blockers.
|
|
244
260
|
|
|
245
261
|
### 4.5 Data Engineer
|
|
246
262
|
|
|
@@ -251,11 +267,12 @@ Read:
|
|
|
251
267
|
- `.grimoire/docs/data/schema.yml` — current baseline
|
|
252
268
|
|
|
253
269
|
Evaluate:
|
|
254
|
-
- **Migrations**:
|
|
270
|
+
- **Migrations — name the deployment consequence, don't mandate zero-downtime**: State plainly what the change costs to ship — does this ALTER **lock the table** (a downtime-incurring change)? Is it **backward-incompatible** (old app versions break mid-deploy)? Is it **irreversible**? Zero-downtime is *not* assumed — many projects accept a maintenance window. Surface the cost as a decision for the human ("this rename locks `users` and breaks rolling deploy — confirm a downtime window is acceptable, or split expand→contract to avoid it"), **not** an automatic blocker. **Expand–Contract / Parallel Change** (add new → backfill → switch reads → drop old) is the *option* offered when the project wants zero-downtime, never a requirement. **A downtime-incurring or backward-incompatible migration MUST be flagged in the PR / merge-request body** (a one-line `⚠️ incurs downtime` / `breaking schema change` note) so it's visible at merge — surfacing it only in the review is not enough.
|
|
255
271
|
- **Indexes**: New foreign keys with no index? New query patterns against unindexed columns?
|
|
256
272
|
- **Naming**: New fields follow existing schema conventions?
|
|
257
|
-
- **
|
|
258
|
-
- **
|
|
273
|
+
- **Data minimization (PII)**: New columns holding personal data — each field necessary, purpose-bound, retention-limited, encrypted at rest if sensitive? Excess PII storage = finding. Pairs with the Security persona's LINDDUN Data-disclosure check (§4.3).
|
|
274
|
+
- **Backward / forward compatibility (named outcome, not forced)**: State *whether* the change is backward-compatible (old readers survive) and forward-compatible (old code + new schema holds during deploy). Report the outcome so breaking is a *conscious* choice, not a surprise — the project decides if it's acceptable; don't force compatibility. If broken, it rides the same PR / merge-request flag as a downtime change.
|
|
275
|
+
- **Breaking contract**: `data.yml` vs `schema.yml` — removed/renamed/retyped response fields or new required request fields = **blocker** unless migration path documented. (This is the silent-break exception: breaking a *documented consumer contract* without noting it harms other people's code — distinct from a self-contained downtime choice above.)
|
|
259
276
|
- **Transactions**: Multi-step writes wrapped in a transaction?
|
|
260
277
|
- **External APIs** *(design)*: New API dependency — `schema_ref` pointing to a stable spec? Fallback if API unavailable?
|
|
261
278
|
|
|
@@ -18,6 +18,25 @@ Loaded by skills that involve writing tests, mocking external services, or verif
|
|
|
18
18
|
- When the contract changes, the fixture must change — stale fixtures are false-positive tests
|
|
19
19
|
- Include at least one error response fixture per external API (matching `error_response` in `schema.yml`)
|
|
20
20
|
|
|
21
|
+
## Test Data Generation
|
|
22
|
+
|
|
23
|
+
**Do not ask the user for test data, sample records, or example scenarios.** Scenarios are derived from the spec (`.feature` scenarios, constraints, contracts); the *data* that exercises them is generated. Asking the user to supply fixtures by hand front-loads the work onto them and produces brittle, hand-curated values. Generate it instead, in this order of preference:
|
|
24
|
+
|
|
25
|
+
1. **Project's standard data factory / generator (default).** Check `config.tools` and existing test imports for the tool already in use and follow it:
|
|
26
|
+
- **Python**: `factory_boy`, `model_bakery`/`model-mommy`, `faker`, `Hypothesis` (property-based)
|
|
27
|
+
- **JS/TS**: `@faker-js/faker`, `fishery`, `test-data-bot`, `fast-check` (property-based)
|
|
28
|
+
- **Ruby**: `factory_bot`, `faker`
|
|
29
|
+
- **Go**: `gofakeit`, table-driven fixtures
|
|
30
|
+
- **Java/Kotlin**: `instancio`, `easy-random`, `jqwik` (property-based)
|
|
31
|
+
|
|
32
|
+
Build records through the factory, override only the fields the scenario actually pins, and let the tool fill the rest. For invariants ("never accepts a negative amount", "round-trips any valid payload"), prefer **property-based generation** (Hypothesis / fast-check / jqwik) over a handful of literals — it covers the input space the spec describes instead of one example.
|
|
33
|
+
|
|
34
|
+
2. **Recorded / fixture responses** for external-API contracts — concrete instances of the `schema.yml` contract (see Fixture Management above). These are captured shapes, not invented ones.
|
|
35
|
+
|
|
36
|
+
3. **AI-authored literal test data — last resort, only on explicit instruction.** Hand-writing literal records (the agent inventing `{name: "Acme Corp", amount: 4200, ...}`) is permitted **only when the user explicitly asks for generated test data**, or no factory tooling exists in the project *and* the case needs one specific crafted value (a known edge constant, a regression repro). When you fall back to this, say so — note in the task/test why a factory wasn't used. Never silently invent a dataset.
|
|
37
|
+
|
|
38
|
+
No data-factory tool configured and the project has tests? Match whatever those tests already do. Proposing a *new* factory dependency is a plan-stage decision, not something to pull in mid-implementation.
|
|
39
|
+
|
|
21
40
|
## Contract Test Requirements
|
|
22
41
|
|
|
23
42
|
Every external API integration needs contract tests that assert:
|