@event4u/agent-config 9.16.0 → 9.18.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 (227) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/AGENTS.md +1 -1
  3. package/CHANGELOG.md +80 -130
  4. package/README.md +1 -1
  5. package/dist/agent-src/commands/agent-handoff.md +100 -48
  6. package/dist/agent-src/commands/challenge-me/vision.md +5 -0
  7. package/dist/agent-src/commands/commit.md +1 -1
  8. package/dist/agent-src/commands/condense.md +19 -64
  9. package/dist/agent-src/commands/evals/agent-handoff.json +13 -1
  10. package/dist/agent-src/commands/evals/rule-compliance-audit.json +46 -0
  11. package/dist/agent-src/commands/feature/plan.md +20 -0
  12. package/dist/agent-src/commands/feature/roadmap.md +19 -0
  13. package/dist/agent-src/commands/memory/promote.md +14 -1
  14. package/dist/agent-src/commands/mode.md +9 -5
  15. package/dist/agent-src/commands/optimize/deep.md +72 -11
  16. package/dist/agent-src/commands/pr/create.md +29 -0
  17. package/dist/agent-src/commands/roadmap/create.md +29 -0
  18. package/dist/agent-src/commands/rule-compliance-audit.md +28 -5
  19. package/dist/agent-src/contexts/authority/commit-mechanics.md +5 -5
  20. package/dist/agent-src/contexts/communication/rules-auto/guidelines-mechanics.md +1 -0
  21. package/dist/agent-src/contexts/communication/rules-auto/skill-quality-mechanics.md +1 -1
  22. package/dist/agent-src/contexts/communication/rules-auto/think-before-action-mechanics.md +6 -1
  23. package/dist/agent-src/contexts/communication/rules-auto/token-efficiency-mechanics.md +4 -1
  24. package/dist/agent-src/contexts/execution/autonomy-mechanics.md +27 -1
  25. package/dist/agent-src/contexts/execution/plan-confidence-gate.md +133 -0
  26. package/dist/agent-src/contexts/execution/roadmap-process-loop.md +5 -2
  27. package/dist/agent-src/profiles/agency.yml +3 -3
  28. package/dist/agent-src/profiles/content_creator.yml +2 -2
  29. package/dist/agent-src/profiles/developer.yml +2 -2
  30. package/dist/agent-src/profiles/finance.yml +1 -1
  31. package/dist/agent-src/profiles/founder.yml +2 -2
  32. package/dist/agent-src/profiles/ops.yml +2 -2
  33. package/dist/agent-src/rules/active-remediation.md +2 -0
  34. package/dist/agent-src/rules/architecture.md +4 -2
  35. package/dist/agent-src/rules/augment-edit-discipline.md +2 -0
  36. package/dist/agent-src/rules/autonomous-execution.md +1 -1
  37. package/dist/agent-src/rules/brand-consistency.md +10 -62
  38. package/dist/agent-src/rules/brand-source-of-truth.md +62 -11
  39. package/dist/agent-src/rules/broken-access-control.md +4 -0
  40. package/dist/agent-src/rules/cli-output-handling.md +5 -0
  41. package/dist/agent-src/rules/code-comment-discipline.md +3 -0
  42. package/dist/agent-src/rules/commit-conventions.md +2 -0
  43. package/dist/agent-src/rules/context-hygiene.md +3 -2
  44. package/dist/agent-src/rules/cross-source-consistency.md +3 -0
  45. package/dist/agent-src/rules/design-fidelity.md +2 -0
  46. package/dist/agent-src/rules/doc-screenshot-hygiene.md +2 -0
  47. package/dist/agent-src/rules/docker-commands.md +4 -0
  48. package/dist/agent-src/rules/domain-adoption-policy.md +2 -0
  49. package/dist/agent-src/rules/domain-safety-disclaimer.md +5 -2
  50. package/dist/agent-src/rules/domain-safety-pii.md +1 -1
  51. package/dist/agent-src/rules/engineering-safety-floor.md +2 -0
  52. package/dist/agent-src/rules/framework-neutrality-in-generic-skills.md +9 -0
  53. package/dist/agent-src/rules/image-likeness-and-rights.md +4 -0
  54. package/dist/agent-src/rules/improve-before-implement.md +4 -0
  55. package/dist/agent-src/rules/laravel-routing.md +4 -0
  56. package/dist/agent-src/rules/legal-safety-floor.md +3 -0
  57. package/dist/agent-src/rules/lethal-trifecta-guard.md +3 -0
  58. package/dist/agent-src/rules/media-governance-routing.md +5 -0
  59. package/dist/agent-src/rules/minimal-safe-diff.md +2 -0
  60. package/dist/agent-src/rules/no-roadmap-references.md +2 -0
  61. package/dist/agent-src/rules/notes-first-reasoning.md +2 -0
  62. package/dist/agent-src/rules/output-discipline.md +9 -2
  63. package/dist/agent-src/rules/php-coding.md +2 -0
  64. package/dist/agent-src/rules/prefer-enums-over-literals.md +3 -0
  65. package/dist/agent-src/rules/provider-lifecycle-discipline.md +5 -0
  66. package/dist/agent-src/rules/roadmap-ci-steps-policy.md +2 -0
  67. package/dist/agent-src/rules/roadmap-progress-sync.md +2 -0
  68. package/dist/agent-src/rules/rule-type-governance.md +2 -0
  69. package/dist/agent-src/rules/scale-discipline.md +3 -0
  70. package/dist/agent-src/rules/secret-vcs-guard.md +2 -0
  71. package/dist/agent-src/rules/security-sensitive-stop.md +9 -2
  72. package/dist/agent-src/rules/senior-engineering-discipline.md +6 -0
  73. package/dist/agent-src/rules/skill-quality.md +2 -0
  74. package/dist/agent-src/rules/source-confidentiality.md +4 -0
  75. package/dist/agent-src/rules/source-discovery-gate.md +3 -0
  76. package/dist/agent-src/rules/source-of-truth.md +2 -0
  77. package/dist/agent-src/rules/strategy-safety-floor.md +2 -0
  78. package/dist/agent-src/rules/think-before-action.md +5 -0
  79. package/dist/agent-src/rules/token-budget-discipline.md +2 -2
  80. package/dist/agent-src/rules/ui-audit-gate.md +2 -0
  81. package/dist/agent-src/rules/user-interaction.md +3 -4
  82. package/dist/agent-src/skills/build-buy-partner/SKILL.md +1 -1
  83. package/dist/agent-src/skills/copilot-agents-optimization/SKILL.md +4 -4
  84. package/dist/agent-src/skills/copilot-config/SKILL.md +1 -1
  85. package/dist/agent-src/skills/deep-reading-analyst/SKILL.md +7 -4
  86. package/dist/agent-src/skills/description-assist/SKILL.md +1 -1
  87. package/dist/agent-src/skills/design-intelligence/SKILL.md +6 -180
  88. package/dist/agent-src/skills/design-intelligence/references/context-and-registers.md +100 -0
  89. package/dist/agent-src/skills/design-intelligence/references/integration-mapping.md +91 -0
  90. package/dist/agent-src/skills/design-review/SKILL.md +4 -141
  91. package/dist/agent-src/skills/design-review/references/review-communication.md +92 -0
  92. package/dist/agent-src/skills/design-review/references/verification-automation.md +61 -0
  93. package/dist/agent-src/skills/existing-ui-audit/SKILL.md +8 -27
  94. package/dist/agent-src/skills/existing-ui-audit/references/anti-slop-cross-reference.md +31 -0
  95. package/dist/agent-src/skills/fe-design/SKILL.md +4 -289
  96. package/dist/agent-src/skills/fe-design/references/design-patterns.md +227 -0
  97. package/dist/agent-src/skills/fe-design/references/design-read-and-memory.md +75 -0
  98. package/dist/agent-src/skills/market-entry-analysis/SKILL.md +1 -1
  99. package/dist/agent-src/skills/persona-writing/SKILL.md +2 -2
  100. package/dist/agent-src/skills/readme-reviewer/SKILL.md +2 -1
  101. package/dist/agent-src/skills/roadmap-management/SKILL.md +10 -0
  102. package/dist/agent-src/skills/roadmap-writing/SKILL.md +12 -1
  103. package/dist/agent-src/skills/rule-writing/SKILL.md +4 -2
  104. package/dist/agent-src/skills/skill-reviewer/SKILL.md +1 -1
  105. package/dist/agent-src/skills/skill-writing/SKILL.md +2 -2
  106. package/dist/agent-src/skills/tailwind-engineer/SKILL.md +3 -1
  107. package/dist/agent-src/skills/token-optimizer/SKILL.md +2 -2
  108. package/dist/agent-src/skills/ui-component-architect/SKILL.md +6 -3
  109. package/dist/agent-src/templates/agent-settings.md +13 -15
  110. package/dist/agent-src/templates/agents/agent-project-settings.example.yml +6 -2
  111. package/dist/agent-src/templates/persona.md +2 -2
  112. package/dist/agent-src/templates/roadmaps.md +13 -1
  113. package/dist/agent-src/templates/rule.md +1 -1
  114. package/dist/agent-src/templates/scripts/work_engine/directives/ui/_fix_lane.ts +52 -0
  115. package/dist/agent-src/templates/scripts/work_engine/directives/ui/audit.ts +8 -0
  116. package/dist/agent-src/templates/scripts/work_engine/directives/ui/design.ts +6 -0
  117. package/dist/agent-src/templates/scripts/work_engine/intent/classify.ts +56 -4
  118. package/dist/agent-src/templates/skill.md +1 -1
  119. package/dist/cli/registry.js +3 -0
  120. package/dist/cli/registry.js.map +1 -1
  121. package/dist/cli-delegate/chunk-AIIUU73N.js +2040 -0
  122. package/dist/cli-delegate/{chunk-ZXXJLL5K.js → chunk-BSLUHV2F.js} +127 -1487
  123. package/dist/cli-delegate/{chunk-H574KOUH.js → chunk-ELMFOQPW.js} +35 -1
  124. package/dist/cli-delegate/chunk-LF2KKJ4Q.js +183 -0
  125. package/dist/cli-delegate/chunk-VSYT7OHO.js +1382 -0
  126. package/dist/cli-delegate/chunk-XGA2NTU4.js +3727 -0
  127. package/dist/cli-delegate/cmd_conformance.js +4 -3
  128. package/dist/cli-delegate/cmd_converge.js +3 -3
  129. package/dist/cli-delegate/cmd_doctor.js +3 -2
  130. package/dist/cli-delegate/cmd_explain.js +36 -36
  131. package/dist/cli-delegate/cmd_export.js +4 -4
  132. package/dist/cli-delegate/cmd_handoff.js +1169 -0
  133. package/dist/cli-delegate/cmd_memory_get.js +35 -3754
  134. package/dist/cli-delegate/cmd_migrate.js +2 -2
  135. package/dist/cli-delegate/cmd_prune.js +4 -4
  136. package/dist/cli-delegate/cmd_route_audit.js +249 -0
  137. package/dist/cli-delegate/cmd_route_explain.js +285 -0
  138. package/dist/cli-delegate/cmd_settings_migrate.js +4 -4
  139. package/dist/cli-delegate/cmd_sync.js +4 -4
  140. package/dist/cli-delegate/cmd_uninstall.js +4 -4
  141. package/dist/cli-delegate/cmd_update.js +3 -3
  142. package/dist/cli-delegate/cmd_upgrade.js +3 -3
  143. package/dist/cli-delegate/cmd_validate.js +4 -4
  144. package/dist/cli-delegate/cmd_versions.js +3 -3
  145. package/dist/discovery/deprecation-report.md +1 -1
  146. package/dist/discovery/discovery-manifest.json +84 -84
  147. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  148. package/dist/discovery/discovery-manifest.summary.md +1 -1
  149. package/dist/discovery/orphan-report.md +1 -1
  150. package/dist/discovery/packs.json +2 -2
  151. package/dist/discovery/trust-report.md +1 -1
  152. package/dist/discovery/workspaces.json +2 -2
  153. package/dist/hooks/dispatch.js +602 -507
  154. package/dist/install/install.mjs +34 -0
  155. package/dist/mcp/awesome-mcp-servers.row.md +1 -1
  156. package/dist/mcp/mcp-cloudflare-catalogue.json +2 -2
  157. package/dist/mcp/registry-manifest.json +4 -4
  158. package/dist/mcp/server.json +2 -2
  159. package/dist/mcp/server.mjs +25 -3
  160. package/dist/router.json +1 -1
  161. package/dist/scripts/_lib/agent_src.js +39 -6
  162. package/dist/scripts/_lib/agent_src.js.map +1 -1
  163. package/dist/server/schemas/settings.js +25 -0
  164. package/dist/server/schemas/settings.js.map +1 -1
  165. package/docs/guidelines/abstraction-thresholds.md +53 -0
  166. package/docs/guidelines/agent-infra/agent-interaction-and-decision-quality.md +1 -1
  167. package/docs/guidelines/agent-infra/asking-and-brevity-examples.md +7 -0
  168. package/docs/guidelines/agent-infra/context-hygiene-mechanics.md +2 -2
  169. package/docs/guidelines/agent-infra/minimal-safe-diff-mechanics.md +5 -3
  170. package/docs/guidelines/agent-infra/size-and-scope.md +8 -2
  171. package/docs/guidelines/component-oriented-and-oop-development.md +11 -6
  172. package/docs/guidelines/docs/readme-size-and-splitting.md +5 -2
  173. package/llms.txt +1 -0
  174. package/package.json +1 -1
  175. package/src/agent-src/templates/scripts/work_engine/directives/ui/_fix_lane.ts +52 -0
  176. package/src/agent-src/templates/scripts/work_engine/directives/ui/audit.ts +8 -0
  177. package/src/agent-src/templates/scripts/work_engine/directives/ui/design.ts +6 -0
  178. package/src/agent-src/templates/scripts/work_engine/intent/classify.ts +56 -4
  179. package/src/config/agent-settings.template.yml +68 -0
  180. package/src/config/evaluator-budgets.json +8 -11
  181. package/src/config/gate-coverage.yml +70 -0
  182. package/src/scripts/_cli/cmd_explain.ts +41 -36
  183. package/src/scripts/_cli/cmd_handoff.ts +405 -0
  184. package/src/scripts/_cli/cmd_route_audit.ts +290 -0
  185. package/src/scripts/_cli/cmd_route_explain.ts +269 -0
  186. package/src/scripts/_cli/handoff_generate.ts +453 -0
  187. package/src/scripts/_cli/handoff_sessions.ts +435 -0
  188. package/src/scripts/_dispatch.bash +32 -0
  189. package/src/scripts/_lib/agent_src.ts +36 -6
  190. package/src/scripts/_lib/git_env.ts +40 -0
  191. package/src/scripts/_lib/md_table.ts +27 -0
  192. package/src/scripts/_lib/planning_settings.ts +43 -0
  193. package/src/scripts/_lib/release_material.ts +156 -0
  194. package/src/scripts/_lib/router_match.ts +301 -0
  195. package/src/scripts/annotate_r1_outcomes.ts +258 -0
  196. package/src/scripts/check_completion_review.ts +1140 -0
  197. package/src/scripts/check_condensation.ts +2 -1
  198. package/src/scripts/check_finding_dispositions.ts +278 -0
  199. package/src/scripts/check_pack_size.ts +4 -3
  200. package/src/scripts/check_references.ts +1 -0
  201. package/src/scripts/check_release_highlights.ts +300 -0
  202. package/src/scripts/check_release_pr_shape.ts +4 -0
  203. package/src/scripts/check_release_surface_equality.ts +132 -0
  204. package/src/scripts/check_reply_consistency.ts +187 -138
  205. package/src/scripts/compile_router.ts +20 -3
  206. package/src/scripts/dispatch_r2_reviewer.ts +968 -0
  207. package/src/scripts/eval_ui_triviality.ts +156 -0
  208. package/src/scripts/handoff_context_hook.ts +148 -0
  209. package/src/scripts/hook_manifest.yaml +17 -7
  210. package/src/scripts/hooks/concern_registry.ts +2 -0
  211. package/src/scripts/lint_abstraction_thresholds.ts +327 -0
  212. package/src/scripts/lint_framework_leakage_allowlist.json +2 -2
  213. package/src/scripts/lint_plan_risk_register.ts +931 -0
  214. package/src/scripts/lint_profile_personas.ts +153 -0
  215. package/src/scripts/lint_token_budget_discipline.ts +148 -0
  216. package/src/scripts/lint_trigger_collisions.ts +257 -0
  217. package/src/scripts/release.ts +156 -32
  218. package/src/scripts/release_drill.ts +491 -0
  219. package/src/scripts/router_telemetry.ts +16 -290
  220. package/src/scripts/schemas/command.schema.json +33 -0
  221. package/src/scripts/schemas/rule.schema.json +10 -0
  222. package/src/scripts/self_review_gate.ts +41 -3
  223. package/src/scripts/skill_linter.ts +3 -1
  224. package/src/scripts/smoke/router.sh +1 -1
  225. package/src/scripts/update_counts.ts +60 -12
  226. package/src/server/schemas/settings.ts +41 -0
  227. package/dist/cli-delegate/{chunk-XX6TOPD7.js → chunk-WR6GTRHJ.js} +3 -3
@@ -321,6 +321,28 @@ personal:
321
321
  # See user-types/README.md for the per-id contract.
322
322
  user_type: "__USER_TYPE__"
323
323
 
324
+ # --- Reply verbosity ---
325
+ verbosity:
326
+ # Announce intent before tool batches ("Let me check X…") — only honored
327
+ # when personal.play_by_play is ALSO true (the direct-answers narration
328
+ # carve-out requires both). Default false = no intent narration.
329
+ intent_announcements: false
330
+
331
+ # Show generated commit messages, PR titles/bodies, branch names before
332
+ # acting. false = use generated content directly (/commit terse path).
333
+ preview_artifacts: false
334
+
335
+ # Confirmation prompts for routine workflow steps with one obvious answer.
336
+ # Iron-Law gates (commit-policy, scope-control git-ops, Hard Floor) ALWAYS
337
+ # ask regardless of this setting.
338
+ routine_confirmations: false
339
+
340
+ # Offer "run AI Council on this?" inside delivery commands.
341
+ offer_council_in_delivery: false
342
+
343
+ # Status blocks after a successful action: off | minimal | full.
344
+ post_action_reports: minimal
345
+
324
346
  # --- Project / team preferences ---
325
347
  project:
326
348
  # Path to the PR template file (relative to project root)
@@ -528,6 +550,52 @@ roadmap:
528
550
  # only if your team genuinely commits work on a calendar plate.
529
551
  horizon_weeks: 0
530
552
 
553
+ # --- Plan governance gates ---
554
+ #
555
+ # Three governance gates around the plan/delivery workflow (contract:
556
+ # docs/contracts/plan-review-gates.md). Scope is every plan artifact —
557
+ # roadmaps AND feature plans — which is why these keys do not live under
558
+ # `roadmap:`. All three default to true; a missing key behaves as true.
559
+ planning:
560
+ # Gate C — plan-confidence gate, BEFORE authoring (true, false).
561
+ # true = default. A plan-artifact authoring ask (/roadmap:create,
562
+ # roadmap-writing, /feature:plan, /feature:roadmap) first runs
563
+ # the four 95%-confidence conditions from /challenge-me vision.
564
+ # All four hold → the agent creates directly and emits exactly
565
+ # one marker line ("Confidence ≥ 95% — creating directly").
566
+ # Any gap → the ask routes into the /challenge-me vision
567
+ # interview first; hosts without that command run the inline
568
+ # degrade interview (one question per turn, same stop
569
+ # conditions — contexts/execution/plan-confidence-gate.md).
570
+ # An explicit user bypass ("just write it") wins for that turn
571
+ # and is counted (gate_c_bypass_rate).
572
+ # false = inert; plan asks author directly (today's behavior).
573
+ challenge_on_create: true
574
+
575
+ # Gate R1 — plan-risk review at plan creation / substantial change
576
+ # (true, false).
577
+ # true = default. Every ready (non-draft) plan carries a schema-valid
578
+ # `## Risk Register` section (ranked risks, mitigation +
579
+ # in-document anchor per row, freshness marker). Enforced by
580
+ # lint_plan_risk_register at pre-push + CI; drafts are exempt
581
+ # until flipped to ready. Honest-null: an empty register is
582
+ # valid only with the exact marker grammar from the contract.
583
+ # false = escape hatch; the validator skips (governance default is on).
584
+ risk_review: true
585
+
586
+ # Gate R2 — completion review at 100% roadmap completion / pre-PR
587
+ # (true, false).
588
+ # true = default. A findings-BEFORE-fixes review by a fresh reviewer
589
+ # context: the findings artifact (agents/evidence/reviews/…) must exist
590
+ # for the current diff hash before the first fix commit; every
591
+ # finding ends fixed | accepted-risk | deferred. No code
592
+ # surface → explicit skip declaration, never a silent skip.
593
+ # Enforced by check_completion_review at pre-push + CI (CI
594
+ # authoritative); a crashed validator (exit 2) warns and
595
+ # allows — a broken gate never blocks its own fix.
596
+ # false = escape hatch; the validator skips (governance default is on).
597
+ completion_review: true
598
+
531
599
  # --- Quality / CI execution ---
532
600
  #
533
601
  # Controls whether the agent runs the project's quality pipeline
@@ -8,7 +8,9 @@
8
8
  "on_release": "fail",
9
9
  "on_main_and_prs": "warn",
10
10
  "on_local": "fail",
11
- "always_blocking": ["a metric with no measurement supplied"],
11
+ "always_blocking": [
12
+ "a metric with no measurement supplied"
13
+ ],
12
14
  "rationale": "road-to-gates-that-can-fail Phase 5. A hard fail on main turns every legitimate command addition into a blocked merge, which is how budgets get quietly raised with a cushion instead of consciously — so budget / regression / drift findings are ADVISORY on main, the nightly and ordinary PRs, and BLOCKING on a release ref. Not a weakening: before the Phase-4 path triggers, this gate ran on release PRs and the nightly only, so the surfaces that now warn never saw it at all. A LOCAL run (no CI env) is strict, because a maintainer running it by hand — including release.ts — wants the strict answer and blocks nobody. A metric with NO measurement is always blocking in either posture: that is a broken harness reporting green on nothing. Implemented in src/scripts/check_evaluator_budgets.ts::detectPosture; override with --posture warn|fail.",
13
15
  "delivery": "This posture IS the nightly-visibility route (council 2026-08-02, blocker nightly-visibility-owner), not a second mechanism beside it: the nightly publishes measurement_record below, a later run re-measures and compares, and the contradiction warns on main / fails on release. No notification channel, no auto-managed issue — a one-maintainer channel producing routine noise gets muted, and a muted channel reproduces the original failure."
14
16
  },
@@ -25,13 +27,8 @@
25
27
  },
26
28
  "not_re_measured": "unpacked_size_mb, node_modules_mb, runtime_dep_count, cli_version_cold_ms, mcp_boot_to_initialize_ms. All five require the packed-tarball harness (npm pack of a fully built tree, then a clean `npm install --omit=dev <tarball>` into a scratch project) that evaluator_umbrella.sh runs in CI. They were NOT re-measured in this pass and their values remain the 2026-07-27 acceptance numbers — stated rather than invented. The next nightly writes the real numbers into measurement_record, and the drift check then reports any contradiction with last_measured on the PR that carries it."
27
29
  },
30
+ "removed_2026_08_04": "unpacked_size_mb (max 28) — removed by maintainer decision at the 9.17.0 release: the gate turned every legitimate payload addition into a blocked release (measured 28.22 vs max 28 with all functional gates green), and the maintainer judged tarball size not worth gating. evaluator_umbrella.sh still MEASURES and records unpacked_size_mb as evidence; only the budget enforcement is gone. ADR-204 review_trigger (a) fired and was resolved this way.",
28
31
  "budgets": {
29
- "unpacked_size_mb": {
30
- "max": 28,
31
- "last_measured": 26.05,
32
- "last_measured_at": "2026-07-27",
33
- "method": "npm pack --json → dist.unpackedSize / 1e6 — includes the Phase-1 precompiled bundles (dist/hooks/dispatch.js + dist/mcp/server.mjs, ~2.1 MB) that bought the 23x hook-latency win and the tsx removal, plus dist/cli-delegate/ (~1.40 MB, ADR-204) which finished that removal for the consumer command surface. This gate is the ONLY size trip-wire on those bundles by design: a dedicated per-bundle budget key would need its own measurement wired into evaluator_umbrella.sh, and an unwired key fails check_evaluator_budgets with 'no measurement supplied' instead of guarding anything. ADR-204 projected 27.45 against max 28 without packing — the next real measurement here is the confirming one, and headroom is thin"
34
- },
35
32
  "node_modules_mb": {
36
33
  "max": 140,
37
34
  "last_measured": 127,
@@ -61,11 +58,11 @@
61
58
  "deterministic": false
62
59
  },
63
60
  "cli_help_command_count": {
64
- "max": 81,
65
- "last_measured": 81,
66
- "last_measured_at": "2026-08-03",
61
+ "max": 84,
62
+ "last_measured": 84,
63
+ "last_measured_at": "2026-08-04",
67
64
  "method": "registry enumeration — count of `{ name: '...', disposition` entries in src/cli/registry.ts (NOT --help prose parsing; methods historically disagreed 74 vs 76 vs 79)",
68
- "baseline_note": "80 → 81 on 2026-08-03 (release 9.15.0 gate). This RECORDS growth that already shipped through its own reviewed PR; it does not authorize new surface. The +1 is f02db54c2 (fix(cli): register routing:doctor in the CLI registry) — the command existed, only its registry entry was missing, and the registering PR did not move this budget. The gate did its job again: breach WARNS on main and BLOCKS on release, which is the conscious-decision point rather than a silently raised cap. Re-measured 2026-08-03 via the pinned method: 81. Headroom stays zero by design — the next registry addition must move this number in its own PR."
65
+ "baseline_note": "80 → 81 on 2026-08-03 (release 9.15.0 gate). This RECORDS growth that already shipped through its own reviewed PR; it does not authorize new surface. The +1 is f02db54c2 (fix(cli): register routing:doctor in the CLI registry) — the command existed, only its registry entry was missing, and the registering PR did not move this budget. The gate did its job again: breach WARNS on main and BLOCKS on release, which is the conscious-decision point rather than a silently raised cap. Re-measured 2026-08-03 via the pinned method: 81. Headroom stays zero by design — the next registry addition must move this number in its own PR. 81 → 82 on 2026-08-04: the `handoff` subcommand (road-to-agent-handoff-resume Phase 4) registers in the same PR that adds the surface, per this record's own contract. Re-measured via the pinned method: 82. 82 → 84 on 2026-08-04: the `route:explain` + `route:audit` verbs (routing-correctness validation surface) register in the same PR that adds the surface. Re-measured via the pinned method: 84."
69
66
  },
70
67
  "mcp_public_tool_count": {
71
68
  "max": 19,
@@ -84,6 +84,12 @@
84
84
  # contract is `dist == rewrite(src)`; `check_ci_local_parity`, whose corpus is
85
85
  # workflow files) carries no recipe and is reported UNPROVEN, never green.
86
86
  gates:
87
+ - id: lint_trigger_collisions
88
+ argv: []
89
+ min_scanned: 90
90
+ corpus: "src/rules/*.md frontmatters (111 at baseline)"
91
+ status: enforced
92
+
87
93
  - id: check_condensation
88
94
  argv: []
89
95
  min_scanned: 380
@@ -260,6 +266,36 @@ gates:
260
266
  failure direction was false-positive rather than false-green, but the
261
267
  cause was the same dead root.
262
268
 
269
+ - id: lint_abstraction_thresholds
270
+ argv: []
271
+ min_scanned: 400
272
+ corpus: "src/rules + src/skills + src/agent-src/commands + docs/guidelines .md (533 at baseline)"
273
+ status: enforced
274
+ note: >
275
+ A collapse below the floor would mean the gate stopped reading the tree
276
+ that states extraction thresholds, so a bare or diverging threshold
277
+ (ADR-213 drift) could land while the gate still printed green.
278
+
279
+ - id: lint_profile_personas
280
+ argv: []
281
+ min_scanned: 5
282
+ corpus: "src/agent-src/profiles/*.yml (6 seed profiles at baseline)"
283
+ status: enforced
284
+ note: >
285
+ Fewer than 5 profiles scanned would mean the gate stopped reading the
286
+ seed-profile dir, so a defaults.personas id that resolves to no persona
287
+ file could land while the gate still printed green.
288
+
289
+ - id: lint_token_budget_discipline
290
+ argv: []
291
+ min_scanned: 200
292
+ corpus: "src/skills/*/SKILL.md (288 at baseline)"
293
+ status: enforced
294
+ note: >
295
+ A collapse below the floor would mean the gate stopped reading the skills
296
+ tree, so a rich-tagged skill without its justification section (or a cap
297
+ breach) could land while the gate still printed green.
298
+
263
299
  - id: lint_framework_leakage
264
300
  argv: []
265
301
  min_scanned: 350
@@ -272,3 +308,37 @@ gates:
272
308
  count. Its inventory-file exemption was also dead: it compared against
273
309
  the retired root AND against 'dist/agent-src' as a single path segment,
274
310
  which a '/'-split can never yield.
311
+
312
+ - id: lint_plan_risk_register
313
+ argv: []
314
+ min_scanned: 12
315
+ corpus: "ready roadmap files under agents/roadmaps/ top level (19 at baseline: 14 grandfathered + 4 draft-exempt + 1 carrying a live register)"
316
+ status: enforced
317
+ note: >
318
+ Gate R1 (docs/contracts/plan-review-gates.md § 1). The count is READY
319
+ FILES INSPECTED incl. grandfathered/draft-exempt ones — exemptions are
320
+ reported, never silently skipped, so a collapse below the floor means
321
+ the roadmaps root moved, not that the corpus went clean.
322
+
323
+ - id: check_completion_review
324
+ argv: ["--advisory", "--base", "origin/main"]
325
+ min_scanned: 1
326
+ corpus: "findings artefacts under agents/evidence/reviews/ + the current-diff evaluation (1 at baseline — the evaluation itself; artefact count grows with gated PRs)"
327
+ status: enforced
328
+ note: >
329
+ Gate R2 (docs/contracts/plan-review-gates.md § 2). HONEST LIMIT, stated
330
+ because a floor that cannot fail is exactly the false green this file
331
+ exists to prevent: scanned = artefacts inspected + 1 for the diff
332
+ evaluation, so it is >= 1 by construction and `min_scanned: 1` can never
333
+ trip. NOTHING ELSE TRIPS EITHER DURING THE ADVISORY WINDOW. The argv above
334
+ mirrors the CI invocation, and under `--advisory` every violation kind —
335
+ dead-scan-scope included — is printed as a warning and the exit code is 0.
336
+ So for the duration of the Stage-A window this entry proves only that the
337
+ gate RAN: it has no blocking path and no trippable floor. The blocking
338
+ behaviour is real but dormant — the dead-scan-scope assertion is a policy
339
+ violation, exit 1 (contract § 6 carve-out: a gate that read nothing has not
340
+ passed), which is what makes a moved reviews root fail loudly instead of
341
+ reporting a clean scope. It takes effect when Stage B drops `--advisory`
342
+ from the CI invocation; nothing else changes at that switch. The entry
343
+ stays registered so the guard reports this gate rather than skipping it
344
+ silently.
@@ -61,6 +61,8 @@ import {
61
61
  load_agent_settings,
62
62
  resolve_project_root,
63
63
  } from '../_lib/agent_settings.js';
64
+ import { trigger_matches } from '../_lib/router_match.js';
65
+ import type { Trigger } from '../_lib/router_match.js';
64
66
  import * as presets from '../config/presets.js';
65
67
  import * as profiles from '../config/profiles.js';
66
68
  import { build_trace } from './explain_last/index.js';
@@ -410,52 +412,51 @@ function pyReprAny(value: unknown): string {
410
412
  return String(value);
411
413
  }
412
414
 
413
- function _matches_trigger(trigger: Dict, text: string, lowered: string): string | null {
414
- if ('keyword' in trigger) {
415
- const kw = String(trigger['keyword']).toLowerCase();
416
- if (kw && lowered.includes(kw)) {
417
- return `keyword: ${kw}`;
415
+ /** `kind: value` label for a trigger's single match key. */
416
+ function _trigger_reason(trigger: Dict): string {
417
+ for (const kind of ['keyword', 'phrase', 'command', 'path_prefix', 'file_pattern']) {
418
+ if (kind in trigger) {
419
+ return `${kind}: ${String(trigger[kind])}`;
418
420
  }
419
421
  }
420
- if ('phrase' in trigger) {
421
- const ph = String(trigger['phrase']).toLowerCase();
422
- if (ph && lowered.includes(ph)) {
423
- return `phrase: ${ph}`;
424
- }
425
- }
426
- if ('path_prefix' in trigger) {
427
- const prefix = String(trigger['path_prefix']);
428
- if (prefix && text.includes(prefix)) {
429
- return `path_prefix: ${prefix}`;
430
- }
431
- }
432
- return null;
422
+ return `trigger: ${JSON.stringify(trigger)}`;
433
423
  }
434
424
 
435
425
  function _explain_route(project_root: string, text: string, as_json: boolean): number {
436
426
  const router = _load_router(project_root);
437
- const lowered = text.toLowerCase();
438
- const matches: Dict[] = [];
439
- const tier_1 = (router['tier_1'] as Dict[] | undefined) || [];
440
- for (const entry of tier_1) {
441
- const triggers = (entry['triggers'] as Dict[] | undefined) || [];
442
- for (const trig of triggers) {
443
- const reason = _matches_trigger(trig, text, lowered);
444
- if (reason !== null) {
445
- matches.push({ id: entry['id'], tier: 'tier_1', reason });
446
- break;
427
+ // Matching goes through the SHARED matcher (_lib/router_match) — anchored
428
+ // keyword semantics, both tiers. This surface carries no open-files /
429
+ // command context, so path_prefix / file_pattern / command triggers
430
+ // cannot match here (previously path_prefix was probed against the
431
+ // prompt TEXT — a divergent second matcher, removed on purpose).
432
+ const tier_1_matches: Dict[] = [];
433
+ const tier_2_matches: Dict[] = [];
434
+ for (const [tier, sink] of [
435
+ ['tier_1', tier_1_matches],
436
+ ['tier_2', tier_2_matches],
437
+ ] as Array<[string, Dict[]]>) {
438
+ const rules = (router[tier] as Dict[] | undefined) || [];
439
+ for (const entry of rules) {
440
+ const triggers = (entry['triggers'] as Dict[] | undefined) || [];
441
+ for (const trig of triggers) {
442
+ if (trigger_matches(trig as Trigger, text, null, null)) {
443
+ sink.push({ id: entry['id'], tier, reason: _trigger_reason(trig) });
444
+ break;
445
+ }
447
446
  }
448
447
  }
449
448
  }
449
+ const total = tier_1_matches.length + tier_2_matches.length;
450
450
  const kernel_always = [...((router['kernel'] as unknown[] | undefined) || [])];
451
451
  const payload: Dict = {
452
452
  input: text,
453
453
  kernel_always,
454
- tier_1_matches: matches,
454
+ tier_1_matches,
455
+ tier_2_matches,
455
456
  };
456
457
  if (as_json) {
457
458
  _dumpJson(payload);
458
- return 0;
459
+ return total === 0 ? 1 : 0;
459
460
  }
460
461
  print(` input: ${pyReprStr(text)}`);
461
462
  print();
@@ -464,14 +465,19 @@ function _explain_route(project_root: string, text: string, as_json: boolean): n
464
465
  print(` · ${pyStr(kid)}`);
465
466
  }
466
467
  print();
467
- print(` tier-1 matches (${matches.length}):`);
468
- if (matches.length === 0) {
469
- print(' · (no trigger matched — only kernel rules active)');
470
- return 1;
468
+ print(` tier-1 matches (${tier_1_matches.length}):`);
469
+ for (const match of tier_1_matches) {
470
+ print(` · ${match['id']} (${match['reason']})`);
471
471
  }
472
- for (const match of matches) {
472
+ print();
473
+ print(` tier-2 matches (${tier_2_matches.length}):`);
474
+ for (const match of tier_2_matches) {
473
475
  print(` · ${match['id']} (${match['reason']})`);
474
476
  }
477
+ if (total === 0) {
478
+ print(' · (no trigger matched — only kernel rules active)');
479
+ return 1;
480
+ }
475
481
  return 0;
476
482
  }
477
483
 
@@ -757,7 +763,6 @@ export {
757
763
  _explain_config,
758
764
  _find_rule,
759
765
  _explain_rule,
760
- _matches_trigger,
761
766
  _explain_route,
762
767
  _explain_last,
763
768
  _LAST_HELP,