its-magic 0.1.2-37 → 0.1.2-39
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/installer.ps1 +20 -0
- package/installer.py +66 -2
- package/installer.sh +22 -0
- package/package.json +2 -1
- package/scripts/check_intake_template_parity.py +1 -0
- package/scripts/intake_evidence_lib.py +413 -10
- package/scripts/intake_evidence_validate.py +2 -2
- package/scripts/materialize_codebase_map.py +184 -0
- package/template/.cursor/agents/po.mdc +19 -0
- package/template/.cursor/commands/architecture.md +12 -0
- package/template/.cursor/commands/ask.md +11 -0
- package/template/.cursor/commands/auto.md +20 -2
- package/template/.cursor/commands/intake.md +64 -9
- package/template/.cursor/commands/map-codebase.md +18 -1
- package/template/.cursor/commands/refresh-context.md +7 -0
- package/template/.cursor/rules/core.mdc +5 -0
- package/template/docs/engineering/artifact-ownership-policy.md +1 -1
- package/template/docs/engineering/context/installer-owned-paths.manifest +17 -0
- package/template/docs/engineering/runbook.md +76 -2
- package/template/scripts/check_intake_template_parity.py +1 -0
- package/template/scripts/enforce-triad-hot-surface.py +626 -0
- package/template/scripts/intake_bug_resume_brief_refresh.py +303 -0
- package/template/scripts/intake_evidence_lib.py +413 -10
- package/template/scripts/intake_evidence_validate.py +2 -2
- package/template/scripts/materialize_codebase_map.py +184 -0
|
@@ -115,6 +115,25 @@ Mandatory intake question packs (`US-0068` / `DEC-0050`):
|
|
|
115
115
|
on failure emit deterministic codes (`INTAKE_REQUIRED_TOPIC_MISSING`,
|
|
116
116
|
`INTAKE_ASSUMPTION_CONFIRMATION_REQUIRED`, umbrella `INTAKE_PERSISTENCE_BLOCKED`) and **abort** writes.
|
|
117
117
|
**`INTAKE_GUIDED_MODE=0`** uses the **same** validation pipeline as guided mode.
|
|
118
|
+
- **US-0083 / DEC-0067**: for explicitly delegated unresolved required topics, set
|
|
119
|
+
`topic_coverage[].satisfied_by=delegation_ref` with bounded metadata
|
|
120
|
+
(`delegation_scope`, `delegation_rationale`, `delegation_confidence=low|medium|high`);
|
|
121
|
+
missing/malformed delegation rows fail closed with
|
|
122
|
+
`INTAKE_DELEGATION_EVIDENCE_MISSING` / `INTAKE_DELEGATION_EVIDENCE_INVALID`
|
|
123
|
+
under umbrella `INTAKE_PERSISTENCE_BLOCKED`.
|
|
124
|
+
- **US-0083 AC-1 accounting**: if equivalent evidence was already captured, avoid repetitive
|
|
125
|
+
re-asking by recording `evidence_source=equivalent_evidence_ref` plus
|
|
126
|
+
`equivalent_evidence_ref` for that `topic_coverage` row (required-topic accounting stays explicit).
|
|
127
|
+
- **US-0081 / DEC-0064**: for `first-intake-pack` (first/new/broad) persist
|
|
128
|
+
full-plan coverage contract fields and block persistence unless:
|
|
129
|
+
- `plan_area_inventory` is normalized and has unique valid `plan_area_id`,
|
|
130
|
+
- `plan_area_coverage` has exactly one row per `plan_area_id`,
|
|
131
|
+
- each row uses xor mapping (`story_ids[]` or `deferred_ref` +
|
|
132
|
+
`deferred_reason`),
|
|
133
|
+
- `coverage_complete=true` matches derived validator result.
|
|
134
|
+
Emit deterministic subcodes under umbrella `INTAKE_PERSISTENCE_BLOCKED`:
|
|
135
|
+
`INTAKE_PLAN_COVERAGE_MISSING`, `INTAKE_PLAN_AREA_ID_INVALID`,
|
|
136
|
+
`INTAKE_PLAN_COVERAGE_CONTRACT_INVALID`, `INTAKE_PLAN_DEFERRED_REF_MISSING`.
|
|
118
137
|
- **US-0079 / DEC-0061**: for **defect** work use **`INTAKE_WORK_ITEM_KIND=bug`** and/or **`/intake bug`**;
|
|
119
138
|
run **`python scripts/intake_bug_routing_guard.py`** when allocating **`US-xxxx`** for ambiguous prose;
|
|
120
139
|
persist **`BUG-####`** under **`## Bug issues (canonical)`** with required fields and validate with
|
|
@@ -86,6 +86,18 @@ description: "its-magic architecture: define approach, risks, and decisions."
|
|
|
86
86
|
`ARTIFACT_HOT_SURFACE_OVERSIZE`,
|
|
87
87
|
- preserve non-target history in archive packs only (never delete unrelated
|
|
88
88
|
story sections without archival evidence).
|
|
89
|
+
10. Codebase map lifecycle gate (US-0082 / DEC-0065) — before handoff to
|
|
90
|
+
`/sprint-plan`, from repository root run:
|
|
91
|
+
`python scripts/materialize_codebase_map.py --trigger architecture`
|
|
92
|
+
- On success, stdout includes `[CODEBASE_MAP_OK]` (created, noop, or
|
|
93
|
+
`preserved_existing` when a non-bootstrap map is left untouched).
|
|
94
|
+
- On `CODEBASE_MAP_BLOCKED:<subreason>` or non-zero exit after a failed
|
|
95
|
+
materialization policy, stop the phase with that token; remediation is on
|
|
96
|
+
stdout (run `/map-codebase`; see runbook **Codebase map bootstrap** and
|
|
97
|
+
`docs/engineering/architecture.md` **# US-0082**).
|
|
98
|
+
- The script writes only `docs/engineering/codebase-map.md` and
|
|
99
|
+
`docs/engineering/dependencies.json` (same surfaces as `/map-codebase`);
|
|
100
|
+
do not use it to bulk-append `state.md`.
|
|
89
101
|
|
|
90
102
|
## Cross-phase ownership guard (US-0061 / DEC-0043)
|
|
91
103
|
|
|
@@ -35,6 +35,17 @@ Preferred read order:
|
|
|
35
35
|
- Reference stories (**`US-xxxx`**), bug issues (**`BUG-####`**), decisions (**`DEC-xxxx`**), and tasks (**`T-xxx`**) by ID.
|
|
36
36
|
- Suggest next actions but do not execute them.
|
|
37
37
|
- If the question reveals a bug or feature idea, suggest running `/intake`.
|
|
38
|
+
- For **`docs/engineering/codebase-map.md`** bootstrap vs manual refresh, cite
|
|
39
|
+
**US-0082 / DEC-0065**: primary lifecycle owner is **`/architecture`**
|
|
40
|
+
(materializer: `python scripts/materialize_codebase_map.py --trigger architecture`);
|
|
41
|
+
optional policy-gated refresh at **`/refresh-context`** when
|
|
42
|
+
`CODEBASE_MAP_REFRESH_ON_ROLLOVER=1`; explicit/manual full pass remains
|
|
43
|
+
**`/map-codebase`**. Deterministic diagnostics: `CODEBASE_MAP_MISSING`,
|
|
44
|
+
`CODEBASE_MAP_BLOCKED:<subreason>` (see runbook **Codebase map bootstrap**).
|
|
45
|
+
- For first/new/broad intake policy questions, cite **US-0081 / DEC-0064**:
|
|
46
|
+
complete-plan mapping (`plan_area_inventory`, `plan_area_coverage`,
|
|
47
|
+
`coverage_complete`) is required, and persistence blocks on
|
|
48
|
+
`INTAKE_PLAN_COVERAGE_MISSING` under umbrella `INTAKE_PERSISTENCE_BLOCKED`.
|
|
38
49
|
|
|
39
50
|
## Steps
|
|
40
51
|
1. Read minimal targeted sections first (narrow-read policy).
|
|
@@ -9,12 +9,30 @@ description: "its-magic auto: deterministic continuation orchestrator."
|
|
|
9
9
|
- tech-lead
|
|
10
10
|
|
|
11
11
|
## Execution model
|
|
12
|
-
- `/auto` is
|
|
13
|
-
-
|
|
12
|
+
- `/auto` is a **spawn-only orchestrator**: it schedules materialization, spawns
|
|
13
|
+
fresh **phase-role** subagents, and verifies phase boundaries—it **must not**
|
|
14
|
+
execute lifecycle phase work, perform phase-role duties, or author **phase
|
|
15
|
+
deliverables** in the orchestrator context.
|
|
16
|
+
- For each phase, **spawn a fresh subagent** for that phase’s canonical role;
|
|
17
|
+
phase output must arrive only via artifacts and handoff files (no in-turn
|
|
18
|
+
orchestrator execution of that phase).
|
|
14
19
|
- Phase context transfer happens only through artifacts and handoff files.
|
|
15
20
|
- Scope is process/workflow orchestration only. Do not claim runtime product
|
|
16
21
|
orchestration changes.
|
|
17
22
|
|
|
23
|
+
## Spawn-boundary integrity (BUG-0006)
|
|
24
|
+
|
|
25
|
+
- **Forbidden**: treating the orchestrator turn as the executor of a lifecycle
|
|
26
|
+
phase (for example running **`architecture`**, **`execute`**, **`qa`**, or any
|
|
27
|
+
other **`phase_id`** in the orchestrator instead of spawning the required
|
|
28
|
+
subagent).
|
|
29
|
+
- **Fail fast** with **`AUTO_ORCHESTRATOR_PHASE_EXECUTION`**. **Remediation**:
|
|
30
|
+
stop; spawn a **fresh** subagent for the canonical **`phase_id`** and **`role`**
|
|
31
|
+
per the phase→role matrix (**DEC-0051**); do not merge phase output into
|
|
32
|
+
orchestrator turns. **Distinct from** **`PHASE_CONTEXT_ISOLATION_VIOLATION`**
|
|
33
|
+
(wrong writer / isolation break) and **`RUNTIME_PROOF_*`** / **`PHASE_ROLE_*`**
|
|
34
|
+
families—do not overload those codes for a missing-spawn violation.
|
|
35
|
+
|
|
18
36
|
## Full specification (US-0080 / DEC-0062)
|
|
19
37
|
|
|
20
38
|
Long prose, expanded mode semantics, and **Steps 1–13** detail live in
|
|
@@ -21,6 +21,7 @@ description: "its-magic intake: clarify idea and capture story + acceptance."
|
|
|
21
21
|
- `docs/product/backlog.md`
|
|
22
22
|
- `docs/product/acceptance.md`
|
|
23
23
|
- `handoffs/po_to_tl.md`
|
|
24
|
+
- `handoffs/resume_brief.md` (required on successful **`/intake bug`** persistence — **DEC-0069** / **BUG-0005**)
|
|
24
25
|
- Optional (when enabled): `docs/engineering/compatibility-report.md`
|
|
25
26
|
- Optional (when enabled): `docs/engineering/component-scope.md`
|
|
26
27
|
|
|
@@ -41,7 +42,7 @@ description: "its-magic intake: clarify idea and capture story + acceptance."
|
|
|
41
42
|
- For artifact mutations, enforce deterministic single-writer scope:
|
|
42
43
|
- establish writer identity (`writer_id`) and run identity (`intake_run_id`),
|
|
43
44
|
- bind writes to target artifacts (`backlog`, `acceptance`, `vision`,
|
|
44
|
-
`po_to_tl`) for this run.
|
|
45
|
+
`po_to_tl`, and when persisting bugs: `resume_brief` per **DEC-0069**) for this run.
|
|
45
46
|
- Drift guard semantics:
|
|
46
47
|
- self-write changes from the same `(writer_id, intake_run_id)` are valid and
|
|
47
48
|
must not trigger concurrent-writer blockers,
|
|
@@ -73,6 +74,7 @@ description: "its-magic intake: clarify idea and capture story + acceptance."
|
|
|
73
74
|
- `INTAKE_REQUIRED_TOPIC_MISSING`
|
|
74
75
|
- `INTAKE_REQUIRED_PACK_INCOMPLETE`
|
|
75
76
|
- `INTAKE_ASSUMPTION_CONFIRMATION_REQUIRED`
|
|
77
|
+
- `INTAKE_ANSWER_REF_NOT_TOPIC_DISTINCT` (**BUG-0007** / **R-0066** — see **Truthfulness** below)
|
|
76
78
|
- `INTAKE_PERSISTENCE_BLOCKED`
|
|
77
79
|
- Remediation guidance surface (mandatory on block):
|
|
78
80
|
- list `missing_topics`,
|
|
@@ -82,6 +84,9 @@ description: "its-magic intake: clarify idea and capture story + acceptance."
|
|
|
82
84
|
- `asked_topics`
|
|
83
85
|
- `missing_topics`
|
|
84
86
|
- `assumptions_confirmed`
|
|
87
|
+
- For `first-intake-pack` (first/new/broad): `plan_area_inventory`,
|
|
88
|
+
`plan_area_coverage`, `coverage_complete=true` (derived), and candidate story
|
|
89
|
+
set refs used for map validation (**US-0081** / **DEC-0064**).
|
|
85
90
|
|
|
86
91
|
## Interactive intake evidence gate (US-0078 / DEC-0060 / R-0055)
|
|
87
92
|
|
|
@@ -92,9 +97,13 @@ and assumption binding. **Do not** mutate `docs/product/backlog.md` or
|
|
|
92
97
|
|
|
93
98
|
- Bundle minimum (logical shape — serialize inline in handoff/backlog notes or JSON sidecar):
|
|
94
99
|
- `selected_pack`, `asked_topics`, `missing_topics`, `assumptions_confirmed`
|
|
95
|
-
- `topic_coverage[]`: `topic_key`, `satisfied_by` (`answer_ref` \| `assumption_confirmation_ref`),
|
|
100
|
+
- `topic_coverage[]`: `topic_key`, `satisfied_by` (`answer_ref` \| `assumption_confirmation_ref` \| `delegation_ref`),
|
|
96
101
|
`ref` (**`ie:`** per **DEC-0060**), `quoted_user_text`, per-row `intake_run_id` / `turn_index`
|
|
97
102
|
(or bundle-level `intake_run_id` shared by rows)
|
|
103
|
+
- Delegated required topic rows (`satisfied_by=delegation_ref`) must include:
|
|
104
|
+
`delegation_scope`, `delegation_rationale`, `delegation_confidence` (`low|medium|high`)
|
|
105
|
+
- Equivalent-evidence accounting (optional; suppress repetitive ask for already captured evidence):
|
|
106
|
+
`evidence_source=equivalent_evidence_ref` + `equivalent_evidence_ref` on the row
|
|
98
107
|
- Affirmative / non-placeholder `assumptions_confirmed`: `assumption_confirmation_ref`,
|
|
99
108
|
`assumption_confirmation_intake_run_id`, `assumption_confirmation_turn_index`,
|
|
100
109
|
`assumption_confirmation_quoted`
|
|
@@ -103,11 +112,41 @@ and assumption binding. **Do not** mutate `docs/product/backlog.md` or
|
|
|
103
112
|
- `python scripts/intake_evidence_validate.py --file <bundle.json>` or `--stdin`
|
|
104
113
|
- Deterministic diagnostics (**AC-7**): on block, list `missing_topics`, cite reason codes, and emit
|
|
105
114
|
remediation prompts for unresolved required keys only.
|
|
115
|
+
- Delegation-specific fail-closed diagnostics under umbrella `INTAKE_PERSISTENCE_BLOCKED`:
|
|
116
|
+
- `INTAKE_DELEGATION_EVIDENCE_MISSING`
|
|
117
|
+
- `INTAKE_DELEGATION_EVIDENCE_INVALID`
|
|
118
|
+
- **US-0081 complete-plan gate** (first/new/broad only): enforce
|
|
119
|
+
`plan_area_id -> story_ids[] | deferred_ref` coverage for every
|
|
120
|
+
`plan_area_inventory` row; emit deterministic subcodes under umbrella
|
|
121
|
+
`INTAKE_PERSISTENCE_BLOCKED`:
|
|
122
|
+
- `INTAKE_PLAN_COVERAGE_MISSING`
|
|
123
|
+
- `INTAKE_PLAN_AREA_ID_INVALID`
|
|
124
|
+
- `INTAKE_PLAN_COVERAGE_CONTRACT_INVALID`
|
|
125
|
+
- `INTAKE_PLAN_DEFERRED_REF_MISSING`
|
|
106
126
|
- **Guided vs low-touch parity**: **`INTAKE_GUIDED_MODE=1`** and **`INTAKE_GUIDED_MODE=0`** run the
|
|
107
127
|
**same pre-persistence validation pipeline**; low-touch may skip optional follow-ups but **must not**
|
|
108
|
-
bypass mandatory pack evidence
|
|
128
|
+
bypass mandatory pack evidence or first-intake complete-plan mapping
|
|
129
|
+
(**AC-5**, **AC-6**).
|
|
109
130
|
- **Grandfathering**: legacy intake rows remain valid for read/display; the **next** intake-driven
|
|
110
131
|
mutation must supply full **US-0078** evidence or the write is blocked (**DEC-0060** §5).
|
|
132
|
+
- Truthfulness / anti-echo (**BUG-0007** / **R-0066**): `INTAKE_ANSWER_REF_NOT_TOPIC_DISTINCT` when
|
|
133
|
+
the same normalized `quoted_user_text` is reused across distinct required `topic_key` rows under
|
|
134
|
+
`satisfied_by=answer_ref` without an exempt path (`evidence_source=equivalent_evidence_ref` +
|
|
135
|
+
`equivalent_evidence_ref`, `delegation_ref` per **DEC-0067** / **US-0083**, or
|
|
136
|
+
`assumption_confirmation_ref` on the row). Canonical **`ie:`** integrity (**DEC-0060**) does not
|
|
137
|
+
prove a topic was actually elicited.
|
|
138
|
+
|
|
139
|
+
## Truthfulness: `asked_topics` and `topic_coverage` (BUG-0007 / US-0083 / DEC-0060 / DEC-0067)
|
|
140
|
+
|
|
141
|
+
- **`asked_topics`** may list a required `topic_key` only when a **user-visible question** was posed
|
|
142
|
+
**or** a **DEC-0060**-allowed alternate applies: **`delegation_ref`** (**DEC-0067**, **US-0083**),
|
|
143
|
+
**`evidence_source=equivalent_evidence_ref`** with **`equivalent_evidence_ref`**, or
|
|
144
|
+
**`assumption_confirmation_ref`** (row-level and/or bundle-level assumption binding per the gate
|
|
145
|
+
contract above).
|
|
146
|
+
- **Forbidden**: fabricating **`topic_coverage`** by echoing **one** user or bug-report blob into
|
|
147
|
+
**`quoted_user_text`** on **every** required key as **`answer_ref`** solely to satisfy structure.
|
|
148
|
+
The validator rejects that pattern under **`INTAKE_ANSWER_REF_NOT_TOPIC_DISTINCT`** (see
|
|
149
|
+
**`docs/engineering/architecture.md`** **`# BUG-0007`**).
|
|
111
150
|
|
|
112
151
|
## Bug issue routing (US-0079 / DEC-0061)
|
|
113
152
|
|
|
@@ -119,6 +158,12 @@ and assumption binding. **Do not** mutate `docs/product/backlog.md` or
|
|
|
119
158
|
- Append **`### BUG-#### — Title`** under **`## Bug issues (canonical)`** with **Status**, **`environment`**, **`steps_to_reproduce`**, **`expected`**, **`actual`**, **`evidence_refs`**.
|
|
120
159
|
- Add matching **`- [ ]` / `- [x]`** row under **`## Bug acceptance (canonical)`**, sorted by id.
|
|
121
160
|
- Run **`python scripts/bug_issue_validate.py --backlog docs/product/backlog.md --check-acceptance`** before completing the handoff.
|
|
161
|
+
- **Resume brief refresh (DEC-0069 / BUG-0005)**: immediately after successful bug persistence and backlog/acceptance validation **PASS**, run the atomic writer (temp file + replace — idempotent latest-pointer upsert):
|
|
162
|
+
- `python scripts/intake_bug_resume_brief_refresh.py --bug-id BUG-#### --backlog docs/product/backlog.md --resume-brief handoffs/resume_brief.md --intake-boundary-utc <RFC3339Z>`
|
|
163
|
+
- Optional: `--orchestrator-run-id`, `--intake-evidence handoffs/intake_evidence/....json`, `--sprint-id` when known.
|
|
164
|
+
- Exit non-zero → **`INTAKE_RESUME_BRIEF_*`** family — do not claim intake complete; fix backlog/brief contradiction or supply valid boundary UTC.
|
|
165
|
+
- Post-condition: **`intended_resume_phase` / `resolved_start_phase` = `discovery`**, **`resolution_source=resume_brief`**, **`bug_id`** matches persisted row, so **`/auto`** without **`start-from`** does not false-trigger **`RESUME_BRIEF_STALE`** for a stale pre-intake **`intake`** target.
|
|
166
|
+
- Optional audit: `python scripts/intake_bug_resume_brief_refresh.py --bug-id BUG-#### --backlog docs/product/backlog.md --resume-brief handoffs/resume_brief.md --validate-file` (no write).
|
|
122
167
|
|
|
123
168
|
## Steps
|
|
124
169
|
1. Determine intake mode from `.cursor/scratchpad.md`:
|
|
@@ -177,12 +222,21 @@ and assumption binding. **Do not** mutate `docs/product/backlog.md` or
|
|
|
177
222
|
- before writing backlog/acceptance artifacts, run **`python scripts/intake_evidence_validate.py`**
|
|
178
223
|
on the captured bundle (or equivalent in-process validation):
|
|
179
224
|
- if validation **PASS**es, proceed to persistence;
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
225
|
+
- on **FAIL**, emit `INTAKE_REQUIRED_TOPIC_MISSING` /
|
|
226
|
+
`INTAKE_REQUIRED_PACK_INCOMPLETE` / `INTAKE_ASSUMPTION_CONFIRMATION_REQUIRED` /
|
|
227
|
+
`INTAKE_DELEGATION_EVIDENCE_MISSING` / `INTAKE_DELEGATION_EVIDENCE_INVALID`
|
|
228
|
+
plus first-intake coverage subcodes (`INTAKE_PLAN_COVERAGE_MISSING`,
|
|
229
|
+
`INTAKE_PLAN_AREA_ID_INVALID`, `INTAKE_PLAN_COVERAGE_CONTRACT_INVALID`,
|
|
230
|
+
`INTAKE_PLAN_DEFERRED_REF_MISSING`) under umbrella
|
|
231
|
+
`INTAKE_PERSISTENCE_BLOCKED` with remediation guidance — **no write**.
|
|
232
|
+
- for `first-intake-pack` requests, derive a normalized
|
|
233
|
+
`plan_area_inventory`, require one coverage row per `plan_area_id`, enforce
|
|
234
|
+
xor mapping (`story_ids` xor `deferred_ref` + `deferred_reason`), and set
|
|
235
|
+
`coverage_complete=true` only when all areas are fully mapped.
|
|
183
236
|
- persist intake evidence fields (`asked_topics`, `missing_topics`,
|
|
184
|
-
`assumptions_confirmed`, `topic_coverage`, assumption ref fields per
|
|
185
|
-
|
|
237
|
+
`assumptions_confirmed`, `topic_coverage`, assumption ref fields per
|
|
238
|
+
**DEC-0060**, and first-intake coverage fields (`plan_area_inventory`,
|
|
239
|
+
`plan_area_coverage`, `coverage_complete`) in relevant intake artifacts.
|
|
186
240
|
6. Optional fresh-project ID namespace bootstrap (US-0052 / DEC-0034):
|
|
187
241
|
- Read `ID_NAMESPACE_BOOTSTRAP` from `.cursor/scratchpad.md` (`0|1`,
|
|
188
242
|
default `0`).
|
|
@@ -255,7 +309,8 @@ and assumption binding. **Do not** mutate `docs/product/backlog.md` or
|
|
|
255
309
|
- Intake mutations must also comply with
|
|
256
310
|
`docs/engineering/artifact-ownership-policy.md`.
|
|
257
311
|
- Intake may mutate only intake-owned scopes (`vision`, `backlog`, `acceptance`,
|
|
258
|
-
`po_to_tl
|
|
312
|
+
`po_to_tl`, and **`handoffs/resume_brief.md`** only via the **DEC-0069** bug-intake
|
|
313
|
+
completion path / `intake_bug_resume_brief_refresh.py`) for target story context.
|
|
259
314
|
- Any attempted delete/rewrite of non-intake-owned sections fails closed with
|
|
260
315
|
`PHASE_OWNERSHIP_VIOLATION`.
|
|
261
316
|
- If an override-authorized path is configured for an artifact but required
|
|
@@ -14,7 +14,21 @@ description: "its-magic map codebase: analyze existing project before changes."
|
|
|
14
14
|
## Outputs (artifacts)
|
|
15
15
|
- `docs/engineering/codebase-map.md`
|
|
16
16
|
- `docs/engineering/dependencies.json`
|
|
17
|
-
- `docs/engineering/state.md`
|
|
17
|
+
- `docs/engineering/state.md` (append-only checkpoints only when the phase
|
|
18
|
+
contract already allows bounded map-related notes)
|
|
19
|
+
|
|
20
|
+
## Lifecycle vs manual (US-0082 / DEC-0065)
|
|
21
|
+
|
|
22
|
+
- **Auto/bootstrap (primary)**: `/architecture` completion (**tech-lead**) must
|
|
23
|
+
run `python scripts/materialize_codebase_map.py --trigger architecture` before
|
|
24
|
+
`/sprint-plan` so a bootstrap map exists or deterministic
|
|
25
|
+
`CODEBASE_MAP_BLOCKED:*` diagnostics are emitted.
|
|
26
|
+
- **Auto/bootstrap (optional)**: `/refresh-context` (**curator**) may run the
|
|
27
|
+
same script with `--trigger refresh-context` only when merged scratchpad sets
|
|
28
|
+
`CODEBASE_MAP_REFRESH_ON_ROLLOVER=1` (default off — limits churn).
|
|
29
|
+
- **Manual (this command)**: `/map-codebase` remains the explicit operator path
|
|
30
|
+
for a full analysis pass and for refreshing rich maps; it does not replace the
|
|
31
|
+
lifecycle gate above.
|
|
18
32
|
|
|
19
33
|
## Stop conditions
|
|
20
34
|
- Decision gate triggered
|
|
@@ -23,3 +37,6 @@ description: "its-magic map codebase: analyze existing project before changes."
|
|
|
23
37
|
1. Identify stack, structure, and key entry points.
|
|
24
38
|
2. Summarize architecture and conventions.
|
|
25
39
|
3. Capture dependencies and tooling.
|
|
40
|
+
4. Persist outputs to the artifact paths above. When a programmatic bootstrap is
|
|
41
|
+
needed in tooling or tests, prefer `scripts/materialize_codebase_map.py`
|
|
42
|
+
(idempotent; preserves non-bootstrap maps).
|
|
@@ -27,6 +27,13 @@ description: "its-magic refresh context: compact state and decisions."
|
|
|
27
27
|
1. Compact state and decisions into a short context pack.
|
|
28
28
|
2. Update sprint summary with current status.
|
|
29
29
|
3. Ensure handoffs and state are consistent.
|
|
30
|
+
3a. Optional codebase map refresh (US-0082 / DEC-0065): when merged scratchpad
|
|
31
|
+
sets `CODEBASE_MAP_REFRESH_ON_ROLLOVER=1`, from repository root run
|
|
32
|
+
`python scripts/materialize_codebase_map.py --trigger refresh-context`.
|
|
33
|
+
Default is **skip** (omit this step) to avoid map churn. On
|
|
34
|
+
`CODEBASE_MAP_BLOCKED:*`, record the token and remediation in the new
|
|
35
|
+
`state.md` checkpoint; do not rewrite operator-authored maps outside the
|
|
36
|
+
bootstrap contract.
|
|
30
37
|
4. Enforce **triad** hot-surface rollover when merged scratchpad thresholds are
|
|
31
38
|
exceeded (DEC-0054):
|
|
32
39
|
- read caps from `.cursor/scratchpad.md` + `.cursor/scratchpad.local.md`,
|
|
@@ -6,6 +6,11 @@ globs: ["**/*"]
|
|
|
6
6
|
- Intake backlog/acceptance writes require **US-0078** evidence validation
|
|
7
7
|
(`scripts/intake_evidence_validate.py` / **DEC-0060**) before persistence; see
|
|
8
8
|
`.cursor/commands/intake.md`.
|
|
9
|
+
- For first/new/broad intake, persistence also requires **US-0081** complete-plan
|
|
10
|
+
coverage contract validation (**DEC-0064**):
|
|
11
|
+
`plan_area_inventory` + `plan_area_coverage` + `coverage_complete=true`; fail
|
|
12
|
+
closed under `INTAKE_PERSISTENCE_BLOCKED` with deterministic plan-coverage
|
|
13
|
+
subcodes.
|
|
9
14
|
- Defect intake uses **`INTAKE_WORK_ITEM_KIND=bug`** and/or **`/intake bug`**; validate bugs with
|
|
10
15
|
`scripts/bug_issue_validate.py` and run `scripts/intake_bug_routing_guard.py` before allocating
|
|
11
16
|
**`US-xxxx`** for defect-shaped prose (**US-0079** / **DEC-0061**).
|
|
@@ -23,7 +23,7 @@ artifacts. Ordering policy and ownership policy are complementary:
|
|
|
23
23
|
| `handoffs/release_queue.md` | target sprint row only | `release` | none |
|
|
24
24
|
| `handoffs/release_notes.md` | latest pointer section | `release`, `refresh-context` | none |
|
|
25
25
|
| `docs/engineering/state.md` | append-bottom checkpoints only | all delivery phases | none |
|
|
26
|
-
| `handoffs/resume_brief.md` | current status/next-actions sections | `pause`, `resume`, `refresh-context`, `release` | none |
|
|
26
|
+
| `handoffs/resume_brief.md` | current status/next-actions sections; latest-pointer upsert on **`/intake bug`** completion (**DEC-0069**) | `intake` (bug persistence path only), `pause`, `resume`, `refresh-context`, `release` | none |
|
|
27
27
|
|
|
28
28
|
## Non-destructive mutation rules
|
|
29
29
|
|
|
@@ -27,6 +27,8 @@ scripts/intake_evidence_validate.py
|
|
|
27
27
|
scripts/intake_evidence_lib.py
|
|
28
28
|
scripts/intake_bug_routing_guard.py
|
|
29
29
|
scripts/check_intake_template_parity.py
|
|
30
|
+
scripts/materialize_codebase_map.py
|
|
31
|
+
scripts/enforce-triad-hot-surface.py
|
|
30
32
|
.github/workflows
|
|
31
33
|
README.md
|
|
32
34
|
its_magic
|
|
@@ -49,7 +51,22 @@ scripts/intake_evidence_validate.py
|
|
|
49
51
|
scripts/intake_evidence_lib.py
|
|
50
52
|
scripts/intake_bug_routing_guard.py
|
|
51
53
|
scripts/check_intake_template_parity.py
|
|
54
|
+
scripts/materialize_codebase_map.py
|
|
55
|
+
scripts/enforce-triad-hot-surface.py
|
|
52
56
|
.github/workflows/ci.yml
|
|
53
57
|
.github/workflows/deploy.yml
|
|
54
58
|
its_magic
|
|
55
59
|
.its-magic-version
|
|
60
|
+
|
|
61
|
+
[required_install_script_paths]
|
|
62
|
+
scripts/validate-and-push.ps1
|
|
63
|
+
scripts/validate-and-push.sh
|
|
64
|
+
scripts/sync_push_gates.py
|
|
65
|
+
scripts/doc_profile_lib.py
|
|
66
|
+
scripts/validate_doc_profile.py
|
|
67
|
+
scripts/intake_evidence_validate.py
|
|
68
|
+
scripts/intake_evidence_lib.py
|
|
69
|
+
scripts/intake_bug_routing_guard.py
|
|
70
|
+
scripts/check_intake_template_parity.py
|
|
71
|
+
scripts/materialize_codebase_map.py
|
|
72
|
+
scripts/enforce-triad-hot-surface.py
|
|
@@ -60,6 +60,41 @@ Remediation:
|
|
|
60
60
|
- define `TEST_COMMAND` explicitly in `docs/engineering/runbook.md`, or
|
|
61
61
|
- add detectable stack markers/scripts then rerun installer upgrade.
|
|
62
62
|
|
|
63
|
+
## Codebase map bootstrap (US-0082 / DEC-0065)
|
|
64
|
+
|
|
65
|
+
**Goal:** `docs/engineering/codebase-map.md` exists in fresh repos without ad-hoc
|
|
66
|
+
operator memory, while **`/map-codebase`** stays the explicit manual analysis
|
|
67
|
+
command.
|
|
68
|
+
|
|
69
|
+
### Responsibility
|
|
70
|
+
|
|
71
|
+
| Path | Owner | Mechanism |
|
|
72
|
+
|------|-------|-----------|
|
|
73
|
+
| Primary | **`/architecture`** (tech-lead) | Before **`/sprint-plan`**, run `python scripts/materialize_codebase_map.py --trigger architecture` from repo root |
|
|
74
|
+
| Optional refresh | **`/refresh-context`** (curator) | Same script with `--trigger refresh-context` only when scratchpad sets **`CODEBASE_MAP_REFRESH_ON_ROLLOVER=1`** (default off) |
|
|
75
|
+
| Manual / deep pass | Operator | **`/map-codebase`** |
|
|
76
|
+
|
|
77
|
+
### Write surfaces
|
|
78
|
+
|
|
79
|
+
Same as **`/map-codebase`**: `docs/engineering/codebase-map.md`,
|
|
80
|
+
`docs/engineering/dependencies.json`. The materializer does **not** append
|
|
81
|
+
`docs/engineering/state.md`. Non-bootstrap maps (no bootstrap sentinel in the
|
|
82
|
+
file) are never replaced silently.
|
|
83
|
+
|
|
84
|
+
### Deterministic diagnostics
|
|
85
|
+
|
|
86
|
+
- **`CODEBASE_MAP_MISSING`** — use when a lifecycle checkpoint requires the map
|
|
87
|
+
but it is absent and generation did not run (e.g. custom **`/auto`** profile
|
|
88
|
+
skipped **`architecture`**).
|
|
89
|
+
- **`CODEBASE_MAP_BLOCKED:<subreason>`** — materializer or policy blocked
|
|
90
|
+
creation (`policy_skip`, permissions, etc.); stdout includes remediation
|
|
91
|
+
pointing here and to **`/map-codebase`**.
|
|
92
|
+
|
|
93
|
+
**Command:** `python scripts/materialize_codebase_map.py --repo .`
|
|
94
|
+
**Tests:** `python tests/codebase_map_materialize_test.py`
|
|
95
|
+
|
|
96
|
+
Normative architecture: `docs/engineering/architecture.md` (**# US-0082**).
|
|
97
|
+
|
|
63
98
|
## Documentation profile validation (US-0077 / DEC-0059)
|
|
64
99
|
|
|
65
100
|
**Goal:** keep root `README.md` (user channel) and `docs/developer/README.md`
|
|
@@ -240,7 +275,33 @@ Required persisted intake evidence fields:
|
|
|
240
275
|
- `missing_topics`
|
|
241
276
|
- `assumptions_confirmed`
|
|
242
277
|
|
|
243
|
-
##
|
|
278
|
+
## First-intake full-plan coverage gate (US-0081 / DEC-0064)
|
|
279
|
+
|
|
280
|
+
For first/new/broad intake (`selected_pack=first-intake-pack`), persistence is
|
|
281
|
+
additionally blocked unless complete-plan coverage is machine-verifiable.
|
|
282
|
+
|
|
283
|
+
Required coverage contract fields:
|
|
284
|
+
|
|
285
|
+
- `plan_area_inventory[]` with unique stable `plan_area_id` values
|
|
286
|
+
- `plan_area_coverage[]` with exactly one row per `plan_area_id`
|
|
287
|
+
- xor mapping per row: `story_ids[]` or `deferred_ref` + `deferred_reason`
|
|
288
|
+
- `coverage_complete=true` only when derived validation succeeds
|
|
289
|
+
|
|
290
|
+
Coverage diagnostics (under umbrella `INTAKE_PERSISTENCE_BLOCKED`):
|
|
291
|
+
|
|
292
|
+
- `INTAKE_PLAN_COVERAGE_MISSING`
|
|
293
|
+
- `INTAKE_PLAN_AREA_ID_INVALID`
|
|
294
|
+
- `INTAKE_PLAN_COVERAGE_CONTRACT_INVALID`
|
|
295
|
+
- `INTAKE_PLAN_DEFERRED_REF_MISSING`
|
|
296
|
+
|
|
297
|
+
Guided and low-touch parity:
|
|
298
|
+
|
|
299
|
+
- `INTAKE_GUIDED_MODE=1` and `INTAKE_GUIDED_MODE=0` must run the same
|
|
300
|
+
first-intake complete-plan validator path.
|
|
301
|
+
- Low-touch may reduce optional prompts but cannot bypass complete-plan coverage
|
|
302
|
+
validation.
|
|
303
|
+
|
|
304
|
+
## Interactive intake evidence validation (US-0078 / DEC-0060 / US-0083 / DEC-0067)
|
|
244
305
|
|
|
245
306
|
**US-0078** adds machine-verifiable **`topic_coverage`** rows, canonical **`ie:`** refs
|
|
246
307
|
(**DEC-0060**), asked-vs-covered enforcement, and **`assumption_confirmation_ref`**
|
|
@@ -251,11 +312,24 @@ binding before backlog/acceptance writes.
|
|
|
251
312
|
- Library: `scripts/intake_evidence_lib.py` (shared rules for tests and tooling).
|
|
252
313
|
- Regression: `tests/intake_evidence_fixtures_test.py` (R-0055 **AC-8** matrix tiers A/B),
|
|
253
314
|
invoked from `tests/run-tests.ps1` / `tests/run-tests.sh` §26k.
|
|
254
|
-
- **Packaged installs (BUG-0001 / DEC-0063)**: `intake_evidence_validate.py`, `intake_evidence_lib.py`, and `intake_bug_routing_guard.py` are mirrored under `template/scripts/` and listed in `docs/engineering/context/installer-owned-paths.manifest` so fresh install and `upgrade` copy them to the consumer’s `scripts/`. Drift guard: `python scripts/check_intake_template_parity.py --repo .` (also §26N in `tests/run-tests.*`).
|
|
315
|
+
- **Packaged installs (BUG-0001 / DEC-0063)**: `intake_evidence_validate.py`, `intake_evidence_lib.py`, and `intake_bug_routing_guard.py` are mirrored under `template/scripts/` and listed in `docs/engineering/context/installer-owned-paths.manifest` so fresh install and `upgrade` copy them to the consumer’s `scripts/`. Drift guard: `python scripts/check_intake_template_parity.py --repo .` (also §26N in `tests/run-tests.*`). **Release (S0060)**: operator notes `handoffs/releases/S0060-release-notes.md` (gate summary + verify steps).
|
|
316
|
+
- **Installer completeness gate (BUG-0003 / DEC-0066)**: post-install invariant checks every path in `[required_install_script_paths]` from `docs/engineering/context/installer-owned-paths.manifest`. Missing paths fail closed with `INSTALL_COMPLETENESS_FAILED` and `INSTALL_REQUIRED_SCRIPT_MISSING:<path>`. Remediation: update manifest parity (active + `template/`), ensure required script exists under `template/scripts/`, keep install/clean ownership paired, then rerun `its-magic --mode missing|upgrade` (or `python installer.py --validate-install-completeness --target <repo>` for direct diagnostics).
|
|
255
317
|
- **Guided** and **low-touch** (`INTAKE_GUIDED_MODE=0`) share the **same** pre-persistence
|
|
256
318
|
validation pipeline; mandatory pack evidence is never skipped.
|
|
257
319
|
- Legacy intake evidence without **`ie:`** refs remains **grandfathered** for display until the
|
|
258
320
|
next intake-driven mutation, which must supply full evidence (**DEC-0060** §5).
|
|
321
|
+
- **Delegated required-topic path (US-0083 / DEC-0067)**:
|
|
322
|
+
- Allowed: `topic_coverage[].satisfied_by=delegation_ref` with required
|
|
323
|
+
`delegation_scope`, `delegation_rationale`, `delegation_confidence` (`low|medium|high`).
|
|
324
|
+
- Missing delegation fields fail closed with `INTAKE_DELEGATION_EVIDENCE_MISSING`.
|
|
325
|
+
- Malformed delegation values or invalid `ie:` binding fail closed with
|
|
326
|
+
`INTAKE_DELEGATION_EVIDENCE_INVALID`.
|
|
327
|
+
- Non-delegated unresolved required topics remain unchanged fail-closed
|
|
328
|
+
(`INTAKE_REQUIRED_TOPIC_MISSING` path).
|
|
329
|
+
- **Repetitive-ask suppression with accounting (US-0083 AC-1)**:
|
|
330
|
+
- When equivalent evidence already exists, avoid re-asking by recording row-level
|
|
331
|
+
`evidence_source=equivalent_evidence_ref` plus `equivalent_evidence_ref`.
|
|
332
|
+
- Required-topic accounting remains explicit through `topic_coverage` rows.
|
|
259
333
|
|
|
260
334
|
## Bug issues (US-0079 / DEC-0061)
|
|
261
335
|
|
|
@@ -12,6 +12,7 @@ INTAKE_TEMPLATE_PAIRS: tuple[tuple[str, str], ...] = (
|
|
|
12
12
|
("scripts/intake_evidence_validate.py", "template/scripts/intake_evidence_validate.py"),
|
|
13
13
|
("scripts/intake_evidence_lib.py", "template/scripts/intake_evidence_lib.py"),
|
|
14
14
|
("scripts/intake_bug_routing_guard.py", "template/scripts/intake_bug_routing_guard.py"),
|
|
15
|
+
("scripts/intake_bug_resume_brief_refresh.py", "template/scripts/intake_bug_resume_brief_refresh.py"),
|
|
15
16
|
("scripts/check_intake_template_parity.py", "template/scripts/check_intake_template_parity.py"),
|
|
16
17
|
)
|
|
17
18
|
|