its-magic 0.1.2-39 → 0.1.2-42
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/README.md +4 -0
- package/installer.ps1 +1 -1
- package/installer.sh +649 -643
- package/package.json +5 -1
- package/scripts/guard_installer_publish.py +88 -0
- package/scripts/remote_config_summary.py +243 -0
- package/template/.cursor/commands/auto.md +132 -17
- package/template/.cursor/commands/execute.md +6 -0
- package/template/.cursor/commands/qa.md +5 -0
- package/template/.cursor/rules/coding-standards.mdc +7 -0
- package/template/.cursor/scratchpad.local.example.md +20 -1
- package/template/.cursor/scratchpad.md +35 -10
- package/template/.cursorignore +5 -0
- package/template/.env.example +28 -0
- package/template/README.md +4 -0
- package/template/docs/engineering/auto-orchestration-reference.md +315 -27
- package/template/docs/engineering/context/installer-owned-paths.manifest +78 -72
- package/template/docs/engineering/runbook.md +1772 -1525
- package/template/docs/engineering/runtime-connectivity.md +47 -0
- package/template/docs/engineering/us-0084-remote-e2e.md +44 -0
- package/template/scripts/guard_installer_publish.py +88 -0
- package/template/scripts/remote_config_summary.py +243 -0
|
@@ -1,1525 +1,1772 @@
|
|
|
1
|
-
# Runbook
|
|
2
|
-
|
|
3
|
-
## Commands
|
|
4
|
-
|
|
5
|
-
TEST_COMMAND:
|
|
6
|
-
LINT_COMMAND:
|
|
7
|
-
TYPECHECK_COMMAND:
|
|
8
|
-
DEPLOY_STAGING_COMMAND: echo "No staging deploy target configured for this repository"
|
|
9
|
-
DEPLOY_PROD_COMMAND: echo "No production deploy target configured for this repository"
|
|
10
|
-
|
|
11
|
-
LINT_FIX_COMMAND:
|
|
12
|
-
FORMAT_COMMAND:
|
|
13
|
-
CI_AUTO_FIX: false
|
|
14
|
-
TEST_TIMEOUT_SECONDS: 120
|
|
15
|
-
|
|
16
|
-
## Notes
|
|
17
|
-
- Leave a command blank to skip that step.
|
|
18
|
-
- Use explicit commands, not placeholders.
|
|
19
|
-
- `TEST_TIMEOUT_SECONDS` limits how long any subprocess can run during tests.
|
|
20
|
-
Prevents hangs from prompts, network waits, or infinite loops.
|
|
21
|
-
- `LINT_FIX_COMMAND` / `FORMAT_COMMAND` are used by CI auto-fix when checks fail
|
|
22
|
-
(e.g. `npx eslint --fix .` or `npx prettier --write .`).
|
|
23
|
-
- `CI_AUTO_FIX`: set to `true` to enable the automatic fix-and-retry loop in
|
|
24
|
-
GitHub Actions. When `false` (default), CI reports failures but does not
|
|
25
|
-
attempt auto-fix commits.
|
|
26
|
-
|
|
27
|
-
## Intentional empty commands (US-0015)
|
|
28
|
-
|
|
29
|
-
For this template/installer repository, the following command keys may be
|
|
30
|
-
intentionally empty in the shipped template; they are not configuration errors:
|
|
31
|
-
|
|
32
|
-
- `TEST_COMMAND` (blank until installer bootstrap per stack; **DEC-0056**)
|
|
33
|
-
- `LINT_COMMAND`
|
|
34
|
-
- `FORMAT_COMMAND`
|
|
35
|
-
- `TYPECHECK_COMMAND`
|
|
36
|
-
|
|
37
|
-
Teams may set these keys when needed for their own project stack.
|
|
38
|
-
|
|
39
|
-
## OS-aware runbook command bootstrap (US-0063 / DEC-0046)
|
|
40
|
-
|
|
41
|
-
Installer/upgrade flows auto-bootstrap runbook command keys with deterministic
|
|
42
|
-
precedence:
|
|
43
|
-
|
|
44
|
-
- `user override > detected defaults > safe fail-fast`
|
|
45
|
-
- user-provided non-empty values are never overwritten
|
|
46
|
-
- defaults are inferred from OS + project stack markers
|
|
47
|
-
(`package.json` scripts, `pyproject.toml`, `go.mod`, platform test scripts)
|
|
48
|
-
|
|
49
|
-
Baseline detection contract:
|
|
50
|
-
|
|
51
|
-
- `TEST_COMMAND` is mandatory for push-eligible quality gates.
|
|
52
|
-
- `LINT_COMMAND` and `TYPECHECK_COMMAND` are optional and only auto-populated
|
|
53
|
-
when confidently detectable.
|
|
54
|
-
- if `TEST_COMMAND` remains unresolved/invalid, installer fails fast with:
|
|
55
|
-
- `[RUNBOOK_BOOTSTRAP_ERROR] TEST_COMMAND_UNRESOLVED`, or
|
|
56
|
-
- `[RUNBOOK_BOOTSTRAP_ERROR] TEST_COMMAND_INVALID:<reason>`
|
|
57
|
-
|
|
58
|
-
Remediation:
|
|
59
|
-
|
|
60
|
-
- define `TEST_COMMAND` explicitly in `docs/engineering/runbook.md`, or
|
|
61
|
-
- add detectable stack markers/scripts then rerun installer upgrade.
|
|
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
|
-
|
|
98
|
-
## Documentation profile validation (US-0077 / DEC-0059)
|
|
99
|
-
|
|
100
|
-
**Goal:** keep root `README.md` (user channel) and `docs/developer/README.md`
|
|
101
|
-
(developer shard) aligned with merged scratchpad keys `DOC_AUDIENCE_PROFILE` and
|
|
102
|
-
`DOC_DETAIL_LEVEL`, with deterministic reason codes and active/`template/` parity.
|
|
103
|
-
|
|
104
|
-
### Scratchpad keys
|
|
105
|
-
|
|
106
|
-
- `DOC_AUDIENCE_PROFILE`: `user` \| `developer` \| `both` (empty defaults to `both` during transition).
|
|
107
|
-
- `DOC_DETAIL_LEVEL`: `concise` \| `balanced` \| `technical-deep` (empty defaults to `balanced`).
|
|
108
|
-
- Invalid values → `DOC_PROFILE_INVALID`. Merge/read failures → `DOC_PROFILE_MERGE_ERROR`.
|
|
109
|
-
- Optional modes `SPEC_PACK_MODE` / `USER_GUIDE_MODE` stay additive only: when `0`, this
|
|
110
|
-
validator does not require spec-pack or user-guide files.
|
|
111
|
-
|
|
112
|
-
### Command
|
|
113
|
-
|
|
114
|
-
```bash
|
|
115
|
-
python scripts/validate_doc_profile.py --repo .
|
|
116
|
-
python scripts/validate_doc_profile.py --repo . --no-template-parity # fixture trees without template/
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
### Installer hook
|
|
120
|
-
|
|
121
|
-
`installer.py` scratchpad post-install refreshes missing normative `##` sections
|
|
122
|
-
(non-destructive append) from the resolved profile, then operators should keep
|
|
123
|
-
content accurate. Re-run `python installer.py --scratchpad-postinstall --target <repo> --mode missing`
|
|
124
|
-
after template upgrades if needed.
|
|
125
|
-
|
|
126
|
-
Normative H2 titles and matrix: `docs/engineering/architecture.md` (`# US-0077`).
|
|
127
|
-
|
|
128
|
-
## User-visible internal metadata guard (US-0071 / DEC-0053)
|
|
129
|
-
|
|
130
|
-
**Goal:** keep planning-shaped identifiers out of **operator-visible software
|
|
131
|
-
channels** (CLI/installer/validate-and-push strings), while they remain valid in
|
|
132
|
-
internal documentation trees and in source comments that are not emitted to
|
|
133
|
-
users.
|
|
134
|
-
|
|
135
|
-
### Forbidden tokens (user-visible channels only)
|
|
136
|
-
|
|
137
|
-
Match planning-shaped tokens:
|
|
138
|
-
|
|
139
|
-
- `US-[0-9]{4}`
|
|
140
|
-
- `DEC-[0-9]{4}`
|
|
141
|
-
- `R-[0-9]{4}`
|
|
142
|
-
|
|
143
|
-
### Inclusive scan roots (deterministic)
|
|
144
|
-
|
|
145
|
-
From repository root, the checker walks **only**:
|
|
146
|
-
|
|
147
|
-
- `bin/**` (`*.js`)
|
|
148
|
-
- `installer.py`, `installer.ps1`, `installer.sh`
|
|
149
|
-
- `packaging/**` (`*.js`, `*.py`, `*.ps1`, `*.sh`)
|
|
150
|
-
- `scripts/validate-and-push.ps1`, `scripts/validate-and-push.sh`
|
|
151
|
-
|
|
152
|
-
Paths outside this set are **not** scanned by this tool (for example `docs/**`,
|
|
153
|
-
`.cursor/**`, `sprints/**`, `handoffs/**`, `decisions/**` remain free to use
|
|
154
|
-
story/decision/research IDs). If a new operator-visible deliverable is added
|
|
155
|
-
outside these roots, extend the scan list or you risk
|
|
156
|
-
`METADATA_SANITIZATION_SCOPE_AMBIGUOUS` classification during review.
|
|
157
|
-
|
|
158
|
-
### Command
|
|
159
|
-
|
|
160
|
-
```bash
|
|
161
|
-
python scripts/check-user-visible-metadata.py
|
|
162
|
-
python scripts/check-user-visible-metadata.py --json
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
### Reason codes (minimum)
|
|
166
|
-
|
|
167
|
-
- `USER_VISIBLE_INTERNAL_METADATA_DETECTED` — forbidden token matched inside a
|
|
168
|
-
scanned user-visible string/literal.
|
|
169
|
-
- `METADATA_SANITIZATION_POLICY_MISSING` — checker entrypoint missing or
|
|
170
|
-
unusable.
|
|
171
|
-
- `METADATA_SANITIZATION_SCOPE_AMBIGUOUS` — cannot classify whether a path
|
|
172
|
-
belongs in inclusive scan roots; treat as fail-closed until the runbook table
|
|
173
|
-
is updated.
|
|
174
|
-
|
|
175
|
-
### Findings / remediation (contract)
|
|
176
|
-
|
|
177
|
-
On failure, diagnostics must cite **evidence_ref** (`path:line:column` when
|
|
178
|
-
available), **token class** (`US` \| `DEC` \| `R`), and remediation: remove the
|
|
179
|
-
token from operator-visible strings; keep traceability in allowlisted internal
|
|
180
|
-
artifacts or non-emitting comments per `DEC-0053`.
|
|
181
|
-
|
|
182
|
-
## Guided intake mode (US-0033)
|
|
183
|
-
|
|
184
|
-
Intake interaction behavior is controlled by one switch in
|
|
185
|
-
`.cursor/scratchpad.md`:
|
|
186
|
-
|
|
187
|
-
- `INTAKE_GUIDED_MODE=1` (default): guided PO behavior
|
|
188
|
-
- targeted follow-up questions only when acceptance is ambiguous
|
|
189
|
-
- at least one viable option/alternative before recommendation
|
|
190
|
-
- explicit user decision authority
|
|
191
|
-
- intake-time research persisted in `docs/engineering/research.md`
|
|
192
|
-
- `INTAKE_GUIDED_MODE=0`: low-touch intake
|
|
193
|
-
- no proactive follow-up/options/research overhead unless user asks
|
|
194
|
-
- duplicate/overlap backlog check remains mandatory baseline safety
|
|
195
|
-
|
|
196
|
-
## Intake decomposition and risk-aware questioning (US-0051)
|
|
197
|
-
|
|
198
|
-
When guided mode is enabled (`INTAKE_GUIDED_MODE=1`), intake adds bounded
|
|
199
|
-
decomposition and adaptive questioning behavior:
|
|
200
|
-
|
|
201
|
-
- Run deterministic breadth/risk heuristics before persisting a story:
|
|
202
|
-
- feature/workflow-step count
|
|
203
|
-
- cross-cutting impact surface
|
|
204
|
-
- acceptance breadth
|
|
205
|
-
- risk/unknown dependency surface
|
|
206
|
-
- If heuristics indicate broad/high-risk intake:
|
|
207
|
-
- propose bounded multi-story decomposition (typically 2-5 stories)
|
|
208
|
-
- prefer vertical-slice/workflow-step stories with independent user value
|
|
209
|
-
- avoid technical-layer-only splits unless user explicitly requests
|
|
210
|
-
- Preserve user authority explicitly before persistence:
|
|
211
|
-
- user can accept, merge, or adjust the proposed split
|
|
212
|
-
- Keep adaptive questioning concise and bounded:
|
|
213
|
-
- ask ambiguity-driven questions plus risk-triggered questions
|
|
214
|
-
- stop after bounded rounds or when acceptance confidence is sufficient
|
|
215
|
-
- Low-touch compatibility (`INTAKE_GUIDED_MODE=0`):
|
|
216
|
-
- no forced decomposition
|
|
217
|
-
- single-story default unless user explicitly asks for decomposition
|
|
218
|
-
- duplicate/overlap safety remains mandatory
|
|
219
|
-
- Traceability requirement:
|
|
220
|
-
- intake output must capture decomposition/questioning evidence in
|
|
221
|
-
`docs/product/backlog.md`, `docs/product/acceptance.md`, and
|
|
222
|
-
`handoffs/po_to_tl.md`.
|
|
223
|
-
|
|
224
|
-
## Mandatory intake question packs and persistence coverage gate (US-0068 / DEC-0050)
|
|
225
|
-
|
|
226
|
-
Intake persistence is fail-closed unless required topic coverage is complete (or
|
|
227
|
-
bounded assumptions are explicitly confirmed).
|
|
228
|
-
|
|
229
|
-
Deterministic pack contract:
|
|
230
|
-
|
|
231
|
-
- `first-intake-pack` (first/new/broad intake)
|
|
232
|
-
- required topics:
|
|
233
|
-
- `users_problem`
|
|
234
|
-
- `runtime_target_environment`
|
|
235
|
-
- `language_framework_runtime`
|
|
236
|
-
- `architecture_preference`
|
|
237
|
-
- `ui_design_expectations`
|
|
238
|
-
- `security_compliance`
|
|
239
|
-
- `non_functional_priorities`
|
|
240
|
-
- `scope_timeline`
|
|
241
|
-
- `small-intake-pack` (small follow-up intake)
|
|
242
|
-
- required topics:
|
|
243
|
-
- `outcome_success_criteria`
|
|
244
|
-
- `impacted_components`
|
|
245
|
-
- `constraints_compatibility_risks`
|
|
246
|
-
- `required_tests_acceptance_checks`
|
|
247
|
-
- `done_definition`
|
|
248
|
-
|
|
249
|
-
Pack selection and coverage behavior:
|
|
250
|
-
|
|
251
|
-
- Select exactly one pack per intake write path.
|
|
252
|
-
- Unknown/ambiguous stack or project cues must fail closed to
|
|
253
|
-
`first-intake-pack`.
|
|
254
|
-
- Required coverage must be evaluated before writing
|
|
255
|
-
`docs/product/backlog.md` or `docs/product/acceptance.md`.
|
|
256
|
-
- Incomplete required coverage blocks persistence unless assumptions are
|
|
257
|
-
explicitly confirmed.
|
|
258
|
-
|
|
259
|
-
Deterministic fail-closed reason codes:
|
|
260
|
-
|
|
261
|
-
- `INTAKE_REQUIRED_TOPIC_MISSING`
|
|
262
|
-
- `INTAKE_REQUIRED_PACK_INCOMPLETE`
|
|
263
|
-
- `INTAKE_ASSUMPTION_CONFIRMATION_REQUIRED`
|
|
264
|
-
- `INTAKE_PERSISTENCE_BLOCKED`
|
|
265
|
-
|
|
266
|
-
Required remediation output on block:
|
|
267
|
-
|
|
268
|
-
- include `missing_topics`
|
|
269
|
-
- provide targeted follow-up prompts for missing required topics
|
|
270
|
-
- request explicit assumption confirmation when assumptions are used
|
|
271
|
-
|
|
272
|
-
Required persisted intake evidence fields:
|
|
273
|
-
|
|
274
|
-
- `asked_topics`
|
|
275
|
-
- `missing_topics`
|
|
276
|
-
- `assumptions_confirmed`
|
|
277
|
-
|
|
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)
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
-
|
|
316
|
-
|
|
317
|
-
- **
|
|
318
|
-
|
|
319
|
-
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
-
|
|
326
|
-
`
|
|
327
|
-
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
-
|
|
331
|
-
`
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
- **
|
|
340
|
-
- **
|
|
341
|
-
- **
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
- no `
|
|
362
|
-
-
|
|
363
|
-
|
|
364
|
-
- `
|
|
365
|
-
|
|
366
|
-
-
|
|
367
|
-
|
|
368
|
-
-
|
|
369
|
-
- If
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
- `
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
- `
|
|
421
|
-
- `
|
|
422
|
-
- `
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
```
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
-
|
|
455
|
-
|
|
456
|
-
- `
|
|
457
|
-
- `
|
|
458
|
-
- `
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
|
471
|
-
|
|
472
|
-
| `/
|
|
473
|
-
| `/
|
|
474
|
-
| `/
|
|
475
|
-
| `/
|
|
476
|
-
| `/
|
|
477
|
-
| `/verify
|
|
478
|
-
| `/
|
|
479
|
-
| `/
|
|
480
|
-
| `/
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
`
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
-
|
|
508
|
-
- `
|
|
509
|
-
-
|
|
510
|
-
|
|
511
|
-
-
|
|
512
|
-
-
|
|
513
|
-
-
|
|
514
|
-
- `
|
|
515
|
-
|
|
516
|
-
- `
|
|
517
|
-
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
-
|
|
525
|
-
|
|
526
|
-
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
-
|
|
545
|
-
|
|
546
|
-
- `
|
|
547
|
-
|
|
548
|
-
- `
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
-
|
|
577
|
-
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
-
|
|
583
|
-
|
|
584
|
-
- `
|
|
585
|
-
- `
|
|
586
|
-
- `
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
- `docs/engineering/
|
|
606
|
-
-
|
|
607
|
-
|
|
608
|
-
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
-
|
|
629
|
-
`
|
|
630
|
-
-
|
|
631
|
-
- `/
|
|
632
|
-
`
|
|
633
|
-
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
`
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
- `#
|
|
697
|
-
- `#
|
|
698
|
-
- `#
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
`
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
**
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
-
|
|
749
|
-
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
- **
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
-
|
|
814
|
-
|
|
815
|
-
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
- `
|
|
830
|
-
|
|
831
|
-
- `
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
- `
|
|
838
|
-
- `
|
|
839
|
-
- `
|
|
840
|
-
|
|
841
|
-
- `
|
|
842
|
-
|
|
843
|
-
- `
|
|
844
|
-
-
|
|
845
|
-
- `
|
|
846
|
-
|
|
847
|
-
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
-
|
|
852
|
-
-
|
|
853
|
-
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
-
|
|
890
|
-
-
|
|
891
|
-
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
-
|
|
935
|
-
-
|
|
936
|
-
-
|
|
937
|
-
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
- `
|
|
944
|
-
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
-
|
|
949
|
-
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
-
|
|
981
|
-
-
|
|
982
|
-
-
|
|
983
|
-
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
- `
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
- `
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
- `
|
|
1023
|
-
|
|
1024
|
-
-
|
|
1025
|
-
-
|
|
1026
|
-
- `
|
|
1027
|
-
- `
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
- `
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
- `
|
|
1035
|
-
- `
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
-
|
|
1040
|
-
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
- `
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
- `
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
- `
|
|
1117
|
-
- `
|
|
1118
|
-
- `
|
|
1119
|
-
|
|
1120
|
-
-
|
|
1121
|
-
|
|
1122
|
-
- `
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
-
|
|
1131
|
-
-
|
|
1132
|
-
|
|
1133
|
-
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
- `
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
- `
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
-
|
|
1209
|
-
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
-
|
|
1228
|
-
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
-
|
|
1241
|
-
-
|
|
1242
|
-
-
|
|
1243
|
-
-
|
|
1244
|
-
|
|
1245
|
-
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
**
|
|
1251
|
-
|
|
1252
|
-
**`
|
|
1253
|
-
**`docs/engineering/
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
**
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
-
|
|
1287
|
-
-
|
|
1288
|
-
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
- `
|
|
1311
|
-
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
-
|
|
1324
|
-
- `
|
|
1325
|
-
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
-
|
|
1364
|
-
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
`
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
- `
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
-
|
|
1398
|
-
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
-
|
|
1404
|
-
- `
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
##
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
-
|
|
1443
|
-
|
|
1444
|
-
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
- `
|
|
1448
|
-
|
|
1449
|
-
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
- `
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
- `
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
-
|
|
1495
|
-
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1
|
+
# Runbook
|
|
2
|
+
|
|
3
|
+
## Commands
|
|
4
|
+
|
|
5
|
+
TEST_COMMAND: powershell -ExecutionPolicy Bypass -File "tests/run-tests.ps1"
|
|
6
|
+
LINT_COMMAND:
|
|
7
|
+
TYPECHECK_COMMAND:
|
|
8
|
+
DEPLOY_STAGING_COMMAND: echo "No staging deploy target configured for this repository"
|
|
9
|
+
DEPLOY_PROD_COMMAND: echo "No production deploy target configured for this repository"
|
|
10
|
+
|
|
11
|
+
LINT_FIX_COMMAND:
|
|
12
|
+
FORMAT_COMMAND:
|
|
13
|
+
CI_AUTO_FIX: false
|
|
14
|
+
TEST_TIMEOUT_SECONDS: 120
|
|
15
|
+
|
|
16
|
+
## Notes
|
|
17
|
+
- Leave a command blank to skip that step.
|
|
18
|
+
- Use explicit commands, not placeholders.
|
|
19
|
+
- `TEST_TIMEOUT_SECONDS` limits how long any subprocess can run during tests.
|
|
20
|
+
Prevents hangs from prompts, network waits, or infinite loops.
|
|
21
|
+
- `LINT_FIX_COMMAND` / `FORMAT_COMMAND` are used by CI auto-fix when checks fail
|
|
22
|
+
(e.g. `npx eslint --fix .` or `npx prettier --write .`).
|
|
23
|
+
- `CI_AUTO_FIX`: set to `true` to enable the automatic fix-and-retry loop in
|
|
24
|
+
GitHub Actions. When `false` (default), CI reports failures but does not
|
|
25
|
+
attempt auto-fix commits.
|
|
26
|
+
|
|
27
|
+
## Intentional empty commands (US-0015)
|
|
28
|
+
|
|
29
|
+
For this template/installer repository, the following command keys may be
|
|
30
|
+
intentionally empty in the shipped template; they are not configuration errors:
|
|
31
|
+
|
|
32
|
+
- `TEST_COMMAND` (blank until installer bootstrap per stack; **DEC-0056**)
|
|
33
|
+
- `LINT_COMMAND`
|
|
34
|
+
- `FORMAT_COMMAND`
|
|
35
|
+
- `TYPECHECK_COMMAND`
|
|
36
|
+
|
|
37
|
+
Teams may set these keys when needed for their own project stack.
|
|
38
|
+
|
|
39
|
+
## OS-aware runbook command bootstrap (US-0063 / DEC-0046)
|
|
40
|
+
|
|
41
|
+
Installer/upgrade flows auto-bootstrap runbook command keys with deterministic
|
|
42
|
+
precedence:
|
|
43
|
+
|
|
44
|
+
- `user override > detected defaults > safe fail-fast`
|
|
45
|
+
- user-provided non-empty values are never overwritten
|
|
46
|
+
- defaults are inferred from OS + project stack markers
|
|
47
|
+
(`package.json` scripts, `pyproject.toml`, `go.mod`, platform test scripts)
|
|
48
|
+
|
|
49
|
+
Baseline detection contract:
|
|
50
|
+
|
|
51
|
+
- `TEST_COMMAND` is mandatory for push-eligible quality gates.
|
|
52
|
+
- `LINT_COMMAND` and `TYPECHECK_COMMAND` are optional and only auto-populated
|
|
53
|
+
when confidently detectable.
|
|
54
|
+
- if `TEST_COMMAND` remains unresolved/invalid, installer fails fast with:
|
|
55
|
+
- `[RUNBOOK_BOOTSTRAP_ERROR] TEST_COMMAND_UNRESOLVED`, or
|
|
56
|
+
- `[RUNBOOK_BOOTSTRAP_ERROR] TEST_COMMAND_INVALID:<reason>`
|
|
57
|
+
|
|
58
|
+
Remediation:
|
|
59
|
+
|
|
60
|
+
- define `TEST_COMMAND` explicitly in `docs/engineering/runbook.md`, or
|
|
61
|
+
- add detectable stack markers/scripts then rerun installer upgrade.
|
|
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
|
+
|
|
98
|
+
## Documentation profile validation (US-0077 / DEC-0059)
|
|
99
|
+
|
|
100
|
+
**Goal:** keep root `README.md` (user channel) and `docs/developer/README.md`
|
|
101
|
+
(developer shard) aligned with merged scratchpad keys `DOC_AUDIENCE_PROFILE` and
|
|
102
|
+
`DOC_DETAIL_LEVEL`, with deterministic reason codes and active/`template/` parity.
|
|
103
|
+
|
|
104
|
+
### Scratchpad keys
|
|
105
|
+
|
|
106
|
+
- `DOC_AUDIENCE_PROFILE`: `user` \| `developer` \| `both` (empty defaults to `both` during transition).
|
|
107
|
+
- `DOC_DETAIL_LEVEL`: `concise` \| `balanced` \| `technical-deep` (empty defaults to `balanced`).
|
|
108
|
+
- Invalid values → `DOC_PROFILE_INVALID`. Merge/read failures → `DOC_PROFILE_MERGE_ERROR`.
|
|
109
|
+
- Optional modes `SPEC_PACK_MODE` / `USER_GUIDE_MODE` stay additive only: when `0`, this
|
|
110
|
+
validator does not require spec-pack or user-guide files.
|
|
111
|
+
|
|
112
|
+
### Command
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
python scripts/validate_doc_profile.py --repo .
|
|
116
|
+
python scripts/validate_doc_profile.py --repo . --no-template-parity # fixture trees without template/
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Installer hook
|
|
120
|
+
|
|
121
|
+
`installer.py` scratchpad post-install refreshes missing normative `##` sections
|
|
122
|
+
(non-destructive append) from the resolved profile, then operators should keep
|
|
123
|
+
content accurate. Re-run `python installer.py --scratchpad-postinstall --target <repo> --mode missing`
|
|
124
|
+
after template upgrades if needed.
|
|
125
|
+
|
|
126
|
+
Normative H2 titles and matrix: `docs/engineering/architecture.md` (`# US-0077`).
|
|
127
|
+
|
|
128
|
+
## User-visible internal metadata guard (US-0071 / DEC-0053)
|
|
129
|
+
|
|
130
|
+
**Goal:** keep planning-shaped identifiers out of **operator-visible software
|
|
131
|
+
channels** (CLI/installer/validate-and-push strings), while they remain valid in
|
|
132
|
+
internal documentation trees and in source comments that are not emitted to
|
|
133
|
+
users.
|
|
134
|
+
|
|
135
|
+
### Forbidden tokens (user-visible channels only)
|
|
136
|
+
|
|
137
|
+
Match planning-shaped tokens:
|
|
138
|
+
|
|
139
|
+
- `US-[0-9]{4}`
|
|
140
|
+
- `DEC-[0-9]{4}`
|
|
141
|
+
- `R-[0-9]{4}`
|
|
142
|
+
|
|
143
|
+
### Inclusive scan roots (deterministic)
|
|
144
|
+
|
|
145
|
+
From repository root, the checker walks **only**:
|
|
146
|
+
|
|
147
|
+
- `bin/**` (`*.js`)
|
|
148
|
+
- `installer.py`, `installer.ps1`, `installer.sh`
|
|
149
|
+
- `packaging/**` (`*.js`, `*.py`, `*.ps1`, `*.sh`)
|
|
150
|
+
- `scripts/validate-and-push.ps1`, `scripts/validate-and-push.sh`
|
|
151
|
+
|
|
152
|
+
Paths outside this set are **not** scanned by this tool (for example `docs/**`,
|
|
153
|
+
`.cursor/**`, `sprints/**`, `handoffs/**`, `decisions/**` remain free to use
|
|
154
|
+
story/decision/research IDs). If a new operator-visible deliverable is added
|
|
155
|
+
outside these roots, extend the scan list or you risk
|
|
156
|
+
`METADATA_SANITIZATION_SCOPE_AMBIGUOUS` classification during review.
|
|
157
|
+
|
|
158
|
+
### Command
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
python scripts/check-user-visible-metadata.py
|
|
162
|
+
python scripts/check-user-visible-metadata.py --json
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### Reason codes (minimum)
|
|
166
|
+
|
|
167
|
+
- `USER_VISIBLE_INTERNAL_METADATA_DETECTED` — forbidden token matched inside a
|
|
168
|
+
scanned user-visible string/literal.
|
|
169
|
+
- `METADATA_SANITIZATION_POLICY_MISSING` — checker entrypoint missing or
|
|
170
|
+
unusable.
|
|
171
|
+
- `METADATA_SANITIZATION_SCOPE_AMBIGUOUS` — cannot classify whether a path
|
|
172
|
+
belongs in inclusive scan roots; treat as fail-closed until the runbook table
|
|
173
|
+
is updated.
|
|
174
|
+
|
|
175
|
+
### Findings / remediation (contract)
|
|
176
|
+
|
|
177
|
+
On failure, diagnostics must cite **evidence_ref** (`path:line:column` when
|
|
178
|
+
available), **token class** (`US` \| `DEC` \| `R`), and remediation: remove the
|
|
179
|
+
token from operator-visible strings; keep traceability in allowlisted internal
|
|
180
|
+
artifacts or non-emitting comments per `DEC-0053`.
|
|
181
|
+
|
|
182
|
+
## Guided intake mode (US-0033)
|
|
183
|
+
|
|
184
|
+
Intake interaction behavior is controlled by one switch in
|
|
185
|
+
`.cursor/scratchpad.md`:
|
|
186
|
+
|
|
187
|
+
- `INTAKE_GUIDED_MODE=1` (default): guided PO behavior
|
|
188
|
+
- targeted follow-up questions only when acceptance is ambiguous
|
|
189
|
+
- at least one viable option/alternative before recommendation
|
|
190
|
+
- explicit user decision authority
|
|
191
|
+
- intake-time research persisted in `docs/engineering/research.md`
|
|
192
|
+
- `INTAKE_GUIDED_MODE=0`: low-touch intake
|
|
193
|
+
- no proactive follow-up/options/research overhead unless user asks
|
|
194
|
+
- duplicate/overlap backlog check remains mandatory baseline safety
|
|
195
|
+
|
|
196
|
+
## Intake decomposition and risk-aware questioning (US-0051)
|
|
197
|
+
|
|
198
|
+
When guided mode is enabled (`INTAKE_GUIDED_MODE=1`), intake adds bounded
|
|
199
|
+
decomposition and adaptive questioning behavior:
|
|
200
|
+
|
|
201
|
+
- Run deterministic breadth/risk heuristics before persisting a story:
|
|
202
|
+
- feature/workflow-step count
|
|
203
|
+
- cross-cutting impact surface
|
|
204
|
+
- acceptance breadth
|
|
205
|
+
- risk/unknown dependency surface
|
|
206
|
+
- If heuristics indicate broad/high-risk intake:
|
|
207
|
+
- propose bounded multi-story decomposition (typically 2-5 stories)
|
|
208
|
+
- prefer vertical-slice/workflow-step stories with independent user value
|
|
209
|
+
- avoid technical-layer-only splits unless user explicitly requests
|
|
210
|
+
- Preserve user authority explicitly before persistence:
|
|
211
|
+
- user can accept, merge, or adjust the proposed split
|
|
212
|
+
- Keep adaptive questioning concise and bounded:
|
|
213
|
+
- ask ambiguity-driven questions plus risk-triggered questions
|
|
214
|
+
- stop after bounded rounds or when acceptance confidence is sufficient
|
|
215
|
+
- Low-touch compatibility (`INTAKE_GUIDED_MODE=0`):
|
|
216
|
+
- no forced decomposition
|
|
217
|
+
- single-story default unless user explicitly asks for decomposition
|
|
218
|
+
- duplicate/overlap safety remains mandatory
|
|
219
|
+
- Traceability requirement:
|
|
220
|
+
- intake output must capture decomposition/questioning evidence in
|
|
221
|
+
`docs/product/backlog.md`, `docs/product/acceptance.md`, and
|
|
222
|
+
`handoffs/po_to_tl.md`.
|
|
223
|
+
|
|
224
|
+
## Mandatory intake question packs and persistence coverage gate (US-0068 / DEC-0050)
|
|
225
|
+
|
|
226
|
+
Intake persistence is fail-closed unless required topic coverage is complete (or
|
|
227
|
+
bounded assumptions are explicitly confirmed).
|
|
228
|
+
|
|
229
|
+
Deterministic pack contract:
|
|
230
|
+
|
|
231
|
+
- `first-intake-pack` (first/new/broad intake)
|
|
232
|
+
- required topics:
|
|
233
|
+
- `users_problem`
|
|
234
|
+
- `runtime_target_environment`
|
|
235
|
+
- `language_framework_runtime`
|
|
236
|
+
- `architecture_preference`
|
|
237
|
+
- `ui_design_expectations`
|
|
238
|
+
- `security_compliance`
|
|
239
|
+
- `non_functional_priorities`
|
|
240
|
+
- `scope_timeline`
|
|
241
|
+
- `small-intake-pack` (small follow-up intake)
|
|
242
|
+
- required topics:
|
|
243
|
+
- `outcome_success_criteria`
|
|
244
|
+
- `impacted_components`
|
|
245
|
+
- `constraints_compatibility_risks`
|
|
246
|
+
- `required_tests_acceptance_checks`
|
|
247
|
+
- `done_definition`
|
|
248
|
+
|
|
249
|
+
Pack selection and coverage behavior:
|
|
250
|
+
|
|
251
|
+
- Select exactly one pack per intake write path.
|
|
252
|
+
- Unknown/ambiguous stack or project cues must fail closed to
|
|
253
|
+
`first-intake-pack`.
|
|
254
|
+
- Required coverage must be evaluated before writing
|
|
255
|
+
`docs/product/backlog.md` or `docs/product/acceptance.md`.
|
|
256
|
+
- Incomplete required coverage blocks persistence unless assumptions are
|
|
257
|
+
explicitly confirmed.
|
|
258
|
+
|
|
259
|
+
Deterministic fail-closed reason codes:
|
|
260
|
+
|
|
261
|
+
- `INTAKE_REQUIRED_TOPIC_MISSING`
|
|
262
|
+
- `INTAKE_REQUIRED_PACK_INCOMPLETE`
|
|
263
|
+
- `INTAKE_ASSUMPTION_CONFIRMATION_REQUIRED`
|
|
264
|
+
- `INTAKE_PERSISTENCE_BLOCKED`
|
|
265
|
+
|
|
266
|
+
Required remediation output on block:
|
|
267
|
+
|
|
268
|
+
- include `missing_topics`
|
|
269
|
+
- provide targeted follow-up prompts for missing required topics
|
|
270
|
+
- request explicit assumption confirmation when assumptions are used
|
|
271
|
+
|
|
272
|
+
Required persisted intake evidence fields:
|
|
273
|
+
|
|
274
|
+
- `asked_topics`
|
|
275
|
+
- `missing_topics`
|
|
276
|
+
- `assumptions_confirmed`
|
|
277
|
+
|
|
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)
|
|
305
|
+
|
|
306
|
+
- Interactive intake evidence validation (US-0078 / DEC-0060) — automation/harness anchor; extended rules for **US-0083** / **DEC-0067** follow in this section.
|
|
307
|
+
|
|
308
|
+
**US-0078** adds machine-verifiable **`topic_coverage`** rows, canonical **`ie:`** refs
|
|
309
|
+
(**DEC-0060**), asked-vs-covered enforcement, and **`assumption_confirmation_ref`**
|
|
310
|
+
binding before backlog/acceptance writes.
|
|
311
|
+
|
|
312
|
+
- Validator entrypoints: `python scripts/intake_evidence_validate.py --self-test`;
|
|
313
|
+
`python scripts/intake_evidence_validate.py --file <bundle.json>` or `--stdin`.
|
|
314
|
+
- Library: `scripts/intake_evidence_lib.py` (shared rules for tests and tooling).
|
|
315
|
+
- Regression: `tests/intake_evidence_fixtures_test.py` (R-0055 **AC-8** matrix tiers A/B),
|
|
316
|
+
invoked from `tests/run-tests.ps1` / `tests/run-tests.sh` §26k.
|
|
317
|
+
- **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).
|
|
318
|
+
- **US-0084**: `remote_config_summary.py` and `guard_installer_publish.py` use the same **`template/scripts/`** mirror + manifest rows; npm **`package.json` `files`** also lists the active copies for publish.
|
|
319
|
+
- **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).
|
|
320
|
+
- **Guided** and **low-touch** (`INTAKE_GUIDED_MODE=0`) share the **same** pre-persistence
|
|
321
|
+
validation pipeline; mandatory pack evidence is never skipped.
|
|
322
|
+
- Legacy intake evidence without **`ie:`** refs remains **grandfathered** for display until the
|
|
323
|
+
next intake-driven mutation, which must supply full evidence (**DEC-0060** §5).
|
|
324
|
+
- **Delegated required-topic path (US-0083 / DEC-0067)**:
|
|
325
|
+
- Allowed: `topic_coverage[].satisfied_by=delegation_ref` with required
|
|
326
|
+
`delegation_scope`, `delegation_rationale`, `delegation_confidence` (`low|medium|high`).
|
|
327
|
+
- Missing delegation fields fail closed with `INTAKE_DELEGATION_EVIDENCE_MISSING`.
|
|
328
|
+
- Malformed delegation values or invalid `ie:` binding fail closed with
|
|
329
|
+
`INTAKE_DELEGATION_EVIDENCE_INVALID`.
|
|
330
|
+
- Non-delegated unresolved required topics remain unchanged fail-closed
|
|
331
|
+
(`INTAKE_REQUIRED_TOPIC_MISSING` path).
|
|
332
|
+
- **Repetitive-ask suppression with accounting (US-0083 AC-1)**:
|
|
333
|
+
- When equivalent evidence already exists, avoid re-asking by recording row-level
|
|
334
|
+
`evidence_source=equivalent_evidence_ref` plus `equivalent_evidence_ref`.
|
|
335
|
+
- Required-topic accounting remains explicit through `topic_coverage` rows.
|
|
336
|
+
|
|
337
|
+
## Bug issues (US-0079 / DEC-0061)
|
|
338
|
+
|
|
339
|
+
- **Canonical ids**: **`BUG-####`** in **`docs/product/backlog.md`** **`## Bug issues (canonical)`**; status literals **`OPEN`** | **`DONE`** only — illegal values fail **`BUG_VALIDATION_STATUS_INVALID`**.
|
|
340
|
+
- **Minimum fields** (non-empty): **`environment`**, **`steps_to_reproduce`**, **`expected`**, **`actual`**, **`evidence_refs`** — missing/empty → **`BUG_VALIDATION_FIELD_EMPTY`** (or **`BUG_VALIDATION_SECTION_MISSING`** when the region is absent).
|
|
341
|
+
- **Ordering**: bug blocks sorted by id ascending — violation → **`BUG_VALIDATION_ORDER_INVERSION`**.
|
|
342
|
+
- **Intake routing**: merged **`INTAKE_WORK_ITEM_KIND=story|bug`** and/or explicit **`/intake bug`**; defect-shaped prose with **`story`** kind → **`INTAKE_BUG_ROUTING_REQUIRED`** via **`python scripts/intake_bug_routing_guard.py`** (**DEC-0061** §5). Mismatch/conflict → **`INTAKE_WORK_ITEM_KIND_MISMATCH`** family (documented in command surfaces).
|
|
343
|
+
- **Acceptance reconciliation**: **`docs/product/acceptance.md`** **`## Bug acceptance (canonical)`** checkbox rows must match backlog bug status — drift codes **`BUG_RECONCILE_ACCEPTANCE_*`**.
|
|
344
|
+
- **Commands**:
|
|
345
|
+
- `python scripts/bug_issue_validate.py --self-test`
|
|
346
|
+
- `python scripts/bug_issue_validate.py --backlog docs/product/backlog.md [--check-acceptance] [--print-next-id]`
|
|
347
|
+
- `python scripts/intake_bug_routing_guard.py --kind story|bug --file <path>` (or **`--stdin`**)
|
|
348
|
+
- **Regression**: `tests/bug_issue_fixtures_test.py` (R-0056 Tier A/B), invoked from **`tests/run-tests.ps1` / `tests/run-tests.sh`** §26L.
|
|
349
|
+
|
|
350
|
+
## Optional ID namespace bootstrap (US-0052)
|
|
351
|
+
|
|
352
|
+
Fresh-project ID bootstrap is optional and default-off in
|
|
353
|
+
`.cursor/scratchpad.md`:
|
|
354
|
+
|
|
355
|
+
- `ID_NAMESPACE_BOOTSTRAP=0|1` (default `0`)
|
|
356
|
+
|
|
357
|
+
Deterministic behavior:
|
|
358
|
+
|
|
359
|
+
- If `ID_NAMESPACE_BOOTSTRAP=1`, evaluate freshness eligibility before creating
|
|
360
|
+
new IDs:
|
|
361
|
+
- no `US-` IDs in `docs/product/backlog.md`
|
|
362
|
+
- no `DEC-` IDs in `docs/engineering/decisions.md` (and no existing
|
|
363
|
+
`decisions/DEC-*.md`)
|
|
364
|
+
- no `R-` IDs in `docs/engineering/research.md`
|
|
365
|
+
- If eligible, first created IDs start at:
|
|
366
|
+
- `US-0001` for intake stories
|
|
367
|
+
- `DEC-0001` for architecture decisions
|
|
368
|
+
- `R-0001` for research entries
|
|
369
|
+
- If not eligible (or mode is off), continue from highest existing ID in each
|
|
370
|
+
namespace.
|
|
371
|
+
- Never rewrite/renumber historical IDs.
|
|
372
|
+
- If bootstrap is requested but ineligible, emit deterministic diagnostic
|
|
373
|
+
`ID_BOOTSTRAP_NOT_FRESH` and continue with highest-existing continuation.
|
|
374
|
+
|
|
375
|
+
## Context compaction and token profile mode (US-0053 / DEC-0035)
|
|
376
|
+
|
|
377
|
+
Tiered token-cost control is explicit and defaulted in `.cursor/scratchpad.md`:
|
|
378
|
+
|
|
379
|
+
- `TOKEN_PROFILE=lean|balanced|full` (default `balanced`)
|
|
380
|
+
|
|
381
|
+
Deterministic profile semantics:
|
|
382
|
+
|
|
383
|
+
- `lean`: reduce non-critical overhead defaults (for example aggressive research,
|
|
384
|
+
autonomous loops, broad-context retrieval), while preserving mandatory
|
|
385
|
+
quality/release gates.
|
|
386
|
+
- `balanced`: preserve current capability profile with moderate overhead.
|
|
387
|
+
- `full`: maximize context breadth and autonomy for complex/high-uncertainty work.
|
|
388
|
+
|
|
389
|
+
Manual override precedence:
|
|
390
|
+
|
|
391
|
+
- Explicit flag values remain authoritative for that flag.
|
|
392
|
+
- If a flag is explicitly set, it overrides profile defaults.
|
|
393
|
+
- Profile changes must not disable mandatory gate contracts
|
|
394
|
+
(`/qa`, `/verify-work`, `/release`).
|
|
395
|
+
|
|
396
|
+
### Token-cost evidence + comparability (US-0080 / DEC-0062)
|
|
397
|
+
|
|
398
|
+
- **Fresh context**: spawn **new** subagents per `/auto` phase; avoid carrying prior chat
|
|
399
|
+
reasoning as phase input.
|
|
400
|
+
- **`start-from`**: use **`/auto start-from=<canonical_phase_id>`** when resuming so the
|
|
401
|
+
schedule intersection matches materialized **`resolved_phase_plan`** (**`DEC-0052`**).
|
|
402
|
+
- **`TOKEN_PROFILE`**: `lean` lowers default automation breadth; does **not** remove
|
|
403
|
+
isolation, strict-proof, role, or release gates.
|
|
404
|
+
- **Metrics**: append-only **`handoffs/token_cost_runs/<orchestrator_run_id>.md`** (or
|
|
405
|
+
**`.jsonl`**); copy path into **`token_cost_evidence_ref`** on **`state.md`** checkpoints.
|
|
406
|
+
- **AC-2**: compare **`cache_read_tokens`** only when **`run_class_hash`** matches; else
|
|
407
|
+
**`TOKEN_COST_RUN_CLASS_MISMATCH`**.
|
|
408
|
+
- **CI/repo checks**: `python scripts/check_token_cost_parity.py --repo .` (manifest-listed
|
|
409
|
+
active/`template/` pairs); **`tests/run-tests.ps1`** / **`tests/run-tests.sh`** §26M.
|
|
410
|
+
|
|
411
|
+
Context compaction policy:
|
|
412
|
+
|
|
413
|
+
- `docs/engineering/state.md` is a compact hot surface for current execution
|
|
414
|
+
context and recent checkpoints.
|
|
415
|
+
- Historical state packs belong in `docs/engineering/state-archive/` and are
|
|
416
|
+
append-only/non-destructive.
|
|
417
|
+
- `docs/engineering/decisions.md` is a compact index with bounded summaries and
|
|
418
|
+
canonical links to full records in `decisions/DEC-xxxx.md`.
|
|
419
|
+
- Enforced rollover thresholds:
|
|
420
|
+
- `STATE_HOT_MAX_LINES` (default `1200`)
|
|
421
|
+
- `STATE_HOT_MAX_CHECKPOINTS` (default `80`)
|
|
422
|
+
- `PO_TO_TL_HOT_MAX_LINES` (default `800`)
|
|
423
|
+
- `PO_TO_TL_HOT_MAX_SECTIONS` (default `60`)
|
|
424
|
+
- `ARCH_HOT_MAX_LINES` (default `3500`)
|
|
425
|
+
- `ARCH_HOT_MAX_STORY_SECTIONS` (default `120`)
|
|
426
|
+
Thresholds resolve from merged `.cursor/scratchpad.md` +
|
|
427
|
+
`.cursor/scratchpad.local.md` (DEC-0054 triad contract).
|
|
428
|
+
When a cap is exceeded, the mutating phase must run rollover **before**
|
|
429
|
+
completion or fail closed (no successful completion with an oversize hot
|
|
430
|
+
surface).
|
|
431
|
+
|
|
432
|
+
### Triad hot-surface enforcement (DEC-0054)
|
|
433
|
+
|
|
434
|
+
Canonical hot/archive surfaces:
|
|
435
|
+
|
|
436
|
+
- `docs/engineering/state.md` → `docs/engineering/state-archive/state-pack-*.md`
|
|
437
|
+
- `handoffs/po_to_tl.md` → `handoffs/archive/po-to-tl-pack-*.md`
|
|
438
|
+
- `docs/engineering/architecture.md` →
|
|
439
|
+
`docs/engineering/architecture-archive/architecture-pack-*.md`
|
|
440
|
+
|
|
441
|
+
Operator commands:
|
|
442
|
+
|
|
443
|
+
```bash
|
|
444
|
+
python scripts/enforce-triad-hot-surface.py --check
|
|
445
|
+
python scripts/enforce-triad-hot-surface.py --rollover
|
|
446
|
+
```
|
|
447
|
+
|
|
448
|
+
- `--check` verifies all three surfaces are within policy (CI-safe).
|
|
449
|
+
- `--rollover` archives oldest contiguous units into the next deterministic pack
|
|
450
|
+
name; reruns are idempotent when already within caps.
|
|
451
|
+
- Successful rollover records a verification tuple:
|
|
452
|
+
`boundary`, `moved`, `retained` (counts / lines), `pack_ref`.
|
|
453
|
+
|
|
454
|
+
Rollover fail-safe reason codes:
|
|
455
|
+
|
|
456
|
+
- `STATE_ARCHIVE_BOUNDARY_AMBIGUOUS`
|
|
457
|
+
- `STATE_ARCHIVE_WRITE_FAILED`
|
|
458
|
+
- `STATE_ARCHIVE_VERIFICATION_FAILED`
|
|
459
|
+
- `STATE_ARCHIVE_REQUIRED`
|
|
460
|
+
- `ARTIFACT_HOT_SURFACE_OVERSIZE`
|
|
461
|
+
- `CONTEXT_BUDGET_EXCEEDED`
|
|
462
|
+
|
|
463
|
+
### Minimal-read defaults by phase (bounded escalation)
|
|
464
|
+
|
|
465
|
+
Read `docs/engineering/phase-context.md` first, then the **required** paths for
|
|
466
|
+
your phase. If unresolved, expand once to the **single** archive pack named in
|
|
467
|
+
the latest verification tuple for that surface. Do not load entire archive
|
|
468
|
+
directories by default.
|
|
469
|
+
|
|
470
|
+
| Phase | Required reads (default) | Combined line budget (guidance) |
|
|
471
|
+
|-------|--------------------------|----------------------------------|
|
|
472
|
+
| `/intake` | `phase-context.md`, target story in `docs/product/backlog.md`, `handoffs/po_to_tl.md` (tail) | ≤ 900 lines |
|
|
473
|
+
| `/discovery` | `phase-context.md`, `docs/product/vision.md` (story notes), `handoffs/po_to_tl.md` (tail) | ≤ 900 lines |
|
|
474
|
+
| `/research` | `phase-context.md`, `docs/engineering/research.md` (target entry), `docs/product/backlog.md` (target story) | ≤ 800 lines |
|
|
475
|
+
| `/architecture` | `phase-context.md`, `docs/engineering/architecture.md` (target story section), `docs/engineering/research.md` | ≤ 1200 lines |
|
|
476
|
+
| `/sprint-plan` | `phase-context.md`, `docs/engineering/architecture.md` (target story), `handoffs/tl_to_dev.md` | ≤ 1000 lines |
|
|
477
|
+
| `/plan-verify` | `phase-context.md`, `sprints/Sxxxx/tasks.md`, `docs/product/backlog.md` (ACs) | ≤ 900 lines |
|
|
478
|
+
| `/execute` | `phase-context.md`, `sprints/Sxxxx/tasks.md`, `handoffs/tl_to_dev.md` | ≤ 800 lines |
|
|
479
|
+
| `/qa` | `phase-context.md`, `sprints/Sxxxx/`, `tests/report.md` | ≤ 900 lines |
|
|
480
|
+
| `/verify-work` | `phase-context.md`, `sprints/Sxxxx/uat.json`, QA findings | ≤ 600 lines |
|
|
481
|
+
| `/release` | `phase-context.md`, release queue + sprint release findings | ≤ 700 lines |
|
|
482
|
+
| `/refresh-context` | `phase-context.md`, `docs/engineering/state.md` (tail), `docs/product/backlog.md` (status) | ≤ 900 lines |
|
|
483
|
+
| `/auto` (resolver) | `phase-context.md`, `handoffs/resume_brief.md`, `docs/engineering/state.md` (tail) | ≤ 700 lines |
|
|
484
|
+
|
|
485
|
+
If the default set is insufficient, escalate with an explicit note citing
|
|
486
|
+
`pack_ref`. Unbounded broad reads fail closed with `CONTEXT_BUDGET_EXCEEDED`.
|
|
487
|
+
|
|
488
|
+
`/ask` retrieval policy:
|
|
489
|
+
|
|
490
|
+
- Use question-scoped narrow reads first.
|
|
491
|
+
- Expand context in bounded steps only when unresolved.
|
|
492
|
+
- If unresolved after bounded expansion, answer with explicit "not found in
|
|
493
|
+
current artifacts" rather than broad speculative reads.
|
|
494
|
+
|
|
495
|
+
## Configurable multi-target publish mode (US-0054 / DEC-0036)
|
|
496
|
+
|
|
497
|
+
Post-release publish orchestration is configurable and default-safe:
|
|
498
|
+
|
|
499
|
+
- `RELEASE_PUBLISH_MODE=disabled|confirm|auto` (default `confirm`)
|
|
500
|
+
- `RELEASE_TARGETS_FILE=docs/engineering/release-targets.json`
|
|
501
|
+
- `RELEASE_TARGETS_DEFAULT=` optional comma-separated default target IDs
|
|
502
|
+
|
|
503
|
+
Target schema contract:
|
|
504
|
+
|
|
505
|
+
- Canonical target config file: `docs/engineering/release-targets.json`
|
|
506
|
+
- Supported target types:
|
|
507
|
+
- `npm`, `choco`, `brew`, `git`, `docker`, `cloud`
|
|
508
|
+
- `custom` (generic command target)
|
|
509
|
+
- `ssh` (host/user/port/auth reference + remote command)
|
|
510
|
+
- Connectivity metadata (for operator-safe remote/local context):
|
|
511
|
+
- `runtime.mode` (`local|remote`)
|
|
512
|
+
- endpoint fields (`domainEnv|ipEnv|hostEnv`, `port`, `protocol`)
|
|
513
|
+
- optional ingress metadata (`traefik.enabled`, `router`, `entrypoint`, `tls`)
|
|
514
|
+
- optional `dockerOverSsh` object for ssh/dockerd remote execution context
|
|
515
|
+
- Each target entry must define deterministic fields:
|
|
516
|
+
- `id` (stable unique target ID)
|
|
517
|
+
- `type`
|
|
518
|
+
- `enabled` (`true|false`)
|
|
519
|
+
- `order` (deterministic execution ordering)
|
|
520
|
+
- execution details (`command` for non-ssh, `remoteCommand` + host/user/auth refs for `ssh`)
|
|
521
|
+
|
|
522
|
+
Safety contract:
|
|
523
|
+
|
|
524
|
+
- Mandatory release gates remain unchanged and must pass before any publish
|
|
525
|
+
target execution.
|
|
526
|
+
- `confirm` mode requires explicit operator approval before publish execution.
|
|
527
|
+
- Sensitive fields must be env-referenced (`*Env` keys); inline secret literals
|
|
528
|
+
are not allowed.
|
|
529
|
+
- Invalid target config must fail fast with deterministic diagnostics and no
|
|
530
|
+
partial side effects.
|
|
531
|
+
- Invalid remote connectivity metadata must fail fast with
|
|
532
|
+
`REMOTE_CONNECTIVITY_CONFIG_INVALID`.
|
|
533
|
+
- Canonical operator endpoint summary is written to
|
|
534
|
+
`docs/engineering/runtime-connectivity.md` with sanitized values only.
|
|
535
|
+
|
|
536
|
+
## Release operator hints contract (US-0067 / DEC-0049)
|
|
537
|
+
|
|
538
|
+
Release outputs must include deterministic operator-ready hints with mandatory
|
|
539
|
+
section order:
|
|
540
|
+
|
|
541
|
+
`Run -> Connect -> Verify -> Credentials -> Known Issues`
|
|
542
|
+
|
|
543
|
+
Required fields for canonical sprint notes
|
|
544
|
+
(`handoffs/releases/Sxxxx-release-notes.md`):
|
|
545
|
+
|
|
546
|
+
- `Run`: `start_command`, `runtime_mode`, `runtime_context_ref`
|
|
547
|
+
- `Connect`: `service_url`, `service_port`, `health_endpoint`
|
|
548
|
+
- `Verify`: deterministic `verification_steps`, `expected_health_signal`
|
|
549
|
+
- `Credentials`: env-reference-only source refs and expected value-source
|
|
550
|
+
location guidance (never inline secrets)
|
|
551
|
+
- `Known Issues`: concise issue list or explicit `None`
|
|
552
|
+
|
|
553
|
+
Legacy pointer contract (`handoffs/release_notes.md`):
|
|
554
|
+
|
|
555
|
+
- keep concise latest run/connect/verify summary only
|
|
556
|
+
- always link to canonical sprint-scoped release notes for full details
|
|
557
|
+
|
|
558
|
+
Fail-closed reason codes:
|
|
559
|
+
|
|
560
|
+
- `RELEASE_OPERATOR_HINTS_MISSING`
|
|
561
|
+
- `RELEASE_OPERATOR_HINTS_AMBIGUOUS`
|
|
562
|
+
- `RELEASE_OPERATOR_HINTS_SECRET_EXPOSURE`
|
|
563
|
+
|
|
564
|
+
## Deterministic status reconciliation mode (US-0055 / DEC-0037)
|
|
565
|
+
|
|
566
|
+
Use the dedicated reconciliation command to normalize status drift across
|
|
567
|
+
canonical and derived artifacts:
|
|
568
|
+
|
|
569
|
+
- Command: `/status-reconcile`
|
|
570
|
+
- Canonical source: `docs/product/backlog.md` (story `Status`)
|
|
571
|
+
- Derived surfaces: `docs/product/acceptance.md`, `docs/engineering/state.md`,
|
|
572
|
+
`handoffs/resume_brief.md`
|
|
573
|
+
|
|
574
|
+
Deterministic behavior:
|
|
575
|
+
|
|
576
|
+
- Detects mismatches (for example DONE + unchecked ACs, acceptance drift, resume drift).
|
|
577
|
+
- Applies target-scoped reconciliation only to mismatched story blocks/rows.
|
|
578
|
+
- Preserves canonical ownership; derived artifacts reconcile to backlog status.
|
|
579
|
+
- Updates `handoffs/resume_brief.md` to next OPEN story and intended phase.
|
|
580
|
+
- Writes auditable rows to `docs/engineering/status-normalization-report.md`.
|
|
581
|
+
|
|
582
|
+
Reason-code baseline:
|
|
583
|
+
|
|
584
|
+
- `STATUS_RECONCILE_APPLIED`
|
|
585
|
+
- `STATUS_RECONCILE_NOOP`
|
|
586
|
+
- `STATUS_RECONCILE_MISSING_INPUT`
|
|
587
|
+
- `STATUS_RECONCILE_CANONICAL_CONFLICT`
|
|
588
|
+
- `STATUS_RECONCILE_PHASE_AMBIGUOUS`
|
|
589
|
+
- `STATUS_RECONCILE_EVIDENCE_MISSING`
|
|
590
|
+
|
|
591
|
+
## Optional cross-repo observability mode (US-0034)
|
|
592
|
+
|
|
593
|
+
Compatibility visibility is optional and default-off in `.cursor/scratchpad.md`:
|
|
594
|
+
|
|
595
|
+
- `CROSS_REPO_OBSERVABILITY=0|1` (default `0`)
|
|
596
|
+
- `COMPATIBILITY_GATE_ON_CRITICAL=0|1` (default `1`)
|
|
597
|
+
- `COMPATIBILITY_SOURCES=` monitored source declarations
|
|
598
|
+
|
|
599
|
+
Default-off behavior:
|
|
600
|
+
- With `CROSS_REPO_OBSERVABILITY=0`, `/intake`, `/architecture`, `/execute`,
|
|
601
|
+
and `/qa` add zero required compatibility overhead.
|
|
602
|
+
|
|
603
|
+
Enabled behavior (`CROSS_REPO_OBSERVABILITY=1`):
|
|
604
|
+
- Use canonical artifacts:
|
|
605
|
+
- `docs/engineering/compatibility-report.md`
|
|
606
|
+
- `docs/engineering/compatibility-signals.md`
|
|
607
|
+
- `docs/engineering/manifests/registry.manifest.yaml`
|
|
608
|
+
- `docs/engineering/manifests/repo.manifest.yaml`
|
|
609
|
+
- Record findings with severity, affected modules, evidence refs, and
|
|
610
|
+
recommended actions.
|
|
611
|
+
- If unresolved critical findings exist and
|
|
612
|
+
`COMPATIBILITY_GATE_ON_CRITICAL=1`, trigger decision gate before release
|
|
613
|
+
progression (`COMPATIBILITY_CRITICAL_OPEN`).
|
|
614
|
+
|
|
615
|
+
## Optional component-scoped execution mode (US-0035)
|
|
616
|
+
|
|
617
|
+
Component-scoped execution is optional and default-off:
|
|
618
|
+
|
|
619
|
+
- `COMPONENT_SCOPE_MODE=0|1` (default `0`)
|
|
620
|
+
- `TARGET_COMPONENTS=` comma-separated scoped component IDs
|
|
621
|
+
|
|
622
|
+
Default-off behavior:
|
|
623
|
+
- With `COMPONENT_SCOPE_MODE=0`, workflow phases add zero required scope
|
|
624
|
+
overhead.
|
|
625
|
+
|
|
626
|
+
Enabled behavior (`COMPONENT_SCOPE_MODE=1`):
|
|
627
|
+
- Declare scope in `docs/engineering/component-scope.md`:
|
|
628
|
+
- `target_components[]`
|
|
629
|
+
- `non_target_components[]`
|
|
630
|
+
- `allowed_interface_touch[]`
|
|
631
|
+
- `/sprint-plan` tasks declare `target_component_ids` and
|
|
632
|
+
`expected_impacted_interfaces`.
|
|
633
|
+
- `/execute` enforces scope-first behavior.
|
|
634
|
+
- `/qa` verifies unaffected-component checks and records evidence in
|
|
635
|
+
`docs/engineering/component-scope-report.md`.
|
|
636
|
+
- If unapproved out-of-scope impact remains open, release must stop at decision
|
|
637
|
+
gate (`COMPONENT_SCOPE_VIOLATION_UNAPPROVED`).
|
|
638
|
+
|
|
639
|
+
## Optional spec-pack documentation mode (US-0031)
|
|
640
|
+
|
|
641
|
+
Spec-pack mode is optional and default-off in `.cursor/scratchpad.md`:
|
|
642
|
+
|
|
643
|
+
- `SPEC_PACK_MODE=0|1` (default `0`)
|
|
644
|
+
|
|
645
|
+
Default-off behavior:
|
|
646
|
+
- With `SPEC_PACK_MODE=0`, `/intake`, `/architecture`, `/execute`, `/qa`, and
|
|
647
|
+
`/release` add no required spec-pack steps (zero overhead).
|
|
648
|
+
|
|
649
|
+
Enabled behavior (`SPEC_PACK_MODE=1`):
|
|
650
|
+
|
|
651
|
+
**Canonical names and locations** (per story):
|
|
652
|
+
- Design Concept: `docs/engineering/spec-pack/<story_id>-design-concept.md`
|
|
653
|
+
- CRS (Customer/Product Requirements Summary): `docs/engineering/spec-pack/<story_id>-crs.md`
|
|
654
|
+
- Technical Specification: `docs/engineering/spec-pack/<story_id>-technical-specification.md`
|
|
655
|
+
|
|
656
|
+
**Traceability**: Backlog story ID (e.g. `US-0031`) maps 1:1 to the three
|
|
657
|
+
artifacts above. Handoffs and state should reference these paths when
|
|
658
|
+
spec-pack mode is enabled.
|
|
659
|
+
|
|
660
|
+
**Minimum required sections** (completeness is testable; validation blocks
|
|
661
|
+
only when enabled and a required section is missing or empty):
|
|
662
|
+
|
|
663
|
+
- Design Concept: `# Summary`, `# Goals`, `# Non-goals`, `# Key decisions`
|
|
664
|
+
- CRS: `# Purpose`, `# Scope`, `# Acceptance criteria ref`
|
|
665
|
+
- Technical Specification: `# Overview`, `# Components`, `# Interfaces`, `# Non-functional`
|
|
666
|
+
|
|
667
|
+
**Validation**: When `SPEC_PACK_MODE=1`, release gate checks that for the
|
|
668
|
+
target sprint story, all three artifacts exist and each required section
|
|
669
|
+
above is present and non-empty. If not, release is blocked with reason code
|
|
670
|
+
`SPEC_PACK_INCOMPLETE` and remediation guidance.
|
|
671
|
+
|
|
672
|
+
**Ownership (role/phase)**:
|
|
673
|
+
- Design Concept: Tech Lead, `/architecture` (create/update).
|
|
674
|
+
- CRS: PO, `/intake` (create/update for new story); Tech Lead may extend in
|
|
675
|
+
architecture.
|
|
676
|
+
- Technical Specification: Tech Lead, `/architecture` (create); Dev, `/execute`
|
|
677
|
+
(update when implementation details change).
|
|
678
|
+
|
|
679
|
+
## Optional user-guide documentation mode (US-0032)
|
|
680
|
+
|
|
681
|
+
User-guide mode is optional and default-off in `.cursor/scratchpad.md`:
|
|
682
|
+
|
|
683
|
+
- `USER_GUIDE_MODE=0|1` (default `0`)
|
|
684
|
+
|
|
685
|
+
Default-off behavior:
|
|
686
|
+
- With `USER_GUIDE_MODE=0`, `/intake`, `/architecture`, `/sprint-plan`, `/execute`,
|
|
687
|
+
`/qa`, and `/release` add no required user-guide steps or blocking checks (zero overhead).
|
|
688
|
+
|
|
689
|
+
Enabled behavior (`USER_GUIDE_MODE=1`):
|
|
690
|
+
|
|
691
|
+
**Canonical location and naming** (per feature story):
|
|
692
|
+
- One guide per feature story: `docs/user-guides/US-xxxx.md` (e.g. `docs/user-guides/US-0032.md`).
|
|
693
|
+
- Story ID `US-xxxx` is the stable identifier; create/update the guide when the story is in scope.
|
|
694
|
+
|
|
695
|
+
**Minimum required schema** (structural validation only; completeness is testable):
|
|
696
|
+
- `# Purpose`
|
|
697
|
+
- `# Prerequisites`
|
|
698
|
+
- `# Usage steps`
|
|
699
|
+
- `# Example`
|
|
700
|
+
- `# Limitations`
|
|
701
|
+
- `# Troubleshooting`
|
|
702
|
+
|
|
703
|
+
**Traceability**: Story ID maps 1:1 to the user-guide artifact. Handoffs and release
|
|
704
|
+
context should reference `docs/user-guides/US-xxxx.md` for the target story when
|
|
705
|
+
user-guide mode is enabled.
|
|
706
|
+
|
|
707
|
+
**Validation**: When `USER_GUIDE_MODE=1`, release gate checks that for the target
|
|
708
|
+
sprint story, the guide file exists at the canonical path and each required section
|
|
709
|
+
above is present and non-empty. If not, release is blocked with reason code
|
|
710
|
+
`USER_GUIDE_INCOMPLETE` and remediation guidance (create or complete the guide).
|
|
711
|
+
|
|
712
|
+
**Boundary with spec-pack (US-0031)**: User guides are end-user facing how-to
|
|
713
|
+
documentation only. They do not duplicate Design Concept, CRS, or Technical
|
|
714
|
+
Specification content; user guides may reference spec-pack artifacts but must not
|
|
715
|
+
replicate their ownership or technical scope. See runbook/README separation guidance.
|
|
716
|
+
|
|
717
|
+
## Legacy DONE-story drift detection and guard (US-0049)
|
|
718
|
+
|
|
719
|
+
Stories that are DONE in backlog but lack aligned acceptance/traceability or
|
|
720
|
+
release representation are in **legacy drift**. US-0049 adds detection, bounded
|
|
721
|
+
repair, and an ongoing guard at release/reconciliation (DEC-0031).
|
|
722
|
+
|
|
723
|
+
**Detection rule** — A story is in legacy drift when:
|
|
724
|
+
- Backlog status is **DONE**, and
|
|
725
|
+
- At least one of:
|
|
726
|
+
- Acceptance checklist item for that story is **unchecked**
|
|
727
|
+
- Traceability index or `docs/engineering/state.md` **lacks an entry** for that story
|
|
728
|
+
- Release artifacts (e.g. `handoffs/releases/Sxxxx-release-notes.md`, queue row)
|
|
729
|
+
**lack clear representation** for that story
|
|
730
|
+
|
|
731
|
+
**Bounded repair**: Only stories matching the rule above may be mutated; no broad
|
|
732
|
+
rewrite of unrelated backlog/acceptance/state/release artifacts.
|
|
733
|
+
|
|
734
|
+
**Canonical audit artifact**: `docs/engineering/legacy-drift-audit.md`
|
|
735
|
+
- Required fields per entry: story ID, prior acceptance state, prior traceability
|
|
736
|
+
state, resolved state(s), reason code, evidence reference.
|
|
737
|
+
- Append-only; one-time backfill and ongoing guard append entries when drift is
|
|
738
|
+
detected and repaired (or when guard blocks and reports).
|
|
739
|
+
|
|
740
|
+
**Reason-code vocabulary** (with remediation):
|
|
741
|
+
- `BACKLOG_DONE_ACCEPTANCE_UNCHECKED` — Backlog DONE but acceptance item unchecked.
|
|
742
|
+
Remediation: set acceptance checkbox from canonical release/state evidence or run one-time backfill.
|
|
743
|
+
- `BACKLOG_DONE_TRACEABILITY_MISSING` — Backlog DONE but traceability/state lacks entry.
|
|
744
|
+
Remediation: add traceability row in `docs/engineering/state.md` from backlog/release evidence or run backfill.
|
|
745
|
+
- `BACKLOG_DONE_RELEASE_ARTIFACT_MISSING` — Backlog DONE but release artifacts lack representation.
|
|
746
|
+
Remediation: ensure release notes or queue row exists for the story’s sprint or run backfill.
|
|
747
|
+
|
|
748
|
+
**One-time backfill mode**: Explicit trigger (e.g. dedicated check or `/memory-audit`-related path).
|
|
749
|
+
- Run detection once over all DONE stories; for each legacy-drift story, perform
|
|
750
|
+
target-scoped repair and append an entry to `docs/engineering/legacy-drift-audit.md`.
|
|
751
|
+
- Idempotent when no drift: no mutations; report empty or "no drift".
|
|
752
|
+
- Only stories matching the detection rule are mutated.
|
|
753
|
+
|
|
754
|
+
**Ongoing guard**: At release or reconciliation boundary (or dedicated check).
|
|
755
|
+
- When legacy drift is detected, either **block** with explicit reason code and
|
|
756
|
+
remediation, or **repair** target-scoped and append audit entry (policy documented).
|
|
757
|
+
- Behavior is deterministic; operators get explicit diagnostics.
|
|
758
|
+
|
|
759
|
+
## Memory drift auditing
|
|
760
|
+
|
|
761
|
+
Run `/memory-audit` at key workflow checkpoints to verify artifact consistency:
|
|
762
|
+
|
|
763
|
+
- **Pre-handoff**: before writing `handoffs/dev_to_qa.md` or any role handoff.
|
|
764
|
+
- **Pre-QA**: before running `/qa` or `/verify-work`.
|
|
765
|
+
- **Pre-release**: before running `/release`.
|
|
766
|
+
- **Ad-hoc**: after external code changes, long pauses, or whenever artifacts
|
|
767
|
+
feel stale.
|
|
768
|
+
|
|
769
|
+
Output: `docs/engineering/memory-drift-report.md` — an advisory report with
|
|
770
|
+
severity-classified findings. The command is read-only and non-blocking.
|
|
771
|
+
|
|
772
|
+
Interpreting results:
|
|
773
|
+
- **high**: artifact contradicts repository state — fix before next handoff/release.
|
|
774
|
+
- **medium**: artifact is likely stale — fix before release.
|
|
775
|
+
- **low**: minor inconsistency — fix during `/refresh-context` or next sprint.
|
|
776
|
+
|
|
777
|
+
Template drift findings (active vs `template/`) are listed for reference only
|
|
778
|
+
and belong to US-0017 scope.
|
|
779
|
+
|
|
780
|
+
Follow-up commands: `/refresh-context`, `/sprint-plan`, `/verify-work`, `/intake`.
|
|
781
|
+
|
|
782
|
+
## Remote execution validation contract
|
|
783
|
+
|
|
784
|
+
Remote execution is mode-aware and default-off:
|
|
785
|
+
|
|
786
|
+
- `REMOTE_EXECUTION=0`: skip remote-config validation entirely (zero overhead).
|
|
787
|
+
- `REMOTE_EXECUTION=1`: validate `.cursor/remote.json` before remote activities;
|
|
788
|
+
fail fast on first blocking issue.
|
|
789
|
+
|
|
790
|
+
Validation classes (remote-enabled mode):
|
|
791
|
+
|
|
792
|
+
1. Presence: config file exists at `REMOTE_CONFIG` (default `.cursor/remote.json`)
|
|
793
|
+
2. Syntax: JSON parses cleanly
|
|
794
|
+
3. Contract: required fields/types/enums
|
|
795
|
+
4. Semantics: `defaultTarget` points to an existing enabled target; target ids
|
|
796
|
+
are unique
|
|
797
|
+
5. Security: no inline secret-like literals; env-var refs only for sensitive values
|
|
798
|
+
|
|
799
|
+
Required contract summary:
|
|
800
|
+
|
|
801
|
+
- Root: `version` (integer), `defaultTarget` (string), `targets` (array)
|
|
802
|
+
- Target: `id` (string), `type` (`docker|ssh|vm`), `enabled` (boolean),
|
|
803
|
+
`host` (string), `port` (integer `1..65535`), `workspaceRoot` (string)
|
|
804
|
+
- Optional auth: `auth.mode` (`none|env`); if `env`, use `*Env` references
|
|
805
|
+
|
|
806
|
+
Error message format (actionable, fail-fast):
|
|
807
|
+
|
|
808
|
+
- `[REMOTE_CONFIG_ERROR] <path>: expected <rule>, got <actual>. Fix: <hint>.`
|
|
809
|
+
|
|
810
|
+
Operator troubleshooting:
|
|
811
|
+
|
|
812
|
+
- Missing config file:
|
|
813
|
+
- Copy from `template/.cursor/remote.json`, or disable remote mode.
|
|
814
|
+
- Malformed JSON:
|
|
815
|
+
- Fix syntax (commas/brackets/quotes), then retry.
|
|
816
|
+
- Invalid value or enum:
|
|
817
|
+
- Correct field value to the documented contract.
|
|
818
|
+
- Security violation (inline secret-like literal):
|
|
819
|
+
- Replace with env-var reference fields (`tokenEnv`, `passwordEnv`,
|
|
820
|
+
`privateKeyPathEnv`, ...).
|
|
821
|
+
|
|
822
|
+
### Manual vs automation routing (US-0086)
|
|
823
|
+
|
|
824
|
+
Manual and automation modes are intentionally separate:
|
|
825
|
+
|
|
826
|
+
- Manual mode (`AUTO_REMOTE_AUTOMATION_PROFILE=off`) keeps local-first behavior.
|
|
827
|
+
No automatic remote routing is allowed, and `TEST_COMMAND` is never silently
|
|
828
|
+
rerouted to remote targets.
|
|
829
|
+
- Automation mode (`AUTO_REMOTE_AUTOMATION_PROFILE=deterministic_v1`) may route
|
|
830
|
+
to Docker/SSH/local targets using deterministic precedence.
|
|
831
|
+
- Explicit NL intent literal is constrained to `start container <target_id>`.
|
|
832
|
+
Unknown or disabled targets fail closed.
|
|
833
|
+
|
|
834
|
+
Deterministic fail-closed reason codes:
|
|
835
|
+
|
|
836
|
+
- `REMOTE_AUTOMATION_MODE_OFF`
|
|
837
|
+
- `REMOTE_TARGET_UNKNOWN`
|
|
838
|
+
- `REMOTE_TARGET_DISABLED`
|
|
839
|
+
- `REMOTE_TARGET_UNROUTABLE`
|
|
840
|
+
|
|
841
|
+
Security continuity (`US-0085` / `DEC-0071`) remains mandatory in all modes:
|
|
842
|
+
|
|
843
|
+
- Never read `.env` from agent automation.
|
|
844
|
+
- Never print secret values in command output, logs, handoffs, or state.
|
|
845
|
+
- Names-only evidence format is required (`secret_surface=names_only`).
|
|
846
|
+
|
|
847
|
+
### Remote-routing evidence tuple (execute/qa/release)
|
|
848
|
+
|
|
849
|
+
When automation routing is used, include this tuple in handoffs/state artifacts:
|
|
850
|
+
|
|
851
|
+
- `target_id`
|
|
852
|
+
- `environment_label`
|
|
853
|
+
- `automation_profile`
|
|
854
|
+
- `routing_source` (`explicit_intent|heuristic_fallback|local_default`)
|
|
855
|
+
- `secret_surface=names_only`
|
|
856
|
+
|
|
857
|
+
If routing is not used (mode off/local default), still record:
|
|
858
|
+
|
|
859
|
+
- `target_id=local-default`
|
|
860
|
+
- `environment_label=local`
|
|
861
|
+
- `automation_profile=off`
|
|
862
|
+
- `routing_source=local_default`
|
|
863
|
+
- `secret_surface=names_only`
|
|
864
|
+
|
|
865
|
+
### Published npm `installer.sh` / POSIX dash (US-0084)
|
|
866
|
+
|
|
867
|
+
- **Symptom**: `set: Illegal option -` on an early line when running `its-magic` or
|
|
868
|
+
`sh installer.sh` on Debian/Ubuntu (**`/bin/sh`** → **dash**).
|
|
869
|
+
- **Common causes**: bash-only `set` options (`pipefail`, `-o errexit`, `-u` bundles)
|
|
870
|
+
on the **unconditional** startup path, or **CRLF** line endings in the file that
|
|
871
|
+
ships from npm.
|
|
872
|
+
- **`sh` vs `bash`**: the Unix CLI path uses **`sh` + `installer.sh`** (**BUG-0004** /
|
|
873
|
+
**DEC-0068**). Do not assume bash for the first lines of **`installer.sh`**.
|
|
874
|
+
- **Remediation**:
|
|
875
|
+
- Upgrade to an **its-magic** build that includes **US-0084** (LF + POSIX guards).
|
|
876
|
+
- Normalize to **LF** only (e.g. `dos2unix installer.sh`, or fix checkout —
|
|
877
|
+
root **`.gitattributes`** uses `*.sh text eol=lf`).
|
|
878
|
+
- Reinstall from npm after verifying maintainer gates:
|
|
879
|
+
`python scripts/guard_installer_publish.py` (also **`npm run guard:installer`**
|
|
880
|
+
/ **`prepublishOnly`**).
|
|
881
|
+
- **Normative**: **`docs/engineering/architecture.md`** **`# US-0084`**.
|
|
882
|
+
|
|
883
|
+
### Automated checks (US-0084)
|
|
884
|
+
|
|
885
|
+
- `python tests/installer_shell_bug0004_test.py` — CR/LF rejection, forbidden
|
|
886
|
+
`set` tokens, optional **`dash -n`** when **`dash`** is on **`PATH`**.
|
|
887
|
+
- `python scripts/guard_installer_publish.py` — same checks for publish/CI
|
|
888
|
+
(**`prepublishOnly`**).
|
|
889
|
+
- `python scripts/remote_config_summary.py` — with **`REMOTE_EXECUTION=1`**,
|
|
890
|
+
read-only summary of **`REMOTE_CONFIG`** (default **`.cursor/remote.json`**);
|
|
891
|
+
stdout is **names-only** (no secret values). **`DEC-0070`**: when
|
|
892
|
+
**`REMOTE_EXECUTION=0`**, the helper exits **0** and skips validation
|
|
893
|
+
(stderr skip reason).
|
|
894
|
+
|
|
895
|
+
### Optional deterministic CI routing recipe (US-0086)
|
|
896
|
+
|
|
897
|
+
Use this only when CI needs explicit remote-target hints; keep it opt-in.
|
|
898
|
+
|
|
899
|
+
1. Define explicit path filters:
|
|
900
|
+
- container surfaces: `Dockerfile*`, `docker-compose*.yml`, container scripts
|
|
901
|
+
- ssh/runtime infra surfaces: deployment ssh scripts, host runtime scripts
|
|
902
|
+
2. Route using explicit matrix labels (`local`, `docker`, `ssh`) with no
|
|
903
|
+
implicit fallback logic outside documented defaults.
|
|
904
|
+
3. Keep manual mode unchanged: if `AUTO_REMOTE_AUTOMATION_PROFILE=off`, run
|
|
905
|
+
local path and do not apply remote routing.
|
|
906
|
+
4. Emit names-only evidence (`target_id`, `environment_label`,
|
|
907
|
+
`automation_profile`, `routing_source`, `secret_surface=names_only`) into
|
|
908
|
+
CI logs/artifacts.
|
|
909
|
+
|
|
910
|
+
## Runtime QA autopilot contract (US-0065 / DEC-0047)
|
|
911
|
+
|
|
912
|
+
Generated-project validation requires runtime proof, not static checks alone.
|
|
913
|
+
|
|
914
|
+
Mandatory runtime stage order:
|
|
915
|
+
|
|
916
|
+
`startup -> readiness/connectivity -> log scan -> bounded retry -> verdict`
|
|
917
|
+
|
|
918
|
+
Deterministic runtime failure reason codes:
|
|
919
|
+
|
|
920
|
+
- `RUNTIME_STARTUP_FAILED`
|
|
921
|
+
- `RUNTIME_ENDPOINT_UNREACHABLE`
|
|
922
|
+
- `RUNTIME_LOG_CRITICAL_DETECTED`
|
|
923
|
+
- `RUNTIME_RETRY_BUDGET_EXHAUSTED`
|
|
924
|
+
- `RUNTIME_STACK_PROFILE_UNRESOLVED`
|
|
925
|
+
|
|
926
|
+
Runtime evidence schema (record in QA findings):
|
|
927
|
+
|
|
928
|
+
- `runtime_startup_command`
|
|
929
|
+
- `runtime_stack_profile` (`node|python|go|java|dotnet`)
|
|
930
|
+
- `runtime_mode` (`local|remote`)
|
|
931
|
+
- `runtime_health_target`
|
|
932
|
+
- `runtime_health_result`
|
|
933
|
+
- `runtime_log_summary` (severity counts and key error signals)
|
|
934
|
+
- `runtime_retry_count`
|
|
935
|
+
- `runtime_retry_ledger` (`attempt`, `delay_ms`, `outcome`)
|
|
936
|
+
- `runtime_final_verdict`
|
|
937
|
+
- `runtime_reason_code`
|
|
938
|
+
- `runtime_evidence_refs`
|
|
939
|
+
|
|
940
|
+
Bounded retry policy:
|
|
941
|
+
|
|
942
|
+
- retry only transient startup/connectivity failures
|
|
943
|
+
- enforce configured max-attempt cap (`attempt <= max`)
|
|
944
|
+
- fail fast on non-transient critical runtime log signals
|
|
945
|
+
|
|
946
|
+
Stack/profile resolution:
|
|
947
|
+
|
|
948
|
+
- Minimum supported runtime profiles: Node, Python, Go, Java, .NET.
|
|
949
|
+
- Unknown or ambiguous profile must fail closed with
|
|
950
|
+
`RUNTIME_STACK_PROFILE_UNRESOLVED`.
|
|
951
|
+
|
|
952
|
+
Webapp verification path (when applicable):
|
|
953
|
+
|
|
954
|
+
- include browser-surface load validation
|
|
955
|
+
- capture console error summary and failed network request summary
|
|
956
|
+
- add these signals to `runtime_log_summary` and evidence refs
|
|
957
|
+
|
|
958
|
+
Optional debug escalation (bounded):
|
|
959
|
+
|
|
960
|
+
- use for reproducible runtime failures only
|
|
961
|
+
- keep instrumentation bounded and reversible
|
|
962
|
+
- record applied debug steps and explicit cleanup confirmation
|
|
963
|
+
|
|
964
|
+
## Generated test scaffolding + auto-run contract (US-0066 / DEC-0048)
|
|
965
|
+
|
|
966
|
+
Generated app projects require deterministic baseline test scaffolding and
|
|
967
|
+
automatic QA test execution evidence.
|
|
968
|
+
|
|
969
|
+
Detection/profile contract:
|
|
970
|
+
|
|
971
|
+
- Resolve one deterministic stack profile from:
|
|
972
|
+
`node|python|go|java|dotnet` (minimum supported).
|
|
973
|
+
- If profile cannot be resolved, fail closed with
|
|
974
|
+
`TEST_SCAFFOLD_STACK_UNRESOLVED`.
|
|
975
|
+
- If detected stack is outside supported baseline set, fail closed with
|
|
976
|
+
`TEST_SCAFFOLD_UNSUPPORTED_STACK`.
|
|
977
|
+
|
|
978
|
+
Generation contract (`/execute`):
|
|
979
|
+
|
|
980
|
+
- Generate only missing baseline assets for:
|
|
981
|
+
- unit tests
|
|
982
|
+
- integration tests
|
|
983
|
+
- acceptance tests
|
|
984
|
+
- Use stable scaffold paths so reruns are idempotent (no duplicate file churn).
|
|
985
|
+
- Record generated paths and actions in execution evidence.
|
|
986
|
+
- If generation fails, fail closed with `TEST_SCAFFOLD_GENERATION_FAILED`.
|
|
987
|
+
|
|
988
|
+
Runbook command wiring:
|
|
989
|
+
|
|
990
|
+
- `TEST_COMMAND` baseline is stack-aware and deterministic.
|
|
991
|
+
- Non-destructive precedence is mandatory:
|
|
992
|
+
- preserve user-authored non-empty `TEST_COMMAND`,
|
|
993
|
+
- write baseline command only when `TEST_COMMAND` is missing/unset.
|
|
994
|
+
|
|
995
|
+
QA auto-run evidence contract (`/qa`):
|
|
996
|
+
|
|
997
|
+
- Execute generated baseline tests automatically.
|
|
998
|
+
- Record evidence fields:
|
|
999
|
+
- `generated_test_stack_profile`
|
|
1000
|
+
- `generated_test_command`
|
|
1001
|
+
- `generated_test_result`
|
|
1002
|
+
- `generated_test_output_ref`
|
|
1003
|
+
- `generated_test_paths_ref`
|
|
1004
|
+
- `generated_test_reason_code`
|
|
1005
|
+
|
|
1006
|
+
Runtime boundary with US-0065:
|
|
1007
|
+
|
|
1008
|
+
- Generated static test PASS is required but never sufficient for QA PASS.
|
|
1009
|
+
- Runtime-autopilot verdict remains mandatory; non-starting apps cannot PASS QA.
|
|
1010
|
+
|
|
1011
|
+
## Auto continuation resume contract
|
|
1012
|
+
|
|
1013
|
+
`/auto` continuation uses deterministic phase resolution (DEC-0017):
|
|
1014
|
+
|
|
1015
|
+
1. explicit `/auto start-from=<phase>`
|
|
1016
|
+
2. `handoffs/resume_brief.md`
|
|
1017
|
+
3. conservative `docs/engineering/state.md` fallback
|
|
1018
|
+
4. fail-fast
|
|
1019
|
+
|
|
1020
|
+
Canonical `start-from` phase IDs:
|
|
1021
|
+
`intake`, `discovery`, `research`, `architecture`, `sprint-plan`,
|
|
1022
|
+
`plan-verify`, `execute`, `qa`, `verify-work`, `release`, `refresh-context`.
|
|
1023
|
+
|
|
1024
|
+
Conflict and stale-source policy:
|
|
1025
|
+
- Explicit valid override wins.
|
|
1026
|
+
- If no override and `resume_brief` conflicts with `state`, fail fast.
|
|
1027
|
+
- If `resume_brief` exists but is stale/unparseable, fail fast.
|
|
1028
|
+
- Use state fallback only when `resume_brief` is absent.
|
|
1029
|
+
|
|
1030
|
+
Fail-fast error format:
|
|
1031
|
+
- `[AUTO_RESUME_ERROR] <code>: <summary>. Source=<source>. Fix: <action>.`
|
|
1032
|
+
|
|
1033
|
+
Required error codes:
|
|
1034
|
+
- `INVALID_START_FROM`
|
|
1035
|
+
- `RESUME_BRIEF_MISSING`
|
|
1036
|
+
- `RESUME_BRIEF_STALE`
|
|
1037
|
+
- `RESUME_BRIEF_UNPARSEABLE`
|
|
1038
|
+
- `RESUME_STATE_CONFLICT`
|
|
1039
|
+
- `STATE_PHASE_AMBIGUOUS`
|
|
1040
|
+
- `STATE_PHASE_UNRECOVERABLE`
|
|
1041
|
+
|
|
1042
|
+
Breadcrumbs required for inspectability:
|
|
1043
|
+
- `resolution_source`, `resolved_start_phase`, `stop_reason`, `stop_phase`,
|
|
1044
|
+
`timestamp`.
|
|
1045
|
+
- Record in `docs/engineering/state.md`; update `handoffs/resume_brief.md` when
|
|
1046
|
+
auto stops before completion.
|
|
1047
|
+
|
|
1048
|
+
Stop-condition preservation:
|
|
1049
|
+
- continuation does not bypass decision gates, missing-input blockers,
|
|
1050
|
+
pause requests, or loop max cycle limits.
|
|
1051
|
+
|
|
1052
|
+
## Per-phase subagent isolation evidence (US-0048 / DEC-0029)
|
|
1053
|
+
|
|
1054
|
+
Per-phase fresh-context isolation is enforced with auditable, fail-closed
|
|
1055
|
+
evidence.
|
|
1056
|
+
|
|
1057
|
+
### Canonical evidence store and locations
|
|
1058
|
+
|
|
1059
|
+
- Canonical evidence store: `docs/engineering/state.md` (append-only checkpoints).
|
|
1060
|
+
- Cross-references are allowed in phase artifacts and handoffs:
|
|
1061
|
+
- `handoffs/dev_to_qa.md`, `handoffs/qa_to_dev.md`
|
|
1062
|
+
- `handoffs/resume_brief.md` (pause/resume provenance)
|
|
1063
|
+
- `sprints/Sxxxx/summary.md`, `sprints/Sxxxx/qa-findings.md`, `sprints/Sxxxx/uat.*`,
|
|
1064
|
+
`sprints/Sxxxx/release-findings.md`
|
|
1065
|
+
|
|
1066
|
+
### Required schema (one entry per phase run)
|
|
1067
|
+
|
|
1068
|
+
Each phase run must append an isolation evidence entry containing:
|
|
1069
|
+
|
|
1070
|
+
- `phase_id`: canonical phase id (`intake|discovery|research|architecture|sprint-plan|plan-verify|execute|qa|verify-work|release|refresh-context|pause|resume`)
|
|
1071
|
+
- `role`: subagent role executing the phase (`po|curator|tech-lead|dev|qa|release|security`)
|
|
1072
|
+
- `fresh_context_marker`: a marker unique to the fresh subagent context for this phase run
|
|
1073
|
+
- `timestamp`: ISO UTC timestamp
|
|
1074
|
+
- `evidence_ref`: canonical path to the primary artifact written/validated for the phase run
|
|
1075
|
+
|
|
1076
|
+
### Gate behavior (fail closed)
|
|
1077
|
+
|
|
1078
|
+
- Missing evidence blocks progression with `PHASE_CONTEXT_ISOLATION_MISSING`.
|
|
1079
|
+
- Invalid schema/fields blocks progression with `ISOLATION_EVIDENCE_INVALID`.
|
|
1080
|
+
- Stale evidence (reused marker across runs or older than the resumed boundary)
|
|
1081
|
+
blocks progression with `ISOLATION_EVIDENCE_STALE`.
|
|
1082
|
+
- Orchestrator executing phase work without spawning a fresh subagent context is
|
|
1083
|
+
a hard violation: `PHASE_CONTEXT_ISOLATION_VIOLATION`.
|
|
1084
|
+
|
|
1085
|
+
Remediation (all cases): re-run the affected phase in a fresh subagent context
|
|
1086
|
+
and write new isolation evidence before proceeding.
|
|
1087
|
+
|
|
1088
|
+
### Reason codes and remediation (US-0048)
|
|
1089
|
+
|
|
1090
|
+
- `PHASE_CONTEXT_ISOLATION_MISSING`: no isolation evidence entry found for a
|
|
1091
|
+
required phase run. Fix: rerun the phase in a fresh subagent and append the
|
|
1092
|
+
required evidence fields.
|
|
1093
|
+
- `ISOLATION_EVIDENCE_INVALID`: evidence entry present but missing required
|
|
1094
|
+
fields or contains invalid `phase_id`/`role`. Fix: rerun the phase and write a
|
|
1095
|
+
corrected entry.
|
|
1096
|
+
- `ISOLATION_EVIDENCE_STALE`: evidence is reused across runs/cycles or predates
|
|
1097
|
+
the latest resume boundary. Fix: rerun the phase and write a new
|
|
1098
|
+
`fresh_context_marker`.
|
|
1099
|
+
- `PHASE_CONTEXT_ISOLATION_VIOLATION`: phase work was performed without a fresh
|
|
1100
|
+
subagent context (for example orchestrator performed phase writes). Fix: stop,
|
|
1101
|
+
revert unsafe artifacts if needed, rerun the phase correctly, and ensure
|
|
1102
|
+
orchestration-only behavior.
|
|
1103
|
+
|
|
1104
|
+
## Strict runtime proof contract (US-0056 / DEC-0038)
|
|
1105
|
+
|
|
1106
|
+
Strict runtime proof augments artifact-level isolation evidence. `/auto`,
|
|
1107
|
+
`/verify-work`, and `/release` must validate runtime attestation tuples at phase
|
|
1108
|
+
boundaries before continuation/finalization.
|
|
1109
|
+
|
|
1110
|
+
Required runtime attestation tuple fields:
|
|
1111
|
+
|
|
1112
|
+
- `orchestrator_run_id`
|
|
1113
|
+
- `runtime_proof_id` (unique per phase run)
|
|
1114
|
+
- `phase_id`
|
|
1115
|
+
- `role`
|
|
1116
|
+
- `proof_issued_at` (ISO UTC / RFC3339)
|
|
1117
|
+
- `proof_ttl_seconds`
|
|
1118
|
+
- `proof_hash`
|
|
1119
|
+
|
|
1120
|
+
Deterministic fail-closed reason codes:
|
|
1121
|
+
|
|
1122
|
+
- `RUNTIME_PROOF_MISSING`
|
|
1123
|
+
- `RUNTIME_PROOF_INVALID`
|
|
1124
|
+
- `RUNTIME_PROOF_REUSED`
|
|
1125
|
+
- `RUNTIME_PROOF_STALE`
|
|
1126
|
+
- `RUNTIME_PROOF_AMBIGUOUS_LINK`
|
|
1127
|
+
|
|
1128
|
+
Boundary behavior:
|
|
1129
|
+
|
|
1130
|
+
- Missing/invalid/reused/stale/ambiguous runtime proof blocks progression.
|
|
1131
|
+
- Release finalization must consume strict runtime proof in addition to existing
|
|
1132
|
+
isolation evidence checks.
|
|
1133
|
+
- Pause/resume provenance must reference latest valid strict-proof boundary.
|
|
1134
|
+
|
|
1135
|
+
## Strict `/auto` phase→role enforcement (US-0069 / DEC-0051)
|
|
1136
|
+
|
|
1137
|
+
`/auto` must treat phase roles as a **fail-closed admission and checkpoint
|
|
1138
|
+
contract** (see `decisions/DEC-0051.md` and `/auto` command text).
|
|
1139
|
+
|
|
1140
|
+
### Canonical matrix and scratchpad alternates
|
|
1141
|
+
|
|
1142
|
+
- Fixed phase→role defaults are documented in `/auto` (for example `execute` →
|
|
1143
|
+
`dev`, `release` → `release`).
|
|
1144
|
+
- Alternate phases resolve **one** expected role via scratchpad:
|
|
1145
|
+
- `AUTO_ROLE_RESEARCH`: `po` \| `tech-lead` (empty → default `tech-lead`)
|
|
1146
|
+
- `AUTO_ROLE_PLAN_VERIFY`: `qa` \| `tech-lead` (empty → default `qa`)
|
|
1147
|
+
- `AUTO_ROLE_REFRESH_CONTEXT`: `curator` \| `po` (empty → default `curator`)
|
|
1148
|
+
- Non-empty values outside the allowed set fail closed (no unrelated-role
|
|
1149
|
+
substitution).
|
|
1150
|
+
|
|
1151
|
+
### Preflight and checkpoints
|
|
1152
|
+
|
|
1153
|
+
- **Preflight (before spawn)**: resolve expected role; verify the required
|
|
1154
|
+
subagent capability exists. Missing capability → `PHASE_ROLE_CAPABILITY_MISSING`
|
|
1155
|
+
with `phase_id`, expected role, observed result, remediation. Do not spawn a
|
|
1156
|
+
substitute role.
|
|
1157
|
+
- **Post-completion**: isolation evidence `role` and strict-proof `role` must
|
|
1158
|
+
both match the same preflight-resolved role; else `PHASE_ROLE_MISMATCH`.
|
|
1159
|
+
- **`proof_hash`**: SHA-256 over sorted-key JSON of the strict-proof tuple fields
|
|
1160
|
+
(`orchestrator_run_id`, `runtime_proof_id`, `phase_id`, `role`,
|
|
1161
|
+
`proof_issued_at`, `proof_ttl_seconds`).
|
|
1162
|
+
|
|
1163
|
+
### Execute default deny and rare override
|
|
1164
|
+
|
|
1165
|
+
- Default: `execute` requires `dev`.
|
|
1166
|
+
- Override allowed only when **both** hold:
|
|
1167
|
+
`AUTO_EXECUTE_ROLE_OVERRIDE=allowed_non_dev_execute` and
|
|
1168
|
+
`EXECUTE_OVERRIDE_GOVERNANCE_REF` references a parseable approved exception (for
|
|
1169
|
+
example `DEC-xxxx` or a documented state anchor).
|
|
1170
|
+
|
|
1171
|
+
### Continuation parity
|
|
1172
|
+
|
|
1173
|
+
- Every `/auto` run recomputes role policy and preflight; `start-from`, fresh
|
|
1174
|
+
`resume_brief`, and `state.md` fallback cannot bypass the gate with stale role
|
|
1175
|
+
intent alone.
|
|
1176
|
+
|
|
1177
|
+
## Configurable `/auto` phase plan (US-0070 / DEC-0052)
|
|
1178
|
+
|
|
1179
|
+
`/auto` schedules a **resolved ordered phase plan** from merged scratchpad
|
|
1180
|
+
before any spawn. See `decisions/DEC-0052.md` and `/auto` command text.
|
|
1181
|
+
|
|
1182
|
+
### Selectors (exactly one active mode)
|
|
1183
|
+
|
|
1184
|
+
- `AUTO_PHASE_PLAN=full` (default when unset and no other selector is set)
|
|
1185
|
+
- `AUTO_PHASE_EXCLUDE=<csv>` — remove listed canonical phase ids from `full`
|
|
1186
|
+
- `AUTO_PHASE_INCLUDE=<csv>` — only listed ids, re-sorted into canonical lifecycle order
|
|
1187
|
+
- `AUTO_PHASE_PROFILE=<name>` — expand a named profile (unknown → fail closed)
|
|
1188
|
+
- `AUTO_PHASE_HIGH_RISK_ACK=<token>` — required when a documented high-risk profile demands acknowledgment
|
|
1189
|
+
|
|
1190
|
+
Conflicting selectors → `PHASE_POLICY_CONFLICT` (no plan materialization).
|
|
1191
|
+
|
|
1192
|
+
### Materialization and gates
|
|
1193
|
+
|
|
1194
|
+
- Expand → apply **non-skippable reinstatement** (`qa`, `verify-work`, `release`,
|
|
1195
|
+
plus evidence-chain closure per `/auto`) → intersect **`start-from` / resume
|
|
1196
|
+
anchor** with the plan → **empty intersection** →
|
|
1197
|
+
`START_FROM_PHASE_PLAN_EMPTY_INTERSECTION`.
|
|
1198
|
+
- Record `resolved_phase_plan`, `skipped_phases` (+ reasons such as
|
|
1199
|
+
`policy_exclude`, `non_skippable_gate`), and **phase boundary status** entries
|
|
1200
|
+
in continuation breadcrumbs (`docs/engineering/state.md`).
|
|
1201
|
+
- **Backlog-drain**, **bulk execute**, and **team scope** paths must **reload**
|
|
1202
|
+
scratchpad phase-selection inputs and **recompute** the plan at each bounded
|
|
1203
|
+
boundary (no silent revival of omitted phases).
|
|
1204
|
+
|
|
1205
|
+
### Failure codes (deterministic)
|
|
1206
|
+
|
|
1207
|
+
- `PHASE_POLICY_CONFLICT`
|
|
1208
|
+
- `PHASE_PLAN_UNKNOWN_PHASE`
|
|
1209
|
+
- `PHASE_PLAN_EMPTY_INCLUDE`
|
|
1210
|
+
- `PHASE_PLAN_UNKNOWN_PROFILE`
|
|
1211
|
+
- `PHASE_PLAN_INVALID_AUTO_PHASE_PLAN`
|
|
1212
|
+
- `PHASE_PLAN_HIGH_RISK_ACK_REQUIRED`
|
|
1213
|
+
- `START_FROM_PHASE_PLAN_EMPTY_INTERSECTION`
|
|
1214
|
+
|
|
1215
|
+
## Optional backlog-drain auto mode (US-0044)
|
|
1216
|
+
|
|
1217
|
+
`/auto` can optionally continue across multiple planned stories when explicitly
|
|
1218
|
+
enabled in scratchpad.
|
|
1219
|
+
|
|
1220
|
+
Controls:
|
|
1221
|
+
- `AUTO_BACKLOG_DRAIN=0|1` (default `0`)
|
|
1222
|
+
- `AUTO_BACKLOG_MAX_STORIES=<n>` (default `1`)
|
|
1223
|
+
- `AUTO_BACKLOG_ON_BLOCK=stop|skip` (default `stop`)
|
|
1224
|
+
- `AUTO_STORY_SELECTION=priority_then_backlog_order` (default)
|
|
1225
|
+
|
|
1226
|
+
Semantics:
|
|
1227
|
+
- With `AUTO_BACKLOG_DRAIN=0`, keep current single-segment continuation behavior.
|
|
1228
|
+
- With `AUTO_BACKLOG_DRAIN=1`, select next eligible OPEN story
|
|
1229
|
+
deterministically and run full lifecycle story-by-story until bounded limit,
|
|
1230
|
+
no eligible stories, or a mandatory stop condition.
|
|
1231
|
+
- Decision gates remain mandatory and pause progression until user decision.
|
|
1232
|
+
|
|
1233
|
+
## Targeted bug auto drain (US-0087)
|
|
1234
|
+
|
|
1235
|
+
Use **`/auto`** with an explicit **OPEN** bug binding when you want defect-scoped
|
|
1236
|
+
continuation instead of story **`AUTO_BACKLOG_DRAIN`**.
|
|
1237
|
+
|
|
1238
|
+
**Canonical argv** (exact literals; no aliases in v1):
|
|
1239
|
+
|
|
1240
|
+
- **`bug-target=BUG-####`** — single **OPEN** bug from **`docs/product/backlog.md`**
|
|
1241
|
+
**`## Bug issues (canonical)`** (example: **`bug-target=BUG-0007`**).
|
|
1242
|
+
- **`bug-target=all-open`** — walk all **OPEN** bugs in ascending **numeric**
|
|
1243
|
+
**`BUG-####`** order (optional per-run cap: **`AUTO_BUG_MAX_ITEMS`**).
|
|
1244
|
+
|
|
1245
|
+
**Scratchpad** (merged; default-off — see **`.cursor/scratchpad.md`** and
|
|
1246
|
+
**`template/.cursor/scratchpad.local.example.md`**):
|
|
1247
|
+
|
|
1248
|
+
- **`AUTO_BUG_QUEUE`**, **`AUTO_BUG_TARGET`**, **`AUTO_BUG_MAX_ITEMS`**, **`AUTO_BUG_ON_BLOCK`**
|
|
1249
|
+
|
|
1250
|
+
**Mutex**: do **not** enable **`AUTO_BACKLOG_DRAIN=1`** and **`AUTO_BUG_QUEUE=1`**
|
|
1251
|
+
together **without** an explicit **`bug-target=`** argv on that invocation — fail
|
|
1252
|
+
closed **`AUTO_SCHEDULER_CONFLICT`**. Supply **`bug-target=`** to select the bug
|
|
1253
|
+
scheduler for that run (normative detail: **`docs/engineering/auto-orchestration-reference.md`**
|
|
1254
|
+
**Optional bug-queue mode (US-0087)** and **`docs/engineering/architecture.md`**
|
|
1255
|
+
**`# US-0087`**).
|
|
1256
|
+
|
|
1257
|
+
**Fail-closed codes**: **`AUTO_BUG_QUEUE_EMPTY`**, **`AUTO_BUG_TARGET_UNKNOWN`**,
|
|
1258
|
+
**`AUTO_BUG_TARGET_NOT_OPEN`**, **`AUTO_SCHEDULER_CONFLICT`** — plus spawn-only
|
|
1259
|
+
orchestrator rules (**`BUG-0006`**, **`US-0069`**, **`AUTO_ORCHESTRATOR_PHASE_EXECUTION`**;
|
|
1260
|
+
see **`.cursor/commands/auto.md`**).
|
|
1261
|
+
|
|
1262
|
+
## Continuous `/auto` + backlog drain (US-0088)
|
|
1263
|
+
|
|
1264
|
+
**Goal:** a single `/auto` run (or documented equivalent outer driver) advances
|
|
1265
|
+
through all intersected lifecycle phases until a deterministic stop, and
|
|
1266
|
+
`AUTO_BACKLOG_DRAIN=1` can continue across multiple OPEN stories without routine
|
|
1267
|
+
operator chatter.
|
|
1268
|
+
|
|
1269
|
+
### Quick start
|
|
1270
|
+
|
|
1271
|
+
```
|
|
1272
|
+
/auto # full lifecycle, single story
|
|
1273
|
+
/auto start-from=execute # resume from execute phase
|
|
1274
|
+
```
|
|
1275
|
+
|
|
1276
|
+
With backlog drain enabled (`.cursor/scratchpad.md`):
|
|
1277
|
+
|
|
1278
|
+
```
|
|
1279
|
+
AUTO_BACKLOG_DRAIN=1
|
|
1280
|
+
AUTO_BACKLOG_MAX_STORIES=5
|
|
1281
|
+
AUTO_BACKLOG_ON_BLOCK=stop
|
|
1282
|
+
```
|
|
1283
|
+
|
|
1284
|
+
### Normative reference
|
|
1285
|
+
|
|
1286
|
+
Multi-phase iteration lives in
|
|
1287
|
+
**`docs/engineering/auto-orchestration-reference.md`** **`## Steps`** item 5
|
|
1288
|
+
(cross-anchor: **"reference Step 5"**). The compact steps in
|
|
1289
|
+
**`.cursor/commands/auto.md`** point to that block unambiguously.
|
|
1290
|
+
|
|
1291
|
+
### Caps and safety guards
|
|
1292
|
+
|
|
1293
|
+
| Control | Default | Purpose |
|
|
1294
|
+
|---------|---------|---------|
|
|
1295
|
+
| `AUTO_BACKLOG_MAX_STORIES` | `1` | Max stories per drain run |
|
|
1296
|
+
| `AUTO_LOOP_MAX_CYCLES` | `5` | Max execute-QA cycles per story |
|
|
1297
|
+
| `AUTO_PAUSE_REQUEST` | `0` | Set to `1` to request graceful stop at next safe boundary |
|
|
1298
|
+
| `AUTO_PAUSE_POLICY` | `after_phase` | Stop boundary granularity |
|
|
1299
|
+
|
|
1300
|
+
### Decision gates
|
|
1301
|
+
|
|
1302
|
+
Decision gates are **never** suppressed — even when `AUTO_QUIET=1`. When a gate
|
|
1303
|
+
fires, the run stops and waits for operator resolution before continuing.
|
|
1304
|
+
|
|
1305
|
+
### `AUTO_QUIET` (default off)
|
|
1306
|
+
|
|
1307
|
+
Set `AUTO_QUIET=1` in `.cursor/scratchpad.md` to suppress **routine** per-phase
|
|
1308
|
+
success chatter. Non-suppressible notifications:
|
|
1309
|
+
|
|
1310
|
+
- `decision_gate`
|
|
1311
|
+
- Errors / `missing_input`
|
|
1312
|
+
- `pause_request`
|
|
1313
|
+
- `loop_max`
|
|
1314
|
+
- `blocked`
|
|
1315
|
+
- Segment handoff / drain advance
|
|
1316
|
+
|
|
1317
|
+
`AUTO_QUIET` is **orthogonal** to `TOKEN_PROFILE` (**DEC-0035** / **US-0080**):
|
|
1318
|
+
`TOKEN_PROFILE` controls context breadth and token cost, not notification policy.
|
|
1319
|
+
|
|
1320
|
+
### Outer-driver equivalence (AC-1, Option B)
|
|
1321
|
+
|
|
1322
|
+
When a single Cursor `/auto` invocation cannot schedule multiple subagent turns,
|
|
1323
|
+
operators may use an outer driver (script or manual re-invocation with
|
|
1324
|
+
`start-from` / refreshed `resume_brief`). This is deterministically equivalent
|
|
1325
|
+
when: same phase order, same isolation + strict-proof per phase, same stop
|
|
1326
|
+
reasons, same `resume_brief` + `state.md` refresh at every boundary.
|
|
1327
|
+
|
|
1328
|
+
### Drain advance behavior
|
|
1329
|
+
|
|
1330
|
+
When `AUTO_BACKLOG_DRAIN=1` and a story reaches its terminal boundary:
|
|
1331
|
+
|
|
1332
|
+
1. Orchestrator reloads merged scratchpad phase-selection inputs.
|
|
1333
|
+
2. Orchestrator recomputes the materialized phase plan for the next story.
|
|
1334
|
+
3. Selects the next eligible OPEN story per `AUTO_STORY_SELECTION`.
|
|
1335
|
+
4. Runs the full resolved lifecycle for that story until stop or cap.
|
|
1336
|
+
|
|
1337
|
+
Notify operator on segment handoff (non-routine, non-suppressible).
|
|
1338
|
+
|
|
1339
|
+
### Stop reasons
|
|
1340
|
+
|
|
1341
|
+
`completed`, `decision_gate`, `missing_input`, `pause_request`, `loop_max`,
|
|
1342
|
+
`error`, `blocked`. See the **Deterministic stop matrix** in
|
|
1343
|
+
**`docs/engineering/auto-orchestration-reference.md`** §
|
|
1344
|
+
**Continuous multi-phase execution (US-0088)**.
|
|
1345
|
+
|
|
1346
|
+
### Troubleshooting
|
|
1347
|
+
|
|
1348
|
+
| Symptom | Likely cause | Fix |
|
|
1349
|
+
|---------|-------------|-----|
|
|
1350
|
+
| Run stops after one phase | Older `/auto` text without continuous semantics | Update to latest; verify **reference Step 5** anchor exists |
|
|
1351
|
+
| `RESUME_BRIEF_STALE` mid-run | Brief not refreshed at phase boundary | Ensure paired `resume_brief` + `state.md` refresh per DEC-0069 |
|
|
1352
|
+
| `AUTO_SCHEDULER_CONFLICT` | Both `AUTO_BACKLOG_DRAIN=1` and `AUTO_BUG_QUEUE=1` without `bug-target=` argv | Supply explicit `bug-target=` or disable one scheduler |
|
|
1353
|
+
| `BACKLOG_MAX_STORIES_REACHED` | Drain cap hit | Increase `AUTO_BACKLOG_MAX_STORIES` or run another `/auto` |
|
|
1354
|
+
|
|
1355
|
+
## Explicit bulk sprint planning mode (US-0046)
|
|
1356
|
+
|
|
1357
|
+
`/sprint-plan` stays single-scope by default. Bulk planning is opt-in via
|
|
1358
|
+
explicit argument:
|
|
1359
|
+
|
|
1360
|
+
- `/sprint-plan --bulk`
|
|
1361
|
+
|
|
1362
|
+
Deterministic controls from `.cursor/scratchpad.md`:
|
|
1363
|
+
- `SPRINT_BULK_MAX_STORIES` (candidate OPEN stories per run)
|
|
1364
|
+
- `SPRINT_BULK_MAX_SPRINTS` (max generated sprints per run)
|
|
1365
|
+
- `SPRINT_BULK_SELECTION=priority_then_backlog_order`
|
|
1366
|
+
|
|
1367
|
+
Deterministic behavior:
|
|
1368
|
+
- Select eligible OPEN stories by configured selection order.
|
|
1369
|
+
- Generate one or more bounded sprint plans while preserving per-sprint sizing
|
|
1370
|
+
guardrails (`SPRINT_MAX_TASKS`, `SPRINT_AUTO_SPLIT`).
|
|
1371
|
+
- Stop with explicit reason codes when bounded or blocked:
|
|
1372
|
+
- `SPRINT_BULK_MAX_STORIES_REACHED`
|
|
1373
|
+
- `SPRINT_BULK_MAX_SPRINTS_REACHED`
|
|
1374
|
+
- `SPRINT_BULK_NO_ELIGIBLE_STORIES`
|
|
1375
|
+
- `SPRINT_BULK_MISSING_ACCEPTANCE`
|
|
1376
|
+
|
|
1377
|
+
## Explicit bulk execute mode (US-0047)
|
|
1378
|
+
|
|
1379
|
+
`/auto` remains non-bulk by default. Bulk execution is explicit and can be
|
|
1380
|
+
enabled per run (`/auto --execute-bulk`) or by scratchpad switch.
|
|
1381
|
+
|
|
1382
|
+
Deterministic controls:
|
|
1383
|
+
- `AUTO_EXECUTE_BULK=0|1` (default `0`)
|
|
1384
|
+
- `AUTO_EXECUTE_MAX_ITEMS=<n>` (default `1`)
|
|
1385
|
+
- `AUTO_EXECUTE_ON_BLOCK=stop|skip` (default `stop`)
|
|
1386
|
+
- `AUTO_EXECUTE_SELECTION=planned_then_priority` (default)
|
|
1387
|
+
- `AUTO_TEAM_SCOPE_ENFORCE=0|1` (default `1`)
|
|
1388
|
+
|
|
1389
|
+
Execution semantics:
|
|
1390
|
+
- Select eligible planned items deterministically.
|
|
1391
|
+
- Preserve strict isolation:
|
|
1392
|
+
- fresh subagent per phase
|
|
1393
|
+
- fresh subagent per execute<->QA loop cycle
|
|
1394
|
+
- Enforce bounded stop behavior:
|
|
1395
|
+
- `EXEC_BULK_MAX_ITEMS_REACHED`
|
|
1396
|
+
- `EXEC_BULK_NO_ELIGIBLE_ITEMS`
|
|
1397
|
+
- `EXEC_BULK_ITEM_BLOCKED_STOP`
|
|
1398
|
+
- `EXEC_BULK_ITEM_BLOCKED_SKIPPED`
|
|
1399
|
+
|
|
1400
|
+
Team mode guardrails (`TEAM_MODE=1`):
|
|
1401
|
+
- Capture team context snapshot in breadcrumbs:
|
|
1402
|
+
- `TEAM_MODE`, `TEAM_MEMBER`, `ACTIVE_TASK_IDS`
|
|
1403
|
+
- With enforcement enabled, out-of-scope tasks are never mutated and must emit:
|
|
1404
|
+
- `EXEC_TEAM_SCOPE_BLOCKED` (stop policy)
|
|
1405
|
+
- `EXEC_TEAM_SCOPE_SKIPPED` (skip policy)
|
|
1406
|
+
|
|
1407
|
+
## Sync policy and guarded auto-push contract (US-0038 / DEC-0018)
|
|
1408
|
+
|
|
1409
|
+
Sync policy controls (from `.cursor/scratchpad.md`):
|
|
1410
|
+
- `SYNC_POLICY_MODE`: `disabled|manual|by_phase|by_milestone|custom_phase_list`
|
|
1411
|
+
- `SYNC_CUSTOM_PHASES`: comma-separated canonical phase IDs for custom mode
|
|
1412
|
+
- `ALLOW_AUTO_PUSH`: `0|1`
|
|
1413
|
+
- `AUTO_PUSH_BRANCH_ALLOWLIST`: comma-separated branches/patterns
|
|
1414
|
+
|
|
1415
|
+
Default-safe behavior:
|
|
1416
|
+
- Default mode is `manual` (non-auto).
|
|
1417
|
+
- `disabled` and `manual` are near-zero-overhead modes (no auto-push attempts).
|
|
1418
|
+
- Unset/invalid mode fails closed to `manual`.
|
|
1419
|
+
|
|
1420
|
+
Phase-boundary-only evaluation:
|
|
1421
|
+
- Evaluate sync eligibility only at completed phase boundaries.
|
|
1422
|
+
- Never evaluate during partial or in-progress work units.
|
|
1423
|
+
|
|
1424
|
+
Guarded auto-push eligibility (all required):
|
|
1425
|
+
1. Boundary trigger is eligible for current mode.
|
|
1426
|
+
2. `ALLOW_AUTO_PUSH=1`.
|
|
1427
|
+
3. QA-first restriction passes (feature work cannot auto-push before QA pass).
|
|
1428
|
+
4. No unresolved blocking QA findings / unresolved critical issues.
|
|
1429
|
+
5. Branch safety passes:
|
|
1430
|
+
- protected/default branches denied by default,
|
|
1431
|
+
- allow only explicitly allowlisted branches.
|
|
1432
|
+
6. Mandatory check chain passes.
|
|
1433
|
+
|
|
1434
|
+
Mandatory pre-push check chain:
|
|
1435
|
+
1. `TEST_COMMAND` (mandatory baseline)
|
|
1436
|
+
2. `LINT_COMMAND` (only if configured)
|
|
1437
|
+
3. `TYPECHECK_COMMAND` (only if configured)
|
|
1438
|
+
|
|
1439
|
+
Rules:
|
|
1440
|
+
- Missing `TEST_COMMAND` blocks push (`TEST_COMMAND_MISSING`).
|
|
1441
|
+
- Failing `TEST_COMMAND` blocks push (`TEST_FAILED`).
|
|
1442
|
+
- Timed-out `TEST_COMMAND` blocks push (`TEST_TIMEOUT`).
|
|
1443
|
+
- Optional check failures block push when configured (`OPTIONAL_CHECK_FAILED`).
|
|
1444
|
+
- Optional checks that are not configured must be reported as `skipped`.
|
|
1445
|
+
|
|
1446
|
+
Deterministic reason-code baseline:
|
|
1447
|
+
- `SYNC_DISABLED`
|
|
1448
|
+
- `MANUAL_MODE_NO_AUTO`
|
|
1449
|
+
- `SYNC_TRIGGER_NOT_ELIGIBLE`
|
|
1450
|
+
- `AUTO_PUSH_NOT_ENABLED`
|
|
1451
|
+
- `PRE_QA_AUTOPUSH_FORBIDDEN`
|
|
1452
|
+
- `BLOCKING_QA_FINDINGS`
|
|
1453
|
+
- `BRANCH_NOT_ALLOWLISTED`
|
|
1454
|
+
- `TEST_COMMAND_MISSING`
|
|
1455
|
+
- `TEST_FAILED`
|
|
1456
|
+
- `TEST_TIMEOUT`
|
|
1457
|
+
- `OPTIONAL_CHECK_FAILED`
|
|
1458
|
+
- `SYNC_PUSHED`
|
|
1459
|
+
|
|
1460
|
+
## Executable validate-and-push wiring (DEC-0058)
|
|
1461
|
+
|
|
1462
|
+
Scratchpad **`SYNC_*` / `ALLOW_AUTO_PUSH` / `AUTO_PUSH_BRANCH_ALLOWLIST`** are read from the
|
|
1463
|
+
**merged** scratchpad only (installer merge: local → materialized baseline → example; same
|
|
1464
|
+
precedence as installer post-install validation). **`scripts/validate-and-push.ps1`** and
|
|
1465
|
+
**`scripts/validate-and-push.sh`** call **`python scripts/sync_push_gates.py`** for policy;
|
|
1466
|
+
**`docs/engineering/runbook.md`** remains the sole source for **`TEST_COMMAND`** and optional
|
|
1467
|
+
lint/typecheck commands.
|
|
1468
|
+
|
|
1469
|
+
**Operator rule:** changing scratchpad alone does **not** run **`git push`**. Run
|
|
1470
|
+
**`validate-and-push`** (or CI) after an eligible boundary. For **`by_phase`**, **`by_milestone`**,
|
|
1471
|
+
and **`custom_phase_list`**, scheduling is **operator or CI** responsibility.
|
|
1472
|
+
|
|
1473
|
+
**`SYNC_PHASE_BOUNDARY`:** optional environment variable (canonical phase id, case-insensitive).
|
|
1474
|
+
When **`SYNC_POLICY_MODE=custom_phase_list`**, the variable must be set and must appear in
|
|
1475
|
+
**`SYNC_CUSTOM_PHASES`** (comma-separated) or the script exits **`SYNC_TRIGGER_NOT_ELIGIBLE`**.
|
|
1476
|
+
|
|
1477
|
+
**Dry-run:** **`powershell .../validate-and-push.ps1 -DryRun`** or
|
|
1478
|
+
**`bash scripts/validate-and-push.sh --dry-run ...`** — runs merge/policy and the runbook check
|
|
1479
|
+
chain, then prints **`SYNC_PUSHED`** without **`git push`**.
|
|
1480
|
+
|
|
1481
|
+
**Branch allowlist matching (`AUTO_PUSH_BRANCH_ALLOWLIST`):** comma-separated entries; each entry
|
|
1482
|
+
is either an exact branch name or a **`fnmatch`** pattern (for example `release/*`). An empty
|
|
1483
|
+
allowlist denies every branch (**`BRANCH_NOT_ALLOWLISTED`**).
|
|
1484
|
+
|
|
1485
|
+
**QA scan (bounded):** files under **`sprints/S####/qa-findings.md`** (four digits). Blocking
|
|
1486
|
+
rules match **`DEC-0058`** §6. **`PRE_QA_AUTOPUSH_FORBIDDEN`** applies on branches other than
|
|
1487
|
+
**`main`** / **`master`** when **no** such **`qa-findings.md`** file exists yet (feature-line
|
|
1488
|
+
signal; see architecture **US-0076**).
|
|
1489
|
+
|
|
1490
|
+
**Python:** merged policy evaluation requires **Python 3** on **`PATH`** (**`PYTHON_NOT_ON_PATH`**
|
|
1491
|
+
if missing).
|
|
1492
|
+
|
|
1493
|
+
Required sync evidence fields:
|
|
1494
|
+
- `phase_boundary`
|
|
1495
|
+
- `policy_mode`
|
|
1496
|
+
- `trigger_source` (`manual|auto`)
|
|
1497
|
+
- `branch`
|
|
1498
|
+
- `checks` (`test|lint|typecheck`: `pass|fail|skipped`)
|
|
1499
|
+
- `qa_status_snapshot`
|
|
1500
|
+
- `push_decision` (`pushed|blocked|not_eligible`)
|
|
1501
|
+
- `reason_code`
|
|
1502
|
+
- `evidence_refs`
|
|
1503
|
+
|
|
1504
|
+
## Release gate chain (US-0039 / DEC-0019)
|
|
1505
|
+
|
|
1506
|
+
Deterministic mandatory gate order; no step may be skipped or reordered:
|
|
1507
|
+
|
|
1508
|
+
1. **Check-in test gate** — Latest `TEST_COMMAND` evidence must be present and passing.
|
|
1509
|
+
2. **QA completion gate** — No unresolved blocking findings in sprint QA context.
|
|
1510
|
+
3. **UAT completion gate** — UAT artifacts populated and verified; no placeholder or unresolved-fail state.
|
|
1511
|
+
4. **Isolation compliance gate** — Per-phase isolation evidence present and valid (US-0048 / DEC-0029).
|
|
1512
|
+
5. **Release finalization** — Notes, queue, backlog/runbook/state updates only after gates 1–4 pass.
|
|
1513
|
+
|
|
1514
|
+
Default: no bypass. Override only via explicit decision gate with rationale and evidence (DEC-0019).
|
|
1515
|
+
|
|
1516
|
+
**Optional-command compatibility (US-0039 / AC-10)**: Blank optional runbook keys (`LINT_COMMAND`, `TYPECHECK_COMMAND`) must not cause release to fail. Mandatory gates are check-in test + QA + UAT + isolation only; optional checks run only when configured and are reported as `skipped` when not configured. Release does not require lint/typecheck evidence when those keys are blank.
|
|
1517
|
+
|
|
1518
|
+
**Per-gate audit verdict schema (US-0039)** — For TL/QA auditability, record per gate:
|
|
1519
|
+
|
|
1520
|
+
- `gate` (check-in_test | qa | uat | isolation | finalization)
|
|
1521
|
+
- `verdict` (pass | fail | override)
|
|
1522
|
+
- `reason_code` (e.g. RELEASE_TEST_FAILED, RELEASE_QA_BLOCKERS_OPEN, RELEASE_UAT_INCOMPLETE, RELEASE_GATE_OVERRIDE_APPROVED)
|
|
1523
|
+
- `remediation` (short remediation steps when fail/override)
|
|
1524
|
+
- `evidence_refs` (paths to tests/report.md, qa-findings.md, uat.json, release-findings.md, DEC-xxxx as applicable)
|
|
1525
|
+
|
|
1526
|
+
Record in `sprints/Sxxxx/release-findings.md` and/or `handoffs/release_queue.md` `gate_snapshot`; state checkpoint in `docs/engineering/state.md` may reference the same.
|
|
1527
|
+
|
|
1528
|
+
## Release queue and sprint notes contract (US-0040 / DEC-0020)
|
|
1529
|
+
|
|
1530
|
+
Canonical release artifacts:
|
|
1531
|
+
- `handoffs/releases/Sxxxx-release-notes.md` (canonical per-sprint notes)
|
|
1532
|
+
- `handoffs/release_queue.md` (canonical queue tracker)
|
|
1533
|
+
- `handoffs/release_notes.md` (legacy-compatible latest pointer/summary)
|
|
1534
|
+
|
|
1535
|
+
Queue row required fields:
|
|
1536
|
+
- `sprint_id`
|
|
1537
|
+
- `story_refs`
|
|
1538
|
+
- `status` (`planned|ready|unreleased|released|blocked`)
|
|
1539
|
+
- `last_updated`
|
|
1540
|
+
- `release_notes_ref`
|
|
1541
|
+
- `gate_snapshot`
|
|
1542
|
+
- `release_version` (optional before finalization)
|
|
1543
|
+
|
|
1544
|
+
Deterministic transition semantics:
|
|
1545
|
+
- target sprint only may change during one `/release` run
|
|
1546
|
+
- entering release flow sets target row to `unreleased`
|
|
1547
|
+
- successful finalization transitions same row to `released`
|
|
1548
|
+
- no non-target sprint row mutation
|
|
1549
|
+
|
|
1550
|
+
Fail-safe reason codes:
|
|
1551
|
+
- `RELEASE_SPRINT_UNRESOLVED`
|
|
1552
|
+
- `LEGACY_NOTES_SPRINT_UNRESOLVED`
|
|
1553
|
+
- `QUEUE_ENTRY_MISSING`
|
|
1554
|
+
- `NOTES_REF_MISSING`
|
|
1555
|
+
- `STATUS_TRANSITION_INVALID`
|
|
1556
|
+
|
|
1557
|
+
Mismatch and unresolved-sprint policy:
|
|
1558
|
+
- fail closed for finalization when sprint identity or queue/notes metadata is
|
|
1559
|
+
inconsistent
|
|
1560
|
+
- preserve existing notes artifacts by default (non-destructive)
|
|
1561
|
+
- do not auto-reconcile by deleting/rebuilding unrelated sprint history
|
|
1562
|
+
- include remediation steps in queue/state and rerun `/release` after correction
|
|
1563
|
+
|
|
1564
|
+
## Post-QA release issue workflow (US-0042)
|
|
1565
|
+
|
|
1566
|
+
When `/release` finds a blocker after QA has passed, document it in a dedicated
|
|
1567
|
+
release findings artifact (separate from QA findings):
|
|
1568
|
+
|
|
1569
|
+
- Canonical artifact: `sprints/Sxxxx/release-findings.md`
|
|
1570
|
+
- Canonical handoff back to implementation: `handoffs/release_to_dev.md`
|
|
1571
|
+
|
|
1572
|
+
Required release-findings content:
|
|
1573
|
+
- gate status (`PASS|BLOCKED`)
|
|
1574
|
+
- blocking and non-blocking findings
|
|
1575
|
+
- deterministic reason code(s)
|
|
1576
|
+
- evidence refs
|
|
1577
|
+
- remediation steps and rerun criteria
|
|
1578
|
+
|
|
1579
|
+
Boundary rule:
|
|
1580
|
+
- QA-phase defects remain in `sprints/Sxxxx/qa-findings.md`.
|
|
1581
|
+
- Post-QA release-gate defects must be recorded in
|
|
1582
|
+
`sprints/Sxxxx/release-findings.md`.
|
|
1583
|
+
|
|
1584
|
+
## Backlog reconciliation invariant (US-0043)
|
|
1585
|
+
|
|
1586
|
+
At release finalization boundary, target sprint stories must be synchronized in
|
|
1587
|
+
`docs/product/backlog.md` using canonical release evidence precedence.
|
|
1588
|
+
|
|
1589
|
+
Contract:
|
|
1590
|
+
- Scope is target sprint stories only (no global backlog mutation).
|
|
1591
|
+
- If release evidence is PASS, set story status to `DONE` and reconcile
|
|
1592
|
+
acceptance checkboxes to checked state.
|
|
1593
|
+
- If sprint is `released` but backlog story state remains contradictory
|
|
1594
|
+
(`OPEN`/unchecked), fail safe with reason code `BACKLOG_STATUS_DRIFT`.
|
|
1595
|
+
- Record remediation guidance and evidence refs in release artifacts before rerun.
|
|
1596
|
+
|
|
1597
|
+
## Canonical status ownership and normalization guard (US-0045)
|
|
1598
|
+
|
|
1599
|
+
Canonical owner:
|
|
1600
|
+
- `docs/product/backlog.md` is the authority for story status (`OPEN|DONE`).
|
|
1601
|
+
- `docs/product/acceptance.md` and `docs/engineering/state.md` are derived views.
|
|
1602
|
+
|
|
1603
|
+
Deterministic reconciliation rules:
|
|
1604
|
+
1. Read canonical story status from backlog.
|
|
1605
|
+
2. Validate target sprint release evidence for status transitions.
|
|
1606
|
+
3. Reconcile derived acceptance/state views from canonical backlog status.
|
|
1607
|
+
4. Keep mutation scope target-scoped only; never broad-rewrite unrelated stories.
|
|
1608
|
+
|
|
1609
|
+
One-time normalization procedure:
|
|
1610
|
+
- Run an initial normalization pass for historically drifted stories.
|
|
1611
|
+
- Write all changed rows to `docs/engineering/status-normalization-report.md`
|
|
1612
|
+
including prior values, resolved values, evidence references, and timestamp.
|
|
1613
|
+
- On future runs, append only delta entries; do not rewrite historical report rows.
|
|
1614
|
+
|
|
1615
|
+
Fail-safe reason codes:
|
|
1616
|
+
- `BACKLOG_STATUS_DRIFT`: release evidence contradicts backlog/AC state.
|
|
1617
|
+
- `CANONICAL_STATUS_CONFLICT`: canonical backlog state conflicts with derived
|
|
1618
|
+
status resolution at reconciliation boundary.
|
|
1619
|
+
|
|
1620
|
+
## Lifecycle QA matrix (US-0041)
|
|
1621
|
+
|
|
1622
|
+
Use this matrix to validate end-to-end installer/CLI lifecycle behavior:
|
|
1623
|
+
|
|
1624
|
+
| Scenario | Primary command path | Coverage location | Required evidence |
|
|
1625
|
+
|---|---|---|---|
|
|
1626
|
+
| Fresh install (`missing`) | `its-magic --mode missing --create` and direct installer | `tests/run-tests.ps1`, `tests/run-tests.sh` | Required files exist + `its_magic/.its-magic-version` exists |
|
|
1627
|
+
| Overwrite + backup | `its-magic --mode overwrite --backup` and direct installer | `tests/run-tests.ps1`, `tests/run-tests.sh` | Backup snapshot contains overwritten framework file |
|
|
1628
|
+
| Upgrade lifecycle | `its-magic --mode upgrade` and direct installer | `tests/run-tests.ps1`, `tests/run-tests.sh`, npm local tests | Framework file restored, scratchpad example refreshed, user local scratchpad preserved |
|
|
1629
|
+
| Clean-repo safety | `its-magic --clean-repo --yes` and direct installer clean path | `tests/run-tests.ps1`, `tests/run-tests.sh`, CI lifecycle subset | Framework artifacts removed, non-framework marker preserved |
|
|
1630
|
+
| Negative path | invalid mode/args | `tests/run-tests.ps1`, `tests/run-tests.sh` | Deterministic non-zero fail-fast behavior |
|
|
1631
|
+
| Platform parity subset | npm/brew/choco CI jobs | `.github/workflows/ci.yml` | Lifecycle subset passes on all three runners |
|
|
1632
|
+
|
|
1633
|
+
## Scratchpad example upgrade contract (US-0057 / DEC-0039 / DEC-0057)
|
|
1634
|
+
|
|
1635
|
+
`its-magic --mode upgrade` treats `.cursor/scratchpad.local.example.md` as
|
|
1636
|
+
framework-owned and `.cursor/scratchpad.local.md` as user-owned.
|
|
1637
|
+
|
|
1638
|
+
Expected deterministic outcome:
|
|
1639
|
+
- Framework-owned example is refreshed to latest release contract **before** baseline
|
|
1640
|
+
materialization runs in `installer.py --scratchpad-postinstall` (**DEC-0057** ordering).
|
|
1641
|
+
- User local scratchpad remains preserved without overwrite.
|
|
1642
|
+
- Installer output reports manifest copy status for the example file where applicable
|
|
1643
|
+
(`added|updated|unchanged`) **and** `[SCRATCHPAD_LAYER]` diagnostics from post-install
|
|
1644
|
+
(`example_refresh`, `baseline_materialize` / `baseline_skip`, `user_local` preserved).
|
|
1645
|
+
- CI regression: `python scripts/check-scratchpad-pair-parity.py --repo <root>` exit `0`
|
|
1646
|
+
when active and `template/` baseline/example pairs share the same automation `KEY=`
|
|
1647
|
+
set and catalog `#` headers from `# Core behavior` (**US-0075** **AC-11**).
|
|
1648
|
+
|
|
1649
|
+
## Scratchpad delivery Model B (US-0073 / DEC-0055)
|
|
1650
|
+
|
|
1651
|
+
- Install manifest ships `.cursor/scratchpad.local.example.md` (framework catalog)
|
|
1652
|
+
but **does not** list `.cursor/scratchpad.md` as a copied file. The installer
|
|
1653
|
+
**materializes** `.cursor/scratchpad.md` from the packaged template when absent
|
|
1654
|
+
(`missing`, `interactive`, `upgrade`) or refreshes it on `overwrite`.
|
|
1655
|
+
- Merge precedence for automation readers: **local > materialized baseline > example**
|
|
1656
|
+
(same invariant as `DEC-0055`).
|
|
1657
|
+
- Post-install validation fails closed with `[SCRATCHPAD_MERGE_ERROR]` /
|
|
1658
|
+
`[SCRATCHPAD_MATERIALIZE_ERROR]` when layers are missing or required keys are
|
|
1659
|
+
empty after merge (`US-0073` `AC-4`).
|
|
1660
|
+
- `installer.ps1` / `installer.sh` delegate materialize+validate to
|
|
1661
|
+
`python installer.py --scratchpad-postinstall` (Python 3 required on PATH).
|
|
1662
|
+
- Recovery: `python installer.py --scratchpad-postinstall --target <repo> --mode missing`
|
|
1663
|
+
(or re-run a full install).
|
|
1664
|
+
|
|
1665
|
+
## Deterministic artifact ordering and write discipline (US-0058 / DEC-0040)
|
|
1666
|
+
|
|
1667
|
+
Canonical policy source:
|
|
1668
|
+
- `docs/engineering/artifact-ordering-policy.md`
|
|
1669
|
+
|
|
1670
|
+
Required write discipline:
|
|
1671
|
+
- `docs/engineering/state.md`: append-bottom checkpoint writes only.
|
|
1672
|
+
- `docs/product/backlog.md`: sorted-canonical story ordering by numeric `US-xxxx`.
|
|
1673
|
+
- `docs/product/acceptance.md`: sorted-canonical row ordering aligned to backlog.
|
|
1674
|
+
- Handoff surfaces use explicit policy (`prepend-top` or `append-bottom`) per
|
|
1675
|
+
matrix and command contract.
|
|
1676
|
+
|
|
1677
|
+
Fail-safe contract:
|
|
1678
|
+
- Missing/ambiguous placement anchors fail closed with
|
|
1679
|
+
`ARTIFACT_ORDERING_ANCHOR_AMBIGUOUS`.
|
|
1680
|
+
- Non-monotonic `state.md` checkpoint timestamps fail closed with
|
|
1681
|
+
`STATE_TIMESTAMP_NON_MONOTONIC`.
|
|
1682
|
+
- No partial mutation on fail-safe path.
|
|
1683
|
+
- Re-run without semantic changes must be ordering-idempotent.
|
|
1684
|
+
|
|
1685
|
+
## Cross-phase artifact ownership guard (US-0061 / DEC-0043)
|
|
1686
|
+
|
|
1687
|
+
Canonical policy source:
|
|
1688
|
+
- `docs/engineering/artifact-ownership-policy.md`
|
|
1689
|
+
|
|
1690
|
+
Required ownership discipline:
|
|
1691
|
+
- Each phase may mutate only its declared owned scopes for target context.
|
|
1692
|
+
- Cross-phase non-owned section rewrite/deletion is forbidden by default.
|
|
1693
|
+
- `docs/engineering/architecture.md` is history-preserving: append new story
|
|
1694
|
+
sections or mutate target section only; unrelated story-section deletion is
|
|
1695
|
+
prohibited.
|
|
1696
|
+
|
|
1697
|
+
Fail-safe contract:
|
|
1698
|
+
- Ownership violations fail closed with `PHASE_OWNERSHIP_VIOLATION`.
|
|
1699
|
+
- Missing evidence on override-authorized mutation path fails closed with
|
|
1700
|
+
`PHASE_OVERRIDE_EVIDENCE_MISSING`.
|
|
1701
|
+
- Architecture history deletion detection fails with
|
|
1702
|
+
`ARCH_HISTORY_DELETION_DETECTED`.
|
|
1703
|
+
- No partial mutation on fail-safe path.
|
|
1704
|
+
|
|
1705
|
+
Execution guidance:
|
|
1706
|
+
- Local baseline: run `sh tests/run-tests.sh` (or `powershell -ExecutionPolicy Bypass -File tests/run-tests.ps1`).
|
|
1707
|
+
- Packaging smoke: run npm local tests in `packaging/npm/`.
|
|
1708
|
+
- CI evidence: inspect `npm-test`, `brew-test`, and `choco-test` job logs.
|
|
1709
|
+
|
|
1710
|
+
## Intake runtime capability and single-writer safety (US-0059 / DEC-0041)
|
|
1711
|
+
|
|
1712
|
+
`/intake` enforces deterministic runtime preflight and drift safety before
|
|
1713
|
+
artifact mutation.
|
|
1714
|
+
|
|
1715
|
+
Capability preflight:
|
|
1716
|
+
- Required role capability: `po` subagent.
|
|
1717
|
+
- Default policy: fail fast when unavailable with
|
|
1718
|
+
`SUBAGENT_CAPABILITY_UNAVAILABLE`.
|
|
1719
|
+
- Fallback policy is explicit only:
|
|
1720
|
+
- `INTAKE_SUBAGENT_FALLBACK=deny` (default): no silent fallback.
|
|
1721
|
+
- `INTAKE_SUBAGENT_FALLBACK=allow`: explicit operator opt-in for fallback path.
|
|
1722
|
+
|
|
1723
|
+
Single-writer drift safety:
|
|
1724
|
+
- Intake run binds a deterministic writer/run identity (`writer_id`,
|
|
1725
|
+
`intake_run_id`) to target artifacts.
|
|
1726
|
+
- Self-write updates for the active writer/run are valid and must not trigger
|
|
1727
|
+
concurrent drift blockers.
|
|
1728
|
+
- External concurrent conflicting writes fail safe with
|
|
1729
|
+
`INTAKE_CONCURRENT_WRITER_DETECTED`.
|
|
1730
|
+
- Fail-safe path performs no partial overwrite.
|
|
1731
|
+
|
|
1732
|
+
## Post-release operator commands (S0070 / BUG-0008 — released `2026-04-05`)
|
|
1733
|
+
|
|
1734
|
+
**S0070** **`released`**; **`BUG-0008`** **DONE** in canonical backlog. In-repo version **`its-magic@0.1.2-41`**. **`/release`** skipped registry publish while **`RELEASE_PUBLISH_MODE=disabled`** — operators still run the steps below when pushing to npm or validating on Debian.
|
|
1735
|
+
|
|
1736
|
+
- **Tests (canonical):** `powershell -ExecutionPolicy Bypass -File "tests/run-tests.ps1"` — refresh **`tests/report.md`**; release gate used **793**/0 @ **2026-04-05T20:21:40Z** with **US-0071** harness rows **PASS**.
|
|
1737
|
+
- **Prepublish:** `npm run prepublishOnly` (runs **`guard:installer`**).
|
|
1738
|
+
- **Publish:** `npm publish` — set **`RELEASE_PUBLISH_MODE`** to **`confirm`** or **`auto`** when ready; no inline registry secrets in docs.
|
|
1739
|
+
- **Debian global E2E (optional follow-up):** **`DEFERRED_DEBIAN_E2E_NO_RUNTIME`** was waived for the release cycle — when a Debian/SSH target exists (**US-0086**), run `npm install -g its-magic@0.1.2-41` (or equivalent), `cat -A` on installed `template/docs/engineering/context/installer-owned-paths.manifest` (no `^M$`), then `its-magic --target <repo> --mode missing` without `[INSTALL_MANIFEST_ERROR]`.
|
|
1740
|
+
|
|
1741
|
+
## Operator `.env` setup (US-0085 / DEC-0071)
|
|
1742
|
+
|
|
1743
|
+
### Quick start
|
|
1744
|
+
|
|
1745
|
+
1. Copy the committed template: `cp .env.example .env`
|
|
1746
|
+
2. Fill in values for each variable relevant to your environment.
|
|
1747
|
+
3. Source before remote, SSH, or release operations:
|
|
1748
|
+
- **Bash/Zsh**: `source .env` or `set -a; source .env; set +a`
|
|
1749
|
+
- **PowerShell**: `Get-Content .env | ForEach-Object { if ($_ -match '^([^#]\S+?)=(.*)$') { [Environment]::SetEnvironmentVariable($Matches[1], $Matches[2], 'Process') } }`
|
|
1750
|
+
4. Run `python scripts/print_remote_env_hint.py` to verify parity between
|
|
1751
|
+
`.env.example` and the `*Env` fields in JSON configs.
|
|
1752
|
+
|
|
1753
|
+
### Forbidden
|
|
1754
|
+
|
|
1755
|
+
- **Committing `.env`**: `.env` is gitignored; never add it to version control.
|
|
1756
|
+
- **Agents reading `.env`**: AI agents must not open, attach, read, search
|
|
1757
|
+
inside, or index `.env` or `.env.*` files (enforced via `.cursorignore` and
|
|
1758
|
+
Cursor rules). Use env var **names** in prose only.
|
|
1759
|
+
|
|
1760
|
+
### Allowed
|
|
1761
|
+
|
|
1762
|
+
- Running `ssh`, `docker`, `python scripts/remote_config_summary.py` after
|
|
1763
|
+
sourcing `.env` — the process inherits normal environment variables.
|
|
1764
|
+
- Referencing env var **names** (not values) in documentation and handoffs.
|
|
1765
|
+
|
|
1766
|
+
## Project run steps
|
|
1767
|
+
|
|
1768
|
+
### Prerequisites
|
|
1769
|
+
|
|
1770
|
+
### Local run
|
|
1771
|
+
|
|
1772
|
+
### Tests
|