@event4u/agent-config 16.2.0 → 16.3.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 (332) 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 +89 -237
  5. package/README.md +14 -12
  6. package/dist/agent-src/commands/analyze/inbox.md +1 -1
  7. package/dist/agent-src/commands/analyze/roadmap-repos.md +1 -1
  8. package/dist/agent-src/commands/bug/fix.md +17 -2
  9. package/dist/agent-src/commands/feature/plan.md +1 -1
  10. package/dist/agent-src/commands/feature/roadmap.md +1 -1
  11. package/dist/agent-src/commands/fix/ci.md +1 -1
  12. package/dist/agent-src/commands/implement-ticket.md +1 -1
  13. package/dist/agent-src/commands/jira-ticket.md +1 -1
  14. package/dist/agent-src/commands/roadmap/create.md +1 -1
  15. package/dist/agent-src/commands/roadmap/materialize.md +1 -1
  16. package/dist/agent-src/commands/roadmap/process-full.md +4 -4
  17. package/dist/agent-src/commands/roadmap/resolve-blockers.md +361 -0
  18. package/dist/agent-src/commands/roadmap/triage-parked.md +325 -0
  19. package/dist/agent-src/commands/roadmap.md +18 -4
  20. package/dist/agent-src/commands/tests/create.md +17 -3
  21. package/dist/agent-src/commands/tests/execute.md +22 -5
  22. package/dist/agent-src/contexts/authority/decision-revisit-gate-enforcement.md +43 -0
  23. package/dist/agent-src/contexts/communication/rules-auto/design-fidelity-enforcement.md +24 -0
  24. package/dist/agent-src/contexts/execution/auto-dispatch-classification.md +6 -6
  25. package/dist/agent-src/contexts/execution/roadmap-process-loop.md +32 -2
  26. package/dist/agent-src/contexts/execution/session-canary-enforcement-history.md +67 -0
  27. package/dist/agent-src/contexts/execution/toolchain-resolver.md +101 -7
  28. package/dist/agent-src/rules/active-remediation.md +1 -1
  29. package/dist/agent-src/rules/autonomous-execution.md +1 -0
  30. package/dist/agent-src/rules/broken-access-control.md +1 -0
  31. package/dist/agent-src/rules/command-suggestion-policy.md +1 -0
  32. package/dist/agent-src/rules/context-hygiene.md +1 -1
  33. package/dist/agent-src/rules/decision-revisit-gate.md +16 -33
  34. package/dist/agent-src/rules/design-fidelity.md +13 -16
  35. package/dist/agent-src/rules/doc-screenshot-hygiene.md +1 -0
  36. package/dist/agent-src/rules/domain-safety-disclaimer.md +1 -0
  37. package/dist/agent-src/rules/domain-safety-pii.md +1 -0
  38. package/dist/agent-src/rules/domain-safety-retention.md +1 -0
  39. package/dist/agent-src/rules/engineering-safety-floor.md +1 -0
  40. package/dist/agent-src/rules/evaluator-independence.md +3 -2
  41. package/dist/agent-src/rules/fast-path-marker-visibility.md +1 -0
  42. package/dist/agent-src/rules/finance-safety-floor.md +1 -0
  43. package/dist/agent-src/rules/git-history-discipline.md +1 -0
  44. package/dist/agent-src/rules/image-likeness-and-rights.md +1 -0
  45. package/dist/agent-src/rules/legal-safety-floor.md +3 -2
  46. package/dist/agent-src/rules/lethal-trifecta-guard.md +1 -0
  47. package/dist/agent-src/rules/low-impact-corpus-privacy-floor.md +1 -0
  48. package/dist/agent-src/rules/media-governance-routing.md +14 -17
  49. package/dist/agent-src/rules/persona-governance.md +2 -2
  50. package/dist/agent-src/rules/provider-lifecycle-discipline.md +1 -1
  51. package/dist/agent-src/rules/question-not-instruction.md +1 -0
  52. package/dist/agent-src/rules/roadmap-progress-sync.md +1 -1
  53. package/dist/agent-src/rules/runtime-safety.md +1 -0
  54. package/dist/agent-src/rules/secret-vcs-guard.md +1 -0
  55. package/dist/agent-src/rules/security-sensitive-stop.md +3 -2
  56. package/dist/agent-src/rules/session-canary.md +8 -62
  57. package/dist/agent-src/rules/settings-ask-protocol.md +1 -0
  58. package/dist/agent-src/rules/source-confidentiality.md +1 -0
  59. package/dist/agent-src/rules/strategy-safety-floor.md +1 -0
  60. package/dist/agent-src/rules/tool-safety.md +1 -0
  61. package/dist/agent-src/rules/untrusted-input-defense.md +1 -0
  62. package/dist/agent-src/rules/user-interrupt-priority.md +1 -0
  63. package/dist/agent-src/scripts/archive_completed_roadmaps.ts +115 -20
  64. package/dist/agent-src/scripts/deferral_carry.ts +339 -0
  65. package/dist/agent-src/scripts/update_roadmap_progress.ts +4 -1
  66. package/dist/agent-src/skills/api-design/data/manifest.json +2 -2
  67. package/dist/agent-src/skills/api-testing/SKILL.md +17 -0
  68. package/dist/agent-src/skills/code-intelligence/SKILL.md +14 -2
  69. package/dist/agent-src/skills/design-system-capture/references/import-procedure.md +1 -1
  70. package/dist/agent-src/skills/existing-ui-audit/SKILL.md +2 -2
  71. package/dist/agent-src/skills/fe-design/SKILL.md +1 -1
  72. package/dist/agent-src/skills/iconography/SKILL.md +1 -1
  73. package/dist/agent-src/skills/js-library-packaging/SKILL.md +2 -2
  74. package/dist/agent-src/skills/monorepo-workspace/SKILL.md +1 -1
  75. package/dist/agent-src/skills/quality-tools/SKILL.md +11 -1
  76. package/dist/agent-src/skills/quality-tools/references/go-tools.md +76 -0
  77. package/dist/agent-src/skills/quality-tools/references/python-tools.md +104 -0
  78. package/dist/agent-src/skills/review-routing/SKILL.md +2 -2
  79. package/dist/agent-src/skills/skill-improvement-pipeline/SKILL.md +1 -1
  80. package/dist/agent-src/skills/storybook-workshop/SKILL.md +3 -3
  81. package/dist/agent-src/skills/tailwind-engineer/SKILL.md +1 -1
  82. package/dist/agent-src/skills/test-case-discovery/SKILL.md +7 -0
  83. package/dist/agent-src/skills/test-driven-development/SKILL.md +17 -0
  84. package/dist/agent-src/skills/test-performance/SKILL.md +19 -1
  85. package/dist/agent-src/skills/ui-component-architect/SKILL.md +2 -2
  86. package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
  87. package/dist/agent-src/templates/scripts/work_engine/directives/ui/apply.ts +48 -6
  88. package/dist/agent-src/templates/scripts/work_engine/stack/runner.ts +774 -109
  89. package/dist/cli/registry.js +1 -1
  90. package/dist/cli-delegate/archive_completed_roadmaps.js +92 -12
  91. package/dist/cli-delegate/check_update_banner.js +12 -1
  92. package/dist/cli-delegate/chunk-523HCFYO.js +90 -0
  93. package/dist/cli-delegate/{chunk-M2DPGFZ4.js → chunk-6V6TA25H.js} +22 -152
  94. package/dist/cli-delegate/chunk-7IQE3D5S.js +191 -0
  95. package/dist/cli-delegate/{chunk-6KFEC3G7.js → chunk-CQWX336L.js} +1 -1
  96. package/dist/cli-delegate/chunk-DEIV7XP7.js +108 -0
  97. package/dist/cli-delegate/chunk-EEHDXSYD.js +2040 -0
  98. package/dist/cli-delegate/{chunk-P6ZHP5W2.js → chunk-GKE7ZVFA.js} +4 -4
  99. package/dist/cli-delegate/chunk-JQOM7TTM.js +1201 -0
  100. package/dist/cli-delegate/{chunk-IGD6ERX6.js → chunk-JQVYKIZA.js} +10 -0
  101. package/dist/cli-delegate/{chunk-FC75PGJE.js → chunk-JY2I2DXV.js} +12 -1
  102. package/dist/cli-delegate/chunk-KB5FZ655.js +208 -0
  103. package/dist/cli-delegate/{chunk-7RQP4UDH.js → chunk-KR6EM23A.js} +235 -1455
  104. package/dist/cli-delegate/{chunk-LTYVIY76.js → chunk-LIYTLH6O.js} +1 -1
  105. package/dist/cli-delegate/{chunk-YJ72UIAK.js → chunk-NQ7WT43P.js} +1186 -244
  106. package/dist/cli-delegate/chunk-NXEILF2K.js +2160 -0
  107. package/dist/cli-delegate/{chunk-5R7HOLAF.js → chunk-NYX3L2PZ.js} +1 -1
  108. package/dist/cli-delegate/{chunk-4E2W63DA.js → chunk-OKJUIAPS.js} +62 -1
  109. package/dist/cli-delegate/{chunk-QAJS5YWY.js → chunk-PHD7OOLE.js} +2 -1
  110. package/dist/cli-delegate/{chunk-RGNIWTEA.js → chunk-QLDHIPWR.js} +1 -1
  111. package/dist/cli-delegate/{chunk-7XGBX6ZH.js → chunk-RQNNW7IF.js} +1314 -560
  112. package/dist/cli-delegate/{chunk-4XFP2Y3E.js → chunk-S4UMZNES.js} +1 -1
  113. package/dist/cli-delegate/{chunk-6KM6ORRY.js → chunk-S4YWNRKO.js} +24 -8
  114. package/dist/cli-delegate/{chunk-FP36SWJD.js → chunk-TRI6DQZ6.js} +2781 -340
  115. package/dist/cli-delegate/chunk-ULQRUR23.js +208 -0
  116. package/dist/cli-delegate/{chunk-NUHLI2RX.js → chunk-YCU3TIXH.js} +2 -0
  117. package/dist/cli-delegate/chunk-ZBZV2G5R.js +210 -0
  118. package/dist/cli-delegate/{chunk-WGXTVKCQ.js → chunk-ZUZKZYCN.js} +5 -3
  119. package/dist/cli-delegate/cmd_analyze_session.js +1 -1
  120. package/dist/cli-delegate/cmd_brand_status.js +1 -1
  121. package/dist/cli-delegate/cmd_conformance.js +1167 -234
  122. package/dist/cli-delegate/cmd_doctor.js +13 -6
  123. package/dist/cli-delegate/cmd_doctor_neighbours.js +23 -0
  124. package/dist/cli-delegate/cmd_explain.js +5 -5
  125. package/dist/cli-delegate/cmd_export.js +11 -8
  126. package/dist/cli-delegate/cmd_fleet.js +3 -3
  127. package/dist/cli-delegate/cmd_handoff.js +10 -7
  128. package/dist/cli-delegate/cmd_mcp_available.js +1 -1
  129. package/dist/cli-delegate/cmd_memory_get.js +3 -1
  130. package/dist/cli-delegate/cmd_migrate.js +2 -2
  131. package/dist/cli-delegate/cmd_packs_active.js +3 -3
  132. package/dist/cli-delegate/cmd_preflight.js +6 -6
  133. package/dist/cli-delegate/cmd_prune.js +11 -8
  134. package/dist/cli-delegate/cmd_refresh.js +2 -1
  135. package/dist/cli-delegate/cmd_route_audit.js +8 -6
  136. package/dist/cli-delegate/cmd_route_explain.js +4 -4
  137. package/dist/cli-delegate/cmd_session_recycle.js +4 -3
  138. package/dist/cli-delegate/cmd_settings_get.js +1 -1
  139. package/dist/cli-delegate/cmd_settings_migrate.js +11 -8
  140. package/dist/cli-delegate/cmd_settings_set.js +4 -4
  141. package/dist/cli-delegate/cmd_sync.js +11 -8
  142. package/dist/cli-delegate/cmd_uninstall.js +11 -8
  143. package/dist/cli-delegate/cmd_update.js +1 -1
  144. package/dist/cli-delegate/cmd_upgrade.js +3 -2
  145. package/dist/cli-delegate/cmd_validate.js +11 -8
  146. package/dist/cli-delegate/cmd_versions.js +1 -1
  147. package/dist/cli-delegate/deferral_carry.js +16 -0
  148. package/dist/cli-delegate/gate_execute.js +2 -2
  149. package/dist/cli-delegate/roadmap_gates.js +5 -5
  150. package/dist/cli-delegate/update_roadmap_progress.js +1 -1
  151. package/dist/discovery/deprecation-report.md +1 -1
  152. package/dist/discovery/discovery-manifest.json +127 -75
  153. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  154. package/dist/discovery/discovery-manifest.summary.md +3 -3
  155. package/dist/discovery/dormancy-report.md +1 -1
  156. package/dist/discovery/orphan-report.md +1 -1
  157. package/dist/discovery/packs.json +7 -5
  158. package/dist/discovery/trust-report.md +2 -2
  159. package/dist/discovery/workspaces.json +6 -4
  160. package/dist/hooks/dispatch.js +5357 -6656
  161. package/dist/hooks/dispatch.sha256 +1 -1
  162. package/dist/install/claudePathsPlan.js +47 -6
  163. package/dist/install/claudeRuleRewrite.js +7 -0
  164. package/dist/install/emit_host_rules_cli.js +39 -36
  165. package/dist/install/globalRuleScope.js +87 -0
  166. package/dist/install/host_rule_ownership.js +160 -0
  167. package/dist/install/install.mjs +2080 -1024
  168. package/dist/install/installThinLayer.js +261 -0
  169. package/dist/install/installedRuleLinks.js +176 -0
  170. package/dist/install/wizard-plan.js +24 -0
  171. package/dist/mcp/registry-manifest.json +3 -3
  172. package/dist/mcp/server.json +2 -2
  173. package/dist/mcp/server.mjs +31965 -27154
  174. package/dist/scripts/_lib/agent_settings.js +11 -0
  175. package/dist/scripts/_lib/claude_settings_hooks.js +10 -8
  176. package/dist/scripts/_lib/installed_layer.js +378 -0
  177. package/dist/scripts/_lib/lean_projection_mode.js +218 -15
  178. package/dist/scripts/_lib/rule_consequence_class.js +45 -0
  179. package/dist/scripts/_lib/rule_injection.js +67 -10
  180. package/dist/scripts/_lib/rule_law_section.js +122 -0
  181. package/dist/scripts/_lib/thin_rules.js +458 -0
  182. package/dist/scripts/_lib/windsurf_render.js +60 -0
  183. package/dist/scripts/condense.js +14 -26
  184. package/dist/scripts/project_thin_rules.js +14 -294
  185. package/dist/server/schemas/settings.js +6 -0
  186. package/dist/shared/skillRanking.js +74 -13
  187. package/docs/contracts/settings-classes.md +7 -5
  188. package/package.json +1 -1
  189. package/src/agent-src/scripts/archive_completed_roadmaps.ts +115 -20
  190. package/src/agent-src/scripts/deferral_carry.ts +339 -0
  191. package/src/agent-src/scripts/update_roadmap_progress.ts +4 -1
  192. package/src/agent-src/templates/scripts/work_engine/directives/ui/apply.ts +48 -6
  193. package/src/agent-src/templates/scripts/work_engine/stack/runner.ts +774 -109
  194. package/src/config/agent-settings.template.yml +62 -22
  195. package/src/config/continuity-surface.json +7 -0
  196. package/src/config/evaluator-budgets.json +4 -4
  197. package/src/config/gate-coverage.yml +96 -3
  198. package/src/config/gate-violation-baselines.json +17 -9
  199. package/src/config/hook-bundle-budget.json +25 -0
  200. package/src/config/hook-token-budget.json +6 -1
  201. package/src/config/host-instruction-limits.json +33 -0
  202. package/src/config/routing-coverage-seed.json +24 -3
  203. package/src/config/rule-activation-census.json +7 -3
  204. package/src/config/rule-consequence-class.json +161 -0
  205. package/src/config/rule-law-ceilings.json +99 -0
  206. package/src/install/claudePathsPlan.ts +46 -4
  207. package/src/install/claudeRuleRewrite.ts +10 -1
  208. package/src/install/emit_host_rules_cli.ts +43 -34
  209. package/src/install/globalRuleScope.ts +109 -0
  210. package/src/install/host_rule_ownership.ts +170 -0
  211. package/src/install/installThinLayer.ts +312 -0
  212. package/src/install/installedRuleLinks.ts +220 -0
  213. package/src/install/wizard-plan.ts +24 -0
  214. package/src/scripts/_cli/cmd_doctor.ts +23 -71
  215. package/src/scripts/_cli/cmd_doctor_neighbours.ts +293 -0
  216. package/src/scripts/_dispatch.bash +16 -2
  217. package/src/scripts/_lib/agent_settings.ts +11 -0
  218. package/src/scripts/_lib/claude_settings_hooks.ts +10 -8
  219. package/src/scripts/_lib/estate_offsets.ts +241 -0
  220. package/src/scripts/_lib/exemption_shape.ts +143 -0
  221. package/src/scripts/_lib/fnv.ts +23 -0
  222. package/src/scripts/_lib/foreign_scan.ts +106 -0
  223. package/src/scripts/_lib/gitignore_block.ts +314 -0
  224. package/src/scripts/_lib/global_deploy_inventory.ts +32 -0
  225. package/src/scripts/_lib/graph_feeder_record.ts +214 -0
  226. package/src/scripts/_lib/hook_settings.ts +73 -0
  227. package/src/scripts/_lib/host_capability.ts +40 -19
  228. package/src/scripts/_lib/host_hook_merge.ts +165 -0
  229. package/src/scripts/_lib/installed_layer.ts +538 -0
  230. package/src/scripts/_lib/json_merge.ts +82 -0
  231. package/src/scripts/_lib/json_pointers.ts +93 -11
  232. package/src/scripts/_lib/lean_projection_mode.ts +275 -15
  233. package/src/scripts/_lib/machine_wake.ts +16 -3
  234. package/src/scripts/_lib/neighbour_census.ts +760 -0
  235. package/src/scripts/_lib/neighbour_scan.ts +122 -0
  236. package/src/scripts/_lib/neighbour_tool_use.ts +189 -0
  237. package/src/scripts/_lib/prompt_shape.ts +46 -0
  238. package/src/scripts/_lib/release_migration_gate.ts +19 -3
  239. package/src/scripts/_lib/reserved_name_sweep.ts +73 -0
  240. package/src/scripts/_lib/review_coverage.ts +134 -0
  241. package/src/scripts/_lib/rule_consequence_class.ts +71 -0
  242. package/src/scripts/_lib/rule_injection.ts +130 -10
  243. package/src/scripts/_lib/rule_law_section.ts +147 -0
  244. package/src/scripts/_lib/rule_layer_overlap.ts +58 -0
  245. package/src/scripts/_lib/skill_origin.ts +254 -0
  246. package/src/scripts/_lib/structured_ask.ts +64 -21
  247. package/src/scripts/_lib/thin_rules.ts +540 -0
  248. package/src/scripts/_lib/touched_file_quality.ts +434 -0
  249. package/src/scripts/_lib/turn_end_refusals.ts +77 -2
  250. package/src/scripts/_lib/windsurf_render.ts +63 -0
  251. package/src/scripts/ai_council/cli_call_budget.ts +13 -5
  252. package/src/scripts/ai_council/clients.ts +26 -57
  253. package/src/scripts/ai_council/config.ts +1 -1
  254. package/src/scripts/ai_council/vendor_defaults.ts +45 -0
  255. package/src/scripts/audit_skill_overlap.ts +261 -0
  256. package/src/scripts/before_complete_hook.ts +243 -12
  257. package/src/scripts/bench_touched_file_quality.ts +238 -0
  258. package/src/scripts/check_enforcement_matrix.ts +377 -20
  259. package/src/scripts/check_estate_count.ts +130 -153
  260. package/src/scripts/check_finding_dispositions.ts +116 -4
  261. package/src/scripts/check_hook_bundle_composition.ts +370 -0
  262. package/src/scripts/check_kernel_edit_ratified.ts +49 -11
  263. package/src/scripts/check_memory.ts +7 -1
  264. package/src/scripts/check_release_highlights.ts +10 -0
  265. package/src/scripts/check_release_pr_shape.ts +38 -15
  266. package/src/scripts/check_standing_rule_delivery.ts +33 -13
  267. package/src/scripts/check_verify_expectation_delta.ts +521 -0
  268. package/src/scripts/code_graph/detect.ts +127 -7
  269. package/src/scripts/code_graph/foreign.ts +194 -0
  270. package/src/scripts/code_graph/query.ts +217 -4
  271. package/src/scripts/code_graph/types.ts +26 -2
  272. package/src/scripts/code_graph/validate.ts +3 -1
  273. package/src/scripts/code_graph/verbs.ts +103 -0
  274. package/src/scripts/compile_hook_manifest.ts +33 -1
  275. package/src/scripts/condense.ts +14 -27
  276. package/src/scripts/estate_exemption_shape.ts +202 -0
  277. package/src/scripts/generate_host_cost_table.ts +1 -1
  278. package/src/scripts/hook_manifest.json +1 -1
  279. package/src/scripts/hook_manifest.yaml +150 -9
  280. package/src/scripts/hooks/block_config_weakening.ts +67 -2
  281. package/src/scripts/hooks/block_plumbing_writes.ts +29 -1
  282. package/src/scripts/hooks/code_graph_context_hook.ts +252 -23
  283. package/src/scripts/hooks/concern_failure_policy.ts +280 -0
  284. package/src/scripts/hooks/dispatch_hook.ts +52 -52
  285. package/src/scripts/hooks/exit_codes.ts +2 -1
  286. package/src/scripts/hooks/host_lowering.json +1 -1
  287. package/src/scripts/hooks/host_lowering.ts +19 -1
  288. package/src/scripts/hooks/one_question_per_ask_hook.ts +41 -25
  289. package/src/scripts/hooks/payload_stub.ts +10 -1
  290. package/src/scripts/hooks/rule_inject_hook.ts +757 -63
  291. package/src/scripts/hooks/table_fingerprint.ts +21 -0
  292. package/src/scripts/hooks/telemetry_usage_hook.ts +64 -8
  293. package/src/scripts/hooks/turn_end_gate_hook.ts +84 -0
  294. package/src/scripts/hooks_status.ts +112 -0
  295. package/src/scripts/injection_scan_hook.ts +7 -0
  296. package/src/scripts/install.ts +72 -185
  297. package/src/scripts/installed_layer_report.ts +103 -0
  298. package/src/scripts/language_mirror_hook.ts +15 -6
  299. package/src/scripts/learning_sidecar.ts +119 -8
  300. package/src/scripts/lint_hook_manifest.ts +53 -0
  301. package/src/scripts/lint_major_migration_sections.ts +156 -26
  302. package/src/scripts/lint_pack_boundaries.ts +63 -5
  303. package/src/scripts/lint_rule_law_section.ts +517 -0
  304. package/src/scripts/lint_workflow_security.ts +161 -5
  305. package/src/scripts/mcp_server/consumer_tool_catalog.json +53 -0
  306. package/src/scripts/mcp_server/graph_tools.ts +72 -3
  307. package/src/scripts/measure_routing_signal.ts +54 -16
  308. package/src/scripts/measure_skill_ranker_baseline.ts +216 -8
  309. package/src/scripts/memory_learn_hook.ts +91 -6
  310. package/src/scripts/model_rule_injection.ts +52 -5
  311. package/src/scripts/project_thin_rules.ts +34 -327
  312. package/src/scripts/report_evidence_temperature.ts +657 -0
  313. package/src/scripts/report_installed_rule_links.ts +157 -0
  314. package/src/scripts/report_label_agreement.ts +233 -0
  315. package/src/scripts/report_obligation_mechanism.ts +230 -0
  316. package/src/scripts/report_single_token_triggers.ts +277 -0
  317. package/src/scripts/report_skill_ranker_confusion.ts +442 -0
  318. package/src/scripts/report_standing_payload_by_host.ts +188 -15
  319. package/src/scripts/report_verification_record_coverage.ts +306 -0
  320. package/src/scripts/rule_activation_census.ts +5 -2
  321. package/src/scripts/rule_trigger_eval.ts +9 -9
  322. package/src/scripts/schemas/review-findings.schema.json +3 -2
  323. package/src/scripts/schemas/rule.schema.json +5 -0
  324. package/src/scripts/self_review_gate.ts +62 -7
  325. package/src/scripts/skill_tools/score_skill_relevance.ts +290 -25
  326. package/src/scripts/sweep_skill_ranker_signals.ts +129 -0
  327. package/src/scripts/sync_gitignore.ts +29 -235
  328. package/src/scripts/trigger_eval_grandfather.json +0 -5
  329. package/src/server/schemas/settings.ts +10 -0
  330. package/src/shared/skillRanking.ts +117 -11
  331. package/dist/cli-delegate/chunk-JNMVLWLR.js +0 -4457
  332. package/dist/cli-delegate/chunk-YDPILCOL.js +0 -152
@@ -0,0 +1,67 @@
1
+ # Session Canary — Enforcement History
2
+
3
+ Loaded by [`session-canary`](../../rules/session-canary.md). Four dated
4
+ conformance audits of the canary carrier, moved here verbatim so the rule
5
+ states its obligation and this file holds the record behind it. Nothing was
6
+ rewritten; the measurements and their stated limits are as they were written.
7
+
8
+ **What that fixed, stated because it was measured.** Conformance audit, 30
9
+ sessions, 2026-08-06, under session-scope-only injection: opening canary dropped
10
+ on ~13 of 15 task starts, often present only in the closing summary, twice
11
+ carrying a name the settings chain did not resolve; the honesty clause fired
12
+ zero times. The frequency join in `check_enforcement_coverage.ts` now reports the
13
+ carrier as covering the obligation — which is a claim about firing, not about
14
+ compliance.
15
+
16
+ **What the second audit found: the carrier fires and compliance did not
17
+ follow.** Conformance round 5, 2026-08-07, reading the five highest-turn
18
+ sessions with the carrier bound per turn: opening canary dropped on **24 of 29**
19
+ task starts, the honesty clause fired **0** times, and the wrong name was
20
+ emitted **twice** — "Mathias", which resolves from no layer of the chain
21
+ (`identity.name` is `Matze`, `git config user.name` is `matze4u`), i.e. inferred
22
+ from the ambient environment rather than read from settings. 24/29 against the
23
+ earlier 13/15 is not a fall, and the two windows are not identical, so they are
24
+ stated side by side rather than as a trend — but nothing here supports the claim
25
+ that the miss rate moved. A reminder in context is therefore not a mechanism for
26
+ this obligation: at higher frequency it is the same request, more often.
27
+
28
+ **What the next mechanism has to be.** Not another injection. It has to be able
29
+ to **refuse** — a check at delivery (`stop` is block-capable on this host, so a
30
+ refused turn-end continues in the same turn) that rejects a task-start reply
31
+ carrying no greeting. Proposed, not shipped; until it is, this obligation is
32
+ model-carried in practice, whatever the frequency join reports.
33
+
34
+ **Round 7 downgrade: that proposed mechanism is UNDECIDABLE as written, and the
35
+ obligation splits into a measured half and an unmeasurable one.** A *task* start
36
+ is recorded nowhere in a transcript — there is no task event on any host, and
37
+ `user-interrupt-priority`'s continuation/clarification/interrupt distinction is a
38
+ judgement, not a field. So a delivery check "that rejects a task-start reply" has
39
+ no way to know a task started. The proposal is not merely unbuilt; as specified it
40
+ cannot be built, and saying "proposed, not shipped" implied otherwise.
41
+
42
+ What IS decidable is the per-**session** instance, and it was measured rather than
43
+ asserted — reproducibly, which took a correction: the probe resolves the name
44
+ through the same settings layers this rule names and REFUSES when no layer carries
45
+ one, so the figure below is reproduced with the name passed explicitly
46
+ (`./scripts-run src/scripts/probe_session_canary --limit 30 --name <your name>`;
47
+ the first version hardcoded a maintainer's nickname as its default, which made the
48
+ number irreproducible for anyone else and silently read 0 %). Over 30 sessions on
49
+ 2026-08-12: the opening greeting is present in **25 of 28** sessions carrying
50
+ assistant prose (89.3 %), and in **24 of 25** post-carrier (96.0 %). Of the three
51
+ misses, two predate the carrier (2026-07-21, 2026-07-29) and one is a session whose
52
+ first thirty turns were tool calls.
53
+
54
+ Both halves of that are load-bearing. The carrier works exactly where it has a
55
+ slot — `session_start` — which is why the session-scope figure is high; and the
56
+ 24-of-29 task-start figure above is not contradicted by it, because the two count
57
+ different events. The honest statement is therefore: **session-scope compliance is
58
+ measured and good; task-scope compliance is unmeasured and unmeasurable with
59
+ today's transcript, and no gate can change that until a task boundary is recorded
60
+ somewhere.** Do not read the 96 % as covering the obligation as a whole.
61
+
62
+ **The wrong-name half needs nothing, and that is worth stating.** The beat
63
+ already carries the resolved value — `build_canary_reminder` emits
64
+ `Canary active for "<name>"`, and the hook no-ops when no layer resolves a name —
65
+ and both wrong-name occurrences predate it: 2026-08-04, where the per-turn beat
66
+ landed 2026-08-06. The inference path they measure is already closed, so a third
67
+ audit should not re-open it.
@@ -13,7 +13,22 @@ tools and run the right one — instead of a per-stack command explosion.
13
13
  > pytest / go / cargo, not N per-stack variants. "Only genuine PHP-space
14
14
  > commands stay PHP-locked."
15
15
 
16
- **Size budget:** ≤ 6,000 chars.
16
+ **Size budget: none of its own.** The enforced ceiling is
17
+ `check_depth_budget`'s 16,000 chars, and that is the only one.
18
+
19
+ This page carried a self-imposed sub-ceiling through three values — 6,000,
20
+ then 7,500, then 8,500 — and each was set just above whatever the file
21
+ measured that day, so the next edit of any size broke it while the same
22
+ sentence forbade raising it. A ceiling fitted to its own artifact is not a
23
+ constraint, it is a tripwire; and the third one was set with a sentence
24
+ claiming "real headroom" over 66 characters, which is the trap diagnosing
25
+ itself and walking in anyway.
26
+
27
+ What actually bounds this page is **what belongs in it**: the resolver's
28
+ contract — the axes, the detection order, the confidence tiers, the refusal
29
+ doctrine, the cache key. Narration, worked examples and per-round history
30
+ belong in the roadmap and the review artifacts, not here. That rule is
31
+ checkable by a reader; a character count was only ever checkable by `wc`.
17
32
 
18
33
  ## 1. The resolver
19
34
 
@@ -29,9 +44,25 @@ for (const r of result.selected) {
29
44
  }
30
45
  ```
31
46
 
32
- Resolution is filesystem-cheap (a handful of small manifest reads) and
33
- **never raises** — a malformed manifest or unknown stack degrades to a
34
- `LOW`-confidence empty result so the command can ask, never crash. This
47
+ Resolution costs **per scope**, not per repository: a fixed name list stat-ed,
48
+ six-or-so manifests read, and the .NET probe's directory listings — three at
49
+ the root with no .NET target present, where the native axis lists once and the
50
+ behavior axis twice. They run in every repository, .NET or not; WITH a root
51
+ target the descent runs too and the count rises with the project tree. A wide workspace pays that times
52
+ its package count, so the cost is proportional and not negligible.
53
+
54
+ The **cache probe is the expensive path**, with the magnitude stated, not
55
+ implied as a SHAPE, because the arithmetic has already been published wrong
56
+ once: `latest_manifest_mtime` stats both fixed-name lists in every scope,
57
+ bounded at 200 scopes, each hit paying a second stat — and without
58
+ an explicit `scopes` it also expands the globs. The guard can cost more than
59
+ the resolution it guards, so a caller holding the scope list passes it. The
60
+ widening is still right: a root-only key cannot see a behavior runner
61
+ arriving in a package, and a key invalidating too often is recoverable where
62
+ one that never invalidates is not.
63
+
64
+ Resolution **never raises** — a malformed manifest or unknown stack degrades
65
+ to a `LOW`-confidence empty result so the command can ask, never crash. This
35
66
  mirrors the recoverable-error contract of the frontend `detect_stack`.
36
67
 
37
68
  ## 2. Detection order — per ecosystem, first match wins
@@ -47,6 +78,30 @@ mirrors the recoverable-error contract of the frontend `detect_stack`.
47
78
  | Python | `pytest` in pyproject / `pytest.ini` | pytest | `pytest` |
48
79
  | Go | `go.mod` present | go-test | `go test ./...` |
49
80
  | Rust | `Cargo.toml` present | cargo-test | `cargo test` |
81
+ | Ruby | `rspec` gem in `Gemfile`/`gems.rb`, `.rspec`, `spec/spec_helper.rb` | rspec | `bundle exec rspec`, or bare `rspec` with no Gemfile |
82
+ | JVM | `build.gradle[.kts]` / `settings.gradle[.kts]` by PRESENCE; `pom.xml` by CONTENT | junit | `./mvnw`/`./gradlew test`, else `mvn`/`gradle test` |
83
+ | .NET | `*.sln[x]` or `*.csproj`/`*.fsproj`/`*.vbproj` **in the scope root** | dotnet-test | `dotnet test` |
84
+
85
+ Each Ruby signal stands alone, and Ruby has **no MEDIUM default** (minitest is
86
+ in the stdlib): no signal, no row. JVM defaults to `junit` at MEDIUM when the
87
+ build file names no runner. A wrapper wins where one exists, since it pins the
88
+ build-tool version.
89
+
90
+ **.NET needs a target in the scope ROOT, because `dotnet test` is not
91
+ recursive.** With no project or solution in the working directory it fails
92
+ MSB1003, whatever sits below — so the row is gated on the root listing, and
93
+ `global.json` / `Directory.Build.props` never produce one on their own. They
94
+ are SDK pins, not targets, and confidence does not gate `selected`
95
+ (`_apply_guard` has never read it), so a row emitted on one would be a
96
+ command the repository cannot run.
97
+
98
+ Given a root target: HIGH when a PROJECT file names a test stack
99
+ (`Microsoft.NET.Test.Sdk`, xunit, nunit, mstest), MEDIUM otherwise. A root
100
+ `.sln` IS a valid target even though its own body names no package, so the
101
+ projects it references are read to decide the tier — which is the one case
102
+ the scan descends for. A `src/<Name>/<Name>.csproj` layout with NO root
103
+ solution therefore emits nothing: correct, because `dotnet test` from that
104
+ root does not run either.
50
105
 
51
106
  **Task-runner wrappers win.** When the project root has a `Makefile`
52
107
  `test:` target, a `Taskfile.yml` `test:` task, or a `package.json`
@@ -57,6 +112,33 @@ container access, env, and parallelism (the architecture rule's
57
112
  The package manager is read from the lockfile (`pnpm-lock.yaml` → pnpm,
58
113
  `yarn.lock` → yarn, else npm).
59
114
 
115
+ ## 2b. Behavior-runner axis — per scope, detection only
116
+
117
+ `result.behavior_runners` is a **separate list** from `runners`: it reports
118
+ which behavior runner each scope already owns, across the same ecosystems.
119
+
120
+ - **`command` is relative to `scope_root`, not to the project root.** It is
121
+ built from files inside the scope (`vendor/bin/behat`, `./gradlew test`), so
122
+ a consumer runs it WITH `scope_root` as the working directory. Every NATIVE
123
+ `runners` command is root-relative; this axis is the exception.
124
+ - **Per scope, never repository-wide.** Each row carries `scope_root` (the
125
+ root plus every declared workspace package). A monorepo
126
+ returns a row per owning package and none for the others; one answer would
127
+ erase which package owns it.
128
+ - **Two of the SAME ecosystem in one scope is a refusal, not a pick** —
129
+ `runner: "unknown"` plus `conflict: [both names]`, the same refusal the
130
+ frontend detector makes between two mutually exclusive workspaces. Two
131
+ DIFFERENT ecosystems are a polyglot repository, not a conflict: a PHP app
132
+ with a JS frontend returns two rows.
133
+ - **Detection, never adoption.** No row recommends installing anything and the
134
+ axis is unreachable from `selected`, so nothing runs *because* this axis
135
+ reported it. That is reachability, not execution: for four of the eight
136
+ labels the behavior command equals a native command already in `selected`
137
+ (`pytest-bdd`/`pytest`, `cucumber-jvm`/`jvm.command`, `reqnroll` and
138
+ `specflow`/`dotnet test`), and those rows are `SPEED_FAST`, so the suite
139
+ runs anyway as part of the native run. The axis adds nothing to what
140
+ executes and removes nothing from it.
141
+
60
142
  ## 3. Confidence tiers — declarative, shared with the non-interactive contract
61
143
 
62
144
  Each runner carries a `confidence` (`HIGH` / `MEDIUM` / `LOW`) and a
@@ -71,6 +153,17 @@ tables:
71
153
  asking (interactive) or `ambiguous_routing` (CI, per the
72
154
  non-interactive contract).
73
155
 
156
+ **`confidence` is about the RUNNER, never about `quality`.** The three
157
+ ecosystems this change added — ruby, jvm, dotnet — contribute a runner and NO
158
+ quality commands, because picking `rubocop`, a Spotless task or
159
+ `dotnet format` is an adoption decision this resolver has no standing to make.
160
+ The consequence is worth stating because it is silent: a Ruby-, JVM- or
161
+ .NET-only repository used to resolve `LOW` with an empty `quality`, which is
162
+ the tier that makes a command ASK; it now resolves `HIGH` with an empty
163
+ `quality`, which a quality pass can read as nothing to do. An empty `quality`
164
+ means **no quality tool was resolved**, never **no quality step is needed** —
165
+ a command that finds one should ask rather than report success.
166
+
74
167
  ## 4. Monorepo guard — fast by default, opt-in for the rest
75
168
 
76
169
  `resolve_toolchain` returns the full `runners` inventory **and** a
@@ -91,9 +184,10 @@ e2e and slow stay out until their flag is passed.
91
184
 
92
185
  `write_config(root, result)` persists the resolved per-stack commands to
93
186
  `agents/runtime/state/toolchain.json` (best-effort; never raises). The
94
- config is keyed on the manifest `mtime`, so it is re-read cheaply and
95
- re-resolved only when a manifest changes — the same cache-invalidation
96
- hook the frontend detector uses.
187
+ config is keyed on the latest `mtime` across every scope's manifests and
188
+ markers — not the root's alone, or a behavior runner arriving in a workspace
189
+ package would never invalidate it. Same hook the frontend detector uses,
190
+ widened to the scopes the behavior axis reads.
97
191
 
98
192
  ## 6. What stays stack-locked
99
193
 
@@ -103,7 +103,7 @@ The note, the ask and the user's decision are all prose, and the issue set is
103
103
  whatever the agent happened to see, so no gate can tell a discharged issue from a
104
104
  mentioned one. This rule ships `instruction-only` — the honesty boundary
105
105
  [`security-sensitive-stop`](security-sensitive-stop.md) and
106
- [`ui-audit-gate`](ui-audit-gate.md) state for their own obligations. The ladder
106
+ `ui-audit-gate` state for their own obligations. The ladder
107
107
  is the control; skipping it is caught by nothing.
108
108
 
109
109
  Body migrated to [`guideline:agent-infra/active-remediation-mechanics`](../guidelines/agent-infra/active-remediation-mechanics.md) (per P4 of `road-to-kernel-and-router.md`) — per-tier fix-now/note+ask/follow-up-PR criteria, version-gated modernization, anti-nagging guardrails.
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  type: "auto"
3
3
  tier: "3"
4
+ consequence_class: "authority-bypass"
4
5
  description: "Ask-or-act on a workflow step — trivial-vs-blocking, autonomy opt-in, commit default; Hard Floor stays"
5
6
  alwaysApply: false
6
7
  load_context:
@@ -2,6 +2,7 @@
2
2
  type: "auto"
3
3
  tier: "2a"
4
4
  alwaysApply: false
5
+ consequence_class: "security-boundary"
5
6
  description: "Endpoint/query on user/tenant data — authenticated ≠ authorized: server-derived ownership/tenant/role + negative tests (401/non-owner/cross-tenant)"
6
7
  triggers:
7
8
  - keyword: "endpoint"
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  type: "auto"
3
3
  tier: "mechanical-already"
4
+ consequence_class: "authority-bypass"
4
5
  description: "Prompt matches an eligible slash command — surface as numbered options with as-is escape; never auto-execute"
5
6
  triggers:
6
7
  - phrase: "free-form prompt"
@@ -22,7 +22,7 @@ obligation_frequency: "per-turn"
22
22
 
23
23
  # Context Hygiene
24
24
 
25
- > **Enforced by:** [`scripts/context_hygiene_hook.ts`](../../scripts/context_hygiene_hook.ts)
25
+ > **Enforced by:** `src/scripts/context_hygiene_hook.ts`
26
26
  > on Augment + Claude Code (`PostToolUse`). Run `agent-config hooks:status` to
27
27
  > see whether that slot is actually bound on the host you are on — this line is
28
28
  > a statement about the manifest, not about your install. The hook maintains
@@ -1,9 +1,12 @@
1
1
  ---
2
2
  type: "auto"
3
3
  tier: "2b"
4
+ consequence_class: "authority-bypass"
4
5
  description: "Beneficial change blocked by a lock (honest-null, don't-relitigate memory, budget canon, ADR) — surface a council re-evaluation offer, never drop"
5
6
  alwaysApply: false
6
7
  council_depth: deep
8
+ load_context:
9
+ - ../contexts/authority/decision-revisit-gate-enforcement.md
7
10
  triggers:
8
11
  - keyword: "don't relitigate"
9
12
  - keyword: "honest null"
@@ -22,7 +25,7 @@ workspaces: [agent-config-maintainer, engineering]
22
25
  packs: [meta]
23
26
  collision_ok:
24
27
  "honest null": "this rule asks whether a recorded null may be REVISITED; evaluator-independence asks how one was PRODUCED — different decision points on the same artefact"
25
- # obligation: line 31
28
+ # obligation: line 33
26
29
  enforced_by:
27
30
  - "instruction-only: no gate can observe an agent citing a decision it never opened; adr_cite_check is deterministic where it runs and nothing makes it run"
28
31
  obligation_frequency: "per-task"
@@ -51,11 +54,10 @@ what the package may ever become.
51
54
  **The default venue is the council, and this is a correction, not a new
52
55
  policy.** [`ai-council`](../skills/ai-council/SKILL.md)'s Iron Law already sends
53
56
  a decision the agent cannot settle from the tree to the council first, and its
54
- class table lists "reopening a recorded decision". The old "offers the user a
55
- path" wording made every lock an owner interrupt; measured across 26 days of
56
- transcripts, the agent reported a lock and waited while the owner voided the
57
- decision retroactively — twice with the lock report timestamped **before** the
58
- override demand. The ordering was the defect; the permission was never missing.
57
+ class table lists "reopening a recorded decision". The measurement behind that
58
+ correction, and why the five steps below are inlined rather than only routed, are
59
+ in
60
+ `contexts/authority/decision-revisit-gate-enforcement.md`.
59
61
 
60
62
  **Mechanism-match check comes FIRST**: a verdict settles the *mechanism it
61
63
  tested*, not every future proposal that resembles it — if the blocked change
@@ -79,16 +81,9 @@ distinction.
79
81
  4. **Route it** — council by default (below), user only for the reserved set.
80
82
  5. **Record** the outcome with scope and `revisit-if`.
81
83
 
82
- The five are stated here, not only behind a route, because the route was
83
- measurably unreachable: `decision-review` ships `install.default: false` in the
84
- non-default `analysis-workbench` pack, so a pack-legal install received the
85
- obligation and not the procedure. `routes_to` now names two always-on skills;
86
- the backward-audit depth in
87
- [`decision-review`](../skills/decision-review/SKILL.md) stays optional.
88
-
89
84
  Full catalog (honest nulls, don't-relitigate notes, budget-canon lines, ADRs,
90
85
  hard structural caps), the per-step detail, when-NOT-to-fire and the failure
91
- modes remain in [`skill:decision-review` § Decision-revisit gate — mechanics](../skills/decision-review/SKILL.md).
86
+ modes remain in `skill:decision-review` § Decision-revisit gate — mechanics.
92
87
  Trigger-set above activates this routing on demand, independent of the discipline profile (ADR-110).
93
88
 
94
89
  ## Reading a lock — the two descriptive axes
@@ -164,7 +159,7 @@ precedent-creates-no-authority clause: [`adr-layout § Reopen authority`](../doc
164
159
  - [`recurring-criticism`](recurring-criticism.md) — the **other entrance**: this
165
160
  rule fires when a lock blocks a change, that one when the same criticism arrives
166
161
  again. It reuses the five steps and the owner-reserved table above.
167
- - [`decision-review`](../skills/decision-review/SKILL.md) — the backward-audit
162
+ - `decision-review` — the backward-audit
168
163
  procedure + the migrated gate mechanics.
169
164
  - [`ai-council`](../skills/ai-council/SKILL.md) — the re-evaluation mechanism;
170
165
  owns the convergence-summary scope + `revisit-if` contract.
@@ -180,21 +175,9 @@ precedent-creates-no-authority clause: [`adr-layout § Reopen authority`](../doc
180
175
 
181
176
  ## Honest enforcement — `instruction-only`
182
177
 
183
- `adr_cite_check` is deterministic where it runs, and nothing makes it run. No
184
- gate can observe an agent citing a decision it never opened, so step 2 above is
185
- model-carried — the same honesty boundary
186
- [`security-sensitive-stop`](security-sensitive-stop.md) and
187
- [`active-remediation`](active-remediation.md) state for their own obligations.
188
-
189
- Two reach limits, named rather than implied. The tool lives in this repository's
190
- `src/scripts/` and is **not** exposed as an `agent-config` verb, so a consumer
191
- install performs step 2 by hand; wiring the verb touches six further surfaces
192
- plus the curated `dist/agent-src/scripts/` list and is deliberately out of this
193
- change. And `docs/decisions/` is projected into no agent-visible tree at all —
194
- the agent sees ADR *numbers* cited across rules and skills, almost never ADR
195
- *text*. Until that changes, "evaluate before citing" means opening the file.
196
-
197
- `docs/contracts/` is unprojected on the same terms (`dist/agent-src/` carries no
198
- `docs/`), so the burden table this rule points at is maintainer-reachable only.
199
- That is why the reserved-set table above stays here rather than becoming a
200
- pointer: a consumer install receives these lines and not the contract.
178
+ Step 2 is model-carried: no gate can observe an agent citing a decision it
179
+ never opened. Why that is so, which two reach limits the tool has in a
180
+ consumer install, and why `docs/decisions/` is projected into no
181
+ agent-visible tree are recorded in
182
+ `contexts/authority/decision-revisit-gate-enforcement.md`,
183
+ named in `load_context` above.
@@ -2,6 +2,8 @@
2
2
  type: "auto"
3
3
  tier: "2a"
4
4
  description: "A provided prototype/mockup/design system is the spec — build 1:1; never swap fonts, controls, or layout unconfirmed"
5
+ load_context:
6
+ - ../contexts/communication/rules-auto/design-fidelity-enforcement.md
5
7
  triggers:
6
8
  - keyword: "prototype"
7
9
  - keyword: "mockup"
@@ -39,7 +41,7 @@ collision_ok:
39
41
  "mockup": "a provided mockup is the spec — 1:1 fidelity floor"
40
42
  enforced_by:
41
43
  - "instruction-only: no artifact in this tree records a fidelity comparison. lint_design_slop and lint_design_quality measure generic AI-aesthetic tells and accessibility; neither reads the handover, so a 1:1 claim is model-carried"
42
- # obligation: line 58
44
+ # obligation: line 60
43
45
  obligation_frequency: "per-edit"
44
46
  ---
45
47
 
@@ -106,7 +108,7 @@ REPRODUCING A WIREFRAME'S GREYS 1:1 HONOURS THE WRONG HALF OF THE ARTEFACT.
106
108
  ```
107
109
 
108
110
  `strict` means *do not redesign*; never *reproduce a wireframe's placeholder grays*, which
109
- are **non-decisions** ([`wireframe`](../skills/wireframe/SKILL.md) § Gotchas).
111
+ are **non-decisions** (`wireframe` § Gotchas).
110
112
  **The discriminator reads the ARTEFACT, never the prose.** A finished comp whose prose
111
113
  mentions a wireframe it replaces routes **strictly** — a reference to a previous artefact,
112
114
  not a declaration about this one. **When the artefact does not declare its maturity,
@@ -155,26 +157,21 @@ a third-party builder's share link, need one word in the prompt — the
155
157
  builder-URL trigger was tried and **withdrawn** as over-broad, and stays pinned
156
158
  silent rather than merely absent.
157
159
 
158
- Every class carries its own near-miss row in `ROUTING_MATRIX`
159
- ([`design_fidelity_routing.test.ts`](../../tests/scripts/design_fidelity_routing.test.ts)),
160
- and the row must test the direction the NEW trigger opens, not one that was
161
- already closed — apply that before writing a trigger, not after. Why each class
162
- is shaped as it is, why `*.html` and a bare builder host are refused, and the
163
- worked example behind the direction rule:
164
- [`design-fidelity-routing`](../guidelines/design-fidelity-routing.md).
160
+ Each class carries a near-miss row in the routing matrix, and a new trigger's
161
+ row must test the direction that trigger opens. The matrix, the reasons behind
162
+ each class, and the worked example are in
163
+ `design-fidelity-enforcement`.
165
164
 
166
165
  Body migrated to [`guideline:design-fidelity-mechanics`](../guidelines/design-fidelity-mechanics.md) (per P4 of `road-to-kernel-and-router.md`) — URL / live-page handover (extraction into the `design-system.json` contract before the first UI write, the retrieval order, the lock boundary), surgical visual edits (targeted-edit vs redesign-trigger discipline, stable anchors), asset & imagery discipline (owned-asset path, third-party delivery is self-hosted by default, real-imagery-as-proof, iconography floor, no unrequested filler), deviation-surfacing shape, failure-mode catalog, `daf-*` fixtures.
167
166
  Trigger-set above activates this routing on demand, independent of the discipline profile (ADR-110).
168
167
 
169
168
  ## Honest enforcement — `instruction-only`
170
169
 
171
- Nothing records a fidelity comparison. The estate's two design linters measure
172
- generic AI-aesthetic tells (`lint_design_slop`) and accessibility
173
- (`lint_design_quality`); neither opens the handover, so nothing can tell a
174
- proven 1:1 from an asserted one. The proof clause in the Iron Law is therefore
175
- model-carried, and the committed matrix
176
- ([`design-review`](../skills/design-review/SKILL.md) § Fidelity proof) is the
177
- control — a reviewer can open it, which is more than any gate here does.
170
+ Nothing records a fidelity comparison, so the proof clause in the Iron Law is
171
+ model-carried and the committed matrix is the control. Which two linters exist,
172
+ what each measures and why neither can tell a proven 1:1 from an asserted one:
173
+ `design-fidelity-enforcement`,
174
+ named in `load_context` above.
178
175
 
179
176
  ## See also
180
177
 
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  type: "auto"
3
3
  tier: "2a"
4
+ consequence_class: "irreversible-external"
4
5
  description: "Doc screenshots — anonymize sensitive data before shipping; data-bearing shots human-gated (published egress); terminal/CLI/IDE shots forbidden"
5
6
  triggers:
6
7
  - keyword: "screenshot"
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  type: "auto"
3
3
  tier: "2a"
4
+ consequence_class: "authority-bypass"
4
5
  description: "Advisory content (legal, medical, financial, consulting) — matching 'not X advice' disclaimer; refuse diagnosis/dosage"
5
6
  triggers:
6
7
  - keyword: "legal brief"
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  type: "auto"
3
3
  tier: "2a"
4
+ consequence_class: "security-boundary"
4
5
  description: "Drafts/logs/exports with real customer/candidate data — redact direct IDs, placeholders, flag quasi-ID re-identification"
5
6
  triggers:
6
7
  - keyword: "support macro"
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  type: "auto"
3
3
  tier: "2a"
4
+ consequence_class: "irreversible-external"
4
5
  description: "Data retention — jurisdiction gap, longest floor, honor DSR/audit holds; never delete under inquiry"
5
6
  triggers:
6
7
  - keyword: "retention policy"
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  type: "auto"
3
3
  tier: "2a"
4
+ consequence_class: "irreversible-external"
4
5
  description: "Production/infra/security/external-system output — blast radius + rollback; Hard-Floor never autonomous"
5
6
  triggers:
6
7
  - keyword: "production"
@@ -6,6 +6,7 @@ norm:
6
6
  tokens: 1500
7
7
  remainder:
8
8
  - "../docs/guidelines/agent-infra/evaluator-independence-mechanics.md"
9
+ consequence_class: "authority-bypass"
9
10
  description: "Commissioning a review/judge/blind-pass on your own work — never author the verdict, never narrow the scope, record the prompt with the result"
10
11
  triggers:
11
12
  - keyword: "blind review"
@@ -121,11 +122,11 @@ ITEM 1 IS ENFORCED. ITEMS 2, 3 AND 4 ARE NOT — 4 ONLY WARNS.
121
122
  NEVER CITE A GUARD THAT WARNS AS ONE THAT BLOCKS.
122
123
  ```
123
124
 
124
- [`evidence_independence.ts`](../scripts/hooks/evidence_independence.ts), a
125
+ `src/scripts/hooks/evidence_independence.ts`, a
125
126
  `pre_tool_use` concern, BLOCKS item 1 on the one host that honours a deny and
126
127
  only WARNS on item 4. Item 2 is enforced by nothing — a narrowed scope is not
127
128
  decidable from a prompt. Item 3 is enforced by
128
- [`check_review_prompt_binding.ts`](../../src/scripts/check_review_prompt_binding.ts),
129
+ `src/scripts/check_review_prompt_binding.ts`,
129
130
  where **omission beats substitution**: not committing the prompt package drops
130
131
  the round out of the checkable set with no finding.
131
132
 
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  type: "auto"
3
3
  tier: "1"
4
+ consequence_class: "authority-bypass"
4
5
  description: "Low-impact council fast-path — surface the transparency marker verbatim as the reply opener"
5
6
  triggers:
6
7
  - keyword: "low-impact council"
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  type: "auto"
3
3
  tier: "2a"
4
+ consequence_class: "authority-bypass"
4
5
  description: "Finance-pack output (runway, valuation, DCF, scenarios, unit economics) — never a final invest/raise call; disclosure footer"
5
6
  triggers:
6
7
  - keyword: "runway"
@@ -2,6 +2,7 @@
2
2
  type: "auto"
3
3
  tier: "2a"
4
4
  alwaysApply: false
5
+ consequence_class: "irreversible-external"
5
6
  description: "Git history — no unasked rebase/squash/amend; never drop foreign commits; pushed rewrite → re-push same turn"
6
7
  triggers:
7
8
  - keyword: "git rebase"
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  type: "auto"
3
3
  tier: "2a"
4
+ consequence_class: "irreversible-external"
4
5
  description: "AI image rights gate — real-person likeness, trademarked marks, named artists' styles need explicit rights/consent"
5
6
  triggers:
6
7
  - keyword: "/image:"
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  type: "auto"
3
3
  tier: "2a"
4
+ consequence_class: "authority-bypass"
4
5
  description: "Legal-pack output (contract/NDA/DPA review, triage) — never a final legal call; attorney-review line; EU/DE-only"
5
6
  triggers:
6
7
  - keyword: "NDA"
@@ -57,7 +58,7 @@ THESE SKILLS ARE A RESEARCH-AND-DRAFTING AID, NOT LEGAL ADVICE.
57
58
  THEY DO NOT REPLACE A LICENSED ATTORNEY. NO ONE MAY RELY ON THEM AS DEFINITIVE.
58
59
  ```
59
60
 
60
- Every output is a **draft / research aid for a human attorney to verify** — not legal advice, not a legal opinion, not a substitute for a qualified lawyer. Non-removable from the pack. See [`LEGAL_NOTICE.md`](../../../LEGAL_NOTICE.md).
61
+ Every output is a **draft / research aid for a human attorney to verify** — not legal advice, not a legal opinion, not a substitute for a qualified lawyer. Non-removable from the pack. See `LEGAL_NOTICE.md`.
61
62
 
62
63
  ## Consent gate — refuse until acknowledged
63
64
 
@@ -133,7 +134,7 @@ Active whenever any of these are in the request, the open file, or the loaded sk
133
134
  ## See also
134
135
 
135
136
  - [`legal-practice-profile`](../skills/legal-practice-profile/SKILL.md) — the migrated operating mechanics (consent gate, council gate, RDG line, headers, jurisdiction honesty, GREEN gate, privilege circle, distribution stance)
136
- - [`LEGAL_NOTICE.md`](../../../LEGAL_NOTICE.md) — repo-root legal notice (no advice / no attorney-client / no warranty)
137
+ - `LEGAL_NOTICE.md` — repo-root legal notice (no advice / no attorney-client / no warranty)
137
138
  - `domain-safety-disclaimer` — generic advisory-content floor (`not-legal-advice`)
138
139
  - `domain-safety-pii` — privilege/PII markers on drafts, logs, exports
139
140
  - `lethal-trifecta-guard` — egress gate the privilege-outbound block builds on
@@ -2,6 +2,7 @@
2
2
  type: "auto"
3
3
  tier: "2a"
4
4
  alwaysApply: false
5
+ consequence_class: "security-boundary"
5
6
  description: "Skill/command/tool mixing private-data access + untrusted content + external comms — break one leg before shipping"
6
7
  triggers:
7
8
  - path_prefix: "src/skills/"
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  type: "auto"
3
3
  tier: "1"
4
+ consequence_class: "security-boundary"
4
5
  description: "Writing/upstreaming low-impact-decisions corpus entries — non-bypassable privacy floor"
5
6
  triggers:
6
7
  - path_prefix: "agents/decisions/low-impact-decisions"