its-magic 0.1.3-3 → 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.
@@ -1,4 +1,4 @@
1
- # its-magic scratchpad (framework default catalog Model B / DEC-0055)
1
+ # its-magic scratchpad (framework default catalog — Model B / DEC-0055)
2
2
  #
3
3
  # Copy this file to `.cursor/scratchpad.local.md` for personal overrides (gitignored).
4
4
  # Merge precedence: local > materialized `.cursor/scratchpad.md` > this example
@@ -49,15 +49,15 @@ MAGIC_BENCH_SESSION=
49
49
  # - AUTO_EXECUTE_ON_BLOCK: stop|skip (behavior when a planned item blocks)
50
50
  # - AUTO_EXECUTE_SELECTION: planned_then_priority
51
51
  # - AUTO_TEAM_SCOPE_ENFORCE: 0|1 (when TEAM_MODE=1, enforce TEAM_MEMBER + ACTIVE_TASK_IDS)
52
- # Optional bug-queue mode (US-0087) default-off when absent/unset after merge
52
+ # Optional bug-queue mode (US-0087) — default-off when absent/unset after merge
53
53
  # - AUTO_BUG_QUEUE: 0|1 (1 = enable bug-targeted /auto; mutex vs AUTO_BACKLOG_DRAIN without bug-target argv)
54
54
  # - AUTO_BUG_TARGET: all-open|BUG-#### (required when AUTO_BUG_QUEUE=1 unless bug-target= argv supplies target)
55
55
  # - AUTO_BUG_MAX_ITEMS: non-negative integer (0 or unset = no cap for all-open queue per run)
56
56
  # - AUTO_BUG_ON_BLOCK: stop|skip (bug segment pause/stop boundary)
57
- # Quiet mode (US-0088) suppress routine per-phase success chatter only
57
+ # Quiet mode (US-0088) — suppress routine per-phase success chatter only
58
58
  # - AUTO_QUIET: 0|1 (default 0; 1 = quiet routine notifications)
59
59
  # Non-suppressible: decision_gate, errors, pause, loop_max, blocked, missing inputs.
60
- # Orthogonal to TOKEN_PROFILE (DEC-0035 / US-0080) TOKEN_PROFILE controls
60
+ # Orthogonal to TOKEN_PROFILE (DEC-0035 / US-0080) — TOKEN_PROFILE controls
61
61
  # context breadth / token cost, not notification policy.
62
62
  AUTO_QUIET=1
63
63
  AUTO_FLOW_MODE=full_autonomy
@@ -83,12 +83,14 @@ AUTO_BLOCK_RETRY_MAX=5
83
83
  # `/auto` phase role policy (US-0069 / DEC-0051)
84
84
  # - AUTO_ROLE_RESEARCH: po|tech-lead (empty -> default tech-lead)
85
85
  # - AUTO_ROLE_PLAN_VERIFY: qa|tech-lead (empty -> default qa)
86
- # - AUTO_ROLE_REFRESH_CONTEXT: curator|po (empty -> default curator)
86
+ # - AUTO_ROLE_REFRESH_CONTEXT: curator|po (empty -> default curator)
87
+ # - AUTO_ROLE_CLOSURE: qe|curator (empty -> default qe) (US-0120 / DEC-0051)
87
88
  # - AUTO_EXECUTE_ROLE_OVERRIDE: empty or allowed_non_dev_execute (execute default is dev)
88
89
  # - EXECUTE_OVERRIDE_GOVERNANCE_REF: parseable waiver pointer (DEC-xxxx / state anchor) when override set
89
90
  AUTO_ROLE_RESEARCH=
90
91
  AUTO_ROLE_PLAN_VERIFY=
91
92
  AUTO_ROLE_REFRESH_CONTEXT=
93
+ AUTO_ROLE_CLOSURE=
92
94
  AUTO_EXECUTE_ROLE_OVERRIDE=
93
95
  EXECUTE_OVERRIDE_GOVERNANCE_REF=
94
96
  #
@@ -184,6 +186,20 @@ LEAN_MEMORY_WRITE=1
184
186
  LEAN_COLD_READ_MAX_SECTIONS=4
185
187
  LEAN_STATE_INDEX_ROWS=80
186
188
  AUTO_DELIVERY_ROUTING=scratchpad_only
189
+ #
190
+ # Work-kind routing (US-0118 / DEC-0118)
191
+ # Default-off per-story work-kind classifier. When WORK_KIND_ROUTING=0,
192
+ # /auto resolve_delivery_mode step 0 + /intake step 5 skip the classifier
193
+ # entirely (zero overhead — byte-identical to pre-US-0118). When 1, the
194
+ # classifier derives (delivery_mode, phase_plan) per the L8 precedence
195
+ # chain: explicit DELIVERY_MODE > AUTO_PHASE_* > WORK_KIND_ROUTING-derived
196
+ # > current default. Merge precedence (US-0078 model B): local > baseline
197
+ # > example. Reuses scripts/dev_environment_lib.classify_touched_files.
198
+ # - WORK_KIND_ROUTING: 0|1 (default 0; absence = 0)
199
+ # - WORK_KIND_TIE_BREAK: highest_tier_wins (default; LOCKED Q1 — code > mini > doc)
200
+ WORK_KIND_ROUTING=0
201
+ WORK_KIND_TIE_BREAK=highest_tier_wins
202
+
187
203
  EARLY_RESEARCH=1
188
204
  INTAKE_GUIDED_MODE=1
189
205
  INTAKE_SUBAGENT_FALLBACK=deny
@@ -259,7 +275,7 @@ README_FEATURE_COVERAGE_ENFORCE=1
259
275
  # Project-owned root README bootstrap + per-story catalog growth.
260
276
  # - PROJECT_README_ENFORCE: 0|1 (default 1 post-bootstrap)
261
277
  # When 0, /release step 3g skips (migration/grandfathering only). When 1, blocking.
262
- # Flip 01 only after validate_project_readme_coverage.py --report shows coverage_missing: [].
278
+ # Flip 0→1 only after validate_project_readme_coverage.py --report shows coverage_missing: [].
263
279
  # - FRAMEWORK_KIT_REPO: 0|1 (default 0)
264
280
  # When 1 (its-magic dev kit repo only), skip execute 23a/23b and project validator root check.
265
281
  # Consumer repos never set FRAMEWORK_KIT_REPO=1.
@@ -271,9 +287,9 @@ FRAMEWORK_KIT_REPO=0
271
287
  # Two-tier browser probe: stdlib lib classifies + agent owns Cursor browser MCP (BUG-0006).
272
288
  # - UAT_BROWSER_PROBE_MODE: cursor|http_fallback|playwright_fallback (default cursor)
273
289
  # - cursor: agent executes MCP sequence; lib emits plan + UAT_PROBE_UNRESOLVED until evidence
274
- # - http_fallback: stdlib HTTP GET (CI recipe set this in CI)
290
+ # - http_fallback: stdlib HTTP GET (CI recipe — set this in CI)
275
291
  # - playwright_fallback: subprocess Playwright primary; HTTP fallback when missing
276
- # - UAT_BROWSER_FALLBACK_CHAIN: 0|1 (default 1; enable HTTP Playwright after MCP unavailable)
292
+ # - UAT_BROWSER_FALLBACK_CHAIN: 0|1 (default 1; enable HTTP → Playwright after MCP unavailable)
277
293
  # - UAT_PROCESS_HEALTH_POLL_SECONDS: positive int (default 60; process_health readiness cap)
278
294
  # - UAT_PROCESS_HEALTH_POLL_INTERVAL_SECONDS: positive int (default 2; poll interval)
279
295
  # - DEV_SERVER_PORT: int (optional; URL/port inference override)
@@ -289,7 +305,7 @@ DEV_SERVER_COMMAND=
289
305
 
290
306
  #
291
307
  # ## Dev environment auto-launch (US-0098 / DEC-0084)
292
- # Execute-phase bounded rebuild/relaunch + Connect surfacing distinct from US-0065 phase QA,
308
+ # Execute-phase bounded rebuild/relaunch + Connect surfacing — distinct from US-0065 phase QA,
293
309
  # US-0086 test routing, and US-0067 release hints. Orthogonal to AUTO_REMOTE_AUTOMATION_PROFILE.
294
310
  # When off, execute step 24 skipped with zero overhead.
295
311
  # - DEV_AUTO_LAUNCH_PROFILE: off|deterministic_v1 (default off)
@@ -326,37 +342,37 @@ CAVEMAN_FILE_SCOPE=
326
342
  #
327
343
  # ## Per-phase model tier selection (US-0101 / DEC-0086)
328
344
  # MODEL_TIER selects LLM model strength (which model runs).
329
- # MODEL_TIER TOKEN_PROFILE DELIVERY_MODE these are independent axes;
345
+ # MODEL_TIER ≠ TOKEN_PROFILE ≠ DELIVERY_MODE — these are independent axes;
330
346
  # none substitutes for the other (DEC-0062 / US-0080 / US-0096).
331
347
  # - MODEL_TIER_DEFAULT: cheap|balanced|strong (default balanced)
332
348
  # - MODEL_TIER_<PHASE>: cheap|balanced|strong (per-phase override; PHASE = canonical phase id)
333
349
  # Examples: MODEL_TIER_EXECUTE=cheap, MODEL_TIER_QA=strong, MODEL_TIER_RESEARCH=balanced
334
350
  # Set in .cursor/scratchpad.local.md to override per phase without touching committed defaults.
335
351
  # Default matrix (architecture-locked):
336
- # cheap ask, refresh-context, memory-audit, status-reconcile, pause
337
- # balanced intake, discovery, research, release, plan-verify
338
- # strong architecture, execute, quick, qa, verify-work, security-review
339
- # (inherit parent) auto (orchestrator always inherits parent model)
352
+ # cheap — ask, refresh-context, memory-audit, status-reconcile, pause
353
+ # balanced — intake, discovery, research, release, plan-verify
354
+ # strong — architecture, execute, quick, qa, verify-work, security-review
355
+ # (inherit parent) — auto (orchestrator always inherits parent model)
340
356
  # - MODEL_CATALOG: path to local slug catalog (default .cursor/model-catalog.local.json)
341
357
  # - MODEL_RESOLVE: alias_only|local_catalog|role_catalog (default alias_only)
342
358
  # alias_only = use Cursor-stable aliases (cheap->fast, balanced->inherit, strong->omit model:)
343
359
  # local_catalog = look up vendor model slugs from MODEL_CATALOG; requires valid JSON catalog
344
- # role_catalog = opt-in phaserolecatalog slug lookup (US-0102 / DEC-0087); falls through on miss
360
+ # role_catalog = opt-in phase→role→catalog slug lookup (US-0102 / DEC-0087); falls through on miss
345
361
  # - MODEL_FALLBACK: fallback when catalog lookup fails (default inherit)
346
362
  # - MODEL_PROVIDER_MODE: cursor|api (default cursor)
347
363
  # cursor = all subagents route through Cursor-managed infrastructure
348
- # api = operator uses BYOK via Cursor Settings Models API Key
364
+ # api = operator uses BYOK via Cursor Settings → Models → API Key
349
365
  # Known limitation: subagents do NOT inherit custom API keys/base URLs.
350
366
  #
351
367
  # Example catalogs for 4 software-complexity levels + a Cursor-only variant:
352
- # .cursor/model-catalog.local.example.json minimal placeholder template
353
- # .cursor/model-catalog.local.example.cursor-only.json only Cursor-integrated Composer models
354
- # .cursor/model-catalog.local.example.level-1-easy.json small/simple apps
355
- # .cursor/model-catalog.local.example.level-2-complex.json complex multi-service apps
356
- # .cursor/model-catalog.local.example.level-3-mega.json mega-complex / modular monoliths
357
- # .cursor/model-catalog.local.example.level-4-super.json super-high-sophisticated / mission-critical
358
- # .cursor/model-catalog.local.example.role-based-balanced.json v2 role preset (balanced)
359
- # .cursor/model-catalog.local.example.role-based-highend.json v2 role preset (high-end)
368
+ # .cursor/model-catalog.local.example.json — minimal placeholder template
369
+ # .cursor/model-catalog.local.example.cursor-only.json — only Cursor-integrated Composer models
370
+ # .cursor/model-catalog.local.example.level-1-easy.json — small/simple apps
371
+ # .cursor/model-catalog.local.example.level-2-complex.json — complex multi-service apps
372
+ # .cursor/model-catalog.local.example.level-3-mega.json — mega-complex / modular monoliths
373
+ # .cursor/model-catalog.local.example.level-4-super.json — super-high-sophisticated / mission-critical
374
+ # .cursor/model-catalog.local.example.role-based-balanced.json — v2 role preset (balanced)
375
+ # .cursor/model-catalog.local.example.role-based-highend.json — v2 role preset (high-end)
360
376
  # Copy one to .cursor/model-catalog.local.json and set MODEL_RESOLVE=local_catalog or role_catalog to activate.
361
377
  MODEL_TIER_DEFAULT=balanced
362
378
  MODEL_CATALOG=.cursor/model-catalog.local.json
@@ -365,20 +381,20 @@ MODEL_FALLBACK=inherit
365
381
  MODEL_PROVIDER_MODE=cursor
366
382
  #
367
383
  # ## Direct per-phase model slug override + role catalog (US-0102 / DEC-0087)
368
- # Composes on US-0101 / DEC-0086 tier baseline unchanged; overlays are optional.
384
+ # Composes on US-0101 / DEC-0086 — tier baseline unchanged; overlays are optional.
369
385
  # Precedence chain (deterministic, per canonical phase_id):
370
- # 1. MODEL_<PHASE> direct vendor slug override (highest priority)
371
- # 2. MODEL_TIER_<PHASE> DEC-0086 tieralias / local_catalog chain
372
- # 3. role_catalog lookup only when MODEL_RESOLVE=role_catalog; miss falls through
373
- # 4. MODEL_TIER_DEFAULT DEC-0086 tier chain
374
- # 5. Cursor stable alias DEC-0086 built-in mapping (fast / inherit / omit)
386
+ # 1. MODEL_<PHASE> — direct vendor slug override (highest priority)
387
+ # 2. MODEL_TIER_<PHASE> — DEC-0086 tier→alias / local_catalog chain
388
+ # 3. role_catalog lookup — only when MODEL_RESOLVE=role_catalog; miss falls through
389
+ # 4. MODEL_TIER_DEFAULT — DEC-0086 tier chain
390
+ # 5. Cursor stable alias — DEC-0086 built-in mapping (fast / inherit / omit)
375
391
  # Scratchpad merge precedence for all MODEL_* keys: MODEL_<PHASE> > MODEL_TIER_<PHASE> > MODEL_TIER_DEFAULT
376
392
  # - MODEL_<PHASE>: direct vendor slug; <PHASE> = canonical phase id (same list as MODEL_TIER_<PHASE>)
377
- # Set in .cursor/scratchpad.local.md only use <your-vendor-slug> placeholders in committed files.
393
+ # Set in .cursor/scratchpad.local.md only — use <your-vendor-slug> placeholders in committed files.
378
394
  # Canonical phase ids: ask, refresh-context, memory-audit, status-reconcile, pause,
379
395
  # intake, discovery, research, release, plan-verify, architecture, execute, quick,
380
396
  # qa, verify-work, security-review, auto
381
- # Examples (placeholders replace in scratchpad.local.md):
397
+ # Examples (placeholders — replace in scratchpad.local.md):
382
398
  # MODEL_ASK=<your-vendor-slug>
383
399
  # MODEL_EXECUTE=<your-vendor-slug>
384
400
  # MODEL_QA=<your-vendor-slug>
@@ -386,10 +402,10 @@ MODEL_PROVIDER_MODE=cursor
386
402
  # MODEL_ASK participates in step 1 like any other phase (no special-case bypass).
387
403
  #
388
404
  # AI Decision Ledger + Plan Fidelity (US-0103 / DEC-0103)
389
- # Sovereign-loop foundation. Default-off zero overhead when AI_DECISION_LEDGER=0.
390
- # - AI_DECISION_LEDGER: 0|1 (default 0) when 0: no ledger reads/writes/schema checks.
391
- # - AUTO_PLAN_FIDELITY: strict|relaxed|extended (default strict) active only when ledger enabled.
392
- # strict = any unapproved drop/reorder/scope-add PLAN_FIDELITY_VIOLATION hard stop
405
+ # Sovereign-loop foundation. Default-off — zero overhead when AI_DECISION_LEDGER=0.
406
+ # - AI_DECISION_LEDGER: 0|1 (default 0) — when 0: no ledger reads/writes/schema checks.
407
+ # - AUTO_PLAN_FIDELITY: strict|relaxed|extended (default strict) — active only when ledger enabled.
408
+ # strict = any unapproved drop/reorder/scope-add → PLAN_FIDELITY_VIOLATION hard stop
393
409
  # relaxed = drop/reorder allowed (ledger entry); scope-add still hard stop
394
410
  # extended = scope-add allowed (extension report); drop/reorder allowed
395
411
  AI_DECISION_LEDGER=0
@@ -397,7 +413,7 @@ AUTO_PLAN_FIDELITY=strict
397
413
  #
398
414
  # Goal-Based Convergence (US-0110 / DEC-0110)
399
415
  # Default-off sovereign-loop terminal predicate. When SOVEREIGN_GOAL_MODE=phase_driven,
400
- # zero overhead no evaluation, no goal_progress block, no partial-delivery write.
416
+ # zero overhead — no evaluation, no goal_progress block, no partial-delivery write.
401
417
  # Compose do NOT amend US-0088 / US-0092 / US-0095 / US-0044 / US-0103 (read-only surfaces).
402
418
  # - SOVEREIGN_GOAL_MODE: phase_driven|goal_convergence (default phase_driven)
403
419
  # - SOVEREIGN_GOAL: explicit goal text (wins over vision auto-derive; default empty)
@@ -411,7 +427,7 @@ SOVEREIGN_GOAL_MAX_CHARS=512
411
427
  SOVEREIGN_GOAL_TIMEOUT_MAX=0
412
428
  #
413
429
  # Cross-Model Adversarial Critic (US-0104 / DEC-0104)
414
- # Default-off cross-model review. When CROSS_MODEL_REVIEW=0, zero overhead no critic
430
+ # Default-off cross-model review. When CROSS_MODEL_REVIEW=0, zero overhead — no critic
415
431
  # spawn, no findings writes, no anti-slop gate. Compose do NOT amend US-0048 / US-0069 /
416
432
  # US-0023 / US-0110 / US-0103 (additive surfaces only).
417
433
  # - CROSS_MODEL_REVIEW: 0|1 (default 0)
@@ -422,14 +438,14 @@ CROSS_MODEL_ANTISLOP_THRESHOLD=6
422
438
  CROSS_MODEL_REWORK_MAX=2
423
439
  #
424
440
  # Sovereign Memory (US-0105 / DEC-0105)
425
- # Default-off institutional memory. When SOVEREIGN_MEMORY=0, zero overhead
441
+ # Default-off institutional memory. When SOVEREIGN_MEMORY=0, zero overhead —
426
442
  # no JSONL writes, no injection reads, no spawn digest assembly.
427
443
  # Compose do NOT amend US-0029 / US-0080 / US-0103 / US-0072 / US-0096.
428
444
  # - SOVEREIGN_MEMORY: 0|1 (default 0)
429
- # - SOVEREIGN_MEMORY_TOP_N: int >= 0 (default 5) global recent pool (all four JSONL families)
430
- # - SOVEREIGN_MEMORY_TOP_K: int >= 0 (default 3) high-impact pool (patterns + mistakes only)
431
- # - SOVEREIGN_MEMORY_MAX_CHARS: int >= 0 (default 2048) hard cap on assembled digest_text
432
- # - SOVEREIGN_MEMORY_JSONL_MAX_LINES: int >= 1 (default 500) active JSONL line cap before archive rollover
445
+ # - SOVEREIGN_MEMORY_TOP_N: int >= 0 (default 5) — global recent pool (all four JSONL families)
446
+ # - SOVEREIGN_MEMORY_TOP_K: int >= 0 (default 3) — high-impact pool (patterns + mistakes only)
447
+ # - SOVEREIGN_MEMORY_MAX_CHARS: int >= 0 (default 2048) — hard cap on assembled digest_text
448
+ # - SOVEREIGN_MEMORY_JSONL_MAX_LINES: int >= 1 (default 500) — active JSONL line cap before archive rollover
433
449
  SOVEREIGN_MEMORY=0
434
450
  SOVEREIGN_MEMORY_TOP_N=5
435
451
  SOVEREIGN_MEMORY_TOP_K=3
@@ -437,19 +453,19 @@ SOVEREIGN_MEMORY_MAX_CHARS=2048
437
453
  SOVEREIGN_MEMORY_JSONL_MAX_LINES=500
438
454
  #
439
455
  # Sovereign Loop Mode (US-0107 / DEC-0107)
440
- # Default-off project orchestration. When AUTO_SOVEREIGN=0, zero overhead no deferral
456
+ # Default-off project orchestration. When AUTO_SOVEREIGN=0, zero overhead — no deferral
441
457
  # reads/writes, no advance, no notifications. Requires SOVEREIGN_GOAL_MODE=goal_convergence
442
458
  # when enabled (fail-closed SOVEREIGN_LOOP_GOAL_MODE_REQUIRED). Compose do NOT amend
443
459
  # US-0088 / US-0092 / US-0095 / US-0044 / US-0103 / US-0105 / US-0110 (additive hooks only).
444
460
  # - AUTO_SOVEREIGN: 0|1 (default 0)
445
- # - AUTO_SOVEREIGN_DEFERRAL_MAX: int >= 1 (default 50) max open deferral rows
446
- # - AUTO_SOVEREIGN_DRAIN_GENERATE_MAX: int >= 0 (default 3) drain-generate iterations per run
461
+ # - AUTO_SOVEREIGN_DEFERRAL_MAX: int >= 1 (default 50) — max open deferral rows
462
+ # - AUTO_SOVEREIGN_DRAIN_GENERATE_MAX: int >= 0 (default 3) — drain-generate iterations per run
447
463
  # - AUTO_SOVEREIGN_DEFERRAL_POLICY: stop|skip|resolve_first (default resolve_first)
448
464
  # - SOVEREIGN_NOTIFY_TARGET: off|ntfy|email|hook (default off)
449
- # - SOVEREIGN_NOTIFY_NTFY_TOPIC: string (default empty local-only)
450
- # - SOVEREIGN_NOTIFY_NTFY_BASE: URL (default empty local-only ntfy base override)
451
- # - SOVEREIGN_NOTIFY_HOOK_URL: URL (default empty local-only webhook)
452
- # - SOVEREIGN_NOTIFY_EMAIL_TO: email (default empty email v1 deferred)
465
+ # - SOVEREIGN_NOTIFY_NTFY_TOPIC: string (default empty — local-only)
466
+ # - SOVEREIGN_NOTIFY_NTFY_BASE: URL (default empty — local-only ntfy base override)
467
+ # - SOVEREIGN_NOTIFY_HOOK_URL: URL (default empty — local-only webhook)
468
+ # - SOVEREIGN_NOTIFY_EMAIL_TO: email (default empty — email v1 deferred)
453
469
  AUTO_SOVEREIGN=0
454
470
  AUTO_SOVEREIGN_DEFERRAL_MAX=50
455
471
  AUTO_SOVEREIGN_DRAIN_GENERATE_MAX=3
@@ -462,14 +478,14 @@ SOVEREIGN_NOTIFY_EMAIL_TO=
462
478
  #
463
479
  # Sovereign Role-Behavior Manifest (US-0106 / DEC-0106)
464
480
  # Default-off per-role objective + inter-role review obligations. When SOVEREIGN_ROLE_MANIFEST=0,
465
- # zero overhead no manifest reads, no objective injection, no review dispatch.
466
- # Compose do NOT amend US-0069 (phaserole matrix unchanged; review spawns supplementary),
481
+ # zero overhead — no manifest reads, no objective injection, no review dispatch.
482
+ # Compose do NOT amend US-0069 (phase→role matrix unchanged; review spawns supplementary),
467
483
  # US-0104 (critic lenses + findings schema unchanged; role reviews additive),
468
484
  # US-0003 / US-0023 / US-0103 / US-0105 / US-0107 (unchanged surfaces).
469
485
  # - SOVEREIGN_ROLE_MANIFEST: 0|1 (default 0)
470
- # - SOVEREIGN_ROLE_OBJECTIVE_MAX_CHARS: int >= 1 (default 512) hard truncate for injection
471
- # - SOVEREIGN_ROLE_REVIEW_MAX_PER_PHASE: int >= 0 (default 2) per-phase review cap
472
- # - SOVEREIGN_ROLE_REVIEW_REWORK_MAX: int >= 0 (default 1) bounded rework before decision gate
486
+ # - SOVEREIGN_ROLE_OBJECTIVE_MAX_CHARS: int >= 1 (default 512) — hard truncate for injection
487
+ # - SOVEREIGN_ROLE_REVIEW_MAX_PER_PHASE: int >= 0 (default 2) — per-phase review cap
488
+ # - SOVEREIGN_ROLE_REVIEW_REWORK_MAX: int >= 0 (default 1) — bounded rework before decision gate
473
489
  SOVEREIGN_ROLE_MANIFEST=0
474
490
  SOVEREIGN_ROLE_OBJECTIVE_MAX_CHARS=512
475
491
  SOVEREIGN_ROLE_REVIEW_MAX_PER_PHASE=2
@@ -477,20 +493,20 @@ SOVEREIGN_ROLE_REVIEW_REWORK_MAX=1
477
493
  #
478
494
  # Parallel Instance Arbitrage (US-0108 / DEC-0108)
479
495
  # Default-off parallel execute-phase instance orchestration. When SOVEREIGN_PARALLEL_DEV=0,
480
- # zero overhead no worktrees, no parallel QA, no pick JSON, no resource guard.
496
+ # zero overhead — no worktrees, no parallel QA, no pick JSON, no resource guard.
481
497
  # Compose do NOT amend US-0047 (bulk execute unchanged), US-0092 (full autonomy unchanged),
482
498
  # US-0103 (ledger schema unchanged; read-only consumer), US-0104 (critic schema unchanged;
483
499
  # read-only anti_slop_score consumer), US-0107 (sovereign loop unchanged; consumer only).
484
- # - SOVEREIGN_PARALLEL_DEV: 0|1 (default 0) global enable gate
485
- # - AUTO_SOVEREIGN_PARALLEL_N: int >= 1 (default 3) instances per execute cycle
486
- # - AUTO_SOVEREIGN_PARALLEL_MAX_TOTAL: int >= 1 (default 6) system-wide instance cap
500
+ # - SOVEREIGN_PARALLEL_DEV: 0|1 (default 0) — global enable gate
501
+ # - AUTO_SOVEREIGN_PARALLEL_N: int >= 1 (default 3) — instances per execute cycle
502
+ # - AUTO_SOVEREIGN_PARALLEL_MAX_TOTAL: int >= 1 (default 6) — system-wide instance cap
487
503
  # - AUTO_SOVEREIGN_MERGE_RESOLVE: first_pass_wins|last_pass_wins|winner_takes_all|manual (default first_pass_wins)
488
- # - AUTO_SOVEREIGN_WORKTREE_KEEP: 0|1 (default 0) retain loser worktrees for debugging
489
- # - AUTO_SOVEREIGN_PARALLEL_QA: 0|1 (default 0) enable parallel QA cross-review (v2)
504
+ # - AUTO_SOVEREIGN_WORKTREE_KEEP: 0|1 (default 0) — retain loser worktrees for debugging
505
+ # - AUTO_SOVEREIGN_PARALLEL_QA: 0|1 (default 0) — enable parallel QA cross-review (v2)
490
506
  # - AUTO_SOVEREIGN_PARALLEL_QA_ARBITER: critic_first_pass|majority_vote (default critic_first_pass)
491
- # - AUTO_SOVEREIGN_PARALLEL_ANTI_SLOP_THRESHOLD: int 0-10 (default 6) anti-slop floor
492
- # - AUTO_SOVEREIGN_PARALLEL_REWORK_MAX: int >= 0 (default 2) per-instance rework cap
493
- # - AUTO_SOVEREIGN_PARALLEL_MERGE_TIMEOUT_SEC: int >= 10 (default 60) merge timeout
507
+ # - AUTO_SOVEREIGN_PARALLEL_ANTI_SLOP_THRESHOLD: int 0-10 (default 6) — anti-slop floor
508
+ # - AUTO_SOVEREIGN_PARALLEL_REWORK_MAX: int >= 0 (default 2) — per-instance rework cap
509
+ # - AUTO_SOVEREIGN_PARALLEL_MERGE_TIMEOUT_SEC: int >= 10 (default 60) — merge timeout
494
510
  # - AUTO_SOVEREIGN_PARALLEL_MODEL_<idx>: model slug per instance (optional)
495
511
  # - AUTO_SOVEREIGN_PARALLEL_LENS_<idx>: lens config per instance (optional)
496
512
  SOVEREIGN_PARALLEL_DEV=0
@@ -506,16 +522,16 @@ AUTO_SOVEREIGN_PARALLEL_MERGE_TIMEOUT_SEC=60
506
522
  #
507
523
  # Self-Healing Deploy Loop (US-0109 / DEC-0109)
508
524
  # Default-off auto-heal post-publish probe + bounded retry + DEPLOY_DEFERRED.
509
- # When AUTO_SOVEREIGN_SELF_HEALING_DEPLOY=0 zero overhead, byte-identical US-0054 publish path
525
+ # When AUTO_SOVEREIGN_SELF_HEALING_DEPLOY=0 zero overhead, byte-identical US-0054 publish path —
510
526
  # no probe, no retry, no deferral, no execute steps 29-31. Compose do NOT amend US-0054 / US-0100 /
511
527
  # US-0103 / US-0107 / US-0110 (US-0109 consumer-only hook after US-0054 publish PASS).
512
- # - AUTO_SOVEREIGN_SELF_HEALING_DEPLOY: 0|1 (default 0) global gate
513
- # - AUTO_SOVEREIGN_DEPLOY_RETRY_MAX: int >= 1 (default 3) max retry attempts after probe FAIL
514
- # - AUTO_SOVEREIGN_DEPLOY_SMOKE_TIMEOUT_SEC: int >= 1 (default 30) per-stage probe HTTP timeout
528
+ # - AUTO_SOVEREIGN_SELF_HEALING_DEPLOY: 0|1 (default 0) — global gate
529
+ # - AUTO_SOVEREIGN_DEPLOY_RETRY_MAX: int >= 1 (default 3) — max retry attempts after probe FAIL
530
+ # - AUTO_SOVEREIGN_DEPLOY_SMOKE_TIMEOUT_SEC: int >= 1 (default 30) — per-stage probe HTTP timeout
515
531
  # - AUTO_SOVEREIGN_DEPLOY_PROBE_KIND: health_endpoint|acceptance_smoke|both (default both)
516
532
  # - SOVEREIGN_DEPLOY_ACCEPTANCE_SMOKE_PATH: repo-relative path (default tests/deploy_smoke/)
517
533
  # - AUTO_SOVEREIGN_DEPLOY_HEALTH_ENDPOINT: names-only env ref (US-0085 compose); empty = unresolvable
518
- # Reason codes (DEC-0109 §7): DEPLOY_HEALING_DISABLED (info), DEPLOY_HEALING_SMOKE_HEALTH_FAIL,
534
+ # Reason codes (DEC-0109 §7): DEPLOY_HEALING_DISABLED (info), DEPLOY_HEALING_SMOKE_HEALTH_FAIL,
519
535
  # DEPLOY_HEALING_SMOKE_ACCEPTANCE_FAIL, DEPLOY_HEALING_RETRY_ATTEMPT,
520
536
  # DEPLOY_HEALING_RETRY_CAP_EXHAUSTED, DEPLOY_HEALING_DEFERRED,
521
537
  # DEPLOY_HEALING_PROBE_TARGET_MISSING, DEPLOY_HEALING_TIMEOUT.
@@ -529,7 +545,7 @@ AUTO_SOVEREIGN_DEPLOY_HEALTH_ENDPOINT=
529
545
  # Release Trigger Adapters (US-0111 / DEC-0111)
530
546
  # Dispatch release flow by trigger source (GitHub webhook, npm publish, Git tag
531
547
  # push, manual /release). Default source is manual (zero behavior change vs
532
- # pre-US-0111 /release path byte-identical). Compose with US-0100; reuses
548
+ # pre-US-0111 /release path — byte-identical). Compose with US-0100; reuses
533
549
  # release_changelog_lib APIs without modification.
534
550
  # - RELEASE_TRIGGER_SOURCE: manual|github|npm|git_tag|auto (default manual)
535
551
  # - RELEASE_TRIGGER_TIMEOUT_SEC: int >= 1 (default 10; adapter subprocess timeout)
@@ -537,3 +553,85 @@ AUTO_SOVEREIGN_DEPLOY_HEALTH_ENDPOINT=
537
553
  RELEASE_TRIGGER_SOURCE=manual
538
554
  RELEASE_TRIGGER_TIMEOUT_SEC=10
539
555
  RELEASE_TRIGGER_FALLBACK_TO_LOCAL=0
556
+ #
557
+ # Autonomy presets (US-0119 / DEC-0119)
558
+ # Configurable autonomy presets and per-feature autonomy flags.
559
+ # Default-off; byte-identical pre-US-0119 when AUTONOMY_PRESET=none.
560
+ #
561
+ # Merge precedence (LOCKED):
562
+ # 1. Explicit per-flag value (in scratchpad or scratchpad.local)
563
+ # 2. AUTONOMY_PRESET expansion (via scripts/autonomy_preset_lib.py)
564
+ # 3. Scratchpad defaults (this file)
565
+ #
566
+ # AUTONOMY_PRESET: none|balanced|full (default=none)
567
+ # none: empty {} — byte-identical pre-US-0119
568
+ # balanced: 8 flags — moderate autonomy
569
+ # full: 12 flags — maximum autonomy (superset of balanced)
570
+ #
571
+ # AUTONOMY_STOP_POLICY: block|auto_repair_then_block|auto_repair_then_skip (default=block)
572
+ # block: all fail-closed codes block (pre-US-0119 behavior)
573
+ # auto_repair_then_block: autonomy_resolvable codes get bounded repair; cap exhaustion -> BLOCK
574
+ # auto_repair_then_skip: autonomy_resolvable codes get bounded repair; cap exhaustion -> SKIP
575
+ #
576
+ # Per-feature autonomy flags (12 total — DEC-0119 §7):
577
+ #
578
+ # INTAKE_AUTONOMY_MODE: 0|1 (default=0)
579
+ # balanced: OFF | full: ON
580
+ # Auto-derives intake answers on known-stack repeat projects (US-0068 compose).
581
+ #
582
+ # INTAKE_MINIMAL_PACK: 0|1 (default=0)
583
+ # balanced: OFF | full: ON
584
+ # Shrinks follow-up intake on established projects (Q7: MAX_US_ID >= US-0100 AND STACK_KNOWN = true).
585
+ #
586
+ # INTAKE_ASSUME_STACK_CONTEXT: 0|1 (default=0)
587
+ # balanced: OFF | full: ON
588
+ # Auto-fills stack/runtime from backlog history with assumption_confirmation_ref contract (BUG-0007 compose).
589
+ #
590
+ # WORK_KIND_AUTO_ACCEPT: 0|1 (default=0)
591
+ # balanced: ON | full: ON
592
+ # Auto-accepts classifier output when WORK_KIND_ROUTING=1.
593
+ #
594
+ # CROSS_MODEL_REWORK_EXHAUSTED_POLICY: block|downgrade (default=block)
595
+ # balanced: downgrade | full: downgrade
596
+ # Converts decision gate to warning when critic rework cap exhausted (US-0104 compose).
597
+ #
598
+ # CROSS_MODEL_SKIP_PHASES: csv (default=empty)
599
+ # balanced: empty | full: empty
600
+ # Skips critic for low-risk phases (e.g., refresh-context,release) (US-0104 compose).
601
+ #
602
+ # RESUME_BRIEF_AUTO_REFRESH: 0|1 (default=0)
603
+ # balanced: ON | full: ON
604
+ # Auto-refreshes stale brief; RESUME_BRIEF_STALE becomes autonomy_resolvable when ON.
605
+ #
606
+ # RUNTIME_PROOF_KIND: strict|lightweight (default=strict)
607
+ # balanced: lightweight | full: lightweight
608
+ # Counter+timestamp attestation instead of SHA-256; TTL unchanged (Q4: 3600s) (US-0056 compose).
609
+ #
610
+ # GOAL_CONVERGENCE_INTERVAL: int >= 1 (default=3)
611
+ # balanced: 3 | full: 1
612
+ # Evaluates goal every N phases (3 = balanced cadence; 1 = every phase) (US-0107 compose).
613
+ #
614
+ # SOVEREIGN_DRAIN_AUTO_ACCEPT: 0|1 (default=0)
615
+ # balanced: ON | full: ON
616
+ # Auto-accepts drain candidates below medium risk tier (Q5) (US-0107 compose).
617
+ #
618
+ # RELEASE_PUBLISH_AUTO_CONFIRM: 0|1 (default=0)
619
+ # balanced: OFF | full: OFF
620
+ # Auto-confirms publish targets when in RELEASE_TARGETS_ALLOWLIST (Q6) (US-0054 compose).
621
+ #
622
+ # AUTONOMY_REPAIR_CAP_OVERRIDE: int >= 1 or empty (default=empty)
623
+ # Operator override for per-run repair cap (empty = use matrix default cap=3 per DEC-0119 §5).
624
+ AUTONOMY_PRESET=none
625
+ AUTONOMY_STOP_POLICY=block
626
+ INTAKE_AUTONOMY_MODE=0
627
+ INTAKE_MINIMAL_PACK=0
628
+ INTAKE_ASSUME_STACK_CONTEXT=0
629
+ WORK_KIND_AUTO_ACCEPT=0
630
+ CROSS_MODEL_REWORK_EXHAUSTED_POLICY=block
631
+ CROSS_MODEL_SKIP_PHASES=
632
+ RESUME_BRIEF_AUTO_REFRESH=0
633
+ RUNTIME_PROOF_KIND=strict
634
+ GOAL_CONVERGENCE_INTERVAL=3
635
+ SOVEREIGN_DRAIN_AUTO_ACCEPT=0
636
+ RELEASE_PUBLISH_AUTO_CONFIRM=0
637
+ AUTONOMY_REPAIR_CAP_OVERRIDE=
@@ -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