@event4u/agent-config 14.2.0 → 14.5.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 (117) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +33 -252
  3. package/agents/templates/.ai-council.yml.example +35 -0
  4. package/dist/agent-src/contexts/execution/roadmap-process-loop.md +83 -12
  5. package/dist/agent-src/rules/roadmap-progress-sync.md +48 -4
  6. package/dist/agent-src/scripts/resume_probe.ts +154 -9
  7. package/dist/agent-src/scripts/roadmap_gates.ts +210 -6
  8. package/dist/agent-src/skills/roadmap-management/SKILL.md +9 -4
  9. package/dist/agent-src/templates/agent-settings.md +70 -0
  10. package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
  11. package/dist/agent-src/templates/scripts/telemetry/remote.ts +571 -0
  12. package/dist/agent-src/templates/scripts/telemetry/settings.ts +222 -44
  13. package/dist/cli/python/workspace_drive.js +8 -3
  14. package/dist/cli/python/workspace_drive.js.map +1 -1
  15. package/dist/cli/python/workspace_hosts.js +16 -12
  16. package/dist/cli/python/workspace_hosts.js.map +1 -1
  17. package/dist/cli/registry.js +2 -0
  18. package/dist/cli/registry.js.map +1 -1
  19. package/dist/cli-delegate/{chunk-F3YUF7SA.js → chunk-3UCJWMMP.js} +1 -1
  20. package/dist/cli-delegate/chunk-F7DQWYR5.js +69 -0
  21. package/dist/cli-delegate/{chunk-7PZ4FSZB.js → chunk-FBKL6JWT.js} +61 -2
  22. package/dist/cli-delegate/{chunk-MNWRDMR5.js → chunk-PKOBQADP.js} +1 -1
  23. package/dist/cli-delegate/cmd_conformance.js +26 -11
  24. package/dist/cli-delegate/cmd_doctor.js +2 -2
  25. package/dist/cli-delegate/cmd_handoff.js +3 -3
  26. package/dist/cli-delegate/cmd_route_audit.js +2 -2
  27. package/dist/cli-delegate/cmd_settings_set.js +17 -3
  28. package/dist/discovery/deprecation-report.md +1 -1
  29. package/dist/discovery/discovery-manifest.json +4 -4
  30. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  31. package/dist/discovery/discovery-manifest.summary.md +1 -1
  32. package/dist/discovery/dormancy-report.md +1 -1
  33. package/dist/discovery/orphan-report.md +1 -1
  34. package/dist/discovery/packs.json +2 -2
  35. package/dist/discovery/trust-report.md +1 -1
  36. package/dist/discovery/workspaces.json +2 -2
  37. package/dist/hooks/dispatch.js +3754 -1721
  38. package/dist/mcp/registry-manifest.json +2 -2
  39. package/dist/mcp/server.json +2 -2
  40. package/dist/mcp/server.mjs +1070 -408
  41. package/dist/scripts/_lib/host_launch.js +66 -0
  42. package/dist/scripts/_lib/host_launch.js.map +1 -0
  43. package/dist/server/io/yamlIO.js +175 -3
  44. package/dist/server/io/yamlIO.js.map +1 -1
  45. package/dist/server/routes/wizard.js +20 -1
  46. package/dist/server/routes/wizard.js.map +1 -1
  47. package/dist/shared/settingsConsent.js +25 -0
  48. package/dist/shared/settingsConsent.js.map +1 -1
  49. package/docs/contracts/settings-classes.md +11 -0
  50. package/docs/guidelines/agent-infra/roadmap-progress-mechanics.md +2 -1
  51. package/package.json +1 -1
  52. package/src/agent-src/scripts/resume_probe.ts +154 -9
  53. package/src/agent-src/scripts/roadmap_gates.ts +210 -6
  54. package/src/agent-src/templates/scripts/telemetry/remote.ts +571 -0
  55. package/src/agent-src/templates/scripts/telemetry/settings.ts +222 -44
  56. package/src/config/estate-count-budget.json +127 -0
  57. package/src/config/evaluator-budgets.json +4 -4
  58. package/src/config/gate-coverage.yml +32 -4
  59. package/src/config/gate-violation-baselines.json +63 -63
  60. package/src/config/gitignore-block.txt +5 -0
  61. package/src/config/hook-latency-budget.json +40 -1
  62. package/src/config/hook-token-budget.json +16 -0
  63. package/src/config/rule-stub-ceilings.json +11 -3
  64. package/src/scripts/_dispatch.bash +42 -1
  65. package/src/scripts/_lib/council_fallback_posture.ts +81 -0
  66. package/src/scripts/_lib/council_fallback_wiring.ts +126 -0
  67. package/src/scripts/_lib/council_settings_block.ts +152 -0
  68. package/src/scripts/_lib/headless_invocation.ts +285 -0
  69. package/src/scripts/_lib/host_launch.ts +72 -0
  70. package/src/scripts/_lib/map_to_object.ts +16 -0
  71. package/src/scripts/_lib/roadmap_checkboxes.ts +88 -0
  72. package/src/scripts/_lib/run_checkpoint.ts +409 -0
  73. package/src/scripts/_lib/session_register.ts +32 -1
  74. package/src/scripts/_lib/stdin.ts +35 -1
  75. package/src/scripts/_lib/turn_end_refusals.ts +12 -4
  76. package/src/scripts/_lib/unattended_guard.ts +371 -0
  77. package/src/scripts/ai_council/config.ts +27 -1
  78. package/src/scripts/ai_council/events_log.ts +12 -1
  79. package/src/scripts/ai_council/fallback_config.ts +114 -0
  80. package/src/scripts/ai_council/mid_flight_fallback.ts +295 -0
  81. package/src/scripts/ai_council/orchestrator.ts +251 -292
  82. package/src/scripts/ai_council/py_parity.ts +139 -0
  83. package/src/scripts/ai_council/response_render.ts +99 -0
  84. package/src/scripts/ai_council/spend_gate.ts +123 -0
  85. package/src/scripts/ai_council/transport_resolver.ts +81 -13
  86. package/src/scripts/bench_hook_injection.ts +118 -7
  87. package/src/scripts/bench_hook_latency.ts +442 -16
  88. package/src/scripts/check_estate_count.ts +924 -0
  89. package/src/scripts/compile_hook_manifest.ts +67 -0
  90. package/src/scripts/council_cli.ts +100 -125
  91. package/src/scripts/decision_memo.ts +325 -0
  92. package/src/scripts/hook_manifest.json +1 -0
  93. package/src/scripts/hook_manifest.yaml +172 -25
  94. package/src/scripts/hooks/concern_registry.ts +6 -0
  95. package/src/scripts/hooks/dispatch_hook.ts +183 -10
  96. package/src/scripts/hooks/dispatch_issues.ts +26 -0
  97. package/src/scripts/hooks/end_review_nudge_hook.ts +97 -24
  98. package/src/scripts/hooks/hook_stdin.ts +111 -5
  99. package/src/scripts/hooks/host_semantics.ts +28 -0
  100. package/src/scripts/hooks/injection_budget.ts +731 -0
  101. package/src/scripts/hooks/payload_stub.ts +446 -0
  102. package/src/scripts/hooks/run_continuation_hook.ts +683 -0
  103. package/src/scripts/hooks/session_eol_hook.ts +52 -0
  104. package/src/scripts/hooks/telemetry_usage_hook.ts +339 -0
  105. package/src/scripts/hooks/tool_result_bytes_hook.ts +27 -0
  106. package/src/scripts/hooks/turn_end_gate_hook.ts +45 -7
  107. package/src/scripts/hooks_doctor.ts +16 -2
  108. package/src/scripts/interruption_report.ts +330 -13
  109. package/src/scripts/lint_hook_manifest.ts +167 -0
  110. package/src/scripts/roadmap_progress_hook.ts +254 -46
  111. package/src/scripts/run_supervise.ts +623 -0
  112. package/src/scripts/session_register_hook.ts +146 -12
  113. package/src/scripts/sessions_cli.ts +18 -6
  114. package/src/scripts/telemetry_disclosure_hook.ts +244 -0
  115. package/src/server/io/yamlIO.ts +167 -3
  116. package/src/shared/settingsConsent.ts +49 -2
  117. package/dist/cli-delegate/chunk-MMJL4TIX.js +0 -18
@@ -19,6 +19,7 @@ concerns:
19
19
  args: [hook-dispatch]
20
20
  fail_closed: false
21
21
  severity: advisory
22
+ needs_payload_bodies: [result]
22
23
  # Hot-context working-memory cache (road-to-second-brain Phase 1).
23
24
  # stop: deterministic, redacted 400-word overwrite of
24
25
  # agents/runtime/state/hot-context.md from the chat-history JSONL.
@@ -43,11 +44,30 @@ concerns:
43
44
  args: []
44
45
  fail_closed: false
45
46
  severity: advisory
47
+ # Debounced since road-to-per-turn-hook-economy step 3.1 (D-3). It used to
48
+ # re-shell the dashboard regenerator through tsx on EVERY roadmap write — a
49
+ # cold tsx start per write, in exactly the roadmap-heavy workflow this repo
50
+ # runs. It now APPENDS the touched repo roots to a ledger on post_tool_use and
51
+ # regenerates ONCE from `stop` / `session_end`, which is why it is bound on
52
+ # three slots rather than one.
53
+ #
54
+ # The two extra bindings are paid for, not free additions to a capped chain:
55
+ # they REPLACE an unbounded number of per-write spawns with one per turn, and
56
+ # the flush path costs a read of one small JSON file when nothing is dirty.
57
+ # No flush binding on windsurf, deliberately — it has no post_tool_use surface,
58
+ # so nothing there ever marks the ledger.
59
+ #
60
+ # The ledger lives under `--project-dir`, not beside the edited file: a touched
61
+ # root may be a sibling worktree and `stop` carries no roadmap path, so a
62
+ # marker written at the target would be unfindable at flush time. A ledger that
63
+ # cannot be written makes the hook regenerate inline, so a broken state
64
+ # directory costs latency rather than a silently stale dashboard.
46
65
  roadmap-progress:
47
66
  script: src/scripts/roadmap_progress_hook.ts
48
67
  args: []
49
68
  fail_closed: false
50
69
  severity: advisory
70
+ needs_payload_bodies: [input]
51
71
  onboarding-gate:
52
72
  script: src/scripts/onboarding_gate_hook.ts
53
73
  args: []
@@ -71,6 +91,7 @@ concerns:
71
91
  args: []
72
92
  fail_closed: false
73
93
  severity: advisory
94
+ needs_payload_bodies: [input, result]
74
95
  # Phase 5 — Tier-1 hook for the minimal-safe-diff rule. Counts unique
75
96
  # files touched per turn into agents/runtime/state/minimal-safe-diff.json and
76
97
  # flips warning=true past hooks.minimal_safe_diff.threshold.
@@ -89,11 +110,13 @@ concerns:
89
110
  args: []
90
111
  fail_closed: false
91
112
  severity: advisory
113
+ needs_payload_bodies: [input]
92
114
  minimal-safe-diff:
93
115
  script: src/scripts/minimal_safe_diff_hook.ts
94
116
  args: []
95
117
  fail_closed: false
96
118
  severity: advisory
119
+ needs_payload_bodies: [input]
97
120
  # road-to-security-pillar.md P3.2 — PostToolUse prompt-injection scanner.
98
121
  # Warn-in-context (exit 2), never blocks. Default-OFF: no-ops unless
99
122
  # hooks.injection_scan.enabled is true in .agent-settings.yml. The runtime
@@ -103,6 +126,7 @@ concerns:
103
126
  args: []
104
127
  fail_closed: false
105
128
  severity: advisory
129
+ needs_payload_bodies: [input, result]
106
130
  # road-to-security-hardening Phase 3 — PreToolUse guard turning the
107
131
  # git-history-discipline Iron Law into a deterministic gate. Blocks
108
132
  # `git … --no-verify` / `-n` and `git -c core.hooksPath=…` (which would
@@ -115,6 +139,7 @@ concerns:
115
139
  args: []
116
140
  fail_closed: true
117
141
  severity: blocking
142
+ needs_payload_bodies: [input]
118
143
  # road-to-ai-employee-borrowings Phase 1 — kernel immutability Layer 1.
119
144
  # PreToolUse guard: DENIES Write/Edit/NotebookEdit (and cross-platform
120
145
  # equivalents) whose target path is a kernel rule file — the source tree
@@ -131,6 +156,7 @@ concerns:
131
156
  args: []
132
157
  fail_closed: true
133
158
  severity: blocking
159
+ needs_payload_bodies: [input]
134
160
  # road-to-renewal-leverage Phase 2 — "fix the code, not the config".
135
161
  # PreToolUse guard over the recorded allowlist-growth antipattern
136
162
  # (autonomous-execution § Antipattern): warns as an allowlist grows within a
@@ -146,6 +172,7 @@ concerns:
146
172
  args: []
147
173
  fail_closed: false
148
174
  severity: blocking
175
+ needs_payload_bodies: [input]
149
176
  # token-saving Phase 3 — PreToolUse RTK-wrap nudge. DETERMINISTIC: keys off a
150
177
  # live `which rtk` probe (not the self-reported flag). When rtk is installed
151
178
  # and the agent is about to run a single verbose CLI command that is NOT
@@ -159,6 +186,7 @@ concerns:
159
186
  args: []
160
187
  fail_closed: false
161
188
  severity: advisory
189
+ needs_payload_bodies: [input]
162
190
  # road-to-anti-slop-detector Phase 3 — OPTIONAL PreToolUse anti-slop nudge.
163
191
  # Runs the lint_design_slop registry against about-to-be-written UI content
164
192
  # and WARNS (exit 2) on P0/P1 aesthetic tells. Never blocks (flags, not
@@ -171,6 +199,7 @@ concerns:
171
199
  args: []
172
200
  fail_closed: false
173
201
  severity: advisory
202
+ needs_payload_bodies: [input]
174
203
  # road-to-frontend-skill-application Phase 4 — OPTIONAL PreToolUse UI-route
175
204
  # nudge. On a Write/Edit to a UI surface with no design consultation latched
176
205
  # this session, WARNS (exit 2) naming the route; a read or search touching a
@@ -186,6 +215,7 @@ concerns:
186
215
  args: []
187
216
  fail_closed: false
188
217
  severity: advisory
218
+ needs_payload_bodies: [input]
189
219
  # ADR-124 Phase 4 — OPTIONAL PreToolUse code-graph nudge. When a code-graph
190
220
  # source is present and the agent is about to search/read source, WARNS
191
221
  # (exit 2) once per session to query the graph first (or rebuild if stale,
@@ -216,6 +246,7 @@ concerns:
216
246
  # correct is the right trade, and the cheap filter is reserved for advisory
217
247
  # concerns whose set is provable from their own source.
218
248
  tools: [Grep, Glob, Read]
249
+ needs_payload_bodies: [input]
219
250
  # road-to-reachable-code-memory Phase 4 — session_end learning-sidecar
220
251
  # aggregation. Joins the EXISTING session_end concern set (no new platform
221
252
  # wiring). Aggregates agents/memory/intake/*.jsonl through the learning
@@ -293,6 +324,7 @@ concerns:
293
324
  args: []
294
325
  fail_closed: false
295
326
  severity: advisory
327
+ needs_payload_bodies: [input, result]
296
328
  # Language-mirror pin — carries the ONE fact the transcript cannot express:
297
329
  # which language the human actually typed. 47 skill/slash-command bodies were
298
330
  # measured arriving in the `user` role across 21 of 30 audited sessions, and
@@ -321,6 +353,7 @@ concerns:
321
353
  args: []
322
354
  fail_closed: true
323
355
  severity: blocking
356
+ needs_payload_bodies: [input]
324
357
  # Evaluator independence. Gates EVALUATION dispatches only. Two branches with
325
358
  # DIFFERENT severities, per the tier rule in
326
359
  # docs/contracts/hook-architecture-v1.md (§ What a concern may block on):
@@ -343,6 +376,7 @@ concerns:
343
376
  args: []
344
377
  fail_closed: false
345
378
  severity: blocking
379
+ needs_payload_bodies: [input]
346
380
  # Canary injection — deterministic carrier for the
347
381
  # session-canary rule (greet-by-name at task start + reply-close markers
348
382
  # as a user-observable context-degradation signal). Gated on
@@ -376,6 +410,19 @@ concerns:
376
410
  args: []
377
411
  fail_closed: false
378
412
  severity: advisory
413
+ # Org-telemetry disclosure (road-to-org-telemetry Phase 3.2; ADR-233 § D5).
414
+ # `org-pack` is the only consent class in this suite granted by somebody
415
+ # OTHER than the person it binds — an org administrator, once, for every
416
+ # install the pack reaches. Telling that person is what makes the grant
417
+ # legitimate rather than a courtesy on top of it. Emits once per
418
+ # (org_id, endpoint) pair and re-discloses when either changes, because a
419
+ # new sink is a new fact. An inactive install prints nothing and writes
420
+ # nothing. Advisory: it informs, it never blocks a session start.
421
+ telemetry-disclosure:
422
+ script: src/scripts/telemetry_disclosure_hook.ts
423
+ args: []
424
+ fail_closed: false
425
+ severity: advisory
379
426
  # Self-repair intake (road-to-self-repair Phase 1). Two slots, one queue:
380
427
  # user_prompt_submit opens a record when the user states the agent worked
381
428
  # wrongly and injects the open-queue line; stop runs the deterministic
@@ -432,6 +479,57 @@ concerns:
432
479
  fail_closed: false
433
480
  severity: advisory
434
481
  tools: [Agent, Task]
482
+ needs_payload_bodies: [input, result]
483
+ # road-to-org-telemetry Phase 1 (step 1.2) — Class-A usage capture. Fires
484
+ # only on a `Skill` tool-use completion, the event Phase 0's first spike
485
+ # confirmed carries the invoked skill name (`tool_input.skill`, present on
486
+ # 164 of 164 real invocations). Exists because the regex collector is blind
487
+ # to consumer installs by construction — spike 3 measured 0 of 89
488
+ # invocations detected on the set it reads.
489
+ #
490
+ # DEFAULT-OFF and then some: `read_remote_settings` activates only when
491
+ # `telemetry.remote.enabled` is true AND the org pack supplied an endpoint,
492
+ # an org id, and a salt. A clone of this repository carries the key names
493
+ # and no values, so it cannot reach the write path. Inactive ⇒ zero
494
+ # telemetry file operations and zero network calls.
495
+ #
496
+ # It appends to a LOCAL JSONL file and stops — no outbound call exists in
497
+ # this concern. Transport is Phase 2 (blocked on `sink-choice`); org-wide
498
+ # enablement is Phase 3 (blocked on `dpo-signoff`).
499
+ #
500
+ # BOUND ON SIX PLATFORMS, INERT ON MOST OF THEM — and that asymmetry is a
501
+ # reading caveat for Phase 4, not a defect to fix by unbinding. A `Skill`
502
+ # tool is a Claude-family surface; on a host that has none, this concern
503
+ # never fires and the org's record set carries no rows for it. A zero from
504
+ # such a host therefore means "no instrument", NOT "no adoption" — which is
505
+ # precisely the blind-zero class this roadmap exists to remove, so it must
506
+ # not be read as a measurement. Every record carries `host`, so the
507
+ # denominator is reconstructable per host; unbinding would convert a
508
+ # readable absence into a guaranteed one.
509
+ #
510
+ # Silent on every path (never writes to stdout); exit 0 always, including a
511
+ # malformed envelope or a write failure. Carries no hook-token-budget row —
512
+ # it emits nothing, same as orchestration-record. fail_closed: false.
513
+ #
514
+ # Concern-budget note: this takes all six `post_tool_use` cells from 10 to
515
+ # 11 against a `max_per_event: 8` that is warn-only (`hard_fail: false`)
516
+ # and was already exceeded by 2 before this change. The threshold is a
517
+ # placeholder awaiting session evidence, per its own comment in the
518
+ # settings template — not a bar this concern is the first to cross.
519
+ telemetry-usage:
520
+ script: src/scripts/hooks/telemetry_usage_hook.ts
521
+ args: []
522
+ fail_closed: false
523
+ severity: advisory
524
+ # Provable from the hook's own source: the only branch surface is
525
+ # `extractToolName(payload) !== SKILL_TOOL_NAME`.
526
+ tools: [Skill]
527
+ # `[input]` only, and provable by reading the hook: it takes the skill
528
+ # name from `tool_input.skill` and the host/session from the envelope.
529
+ # It never touches `tool_response` — a skill invocation's RESULT body is
530
+ # the large one, and this concern records a usage FACT rather than an
531
+ # outcome, so the result class would be paid for and discarded.
532
+ needs_payload_bodies: [input]
435
533
  # road-to-orchestrator-discipline-carriers Phase 4 (F3-lite) — conditional
436
534
  # delegation nudge. Extracts cheap structural signals from the SUBMITTED
437
535
  # prompt (enumerated file lists, "for each"/"alle …" shapes, explicit slice
@@ -444,11 +542,32 @@ concerns:
444
542
  # enumerated signal → no injection at all. Never blocks the turn — see the
445
543
  # hook's file header for the `host_semantics.emitFor` proof. fail_closed:
446
544
  # false.
545
+ # `nudge_rank` (road-to-standing-context-40k Phase 4 step 4.2) — nudge-class
546
+ # exclusivity. At most ONE ranked nudge leaves per slot; the LOWEST rank wins
547
+ # and the dispatcher records every suppression as a `nudge_interference_drop`
548
+ # dispatch issue. A concern without the field is not nudge-class and is never
549
+ # suppressed by this policy.
550
+ #
551
+ # Measured before the policy was written, so the overlap is a fact rather than
552
+ # a hypothesis: the prompt "Use when starting parallel work in isolation from
553
+ # the current branch — spawn a git worktree … for src/a.ts, src/b.ts, src/c.ts
554
+ # and src/d.ts, each independently" fires delegation-nudge AND skill-route
555
+ # together on `user_prompt_submit`. Pinned by tests/eval/nudge-interference/.
556
+ #
557
+ # WHY delegation-nudge OUTRANKS skill-route, stated because the order is a
558
+ # decision and not an accident: the delegation verdict changes the SHAPE of
559
+ # the work (dispatch vs in-session), while a skill pointer is a hint the model
560
+ # may ignore — and the suppressed half has a first-class recovery path that
561
+ # the suppressed delegation verdict would not, because `suggest_skill_for_task`
562
+ # ranks the same catalogue on demand (see the missing-skill-recovery rule).
563
+ # Losing the pointer costs one tool call; losing the delegation verdict costs
564
+ # the plan.
447
565
  delegation-nudge:
448
566
  script: src/scripts/hooks/delegation_nudge_hook.ts
449
567
  args: []
450
568
  fail_closed: false
451
569
  severity: advisory
570
+ nudge_rank: 1
452
571
  # road-to-inbox-harvest-2026-08-d-runtime-skill-routing Phase 2 — binds the
453
572
  # deterministic task→skill ranker, which had shipped with ZERO production
454
573
  # callers: `score_skill_relevance.rank` and its `suggest_skill_for_task`
@@ -471,6 +590,7 @@ concerns:
471
590
  args: []
472
591
  fail_closed: false
473
592
  severity: advisory
593
+ nudge_rank: 2
474
594
  # road-to-orchestrator-discipline-carriers Phase 5 (F4-lite) — end-review
475
595
  # nudge. Fires ONLY when the session mutated tracked+untracked, non-doc
476
596
  # files beyond MUTATION_LINE_THRESHOLD (50 lines; untracked files added
@@ -545,6 +665,7 @@ concerns:
545
665
  # `toolName !== 'Write'` — same cheap-filter discipline as
546
666
  # `orchestration-record`'s [Agent, Task].
547
667
  tools: [Write]
668
+ needs_payload_bodies: [input]
548
669
  # road-to-token-economy-cache Phase 6.1/6.2 — re-read guard + post-edit
549
670
  # scope hint. PreToolUse, ADVISORY ONLY (never exit 1 — a stale-ledger
550
671
  # false positive on a block would corrupt work): a full-file Read of a
@@ -563,6 +684,7 @@ concerns:
563
684
  severity: advisory
564
685
  # Provable from the hook's own source: READ_TOOLS ∪ WRITE_TOOLS.
565
686
  tools: [Read, Edit, Write]
687
+ needs_payload_bodies: [input]
566
688
  # road-to-token-economy-recycling Phases 1.1 / 3.2 / 4.2 — session
567
689
  # end-of-life instrument + recycle advisory. Every Stop, incrementally
568
690
  # folds the transcript's newly appended lines (payload `transcript_path`,
@@ -582,6 +704,31 @@ concerns:
582
704
  args: []
583
705
  fail_closed: false
584
706
  severity: advisory
707
+ # road-to-long-horizon-execution Phase 1 (H-1) — the stop slot's first
708
+ # WORK-REMAINING concern. No-op unless this session claimed a roadmap
709
+ # (`sessions:claim`) whose frontmatter says `execution.mode: autonomous`;
710
+ # then compares the claimed roadmap's open checkboxes against the run and
711
+ # BLOCKS the stop with a continuation naming the next step + its `verify:`
712
+ # line, under a termination ladder (max 25 iterations, 4 h wall clock,
713
+ # 3-engagement stall → allow). Registered AFTER turn-end-gate on purpose:
714
+ # concerns run sequentially, so a gate refusal for this turn is on disk
715
+ # first and this concern defers to it — quality gates outrank continuation,
716
+ # always. Events: agents/runtime/state/run-continuation.jsonl. Kill switch:
717
+ # AGENT_CONFIG_NO_RUN_CONTINUATION=1. fail_closed: false — the only block
718
+ # it ever emits is the one carrying its own continuation text.
719
+ run-continuation:
720
+ script: src/scripts/hooks/run_continuation_hook.ts
721
+ args: []
722
+ fail_closed: false
723
+ # `blocking`, and the R2 review is why. The concern shipped `advisory`,
724
+ # which the dispatcher enforces as a CEILING: `_is_advisory` downgrades any
725
+ # EXIT_BLOCK to EXIT_WARN, and `host_semantics.emitFor` maps stop+warn to
726
+ # exit 0 + additionalContext. The concern's `return EXIT_BLOCK`, this
727
+ # comment block's "BLOCKS the stop", and the hook's own docblock therefore
728
+ # all described behaviour the declaration forbade — the whole re-engagement
729
+ # mechanism was inert on the one verified host. `turn-end-gate` above sits
730
+ # on the same slot and declares `blocking` for exactly this reason.
731
+ severity: blocking
585
732
  # road-to-user-out-of-the-loop Phase 0 Step 1 — the interruption ledger.
586
733
  # Every Stop, classifies whether the turn that just ended put a synchronous
587
734
  # contact to the user and appends one `{run_id, turn, kind, class, roadmap}`
@@ -736,19 +883,19 @@ roles:
736
883
 
737
884
  platforms:
738
885
  augment:
739
- session_start: [chat-history, hot-context, handoff-context, session-canary, council-availability, first-run-gate, onboarding-gate, verify-before-complete, minimal-safe-diff, profile-staleness, wrapper-freshness, surface-probe, session-register]
740
- session_end: [chat-history, memory-learn, session-register]
741
- stop: [chat-history, hot-context, verify-before-complete, self-repair, session-register]
886
+ session_start: [chat-history, hot-context, handoff-context, session-canary, council-availability, telemetry-disclosure, first-run-gate, onboarding-gate, verify-before-complete, minimal-safe-diff, profile-staleness, wrapper-freshness, surface-probe, session-register]
887
+ session_end: [chat-history, memory-learn, session-register, roadmap-progress]
888
+ stop: [chat-history, hot-context, verify-before-complete, self-repair, session-register, roadmap-progress]
742
889
  pre_tool_use: [block-no-verify, block-unauthorized-git, evidence-independence, block-kernel-rule-writes, block-config-weakening, rtk-wrap, design-slop, ui-route-nudge, code-graph-nudge, ship-diff-volume, reread-guard]
743
- post_tool_use: [chat-history, roadmap-progress, context-hygiene, verify-before-complete, minimal-safe-diff, injection-scan, pr-url-reminder, orchestration-record, tool-result-bytes, edit-shape]
890
+ post_tool_use: [chat-history, roadmap-progress, context-hygiene, verify-before-complete, minimal-safe-diff, injection-scan, pr-url-reminder, orchestration-record, telemetry-usage, tool-result-bytes, edit-shape]
744
891
 
745
892
  claude:
746
- session_start: [chat-history, hot-context, handoff-context, session-canary, council-availability, first-run-gate, onboarding-gate, verify-before-complete, minimal-safe-diff, profile-staleness, wrapper-freshness, surface-probe, session-register]
747
- session_end: [chat-history, memory-learn, session-register]
748
- stop: [chat-history, hot-context, verify-before-complete, team-review-gate, end-review-nudge, turn-end-gate, self-repair, session-register, session-eol, interruption-ledger]
893
+ session_start: [chat-history, hot-context, handoff-context, session-canary, council-availability, telemetry-disclosure, first-run-gate, onboarding-gate, verify-before-complete, minimal-safe-diff, profile-staleness, wrapper-freshness, surface-probe, session-register]
894
+ session_end: [chat-history, memory-learn, session-register, roadmap-progress]
895
+ stop: [chat-history, hot-context, verify-before-complete, team-review-gate, end-review-nudge, turn-end-gate, self-repair, session-register, session-eol, interruption-ledger, roadmap-progress, run-continuation]
749
896
  user_prompt_submit: [chat-history, verify-before-complete, minimal-safe-diff, language-mirror, delegation-nudge, skill-route, git-authorization, session-canary, self-repair, session-register]
750
897
  pre_tool_use: [block-no-verify, block-unauthorized-git, evidence-independence, block-kernel-rule-writes, block-config-weakening, rtk-wrap, design-slop, ui-route-nudge, code-graph-nudge, ship-diff-volume, reread-guard, spawn-guard-shadow]
751
- post_tool_use: [chat-history, roadmap-progress, context-hygiene, verify-before-complete, minimal-safe-diff, injection-scan, pr-url-reminder, orchestration-record, tool-result-bytes, edit-shape, language-mirror]
898
+ post_tool_use: [chat-history, roadmap-progress, context-hygiene, verify-before-complete, minimal-safe-diff, injection-scan, pr-url-reminder, orchestration-record, telemetry-usage, tool-result-bytes, edit-shape, language-mirror]
752
899
  # `language-mirror` — round-5 § 6.1. `pre_compact` sets a pin-lost marker;
753
900
  # the `post_tool_use` entry above re-emits the pin exactly once while that
754
901
  # marker is set, then clears it. One extra injection per compaction EVENT —
@@ -787,8 +934,8 @@ platforms:
787
934
  # Decision matrix + upstream blockers tracked in
788
935
  # agents/settings/contexts/chat-history-platform-hooks.md § Cowork.
789
936
  cowork:
790
- session_start: [chat-history, hot-context, handoff-context, session-canary, council-availability, first-run-gate, onboarding-gate, verify-before-complete, minimal-safe-diff, profile-staleness, wrapper-freshness, surface-probe, session-register]
791
- session_end: [chat-history, memory-learn, session-register]
937
+ session_start: [chat-history, hot-context, handoff-context, session-canary, council-availability, telemetry-disclosure, first-run-gate, onboarding-gate, verify-before-complete, minimal-safe-diff, profile-staleness, wrapper-freshness, surface-probe, session-register]
938
+ session_end: [chat-history, memory-learn, session-register, roadmap-progress]
792
939
  # end-review-nudge and delegation-nudge are DELIBERATELY NOT bound on
793
940
  # this platform (F10, review) — cowork-dispatcher.sh's own header states
794
941
  # it "always exit[s] 0" and its dispatch line discards the dispatcher's
@@ -799,10 +946,10 @@ platforms:
799
946
  # is later verified to forward it. Binding them here would be dead
800
947
  # weight: the concern still runs (git diff, transcript scan, classifier),
801
948
  # still costs the dispatch, and its entire output is thrown away.
802
- stop: [chat-history, hot-context, verify-before-complete, self-repair, session-register]
949
+ stop: [chat-history, hot-context, verify-before-complete, self-repair, session-register, roadmap-progress]
803
950
  user_prompt_submit: [chat-history, verify-before-complete, minimal-safe-diff, language-mirror, git-authorization, session-canary, self-repair, session-register]
804
951
  pre_tool_use: [block-no-verify, block-unauthorized-git, evidence-independence, block-kernel-rule-writes, block-config-weakening, rtk-wrap, design-slop, ui-route-nudge, code-graph-nudge, ship-diff-volume, reread-guard, spawn-guard-shadow]
805
- post_tool_use: [chat-history, roadmap-progress, context-hygiene, verify-before-complete, minimal-safe-diff, injection-scan, pr-url-reminder, orchestration-record, tool-result-bytes, edit-shape]
952
+ post_tool_use: [chat-history, roadmap-progress, context-hygiene, verify-before-complete, minimal-safe-diff, injection-scan, pr-url-reminder, orchestration-record, telemetry-usage, tool-result-bytes, edit-shape]
806
953
  # subagent-ledger IS bound here, unlike the two nudges above, and the
807
954
  # difference is the delivery channel rather than the platform: the nudges
808
955
  # depend on stdout reaching the model, which this trampoline discards by
@@ -821,11 +968,11 @@ platforms:
821
968
  # IDE-only — CLI-only users fall back to /checkpoint per
822
969
  # agents/settings/contexts/chat-history-platform-hooks.md.
823
970
  cursor:
824
- session_start: [chat-history, hot-context, handoff-context, session-canary, council-availability, first-run-gate, onboarding-gate, verify-before-complete, minimal-safe-diff, profile-staleness, wrapper-freshness, surface-probe, session-register]
825
- session_end: [chat-history, memory-learn, session-register]
826
- stop: [chat-history, hot-context, verify-before-complete, self-repair, session-register]
971
+ session_start: [chat-history, hot-context, handoff-context, session-canary, council-availability, telemetry-disclosure, first-run-gate, onboarding-gate, verify-before-complete, minimal-safe-diff, profile-staleness, wrapper-freshness, surface-probe, session-register]
972
+ session_end: [chat-history, memory-learn, session-register, roadmap-progress]
973
+ stop: [chat-history, hot-context, verify-before-complete, self-repair, session-register, roadmap-progress]
827
974
  user_prompt_submit: [chat-history, verify-before-complete, minimal-safe-diff, language-mirror, git-authorization, session-canary, self-repair, session-register]
828
- post_tool_use: [chat-history, roadmap-progress, context-hygiene, verify-before-complete, minimal-safe-diff, injection-scan, pr-url-reminder, orchestration-record, tool-result-bytes, edit-shape]
975
+ post_tool_use: [chat-history, roadmap-progress, context-hygiene, verify-before-complete, minimal-safe-diff, injection-scan, pr-url-reminder, orchestration-record, telemetry-usage, tool-result-bytes, edit-shape]
829
976
 
830
977
  # Phase 7.6 — Cline. Hooks live under `.clinerules/hooks/<HookName>`
831
978
  # (project, no file extension, must be executable per Cline docs) or
@@ -836,11 +983,11 @@ platforms:
836
983
  # both map to session_start. TaskCancel maps to stop because the
837
984
  # session is interrupted with partial state (mirrors Augment Stop).
838
985
  cline:
839
- session_start: [chat-history, hot-context, handoff-context, session-canary, council-availability, first-run-gate, onboarding-gate, verify-before-complete, minimal-safe-diff, profile-staleness, wrapper-freshness, surface-probe, session-register]
840
- session_end: [chat-history, memory-learn, session-register]
841
- stop: [chat-history, hot-context, verify-before-complete, self-repair, session-register]
986
+ session_start: [chat-history, hot-context, handoff-context, session-canary, council-availability, telemetry-disclosure, first-run-gate, onboarding-gate, verify-before-complete, minimal-safe-diff, profile-staleness, wrapper-freshness, surface-probe, session-register]
987
+ session_end: [chat-history, memory-learn, session-register, roadmap-progress]
988
+ stop: [chat-history, hot-context, verify-before-complete, self-repair, session-register, roadmap-progress]
842
989
  user_prompt_submit: [chat-history, verify-before-complete, minimal-safe-diff, language-mirror, git-authorization, session-canary, self-repair, session-register]
843
- post_tool_use: [chat-history, roadmap-progress, context-hygiene, verify-before-complete, minimal-safe-diff, injection-scan, pr-url-reminder, orchestration-record, tool-result-bytes, edit-shape]
990
+ post_tool_use: [chat-history, roadmap-progress, context-hygiene, verify-before-complete, minimal-safe-diff, injection-scan, pr-url-reminder, orchestration-record, telemetry-usage, tool-result-bytes, edit-shape]
844
991
 
845
992
  # Phase 7.7 — Windsurf (Cascade). Hooks live at `.windsurf/hooks.json`
846
993
  # (project) or `~/.codeium/windsurf/hooks.json` (user). Cascade has
@@ -855,7 +1002,7 @@ platforms:
855
1002
  # surface to record verification commands; documented limitation).
856
1003
  # minimal-safe-diff is omitted entirely on Windsurf for the same reason.
857
1004
  windsurf:
858
- session_start: [chat-history, hot-context, handoff-context, session-canary, council-availability, first-run-gate, onboarding-gate, verify-before-complete, profile-staleness, wrapper-freshness, surface-probe, session-register]
1005
+ session_start: [chat-history, hot-context, handoff-context, session-canary, council-availability, telemetry-disclosure, first-run-gate, onboarding-gate, verify-before-complete, profile-staleness, wrapper-freshness, surface-probe, session-register]
859
1006
  stop: [chat-history, hot-context, verify-before-complete, self-repair, session-register]
860
1007
  # language-mirror IS bound here: unlike minimal-safe-diff it needs only the
861
1008
  # user_prompt_submit slot, which Windsurf has.
@@ -872,11 +1019,11 @@ platforms:
872
1019
  # turn-check semantics. AfterAgent fires when the agent loop ends
873
1020
  # — this is our `stop` slot.
874
1021
  gemini:
875
- session_start: [chat-history, hot-context, handoff-context, session-canary, council-availability, first-run-gate, onboarding-gate, verify-before-complete, minimal-safe-diff, profile-staleness, wrapper-freshness, surface-probe, session-register]
876
- session_end: [chat-history, memory-learn, session-register]
877
- stop: [chat-history, hot-context, verify-before-complete, self-repair, session-register]
1022
+ session_start: [chat-history, hot-context, handoff-context, session-canary, council-availability, telemetry-disclosure, first-run-gate, onboarding-gate, verify-before-complete, minimal-safe-diff, profile-staleness, wrapper-freshness, surface-probe, session-register]
1023
+ session_end: [chat-history, memory-learn, session-register, roadmap-progress]
1024
+ stop: [chat-history, hot-context, verify-before-complete, self-repair, session-register, roadmap-progress]
878
1025
  user_prompt_submit: [chat-history, verify-before-complete, minimal-safe-diff, language-mirror, git-authorization, session-canary, self-repair, session-register]
879
- post_tool_use: [chat-history, roadmap-progress, context-hygiene, verify-before-complete, minimal-safe-diff, injection-scan, pr-url-reminder, orchestration-record, tool-result-bytes, edit-shape]
1026
+ post_tool_use: [chat-history, roadmap-progress, context-hygiene, verify-before-complete, minimal-safe-diff, injection-scan, pr-url-reminder, orchestration-record, telemetry-usage, tool-result-bytes, edit-shape]
880
1027
 
881
1028
  # Phase 7.9 — Copilot has no hook surface. Concerns route through
882
1029
  # rule-only fallback; the dispatcher silently no-ops on --platform copilot.
@@ -43,6 +43,7 @@ import { main as teamReviewGateMain } from '../team_review_gate_hook.js';
43
43
  import { main as prUrlReminderMain } from '../pr_url_reminder_hook.js';
44
44
  import { main as sessionCanaryMain } from '../session_canary_hook.js';
45
45
  import { main as councilAvailabilityMain } from '../council_availability_hook.js';
46
+ import { main as telemetryDisclosureMain } from '../telemetry_disclosure_hook.js';
46
47
  import { main as selfRepairMain } from '../self_repair_hook.js';
47
48
  import { main as sessionRegisterMain } from '../session_register_hook.js';
48
49
  import { main as languageMirrorMain } from '../language_mirror_hook.js';
@@ -57,6 +58,7 @@ import { main as designSlopMain } from './design_slop_hook.js';
57
58
  import { main as codeGraphNudgeMain } from './code_graph_nudge_hook.js';
58
59
  import { main as uiRouteNudgeMain } from './ui_route_nudge_hook.js';
59
60
  import { main as orchestrationRecordMain } from './orchestration_record_hook.js';
61
+ import { main as telemetryUsageMain } from './telemetry_usage_hook.js';
60
62
  import { main as delegationNudgeMain } from './delegation_nudge_hook.js';
61
63
  import { main as skillRouteMain } from './skill_route_hook.js';
62
64
  import { main as endReviewNudgeMain } from './end_review_nudge_hook.js';
@@ -68,6 +70,7 @@ import { main as subagentLedgerMain } from './subagent_ledger_hook.js';
68
70
  import { main as toolResultBytesMain } from './tool_result_bytes_hook.js';
69
71
  import { main as spawnGuardShadowMain } from './spawn_guard_shadow_hook.js';
70
72
  import { main as interruptionLedgerMain } from './interruption_ledger_hook.js';
73
+ import { main as runContinuationMain } from './run_continuation_hook.js';
71
74
 
72
75
  /** A concern `main` — argv-taking or not; both shapes exist. */
73
76
  export type ConcernMain = (argv?: string[]) => number | undefined | void;
@@ -93,6 +96,7 @@ export const CONCERN_REGISTRY: Readonly<Record<string, ConcernMain>> = {
93
96
  'src/scripts/pr_url_reminder_hook.ts': prUrlReminderMain as ConcernMain,
94
97
  'src/scripts/session_canary_hook.ts': sessionCanaryMain as ConcernMain,
95
98
  'src/scripts/council_availability_hook.ts': councilAvailabilityMain as ConcernMain,
99
+ 'src/scripts/telemetry_disclosure_hook.ts': telemetryDisclosureMain as ConcernMain,
96
100
  'src/scripts/self_repair_hook.ts': selfRepairMain as ConcernMain,
97
101
  'src/scripts/session_register_hook.ts': sessionRegisterMain as ConcernMain,
98
102
  'src/scripts/language_mirror_hook.ts': languageMirrorMain as ConcernMain,
@@ -107,6 +111,7 @@ export const CONCERN_REGISTRY: Readonly<Record<string, ConcernMain>> = {
107
111
  'src/scripts/hooks/code_graph_nudge_hook.ts': codeGraphNudgeMain as ConcernMain,
108
112
  'src/scripts/hooks/ui_route_nudge_hook.ts': uiRouteNudgeMain as ConcernMain,
109
113
  'src/scripts/hooks/orchestration_record_hook.ts': orchestrationRecordMain as ConcernMain,
114
+ 'src/scripts/hooks/telemetry_usage_hook.ts': telemetryUsageMain as ConcernMain,
110
115
  'src/scripts/hooks/delegation_nudge_hook.ts': delegationNudgeMain as ConcernMain,
111
116
  'src/scripts/hooks/skill_route_hook.ts': skillRouteMain as ConcernMain,
112
117
  'src/scripts/hooks/end_review_nudge_hook.ts': endReviewNudgeMain as ConcernMain,
@@ -118,4 +123,5 @@ export const CONCERN_REGISTRY: Readonly<Record<string, ConcernMain>> = {
118
123
  'src/scripts/hooks/tool_result_bytes_hook.ts': toolResultBytesMain as ConcernMain,
119
124
  'src/scripts/hooks/spawn_guard_shadow_hook.ts': spawnGuardShadowMain as ConcernMain,
120
125
  'src/scripts/hooks/interruption_ledger_hook.ts': interruptionLedgerMain as ConcernMain,
126
+ 'src/scripts/hooks/run_continuation_hook.ts': runContinuationMain as ConcernMain,
121
127
  };