@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,104 @@
1
+ # quality-tools — Python quality tools
2
+
3
+ > Mode body of the [`quality-tools`](../SKILL.md) skill. Load this file when
4
+ > the mode table in SKILL.md routes here. The cross-mode material — execution
5
+ > policy, environment, output discipline — stays in SKILL.md and is NOT
6
+ > repeated here.
7
+
8
+ # Python Quality Tools
9
+
10
+ ## Detection
11
+
12
+ The resolver is the authority, not this table. `resolve_toolchain`
13
+ (`work_engine/stack/runner.ts`) reads `pyproject.toml` and returns the quality
14
+ commands it found; run those. The table says what each one is, so a reader can
15
+ tell a missing tool from an unknown one.
16
+
17
+ | Indicator in `pyproject.toml` | Tool | What it does |
18
+ |---|---|---|
19
+ | `[tool.ruff]` | **Ruff** | Linting and formatting in one binary; replaces flake8, isort, pyupgrade and (with `ruff format`) black |
20
+ | `[tool.mypy]` | **mypy** | Static type checking |
21
+ | `[tool.pytest.ini_options]` | **pytest** | Test runner — the resolver binds it as the test command, not as a quality command |
22
+
23
+ A repository with none of the three resolves an empty `quality` list. That
24
+ means **none was resolved**, never that none is needed — the same distinction
25
+ SKILL.md draws for ruby, jvm and dotnet.
26
+
27
+ ## Ruff — linting and formatting
28
+
29
+ ```bash
30
+ ruff check . # lint, read-only
31
+ ruff check --fix . # lint and apply the safe fixes
32
+ ruff format . # format
33
+ ruff format --check . # format check, read-only — what CI runs
34
+ ```
35
+
36
+ Config lives in `[tool.ruff]` in `pyproject.toml` (or `ruff.toml`). The two
37
+ settings that change what the other commands mean:
38
+
39
+ - `line-length` — the formatter's wrap column; `ruff check` reports `E501`
40
+ against the same number.
41
+ - `[tool.ruff.lint] select` / `ignore` — the rule set. An empty `select` is
42
+ Ruff's default set, not "no rules".
43
+
44
+ **`--fix` is not a formatter.** `ruff check --fix` rewrites code to satisfy
45
+ lint rules; `ruff format` rewrites layout. A pipeline that runs only the first
46
+ leaves formatting drift that CI's `ruff format --check` then fails on.
47
+
48
+ ## mypy — type checking
49
+
50
+ ```bash
51
+ mypy . # check the package
52
+ mypy --strict . # every optional strictness flag on
53
+ ```
54
+
55
+ Config lives in `[tool.mypy]`. `strict = true` there is the same as `--strict`
56
+ on the command line, so passing the flag to a project that already sets it
57
+ changes nothing — and passing it to one that does not is a different check
58
+ from the one CI runs. Read the config before adding flags.
59
+
60
+ An error mypy reports on a file the current change did not touch is
61
+ pre-existing debt. Treat it the way SKILL.md's baseline policy treats a
62
+ PHPStan baseline entry: it is not this change's to clear silently.
63
+
64
+ ## pytest — the test runner
65
+
66
+ Not a quality tool, listed here because the resolver finds it in the same
67
+ file and a reader looking for "the Python commands" expects it.
68
+
69
+ ```bash
70
+ pytest # the resolver's bound command
71
+ pytest -q # quiet, what `addopts = "-q"` already sets
72
+ pytest -k '<expr>' # filter by name — the targeted probe
73
+ pytest path/to/test.py # filter by file
74
+ ```
75
+
76
+ Run the filtered form when verifying one fix. The whole suite is the final
77
+ gate, never the per-iteration probe.
78
+
79
+ ## Workflow sequence
80
+
81
+ 1. `ruff format --check .` — fails fast and costs nothing.
82
+ 2. `ruff check .` — lint.
83
+ 3. `mypy .` — types.
84
+ 4. `pytest -k '<the thing you changed>'` — targeted.
85
+ 5. The full suite, once, at the end.
86
+
87
+ Each step is cheaper and narrower than the next, so running them out of order
88
+ spends the expensive verdict on a failure the cheap one would have named.
89
+
90
+ ## Gotchas
91
+
92
+ - **A virtualenv the agent did not activate.** `ruff` and `mypy` installed in
93
+ a project venv are not on `PATH` outside it. `python -m ruff` / `python -m
94
+ mypy` run the installed copy; a bare `ruff` may run a different version or
95
+ none.
96
+ - **`requirements.txt` only.** The resolver still binds pytest (at MEDIUM
97
+ confidence) but finds no quality commands, because it reads them from
98
+ `pyproject.toml`. An empty `quality` list on such a repository is correct
99
+ output, not a detection bug.
100
+ - **`setup.cfg` and `tox.ini` carry config too.** Older projects keep flake8
101
+ and mypy settings there. The resolver does not read them; if a project has
102
+ no `[tool.*]` block and a populated `setup.cfg`, the tools are configured and
103
+ the resolver's empty list is a gap in the resolver, worth reporting rather
104
+ than working around.
@@ -31,7 +31,7 @@ Do NOT use when:
31
31
  - The diff is low-risk and no ownership map exists — fall back to the
32
32
  common role vocabulary below.
33
33
  - A full PR description is requested — route to
34
- [`/pr:create:description-only`](../../domains/git/pr/create/description-only/command.md) and let
34
+ `/pr:create:description-only` and let
35
35
  it call this skill for the routing block.
36
36
  - A threat model is wanted — route to
37
37
  [`threat-modeling`](../threat-modeling/SKILL.md).
@@ -210,6 +210,6 @@ Data source: <"ownership-map.yml + historical-bug-patterns.yml"
210
210
 
211
211
  - [`reviewer-awareness`](../../rules/reviewer-awareness.md) — the rule that routes here: anchor reviewer choice in paths and risk, never seniority
212
212
  - [`review-routing-data-format`](../../guidelines/agent-infra/review-routing-data-format.md)
213
- - [`/pr:create:description-only`](../../domains/git/pr/create/description-only/command.md)
213
+ - `/pr:create:description-only`
214
214
  - [`judge-test-coverage`](../judge-test-coverage/SKILL.md) — consumes
215
215
  the `required_test` entries from matched patterns.
@@ -213,7 +213,7 @@ is the wrong question asked well.
213
213
  **The escalation threshold applies here too.** A third recurrence of the same
214
214
  violation class converts an observation into a deterministic gate — and a review
215
215
  finding never silently becomes a hard gate. Both halves, specified in
216
- [`decision-review` § Removal is a disposition](../decision-review/SKILL.md).
216
+ `decision-review` § Removal is a disposition.
217
217
 
218
218
  ## Output format
219
219
 
@@ -16,7 +16,7 @@ agent reads to learn what the component accepts, and the harness that catches a
16
16
  focus defect while the component is still in isolation. Stack-agnostic — the tool is
17
17
  Storybook, the discipline is not.
18
18
 
19
- Lifted out of [`react-shadcn-ui`](../react-shadcn-ui/SKILL.md) § Component workshop, which
19
+ Lifted out of `react-shadcn-ui` § Component workshop, which
20
20
  keeps a pointer here rather than a copy.
21
21
 
22
22
  ## The Iron Law
@@ -135,7 +135,7 @@ Run the project's story test command (the Vitest addon's `storybook test`, or wh
135
135
  `package.json` declares — read it, do not assume a name), then read the a11y result.
136
136
 
137
137
  Write findings into `state.ui_review.a11y` in the shape
138
- [`react-shadcn-ui`](../react-shadcn-ui/SKILL.md) § Review pass already defines:
138
+ `react-shadcn-ui` § Review pass already defines:
139
139
 
140
140
  ```
141
141
  {violations: [{rule, selector, severity}, …], severity_floor?, accepted_violations?}
@@ -235,7 +235,7 @@ copied verbatim:
235
235
 
236
236
  ## See also
237
237
 
238
- - [`react-shadcn-ui`](../react-shadcn-ui/SKILL.md) — the React stack lane, and the `(rule, selector, severity)` shape § Validate writes into.
238
+ - `react-shadcn-ui` — the React stack lane, and the `(rule, selector, severity)` shape § Validate writes into.
239
239
  - [`existing-ui-audit`](../existing-ui-audit/SKILL.md) — the inventory the MCP path accelerates.
240
240
  - [`js-library-packaging`](../js-library-packaging/SKILL.md) — the package around the workshop.
241
241
  - [`accessibility-auditor`](../accessibility-auditor/SKILL.md) — the WCAG depth behind the a11y half.
@@ -87,7 +87,7 @@ Structure, controls, grid and breakpoints are never this skill's to adjust;
87
87
  those stay 1:1 with the artifact and belong to the rule, not to a
88
88
  utility-class decision. **Icons are out of scope here as well, and this skill
89
89
  asserts no obligation about them** — the icon system belongs to
90
- [`icon-consistency`](../../rules/icon-consistency.md). An earlier revision of
90
+ `icon-consistency`. An earlier revision of
91
91
  this paragraph claimed icons "stay 1:1 with the artifact" with no citation of
92
92
  any kind, while putting them outside its own scope in the same sentence; the
93
93
  claim is withdrawn rather than defended, because a clause that reached the tree
@@ -39,6 +39,13 @@ CAP PER BEHAVIOR: 5–8 CASES — EACH MUST FAIL FOR A DISTINCT REASON.
39
39
 
40
40
  ## Does this change owe an executable behavior contract?
41
41
 
42
+ This section is the decision *Gherkin*, *BDD*, *Cucumber*, *Behat* and
43
+ *given-when-then* are meant to reach — each pinned as a should-trigger case in
44
+ `evals/triggers.json`, with German exemplars for *Cucumber* and *Behat*. That
45
+ corpus specifies
46
+ the intent; it does not route, and this skill's `description` carries none of
47
+ the terms. A decision, not a guide to writing one.
48
+
42
49
  Cases and contracts are not the same artifact. A **case** is something you assert
43
50
  in the project's unit runner. An **executable behavior contract** — a
44
51
  specification written in the language of whoever asked for the change, and run
@@ -313,6 +313,23 @@ export async function retry<T>(op: () => Promise<T>): Promise<T> {
313
313
  Run again → passes. Configurable attempt count, backoff, and jitter all
314
314
  wait for their own failing tests.
315
315
 
316
+ ## The filtered probe, per ecosystem
317
+
318
+ The discipline above is stack-independent; the **command** is not, and every
319
+ runner invocation elsewhere in this file is a PHP one. Resolve the runner with
320
+ `resolve_toolchain` (`work_engine/stack/runner.ts`) and read its `ecosystems`,
321
+ then filter with that ecosystem's own form — never the whole suite:
322
+
323
+ | `ecosystems` | Filtered probe |
324
+ |---|---|
325
+ | `php` | `vendor/bin/pest --filter '<name>'` · `php artisan test --filter '<name>'` |
326
+ | `js` | `npx vitest run -t '<name>'` · `npx jest -t '<name>'` |
327
+ | `python` | `pytest -k '<expr>'` · `pytest path/to/test.py::test_name` |
328
+ | `go` | `go test -run '<regexp>' ./pkg/...` |
329
+
330
+ A TypeScript repository resolves the ecosystem `js`, never `typescript`. The
331
+ whole suite is the final gate and never the per-iteration probe, in every row.
332
+
316
333
  ## Gotchas
317
334
 
318
335
  * Running the full suite instead of a filtered test hides the RED→GREEN
@@ -174,4 +174,22 @@ Replace dynamic `getPdo()` probing with explicit config:
174
174
  - Do NOT use RefreshDatabase when DatabaseTransactions works — 10x slower.
175
175
  - Do NOT run full test suite on every code change — use `--filter`.
176
176
  - Do NOT add test-only indexes — fix test design instead.
177
- - Do NOT disable parallel testing to "fix" flaky tests — fix the root cause.
177
+ - Do NOT disable parallel testing to "fix" flaky tests — fix the root cause.
178
+
179
+ ## Where the time goes, per ecosystem
180
+
181
+ The diagnosis above is PHPUnit-shaped. The method — measure before optimising,
182
+ find the slowest tests first, separate setup cost from assertion cost —
183
+ transfers; the instrument does not. Resolve the runner with
184
+ `resolve_toolchain` and read its `ecosystems`:
185
+
186
+ | `ecosystems` | Slowest-test instrument | The usual first cause |
187
+ |---|---|---|
188
+ | `php` | `--profile` / Pest's duration column | database refresh per test |
189
+ | `js` | `vitest --reporter=verbose`, `jest --detectOpenHandles` | module transform and a leaked handle |
190
+ | `python` | `pytest --durations=20` | session-scoped fixtures rebuilt per test |
191
+ | `go` | `go test -v`, `-cpuprofile`, `-race` for the slow-and-flaky pair | a `TestMain` that starts real I/O |
192
+
193
+ `go test` caches a package's result until its inputs change, so a suite that
194
+ looks fast on the second run may not have run at all — `-count=1` defeats the
195
+ cache when you are measuring.
@@ -61,7 +61,7 @@ than under-splitting. Meet BOTH conditions before you extract.
61
61
  **Read `DESIGN.md` § Owned components first** — it is the project's own inventory of what
62
62
  it already owns (component, status, story file, registry item), filled from the story files
63
63
  rather than from memory by
64
- [`design-system-capture`](../design-system-capture/SKILL.md). It is the cheapest possible
64
+ `design-system-capture`. It is the cheapest possible
65
65
  prior-art check: one table, and a `deprecated` row tells you not to reach for something that
66
66
  still exists in the tree. Absent or empty → fall through to
67
67
  [`existing-ui-audit`](../existing-ui-audit/SKILL.md), which reads the codebase itself.
@@ -104,7 +104,7 @@ checkable before it reaches a page. That skill is stack-agnostic and ships in
104
104
  `engineering-base`, so a plain-`react` project receives it exactly as a
105
105
  `react-shadcn` one does. The state-coverage matrix the story set is derived
106
106
  from is React-specific and lives in
107
- [`react-shadcn-ui`](../react-shadcn-ui/SKILL.md) § Step 3, deliberately not
107
+ `react-shadcn-ui` § Step 3, deliberately not
108
108
  duplicated here; a Blade, Vue or Livewire lane derives its story set from that
109
109
  lane's own state list instead.
110
110
 
@@ -39,7 +39,7 @@ schema_version: 1
39
39
  # CI guard: a release bump of `package.json` must update this value
40
40
  # in lockstep — see scripts/check_template_pin_drift.ts (road-to-
41
41
  # portable-runtime-and-update-check P3.3).
42
- agent_config_version: "16.2.0"
42
+ agent_config_version: "16.3.0"
43
43
 
44
44
  # --- Project identity ---
45
45
  project:
@@ -133,12 +133,11 @@ export function run(state: DeliveryState): StepResult {
133
133
  return _halt_coverage(state, provided, report.gaps);
134
134
  }
135
135
  notes.push(...report.fallbacks);
136
- // 3.1 — reported in shadow: the outcome value is unchanged for one
137
- // release, so a caller branching on it is found by the line rather
138
- // than by the breakage.
139
- const handed_back = _handed_back_line(report);
140
- if (handed_back !== null) {
141
- notes.push(handed_back);
136
+ // 3.2 — the shadow is now the outcome. 3.1 shipped the line one
137
+ // release ahead (16.2.0 carries it) so a caller branching on
138
+ // `SUCCESS` was found by the words before it is found by the value.
139
+ if (carried_nothing(report)) {
140
+ return _halt_carried_nothing(state, report, notes);
142
141
  }
143
142
  }
144
143
 
@@ -390,6 +389,49 @@ function _halt_coverage(
390
389
  });
391
390
  }
392
391
 
392
+ /**
393
+ * BLOCKED halt — the port accounted for everything and carried none of it.
394
+ *
395
+ * The gap list is empty here by construction: a complete report and a complete
396
+ * surrender look identical to `coverage_gaps`, which is why this is its own
397
+ * halt rather than a gap. `questions` is non-empty because the dispatcher
398
+ * rejects a `BLOCKED` result that surfaces nothing to answer — handing the
399
+ * work back has to come with a way forward, not just a refusal.
400
+ */
401
+ function _halt_carried_nothing(
402
+ state: DeliveryState,
403
+ report: CoverageReport,
404
+ fallbacks: ReadonlyArray<string>,
405
+ ): StepResult {
406
+ const directive = _resolve_directive(state);
407
+ const lines: string[] = [
408
+ agent_directive(directive),
409
+ '> Apply rejected: the coverage report accounts for every declared ' +
410
+ 'item and the port carried none of them over.',
411
+ `> All ${report.declared.length} declared item(s) are in \`flagged\`:`,
412
+ ];
413
+ for (const item of report.handed_back) {
414
+ lines.push(`> - \`${item}\``);
415
+ }
416
+ lines.push(
417
+ '> A complete report and a complete hand-back are the same empty gap ' +
418
+ 'list, so this is checked separately — flagging one handler the ' +
419
+ 'port could not carry is the ledger working; flagging all of them ' +
420
+ 'is the port not having run.',
421
+ '> 1. Continue — implement the items above and re-write ' +
422
+ '`ui_apply.coverage` with each one in `honoured` or `translated`, ' +
423
+ 'leaving in `flagged` only what genuinely could not be carried',
424
+ '> 2. Flag deliberately — say here which of the items above are out of ' +
425
+ 'scope for this port and why, and the operator decides',
426
+ '> 3. Abort — drop this UI request',
427
+ );
428
+ return new StepResult({
429
+ outcome: Outcome.BLOCKED,
430
+ questions: lines,
431
+ message: [...fallbacks, `UI apply rejected: ${_handed_back_line(report)}`].join('\n'),
432
+ });
433
+ }
434
+
393
435
  /** Return the agent-written `ui_apply` envelope, or `null`. */
394
436
  function _apply_envelope(state: DeliveryState): Record<string, Any> | null {
395
437
  const data = _pyTruthy(state.ticket) ? state.ticket : {};