its-magic 0.1.2-43 → 0.1.2-49

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 (27) hide show
  1. package/README.md +119 -0
  2. package/package.json +1 -1
  3. package/scripts/check_intake_template_parity.py +90 -2
  4. package/scripts/guard_installer_publish.py +19 -1
  5. package/template/.cursor/commands/architecture.md +16 -6
  6. package/template/.cursor/commands/auto.md +42 -0
  7. package/template/.cursor/commands/execute.md +49 -0
  8. package/template/.cursor/commands/qa.md +37 -0
  9. package/template/.cursor/commands/release.md +11 -0
  10. package/template/.cursor/commands/verify-work.md +43 -1
  11. package/template/.cursor/rules/caveman.mdc +43 -0
  12. package/template/.cursor/scratchpad.local.example.md +39 -4
  13. package/template/.cursor/scratchpad.md +34 -4
  14. package/template/.github/workflows/ci.yml +4 -114
  15. package/template/README.md +113 -0
  16. package/template/docs/engineering/auto-orchestration-reference.md +62 -1
  17. package/template/docs/engineering/context/installer-owned-paths.manifest +12 -0
  18. package/template/docs/engineering/context/readme-section-affinity.json +30 -0
  19. package/template/docs/engineering/runbook.md +151 -5
  20. package/template/scripts/auto_outer_driver.py +521 -0
  21. package/template/scripts/check_downstream_ci_guard.py +67 -0
  22. package/template/scripts/check_intake_template_parity.py +90 -2
  23. package/template/scripts/downstream_ci_guard_lib.py +222 -0
  24. package/template/scripts/enforce-triad-hot-surface.py +135 -8
  25. package/template/scripts/readme_feature_coverage_lib.py +608 -0
  26. package/template/scripts/uat_probe_lib.py +868 -0
  27. package/template/scripts/validate_readme_feature_coverage.py +140 -0
@@ -125,6 +125,48 @@ after template upgrades if needed.
125
125
 
126
126
  Normative H2 titles and matrix: `docs/engineering/architecture.md` (`# US-0077`).
127
127
 
128
+ ## README feature coverage validation (US-0091 / DEC-0074)
129
+
130
+ **Goal:** ensure every DONE user-visible backlog item (`US-xxxx` / `BUG-xxxx` with
131
+ `user_visible: true`) has operator blurbs in root `README.md` and traceability rows in
132
+ `docs/developer/README.md`, without inventing new `USER_*` / `DEV_*` H2 literals
133
+ (**DEC-0059** composes; **US-0030** delta gate unchanged).
134
+
135
+ ### Delta vs static doc gates
136
+
137
+ | Gate | Question | Remediation |
138
+ |------|----------|-------------|
139
+ | **US-0030** (delta) | Did this sprint change commands/flags without README/runbook updates? | Update command docs for changed surfaces; agent checklist in `/release` step 3 family. |
140
+ | **US-0091** (static) | Is every DONE user-visible item documented in the README family? | Backfill root + DEV shard; set `user_visible:` marker; run validator `--report`. |
141
+
142
+ ### Scratchpad key
143
+
144
+ - `README_FEATURE_COVERAGE_ENFORCE`: `0` \| `1` (default `0` until backfill completes).
145
+ - When `0`: `/release` step **3f** records `skipped` evidence; migration heuristic H1–H8
146
+ may classify unset `user_visible` during backfill.
147
+ - When `1`: explicit `user_visible:` required on all DONE items; heuristic disabled;
148
+ `/release` runs blocking validator.
149
+
150
+ **Activation (same commit as backfill):** complete audit + three-file backfill → explicit
151
+ `user_visible:` markers → verify `--report` shows `coverage_missing: []` → flip `0` → `1`.
152
+
153
+ ### Commands
154
+
155
+ ```bash
156
+ python scripts/validate_readme_feature_coverage.py --self-test
157
+ python scripts/validate_readme_feature_coverage.py --repo . --report
158
+ python scripts/validate_readme_feature_coverage.py --repo . --audit-out docs/engineering/context/readme-feature-coverage-audit.json
159
+ python scripts/validate_readme_feature_coverage.py --repo . --enforce
160
+ python scripts/check_intake_template_parity.py --scope=readme-feature-coverage
161
+ ```
162
+
163
+ Reason codes: `README_FEATURE_COVERAGE_BLOCKED`, `README_FEATURE_COVERAGE_GAP:<id>`,
164
+ `README_FEATURE_COVERAGE_PARITY_FAIL`, `README_FEATURE_COVERAGE_INPUT_INVALID`,
165
+ `README_FEATURE_COVERAGE_PROFILE_VIOLATION`.
166
+
167
+ Normative predicate + affinity manifest: `decisions/DEC-0074.md`,
168
+ `docs/engineering/context/readme-section-affinity.json`.
169
+
128
170
  ## User-visible internal metadata guard (US-0071 / DEC-0053)
129
171
 
130
172
  **Goal:** keep planning-shaped identifiers out of **operator-visible software
@@ -380,11 +422,10 @@ Tiered token-cost control is explicit and defaulted in `.cursor/scratchpad.md`:
380
422
 
381
423
  Deterministic profile semantics:
382
424
 
383
- - `lean`: reduce non-critical overhead defaults (for example aggressive research,
384
- autonomous loops, broad-context retrieval), while preserving mandatory
425
+ - `lean`: lowest context breadth / token cost defaults while preserving mandatory
385
426
  quality/release gates.
386
- - `balanced`: preserve current capability profile with moderate overhead.
387
- - `full`: maximize context breadth and autonomy for complex/high-uncertainty work.
427
+ - `balanced`: moderate context breadth / token cost.
428
+ - `full`: highest context breadth / token cost for complex/high-uncertainty work.
388
429
 
389
430
  Manual override precedence:
390
431
 
@@ -399,7 +440,8 @@ Manual override precedence:
399
440
  reasoning as phase input.
400
441
  - **`start-from`**: use **`/auto start-from=<canonical_phase_id>`** when resuming so the
401
442
  schedule intersection matches materialized **`resolved_phase_plan`** (**`DEC-0052`**).
402
- - **`TOKEN_PROFILE`**: `lean` lowers default automation breadth; does **not** remove
443
+ - **`TOKEN_PROFILE`**: **TOKEN_PROFILE controls context breadth / token cost only**;
444
+ does **not** change automation level, drain, outer-driver invocation, or remove
403
445
  isolation, strict-proof, role, or release gates.
404
446
  - **Metrics**: append-only **`handoffs/token_cost_runs/<orchestrator_run_id>.md`** (or
405
447
  **`.jsonl`**); copy path into **`token_cost_evidence_ref`** on **`state.md`** checkpoints.
@@ -458,8 +500,15 @@ Rollover fail-safe reason codes:
458
500
  - `STATE_ARCHIVE_VERIFICATION_FAILED`
459
501
  - `STATE_ARCHIVE_REQUIRED`
460
502
  - `ARTIFACT_HOT_SURFACE_OVERSIZE`
503
+ - `ARCH_STORY_HEADING_LEVEL_INVALID`
461
504
  - `CONTEXT_BUDGET_EXCEEDED`
462
505
 
506
+ **Architecture file blocked on rollover?** If story sections use legacy H2 `## US-xxxx`
507
+ headings, the archiver now recognizes them for rollover after **BUG-0010**. For new work,
508
+ `/architecture` must append H1 `# US-xxxx` (or `# BUG-xxxx` for defects). To converge an
509
+ existing repo, optionally normalize `## US-xxxx` → `# US-xxxx` manually (count decrease is
510
+ allowed; adding new `## US-` story headings is blocked).
511
+
463
512
  ### Minimal-read defaults by phase (bounded escalation)
464
513
 
465
514
  Read `docs/engineering/phase-context.md` first, then the **required** paths for
@@ -1317,6 +1366,79 @@ success chatter. Non-suppressible notifications:
1317
1366
  `AUTO_QUIET` is **orthogonal** to `TOKEN_PROFILE` (**DEC-0035** / **US-0080**):
1318
1367
  `TOKEN_PROFILE` controls context breadth and token cost, not notification policy.
1319
1368
 
1369
+ ### Full-autonomy outer driver (US-0092)
1370
+
1371
+ Opt-in **`AUTO_FLOW_MODE=full_autonomy`** (exact literal, default-off) enables the
1372
+ shipped stdlib outer driver. Spawn-only preserved — the driver loops hook
1373
+ invocations; it never performs phase-role work.
1374
+
1375
+ #### Enable and run (once per portfolio segment)
1376
+
1377
+ 1. Set in merged scratchpad (`.cursor/scratchpad.md` + optional local overrides):
1378
+ - `AUTO_FLOW_MODE=full_autonomy`
1379
+ - Optional: `AUTO_BACKLOG_DRAIN=1`, `AUTO_BUG_QUEUE=1` (scheduler mutex per US-0087)
1380
+ - Caps: `AUTO_LOOP_MAX_CYCLES`, `AUTO_BACKLOG_MAX_STORIES`, `AUTO_BLOCK_RETRY_MAX` (default `3`)
1381
+ - Optional: `AUTO_OUTER_DRIVER_TIMEOUT_SECONDS` (unset = no timeout)
1382
+ 2. Run once: `python scripts/auto_outer_driver.py --repo .`
1383
+ 3. Interpret exit code (driver prints reason tokens on stderr):
1384
+
1385
+ | Exit | Meaning |
1386
+ |------|---------|
1387
+ | **0** | `completed` — segment/portfolio terminal per policy |
1388
+ | **1** | Hard stop — `decision_gate`, unrecoverable `error`, isolation/strict-proof, security deny |
1389
+ | **2** | Configuration — `AUTO_FLOW_MODE` not `full_autonomy` (`AUTO_FLOW_MODE_NOT_FULL_AUTONOMY`) |
1390
+ | **3** | `loop_max` — `AUTO_LOOP_MAX_CYCLES` exhausted |
1391
+ | **4** | `BACKLOG_MAX_STORIES_REACHED` / drain cap |
1392
+ | **5** | `pause_request` / `AUTO_PAUSE_REQUEST` |
1393
+ | **6** | `BLOCK_RETRY_CAP_EXHAUSTED` |
1394
+ | **124** | Hook/subprocess timeout |
1395
+
1396
+ `--dry-run` emits planned `/auto` hook invocations and drain-advance scheduling
1397
+ without side effects. `--invoke-cmd` overrides the default normative `/auto …` line.
1398
+
1399
+ #### Security (US-0092 / DEC-0078)
1400
+
1401
+ - **No** auto-read **`.env`** or secret paths.
1402
+ - **No** intake evidence mutation under automation.
1403
+ - **No** publish without **`RELEASE_PUBLISH_MODE=auto`** (explicit opt-in; default-off).
1404
+ - Block-retry ledger **`handoffs/auto_block_retry/<orchestrator_run_id>.jsonl`** is
1405
+ names-only — no secrets, no file contents.
1406
+
1407
+ UAT self-verify: **`scripts/uat_probe_lib.py`** shared by **`/verify-work`** and **`/qa`**.
1408
+
1409
+ ### Browser UAT self-test (US-0093)
1410
+
1411
+ Enable Cursor browser-integrated UAT probes for web acceptance steps (**DEC-0079**).
1412
+
1413
+ #### Scratchpad keys
1414
+
1415
+ | Key | Values | Default | Notes |
1416
+ |-----|--------|---------|-------|
1417
+ | `UAT_BROWSER_PROBE_MODE` | `cursor` \| `http_fallback` \| `playwright_fallback` | `cursor` | Primary probe path |
1418
+ | `UAT_BROWSER_FALLBACK_CHAIN` | `0` \| `1` | `1` | HTTP → Playwright after MCP unavailable |
1419
+ | `UAT_PROCESS_HEALTH_POLL_SECONDS` | int | `60` | Readiness poll cap |
1420
+ | `UAT_PROCESS_HEALTH_POLL_INTERVAL_SECONDS` | int | `2` | Poll interval |
1421
+ | `DEV_SERVER_PORT` | int | unset | Port override |
1422
+ | `DEV_SERVER_COMMAND` | command | unset | Startup override |
1423
+
1424
+ Orthogonal to **`PERMISSION_MODE`** and Cursor browser approval modes. Health URLs from
1425
+ **`docs/engineering/runtime-connectivity.md`** first.
1426
+
1427
+ #### CI recipe
1428
+
1429
+ Set **`UAT_BROWSER_PROBE_MODE=http_fallback`** in CI — never false PASS without agent evidence.
1430
+
1431
+ #### Evidence layout
1432
+
1433
+ Binary artifacts under **`sprints/Sxxxx/evidence/browser/`** (gitignored OK). JSON carries path
1434
+ refs only. Validate agent write-back:
1435
+ `python scripts/uat_probe_lib.py --merge-result sprints/Sxxxx/evidence/browser/fragment.json`.
1436
+
1437
+ #### Manual override
1438
+
1439
+ Use **`@browser`** in Agent panel or invoke browser tools manually when MCP sequence needs operator
1440
+ approval for production-like targets.
1441
+
1320
1442
  ### Caveman mode (US-0089)
1321
1443
 
1322
1444
  Optional response-side terse / imperative assistant voice. **Default off.**
@@ -1371,6 +1493,19 @@ vocabulary inherited from **US-0088** (`decision_gate`, `error`, `pause`,
1371
1493
  `[INTAKE_EVIDENCE_VALIDATION_OK]`, `[SCRATCHPAD_PAIR_OK]`) also renders
1372
1494
  byte-literal even at `CAVEMAN_LEVEL=ultra`.
1373
1495
 
1496
+ #### Voice compression levels
1497
+
1498
+ Compact before/after examples (full contract: `.cursor/rules/caveman.mdc`):
1499
+
1500
+ | Scenario | Level | Before | After |
1501
+ |----------|-------|--------|-------|
1502
+ | Technical explain | `full` | "The spawn-only orchestrator must dispatch a fresh subagent for each phase." | "Spawn-only orchestrator dispatches fresh subagent per phase. Next: run `/execute`." |
1503
+ | Destructive warning (auto-clarity break) | (pause) | "I will run `git push --force` to fix the remote." | "Destructive: `git push --force` rewrites remote history. Confirm branch and remote before proceeding." |
1504
+
1505
+ Normative voice-compression contract (precedence, drop rules, persistence,
1506
+ 9-zone deferral): **`.cursor/rules/caveman.mdc`** — `## Voice compression
1507
+ (when CAVEMAN_MODE=1)`.
1508
+
1374
1509
  ### Caveman input compression (US-0090)
1375
1510
 
1376
1511
  Optional **input-side** file compression. **Default off.** Operator-initiated,
@@ -1518,6 +1653,17 @@ Notify operator on segment handoff (non-routine, non-suppressible).
1518
1653
  | `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 |
1519
1654
  | `BACKLOG_MAX_STORIES_REACHED` | Drain cap hit | Increase `AUTO_BACKLOG_MAX_STORIES` or run another `/auto` |
1520
1655
 
1656
+ ### Downstream CI packaging job leak (BUG-0009 / DEC-0075)
1657
+
1658
+ **CI still runs its-magic packaging jobs?** Your project received a pre-fix workflow.
1659
+ Run **`its-magic --target <repo> --mode upgrade`** (or **`--mode clean`** then reinstall)
1660
+ to refresh `.github/workflows/ci.yml` from the corrected template. After upgrade, GitHub
1661
+ Actions should show only **`checks`** and **`auto-fix`** jobs — not `npm-test`,
1662
+ `brew-test`, or `choco-test`.
1663
+
1664
+ Scope reminder: fix applies to **new installs/upgrades**; stale repos heal on next upgrade
1665
+ (**US-0018**).
1666
+
1521
1667
  ## Explicit bulk sprint planning mode (US-0046)
1522
1668
 
1523
1669
  `/sprint-plan` stays single-scope by default. Bulk planning is opt-in via