@event4u/agent-config 16.0.0 → 16.2.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 (382) hide show
  1. package/.augment-plugin/marketplace.json +3 -3
  2. package/.augment-plugin/plugin.json +1 -1
  3. package/.claude-plugin/marketplace.json +1 -1
  4. package/CHANGELOG.md +289 -140
  5. package/CONTRIBUTING.md +9 -0
  6. package/README.md +2 -2
  7. package/dist/agent-src/commands/analyze/inbox.md +26 -0
  8. package/dist/agent-src/commands/analyze/roadmap-repos.md +27 -0
  9. package/dist/agent-src/commands/challenge-me/closure.md +178 -0
  10. package/dist/agent-src/commands/challenge-me.md +9 -2
  11. package/dist/agent-src/commands/council/default.md +25 -5
  12. package/dist/agent-src/commands/feature/plan.md +28 -1
  13. package/dist/agent-src/commands/feature/roadmap.md +28 -1
  14. package/dist/agent-src/commands/implement-ticket.md +27 -0
  15. package/dist/agent-src/commands/jira-ticket.md +27 -0
  16. package/dist/agent-src/commands/pr/create.md +29 -0
  17. package/dist/agent-src/commands/pr/merge.md +60 -9
  18. package/dist/agent-src/commands/roadmap/ai-council.md +7 -1
  19. package/dist/agent-src/commands/roadmap/create.md +74 -27
  20. package/dist/agent-src/commands/roadmap/materialize.md +27 -0
  21. package/dist/agent-src/commands/roadmap/process-full.md +123 -18
  22. package/dist/agent-src/commands/team.md +22 -0
  23. package/dist/agent-src/commands/work.md +4 -0
  24. package/dist/agent-src/contexts/authority/scope-growth-ownership.md +80 -0
  25. package/dist/agent-src/contexts/communication/rules-auto/user-interaction-mechanics.md +47 -0
  26. package/dist/agent-src/contexts/execution/auto-orchestration-activation.md +44 -3
  27. package/dist/agent-src/contexts/execution/autonomy-mechanics.md +19 -23
  28. package/dist/agent-src/contexts/execution/decision-closure-execution.md +93 -0
  29. package/dist/agent-src/contexts/execution/fix-loop-ladder.md +108 -0
  30. package/dist/agent-src/contexts/execution/plan-confidence-gate.md +4 -2
  31. package/dist/agent-src/contexts/execution/roadmap-process-loop.md +75 -6
  32. package/dist/agent-src/guidelines/agent-infra/active-remediation-mechanics.md +57 -0
  33. package/dist/agent-src/guidelines/agent-infra/evaluator-independence-mechanics.md +102 -0
  34. package/dist/agent-src/guidelines/design-fidelity-routing.md +29 -0
  35. package/dist/agent-src/rules/autonomous-execution.md +15 -8
  36. package/dist/agent-src/rules/delegation-policy.md +23 -45
  37. package/dist/agent-src/rules/design-fidelity.md +32 -37
  38. package/dist/agent-src/rules/evaluator-independence.md +43 -49
  39. package/dist/agent-src/rules/test-first.md +41 -0
  40. package/dist/agent-src/rules/ui-audit-gate.md +1 -2
  41. package/dist/agent-src/skills/accessibility-auditor/data/aria-patterns.csv +1 -1
  42. package/dist/agent-src/skills/accessibility-auditor/data/manifest.json +3 -3
  43. package/dist/agent-src/skills/ai-council/SKILL.md +11 -3
  44. package/dist/agent-src/skills/api-design/data/manifest.json +3 -3
  45. package/dist/agent-src/skills/database/data/manifest.json +4 -4
  46. package/dist/agent-src/skills/database/data/query-tuning.csv +3 -3
  47. package/dist/agent-src/skills/design-review/SKILL.md +80 -4
  48. package/dist/agent-src/skills/design-review/references/verification-automation.md +32 -0
  49. package/dist/agent-src/skills/existing-ui-audit/SKILL.md +30 -5
  50. package/dist/agent-src/skills/existing-ui-audit/references/component-taxonomy-detection.md +56 -0
  51. package/dist/agent-src/skills/experiment-loop/SKILL.md +31 -1
  52. package/dist/agent-src/skills/markitdown/SKILL.md +4 -0
  53. package/dist/agent-src/skills/playwright-testing/SKILL.md +30 -6
  54. package/dist/agent-src/skills/roadmap-writing/SKILL.md +1 -1
  55. package/dist/agent-src/skills/storybook-workshop/SKILL.md +42 -3
  56. package/dist/agent-src/skills/threat-modeling/SKILL.md +9 -4
  57. package/dist/agent-src/skills/threat-modeling/data/manifest.json +4 -4
  58. package/dist/agent-src/skills/ui-component-architect/SKILL.md +23 -0
  59. package/dist/agent-src/skills/verify-repair-loop/SKILL.md +37 -3
  60. package/dist/agent-src/templates/agent-settings.md +1 -1
  61. package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
  62. package/dist/agent-src/templates/roadmaps.md +218 -0
  63. package/dist/agent-src/templates/scripts/work_engine/directives/backend/_self_fix.ts +62 -2
  64. package/dist/agent-src/templates/scripts/work_engine/directives/backend/test.ts +1 -0
  65. package/dist/agent-src/templates/scripts/work_engine/directives/backend/verify.ts +1 -0
  66. package/dist/agent-src/templates/scripts/work_engine/directives/ui/app_spec.ts +10 -4
  67. package/dist/agent-src/templates/scripts/work_engine/directives/ui/apply.ts +260 -21
  68. package/dist/agent-src/templates/scripts/work_engine/directives/ui/audit.ts +22 -3
  69. package/dist/agent-src/templates/scripts/work_engine/directives/ui/scaffold.ts +6 -1
  70. package/dist/agent-src/templates/scripts/work_engine/state.ts +57 -7
  71. package/dist/agent-src/templates/scripts/work_engine/taxonomy/detect.ts +500 -0
  72. package/dist/agent-src/templates/scripts/work_engine/taxonomy/place.ts +183 -0
  73. package/dist/cli/python/knowledge_ingest.js +1 -1
  74. package/dist/cli/python/workspace_drive.js +1 -1
  75. package/dist/cli-delegate/check_update_banner.js +40 -2
  76. package/dist/cli-delegate/chunk-4E2W63DA.js +335 -0
  77. package/dist/cli-delegate/{chunk-S3VFXMTM.js → chunk-4XFP2Y3E.js} +1 -1
  78. package/dist/cli-delegate/chunk-5R7HOLAF.js +99 -0
  79. package/dist/cli-delegate/{chunk-IVBPRCQO.js → chunk-6KFEC3G7.js} +1 -1
  80. package/dist/cli-delegate/{chunk-2TAQ2K4V.js → chunk-6KM6ORRY.js} +55 -386
  81. package/dist/cli-delegate/{chunk-AK6HODNQ.js → chunk-7XGBX6ZH.js} +973 -555
  82. package/dist/cli-delegate/{chunk-2XY7ILBT.js → chunk-FC75PGJE.js} +42 -2
  83. package/dist/cli-delegate/{chunk-55ACLDUE.js → chunk-FP36SWJD.js} +587 -141
  84. package/dist/cli-delegate/{chunk-3FKR64R5.js → chunk-IGD6ERX6.js} +62 -7
  85. package/dist/cli-delegate/{chunk-GYC3VRYN.js → chunk-JNMVLWLR.js} +99 -14
  86. package/dist/cli-delegate/{chunk-H32DGUJH.js → chunk-P6ZHP5W2.js} +1 -1
  87. package/dist/cli-delegate/{chunk-57PN4GYJ.js → chunk-RGNIWTEA.js} +1 -1
  88. package/dist/cli-delegate/chunk-ROYYTEZU.js +39 -0
  89. package/dist/cli-delegate/{chunk-2DK2VJWG.js → chunk-WGXTVKCQ.js} +20 -6
  90. package/dist/cli-delegate/chunk-YDPILCOL.js +152 -0
  91. package/dist/cli-delegate/{chunk-QJWAUMJW.js → chunk-YJ72UIAK.js} +730 -15
  92. package/dist/cli-delegate/cmd_analyze_session.js +1 -1
  93. package/dist/cli-delegate/cmd_brand_status.js +1 -1
  94. package/dist/cli-delegate/cmd_conformance.js +985 -831
  95. package/dist/cli-delegate/cmd_doctor.js +7 -5
  96. package/dist/cli-delegate/cmd_explain.js +2 -2
  97. package/dist/cli-delegate/cmd_export.js +9 -7
  98. package/dist/cli-delegate/cmd_fleet.js +4 -2
  99. package/dist/cli-delegate/cmd_handoff.js +7 -7
  100. package/dist/cli-delegate/cmd_mcp_available.js +1 -1
  101. package/dist/cli-delegate/cmd_memory_get.js +1 -1
  102. package/dist/cli-delegate/cmd_migrate.js +2 -2
  103. package/dist/cli-delegate/cmd_packs_active.js +2 -2
  104. package/dist/cli-delegate/cmd_preflight.js +4 -2
  105. package/dist/cli-delegate/cmd_prune.js +10 -8
  106. package/dist/cli-delegate/cmd_route_audit.js +3 -3
  107. package/dist/cli-delegate/cmd_route_explain.js +1 -1
  108. package/dist/cli-delegate/cmd_session_recycle.js +4 -4
  109. package/dist/cli-delegate/cmd_settings_get.js +28 -2
  110. package/dist/cli-delegate/cmd_settings_migrate.js +9 -7
  111. package/dist/cli-delegate/cmd_settings_set.js +1 -1
  112. package/dist/cli-delegate/cmd_sync.js +10 -8
  113. package/dist/cli-delegate/cmd_uninstall.js +16 -13
  114. package/dist/cli-delegate/cmd_update.js +1 -1
  115. package/dist/cli-delegate/cmd_upgrade.js +1 -1
  116. package/dist/cli-delegate/cmd_validate.js +12 -10
  117. package/dist/cli-delegate/cmd_versions.js +1 -1
  118. package/dist/discovery/deprecation-report.md +1 -1
  119. package/dist/discovery/discovery-manifest.json +90 -43
  120. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  121. package/dist/discovery/discovery-manifest.summary.md +4 -4
  122. package/dist/discovery/dormancy-report.md +1 -1
  123. package/dist/discovery/orphan-report.md +1 -1
  124. package/dist/discovery/packs.json +10 -8
  125. package/dist/discovery/trust-report.md +3 -3
  126. package/dist/discovery/workspaces.json +8 -6
  127. package/dist/hooks/dispatch.js +7682 -2772
  128. package/dist/hooks/dispatch.sha256 +1 -0
  129. package/dist/install/claudeRuleRewrite.js +14 -3
  130. package/dist/install/conflict.js +60 -10
  131. package/dist/install/conflictTracker.js +218 -0
  132. package/dist/install/fsPrimitives.js +54 -0
  133. package/dist/install/install.mjs +2200 -1559
  134. package/dist/install/manifestFiles.js +259 -0
  135. package/dist/install/preflight.js +14 -2
  136. package/dist/install/preserve.js +157 -0
  137. package/dist/install/recordedOwnership.js +132 -0
  138. package/dist/install/txlog.js +11 -2
  139. package/dist/mcp/registry-manifest.json +3 -3
  140. package/dist/mcp/server.json +2 -2
  141. package/dist/mcp/server.mjs +3066 -1470
  142. package/dist/router.json +1 -1
  143. package/dist/scripts/_lib/agent_settings.js +3 -2
  144. package/dist/scripts/_lib/fs_atomic.js +167 -0
  145. package/dist/scripts/_lib/installed_tools.js +460 -0
  146. package/dist/scripts/_lib/lean_projection_mode.js +3 -2
  147. package/dist/scripts/_lib/settings_renamed_keys.js +78 -0
  148. package/dist/server/routes/install.js +8 -0
  149. package/dist/server/routes/wizard.js +9 -3
  150. package/dist/server/schemas/settings.js +40 -5
  151. package/dist/shared/missionExecution.js +97 -0
  152. package/dist/ui/assets/index-Cwq4d0hX.js +23 -0
  153. package/dist/ui/assets/index-Cyjy8bWO.css +1 -0
  154. package/dist/ui/index.html +2 -2
  155. package/docs/MIGRATION.md +103 -0
  156. package/docs/contracts/settings-classes.md +28 -7
  157. package/docs/guidelines/agent-infra/active-remediation-mechanics.md +57 -0
  158. package/docs/guidelines/agent-infra/evaluator-independence-mechanics.md +102 -0
  159. package/docs/guidelines/design-fidelity-routing.md +29 -0
  160. package/package.json +4 -4
  161. package/src/agent-src/templates/scripts/work_engine/directives/backend/_self_fix.ts +62 -2
  162. package/src/agent-src/templates/scripts/work_engine/directives/backend/test.ts +1 -0
  163. package/src/agent-src/templates/scripts/work_engine/directives/backend/verify.ts +1 -0
  164. package/src/agent-src/templates/scripts/work_engine/directives/ui/app_spec.ts +10 -4
  165. package/src/agent-src/templates/scripts/work_engine/directives/ui/apply.ts +260 -21
  166. package/src/agent-src/templates/scripts/work_engine/directives/ui/audit.ts +22 -3
  167. package/src/agent-src/templates/scripts/work_engine/directives/ui/scaffold.ts +6 -1
  168. package/src/agent-src/templates/scripts/work_engine/state.ts +57 -7
  169. package/src/agent-src/templates/scripts/work_engine/taxonomy/detect.ts +500 -0
  170. package/src/agent-src/templates/scripts/work_engine/taxonomy/place.ts +183 -0
  171. package/src/config/agent-settings.template.yml +168 -27
  172. package/src/config/auto-rule-budget.json +16 -0
  173. package/src/config/ci-local-parity.yml +36 -5
  174. package/src/config/continuity-surface.json +23 -2
  175. package/src/config/gate-coverage.yml +377 -13
  176. package/src/config/gate-violation-baselines.json +10 -6
  177. package/src/config/hook-latency-budget.json +21 -0
  178. package/src/config/hook-token-budget.json +4 -2
  179. package/src/config/loop-surfaces.yaml +215 -0
  180. package/src/config/metric-registry.yml +114 -0
  181. package/src/config/placeholder-drift-budget.json +10 -0
  182. package/src/config/platform-anchor.json +3 -2
  183. package/src/config/release-gate-locality.yml +11 -0
  184. package/src/config/routing-coverage-seed.json +33 -5
  185. package/src/config/rule-enforcement-baseline.json +0 -1
  186. package/src/install/claudeRuleRewrite.ts +16 -2
  187. package/src/install/conflict.ts +65 -9
  188. package/src/install/conflictTracker.ts +299 -0
  189. package/src/install/fsPrimitives.ts +54 -0
  190. package/src/install/manifestFiles.ts +312 -0
  191. package/src/install/preflight.ts +16 -2
  192. package/src/install/preserve.ts +205 -0
  193. package/src/install/recordedOwnership.ts +149 -0
  194. package/src/install/txlog.ts +11 -2
  195. package/src/install/types.ts +19 -4
  196. package/src/scripts/_cli/cmd_conformance.ts +88 -15
  197. package/src/scripts/_cli/cmd_doctor.ts +7 -20
  198. package/src/scripts/_cli/cmd_route_explain.ts +9 -2
  199. package/src/scripts/_cli/cmd_settings_get.ts +44 -0
  200. package/src/scripts/_cli/doctor_execution.ts +173 -0
  201. package/src/scripts/_cli/doctor_network_posture.ts +226 -0
  202. package/src/scripts/_lib/activation_payload.ts +247 -0
  203. package/src/scripts/_lib/agent_settings.ts +4 -2
  204. package/src/scripts/_lib/authority_path.ts +102 -0
  205. package/src/scripts/_lib/body_portable.ts +102 -0
  206. package/src/scripts/_lib/cascade_base.ts +94 -0
  207. package/src/scripts/_lib/cc_transcript.ts +132 -1
  208. package/src/scripts/_lib/changelog_eras.ts +7 -2
  209. package/src/scripts/_lib/concern_sla_window.ts +200 -0
  210. package/src/scripts/_lib/continuation_ladder.ts +149 -2
  211. package/src/scripts/_lib/council_transport.ts +129 -0
  212. package/src/scripts/_lib/delivery_ready.ts +112 -0
  213. package/src/scripts/_lib/forge_protection.ts +381 -0
  214. package/src/scripts/_lib/forge_reader.ts +558 -0
  215. package/src/scripts/_lib/hook_platform_keys.ts +27 -0
  216. package/src/scripts/_lib/host_env_write.ts +111 -0
  217. package/src/scripts/_lib/json_python_parity.ts +127 -0
  218. package/src/scripts/_lib/lean_projection_mode.ts +14 -3
  219. package/src/scripts/_lib/llm_proposer_transport.ts +14 -4
  220. package/src/scripts/_lib/loop_surfaces.ts +382 -0
  221. package/src/scripts/_lib/mission_record.ts +190 -0
  222. package/src/scripts/_lib/obligation_frequency.ts +217 -0
  223. package/src/scripts/_lib/obligations.ts +513 -0
  224. package/src/scripts/_lib/orchestration_record.ts +11 -20
  225. package/src/scripts/_lib/probe_inputs.ts +271 -0
  226. package/src/scripts/_lib/read_surface_scan.ts +322 -0
  227. package/src/scripts/_lib/release_highlights.ts +201 -11
  228. package/src/scripts/_lib/release_holds.ts +493 -0
  229. package/src/scripts/_lib/release_migration_gate.ts +184 -0
  230. package/src/scripts/_lib/retrieval_sanitize.ts +77 -16
  231. package/src/scripts/_lib/rides_along.ts +102 -0
  232. package/src/scripts/_lib/settings_renamed_keys.ts +82 -0
  233. package/src/scripts/_lib/shell_write_shapes.ts +108 -0
  234. package/src/scripts/_lib/structural_hiding.ts +622 -0
  235. package/src/scripts/_lib/test_delta.ts +166 -0
  236. package/src/scripts/_lib/test_provenance.ts +171 -0
  237. package/src/scripts/_lib/turn_end_refusals.ts +525 -4
  238. package/src/scripts/_lib/turn_end_transcript.ts +216 -0
  239. package/src/scripts/_lib/typed_op_grant.ts +246 -0
  240. package/src/scripts/_lib/typed_op_watch.ts +185 -0
  241. package/src/scripts/_lib/verification_command.ts +324 -0
  242. package/src/scripts/_lib/verification_evidence.ts +647 -0
  243. package/src/scripts/_lib/verify_clause.ts +280 -0
  244. package/src/scripts/ai_council/config.ts +8 -11
  245. package/src/scripts/ai_council/fallback_config.ts +5 -3
  246. package/src/scripts/ai_council/ownership_classes.ts +118 -0
  247. package/src/scripts/ai_team/team_dispatch.ts +4 -0
  248. package/src/scripts/ask_block_census.ts +285 -15
  249. package/src/scripts/before_complete_hook.ts +340 -23
  250. package/src/scripts/bench_hook_latency.ts +412 -5
  251. package/src/scripts/cache_realization_report.ts +61 -1
  252. package/src/scripts/check_argument_hint.ts +287 -0
  253. package/src/scripts/check_claims.ts +125 -1
  254. package/src/scripts/check_enforcement_coverage.ts +38 -9
  255. package/src/scripts/check_enforcement_matrix.ts +866 -0
  256. package/src/scripts/check_finding_dispositions.ts +22 -3
  257. package/src/scripts/check_gate_reachability.ts +173 -10
  258. package/src/scripts/check_generator_sync.ts +1025 -0
  259. package/src/scripts/check_host_docs_digest.ts +786 -0
  260. package/src/scripts/check_host_format_column.ts +559 -0
  261. package/src/scripts/check_input_references.ts +228 -0
  262. package/src/scripts/check_inputs_parity.ts +235 -0
  263. package/src/scripts/check_kernel_edit_ratified.ts +47 -5
  264. package/src/scripts/check_kill_switch_table.ts +294 -0
  265. package/src/scripts/check_placeholder_drift.ts +221 -0
  266. package/src/scripts/check_preamble_payload_budget.ts +75 -2
  267. package/src/scripts/check_read_surface_coverage.ts +515 -0
  268. package/src/scripts/check_release_highlights.ts +33 -1
  269. package/src/scripts/check_release_holds.ts +568 -0
  270. package/src/scripts/check_routing_coverage.ts +378 -11
  271. package/src/scripts/check_rule_projection_integrity.ts +22 -12
  272. package/src/scripts/check_static_parity.ts +17 -0
  273. package/src/scripts/check_test_delta.ts +294 -0
  274. package/src/scripts/check_test_weakening.ts +299 -0
  275. package/src/scripts/ci_settle.ts +145 -19
  276. package/src/scripts/closure_scan.ts +447 -0
  277. package/src/scripts/compile_hook_manifest.ts +102 -18
  278. package/src/scripts/council_record_shape.ts +209 -0
  279. package/src/scripts/external_sources_denylist.json +29 -4
  280. package/src/scripts/hook_manifest.json +1 -1
  281. package/src/scripts/hook_manifest.yaml +127 -11
  282. package/src/scripts/hooks/block_config_weakening.ts +229 -4
  283. package/src/scripts/hooks/block_kernel_rule_writes.ts +9 -78
  284. package/src/scripts/hooks/block_plumbing_writes.ts +314 -0
  285. package/src/scripts/hooks/bundle_integrity.ts +291 -0
  286. package/src/scripts/hooks/chain_nudge_hook.ts +1 -2
  287. package/src/scripts/hooks/code_graph_context_hook.ts +1 -2
  288. package/src/scripts/hooks/comment_discipline_hook.ts +1 -3
  289. package/src/scripts/hooks/concern_registry.ts +6 -0
  290. package/src/scripts/hooks/concern_timings.ts +94 -0
  291. package/src/scripts/hooks/delegation_nudge_hook.ts +1 -2
  292. package/src/scripts/hooks/design_pass_hook.ts +221 -5
  293. package/src/scripts/hooks/design_slop_hook.ts +1 -2
  294. package/src/scripts/hooks/dispatch_hook.ts +25 -19
  295. package/src/scripts/hooks/edit_shape_hook.ts +1 -2
  296. package/src/scripts/hooks/end_review_nudge_hook.ts +1 -1
  297. package/src/scripts/hooks/evidence_independence.ts +97 -2
  298. package/src/scripts/hooks/exit_codes.ts +128 -0
  299. package/src/scripts/hooks/host_lowering.json +1 -0
  300. package/src/scripts/hooks/host_lowering.ts +128 -3
  301. package/src/scripts/hooks/host_lowering.yaml +262 -46
  302. package/src/scripts/hooks/host_semantics.ts +30 -2
  303. package/src/scripts/hooks/injection_budget.ts +9 -2
  304. package/src/scripts/hooks/interruption_ledger_hook.ts +1 -2
  305. package/src/scripts/hooks/journal_record_hook.ts +1 -2
  306. package/src/scripts/hooks/memory_recall_hook.ts +539 -0
  307. package/src/scripts/hooks/obligation_settle_hook.ts +328 -0
  308. package/src/scripts/hooks/one_question_per_ask_hook.ts +25 -4
  309. package/src/scripts/hooks/orchestration_record_hook.ts +1 -2
  310. package/src/scripts/hooks/permission_gate.ts +1 -2
  311. package/src/scripts/hooks/push_settle_hook.ts +1 -3
  312. package/src/scripts/hooks/replay_hook.ts +2 -1
  313. package/src/scripts/hooks/reread_guard_hook.ts +1 -2
  314. package/src/scripts/hooks/review_baseline_hook.ts +1 -2
  315. package/src/scripts/hooks/rtk_wrap_hook.ts +1 -2
  316. package/src/scripts/hooks/rule_inject_hook.ts +55 -4
  317. package/src/scripts/hooks/run_continuation_hook.ts +30 -35
  318. package/src/scripts/hooks/skill_route_hook.ts +1 -2
  319. package/src/scripts/hooks/source_first_gate_hook.ts +1 -2
  320. package/src/scripts/hooks/spawn_guard_shadow_hook.ts +1 -2
  321. package/src/scripts/hooks/subagent_ledger_hook.ts +1 -2
  322. package/src/scripts/hooks/suggestion_capture_hook.ts +1 -1
  323. package/src/scripts/hooks/table_fingerprint.ts +49 -0
  324. package/src/scripts/hooks/telemetry_flush_hook.ts +1 -2
  325. package/src/scripts/hooks/telemetry_usage_hook.ts +1 -2
  326. package/src/scripts/hooks/tool_result_bytes_hook.ts +93 -9
  327. package/src/scripts/hooks/turn_end_gate_hook.ts +337 -324
  328. package/src/scripts/hooks/ui_route_nudge_hook.ts +1 -2
  329. package/src/scripts/hooks_doctor.ts +85 -0
  330. package/src/scripts/hooks_status.ts +19 -0
  331. package/src/scripts/install.ts +109 -210
  332. package/src/scripts/janitor.ts +7 -0
  333. package/src/scripts/lint_decision_classes.ts +464 -0
  334. package/src/scripts/lint_deny_text.ts +419 -0
  335. package/src/scripts/lint_exit_codes.ts +262 -0
  336. package/src/scripts/lint_hook_manifest.ts +66 -0
  337. package/src/scripts/lint_major_migration_sections.ts +450 -0
  338. package/src/scripts/lint_plan_risk_register.ts +47 -3
  339. package/src/scripts/lint_roadmap_blockers.ts +139 -12
  340. package/src/scripts/lint_roadmap_producers.ts +202 -0
  341. package/src/scripts/lint_skill_descriptions.ts +1 -1
  342. package/src/scripts/lint_skill_scripts_readonly.ts +1 -1
  343. package/src/scripts/mcp_server/prompts.ts +142 -1
  344. package/src/scripts/measure_rule_budget.ts +101 -5
  345. package/src/scripts/measure_skill_ranker_baseline.ts +305 -51
  346. package/src/scripts/measure_turn_end_gate.ts +193 -0
  347. package/src/scripts/memory_lookup.ts +1 -1
  348. package/src/scripts/new_roadmap.ts +37 -0
  349. package/src/scripts/orchestration_record.ts +0 -5
  350. package/src/scripts/prepack-check.mjs +53 -0
  351. package/src/scripts/release.ts +14 -98
  352. package/src/scripts/release_drill.ts +267 -1
  353. package/src/scripts/release_publication.ts +64 -1
  354. package/src/scripts/report_enforcement_drift.ts +566 -0
  355. package/src/scripts/report_host_injection_effect.ts +3 -11
  356. package/src/scripts/report_invocation_surface.ts +383 -0
  357. package/src/scripts/report_obligation_carriers.ts +699 -0
  358. package/src/scripts/report_obligation_writer_split.ts +236 -0
  359. package/src/scripts/report_skill_menu_census.ts +208 -0
  360. package/src/scripts/report_standing_payload_by_host.ts +26 -152
  361. package/src/scripts/roadmap_verify_share.ts +213 -0
  362. package/src/scripts/schemas/agent-settings.schema.json +23 -0
  363. package/src/scripts/schemas/command.schema.json +48 -0
  364. package/src/scripts/schemas/review-findings.schema.json +4 -0
  365. package/src/scripts/schemas/skill.schema.json +44 -0
  366. package/src/scripts/scope_growth.ts +219 -0
  367. package/src/scripts/self_review_gate.ts +359 -10
  368. package/src/scripts/semantic_parity_census.ts +314 -0
  369. package/src/scripts/session_eol_report.ts +54 -1
  370. package/src/scripts/sweep_dead_scan_roots.ts +1 -1
  371. package/src/scripts/trigger_eval_grandfather.json +0 -3
  372. package/src/scripts/trigger_eval_rotation.ts +122 -27
  373. package/src/scripts/ui_conformance_probe.ts +774 -0
  374. package/src/scripts/update_prices.ts +85 -3
  375. package/src/scripts/write_bundle_digest.mjs +74 -0
  376. package/src/server/schemas/settings.ts +62 -7
  377. package/src/shared/missionExecution.ts +126 -0
  378. package/src/templates/consumer-settings/ONBOARDING.md +1 -0
  379. package/dist/cli-delegate/chunk-523HCFYO.js +0 -90
  380. package/dist/ui/assets/index-D0jaCRPM.js +0 -29
  381. package/dist/ui/assets/index-jSfMW8_t.css +0 -1
  382. /package/dist/cli-delegate/{chunk-YUM5KURG.js → chunk-7RQP4UDH.js} +0 -0
@@ -0,0 +1,324 @@
1
+ /**
2
+ * The verification-command selector — one predicate, two importers.
3
+ *
4
+ * It first moved here byte-identical out of `hooks/turn_end_gate_hook.ts` so
5
+ * that `_lib/verification_evidence.ts` could read it without importing a hook
6
+ * that imports the evidence module straight back. That cycle resolves at
7
+ * runtime today and breaks the day either side grows a module-level constant
8
+ * reading the other, which is a failure nobody would trace to an import line.
9
+ *
10
+ * The hook re-exports the name, so every existing consumer — including both
11
+ * pinning test files — addresses it at the path it always did.
12
+ *
13
+ * WHY IT STOPPED BEING A REGEX (2026-09-30).
14
+ * The tree carried TWO expressions answering "did this command verify
15
+ * anything", and they disagreed in both directions:
16
+ *
17
+ * - `_VERIFY_RE` here matched a verification token **anywhere on the line**, so
18
+ * `ls tests`, `cat build.log`, `git checkout main`, `mkdir build` and
19
+ * `git commit -m "fix ci"` all cleared detector C — the exact case this
20
+ * header claimed to reject. Measured at the pin: all six returned `true`.
21
+ * - `_VERIFICATION_RE` in `before_complete_hook.ts` was head-anchored to a
22
+ * fixed vendor list and refused `npx vitest run`, `tsc --noEmit` and every
23
+ * `./scripts-run src/scripts/lint_*` — commands this project runs constantly.
24
+ * Measured at the pin: all three returned `false`.
25
+ *
26
+ * Both accepted `npm test || true`, where the shell discards the failure.
27
+ *
28
+ * The audited allowlist passed the whole time the first defect was live,
29
+ * because not one of its seven negatives put a verify token in an ARGUMENT
30
+ * position. A word-boundary regex cannot express "the head of the segment",
31
+ * which is the property that actually distinguishes `npm test` from `ls tests`,
32
+ * so the predicate is now structural: split on shell separators, drop a
33
+ * segment whose failure the shell discards, and classify each remaining
34
+ * segment on its HEAD.
35
+ *
36
+ * THE LISTS ARE STILL DELIBERATELY NARROW.
37
+ * A positive list. The alternative — treating any `Bash` call as verification —
38
+ * was rejected because `ls` would then clear an unverified edit, which is the
39
+ * failure mode `verify-before-complete` names ("relying on partial
40
+ * verification"). The cost of narrowness is a MISSED detection when a project
41
+ * verifies by some command not listed here, and that is the safe direction for
42
+ * a gate that can refuse a turn: a false negative costs one unguarded turn, a
43
+ * false positive teaches the user to switch the gate off.
44
+ *
45
+ * AUDITED 2026-08-17, re-seeded 2026-09-30 from the union of both lists minus
46
+ * every row that only ever matched on an argument. The table of every command
47
+ * with its verdict is `turn_end_verify_allowlist.test.ts`; the two directions
48
+ * of the old disagreement are `verification_command_anchoring.test.ts`.
49
+ *
50
+ * Deliberate NON-additions, kept because Risk 2 of the originating roadmap is
51
+ * that every addition is a way to satisfy the gate without verifying anything:
52
+ *
53
+ * · `npm run prepack` — a lifecycle hook whose content is per-project. Here
54
+ * it validates; elsewhere it copies files.
55
+ * · `task sync` / `task generate-tools` / `agent-config roadmap:progress` —
56
+ * GENERATORS. They rewrite the tree; they check nothing.
57
+ * · `agent-config gates --all` — enumerates gates, runs none.
58
+ * · `rector` — a refactoring tool. Its dry run prints a diff; it asserts
59
+ * nothing. It appears in `_VERIFICATION_RE`'s list and is dropped from the
60
+ * union on the strength of the audited `false` row, which carries a reason
61
+ * where the other list carried only a name.
62
+ * · `./scripts-run src/scripts/rule_activation_census` — a census writes a
63
+ * report; it asserts nothing. This is why the `scripts-run` rule keys on
64
+ * the `check_` / `lint_` prefix rather than on the runner.
65
+ *
66
+ * `psalm` IS carried, unlike the pre-2026-09-30 note here which argued it out
67
+ * for want of a local user: it was in `_VERIFICATION_RE` all along, so the
68
+ * union rule admits it and dropping it would be a narrowing this change did not
69
+ * set out to make.
70
+ *
71
+ * WHAT THIS SELECTOR STILL CANNOT DO: it reads the command TEXT, so
72
+ * `vitest run` matches whether or not it passed. Deciding whether a run proved
73
+ * anything is `verification_evidence.ts`, which reads the exit code and the
74
+ * summary the command printed. This selector decides only what is WORTH
75
+ * recording and classifying.
76
+ */
77
+
78
+ /** Binaries that verify when they are the head of a segment. */
79
+ const VERIFY_BINARIES: ReadonlySet<string> = new Set([
80
+ 'vitest',
81
+ 'jest',
82
+ 'pytest',
83
+ 'phpunit',
84
+ 'pest',
85
+ 'tsc',
86
+ 'eslint',
87
+ 'ruff',
88
+ 'mypy',
89
+ 'pyright',
90
+ 'clippy',
91
+ 'phpstan',
92
+ 'psalm',
93
+ 'ecs',
94
+ ]);
95
+
96
+ /** Prefixes that delegate to the real command; dropped before classifying. */
97
+ const DELEGATING_HEADS: ReadonlySet<string> = new Set([
98
+ 'npx',
99
+ 'bunx',
100
+ 'sudo',
101
+ 'time',
102
+ 'command',
103
+ ]);
104
+
105
+ /** Path prefixes a binary is commonly reached through. */
106
+ const PATH_PREFIXES: readonly string[] = [
107
+ './',
108
+ 'vendor/bin/',
109
+ '.venv/bin/',
110
+ 'node_modules/.bin/',
111
+ 'bin/',
112
+ ];
113
+
114
+ /** A script or subcommand name that names a check rather than a build step. */
115
+ const VERIFY_WORD = /(^|[-_:])(test|tests|check|checks|lint|typecheck|tsc|qa|preflight|smoke|validate)([-_:]|$)/i;
116
+
117
+ /** `npm run build` verifies here; `task build` is not in the audited surface. */
118
+ const NPM_SCRIPT_WORD = /(^|[-_:])(test|tests|check|checks|lint|typecheck|tsc|build)([-_:]|$)/i;
119
+
120
+ /** Segment separators, and whether a failure before them survives. */
121
+ interface Segment {
122
+ readonly words: readonly string[];
123
+ /** The separator that FOLLOWS this segment, or null at the end. */
124
+ readonly nextSep: '&&' | '||' | ';' | '|' | null;
125
+ /** The head word of the segment that follows, lowercased. */
126
+ readonly nextHead: string | null;
127
+ }
128
+
129
+ /** Strip an unquoted trailing `#` comment. */
130
+ function stripComment(command: string): string {
131
+ let inSingle = false;
132
+ let inDouble = false;
133
+ for (let i = 0; i < command.length; i += 1) {
134
+ const ch = command[i];
135
+ if (ch === "'" && !inDouble) inSingle = !inSingle;
136
+ else if (ch === '"' && !inSingle) inDouble = !inDouble;
137
+ else if (ch === '#' && !inSingle && !inDouble && (i === 0 || /\s/.test(command[i - 1] ?? ''))) {
138
+ return command.slice(0, i);
139
+ }
140
+ }
141
+ return command;
142
+ }
143
+
144
+ /** Split into segments, remembering the separator that follows each. */
145
+ function splitSegments(command: string): Segment[] {
146
+ const raw: Array<{ text: string; sep: Segment['nextSep'] }> = [];
147
+ let buf = '';
148
+ let inSingle = false;
149
+ let inDouble = false;
150
+ for (let i = 0; i < command.length; i += 1) {
151
+ const ch = command[i] as string;
152
+ const two = command.slice(i, i + 2);
153
+ if (ch === "'" && !inDouble) {
154
+ inSingle = !inSingle;
155
+ buf += ch;
156
+ continue;
157
+ }
158
+ if (ch === '"' && !inSingle) {
159
+ inDouble = !inDouble;
160
+ buf += ch;
161
+ continue;
162
+ }
163
+ if (!inSingle && !inDouble) {
164
+ if (two === '&&' || two === '||') {
165
+ raw.push({ text: buf, sep: two as '&&' | '||' });
166
+ buf = '';
167
+ i += 1;
168
+ continue;
169
+ }
170
+ if (ch === ';' || ch === '|') {
171
+ raw.push({ text: buf, sep: ch as ';' | '|' });
172
+ buf = '';
173
+ continue;
174
+ }
175
+ }
176
+ buf += ch;
177
+ }
178
+ raw.push({ text: buf, sep: null });
179
+
180
+ return raw.map((entry, idx) => {
181
+ const next = raw[idx + 1];
182
+ const nextWords = next ? words(next.text) : [];
183
+ return {
184
+ words: words(entry.text),
185
+ nextSep: entry.sep,
186
+ nextHead: (nextWords[0] ?? null)?.toLowerCase() ?? null,
187
+ };
188
+ });
189
+ }
190
+
191
+ /** Tokenise a segment, dropping leading `VAR=value` assignments. */
192
+ function words(text: string): string[] {
193
+ const tokens = text.trim().split(/\s+/).filter((w) => w.length > 0);
194
+ let i = 0;
195
+ while (i < tokens.length && /^[A-Za-z_][A-Za-z0-9_]*=/.test(tokens[i] as string)) i += 1;
196
+ return tokens.slice(i);
197
+ }
198
+
199
+ /** Strip a path prefix from a binary name. */
200
+ function bareName(word: string): string {
201
+ let w = word;
202
+ for (const prefix of PATH_PREFIXES) {
203
+ if (w.startsWith(prefix)) {
204
+ w = w.slice(prefix.length);
205
+ break;
206
+ }
207
+ }
208
+ const slash = w.lastIndexOf('/');
209
+ return (slash >= 0 ? w.slice(slash + 1) : w).toLowerCase();
210
+ }
211
+
212
+ /**
213
+ * Does the shell discard this segment's failure?
214
+ *
215
+ * `cmd || true`, `cmd || :` and `cmd ; true` all leave the caller with exit 0
216
+ * whatever `cmd` did, so a verification there proves nothing about the tree.
217
+ * Deliberately narrow: `cmd || exit 1` propagates the failure and still counts.
218
+ */
219
+ function failureIsDiscarded(seg: Segment): boolean {
220
+ if (seg.nextSep === '||') return seg.nextHead === 'true' || seg.nextHead === ':';
221
+ if (seg.nextSep === ';') return seg.nextHead === 'true' || seg.nextHead === ':';
222
+ return false;
223
+ }
224
+
225
+ /** Classify one segment on its head. */
226
+ function segmentVerifies(rawWords: readonly string[]): boolean {
227
+ const w = rawWords.filter((x) => x.length > 0);
228
+ let idx = 0;
229
+ // Peel delegating prefixes: `npx vitest run`, `sudo make test`.
230
+ while (idx < w.length && DELEGATING_HEADS.has(bareName(w[idx] as string))) idx += 1;
231
+ if (idx >= w.length) return false;
232
+
233
+ const head = bareName(w[idx] as string);
234
+ const rest = w.slice(idx + 1).map((x) => x.toLowerCase());
235
+ const arg1 = rest[0] ?? '';
236
+
237
+ if (VERIFY_BINARIES.has(head)) return true;
238
+
239
+ switch (head) {
240
+ case 'npm':
241
+ case 'pnpm':
242
+ case 'yarn':
243
+ case 'bun': {
244
+ // `pnpm dlx vitest` delegates; `npm run test:ts` names a script.
245
+ if (arg1 === 'dlx' || arg1 === 'exec') return segmentVerifies(rest.slice(1));
246
+ const script = arg1 === 'run' ? (rest[1] ?? '') : arg1;
247
+ return NPM_SCRIPT_WORD.test(script);
248
+ }
249
+ case 'task':
250
+ return VERIFY_WORD.test(arg1) || /^ci([-_:]|$)/i.test(arg1);
251
+ case 'cargo':
252
+ return arg1 === 'test' || arg1 === 'check' || arg1 === 'clippy';
253
+ case 'go':
254
+ return arg1 === 'test' || arg1 === 'vet';
255
+ case 'make':
256
+ return VERIFY_WORD.test(arg1) || /^ci([-_:]|$)/i.test(arg1);
257
+ case 'composer':
258
+ return VERIFY_WORD.test(arg1) || arg1 === 'phpstan';
259
+ case 'php':
260
+ return arg1 === 'artisan' && (rest[1] ?? '') === 'test';
261
+ case 'artisan':
262
+ return arg1 === 'test';
263
+ case 'python':
264
+ case 'python3':
265
+ return arg1 === '-m' && VERIFY_BINARIES.has(rest[1] ?? '');
266
+ case 'node':
267
+ case 'deno':
268
+ // `node --test` is a runner selected by a FLAG, not by a
269
+ // subcommand, so head-anchoring alone would refuse it. Caught by
270
+ // `verification_evidence.test.ts` when this predicate narrowed:
271
+ // the old token-anywhere regex accepted it by accident and neither
272
+ // explicit list named it, so the union seeding missed it too.
273
+ return rest.some((a) => a === 'test' || a.startsWith('--test'));
274
+ case 'scripts-run': {
275
+ // `./scripts-run src/scripts/lint_x` verifies; `…/rule_activation_census`
276
+ // writes a report and asserts nothing, which is why this keys on the
277
+ // script's own prefix rather than on the runner.
278
+ const script = bareName(arg1);
279
+ return /^(check|lint|verify|validate)[-_]/.test(script);
280
+ }
281
+ default:
282
+ return false;
283
+ }
284
+ }
285
+
286
+ /**
287
+ * True when the command runs something that asserts the tree still holds.
288
+ *
289
+ * Classified per shell segment on the segment's HEAD, so a verification token
290
+ * appearing as an argument — `ls tests`, `git commit -m "fix ci"` — never
291
+ * counts, and a chained `task sync && task ci` counts on its second segment.
292
+ */
293
+ export function isVerificationCommand(command: string): boolean {
294
+ if (!command) return false;
295
+ const segments = splitSegments(stripComment(command));
296
+ return segments.some((seg) => !failureIsDiscarded(seg) && segmentVerifies(seg.words));
297
+ }
298
+
299
+ /**
300
+ * The RECORDER's net — deliberately wider than the predicate above, and not a
301
+ * leftover of the two-regex era it replaces.
302
+ *
303
+ * The two answer different questions. `isVerificationCommand` answers *did
304
+ * this verify*, and a false positive there clears an unverified edit, so it is
305
+ * head-anchored and narrow. This one answers *is this worth writing down for
306
+ * `classifyRun` to judge*, and there the costly error is the opposite: a
307
+ * recorder that filtered `echo test` out would leave the turn-end gate unable
308
+ * to tell "the turn ran a non-verification command" from "the turn ran
309
+ * nothing at all", and `not_a_verification_command` is a verdict the gate
310
+ * needs to SEE rather than infer from silence.
311
+ *
312
+ * That is why unifying the two call sites into one predicate was tried and
313
+ * rejected on 2026-09-30: it is not two spellings of one idea, it is two
314
+ * questions with opposite error costs. What was wrong before was that each
315
+ * question had its own private regex in its own file and the two also
316
+ * disagreed about the FIRST question. Both now live here, and only this one
317
+ * matches on a token anywhere in the line.
318
+ */
319
+ const _WIDE_CANDIDATE_RE =
320
+ /\b(test|tests|vitest|jest|pytest|phpunit|pest|tsc|eslint|ruff|mypy|pyright|clippy|phpstan|typecheck|lint[-_:a-z]*|build|ci|preflight|smoke[-_:a-z]*|check[-_:a-z]*|validate[-_:a-z]*)\b|\b(task|npm|pnpm|yarn|composer|cargo|go|make|php artisan|bun)\s+(run\s+)?\S*(test|check|lint|build|ci|typecheck)/i;
321
+
322
+ export function mightBeVerification(command: string): boolean {
323
+ return _WIDE_CANDIDATE_RE.test(command);
324
+ }