its-magic 0.1.2-9 → 0.1.3-0

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.
Files changed (237) hide show
  1. package/README.md +1602 -755
  2. package/bin/its-magic.js +121 -11
  3. package/bin/postinstall.js +93 -0
  4. package/installer.ps1 +759 -0
  5. package/installer.py +1036 -0
  6. package/installer.sh +649 -0
  7. package/package.json +18 -14
  8. package/scripts/check_intake_template_parity.py +312 -0
  9. package/scripts/doc_profile_lib.py +415 -0
  10. package/scripts/guard_installer_publish.py +88 -0
  11. package/scripts/intake_bug_routing_guard.py +67 -0
  12. package/scripts/intake_evidence_lib.py +802 -0
  13. package/scripts/intake_evidence_validate.py +73 -0
  14. package/scripts/materialize_codebase_map.py +184 -0
  15. package/scripts/remote_config_summary.py +243 -0
  16. package/template/.cursor/agents/curator.mdc +35 -0
  17. package/template/.cursor/agents/dev.mdc +29 -0
  18. package/template/.cursor/agents/po.mdc +141 -0
  19. package/template/.cursor/agents/qa.mdc +28 -0
  20. package/template/.cursor/agents/release.mdc +28 -0
  21. package/template/.cursor/agents/security.mdc +98 -0
  22. package/template/.cursor/agents/tech-lead.mdc +57 -0
  23. package/template/.cursor/commands/architecture.md +127 -0
  24. package/template/.cursor/commands/ask.md +55 -0
  25. package/template/.cursor/commands/auto.md +533 -0
  26. package/template/.cursor/commands/discovery.md +47 -0
  27. package/template/.cursor/commands/execute.md +343 -0
  28. package/template/.cursor/commands/intake.md +323 -0
  29. package/template/.cursor/commands/map-codebase.md +46 -0
  30. package/template/.cursor/commands/memory-audit.md +175 -0
  31. package/template/.cursor/commands/milestone-complete.md +51 -0
  32. package/template/.cursor/commands/milestone-start.md +59 -0
  33. package/template/.cursor/commands/pause.md +64 -0
  34. package/{.cursor/commands/gsd-phase-context.md → template/.cursor/commands/phase-context.md} +6 -2
  35. package/template/.cursor/commands/plan-verify.md +34 -0
  36. package/template/.cursor/commands/qa.md +226 -0
  37. package/template/.cursor/commands/quick.md +41 -0
  38. package/template/.cursor/commands/refresh-context.md +82 -0
  39. package/template/.cursor/commands/release.md +523 -0
  40. package/template/.cursor/commands/research.md +49 -0
  41. package/template/.cursor/commands/resume.md +67 -0
  42. package/template/.cursor/commands/security-review.md +81 -0
  43. package/template/.cursor/commands/sprint-plan.md +103 -0
  44. package/template/.cursor/commands/status-reconcile.md +95 -0
  45. package/template/.cursor/commands/verify-work.md +152 -0
  46. package/template/.cursor/dev-environment.json.example +22 -0
  47. package/{.cursor → template/.cursor}/hooks/README.md +3 -2
  48. package/{.cursor/hooks/gsd-hook.py → template/.cursor/hooks/hook.py} +15 -6
  49. package/template/.cursor/hooks.json +26 -0
  50. package/template/.cursor/remote.json +31 -0
  51. package/template/.cursor/rules/caveman.mdc +184 -0
  52. package/template/.cursor/rules/coding-standards.mdc +39 -0
  53. package/template/.cursor/rules/core.mdc +111 -0
  54. package/template/.cursor/rules/handoffs.mdc +27 -0
  55. package/template/.cursor/rules/quality.mdc +49 -0
  56. package/template/.cursor/scratchpad.local.example.md +323 -0
  57. package/template/.cursor/scratchpad.md +324 -0
  58. package/{.cursor/skills/gsd-team → template/.cursor/skills/its-magic}/SKILL.md +2 -2
  59. package/template/.cursorignore +6 -0
  60. package/template/.env.example +28 -0
  61. package/template/.github/workflows/ci.yml +194 -0
  62. package/{.github → template/.github}/workflows/deploy.yml +5 -2
  63. package/template/.its-magic-version +1 -0
  64. package/template/CHANGELOG.md +11 -0
  65. package/template/README.md +1602 -0
  66. package/template/decisions/DEC-0001.md +11 -0
  67. package/template/decisions/DEC-0002.md +11 -0
  68. package/template/docs/developer/README.md +44 -0
  69. package/template/docs/engineering/architecture.md +9 -0
  70. package/template/docs/engineering/artifact-ordering-policy.md +48 -0
  71. package/template/docs/engineering/artifact-ownership-policy.md +57 -0
  72. package/template/docs/engineering/auto-orchestration-reference.md +1211 -0
  73. package/{docs → template/docs}/engineering/codebase-map.md +0 -5
  74. package/template/docs/engineering/compatibility-report.md +20 -0
  75. package/template/docs/engineering/compatibility-signals.md +7 -0
  76. package/template/docs/engineering/component-scope-report.md +16 -0
  77. package/template/docs/engineering/component-scope.md +19 -0
  78. package/template/docs/engineering/context/installer-owned-paths.manifest +96 -0
  79. package/template/docs/engineering/context/readme-section-affinity.json +30 -0
  80. package/template/docs/engineering/decisions.md +16 -0
  81. package/template/docs/engineering/legacy-drift-audit.md +21 -0
  82. package/template/docs/engineering/manifests/components/api-gateway.manifest.yaml +12 -0
  83. package/template/docs/engineering/manifests/registry.manifest.yaml +20 -0
  84. package/template/docs/engineering/manifests/repo.manifest.yaml +11 -0
  85. package/template/docs/engineering/phase-context.md +16 -0
  86. package/template/docs/engineering/release-targets.json +123 -0
  87. package/template/docs/engineering/research.md +29 -0
  88. package/template/docs/engineering/runbook.md +2391 -0
  89. package/template/docs/engineering/runtime-connectivity.md +81 -0
  90. package/template/docs/engineering/security-review.md +33 -0
  91. package/template/docs/engineering/spec-pack/README.md +20 -0
  92. package/template/docs/engineering/state-archive/README.md +15 -0
  93. package/template/docs/engineering/state.md +20 -0
  94. package/template/docs/engineering/status-normalization-report.md +19 -0
  95. package/template/docs/engineering/token-cost-parity-manifest.md +16 -0
  96. package/template/docs/engineering/us-0084-remote-e2e.md +44 -0
  97. package/template/docs/product/acceptance.md +1 -0
  98. package/template/docs/product/backlog.md +5 -0
  99. package/template/docs/product/vision.md +11 -0
  100. package/template/docs/user-guides/README.md +40 -0
  101. package/{handoffs → template/handoffs}/dev_to_qa.md +0 -3
  102. package/{handoffs → template/handoffs}/po_to_tl.md +0 -3
  103. package/{handoffs → template/handoffs}/qa_to_dev.md +1 -2
  104. package/template/handoffs/release_notes.md +51 -0
  105. package/template/handoffs/release_queue.md +47 -0
  106. package/template/handoffs/release_to_dev.md +31 -0
  107. package/template/handoffs/releases/Sxxxx-release-notes.md +62 -0
  108. package/template/handoffs/releases/vX.Y.Z-release-notes.md.example +21 -0
  109. package/template/handoffs/resume_brief.md +14 -0
  110. package/{handoffs → template/handoffs}/tl_to_dev.md +0 -2
  111. package/template/handoffs/token_cost_runs/README.md +26 -0
  112. package/template/its_magic/.its-magic-version +1 -0
  113. package/template/its_magic/README.md +9 -0
  114. package/template/scripts/auto_outer_driver.py +521 -0
  115. package/template/scripts/caveman_compress_input.py +903 -0
  116. package/template/scripts/check_downstream_ci_guard.py +67 -0
  117. package/template/scripts/check_intake_template_parity.py +312 -0
  118. package/template/scripts/check_token_cost_parity.py +69 -0
  119. package/template/scripts/dev_environment_lib.py +601 -0
  120. package/template/scripts/doc_profile_lib.py +415 -0
  121. package/template/scripts/downstream_ci_guard_lib.py +222 -0
  122. package/template/scripts/enforce-triad-hot-surface.py +753 -0
  123. package/template/scripts/guard_installer_publish.py +88 -0
  124. package/template/scripts/intake_bug_resume_brief_refresh.py +303 -0
  125. package/template/scripts/intake_bug_routing_guard.py +67 -0
  126. package/template/scripts/intake_evidence_lib.py +802 -0
  127. package/template/scripts/intake_evidence_validate.py +73 -0
  128. package/template/scripts/materialize_codebase_map.py +184 -0
  129. package/template/scripts/pack_json_validate.py +130 -0
  130. package/template/scripts/project_readme_coverage_lib.py +417 -0
  131. package/template/scripts/readme_feature_coverage_lib.py +608 -0
  132. package/{scripts → template/scripts}/release-all.sh +27 -4
  133. package/template/scripts/release_changelog_backfill.py +153 -0
  134. package/template/scripts/release_changelog_lib.py +544 -0
  135. package/template/scripts/release_changelog_validate.py +134 -0
  136. package/template/scripts/remote_config_summary.py +243 -0
  137. package/template/scripts/sync_push_gates.py +198 -0
  138. package/template/scripts/token_cost_compare.py +40 -0
  139. package/template/scripts/token_cost_lib.py +108 -0
  140. package/template/scripts/uat_probe_lib.py +868 -0
  141. package/template/scripts/validate-and-push.ps1 +280 -0
  142. package/template/scripts/validate-and-push.sh +243 -0
  143. package/template/scripts/validate_doc_profile.py +103 -0
  144. package/template/scripts/validate_project_readme_coverage.py +151 -0
  145. package/template/scripts/validate_readme_feature_coverage.py +140 -0
  146. package/template/sprints/S0001/progress.md +1 -0
  147. package/template/sprints/S0001/qa-findings.md +9 -0
  148. package/template/sprints/S0001/release-findings.md +24 -0
  149. package/template/sprints/S0001/sprint.md +9 -0
  150. package/template/sprints/S0001/summary.md +7 -0
  151. package/template/sprints/S0001/tasks.md +1 -0
  152. package/template/sprints/S0001/uat.json +6 -0
  153. package/template/sprints/S0001/uat.md +5 -0
  154. package/template/sprints/quick/Q0001/summary.md +1 -0
  155. package/{sprints → template/sprints}/quick/Q0001/task.json +0 -1
  156. package/.cursor/agents/curator.mdc +0 -21
  157. package/.cursor/agents/dev.mdc +0 -20
  158. package/.cursor/agents/po.mdc +0 -19
  159. package/.cursor/agents/qa.mdc +0 -19
  160. package/.cursor/agents/release.mdc +0 -19
  161. package/.cursor/agents/tech-lead.mdc +0 -21
  162. package/.cursor/commands/gsd-architecture.md +0 -29
  163. package/.cursor/commands/gsd-auto.md +0 -27
  164. package/.cursor/commands/gsd-discovery.md +0 -27
  165. package/.cursor/commands/gsd-execute.md +0 -32
  166. package/.cursor/commands/gsd-intake.md +0 -28
  167. package/.cursor/commands/gsd-map-codebase.md +0 -25
  168. package/.cursor/commands/gsd-milestone-complete.md +0 -24
  169. package/.cursor/commands/gsd-milestone-start.md +0 -26
  170. package/.cursor/commands/gsd-pause.md +0 -25
  171. package/.cursor/commands/gsd-plan-verify.md +0 -26
  172. package/.cursor/commands/gsd-qa.md +0 -28
  173. package/.cursor/commands/gsd-quick.md +0 -24
  174. package/.cursor/commands/gsd-refresh-context.md +0 -26
  175. package/.cursor/commands/gsd-release.md +0 -29
  176. package/.cursor/commands/gsd-research.md +0 -28
  177. package/.cursor/commands/gsd-resume.md +0 -26
  178. package/.cursor/commands/gsd-sprint-plan.md +0 -30
  179. package/.cursor/commands/gsd-verify-work.md +0 -25
  180. package/.cursor/hooks.json +0 -26
  181. package/.cursor/plans/cursor-gsd-team-kit_8cfee9b8.plan.md +0 -57
  182. package/.cursor/remote.json +0 -18
  183. package/.cursor/rules/gsd-core.mdc +0 -18
  184. package/.cursor/rules/gsd-handoffs.mdc +0 -10
  185. package/.cursor/rules/gsd-quality.mdc +0 -15
  186. package/.cursor/scratchpad.md +0 -34
  187. package/.github/workflows/ci.yml +0 -47
  188. package/decisions/DEC-0001.md +0 -21
  189. package/decisions/DEC-0002.md +0 -21
  190. package/docs/engineering/architecture.md +0 -354
  191. package/docs/engineering/decisions.md +0 -6
  192. package/docs/engineering/research.md +0 -11
  193. package/docs/engineering/runbook.md +0 -32
  194. package/docs/engineering/state.md +0 -33
  195. package/docs/product/acceptance.md +0 -6
  196. package/docs/product/backlog.md +0 -7
  197. package/docs/product/vision.md +0 -46
  198. package/gsd-installer.ps1 +0 -189
  199. package/gsd-installer.py +0 -195
  200. package/gsd-installer.sh +0 -201
  201. package/handoffs/release_notes.md +0 -14
  202. package/handoffs/resume_brief.md +0 -8
  203. package/milestones/M0001/milestone.json +0 -7
  204. package/milestones/M0001/phases.json +0 -9
  205. package/milestones/M0001/progress.md +0 -3
  206. package/milestones/M0001/summary.md +0 -3
  207. package/scripts/generate-release-notes.ps1 +0 -74
  208. package/scripts/generate-release-notes.sh +0 -63
  209. package/scripts/release-all.ps1 +0 -423
  210. package/sprints/S0001/progress.md +0 -4
  211. package/sprints/S0001/qa-findings.md +0 -113
  212. package/sprints/S0001/sprint.md +0 -70
  213. package/sprints/S0001/summary.md +0 -46
  214. package/sprints/S0001/tasks.md +0 -35
  215. package/sprints/S0001/uat.json +0 -8
  216. package/sprints/S0001/uat.md +0 -8
  217. package/sprints/quick/Q0001/summary.md +0 -3
  218. /package/{.cursor/rules/gsd-escalation.mdc → template/.cursor/rules/escalation.mdc} +0 -0
  219. /package/{.cursor/skills/gsd-team → template/.cursor/skills/its-magic}/templates/acceptance.json +0 -0
  220. /package/{.cursor/skills/gsd-team → template/.cursor/skills/its-magic}/templates/acceptance.md +0 -0
  221. /package/{.cursor/skills/gsd-team → template/.cursor/skills/its-magic}/templates/architecture.json +0 -0
  222. /package/{.cursor/skills/gsd-team → template/.cursor/skills/its-magic}/templates/architecture.md +0 -0
  223. /package/{.cursor/skills/gsd-team → template/.cursor/skills/its-magic}/templates/decision.json +0 -0
  224. /package/{.cursor/skills/gsd-team → template/.cursor/skills/its-magic}/templates/decision.md +0 -0
  225. /package/{.cursor/skills/gsd-team → template/.cursor/skills/its-magic}/templates/handoff.json +0 -0
  226. /package/{.cursor/skills/gsd-team → template/.cursor/skills/its-magic}/templates/handoff.md +0 -0
  227. /package/{.cursor/skills/gsd-team → template/.cursor/skills/its-magic}/templates/milestone.json +0 -0
  228. /package/{.cursor/skills/gsd-team → template/.cursor/skills/its-magic}/templates/phase-context.json +0 -0
  229. /package/{.cursor/skills/gsd-team → template/.cursor/skills/its-magic}/templates/plan-verify.json +0 -0
  230. /package/{.cursor/skills/gsd-team → template/.cursor/skills/its-magic}/templates/sprint.json +0 -0
  231. /package/{.cursor/skills/gsd-team → template/.cursor/skills/its-magic}/templates/sprint.md +0 -0
  232. /package/{.cursor/skills/gsd-team → template/.cursor/skills/its-magic}/templates/story.json +0 -0
  233. /package/{.cursor/skills/gsd-team → template/.cursor/skills/its-magic}/templates/story.md +0 -0
  234. /package/{.cursor/skills/gsd-team → template/.cursor/skills/its-magic}/templates/uat.json +0 -0
  235. /package/{docs → template/docs}/engineering/context/phase-template.json +0 -0
  236. /package/{docs → template/docs}/engineering/dependencies.json +0 -0
  237. /package/{sprints → template/sprints}/S0001/plan-verify.json +0 -0
@@ -0,0 +1,343 @@
1
+ ---
2
+ description: "its-magic execute: implement tasks with artifacts and state updates."
3
+ ---
4
+
5
+ # /execute
6
+
7
+ ## Subagents
8
+ - dev
9
+
10
+ ## Execution model
11
+ - Run `/execute` in a fresh Dev subagent context.
12
+ - After writing outputs, stop and hand off to `/qa` in a new subagent/chat.
13
+ - When fixing QA findings, each new `/execute` run is a new Dev subagent.
14
+
15
+ ## Isolation evidence write requirement (US-0048 / DEC-0029)
16
+
17
+ At the end of `/execute`, append an isolation evidence entry to
18
+ `docs/engineering/state.md`:
19
+
20
+ - `phase_id=execute`
21
+ - `role=dev`
22
+ - `fresh_context_marker=<new marker for this subagent>`
23
+ - `timestamp=<ISO UTC>`
24
+ - `evidence_ref=<primary output ref>` (recommended: `handoffs/dev_to_qa.md` and the target sprint `sprints/Sxxxx/summary.md`)
25
+
26
+ In an execute↔QA implementation loop (`AUTO_IMPLEMENTATION_LOOP=1`), each new
27
+ `/execute` cycle must have a new `fresh_context_marker` (marker reuse is treated
28
+ as stale isolation evidence).
29
+
30
+ ## Inputs
31
+
32
+ - **Narrow-read (US-0053 / US-0096 Tranche A)**: Start at docs/engineering/phase-context.md
33
+ and the story section anchor in vision/architecture/decisions when a heading exists; forbid
34
+ full-file reads when a section heading exists.
35
+ - `sprints/S0001/tasks.md`
36
+ - `handoffs/tl_to_dev.md`
37
+ - Optional: `handoffs/qa_to_dev.md` when fixing QA findings
38
+ - Optional (remote-enabled mode only): `.cursor/remote.json`
39
+
40
+ ## Outputs (artifacts)
41
+ - Code changes
42
+ - `sprints/S0001/summary.md`
43
+ - `docs/engineering/state.md`
44
+ - `handoffs/dev_to_qa.md` (if ready)
45
+ - Optional (when enabled):
46
+ - `docs/engineering/compatibility-signals.md`
47
+ - `docs/engineering/compatibility-report.md`
48
+
49
+ ## Stop conditions
50
+ - Decision gate triggered
51
+ - Missing task definition or unclear scope
52
+
53
+ Release gate semantics (US-0039): mandatory gates (check-in test, QA, UAT) and no-bypass/override contract are enforced at `/release`; see `.cursor/commands/release.md` and `.cursor/commands/qa.md`.
54
+
55
+ ### Browser UAT self-test (US-0093)
56
+
57
+ When **`UAT_BROWSER_PROBE_MODE=cursor`** (default) and acceptance steps classify as **`browser_smoke`**
58
+ (or automatable **`manual_operator`** re-routed per **DEC-0079** §4), execute the **Cursor browser MCP**
59
+ sequence during `/execute` when web UI verification applies (**BUG-0006**: **`scripts/uat_probe_lib.py`**
60
+ never invokes MCP — subagent only):
61
+
62
+ 1. **Resolve target URL** — `docs/engineering/runtime-connectivity.md` first `http(s)://`; else
63
+ `package.json` dev/start + **`DEV_SERVER_PORT`** scratchpad override.
64
+ 2. **`browser_navigate`** — load URL; respect enterprise origin allowlist.
65
+ 3. **Step plan** — map automatable verbs to **`browser_click`** / **`browser_type`** / **`browser_scroll`**;
66
+ **never** fill password/credential fields; **never** read **`.env`** paths.
67
+ 4. **`browser_screenshot`** — write to **`sprints/Sxxxx/evidence/browser/<probe_id>-<seq>.png`** (max **5**).
68
+ 5. **Console + network evidence** — counts + summary path refs only (no inline secrets).
69
+ 6. **Verdict** — set **`passed`**, **`reason_code`**, **`browser_evidence_refs`** on the matching
70
+ **`probe_results[]`** row in **`uat.json`**. **`passed=true`** in **`cursor`** mode requires
71
+ non-empty **`navigation_url`** + at least one screenshot or console/network summary path — else
72
+ downgrade to **`UAT_BROWSER_PROBE_FAILED`**.
73
+ 7. **Fallback trigger** — MCP unavailable → record **`UAT_BROWSER_UNAVAILABLE`**; when
74
+ **`UAT_BROWSER_FALLBACK_CHAIN=1`**, stdlib HTTP/Playwright fallback runs via **`uat_probe_lib.py`**.
75
+ Both fail → **`UAT_BROWSER_PROBE_FAILED`** (no silent PASS).
76
+
77
+ Optional validation: **`python scripts/uat_probe_lib.py --merge-result <fragment.json>`** —
78
+ evidence-required-on-PASS in **`cursor`** mode. No auto-read **`.env`**, no credential auto-fill,
79
+ no intake evidence mutation.
80
+
81
+ ## Intake evidence tooling reference (US-0078 / DEC-0060)
82
+
83
+ Stories that harden intake persistence ship **`scripts/intake_evidence_lib.py`**,
84
+ **`scripts/intake_evidence_validate.py`**, and **`tests/intake_evidence_fixtures_test.py`**
85
+ (invoked from **`tests/run-tests.ps1`** / **`tests/run-tests.sh`** §26k). See
86
+ **`docs/engineering/architecture.md`** **`# US-0078`** and **`decisions/DEC-0060.md`**.
87
+
88
+ ## Bug issue tooling reference (US-0079 / DEC-0061)
89
+
90
+ Ship **`scripts/bug_issue_lib.py`**, **`scripts/bug_issue_validate.py`**, **`scripts/intake_bug_routing_guard.py`**, and **`tests/bug_issue_fixtures_test.py`** (§26L in **`tests/run-tests.ps1`** / **`tests/run-tests.sh`**). See **`docs/engineering/architecture.md`** **`# US-0079`** and **`decisions/DEC-0061.md`**.
91
+
92
+ ## Token-cost evidence (US-0080 / DEC-0062)
93
+
94
+ When persisting token metrics for an orchestrated run: use append-only
95
+ **`handoffs/token_cost_runs/<orchestrator_run_id>.md`** (or **`.jsonl`**) per
96
+ **`DEC-0062`** §3; set **`token_cost_evidence_ref`** on **`docs/engineering/state.md`**
97
+ checkpoints when rows exist. **`run_class_hash`** comparability for **AC-2** uses
98
+ **`scripts/token_cost_lib.py`** / **`scripts/token_cost_compare.py`**; active/`template/`
99
+ parity for listed paths: **`python scripts/check_token_cost_parity.py --repo .`**
100
+ (§26M in **`tests/run-tests.ps1`** / **`tests/run-tests.sh`**).
101
+
102
+ ## Canonical status contract (US-0045)
103
+
104
+ - Story status authority is `docs/product/backlog.md` (including **`BUG-####`** under **`## Bug issues (canonical)`** per **DEC-0061**).
105
+ - `docs/product/acceptance.md` and `docs/engineering/state.md` are derived and
106
+ must not be treated as canonical readiness sources when contradictory.
107
+ - `/execute` must not start/continue implementation solely based on
108
+ non-canonical status evidence.
109
+
110
+ ## Browser UAT self-test (US-0093)
111
+
112
+ When acceptance steps classify as **`browser_smoke`** (or automatable **`manual_operator`**
113
+ reclassified per **DEC-0079** §4) and **`UAT_BROWSER_PROBE_MODE=cursor`**, execute the **Cursor
114
+ browser MCP** sequence during execute-phase verification — **lib never calls MCP directly**
115
+ (**BUG-0006**):
116
+
117
+ 1. **Resolve target URL** — `docs/engineering/runtime-connectivity.md` first `http(s)://`; else
118
+ dev-server port from `package.json` + scratchpad **`DEV_SERVER_PORT`**.
119
+ 2. **`browser_navigate`** — respect origin allowlist.
120
+ 3. **Step plan** — **`browser_click`** / **`browser_type`** / **`browser_scroll`** when
121
+ automatable; **never** fill password/credential fields or read **`.env`**.
122
+ 4. **`browser_screenshot`** → **`sprints/Sxxxx/evidence/browser/<probe_id>-<seq>.png`** (max **5**).
123
+ 5. Console + network summary path refs only (no inline secrets).
124
+ 6. Write **`browser_evidence_refs`** to **`uat.json`** `probe_results[]`; mirror
125
+ **Runtime browser evidence** in **`qa-findings.md`**.
126
+ 7. MCP unavailable → **`UAT_BROWSER_UNAVAILABLE`** + stdlib fallback when
127
+ **`UAT_BROWSER_FALLBACK_CHAIN=1`**; validate with
128
+ **`python scripts/uat_probe_lib.py --merge-result <fragment.json>`**.
129
+
130
+ Reason codes: **`UAT_BROWSER_UNAVAILABLE`**, **`UAT_BROWSER_PROBE_FAILED`**,
131
+ **`UAT_BROWSER_PROBE_TIMEOUT`**. **No silent PASS** without agent evidence in **`cursor`** mode.
132
+
133
+ ## Steps
134
+ 1. Implement one task at a time.
135
+ 2. Update summary and engineering state.
136
+ 3. Handoff to QA when ready.
137
+ 4. If `AUTO_INSTALL_DEPS=1` in `.cursor/scratchpad.md`, install dependencies
138
+ via the appropriate package manager without prompting.
139
+ 5. Mode-aware remote-config validation (DEC-0016):
140
+ - If `REMOTE_EXECUTION=0`, skip all remote-config checks (zero overhead).
141
+ - If `REMOTE_EXECUTION=1`, fail fast on `.cursor/remote.json` contract errors
142
+ before remote execution is attempted.
143
+ - Required root fields: `version` (integer), `defaultTarget` (string),
144
+ `targets` (array).
145
+ - Required target fields: `id` (string), `type` (`docker|ssh|vm`),
146
+ `enabled` (boolean), `host` (string), `port` (integer 1..65535),
147
+ `workspaceRoot` (string).
148
+ - Optional target field: `auth` object with `mode` (`none|env`).
149
+ - If `auth.mode=env`, sensitive values must be env-var references only
150
+ (for example `tokenEnv`, `passwordEnv`, `privateKeyPathEnv`).
151
+ - `defaultTarget` must match an existing enabled target `id`.
152
+ - Secret-like inline literals are forbidden in committed config.
153
+ 6. Remote validation errors must use actionable fail-fast format:
154
+ `[REMOTE_CONFIG_ERROR] <path>: expected <rule>, got <actual>. Fix: <hint>.`
155
+ - Missing file: `.cursor/remote.json` not found.
156
+ - Malformed JSON: parse failure with syntax location.
157
+ - Invalid enum/type/value: include field path and allowed/expected values.
158
+ - Security violation: inline secret-like value detected.
159
+ Use remediation hints that either fix config or disable remote mode
160
+ (`REMOTE_EXECUTION=0`) when remote execution is not needed.
161
+ 7. If `RUN_TESTS_ON_EDIT=1`, run configured tests after meaningful edits.
162
+ 8. If `LOOP_UNTIL_GREEN=1`, fix failing tests in small iterations until green,
163
+ or stop and document blockers in `docs/engineering/state.md`.
164
+ 9. If `AUTO_PAUSE_REQUEST=1` and boundary rules permit, checkpoint via `/pause`.
165
+ 10. Sync policy evaluation contract (US-0038):
166
+ - Evaluate sync eligibility only at completed phase boundaries.
167
+ - Do not evaluate on partial/intra-phase edits (deterministic boundary-only behavior).
168
+ - If policy mode is `disabled|manual`, keep near-zero overhead and do not
169
+ auto-trigger push behavior.
170
+ 11. Team-scope guardrails for bulk execute mode (US-0047 / DEC-0024):
171
+ - When `TEAM_MODE=1` and `AUTO_TEAM_SCOPE_ENFORCE=1`, only execute tasks that
172
+ match current member scope (`TEAM_MEMBER`, `ACTIVE_TASK_IDS`).
173
+ - For out-of-scope tasks, do not write code or artifacts; emit deterministic
174
+ reason code and follow configured stop/skip policy.
175
+ 12. When ready to push, suggest `scripts/validate-and-push` to run the full
176
+ quality chain locally before CI.
177
+ 13. Optional compatibility observability execution contract (US-0034):
178
+ - If `CROSS_REPO_OBSERVABILITY=0`, skip all compatibility checks (zero
179
+ required overhead).
180
+ - If `CROSS_REPO_OBSERVABILITY=1`, append/update compatibility signals and
181
+ findings in canonical artifacts (`compatibility-signals.md`,
182
+ `compatibility-report.md`) including severity, impacted modules,
183
+ evidence refs, and recommended actions.
184
+ 14. Optional component-scoped execution guardrails (US-0035):
185
+ - If `COMPONENT_SCOPE_MODE=0`, add zero required scope overhead.
186
+ - If `COMPONENT_SCOPE_MODE=1`, enforce scope-first execution:
187
+ - do not intentionally modify out-of-scope components unless escalation is
188
+ explicitly approved and recorded,
189
+ - any detected unapproved out-of-scope impact must be flagged for decision
190
+ gate handling before release.
191
+ 15. Optional spec-pack (US-0031):
192
+ - If `SPEC_PACK_MODE=0`, add no required spec-pack steps (zero overhead).
193
+ - If `SPEC_PACK_MODE=1`, update Technical Specification artifact for target
194
+ story at canonical path when implementation details change; see runbook
195
+ for required sections and ownership.
196
+ 16. Optional user-guide (US-0032):
197
+ - If `USER_GUIDE_MODE=0`, add no required user-guide steps or blocking checks (zero overhead).
198
+ - If `USER_GUIDE_MODE=1`, create or update user guide at
199
+ `docs/user-guides/US-xxxx.md` for target story; see runbook for minimum schema.
200
+ 17. Optional remote runtime execution context (US-0064):
201
+ - If release target runtime metadata indicates `runtime.mode=remote`, record
202
+ remote execution/debug context in handoff outputs and state evidence
203
+ references.
204
+ - If remote execution is required but connectivity metadata is incomplete,
205
+ fail fast with `REMOTE_CONNECTIVITY_CONFIG_INVALID`.
206
+ - Never expose secrets in execution outputs; only sanitized endpoint data and
207
+ env-reference names are allowed.
208
+ 17b. Remote evidence cues (US-0084):
209
+ - When `REMOTE_EXECUTION=1`, cite an **environment label** in
210
+ `handoffs/dev_to_qa.md` (e.g. `WSL`, `ssh:SSH_HOST` as the **env var name**,
211
+ `dockerOverSsh`) and state **where tests ran** (local vs remote host).
212
+ - Do not paste private keys, tokens, or resolved secret **values**; use
213
+ `python scripts/remote_config_summary.py` for a names-only summary when needed.
214
+ 18. Runtime QA autopilot execution contract (US-0065 / DEC-0047):
215
+ - Treat runtime verification as mandatory for generated-project scope; static
216
+ checks alone are not sufficient evidence for PASS readiness.
217
+ - Follow canonical stage order:
218
+ `startup -> readiness/connectivity -> log scan -> bounded retry -> verdict`.
219
+ - Record runtime execution evidence in execute outputs:
220
+ - startup command and selected stack profile,
221
+ - runtime mode (`local|remote`) and endpoint/health snapshot,
222
+ - retry ledger (`attempt`, `delay_ms`, `outcome`),
223
+ - log severity summary (`info|warn|error|fatal` counts),
224
+ - final runtime verdict with deterministic reason code.
225
+ - Supported stack profiles (minimum): `node`, `python`, `go`, `java`, `dotnet`.
226
+ - If stack profile cannot be resolved deterministically, fail closed with
227
+ `RUNTIME_STACK_PROFILE_UNRESOLVED` and remediation guidance.
228
+ - Bounded retry policy:
229
+ - retries are allowed only for transient startup/connectivity failures,
230
+ - retry attempts must not exceed configured max,
231
+ - critical log signals are non-transient and fail closed immediately.
232
+ - Runtime failure reason-code baseline:
233
+ - `RUNTIME_STARTUP_FAILED`
234
+ - `RUNTIME_ENDPOINT_UNREACHABLE`
235
+ - `RUNTIME_LOG_CRITICAL_DETECTED`
236
+ - `RUNTIME_RETRY_BUDGET_EXHAUSTED`
237
+ - `RUNTIME_STACK_PROFILE_UNRESOLVED`
238
+ - When HTTP/UI context is detected, include webapp runtime evidence path for
239
+ QA handoff (browser-surface checks plus console/network error signals).
240
+ 19. Generated baseline test scaffolding contract (US-0066 / DEC-0048):
241
+ - Resolve deterministic stack/project profile before scaffold generation:
242
+ `node|python|go|java|dotnet` (minimum supported set).
243
+ - Generate baseline tests only when missing; create minimal runnable assets for
244
+ unit, integration, and acceptance layers using stable paths.
245
+ - Record generated-test evidence in execute outputs:
246
+ - resolved stack profile,
247
+ - generated paths inventory (`unit|integration|acceptance`),
248
+ - scaffold command/actions and outcome.
249
+ - Deterministic runbook baseline wiring:
250
+ - if `TEST_COMMAND` is missing/unset, write stack baseline command,
251
+ - if `TEST_COMMAND` is user-authored and non-empty, preserve it.
252
+ - Fail-closed diagnostics for generation/profile failures:
253
+ - `TEST_SCAFFOLD_STACK_UNRESOLVED`
254
+ - `TEST_SCAFFOLD_UNSUPPORTED_STACK`
255
+ - `TEST_SCAFFOLD_GENERATION_FAILED`
256
+ - Non-destructive precedence is mandatory:
257
+ - preserve existing user-authored test files and config by default,
258
+ - fill only missing baseline scaffold assets.
259
+ - Rerun behavior must be idempotent:
260
+ - no duplicate scaffold files on repeated `/execute`,
261
+ - no oscillating `TEST_COMMAND` rewrites between runs.
262
+ - Runtime boundary:
263
+ - static generated-test PASS is necessary but not sufficient for QA PASS;
264
+ runtime startup/connectivity/log verdict remains governed by `US-0065`.
265
+ 20. User-visible internal metadata guard (US-0071 / DEC-0053):
266
+ - Before completing `/execute`, run `python scripts/check-user-visible-metadata.py`
267
+ from the repository root (or `python scripts/check-user-visible-metadata.py --repo <root>`).
268
+ - On failure, stop with `USER_VISIBLE_INTERNAL_METADATA_DETECTED` and use the
269
+ remediation contract in `docs/engineering/runbook.md` (evidence ref, token
270
+ class, neutral operator copy). Do not ship planning tokens in scanned
271
+ operator-visible strings.
272
+ - If you add a new operator-facing script or binary path, update inclusive
273
+ scan roots in `scripts/check-user-visible-metadata.py` **and** this runbook
274
+ section together or fail closed with `METADATA_SANITIZATION_SCOPE_AMBIGUOUS`
275
+ semantics at QA/release.
276
+ 21. Documentation profile validation (US-0077 / DEC-0059):
277
+ - When you change `README.md`, `docs/developer/README.md`, scratchpad profile keys
278
+ (`DOC_AUDIENCE_PROFILE`, `DOC_DETAIL_LEVEL`), or `scripts/doc_profile_lib.py` /
279
+ `scripts/validate_doc_profile.py`, run `python scripts/validate_doc_profile.py --repo <root>`.
280
+ - Fail closed on `DOC_PROFILE_INVALID`, `DOC_PROFILE_MERGE_ERROR`,
281
+ `DOC_SECTION_MISSING:*`, `DOC_SECTION_BUDGET_EXCEEDED`, or `DOC_TEMPLATE_PARITY_FAIL`
282
+ (see `docs/engineering/runbook.md`).
283
+ 22. Triad hot-surface enforcement (DEC-0054):
284
+ - Before completing `/execute`, run
285
+ `python scripts/enforce-triad-hot-surface.py --check` from repository root
286
+ (or `--repo <root>`).
287
+ - If the check fails, run `python scripts/enforce-triad-hot-surface.py --rollover`
288
+ then `--check` again; if still failing, stop with `STATE_ARCHIVE_REQUIRED` or
289
+ `ARTIFACT_HOT_SURFACE_OVERSIZE` (no successful execute completion on oversize
290
+ triad hot files).
291
+ - When your edits touched any triad path (`docs/engineering/state.md`,
292
+ `handoffs/po_to_tl.md`, `docs/engineering/architecture.md`), ensure rollover
293
+ evidence (`boundary`, `moved`, `retained`, `pack_ref`) is recorded in the
294
+ execute checkpoint when packs were written.
295
+ 23. Project README bootstrap + per-story catalog delta (US-0097 / DEC-0083):
296
+ - **23 preamble**: Read merged scratchpad `FRAMEWORK_KIT_REPO` (default `0`).
297
+ When `1` (its-magic kit repo only), skip **23a** and **23b** — consumer repos
298
+ never set `FRAMEWORK_KIT_REPO=1`. Read `PROJECT_README_ENFORCE` for delta context.
299
+ - **23a Bootstrap**: When root `README.md` is missing or matches placeholder
300
+ sentinels **S1–S4** (framework H1, `<!-- readme-feature-coverage-catalog -->`,
301
+ `Feature coverage catalog (US-0091)` heading, or byte-match to `template/README.md`),
302
+ materialize the project scaffold from `docs/product/vision.md` (H1 + 1–3 sentence
303
+ purpose, `## For users`, `## For developers`, `## Features`,
304
+ `<!-- project-readme-feature-catalog -->`, pointer to `its_magic/README.md`).
305
+ Operator-authored roots (**S5**) are never overwritten. Fail closed →
306
+ `PROJECT_README_BOOTSTRAP_SKIPPED` when bootstrap required but not performed.
307
+ - **23b Per-story delta (mandatory)**: Before `/execute` PASS for a shipped story,
308
+ add or update ≥1 user-facing catalog bullet under
309
+ `<!-- project-readme-feature-catalog -->` containing `\bUS-xxxx\b` for each
310
+ `user_visible: true` story in scope. Fail closed → `PROJECT_README_DELTA_SKIPPED`.
311
+ Hybrid/ambiguous roots → `PROJECT_README_MIGRATION_AMBIGUOUS` or
312
+ `PROJECT_README_SENTINEL_CONFLICT` (see runbook migration §). Inconclusive
313
+ classifier → `PROJECT_README_PLACEHOLDER_UNRESOLVED`.
314
+ - **23c Hygiene compose**: Prose edits in root `README.md` are subject to step **20**
315
+ (**US-0071**) — do not run duplicate hygiene when README is unchanged this phase.
316
+ - Active + `template/.cursor/commands/execute.md` byte-identical step **23** block.
317
+
318
+ 24. Dev environment auto-launch profile (US-0098 / DEC-0084):
319
+ - **24 preamble**: Read merged scratchpad `DEV_AUTO_LAUNCH_PROFILE` (default `off`) and
320
+ optional `DEV_ENVIRONMENT_CONFIG` (default `.cursor/dev-environment.json`). When `off`,
321
+ skip **24a–24d** with zero overhead — manual workflows unchanged.
322
+ - **24a Gate + profile load**: Validate profile path via `scripts/dev_environment_lib.py`
323
+ `load_profile`; names-only schema check. Fail closed → `DEV_ENV_PROFILE_INVALID` or
324
+ `DEV_ENV_PROFILE_MISSING`. Never read `.env`.
325
+ - **24b Detect + persist**: Run `detect_mode(repo, profile, scratchpad)` per detection
326
+ precedence (**US-0086** remote wins over **docker-host-local**). Merge fields idempotently
327
+ into profile file.
328
+ - **24c Relaunch (bounded)**: When touched files match Tier A/B/C via `classify_touched_files`
329
+ or explicit operator refresh (**exact literal** `refresh dev environment` — case-sensitive
330
+ whole phrase): run `build_relaunch_plan` recipe; bounded retries (`retry_count` max **2**;
331
+ delays **5s** then **15s**). Bind-mount skip default: source-only docker changes emit
332
+ `DEV_ENV_RELAUNCH_SKIPPED_NO_SURFACE` unless `rebuild_recipe.restart_on_source_change=true`
333
+ or explicit refresh.
334
+ - **24d Connect + handoff**: Append **Dev environment relaunch** + **Connect** sections to
335
+ `handoffs/dev_to_qa.md` with evidence tuple fields: `dev_auto_launch_profile`,
336
+ `runtime_mode`, `relaunch_tier`, `relaunch_command`, `relaunch_outcome`, `retry_count`,
337
+ `reason_code`. Use `format_connect_block` — mandatory fields: `runtime_mode`,
338
+ `connect_endpoint`, `health_path`, `service_id`/`container_id`, `target_id`, `env_refs`,
339
+ `relaunch_outcome`. Names-only — no secret values.
340
+ - Orthogonal to step **18** (**US-0065**) runtime QA autopilot and step **17** (**US-0084**)
341
+ remote cues (compose when both fire).
342
+ - Active + `template/.cursor/commands/execute.md` byte-identical step **24** block.
343
+