its-magic 0.1.3-2 → 0.1.3-4
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/package.json +1 -1
- package/scripts/check_intake_template_parity.py +190 -0
- package/template/.cursor/commands/auto.md +54 -4
- package/template/.cursor/commands/closure.md +184 -0
- package/template/.cursor/commands/intake.md +26 -0
- package/template/.cursor/commands/release.md +17 -26
- package/template/.cursor/scratchpad.local.example.md +636 -377
- package/template/docs/engineering/autonomy-stop-matrix.md +101 -0
- package/template/docs/engineering/context/installer-owned-paths.manifest +12 -0
- package/template/docs/engineering/runbook.md +3869 -3510
- package/template/its_magic/README.md +3981 -6
- package/template/scripts/autonomy_preset_lib.py +224 -0
- package/template/scripts/check_intake_template_parity.py +71 -0
- package/template/scripts/validate_autonomy_stop_matrix.py +486 -0
- package/template/scripts/validate_closure_verification.py +304 -0
- package/template/scripts/work_kind_classify_lib.py +543 -0
- package/template/scripts/work_kind_routing_lib.py +318 -0
- package/template/tests/__pycache__/scratchpad_example_parity_test.cpython-312-pytest-9.0.2.pyc +0 -0
- package/template/tests/scratchpad_example_parity_test.py +124 -0
- package/template/tests/us0118_contract_test.py +330 -0
- package/template/tests/us0119_autonomy_preset_test.py +168 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# Autonomy Stop Matrix (US-0119 / DEC-0119)
|
|
2
|
+
|
|
3
|
+
**Owner**: `DEC-0119` (Accepted 2026-07-05)
|
|
4
|
+
**Story**: `US-0119` — Autonomous-autonomy presets and configurable hard-stop relaxation
|
|
5
|
+
**Consumer**: `scripts/validate_autonomy_stop_matrix.py` (validator)
|
|
6
|
+
**Template parity**: `template/docs/engineering/autonomy-stop-matrix.md` (byte-identical)
|
|
7
|
+
|
|
8
|
+
## Purpose
|
|
9
|
+
|
|
10
|
+
Classifies all fail-closed reason codes into two stop classes to support `AUTONOMY_STOP_POLICY` dispatch:
|
|
11
|
+
|
|
12
|
+
- **`security_hard`**: NEVER auto-repaired under any preset/policy. Block immediately.
|
|
13
|
+
- **`autonomy_resolvable`**: Bounded auto-repair permitted when `AUTONOMY_STOP_POLICY != block`. Cap per (run, reason_code) from matrix `cap` column (default 3 per R-0107 Q3).
|
|
14
|
+
|
|
15
|
+
## Stop class rules
|
|
16
|
+
|
|
17
|
+
| Stop class | `auto_repair_kind` | `cap` | Rationale |
|
|
18
|
+
|------------|--------------------|----|-----------|
|
|
19
|
+
| `security_hard` | `n/a` (MUST) | `0` (MUST) | Security boundary — never softened |
|
|
20
|
+
| `autonomy_resolvable` | one of 9 taxonomy values (MUST) | `>= 1` or `0` for terminal stops (MUST) | Bounded repair with audit trail |
|
|
21
|
+
|
|
22
|
+
## `auto_repair_kind` taxonomy (9 values — R-0107 Q2)
|
|
23
|
+
|
|
24
|
+
| auto_repair_kind | Description |
|
|
25
|
+
|------------------|-------------|
|
|
26
|
+
| `reorder_anchors` | Sort H1s by story ID |
|
|
27
|
+
| `fix_timestamp` | Replace stale timestamp with `now()` |
|
|
28
|
+
| `truncate_hot_surface` | Archive rollover |
|
|
29
|
+
| `reset_retry_counter` | Reset to 0 |
|
|
30
|
+
| `disambiguate_state` | Pick last-known phase |
|
|
31
|
+
| `auto_refresh_brief` | Regenerate from state.md |
|
|
32
|
+
| `approve_plan_deviation` | Ledger waiver |
|
|
33
|
+
| `regenerate_isolation_evidence` | Re-run context-refresh |
|
|
34
|
+
| `skip_confirmation_gate` | Allowlist-gated skip |
|
|
35
|
+
|
|
36
|
+
## Security-hard gates (18 codes)
|
|
37
|
+
|
|
38
|
+
Reason codes that are NEVER auto-repaired. Violation of any triggers terminal `AUTONOMY_REPAIR_CAP_EXHAUSTED` escalation.
|
|
39
|
+
|
|
40
|
+
| Reason code | Rationale |
|
|
41
|
+
|-------------|-----------|
|
|
42
|
+
| `PHASE_CONTEXT_ISOLATION_VIOLATION` | Context isolation is a fundamental security boundary |
|
|
43
|
+
| `PHASE_CONTEXT_ISOLATION_MISSING` | Missing isolation evidence = untrusted context |
|
|
44
|
+
| `ISOLATION_EVIDENCE_STALE` | Stale evidence = untrusted context |
|
|
45
|
+
| `RUNTIME_PROOF_MISSING` | Proof absence = unverifiable execution |
|
|
46
|
+
| `RUNTIME_PROOF_REUSED` | Proof reuse = unverifiable execution |
|
|
47
|
+
| `RUNTIME_PROOF_STALE` | Stale proof = unverifiable execution |
|
|
48
|
+
| `RUNTIME_PROOF_AMBIGUOUS_LINK` | Ambiguous link = unverifiable execution |
|
|
49
|
+
| `PHASE_ROLE_CAPABILITY_MISSING` | Role capability is a security boundary |
|
|
50
|
+
| `PHASE_ROLE_MISMATCH` | Role mismatch is a security boundary |
|
|
51
|
+
| `PHASE_OWNERSHIP_VIOLATION` | Ownership is a security boundary |
|
|
52
|
+
| `PHASE_OVERRIDE_EVIDENCE_MISSING` | Override evidence is a security boundary |
|
|
53
|
+
| `INTAKE_BUG_ROUTING_REQUIRED` | Bug routing is a structural gate |
|
|
54
|
+
| `INTAKE_ANSWER_REF_NOT_TOPIC_DISTINCT` | Topic distinctness is a truthfulness boundary |
|
|
55
|
+
| `INTAKE_REQUIRED_TOPIC_MISSING` | Required topic absence blocks intake |
|
|
56
|
+
| `INTAKE_PERSISTENCE_BLOCKED` | Persistence failure = unreliable state |
|
|
57
|
+
| `AUTO_SCHEDULER_CONFLICT` | Scheduler conflict = unreliable sequencing |
|
|
58
|
+
| `RESUME_BRIEF_STALE` (when `RESUME_BRIEF_AUTO_REFRESH != 1`) | Stale brief = unreliable context (when auto-refresh not enabled) |
|
|
59
|
+
| `SECURITY_REVIEW_CRITICAL_FINDING` | Security review critical = security boundary |
|
|
60
|
+
|
|
61
|
+
## Autonomy-resolvable gates (9 codes)
|
|
62
|
+
|
|
63
|
+
Reason codes that may be auto-repaired when `AUTONOMY_STOP_POLICY` allows. Cap per (run, reason_code) from matrix `cap` column.
|
|
64
|
+
|
|
65
|
+
| Reason code | `auto_repair_kind` | `cap` | Rationale |
|
|
66
|
+
|-------------|---------------------|-------|-----------|
|
|
67
|
+
| `ARTIFACT_ORDERING_ANCHOR_AMBIGUOUS` | `reorder_anchors` | `3` | Sort H1s by story ID (mechanical fix) |
|
|
68
|
+
| `STATE_TIMESTAMP_NON_MONOTONIC` | `fix_timestamp` | `3` | Replace stale timestamp (mechanical fix) |
|
|
69
|
+
| `ARTIFACT_HOT_SURFACE_OVERSIZE` | `truncate_hot_surface` | `3` | Archive rollover (mechanical fix) |
|
|
70
|
+
| `BLOCK_RETRY_CAP_EXHAUSTED` | `reset_retry_counter` | `3` | Reset to 0 (ledger entry) |
|
|
71
|
+
| `STATE_PHASE_AMBIGUOUS` | `disambiguate_state` | `3` | Pick last-known phase (unambiguous selection) |
|
|
72
|
+
| `RESUME_BRIEF_MISSING` | `auto_refresh_brief` | `3` | Regenerate brief from state.md (when `RESUME_BRIEF_AUTO_REFRESH=1`) |
|
|
73
|
+
| `PLAN_FIDELITY_VIOLATION` | `approve_plan_deviation` | `3` | Ledger waiver (bounded audit trail) |
|
|
74
|
+
| `ISOLATION_EVIDENCE_INVALID` | `regenerate_isolation_evidence` | `3` | Re-run context-refresh (mechanical fix) |
|
|
75
|
+
| `RELEASE_PUBLISH_MODE` | `skip_confirmation_gate` | `3` | Allowlist-gated skip (when target in `RELEASE_TARGETS_ALLOWLIST`) |
|
|
76
|
+
|
|
77
|
+
## Terminal stop reasons
|
|
78
|
+
|
|
79
|
+
Reason codes emitted by the bounded auto-repair ledger when cap is exhausted.
|
|
80
|
+
|
|
81
|
+
| Reason code | `auto_repair_kind` | `cap` | Rationale |
|
|
82
|
+
|-------------|---------------------|-------|-----------|
|
|
83
|
+
| `AUTONOMY_REPAIR_CAP_EXHAUSTED` | `n/a` | `0` | Terminal stop — cap exhaustion escalates to operator (distinct from `BLOCK_RETRY_CAP_EXHAUSTED` per R-0107 Q9) |
|
|
84
|
+
|
|
85
|
+
## Matrix validator
|
|
86
|
+
|
|
87
|
+
`scripts/validate_autonomy_stop_matrix.py --self-test` enforces:
|
|
88
|
+
- No orphan reason codes in scripts (grep `scripts/*.py` for codes not in YAML → fail)
|
|
89
|
+
- `security_hard` rows carry `auto_repair_kind=n/a`
|
|
90
|
+
- `autonomy_resolvable` rows carry finite `cap` (default 3)
|
|
91
|
+
- Every reason code in `.cursor/commands/*.md` is in YAML (grep-based cross-check per R-0107 Q8)
|
|
92
|
+
|
|
93
|
+
Exit 0 = matrix valid. Exit non-zero = matrix invalid (list of violations on stderr).
|
|
94
|
+
|
|
95
|
+
## YAML single source of truth
|
|
96
|
+
|
|
97
|
+
`scripts/data/autonomy_stop_matrix.yaml` is the machine-readable companion. Validator reads YAML, not this markdown file. Markdown is operator-facing documentation; YAML is the contract.
|
|
98
|
+
|
|
99
|
+
## Compose guards
|
|
100
|
+
|
|
101
|
+
US-0119 composes read-only with US-0092 / US-0095 / US-0056 / US-0068 / US-0096 / BUG-0007. This matrix does NOT amend their architectural surfaces. Stop classification is additive only.
|
|
@@ -48,6 +48,13 @@ scripts/auto_outer_driver.py
|
|
|
48
48
|
scripts/uat_probe_lib.py
|
|
49
49
|
scripts/project_readme_coverage_lib.py
|
|
50
50
|
scripts/validate_project_readme_coverage.py
|
|
51
|
+
scripts/work_kind_classify_lib.py
|
|
52
|
+
scripts/work_kind_routing_lib.py
|
|
53
|
+
scripts/autonomy_preset_lib.py
|
|
54
|
+
scripts/autonomy_repair_ledger_lib.py
|
|
55
|
+
scripts/data/autonomy_stop_matrix.yaml
|
|
56
|
+
scripts/validate_closure_verification.py
|
|
57
|
+
scripts/validate_autonomy_stop_matrix.py
|
|
51
58
|
.github/workflows
|
|
52
59
|
its_magic
|
|
53
60
|
|
|
@@ -82,6 +89,9 @@ scripts/auto_outer_driver.py
|
|
|
82
89
|
scripts/uat_probe_lib.py
|
|
83
90
|
scripts/project_readme_coverage_lib.py
|
|
84
91
|
scripts/validate_project_readme_coverage.py
|
|
92
|
+
scripts/work_kind_classify_lib.py
|
|
93
|
+
scripts/work_kind_routing_lib.py
|
|
94
|
+
scripts/validate_closure_verification.py
|
|
85
95
|
.github/workflows/ci.yml
|
|
86
96
|
.github/workflows/deploy.yml
|
|
87
97
|
its_magic
|
|
@@ -102,3 +112,5 @@ scripts/remote_config_summary.py
|
|
|
102
112
|
scripts/guard_installer_publish.py
|
|
103
113
|
scripts/enforce-triad-hot-surface.py
|
|
104
114
|
scripts/caveman_compress_input.py
|
|
115
|
+
scripts/work_kind_classify_lib.py
|
|
116
|
+
scripts/work_kind_routing_lib.py
|