@event4u/agent-config 16.3.0 → 16.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (532) 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 +178 -78
  5. package/README.md +2 -2
  6. package/agents/templates/.ai-council.yml.example +26 -8
  7. package/dist/agent-src/commands/analyze/inbox.md +10 -7
  8. package/dist/agent-src/commands/bug/investigate.md +1 -1
  9. package/dist/agent-src/commands/commit/in-chunks.md +40 -31
  10. package/dist/agent-src/commands/commit.md +72 -33
  11. package/dist/agent-src/commands/condense.md +2 -8
  12. package/dist/agent-src/commands/council/debate.md +11 -7
  13. package/dist/agent-src/commands/council/default.md +10 -9
  14. package/dist/agent-src/commands/council.md +1 -1
  15. package/dist/agent-src/commands/design.md +1 -1
  16. package/dist/agent-src/commands/estimate-ticket.md +1 -1
  17. package/dist/agent-src/commands/feature/explore.md +3 -3
  18. package/dist/agent-src/commands/feature/plan.md +1 -1
  19. package/dist/agent-src/commands/fix/ci.md +17 -3
  20. package/dist/agent-src/commands/fix/commit-messages.md +48 -23
  21. package/dist/agent-src/commands/fix/pr-comments.md +3 -6
  22. package/dist/agent-src/commands/implement-ticket.md +3 -3
  23. package/dist/agent-src/commands/memory/add.md +4 -16
  24. package/dist/agent-src/commands/memory/load.md +5 -6
  25. package/dist/agent-src/commands/memory/promote.md +3 -16
  26. package/dist/agent-src/commands/mission/upgrade.md +3 -2
  27. package/dist/agent-src/commands/optimize/agents-dir.md +2 -2
  28. package/dist/agent-src/commands/optimize/deep.md +4 -2
  29. package/dist/agent-src/commands/optimize/rtk.md +4 -26
  30. package/dist/agent-src/commands/pr/create/description-only.md +18 -15
  31. package/dist/agent-src/commands/pr/create.md +42 -34
  32. package/dist/agent-src/commands/pr/merge.md +136 -9
  33. package/dist/agent-src/commands/prepare-for-review.md +13 -11
  34. package/dist/agent-src/commands/project/analyze.md +7 -35
  35. package/dist/agent-src/commands/refine-ticket.md +1 -1
  36. package/dist/agent-src/commands/review/changes.md +14 -19
  37. package/dist/agent-src/commands/roadmap/next.md +10 -1
  38. package/dist/agent-src/commands/roadmap/process-full.md +52 -38
  39. package/dist/agent-src/commands/roadmap/resolve-blockers.md +64 -14
  40. package/dist/agent-src/commands/worktree/create.md +7 -3
  41. package/dist/agent-src/commands/worktree/verify.md +2 -1
  42. package/dist/agent-src/contexts/communication/rules-auto/think-before-action-mechanics.md +5 -3
  43. package/dist/agent-src/contexts/communication/rules-auto/token-efficiency-mechanics.md +7 -9
  44. package/dist/agent-src/contexts/contracts/command-suggestion-flow.md +8 -6
  45. package/dist/agent-src/contexts/contracts/frugality-charter.md +8 -5
  46. package/dist/agent-src/contexts/execution/auto-dispatch-classification.md +1 -1
  47. package/dist/agent-src/contexts/execution/auto-orchestration-activation.md +0 -1
  48. package/dist/agent-src/contexts/execution/evidence-discipline.md +2 -2
  49. package/dist/agent-src/contexts/execution/non-interactive-contract.md +5 -8
  50. package/dist/agent-src/contexts/execution/rdp-gate.md +4 -4
  51. package/dist/agent-src/contexts/execution/roadmap-execution-contract.md +9 -8
  52. package/dist/agent-src/contexts/execution/roadmap-process-loop.md +67 -52
  53. package/dist/agent-src/contexts/execution/subagent-routing.md +8 -8
  54. package/dist/agent-src/contexts/execution/subagent-steering.md +6 -4
  55. package/dist/agent-src/contexts/execution/terminal-states.md +2 -2
  56. package/dist/agent-src/contexts/execution/toolchain-resolver.md +4 -10
  57. package/dist/agent-src/contexts/subagent-configuration.md +1 -1
  58. package/dist/agent-src/guidelines/agent-infra/active-remediation-mechanics.md +39 -0
  59. package/dist/agent-src/guidelines/agent-infra/context-hygiene-mechanics.md +1 -1
  60. package/dist/agent-src/guidelines/agent-infra/cross-source-consistency-mechanics.md +8 -10
  61. package/dist/agent-src/guidelines/agent-infra/frontier-reasoning-operating-profile.md +3 -2
  62. package/dist/agent-src/guidelines/agent-infra/layered-settings.md +13 -1
  63. package/dist/agent-src/guidelines/agent-infra/roadmap-progress-mechanics.md +1 -1
  64. package/dist/agent-src/guidelines/agent-infra/self-improvement-pipeline.md +10 -3
  65. package/dist/agent-src/guidelines/agent-infra/size-and-scope.md +36 -0
  66. package/dist/agent-src/guidelines/design-antipatterns.md +1 -1
  67. package/dist/agent-src/guidelines/php/git.md +15 -2
  68. package/dist/agent-src/rules/active-remediation.md +0 -1
  69. package/dist/agent-src/rules/analysis-skill-routing.md +0 -1
  70. package/dist/agent-src/rules/architecture.md +0 -1
  71. package/dist/agent-src/rules/artifact-drafting-protocol.md +0 -1
  72. package/dist/agent-src/rules/artifact-engagement-recording.md +0 -1
  73. package/dist/agent-src/rules/augment-edit-discipline.md +0 -1
  74. package/dist/agent-src/rules/autonomous-execution.md +0 -1
  75. package/dist/agent-src/rules/brand-consistency.md +0 -1
  76. package/dist/agent-src/rules/brand-source-of-truth.md +0 -1
  77. package/dist/agent-src/rules/broken-access-control.md +0 -1
  78. package/dist/agent-src/rules/cli-output-handling.md +0 -1
  79. package/dist/agent-src/rules/code-comment-discipline.md +0 -1
  80. package/dist/agent-src/rules/code-provenance.md +0 -1
  81. package/dist/agent-src/rules/command-suggestion-policy.md +0 -1
  82. package/dist/agent-src/rules/commit-conventions.md +1 -2
  83. package/dist/agent-src/rules/communication-through-line.md +1 -2
  84. package/dist/agent-src/rules/content-quoting-floor.md +1 -2
  85. package/dist/agent-src/rules/context-hygiene.md +5 -5
  86. package/dist/agent-src/rules/copilot-routing.md +1 -2
  87. package/dist/agent-src/rules/council-availability.md +4 -4
  88. package/dist/agent-src/rules/cross-source-consistency.md +4 -6
  89. package/dist/agent-src/rules/decision-revisit-gate.md +2 -3
  90. package/dist/agent-src/rules/delegation-policy.md +2 -3
  91. package/dist/agent-src/rules/design-fidelity.md +0 -1
  92. package/dist/agent-src/rules/design-review-after-ui-write.md +3 -3
  93. package/dist/agent-src/rules/devcontainer-routing.md +1 -2
  94. package/dist/agent-src/rules/doc-screenshot-hygiene.md +0 -1
  95. package/dist/agent-src/rules/docker-commands.md +0 -1
  96. package/dist/agent-src/rules/domain-adoption-policy.md +0 -1
  97. package/dist/agent-src/rules/domain-safety-disclaimer.md +0 -1
  98. package/dist/agent-src/rules/domain-safety-pii.md +0 -1
  99. package/dist/agent-src/rules/domain-safety-retention.md +0 -1
  100. package/dist/agent-src/rules/downstream-changes.md +0 -1
  101. package/dist/agent-src/rules/engineering-safety-floor.md +0 -1
  102. package/dist/agent-src/rules/external-code-graph-interop.md +0 -1
  103. package/dist/agent-src/rules/external-reference-deep-dive.md +0 -1
  104. package/dist/agent-src/rules/fast-path-marker-visibility.md +1 -2
  105. package/dist/agent-src/rules/finance-safety-floor.md +0 -1
  106. package/dist/agent-src/rules/fix-what-you-see.md +6 -32
  107. package/dist/agent-src/rules/framework-neutrality-in-generic-skills.md +0 -1
  108. package/dist/agent-src/rules/git-history-discipline.md +1 -2
  109. package/dist/agent-src/rules/guidelines.md +0 -1
  110. package/dist/agent-src/rules/history-discipline.md +0 -1
  111. package/dist/agent-src/rules/icon-consistency.md +0 -1
  112. package/dist/agent-src/rules/image-likeness-and-rights.md +0 -1
  113. package/dist/agent-src/rules/improve-before-implement.md +0 -1
  114. package/dist/agent-src/rules/invite-challenge.md +0 -1
  115. package/dist/agent-src/rules/laravel-routing.md +1 -2
  116. package/dist/agent-src/rules/laravel-translations.md +0 -1
  117. package/dist/agent-src/rules/legal-safety-floor.md +0 -1
  118. package/dist/agent-src/rules/lethal-trifecta-guard.md +0 -1
  119. package/dist/agent-src/rules/linked-projects-onboarding-gate.md +0 -1
  120. package/dist/agent-src/rules/low-impact-corpus-privacy-floor.md +0 -1
  121. package/dist/agent-src/rules/markdown-safe-codeblocks.md +0 -1
  122. package/dist/agent-src/rules/media-governance-routing.md +1 -2
  123. package/dist/agent-src/rules/media-sync-ground-truth.md +0 -1
  124. package/dist/agent-src/rules/minimal-safe-diff.md +0 -1
  125. package/dist/agent-src/rules/missing-skill-recovery.md +0 -1
  126. package/dist/agent-src/rules/missing-tool-handling.md +0 -1
  127. package/dist/agent-src/rules/model-recommendation.md +0 -1
  128. package/dist/agent-src/rules/neighbour-precedence.md +64 -0
  129. package/dist/agent-src/rules/no-attribution-footers.md +0 -1
  130. package/dist/agent-src/rules/no-decorative-emojis-in-git-surfaces.md +0 -1
  131. package/dist/agent-src/rules/no-pr-progress-comments.md +0 -1
  132. package/dist/agent-src/rules/no-roadmap-references.md +0 -1
  133. package/dist/agent-src/rules/notes-first-reasoning.md +0 -1
  134. package/dist/agent-src/rules/onboarding-gate.md +0 -1
  135. package/dist/agent-src/rules/output-discipline.md +0 -1
  136. package/dist/agent-src/rules/package-ci-checks.md +0 -1
  137. package/dist/agent-src/rules/persona-governance.md +2 -3
  138. package/dist/agent-src/rules/php-coding.md +0 -1
  139. package/dist/agent-src/rules/prefer-enums-over-literals.md +0 -1
  140. package/dist/agent-src/rules/preservation-guard.md +0 -1
  141. package/dist/agent-src/rules/provider-lifecycle-discipline.md +2 -3
  142. package/dist/agent-src/rules/question-not-instruction.md +0 -1
  143. package/dist/agent-src/rules/reviewer-awareness.md +0 -1
  144. package/dist/agent-src/rules/roadmap-ci-steps-policy.md +0 -1
  145. package/dist/agent-src/rules/roadmap-progress-sync.md +3 -6
  146. package/dist/agent-src/rules/role-mode-adherence.md +0 -1
  147. package/dist/agent-src/rules/rule-type-governance.md +0 -1
  148. package/dist/agent-src/rules/runtime-safety.md +0 -1
  149. package/dist/agent-src/rules/scale-discipline.md +0 -1
  150. package/dist/agent-src/rules/secret-vcs-guard.md +0 -1
  151. package/dist/agent-src/rules/security-sensitive-stop.md +0 -1
  152. package/dist/agent-src/rules/self-repair-loop.md +0 -1
  153. package/dist/agent-src/rules/senior-engineering-discipline.md +0 -1
  154. package/dist/agent-src/rules/session-canary.md +0 -1
  155. package/dist/agent-src/rules/settings-ask-protocol.md +5 -6
  156. package/dist/agent-src/rules/size-enforcement.md +0 -1
  157. package/dist/agent-src/rules/skill-improvement-trigger.md +2 -3
  158. package/dist/agent-src/rules/skill-quality.md +0 -1
  159. package/dist/agent-src/rules/slash-command-routing-policy.md +0 -1
  160. package/dist/agent-src/rules/source-confidentiality.md +0 -1
  161. package/dist/agent-src/rules/source-discovery-gate.md +0 -1
  162. package/dist/agent-src/rules/source-of-truth.md +0 -1
  163. package/dist/agent-src/rules/spreadsheet-source-quality.md +1 -2
  164. package/dist/agent-src/rules/strategy-safety-floor.md +0 -1
  165. package/dist/agent-src/rules/symfony-routing.md +1 -2
  166. package/dist/agent-src/rules/think-before-action.md +0 -1
  167. package/dist/agent-src/rules/token-budget-discipline.md +14 -48
  168. package/dist/agent-src/rules/token-efficiency.md +0 -1
  169. package/dist/agent-src/rules/token-optimizer-maintenance.md +0 -1
  170. package/dist/agent-src/rules/tool-safety.md +0 -1
  171. package/dist/agent-src/rules/ui-audit-gate.md +1 -2
  172. package/dist/agent-src/rules/untrusted-input-defense.md +0 -1
  173. package/dist/agent-src/rules/upstream-proposal.md +0 -1
  174. package/dist/agent-src/rules/user-interaction.md +0 -1
  175. package/dist/agent-src/rules/user-interrupt-priority.md +0 -1
  176. package/dist/agent-src/scripts/gate_budget.ts +47 -23
  177. package/dist/agent-src/scripts/gate_execute.ts +12 -4
  178. package/dist/agent-src/skills/accessibility-auditor/data/aria-patterns.csv +2 -0
  179. package/dist/agent-src/skills/accessibility-auditor/data/manifest.json +3 -3
  180. package/dist/agent-src/skills/ai-council/SKILL.md +7 -4
  181. package/dist/agent-src/skills/ai-council/references/cost-and-redaction.md +21 -11
  182. package/dist/agent-src/skills/ai-council/references/procedure.md +12 -6
  183. package/dist/agent-src/skills/analysis-autonomous-mode/SKILL.md +1 -1
  184. package/dist/agent-src/skills/bug-analyzer/SKILL.md +1 -1
  185. package/dist/agent-src/skills/canvas-design/SKILL.md +4 -2
  186. package/dist/agent-src/skills/command-routing/SKILL.md +3 -4
  187. package/dist/agent-src/skills/conventional-commits-writing/SKILL.md +127 -139
  188. package/dist/agent-src/skills/corpus-grounding/ATTRIBUTION.md +39 -0
  189. package/dist/agent-src/skills/corpus-grounding/SKILL.md +8 -2
  190. package/dist/agent-src/skills/database/data/manifest.json +2 -2
  191. package/dist/agent-src/skills/database/data/query-tuning.csv +13 -13
  192. package/dist/agent-src/skills/design-intelligence/references/integration-mapping.md +13 -10
  193. package/dist/agent-src/skills/design-system-capture/SKILL.md +0 -3
  194. package/dist/agent-src/skills/estimate-ticket/SKILL.md +1 -1
  195. package/dist/agent-src/skills/fe-design/references/design-patterns.md +49 -2
  196. package/dist/agent-src/skills/feature-planning/SKILL.md +1 -1
  197. package/dist/agent-src/skills/frontend-render-security/SKILL.md +9 -0
  198. package/dist/agent-src/skills/git-workflow/SKILL.md +44 -44
  199. package/dist/agent-src/skills/git-workflow/references/branch-update.md +312 -0
  200. package/dist/agent-src/skills/git-workflow/references/commit-subject.md +205 -0
  201. package/dist/agent-src/skills/iconography/SKILL.md +4 -2
  202. package/dist/agent-src/skills/image-provider-routing/SKILL.md +16 -5
  203. package/dist/agent-src/skills/jira-integration/SKILL.md +3 -3
  204. package/dist/agent-src/skills/logo-generation/SKILL.md +12 -8
  205. package/dist/agent-src/skills/merge-conflicts/SKILL.md +10 -4
  206. package/dist/agent-src/skills/po-discovery/SKILL.md +1 -1
  207. package/dist/agent-src/skills/refine-ticket/SKILL.md +4 -4
  208. package/dist/agent-src/skills/roadmap-writing/SKILL.md +2 -2
  209. package/dist/agent-src/skills/skill-improvement-pipeline/SKILL.md +4 -2
  210. package/dist/agent-src/skills/source-discovery/SKILL.md +1 -1
  211. package/dist/agent-src/skills/svg-authoring/SKILL.md +318 -0
  212. package/dist/agent-src/skills/tailwind-engineer/SKILL.md +3 -1
  213. package/dist/agent-src/skills/testing-anti-patterns/SKILL.md +1 -1
  214. package/dist/agent-src/skills/using-git-worktrees/SKILL.md +1 -1
  215. package/dist/agent-src/skills/verify-repair-loop/SKILL.md +2 -2
  216. package/dist/agent-src/skills/wireframe/SKILL.md +5 -2
  217. package/dist/agent-src/templates/AGENTS.md +1 -1
  218. package/dist/agent-src/templates/agent-settings.md +46 -129
  219. package/dist/agent-src/templates/agents/agent-project-settings.example.yml +3 -3
  220. package/dist/agent-src/templates/command.md +2 -2
  221. package/dist/agent-src/templates/roadmaps.md +6 -1
  222. package/dist/agent-src/templates/scripts/work_engine/_lib/agent_settings.ts +0 -6
  223. package/dist/agent-src/templates/scripts/work_engine/directives/backend/_self_fix.ts +11 -7
  224. package/dist/agent-src/templates/scripts/work_engine/hooks/builtin/decision_trace.ts +3 -2
  225. package/dist/agent-src/templates/scripts/work_engine/hooks/builtin/memory_visibility.ts +2 -1
  226. package/dist/agent-src/templates/scripts/work_engine/hooks/settings.ts +0 -6
  227. package/dist/agent-src/templates/scripts/work_engine/scoring/decision_engine.ts +9 -12
  228. package/dist/agent-src/templates/scripts/work_engine/scoring/memory_visibility.ts +2 -1
  229. package/dist/agent-src/templates/skill.md +1 -1
  230. package/dist/cli/commands/uiRender.js +201 -4
  231. package/dist/cli/commands/uiRenderAsset.js +1308 -0
  232. package/dist/cli/commands/uiRenderAssetCompare.js +752 -0
  233. package/dist/cli/commands/uiRenderAssetGrid.js +265 -0
  234. package/dist/cli/commands/uiRenderAssetGrounds.js +323 -0
  235. package/dist/cli/commands/uiRenderAssetIsolation.js +85 -0
  236. package/dist/cli/commands/uiRenderAssetTypes.js +145 -0
  237. package/dist/cli/main.js +47 -1
  238. package/dist/cli/registry.js +2 -1
  239. package/dist/cli-delegate/check_update_banner.js +195 -119
  240. package/dist/cli-delegate/{chunk-S4UMZNES.js → chunk-4DBG5K7M.js} +5 -5
  241. package/dist/cli-delegate/{chunk-TRI6DQZ6.js → chunk-5GPULQBE.js} +60 -42
  242. package/dist/cli-delegate/{chunk-JQVYKIZA.js → chunk-6SRJTYJS.js} +33 -177
  243. package/dist/cli-delegate/chunk-6V5FMA3P.js +186 -0
  244. package/dist/cli-delegate/chunk-6YQC2HLF.js +415 -0
  245. package/dist/cli-delegate/{chunk-E4XIZDIB.js → chunk-7HKRE54K.js} +1 -64
  246. package/dist/cli-delegate/{chunk-7HQ52DHU.js → chunk-AL3RZ22D.js} +1 -1
  247. package/dist/cli-delegate/{chunk-DBH4AHDK.js → chunk-ED7KCMLB.js} +9 -11
  248. package/dist/cli-delegate/{chunk-NXEILF2K.js → chunk-F3QDG2GT.js} +481 -72
  249. package/dist/cli-delegate/{chunk-CQWX336L.js → chunk-G5VVIZRC.js} +3 -3
  250. package/dist/cli-delegate/{chunk-JY2I2DXV.js → chunk-H76PHZBI.js} +137 -60
  251. package/dist/cli-delegate/chunk-IAYTIIQW.js +67 -0
  252. package/dist/cli-delegate/{chunk-LIYTLH6O.js → chunk-KXXWJTDO.js} +5 -10
  253. package/dist/cli-delegate/{chunk-T7L2QK3K.js → chunk-LQOCRFWT.js} +1 -1
  254. package/dist/cli-delegate/{chunk-S4YWNRKO.js → chunk-MDPPKQCQ.js} +34 -1
  255. package/dist/cli-delegate/chunk-OAFSJBHH.js +272 -0
  256. package/dist/cli-delegate/{chunk-GKE7ZVFA.js → chunk-PWX7CKMD.js} +1 -1
  257. package/dist/cli-delegate/{chunk-NDJLNC6Q.js → chunk-T6BP34WI.js} +1 -0
  258. package/dist/cli-delegate/{chunk-RQNNW7IF.js → chunk-T7XSJSUQ.js} +433 -632
  259. package/dist/cli-delegate/{chunk-NQ7WT43P.js → chunk-TMWYUOK4.js} +75 -12
  260. package/dist/cli-delegate/{chunk-EEHDXSYD.js → chunk-WQWXGIWB.js} +12 -273
  261. package/dist/cli-delegate/{chunk-QLDHIPWR.js → chunk-XQTPXKFA.js} +1 -1
  262. package/dist/cli-delegate/cmd_analyze_session.js +223 -43
  263. package/dist/cli-delegate/cmd_brand_status.js +3 -2
  264. package/dist/cli-delegate/cmd_conformance.js +489 -238
  265. package/dist/cli-delegate/cmd_converge.js +3 -3
  266. package/dist/cli-delegate/cmd_doctor.js +15 -12
  267. package/dist/cli-delegate/cmd_doctor_neighbours.js +11 -4
  268. package/dist/cli-delegate/cmd_explain.js +43 -19
  269. package/dist/cli-delegate/cmd_export.js +10 -10
  270. package/dist/cli-delegate/cmd_git_convention.js +1851 -0
  271. package/dist/cli-delegate/cmd_handoff.js +40 -21
  272. package/dist/cli-delegate/cmd_mcp_available.js +3 -2
  273. package/dist/cli-delegate/cmd_migrate.js +3 -3
  274. package/dist/cli-delegate/cmd_packs_active.js +4 -3
  275. package/dist/cli-delegate/cmd_prune.js +10 -10
  276. package/dist/cli-delegate/cmd_route_audit.js +7 -7
  277. package/dist/cli-delegate/cmd_route_explain.js +5 -5
  278. package/dist/cli-delegate/cmd_session_recycle.js +9 -7
  279. package/dist/cli-delegate/cmd_settings_check.js +54 -7
  280. package/dist/cli-delegate/cmd_settings_get.js +18 -8
  281. package/dist/cli-delegate/cmd_settings_migrate.js +10 -10
  282. package/dist/cli-delegate/cmd_settings_set.js +1 -1
  283. package/dist/cli-delegate/cmd_sync.js +10 -10
  284. package/dist/cli-delegate/cmd_uninstall.js +10 -10
  285. package/dist/cli-delegate/cmd_update.js +7 -7
  286. package/dist/cli-delegate/cmd_upgrade.js +7 -7
  287. package/dist/cli-delegate/cmd_validate.js +10 -10
  288. package/dist/cli-delegate/cmd_versions.js +5 -5
  289. package/dist/cli-delegate/gate_budget.js +1 -1
  290. package/dist/cli-delegate/gate_execute.js +2 -2
  291. package/dist/cli-delegate/roadmap_gates.js +2 -2
  292. package/dist/discovery/deprecation-report.md +1 -1
  293. package/dist/discovery/discovery-manifest.json +171 -107
  294. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  295. package/dist/discovery/discovery-manifest.summary.md +7 -7
  296. package/dist/discovery/dormancy-report.md +1 -1
  297. package/dist/discovery/orphan-report.md +1 -1
  298. package/dist/discovery/packs.json +41 -22
  299. package/dist/discovery/trust-report.md +3 -3
  300. package/dist/discovery/workspaces.json +16 -11
  301. package/dist/hooks/dispatch.js +2520 -1924
  302. package/dist/hooks/dispatch.sha256 +1 -1
  303. package/dist/hooks/svg_rules.chunk.cjs +1626 -0
  304. package/dist/hooks/svg_rules.chunk.cjs.sha256 +1 -0
  305. package/dist/install/install.mjs +462 -431
  306. package/dist/install/installThinLayer.js +40 -12
  307. package/dist/install/installedRuleLinks.js +105 -19
  308. package/dist/mcp/awesome-mcp-servers.row.md +1 -1
  309. package/dist/mcp/mcp-cloudflare-catalogue.json +2 -2
  310. package/dist/mcp/registry-manifest.json +5 -5
  311. package/dist/mcp/server.json +2 -2
  312. package/dist/mcp/server.mjs +3063 -2160
  313. package/dist/router.json +1 -1
  314. package/dist/scripts/_lib/agent_settings.js +15 -120
  315. package/dist/scripts/_lib/compile_time_toggles.js +12 -21
  316. package/dist/scripts/_lib/git_convention.js +232 -0
  317. package/dist/scripts/_lib/global_deploy_inventory.js +730 -0
  318. package/dist/scripts/_lib/installed_layer.js +344 -18
  319. package/dist/scripts/_lib/package_root.js +68 -0
  320. package/dist/scripts/_lib/rule_law_section.js +1 -1
  321. package/dist/scripts/_lib/scan_scope.js +105 -0
  322. package/dist/scripts/_lib/settings_removed_keys.js +168 -0
  323. package/dist/scripts/_lib/svg_dom.js +284 -0
  324. package/dist/scripts/_lib/svg_geometry.js +477 -0
  325. package/dist/scripts/_lib/svg_motion.js +179 -0
  326. package/dist/scripts/_lib/svg_rules.js +1337 -0
  327. package/dist/scripts/_lib/svg_urls.js +67 -0
  328. package/dist/scripts/_lib/thin_rules.js +80 -3
  329. package/dist/scripts/lint_svg_asset.js +324 -0
  330. package/dist/server/app.js +2 -1
  331. package/dist/server/gitKeysGate.js +105 -0
  332. package/dist/server/routes/settings.js +67 -8
  333. package/dist/server/routes/wizard.js +4 -0
  334. package/dist/server/schemas/settings.js +23 -81
  335. package/dist/shared/skillRanking.js +30 -4
  336. package/dist/ui/assets/{index-Cwq4d0hX.js → index-C3djEJah.js} +2 -2
  337. package/dist/ui/index.html +1 -1
  338. package/docs/MIGRATION.md +72 -1
  339. package/docs/contracts/settings-classes.md +35 -65
  340. package/docs/guidelines/agent-infra/active-remediation-mechanics.md +39 -0
  341. package/docs/guidelines/agent-infra/context-hygiene-mechanics.md +1 -1
  342. package/docs/guidelines/agent-infra/cross-source-consistency-mechanics.md +8 -10
  343. package/docs/guidelines/agent-infra/frontier-reasoning-operating-profile.md +3 -2
  344. package/docs/guidelines/agent-infra/layered-settings.md +13 -1
  345. package/docs/guidelines/agent-infra/roadmap-progress-mechanics.md +1 -1
  346. package/docs/guidelines/agent-infra/self-improvement-pipeline.md +10 -3
  347. package/docs/guidelines/agent-infra/size-and-scope.md +36 -0
  348. package/docs/guidelines/design-antipatterns.md +1 -1
  349. package/docs/guidelines/php/git.md +15 -2
  350. package/package.json +4 -3
  351. package/src/agent-src/scripts/gate_budget.ts +47 -23
  352. package/src/agent-src/scripts/gate_execute.ts +12 -4
  353. package/src/agent-src/templates/AGENTS.md +1 -1
  354. package/src/agent-src/templates/scripts/work_engine/_lib/agent_settings.ts +0 -6
  355. package/src/agent-src/templates/scripts/work_engine/directives/backend/_self_fix.ts +11 -7
  356. package/src/agent-src/templates/scripts/work_engine/hooks/builtin/decision_trace.ts +3 -2
  357. package/src/agent-src/templates/scripts/work_engine/hooks/builtin/memory_visibility.ts +2 -1
  358. package/src/agent-src/templates/scripts/work_engine/hooks/settings.ts +0 -6
  359. package/src/agent-src/templates/scripts/work_engine/scoring/decision_engine.ts +9 -12
  360. package/src/agent-src/templates/scripts/work_engine/scoring/memory_visibility.ts +2 -1
  361. package/src/config/agent-settings.template.yml +79 -312
  362. package/src/config/agents-paths.yml +16 -0
  363. package/src/config/assurance-capability-registry.json +7 -3
  364. package/src/config/ci-local-parity.yml +3 -0
  365. package/src/config/continuity-surface.json +3 -3
  366. package/src/config/discovery/packs.yml +17 -1
  367. package/src/config/evaluator-budgets.json +19 -6
  368. package/src/config/gate-coverage.yml +65 -23
  369. package/src/config/gate-violation-baselines.json +56 -16
  370. package/src/config/gitignore-block.txt +19 -0
  371. package/src/config/hook-bundle-budget.json +1 -1
  372. package/src/config/release-gate-locality.yml +2 -1
  373. package/src/config/routing-coverage-seed.json +55 -6
  374. package/src/config/rule-law-ceilings.json +12 -6
  375. package/src/config/rule-obligations.json +833 -0
  376. package/src/install/installThinLayer.ts +76 -10
  377. package/src/install/installedRuleLinks.ts +105 -17
  378. package/src/scripts/_cli/cmd_analyze_session.ts +9 -15
  379. package/src/scripts/_cli/cmd_conformance.ts +13 -2
  380. package/src/scripts/_cli/cmd_doctor.ts +10 -10
  381. package/src/scripts/_cli/cmd_doctor_neighbours.ts +133 -0
  382. package/src/scripts/_cli/cmd_explain.ts +72 -14
  383. package/src/scripts/_cli/cmd_git_convention.ts +637 -0
  384. package/src/scripts/_cli/cmd_settings_check.ts +66 -8
  385. package/src/scripts/_cli/cmd_settings_get.ts +18 -3
  386. package/src/scripts/_cli/doctor_execution.ts +72 -1
  387. package/src/scripts/_dispatch.bash +37 -2
  388. package/src/scripts/_lib/agent_settings.ts +15 -124
  389. package/src/scripts/_lib/blocked_by_marker.ts +1 -1
  390. package/src/scripts/_lib/compile_time_toggles.ts +12 -21
  391. package/src/scripts/_lib/dispatch_import_closure.ts +163 -0
  392. package/src/scripts/_lib/git_base_ref.ts +92 -0
  393. package/src/scripts/_lib/git_convention.ts +291 -0
  394. package/src/scripts/_lib/git_convention_carrier.ts +389 -0
  395. package/src/scripts/_lib/git_convention_grammar.ts +246 -0
  396. package/src/scripts/_lib/git_convention_measure.ts +344 -0
  397. package/src/scripts/_lib/global_deploy_inventory.ts +74 -0
  398. package/src/scripts/_lib/graph_feeder_record.ts +236 -13
  399. package/src/scripts/_lib/installed_layer.ts +448 -23
  400. package/src/scripts/_lib/knowledge_global.ts +14 -1
  401. package/src/scripts/_lib/module_reach.ts +456 -0
  402. package/src/scripts/_lib/neighbour_contradictions.ts +236 -0
  403. package/src/scripts/_lib/neighbour_tool_use.ts +8 -10
  404. package/src/scripts/_lib/ratification_artifact.ts +220 -1
  405. package/src/scripts/_lib/ratification_subject.ts +92 -0
  406. package/src/scripts/_lib/release_findings_ingest.ts +15 -7
  407. package/src/scripts/_lib/release_highlights.ts +5 -0
  408. package/src/scripts/_lib/rule_law_section.ts +1 -1
  409. package/src/scripts/_lib/rule_obligations.ts +205 -0
  410. package/src/scripts/_lib/self_repair.ts +1 -1
  411. package/src/scripts/_lib/settings_removed_keys.ts +173 -0
  412. package/src/scripts/_lib/svg_dom.ts +318 -0
  413. package/src/scripts/_lib/svg_geometry.ts +480 -0
  414. package/src/scripts/_lib/svg_motion.ts +208 -0
  415. package/src/scripts/_lib/svg_rules.ts +1453 -0
  416. package/src/scripts/_lib/svg_urls.ts +72 -0
  417. package/src/scripts/_lib/test_red_state.ts +5 -0
  418. package/src/scripts/_lib/thin_rules.ts +83 -3
  419. package/src/scripts/_lib/touched_file_quality.ts +142 -6
  420. package/src/scripts/_lib/verification_command.ts +59 -0
  421. package/src/scripts/_lib/verify_clause.ts +27 -17
  422. package/src/scripts/_lib/worker_budget.ts +1 -1
  423. package/src/scripts/adr/regenerate_index.ts +16 -1
  424. package/src/scripts/ai_council/config.ts +7 -7
  425. package/src/scripts/ai_council/modification_review.ts +100 -0
  426. package/src/scripts/ai_council/modification_review_questions.ts +90 -0
  427. package/src/scripts/ai_council/orchestrator.ts +5 -5
  428. package/src/scripts/ai_council/spend_gate.ts +18 -7
  429. package/src/scripts/ai_team/config.ts +11 -16
  430. package/src/scripts/audit_user_type_axis.ts +20 -8
  431. package/src/scripts/bench_ab_clone.ts +1 -2
  432. package/src/scripts/bench_concern_spawn_path.ts +129 -0
  433. package/src/scripts/bench_graph_feeder_latency.ts +584 -0
  434. package/src/scripts/check_agent_artifact_location.ts +36 -0
  435. package/src/scripts/check_branch_freshness.ts +147 -24
  436. package/src/scripts/check_enforcement_coverage.ts +130 -0
  437. package/src/scripts/check_evaluator_budgets.ts +4 -0
  438. package/src/scripts/check_finding_dispositions.ts +88 -25
  439. package/src/scripts/check_gate_coverage.ts +4 -3
  440. package/src/scripts/check_gate_reachability.ts +48 -1
  441. package/src/scripts/check_generator_sync.ts +48 -0
  442. package/src/scripts/check_hook_bundle_composition.ts +107 -0
  443. package/src/scripts/check_kernel_edit_ratified.ts +86 -6
  444. package/src/scripts/check_pack_size.ts +1 -1
  445. package/src/scripts/check_release_manifest_content.ts +189 -0
  446. package/src/scripts/check_standing_rule_delivery.ts +96 -0
  447. package/src/scripts/check_suppression_hygiene.ts +2 -5
  448. package/src/scripts/ci_settle.ts +42 -5
  449. package/src/scripts/classify_merge_risk.ts +320 -0
  450. package/src/scripts/closure_scan.ts +91 -1
  451. package/src/scripts/command_suggester/settings.ts +8 -108
  452. package/src/scripts/command_suggester/types.ts +4 -5
  453. package/src/scripts/consumer_matrix.ts +102 -0
  454. package/src/scripts/context_hygiene_hook.ts +13 -23
  455. package/src/scripts/cost/preflight.mjs +12 -1
  456. package/src/scripts/council_cli.ts +7 -7
  457. package/src/scripts/dispatch_r2_reviewer.ts +24 -11
  458. package/src/scripts/explain_run.ts +8 -13
  459. package/src/scripts/generate_git_convention_grammar.ts +127 -0
  460. package/src/scripts/generate_host_cost_table.ts +20 -3
  461. package/src/scripts/handoff_context_hook.ts +86 -37
  462. package/src/scripts/hook_manifest.json +1 -1
  463. package/src/scripts/hook_manifest.yaml +25 -6
  464. package/src/scripts/hooks/block_config_weakening.ts +48 -5
  465. package/src/scripts/hooks/block_plumbing_writes.ts +8 -4
  466. package/src/scripts/hooks/block_speaking_inbox_dir.ts +16 -1
  467. package/src/scripts/hooks/concern_registry.ts +2 -0
  468. package/src/scripts/hooks/delegation_nudge_hook.ts +2 -3
  469. package/src/scripts/hooks/design_pass_hook.ts +157 -3
  470. package/src/scripts/hooks/evidence_independence.ts +12 -4
  471. package/src/scripts/hooks/mcp_usage_observation_hook.ts +121 -0
  472. package/src/scripts/hooks/push_settle_hook.ts +4 -3
  473. package/src/scripts/hooks/rule_inject_hook.ts +44 -3
  474. package/src/scripts/hooks/state_io.ts +8 -4
  475. package/src/scripts/hooks/svg_obligation.ts +497 -0
  476. package/src/scripts/hooks/svg_rules_loader.ts +133 -0
  477. package/src/scripts/hooks/telemetry_usage_hook.ts +7 -46
  478. package/src/scripts/hooks/turn_end_gate_hook.ts +6 -3
  479. package/src/scripts/install-hooks.sh +42 -14
  480. package/src/scripts/install.ts +7 -31
  481. package/src/scripts/lint_blocker_citations.ts +198 -0
  482. package/src/scripts/lint_consolidation_lineage.ts +6 -3
  483. package/src/scripts/lint_design_quality.ts +60 -12
  484. package/src/scripts/lint_evidence_artifacts.ts +9 -0
  485. package/src/scripts/lint_hook_concern_budget.ts +10 -21
  486. package/src/scripts/lint_motion_authority_drift.ts +27 -0
  487. package/src/scripts/lint_pack_boundaries.ts +406 -28
  488. package/src/scripts/lint_roadmap_blockers.ts +282 -29
  489. package/src/scripts/lint_roadmap_complexity.ts +4 -2
  490. package/src/scripts/lint_rule_law_section.ts +151 -21
  491. package/src/scripts/lint_rule_skill_pack_reach.ts +17 -0
  492. package/src/scripts/lint_settings_classes.ts +1 -1
  493. package/src/scripts/lint_svg_asset.ts +365 -0
  494. package/src/scripts/lint_ticked_unmet_criteria.ts +165 -0
  495. package/src/scripts/lint_workflow_security.ts +12 -1
  496. package/src/scripts/measure_skill_ranker_baseline.ts +5 -0
  497. package/src/scripts/model_rule_injection.ts +3 -3
  498. package/src/scripts/onboarding_gate_hook.ts +7 -6
  499. package/src/scripts/print_required_checks.ts +15 -3
  500. package/src/scripts/probe_host_compliance.ts +33 -5
  501. package/src/scripts/probe_turnaround.ts +183 -3
  502. package/src/scripts/ratification_header.ts +77 -0
  503. package/src/scripts/refusal_envelope.ts +138 -0
  504. package/src/scripts/release_publication.ts +29 -3
  505. package/src/scripts/report_dispatch_import_closure.ts +76 -0
  506. package/src/scripts/report_installed_rule_links.ts +118 -1
  507. package/src/scripts/report_module_reach.ts +212 -0
  508. package/src/scripts/report_obligation_mechanism.ts +16 -18
  509. package/src/scripts/report_parked_blockers.ts +222 -0
  510. package/src/scripts/report_required_checks_drift.ts +196 -0
  511. package/src/scripts/report_skill_ranker_confusion.ts +103 -2
  512. package/src/scripts/report_standing_payload_by_host.ts +1 -1
  513. package/src/scripts/routing_doctor.ts +2 -2
  514. package/src/scripts/schemas/agent-settings.schema.json +17 -31
  515. package/src/scripts/schemas/command.schema.json +1 -1
  516. package/src/scripts/schemas/skill.schema.json +1 -1
  517. package/src/scripts/self_review_gate.ts +39 -2
  518. package/src/scripts/skill_tools/score_skill_relevance.ts +28 -19
  519. package/src/scripts/sync_pr_branch.ts +403 -132
  520. package/src/scripts/trigger_eval_grandfather.json +0 -16
  521. package/src/server/schemas/settings.ts +33 -177
  522. package/src/shared/skillRanking.ts +53 -4
  523. package/dist/cli-delegate/chunk-NYX3L2PZ.js +0 -99
  524. package/src/scripts/_lib/config_chain.ts +0 -477
  525. package/src/scripts/_lib/conformance_report.ts +0 -403
  526. package/src/scripts/_lib/eval_discrimination.ts +0 -95
  527. package/src/scripts/_lib/evaluator_promotion.ts +0 -225
  528. package/src/scripts/_lib/file_slicer.ts +0 -117
  529. package/src/scripts/_lib/legacy_boundary_map.ts +0 -228
  530. package/src/scripts/_lib/minimality_tiebreak.ts +0 -168
  531. package/src/scripts/_lib/overbuild_lens_contract.ts +0 -196
  532. package/src/scripts/_lib/role_split.ts +0 -338
@@ -7371,10 +7371,10 @@ var require_dist = __commonJS({
7371
7371
  import { spawn, spawnSync as spawnSync2 } from "node:child_process";
7372
7372
  import * as crypto5 from "node:crypto";
7373
7373
  import * as fs33 from "node:fs";
7374
- import * as os11 from "node:os";
7374
+ import * as os12 from "node:os";
7375
7375
  import * as path32 from "node:path";
7376
7376
  import process4 from "node:process";
7377
- import { fileURLToPath as fileURLToPath9, pathToFileURL as pathToFileURL2 } from "node:url";
7377
+ import { fileURLToPath as fileURLToPath8, pathToFileURL as pathToFileURL2 } from "node:url";
7378
7378
 
7379
7379
  // src/scripts/_lib/json_pointers.ts
7380
7380
  import { createHash } from "node:crypto";
@@ -9741,6 +9741,14 @@ function expanduser6(p) {
9741
9741
  }
9742
9742
  return p;
9743
9743
  }
9744
+ function expanduser_at(p, home) {
9745
+ if (home === void 0 || home === null || home === "") return expanduser6(p);
9746
+ if (p === "~") return home;
9747
+ if (p.startsWith("~/") || process.platform === "win32" && p.startsWith("~\\")) {
9748
+ return path11.join(home, p.slice(2));
9749
+ }
9750
+ return p;
9751
+ }
9744
9752
  function resolve_path(p) {
9745
9753
  try {
9746
9754
  return fs12.realpathSync(p);
@@ -10155,6 +10163,27 @@ function recorded_rel_files(tool_id, anchor, inventory) {
10155
10163
  }
10156
10164
  return new Set(files.filter((f) => typeof f === "string"));
10157
10165
  }
10166
+ function recorded_absolute_files(inventory, home) {
10167
+ const inv = inventory ?? load_inventory();
10168
+ const tools = inv["tools"] ?? {};
10169
+ const out = /* @__PURE__ */ new Set();
10170
+ if (typeof tools !== "object" || tools === null || Array.isArray(tools)) return out;
10171
+ for (const entry of Object.values(tools)) {
10172
+ if (typeof entry !== "object" || entry === null || Array.isArray(entry)) continue;
10173
+ const e = entry;
10174
+ const anchor = e["anchor"];
10175
+ const files = e["files"];
10176
+ if (typeof anchor !== "string" || !Array.isArray(files)) continue;
10177
+ const expanded = expanduser_at(anchor, home);
10178
+ for (const rel of files) {
10179
+ if (typeof rel !== "string") continue;
10180
+ const lexical = path11.resolve(expanded, rel);
10181
+ out.add(lexical);
10182
+ out.add(resolve_path(lexical));
10183
+ }
10184
+ }
10185
+ return out;
10186
+ }
10158
10187
  function sorted_strings(items) {
10159
10188
  return items.filter((i) => typeof i === "string").sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
10160
10189
  }
@@ -11347,10 +11376,39 @@ function hostBindings(host, table = loadHostLowering()) {
11347
11376
 
11348
11377
  // src/scripts/_lib/agent_settings.ts
11349
11378
  import { createRequire as createRequire2 } from "node:module";
11350
- import * as fs20 from "node:fs";
11379
+ import * as fs21 from "node:fs";
11351
11380
  import * as os7 from "node:os";
11381
+ import * as path20 from "node:path";
11382
+
11383
+ // src/scripts/_lib/package_root.ts
11384
+ import * as fs20 from "node:fs";
11352
11385
  import * as path19 from "node:path";
11353
11386
  import { fileURLToPath as fileURLToPath4 } from "node:url";
11387
+ var PACKAGE_NAME = "@event4u/agent-config";
11388
+ var MAX_ASCENT = 16;
11389
+ function resolvePackageRoot(fromUrlOrPath, legacyHops = 3) {
11390
+ const start = fromUrlOrPath.startsWith("file:") ? fileURLToPath4(fromUrlOrPath) : fromUrlOrPath;
11391
+ const startDir = path19.dirname(start);
11392
+ let dir = startDir;
11393
+ for (let i = 0; i < MAX_ASCENT; i++) {
11394
+ const manifest = path19.join(dir, "package.json");
11395
+ if (fs20.existsSync(manifest)) {
11396
+ try {
11397
+ const parsed = JSON.parse(fs20.readFileSync(manifest, "utf8"));
11398
+ if (parsed.name === PACKAGE_NAME) {
11399
+ return dir;
11400
+ }
11401
+ } catch {
11402
+ }
11403
+ }
11404
+ const parent = path19.dirname(dir);
11405
+ if (parent === dir) {
11406
+ break;
11407
+ }
11408
+ dir = parent;
11409
+ }
11410
+ return path19.resolve(startDir, ...Array.from({ length: legacyHops }, () => ".."));
11411
+ }
11354
11412
 
11355
11413
  // src/shared/settingsCarveOut.ts
11356
11414
  var SETTINGS_CARVE_OUT = [
@@ -11445,6 +11503,102 @@ function applyRenamedKeys(layer) {
11445
11503
  return layer;
11446
11504
  }
11447
11505
 
11506
+ // src/scripts/_lib/settings_removed_keys.ts
11507
+ var REMOVED_KEYS = /* @__PURE__ */ new Map([
11508
+ ["subagents.enabled", "always-on orchestration"],
11509
+ ["subagents.auto", "always-on orchestration"],
11510
+ ["subagents.host_capabilities", "always-on orchestration"],
11511
+ ["subagents.budget_routing", "always-on orchestration"],
11512
+ ["ai_team.enabled", "always-on orchestration"],
11513
+ ["hooks.turn_end_gate.enabled", "the turn-end gate is always armed"],
11514
+ ["hooks.turn_end_gate.promissory", "the turn-end gate is always armed"],
11515
+ ["hooks.turn_end_gate.language", "the turn-end gate is always armed"],
11516
+ ["hooks.turn_end_gate.verification", "the turn-end gate is always armed"],
11517
+ ["telegraph.speak_scope", "the rule body states its own scope; compile_time_toggles decides whether the rule ships"],
11518
+ ["chat_history.max_size_kb", "the rotate command takes --max-kb from argv; session-count pruning bounds the file"],
11519
+ ["chat_history.on_overflow", "the overflow mode comes from the rotate command --mode argv"],
11520
+ ["quality.wait_for_remote_ci", "whether to poll follows from the push plus a detectable remote pipeline"],
11521
+ ["legal_review_prep.consented_at", "the provenance sidecar settings:set writes and consentVerdict reads"],
11522
+ ["worktrees.mode", "the user asking for a worktree in the chat; creation is instruction-only and hardcoded"],
11523
+ // 2026-10-09 — output and tone
11524
+ ["personal.minimal_output", "direct-answers Iron Law 3 mandates terse replies; there is no verbose mode"],
11525
+ ["personal.play_by_play", "direct-answers: no narration unless the user asks for it in the turn"],
11526
+ ["personal.pr_comment_bot_icon", "no-decorative-emojis-in-git-surfaces forbids the \u{1F916} prefix"],
11527
+ ["verbosity.intent_announcements", 'direct-answers: act and emit the result, no "Let me\u2026" openers'],
11528
+ ["verbosity.preview_artifacts", "generated content is used directly; preview-on-error and the Iron-Law gates decide when a preview shows"],
11529
+ ["verbosity.routine_confirmations", "the no-cheap-questions Pre-Send Self-Check; Iron-Law gates always ask"],
11530
+ ["verbosity.post_action_reports", "direct-answers Iron Law 3: a one-line confirmation and one end-summary"],
11531
+ ["telegraph.speak", "the telegraph-speak predicate in compile_time_toggles.ts; the bench verdict is package-level (ADR telegraph/0002)"],
11532
+ ["tokens.rich_skills", "the skill's own token_budget_class: rich plus the lint_token_budget_discipline ceiling"],
11533
+ // 2026-10-09 — reasoning protocol switches
11534
+ ["reasoning.auto_gate", "the RDP gate task signal plus the host self-assessment in rdp-gate.md"],
11535
+ ["reasoning.components.orchestrator", "the RDP gate task and host signals decide per component; reasoning.enabled stays the hard off"],
11536
+ ["reasoning.components.notes_first", "the RDP gate task and host signals decide per component; reasoning.enabled stays the hard off"],
11537
+ ["reasoning.components.grounding", "the RDP gate task and host signals decide per component; reasoning.enabled stays the hard off"],
11538
+ ["reasoning.components.intent", "the RDP gate task and host signals decide per component; reasoning.enabled stays the hard off"],
11539
+ ["reasoning.components.complexity_first", "the RDP gate task and host signals decide per component; reasoning.enabled stays the hard off"],
11540
+ ["reasoning.components.verifier_default", "the RDP gate task and host signals decide per component; reasoning.enabled stays the hard off"],
11541
+ ["reasoning.components.prediction_tracking", "the RDP gate task and host signals decide per component; reasoning.enabled stays the hard off"],
11542
+ ["reasoning.components.decision_ledger", "the RDP gate task and host signals decide per component; reasoning.enabled stays the hard off"],
11543
+ ["reasoning.components.uncertainty_budget", "the RDP gate task and host signals decide per component; reasoning.enabled stays the hard off"],
11544
+ // 2026-10-09 — roadmap cadence
11545
+ ["roadmap.skip_pre_run_gate", "the command name names the scope; only an ambiguous roadmap or an unresolvable conflict shows the gate"],
11546
+ ["roadmap.dashboard_regen_cadence", "a fixed cadence: every 5th closed step, every phase boundary, reply end and any file-shape touch"],
11547
+ // 2026-10-09 — command suggestion and PR creation
11548
+ ["commands.auto_detect", "an orchestrator's own auto_detect front-matter and the --no-auto-detect flag"],
11549
+ ["commands.suggestion.enabled", "the suggester match-score floor and cooldown; /command-suggestion-off silences one conversation"],
11550
+ ["commands.suggestion.confidence_floor", "the suggester's fixed 0.6 floor; a command's own suggestion frontmatter can tighten it"],
11551
+ ["commands.suggestion.cooldown_seconds", "the suggester's fixed 600-second cooldown; a command's own suggestion frontmatter can lengthen it"],
11552
+ ["commands.suggestion.max_options", "the fixed cap of 4 suggestions plus the always-present as-is option"],
11553
+ ["commands.create_pr.api_examples", "/create-pr's grounding rule: an example only from a real source, otherwise a one-line pointer"],
11554
+ ["commands.create_pr.ui_paths", "/create-pr's light frontend heuristic, which fails open"],
11555
+ ["commands.create_pr.api_paths", "/create-pr's light API-endpoint heuristic, which fails open"],
11556
+ // 2026-10-09 — memory and knowledge sharing
11557
+ ["memory.cadence", "a fixed cadence: the memory line renders whenever a memory type was asked; memory.visibility: off still silences it"],
11558
+ ["memory.review_threshold", "/memory load's fixed preview threshold of 10 unreviewed intake signals"],
11559
+ ["knowledge.global_sharing.redaction.enabled", "the write-time redaction scan, which always runs before a card goes global"],
11560
+ ["knowledge.global_sharing.redaction.halt_on_trigger", "the redaction gate, which always halts on a confidential-pattern hit"],
11561
+ ["knowledge.global_sharing.auto_promote_threshold", "the fixed two-repo sighting count that triggers a promotion suggestion"],
11562
+ ["knowledge.global_sharing.freshness.hypothesis_after_days", "the card's age over last_verified against the fixed 90-day lead-only window"],
11563
+ ["knowledge.global_sharing.freshness.stale_after_days", "the card's age over last_verified against the fixed 180-day skip window"],
11564
+ // 2026-10-09 — hooks and engine
11565
+ ["hooks.concern_budget.max_per_event", "the concern-budget gate's own constant of 8 per (platform, event) cell"],
11566
+ ["hooks.concern_budget.hard_fail", "the concern-budget gate's --strict argv; without it the gate warns"],
11567
+ ["decision_engine.surface_traces", "nothing: the per-phase decision trace stays off, the old default"],
11568
+ ["decision_engine.on_block_fallback", "the fail-safe: an on_block ask that times out always stops"],
11569
+ ["explain.enable_last", "the presence of a work-state trace; explain last always renders it"],
11570
+ // 2026-10-09 — remaining
11571
+ ["project.pr_template", "/create-pr, which reads .github/pull_request_template.md"],
11572
+ ["pipelines.skill_improvement", "the skill-improvement-trigger rule; the capture is a proposal the user confirms"],
11573
+ ["consistency.cross_source", "the cross-source-consistency rule, always on; batching and the no-cheap-questions floor bound the noise"],
11574
+ ["subagents.downshift", "the model_tier each sub-task declares; downshift is always on"],
11575
+ ["ai_team.suppress_setup_hint", "nothing: the one-line team-mode setup hint is always shown"]
11576
+ ]);
11577
+ var _warnedRemovedKeys = /* @__PURE__ */ new Set();
11578
+ function _readDotted(root, dotted) {
11579
+ let node = root;
11580
+ for (const part of dotted.split(".")) {
11581
+ if (typeof node !== "object" || node === null || Array.isArray(node)) {
11582
+ return void 0;
11583
+ }
11584
+ node = node[part];
11585
+ }
11586
+ return node;
11587
+ }
11588
+ function warnRemovedKeys(merged) {
11589
+ for (const [key, reason] of REMOVED_KEYS) {
11590
+ if (_warnedRemovedKeys.has(key)) {
11591
+ continue;
11592
+ }
11593
+ if (_readDotted(merged, key) === void 0) {
11594
+ continue;
11595
+ }
11596
+ _warnedRemovedKeys.add(key);
11597
+ process.stderr.write(`${key} was removed (${reason}); ignored.
11598
+ `);
11599
+ }
11600
+ }
11601
+
11448
11602
  // src/scripts/_lib/agent_settings.ts
11449
11603
  var _require2 = createRequire2(import.meta.url);
11450
11604
  var Logger = class {
@@ -11485,10 +11639,10 @@ var DEFAULT_PROJECT_FILE = ".agent-settings.yml";
11485
11639
  var LOCAL_PROJECT_FILE = ".agent-settings.local.yml";
11486
11640
  var LOCAL_PROJECT_SUBDIR = ["agents", "settings"];
11487
11641
  function _local_settings_path(project_root) {
11488
- return path19.join(project_root, ...LOCAL_PROJECT_SUBDIR, LOCAL_PROJECT_FILE);
11642
+ return path20.join(project_root, ...LOCAL_PROJECT_SUBDIR, LOCAL_PROJECT_FILE);
11489
11643
  }
11490
11644
  function _canonical_settings_path(project_root) {
11491
- return path19.join(project_root, ...LOCAL_PROJECT_SUBDIR, DEFAULT_PROJECT_FILE);
11645
+ return path20.join(project_root, ...LOCAL_PROJECT_SUBDIR, DEFAULT_PROJECT_FILE);
11492
11646
  }
11493
11647
  var USER_GLOBAL_FILENAME = "agent-settings.yml";
11494
11648
  function DEFAULT_USER_GLOBAL_FILE() {
@@ -11511,13 +11665,13 @@ function user_global_settings_paths() {
11511
11665
  return paths;
11512
11666
  }
11513
11667
  var MERGEABLE_KEYS = [
11514
- // `name`, `ide` and `personal.bot_icon` are the PRE-MIGRATION spellings.
11515
- // `install.ts` migrates `ide` → `personal.ide` and `pr_comment_bot_icon`
11516
- // into its `personal.` home, and this list was never moved with them — so
11517
- // the whitelist named keys the template does not have while the keys it
11518
- // does have were filtered out silently. A user setting either preference
11519
- // user-globally got no error, no warning, and no effect
11520
- // (road-to-capability-answerability 4.3, ADR-219).
11668
+ // `name` and `ide` are the PRE-MIGRATION spellings. `install.ts` migrates
11669
+ // `ide` → `personal.ide`, and this list was never moved with it — so the
11670
+ // whitelist named a key the template does not have while the key it does
11671
+ // have was filtered out silently (road-to-capability-answerability 4.3,
11672
+ // ADR-219). `personal.bot_icon` / `personal.pr_comment_bot_icon` left with
11673
+ // the key itself (2026-10-09): a whitelisted key nothing reads would carry a
11674
+ // user-global value into a tree that ignores it.
11521
11675
  //
11522
11676
  // Both spellings are listed rather than replaced: a legacy file that still
11523
11677
  // uses the old name keeps working, and nothing that resolved before
@@ -11527,20 +11681,12 @@ var MERGEABLE_KEYS = [
11527
11681
  "ide",
11528
11682
  "personal.ide",
11529
11683
  "rule_loading_tier",
11530
- "memory.cadence",
11531
- "personal.bot_icon",
11532
- "personal.pr_comment_bot_icon",
11533
11684
  "personal.autonomy",
11534
11685
  // Knowledge-card global cross-project sharing is a USER-GLOBAL setting
11535
11686
  // (ADR-100 / road-to-structure-grounding-v2). Whitelisted so the
11536
11687
  // ~/.event4u/agent-config/agent-settings.yml values are honoured.
11537
11688
  "knowledge.global_sharing.enabled",
11538
11689
  "knowledge.global_sharing.allowed_tiers",
11539
- "knowledge.global_sharing.redaction.enabled",
11540
- "knowledge.global_sharing.redaction.halt_on_trigger",
11541
- "knowledge.global_sharing.auto_promote_threshold",
11542
- "knowledge.global_sharing.freshness.hypothesis_after_days",
11543
- "knowledge.global_sharing.freshness.stale_after_days",
11544
11690
  // `design.fidelity_mode` is a per-DEVELOPER working preference, not a
11545
11691
  // per-project one: whether an agent may deviate from a handed-over design
11546
11692
  // is a property of how that person works, and a designer who sets it once
@@ -11564,10 +11710,10 @@ var MERGEABLE_KEYS = [
11564
11710
  "lean_projection.mode",
11565
11711
  "lean_projection.hosts"
11566
11712
  ];
11567
- var TEMPLATE_RELATIVE = path19.join("src", "config", "agent-settings.template.yml");
11568
- var _PACKAGE_ROOT = path19.resolve(path19.dirname(fileURLToPath4(import.meta.url)), "..", "..", "..");
11713
+ var TEMPLATE_RELATIVE = path20.join("src", "config", "agent-settings.template.yml");
11714
+ var _PACKAGE_ROOT = resolvePackageRoot(import.meta.url);
11569
11715
  function default_template_path() {
11570
- return path19.join(_PACKAGE_ROOT, TEMPLATE_RELATIVE);
11716
+ return path20.join(_PACKAGE_ROOT, TEMPLATE_RELATIVE);
11571
11717
  }
11572
11718
  function _is_placeholder(value) {
11573
11719
  return typeof value === "string" && /^__[A-Z0-9_]+__$/.test(value);
@@ -11618,8 +11764,8 @@ var _AGENTS_DIR_MARKERS = [
11618
11764
  var _LEGACY_ANCHOR_ENV = "AGENT_CONFIG_LEGACY_ANCHOR";
11619
11765
  function _exists(p) {
11620
11766
  try {
11621
- fs20.lstatSync(p);
11622
- fs20.statSync(p);
11767
+ fs21.lstatSync(p);
11768
+ fs21.statSync(p);
11623
11769
  return true;
11624
11770
  } catch {
11625
11771
  return false;
@@ -11627,22 +11773,22 @@ function _exists(p) {
11627
11773
  }
11628
11774
  function _is_dir2(p) {
11629
11775
  try {
11630
- return fs20.statSync(p).isDirectory();
11776
+ return fs21.statSync(p).isDirectory();
11631
11777
  } catch {
11632
11778
  return false;
11633
11779
  }
11634
11780
  }
11635
11781
  function _is_file(p) {
11636
11782
  try {
11637
- return fs20.statSync(p).isFile();
11783
+ return fs21.statSync(p).isFile();
11638
11784
  } catch {
11639
11785
  return false;
11640
11786
  }
11641
11787
  }
11642
11788
  function _resolve(p) {
11643
- const absolute = path19.resolve(p);
11789
+ const absolute = path20.resolve(p);
11644
11790
  try {
11645
- return fs20.realpathSync(absolute);
11791
+ return fs21.realpathSync(absolute);
11646
11792
  } catch {
11647
11793
  return absolute;
11648
11794
  }
@@ -11652,7 +11798,7 @@ function _ancestor_chain(start) {
11652
11798
  let cursor = start;
11653
11799
  for (; ; ) {
11654
11800
  chain.push(cursor);
11655
- const parent = path19.dirname(cursor);
11801
+ const parent = path20.dirname(cursor);
11656
11802
  if (parent === cursor) {
11657
11803
  break;
11658
11804
  }
@@ -11661,15 +11807,15 @@ function _ancestor_chain(start) {
11661
11807
  return chain;
11662
11808
  }
11663
11809
  function _boundary_anchor_at(dir) {
11664
- const agents_dir = path19.join(dir, "agents");
11810
+ const agents_dir = path20.join(dir, "agents");
11665
11811
  if (_is_dir2(agents_dir)) {
11666
11812
  for (const marker of _AGENTS_DIR_MARKERS) {
11667
- if (_exists(path19.join(agents_dir, marker))) {
11813
+ if (_exists(path20.join(agents_dir, marker))) {
11668
11814
  return ANCHOR_AGENTS_DIR;
11669
11815
  }
11670
11816
  }
11671
11817
  }
11672
- if (_exists(path19.join(dir, ".git"))) {
11818
+ if (_exists(path20.join(dir, ".git"))) {
11673
11819
  return ANCHOR_GIT;
11674
11820
  }
11675
11821
  return null;
@@ -11680,7 +11826,7 @@ function find_project_root_with_anchor(start) {
11680
11826
  const chain = _ancestor_chain(current);
11681
11827
  if (legacy) {
11682
11828
  for (const candidate of chain) {
11683
- if (_exists(path19.join(candidate, ".git"))) {
11829
+ if (_exists(path20.join(candidate, ".git"))) {
11684
11830
  return [candidate, ANCHOR_GIT];
11685
11831
  }
11686
11832
  }
@@ -11694,7 +11840,7 @@ function find_project_root_with_anchor(start) {
11694
11840
  }
11695
11841
  let outermost = null;
11696
11842
  for (const candidate of chain) {
11697
- if (_exists(path19.join(candidate, DEFAULT_PROJECT_FILE))) {
11843
+ if (_exists(path20.join(candidate, DEFAULT_PROJECT_FILE))) {
11698
11844
  outermost = candidate;
11699
11845
  }
11700
11846
  }
@@ -11738,7 +11884,7 @@ function _expanduser(p) {
11738
11884
  return os7.homedir();
11739
11885
  }
11740
11886
  if (p.startsWith("~/") || process.platform === "win32" && p.startsWith("~\\")) {
11741
- return path19.join(os7.homedir(), p.slice(2));
11887
+ return path20.join(os7.homedir(), p.slice(2));
11742
11888
  }
11743
11889
  return p;
11744
11890
  }
@@ -11767,13 +11913,13 @@ function resolve_project_root(arg, options = {}) {
11767
11913
  function _resolve_cascade_paths(cwd, project_path) {
11768
11914
  if (cwd === null) {
11769
11915
  const legacy = project_path ? project_path : DEFAULT_PROJECT_FILE;
11770
- const parent = path19.dirname(legacy);
11916
+ const parent = path20.dirname(legacy);
11771
11917
  return [legacy, _canonical_settings_path(parent), _local_settings_path(parent)];
11772
11918
  }
11773
11919
  const root = find_project_root(cwd);
11774
11920
  if (root === null) {
11775
11921
  const legacy = project_path ? project_path : DEFAULT_PROJECT_FILE;
11776
- const parent = path19.dirname(legacy);
11922
+ const parent = path20.dirname(legacy);
11777
11923
  return [legacy, _canonical_settings_path(parent), _local_settings_path(parent)];
11778
11924
  }
11779
11925
  const cwd_resolved = _resolve(cwd);
@@ -11784,7 +11930,7 @@ function _resolve_cascade_paths(cwd, project_path) {
11784
11930
  if (cursor === root) {
11785
11931
  break;
11786
11932
  }
11787
- const parent = path19.dirname(cursor);
11933
+ const parent = path20.dirname(cursor);
11788
11934
  if (parent === cursor) {
11789
11935
  break;
11790
11936
  }
@@ -11792,7 +11938,7 @@ function _resolve_cascade_paths(cwd, project_path) {
11792
11938
  }
11793
11939
  chain.reverse();
11794
11940
  return [
11795
- ...chain.map((d) => path19.join(d, DEFAULT_PROJECT_FILE)),
11941
+ ...chain.map((d) => path20.join(d, DEFAULT_PROJECT_FILE)),
11796
11942
  _canonical_settings_path(root),
11797
11943
  _local_settings_path(root)
11798
11944
  ];
@@ -11823,50 +11969,9 @@ function load_agent_settings(options = {}) {
11823
11969
  _deep_merge(merged, layer);
11824
11970
  }
11825
11971
  }
11826
- _warn_removed_always_on_keys(merged);
11972
+ warnRemovedKeys(merged);
11827
11973
  return merged;
11828
11974
  }
11829
- var REMOVED_KEYS = /* @__PURE__ */ new Map([
11830
- ["subagents.enabled", "always-on orchestration"],
11831
- ["subagents.auto", "always-on orchestration"],
11832
- ["subagents.host_capabilities", "always-on orchestration"],
11833
- ["subagents.budget_routing", "always-on orchestration"],
11834
- ["ai_team.enabled", "always-on orchestration"],
11835
- ["hooks.turn_end_gate.enabled", "the turn-end gate is always armed"],
11836
- ["hooks.turn_end_gate.promissory", "the turn-end gate is always armed"],
11837
- ["hooks.turn_end_gate.language", "the turn-end gate is always armed"],
11838
- ["hooks.turn_end_gate.verification", "the turn-end gate is always armed"],
11839
- ["telegraph.speak_scope", "the rule body states its own scope; compile_router gates on telegraph.speak alone"],
11840
- ["chat_history.max_size_kb", "the rotate command takes --max-kb from argv; session-count pruning bounds the file"],
11841
- ["chat_history.on_overflow", "the overflow mode comes from the rotate command --mode argv"],
11842
- ["quality.wait_for_remote_ci", "whether to poll follows from the push plus a detectable remote pipeline"],
11843
- ["legal_review_prep.consented_at", "the provenance sidecar settings:set writes and consentVerdict reads"],
11844
- ["worktrees.mode", "the user asking for a worktree in the chat; creation is instruction-only and hardcoded"]
11845
- ]);
11846
- var _warnedRemovedKeys = /* @__PURE__ */ new Set();
11847
- function _readDottedSettingsPath(root, dotted) {
11848
- let node = root;
11849
- for (const part of dotted.split(".")) {
11850
- if (typeof node !== "object" || node === null || Array.isArray(node)) {
11851
- return void 0;
11852
- }
11853
- node = node[part];
11854
- }
11855
- return node;
11856
- }
11857
- function _warn_removed_always_on_keys(merged) {
11858
- for (const [key, reason] of REMOVED_KEYS) {
11859
- if (_warnedRemovedKeys.has(key)) {
11860
- continue;
11861
- }
11862
- if (_readDottedSettingsPath(merged, key) === void 0) {
11863
- continue;
11864
- }
11865
- _warnedRemovedKeys.add(key);
11866
- process.stderr.write(`${key} was removed (${reason}); ignored.
11867
- `);
11868
- }
11869
- }
11870
11975
  function _read_yaml(p) {
11871
11976
  if (!_is_file(p)) {
11872
11977
  return null;
@@ -11879,7 +11984,7 @@ function _read_yaml(p) {
11879
11984
  }
11880
11985
  let data;
11881
11986
  try {
11882
- const text = fs20.readFileSync(p, "utf-8");
11987
+ const text = fs21.readFileSync(p, "utf-8");
11883
11988
  data = YAML6.parse(text, { version: "1.1" });
11884
11989
  if (data === null || data === void 0) {
11885
11990
  data = {};
@@ -11979,11 +12084,11 @@ function _is_plain_dict(value) {
11979
12084
  }
11980
12085
 
11981
12086
  // src/install/rule_scope.ts
11982
- import * as path20 from "node:path";
12087
+ import * as path21 from "node:path";
11983
12088
 
11984
12089
  // src/install/ruleInScope.ts
11985
12090
  var YAML5 = __toESM(require_dist(), 1);
11986
- import * as fs21 from "node:fs";
12091
+ import * as fs22 from "node:fs";
11987
12092
  function parseYaml3(text) {
11988
12093
  try {
11989
12094
  const data = YAML5.parse(text, { version: "1.1" });
@@ -12021,7 +12126,7 @@ function rule_in_scope(source_path, scope, pack_scope = null, role_scope = null)
12021
12126
  if (scope === null && pack_scope === null && role_scope === null) {
12022
12127
  return true;
12023
12128
  }
12024
- const [meta] = parseFrontmatter(fs21.readFileSync(source_path, "utf-8"));
12129
+ const [meta] = parseFrontmatter(fs22.readFileSync(source_path, "utf-8"));
12025
12130
  if (meta["type"] === "always" || meta["alwaysApply"] === true) {
12026
12131
  return true;
12027
12132
  }
@@ -12072,7 +12177,7 @@ function ruleFileArrives(sourcePath, scope) {
12072
12177
  if (!sourcePath.endsWith(".md")) {
12073
12178
  return true;
12074
12179
  }
12075
- const basename9 = path20.basename(sourcePath);
12180
+ const basename9 = path21.basename(sourcePath);
12076
12181
  if (COMPAT_ALWAYS_EXCLUDED.includes(basename9)) {
12077
12182
  return false;
12078
12183
  }
@@ -12080,26 +12185,26 @@ function ruleFileArrives(sourcePath, scope) {
12080
12185
  }
12081
12186
 
12082
12187
  // src/install/partitionEligibility.ts
12083
- import * as fs23 from "node:fs";
12188
+ import * as fs24 from "node:fs";
12084
12189
  import * as os8 from "node:os";
12085
12190
 
12086
12191
  // src/install/hostLayerFingerprint.ts
12087
12192
  import { createHash as createHash6 } from "node:crypto";
12088
- import * as fs22 from "node:fs";
12089
- import * as path21 from "node:path";
12193
+ import * as fs23 from "node:fs";
12194
+ import * as path22 from "node:path";
12090
12195
  var FINGERPRINT_SCHEMA = 1;
12091
12196
  function collectFiles(dir) {
12092
12197
  const out = [];
12093
12198
  const walk = (d) => {
12094
12199
  let entries;
12095
12200
  try {
12096
- entries = fs22.readdirSync(d, { withFileTypes: true });
12201
+ entries = fs23.readdirSync(d, { withFileTypes: true });
12097
12202
  } catch {
12098
12203
  return;
12099
12204
  }
12100
12205
  const sorted = [...entries].sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0);
12101
12206
  for (const e of sorted) {
12102
- const p = path21.join(d, e.name);
12207
+ const p = path22.join(d, e.name);
12103
12208
  if (e.isDirectory()) {
12104
12209
  walk(p);
12105
12210
  } else if (e.isFile()) {
@@ -12116,10 +12221,10 @@ function fingerprintLayers(layers) {
12116
12221
  for (const layer of layers) {
12117
12222
  h.update(`layer:${layer.label}\0`);
12118
12223
  for (const file of collectFiles(layer.root)) {
12119
- h.update(path21.relative(layer.root, file));
12224
+ h.update(path22.relative(layer.root, file));
12120
12225
  h.update("\0");
12121
12226
  try {
12122
- h.update(fs22.readFileSync(file));
12227
+ h.update(fs23.readFileSync(file));
12123
12228
  } catch {
12124
12229
  h.update("\0unreadable\0");
12125
12230
  }
@@ -12129,11 +12234,11 @@ function fingerprintLayers(layers) {
12129
12234
  return h.digest("hex");
12130
12235
  }
12131
12236
  function hostLayerInputs(userHome) {
12132
- const claude = path21.join(userHome, ".claude");
12237
+ const claude = path22.join(userHome, ".claude");
12133
12238
  return [
12134
- { label: "rules", root: path21.join(claude, "rules") },
12135
- { label: "skills", root: path21.join(claude, "skills") },
12136
- { label: "commands", root: path21.join(claude, "commands") }
12239
+ { label: "rules", root: path22.join(claude, "rules") },
12240
+ { label: "skills", root: path22.join(claude, "skills") },
12241
+ { label: "commands", root: path22.join(claude, "commands") }
12137
12242
  ];
12138
12243
  }
12139
12244
 
@@ -12142,7 +12247,7 @@ var MAINTAINER_WORKSPACE = "agent-config-maintainer";
12142
12247
  function isExclusivelyPackageOnly(source_path) {
12143
12248
  let meta;
12144
12249
  try {
12145
- [meta] = parseFrontmatter(fs23.readFileSync(source_path, "utf-8"));
12250
+ [meta] = parseFrontmatter(fs24.readFileSync(source_path, "utf-8"));
12146
12251
  } catch {
12147
12252
  return false;
12148
12253
  }
@@ -12173,8 +12278,8 @@ function stampHostLayerFingerprint(installedVersion, tools, lockfilePath, skip2,
12173
12278
  }
12174
12279
 
12175
12280
  // src/install/claudeRuleRewrite.ts
12176
- import * as fs24 from "node:fs";
12177
- import * as path22 from "node:path";
12281
+ import * as fs25 from "node:fs";
12282
+ import * as path23 from "node:path";
12178
12283
 
12179
12284
  // src/install/claudePathsPlan.ts
12180
12285
  function derive_trigger_globs(meta) {
@@ -12343,23 +12448,23 @@ function rewriteClaudeRules(rulesDir, preserved = /* @__PURE__ */ new Set()) {
12343
12448
  const result = { rewritten: 0, scoped: [], dropped: [], failed: [] };
12344
12449
  let entries;
12345
12450
  try {
12346
- entries = fs24.readdirSync(rulesDir);
12451
+ entries = fs25.readdirSync(rulesDir);
12347
12452
  } catch {
12348
12453
  return result;
12349
12454
  }
12350
12455
  for (const name of entries.filter((n) => n.endsWith(".md")).sort()) {
12351
- const full = path22.join(rulesDir, name);
12352
- if (preserved.has(path22.resolve(full))) continue;
12456
+ const full = path23.join(rulesDir, name);
12457
+ if (preserved.has(path23.resolve(full))) continue;
12353
12458
  let stat;
12354
12459
  try {
12355
- stat = fs24.lstatSync(full);
12460
+ stat = fs25.lstatSync(full);
12356
12461
  } catch {
12357
12462
  continue;
12358
12463
  }
12359
12464
  if (!stat.isFile() || stat.isSymbolicLink()) continue;
12360
12465
  let text;
12361
12466
  try {
12362
- text = fs24.readFileSync(full, "utf-8");
12467
+ text = fs25.readFileSync(full, "utf-8");
12363
12468
  } catch {
12364
12469
  continue;
12365
12470
  }
@@ -12369,7 +12474,7 @@ function rewriteClaudeRules(rulesDir, preserved = /* @__PURE__ */ new Set()) {
12369
12474
  const withOwnership = _withPreservedKeys(rendered.text, text);
12370
12475
  if (withOwnership !== text) {
12371
12476
  try {
12372
- fs24.writeFileSync(full, withOwnership, "utf-8");
12477
+ fs25.writeFileSync(full, withOwnership, "utf-8");
12373
12478
  } catch (e) {
12374
12479
  result.failed.push({
12375
12480
  rule: name.slice(0, -3),
@@ -12389,18 +12494,19 @@ function rewriteClaudeRules(rulesDir, preserved = /* @__PURE__ */ new Set()) {
12389
12494
  }
12390
12495
 
12391
12496
  // src/install/installThinLayer.ts
12392
- import * as fs28 from "node:fs";
12393
- import * as path27 from "node:path";
12394
- import * as os10 from "node:os";
12497
+ import * as fs29 from "node:fs";
12498
+ import * as path28 from "node:path";
12499
+ import * as os11 from "node:os";
12395
12500
 
12396
12501
  // src/scripts/_lib/installed_layer.ts
12397
- import * as fs25 from "node:fs";
12398
- import * as path24 from "node:path";
12502
+ import * as fs26 from "node:fs";
12503
+ import * as os10 from "node:os";
12504
+ import * as path25 from "node:path";
12399
12505
  import { fileURLToPath as fileURLToPath5 } from "node:url";
12400
12506
 
12401
12507
  // src/install/globalRuleLayers.ts
12402
12508
  import * as os9 from "node:os";
12403
- import * as path23 from "node:path";
12509
+ import * as path24 from "node:path";
12404
12510
  var GLOBAL_RULE_DIRS = {
12405
12511
  "claude-code": ".claude/rules",
12406
12512
  cursor: ".cursor/rules",
@@ -12412,7 +12518,7 @@ var GLOBAL_RULE_DIRS = {
12412
12518
  };
12413
12519
  function globalRuleLayerPath(toolId, home = process.env["HOME"] ?? os9.homedir()) {
12414
12520
  const rel = GLOBAL_RULE_DIRS[toolId];
12415
- return rel === void 0 ? null : path23.join(home, rel);
12521
+ return rel === void 0 ? null : path24.join(home, rel);
12416
12522
  }
12417
12523
 
12418
12524
  // src/scripts/_lib/rule_law_section.ts
@@ -12477,7 +12583,12 @@ function lawText(body) {
12477
12583
  var TOP_FILES = 20;
12478
12584
  var LIMIT_WARN_FRACTION = 0.8;
12479
12585
  function isUnconditional(text) {
12480
- return !/^paths:/m.test(text);
12586
+ const [frontmatter] = splitFrontmatter(text);
12587
+ const emptyBlock = /^---\n---(\n|$)/.test(text);
12588
+ if (frontmatter === "" && !emptyBlock && /^\uFEFF?[\s]*---/.test(text)) {
12589
+ return !/^paths:/m.test(text);
12590
+ }
12591
+ return !/^paths:/m.test(frontmatter);
12481
12592
  }
12482
12593
  function readLayer(host, scope, dir, recorded) {
12483
12594
  const empty = {
@@ -12488,23 +12599,25 @@ function readLayer(host, scope, dir, recorded) {
12488
12599
  foreign: 0,
12489
12600
  package_owned_chars: 0,
12490
12601
  foreign_chars: 0,
12602
+ unconditional_chars: 0,
12603
+ scoped_chars: 0,
12491
12604
  top: []
12492
12605
  };
12493
12606
  let names;
12494
12607
  try {
12495
- names = fs25.readdirSync(dir);
12608
+ names = fs26.readdirSync(dir);
12496
12609
  } catch {
12497
12610
  return { host, scope, dir, present: false, ...empty };
12498
12611
  }
12499
12612
  const readings = [];
12500
12613
  for (const name of names.sort()) {
12501
12614
  if (!name.endsWith(".md")) continue;
12502
- const abs = path24.join(dir, name);
12615
+ const abs = path25.join(dir, name);
12503
12616
  let text;
12504
12617
  try {
12505
- const st = fs25.statSync(abs);
12618
+ const st = fs26.statSync(abs);
12506
12619
  if (!st.isFile()) continue;
12507
- text = fs25.readFileSync(abs, "utf-8");
12620
+ text = fs26.readFileSync(abs, "utf-8");
12508
12621
  } catch {
12509
12622
  continue;
12510
12623
  }
@@ -12533,12 +12646,14 @@ function readLayer(host, scope, dir, recorded) {
12533
12646
  foreign: readings.filter((r) => !r.package_owned).length,
12534
12647
  package_owned_chars: readings.reduce((n, r) => n + (r.package_owned ? r.chars : 0), 0),
12535
12648
  foreign_chars: readings.reduce((n, r) => n + (r.package_owned ? 0 : r.chars), 0),
12649
+ unconditional_chars: readings.reduce((n, r) => n + (r.unconditional ? r.chars : 0), 0),
12650
+ scoped_chars: readings.reduce((n, r) => n + (r.unconditional ? 0 : r.chars), 0),
12536
12651
  top
12537
12652
  };
12538
12653
  }
12539
12654
  function defaultHostLimitsPath() {
12540
- return path24.join(
12541
- path24.dirname(fileURLToPath5(import.meta.url)),
12655
+ return path25.join(
12656
+ path25.dirname(fileURLToPath5(import.meta.url)),
12542
12657
  "..",
12543
12658
  "..",
12544
12659
  "config",
@@ -12549,7 +12664,7 @@ function loadHostInstructionLimits(file = defaultHostLimitsPath()) {
12549
12664
  const out = /* @__PURE__ */ new Map();
12550
12665
  let raw;
12551
12666
  try {
12552
- raw = JSON.parse(fs25.readFileSync(file, "utf-8"));
12667
+ raw = JSON.parse(fs26.readFileSync(file, "utf-8"));
12553
12668
  } catch {
12554
12669
  return out;
12555
12670
  }
@@ -12598,6 +12713,89 @@ function buildHostLimitRows(layers, limits) {
12598
12713
  }
12599
12714
  return rows;
12600
12715
  }
12716
+ function defaultInventoryPath(home) {
12717
+ if (home === void 0 || home === null || home === "") return inventory_path();
12718
+ try {
12719
+ const real = (q) => {
12720
+ try {
12721
+ return fs26.realpathSync(q);
12722
+ } catch {
12723
+ return path25.resolve(q);
12724
+ }
12725
+ };
12726
+ const mine = os10.homedir();
12727
+ if (path25.resolve(home) === path25.resolve(mine) || real(home) === real(mine)) {
12728
+ return inventory_path();
12729
+ }
12730
+ } catch {
12731
+ }
12732
+ return path25.join(home, DEFAULT_EVENT4U_ROOT_RELATIVE, INVENTORY_BASENAME);
12733
+ }
12734
+ function resolveLayerOwnership(opts) {
12735
+ const recorded = /* @__PURE__ */ new Map();
12736
+ const sources = [];
12737
+ if (opts.inventoryPath !== null) {
12738
+ let n = 0;
12739
+ try {
12740
+ const inv = load_inventory(opts.inventoryPath ?? defaultInventoryPath(opts.home));
12741
+ for (const abs of recorded_absolute_files(inv, opts.home ?? null)) {
12742
+ if (!recorded.has(abs)) n += 1;
12743
+ recorded.set(abs, null);
12744
+ }
12745
+ } catch {
12746
+ }
12747
+ if (n > 0) sources.push("global-inventory");
12748
+ }
12749
+ let fromDeploy = 0;
12750
+ for (const [anchor, rels] of opts.thisDeploy ?? /* @__PURE__ */ new Map()) {
12751
+ for (const rel of rels) {
12752
+ const abs = path25.resolve(anchor, rel);
12753
+ if (!recorded.has(abs)) fromDeploy += 1;
12754
+ recorded.set(abs, null);
12755
+ try {
12756
+ recorded.set(fs26.realpathSync(abs), null);
12757
+ } catch {
12758
+ }
12759
+ }
12760
+ }
12761
+ if (fromDeploy > 0) sources.push("this-deploy");
12762
+ const manifestPath = opts.manifestPath ?? null;
12763
+ if (manifestPath !== null && fs26.existsSync(manifestPath)) {
12764
+ let n = 0;
12765
+ let recordedHashes;
12766
+ try {
12767
+ recordedHashes = readRecordedHashes(manifestPath, opts.projectRoot);
12768
+ } catch {
12769
+ recordedHashes = NO_RECORDED_HASHES;
12770
+ }
12771
+ for (const [abs, hash] of recordedHashes) {
12772
+ n += 1;
12773
+ recorded.set(abs, hash);
12774
+ }
12775
+ if (n > 0) sources.push("manifest");
12776
+ }
12777
+ if (recorded.size === 0) {
12778
+ return { recorded: NO_RECORDED_HASHES, sources: [], source: "none" };
12779
+ }
12780
+ const primary = sources.includes("manifest") ? "manifest" : sources.includes("global-inventory") ? "global-inventory" : "this-deploy";
12781
+ return { recorded, sources, source: primary };
12782
+ }
12783
+ function ownershipLine(sources) {
12784
+ const list = (Array.isArray(sources) ? sources : [sources]).filter(
12785
+ (s) => s !== "none"
12786
+ );
12787
+ if (list.length === 0) {
12788
+ return "ownership: NO manifest and NO deploy inventory resolved \u2014 every file reads foreign, which is no evidence rather than a finding";
12789
+ }
12790
+ const phrases = {
12791
+ manifest: "the installed-tools manifest",
12792
+ "global-inventory": "the global deploy inventory (deployed-files.json)",
12793
+ "this-deploy": "the file set this install just wrote"
12794
+ };
12795
+ const named = list.map((s) => phrases[s]);
12796
+ const joined = named.length === 1 ? named[0] : `${named.slice(0, -1).join(", ")} and ${named[named.length - 1]}`;
12797
+ return `ownership: read from ${joined}`;
12798
+ }
12601
12799
  function renderHostLimitRows(rows) {
12602
12800
  const out = [
12603
12801
  "host instruction budgets \u2014 package-owned + foreign against the published limit"
@@ -12618,16 +12816,16 @@ function renderHostLimitRows(rows) {
12618
12816
 
12619
12817
  // src/scripts/_lib/thin_rules.ts
12620
12818
  import { createHash as createHash7 } from "node:crypto";
12621
- import * as fs27 from "node:fs";
12622
- import * as path26 from "node:path";
12819
+ import * as fs28 from "node:fs";
12820
+ import * as path27 from "node:path";
12623
12821
  import { fileURLToPath as fileURLToPath6 } from "node:url";
12624
12822
 
12625
12823
  // src/scripts/_lib/rule_consequence_class.ts
12626
- import * as fs26 from "node:fs";
12627
- import * as path25 from "node:path";
12824
+ import * as fs27 from "node:fs";
12825
+ import * as path26 from "node:path";
12628
12826
  var CLASS_CONFIG_REL = "src/config/rule-consequence-class.json";
12629
12827
  function readConsequenceClass(repoRoot) {
12630
- const raw = JSON.parse(fs26.readFileSync(path25.join(repoRoot, CLASS_CONFIG_REL), "utf-8"));
12828
+ const raw = JSON.parse(fs27.readFileSync(path26.join(repoRoot, CLASS_CONFIG_REL), "utf-8"));
12631
12829
  return {
12632
12830
  criterion_ref: raw.criterion_ref ?? "",
12633
12831
  members: raw.members ?? {},
@@ -12673,22 +12871,22 @@ function triggerlessRuleIds(router) {
12673
12871
 
12674
12872
  // src/scripts/_lib/thin_rules.ts
12675
12873
  var _HERE2 = fileURLToPath6(import.meta.url);
12676
- var REPO_ROOT = path26.resolve(path26.dirname(_HERE2), "..", "..", "..");
12677
- var RULES_SOURCE = path26.join(REPO_ROOT, "dist/agent-src", "rules");
12678
- var ROUTER = path26.join(REPO_ROOT, "dist", "router.json");
12874
+ var REPO_ROOT = path27.resolve(path27.dirname(_HERE2), "..", "..", "..");
12875
+ var RULES_SOURCE = path27.join(REPO_ROOT, "dist/agent-src", "rules");
12876
+ var ROUTER = path27.join(REPO_ROOT, "dist", "router.json");
12679
12877
  function _globSortedMd(dir) {
12680
12878
  let names;
12681
12879
  try {
12682
- names = fs27.readdirSync(dir);
12880
+ names = fs28.readdirSync(dir);
12683
12881
  } catch {
12684
12882
  return [];
12685
12883
  }
12686
- const out = names.filter((n) => n.endsWith(".md")).map((n) => path26.join(dir, n));
12884
+ const out = names.filter((n) => n.endsWith(".md")).map((n) => path27.join(dir, n));
12687
12885
  out.sort();
12688
12886
  return out;
12689
12887
  }
12690
12888
  function kernel_ids(routerPath = ROUTER) {
12691
- const data = JSON.parse(fs27.readFileSync(routerPath, "utf-8"));
12889
+ const data = JSON.parse(fs28.readFileSync(routerPath, "utf-8"));
12692
12890
  const kernel = data.kernel;
12693
12891
  if (Array.isArray(kernel)) {
12694
12892
  return new Set(kernel.map((x) => String(x)));
@@ -12696,7 +12894,7 @@ function kernel_ids(routerPath = ROUTER) {
12696
12894
  return /* @__PURE__ */ new Set();
12697
12895
  }
12698
12896
  function _router(routerPath = ROUTER) {
12699
- return JSON.parse(fs27.readFileSync(routerPath, "utf-8"));
12897
+ return JSON.parse(fs28.readFileSync(routerPath, "utf-8"));
12700
12898
  }
12701
12899
  function path_only_ids(routerPath = ROUTER) {
12702
12900
  return pathOnlyRuleIds(_router(routerPath));
@@ -12705,7 +12903,7 @@ function no_trigger_ids(routerPath = ROUTER) {
12705
12903
  return new Set(triggerlessRuleIds(_router(routerPath)));
12706
12904
  }
12707
12905
  function rule_workspaces_map(routerPath = ROUTER) {
12708
- const data = JSON.parse(fs27.readFileSync(routerPath, "utf-8"));
12906
+ const data = JSON.parse(fs28.readFileSync(routerPath, "utf-8"));
12709
12907
  const map = /* @__PURE__ */ new Map();
12710
12908
  for (const tier of ["tier_1", "tier_2"]) {
12711
12909
  const entries = data[tier];
@@ -12769,10 +12967,15 @@ function _trigger_hint(fm) {
12769
12967
  function _title(s) {
12770
12968
  return s.replace(/[A-Za-z]+/g, (w) => w.charAt(0).toUpperCase() + w.slice(1).toLowerCase());
12771
12969
  }
12772
- var THIN_ENTRY_MARKER = "> Routed rule \u2014 load the body on trigger-match.";
12970
+ var THIN_ENTRY_MARKER = "> Load the body on a match.";
12971
+ var THIN_BODY_POINTER_PREFIX = "Body: ";
12972
+ var THIN_BODY_POINTER_RE = (() => {
12973
+ const lit = THIN_BODY_POINTER_PREFIX.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
12974
+ return new RegExp(`${lit}((?:(?!${lit}).)+\\.md)\\s*$`, "m");
12975
+ })();
12773
12976
  var BODY_LINK_PREFIX = "../../dist/agent-src/rules/";
12774
12977
  function absoluteBodyLinkPrefix(packageRoot) {
12775
- return `${path26.join(path26.resolve(packageRoot), "dist", "agent-src", "rules")}${path26.sep}`;
12978
+ return `${path27.join(path27.resolve(packageRoot), "dist", "agent-src", "rules")}${path27.sep}`;
12776
12979
  }
12777
12980
  function thin_entry(rule_id, text, bodyLinkPrefix = BODY_LINK_PREFIX) {
12778
12981
  const [fm] = split_frontmatter(text);
@@ -12781,7 +12984,7 @@ function thin_entry(rule_id, text, bodyLinkPrefix = BODY_LINK_PREFIX) {
12781
12984
  const title = _title(rule_id.replace(/-/g, " "));
12782
12985
  const fires = hint ? ` Fires on: ${hint}.` : "";
12783
12986
  return `## ${title}
12784
- ${THIN_ENTRY_MARKER}${fires} ${desc} Body: [\`${rule_id}\`](${bodyLinkPrefix}${rule_id}.md)
12987
+ ${THIN_ENTRY_MARKER}${fires} ${desc} ${THIN_BODY_POINTER_PREFIX}${bodyLinkPrefix}${rule_id}.md
12785
12988
  `;
12786
12989
  }
12787
12990
  var STUB_LAW_OPEN = "<!-- law: byte-copied from the rule, sha256 ";
@@ -12819,7 +13022,7 @@ ${STUB_LAW_CLOSE}
12819
13022
  `;
12820
13023
  }
12821
13024
  function build_thin(rules_dir = RULES_SOURCE, scope = null, announce = null, consequenceClass = null, roots = null) {
12822
- const routerPath = roots?.routerPath ?? (roots?.packageRoot === void 0 ? ROUTER : path26.join(roots.packageRoot, "dist", "router.json"));
13025
+ const routerPath = roots?.routerPath ?? (roots?.packageRoot === void 0 ? ROUTER : path27.join(roots.packageRoot, "dist", "router.json"));
12823
13026
  const classRoot = roots?.packageRoot ?? REPO_ROOT;
12824
13027
  const bodyLinkPrefix = roots?.bodyLinkPrefix ?? BODY_LINK_PREFIX;
12825
13028
  const kernel = kernel_ids(routerPath);
@@ -12830,43 +13033,43 @@ function build_thin(rules_dir = RULES_SOURCE, scope = null, announce = null, con
12830
13033
  const wsMap = scope !== null ? rule_workspaces_map(routerPath) : /* @__PURE__ */ new Map();
12831
13034
  const out = /* @__PURE__ */ new Map();
12832
13035
  for (const p of _globSortedMd(rules_dir)) {
12833
- const text = fs27.readFileSync(p, "utf-8");
12834
- const stem = path26.basename(p).replace(/\.md$/, "");
13036
+ const text = fs28.readFileSync(p, "utf-8");
13037
+ const stem = path27.basename(p).replace(/\.md$/, "");
12835
13038
  if (!id_in_scope(stem, scope, kernel, wsMap, fm_workspaces(text))) {
12836
13039
  continue;
12837
13040
  }
12838
13041
  const noStub = cls.no_stub[stem] !== void 0;
12839
13042
  const full = kernel.has(stem) || noTrigger.has(stem) || pathOnly.has(stem) || noStub;
12840
13043
  if (announce !== null && noTrigger.has(stem) && !kernel.has(stem)) {
12841
- announce(`D3: trigger-less auto rule ${path26.basename(p)} \u2014 kept full-bodied, never thinned`);
13044
+ announce(`D3: trigger-less auto rule ${path27.basename(p)} \u2014 kept full-bodied, never thinned`);
12842
13045
  }
12843
13046
  if (announce !== null && pathOnly.has(stem) && !kernel.has(stem) && !noTrigger.has(stem)) {
12844
13047
  announce(
12845
- `E2: path-only auto rule ${path26.basename(p)} \u2014 kept full-bodied; its only triggers are path-shaped and the delivery concern is not bound on pre_tool_use`
13048
+ `E2: path-only auto rule ${path27.basename(p)} \u2014 kept full-bodied; its only triggers are path-shaped and the delivery concern is not bound on pre_tool_use`
12846
13049
  );
12847
13050
  }
12848
13051
  if (full) {
12849
- out.set(path26.basename(p), text);
13052
+ out.set(path27.basename(p), text);
12850
13053
  continue;
12851
13054
  }
12852
13055
  if (lawInStub.has(stem)) {
12853
13056
  if (announce !== null) {
12854
13057
  announce(
12855
- `LAW: high-consequence rule ${path26.basename(p)} \u2014 stub carries its own law section, byte-copied`
13058
+ `LAW: high-consequence rule ${path27.basename(p)} \u2014 stub carries its own law section, byte-copied`
12856
13059
  );
12857
13060
  }
12858
- out.set(path26.basename(p), thin_entry_with_law(stem, text, bodyLinkPrefix));
13061
+ out.set(path27.basename(p), thin_entry_with_law(stem, text, bodyLinkPrefix));
12859
13062
  continue;
12860
13063
  }
12861
- out.set(path26.basename(p), thin_entry(stem, text, bodyLinkPrefix));
13064
+ out.set(path27.basename(p), thin_entry(stem, text, bodyLinkPrefix));
12862
13065
  }
12863
13066
  return out;
12864
13067
  }
12865
13068
 
12866
13069
  // src/install/installThinLayer.ts
12867
13070
  function thinInstalledRuleLayer(opts) {
12868
- const packageRoot = path27.resolve(opts.packageRoot);
12869
- const bodySourceDir = path27.join(packageRoot, "dist", "agent-src", "rules");
13071
+ const packageRoot = path28.resolve(opts.packageRoot);
13072
+ const bodySourceDir = path28.join(packageRoot, "dist", "agent-src", "rules");
12870
13073
  const bodyLinkPrefix = absoluteBodyLinkPrefix(packageRoot);
12871
13074
  const preserved = opts.preserved ?? /* @__PURE__ */ new Set();
12872
13075
  const stubs = build_thin(bodySourceDir, null, null, null, { packageRoot, bodyLinkPrefix });
@@ -12879,10 +13082,10 @@ function thinInstalledRuleLayer(opts) {
12879
13082
  const absent = [];
12880
13083
  const failed = [];
12881
13084
  for (const [name, stubText] of stubs) {
12882
- const target = path27.join(opts.rulesDir, name);
13085
+ const target = path28.join(opts.rulesDir, name);
12883
13086
  let installed;
12884
13087
  try {
12885
- installed = fs28.readFileSync(target, "utf-8");
13088
+ installed = fs29.readFileSync(target, "utf-8");
12886
13089
  } catch (e) {
12887
13090
  if (e.code === "ENOENT") absent.push(name);
12888
13091
  else failed.push({ rule: name, reason: String(e) });
@@ -12890,7 +13093,7 @@ function thinInstalledRuleLayer(opts) {
12890
13093
  }
12891
13094
  let sourceText;
12892
13095
  try {
12893
- sourceText = fs28.readFileSync(path27.join(bodySourceDir, name), "utf-8");
13096
+ sourceText = fs29.readFileSync(path28.join(bodySourceDir, name), "utf-8");
12894
13097
  } catch {
12895
13098
  sourceText = null;
12896
13099
  }
@@ -12900,7 +13103,7 @@ function thinInstalledRuleLayer(opts) {
12900
13103
  charsAfter += installed.length;
12901
13104
  continue;
12902
13105
  }
12903
- if (preserved.has(path27.resolve(target))) {
13106
+ if (preserved.has(path28.resolve(target))) {
12904
13107
  preservedHits.push(name);
12905
13108
  charsBefore += installed.length;
12906
13109
  charsAfter += installed.length;
@@ -12919,7 +13122,7 @@ function thinInstalledRuleLayer(opts) {
12919
13122
  const next = `${frontmatter}${stubText}`;
12920
13123
  try {
12921
13124
  if (next !== installed) {
12922
- fs28.writeFileSync(target, next, "utf-8");
13125
+ fs29.writeFileSync(target, next, "utf-8");
12923
13126
  rewritten += 1;
12924
13127
  }
12925
13128
  thinned += 1;
@@ -12962,15 +13165,36 @@ function describeThinInstalledLayer(res) {
12962
13165
  }
12963
13166
  return out;
12964
13167
  }
12965
- function installReceiptBudgetLines(packageRoot, home = os10.homedir()) {
13168
+ function installReceiptBudgetLines(packageRoot, home = os11.homedir(), opts = {}) {
12966
13169
  try {
12967
- const recorded = (() => {
12968
- try {
12969
- return readRecordedHashes(manifest_path(packageRoot), packageRoot);
12970
- } catch {
12971
- return NO_RECORDED_HASHES;
12972
- }
12973
- })();
13170
+ const { recorded, sources } = resolveLayerOwnership({
13171
+ manifestPath: opts.manifestPath === void 0 ? manifest_path(packageRoot) : opts.manifestPath,
13172
+ projectRoot: packageRoot,
13173
+ // The same home the layers below are read from — the inventory's
13174
+ // anchor is tilde-relative, so the two must agree or the receipt
13175
+ // measures one install and claims ownership of another.
13176
+ home,
13177
+ // THE RECEIPT IS THE "ASKING PROCESS" CASE, so it names no home
13178
+ // here. It runs inside the install that WROTE the inventory, and
13179
+ // that writer resolves the path through `inventory_path()` —
13180
+ // honouring `AGENT_CONFIG_DEPLOY_INVENTORY`, which names a FILE
13181
+ // rather than a home, and `EVENT4U_CONFIG_HOME`. Passing `home`
13182
+ // would take `defaultInventoryPath`'s stated-home branch and read
13183
+ // `<home>/.event4u/...`, a file nothing wrote under either
13184
+ // override, and the inventory evidence would be silently lost.
13185
+ // UNDEFINED IS LEFT UNDEFINED so `resolveLayerOwnership` applies
13186
+ // `defaultInventoryPath(home)` — the SAME resolution the report
13187
+ // uses. Hardcoding `inventory_path()` here made the two readers
13188
+ // step 1.2 exists to reconcile disagree for any home that is not
13189
+ // the asking process's: the receipt read one install's inventory
13190
+ // and then expanded its tilde-relative anchors against the OTHER
13191
+ // home, which is the cross-home misattribution two docstrings in
13192
+ // the resolver forbid. `defaultInventoryPath` already returns
13193
+ // `inventory_path()` when the stated home IS this process's, which
13194
+ // is the case that motivated the hardcode.
13195
+ inventoryPath: opts.inventoryPath,
13196
+ thisDeploy: opts.thisDeploy
13197
+ });
12974
13198
  const layers = [];
12975
13199
  for (const host of Object.keys(GLOBAL_RULE_DIRS).sort()) {
12976
13200
  const dir = globalRuleLayerPath(host, home);
@@ -12978,7 +13202,8 @@ function installReceiptBudgetLines(packageRoot, home = os10.homedir()) {
12978
13202
  layers.push(readLayer(host, "global", dir, recorded));
12979
13203
  }
12980
13204
  const rows = buildHostLimitRows(layers, loadHostInstructionLimits());
12981
- return rows.length === 0 ? [] : renderHostLimitRows(rows).map((l) => ` ${l}`);
13205
+ if (rows.length === 0) return [];
13206
+ return [` ${ownershipLine(sources)}`, ...renderHostLimitRows(rows).map((l) => ` ${l}`)];
12982
13207
  } catch {
12983
13208
  return [];
12984
13209
  }
@@ -13025,7 +13250,7 @@ function resolveGlobalRuleScope(inputs) {
13025
13250
  }
13026
13251
 
13027
13252
  // src/scripts/_lib/lean_projection_mode.ts
13028
- import * as path28 from "node:path";
13253
+ import * as path29 from "node:path";
13029
13254
  var DEFAULT_LEAN_PROJECTION_MODE = "eager-all";
13030
13255
  function normalizeLeanProjectionMode(raw) {
13031
13256
  const v = typeof raw === "string" ? raw.trim().toLowerCase() : "";
@@ -13073,8 +13298,8 @@ function thinsHost(mode, hosts, hostId) {
13073
13298
  return writesThinFiles(mode) && hosts.includes(hostId);
13074
13299
  }
13075
13300
  function resolveLeanProjection(opts = {}) {
13076
- const file = opts.settingsPath ?? path28.join(opts.projectRoot ?? process.cwd(), ".agent-settings.yml");
13077
- const tpl = opts.packageRoot == null ? null : path28.join(opts.packageRoot, "src", "config", "agent-settings.template.yml");
13301
+ const file = opts.settingsPath ?? path29.join(opts.projectRoot ?? process.cwd(), ".agent-settings.yml");
13302
+ const tpl = opts.packageRoot == null ? null : path29.join(opts.packageRoot, "src", "config", "agent-settings.template.yml");
13078
13303
  let lean;
13079
13304
  try {
13080
13305
  lean = load_agent_settings(
@@ -13099,9 +13324,9 @@ function resolveLeanProjection(opts = {}) {
13099
13324
  }
13100
13325
  };
13101
13326
  }
13102
- var NO_TEMPLATE_LAYER = path28.join(path28.sep, "dev", "null", "agent-config-absent-template.yml");
13327
+ var NO_TEMPLATE_LAYER = path29.join(path29.sep, "dev", "null", "agent-config-absent-template.yml");
13103
13328
  function rawExplicitLeanProjectionMode(opts = {}) {
13104
- const file = opts.settingsPath ?? path28.join(opts.projectRoot ?? process.cwd(), ".agent-settings.yml");
13329
+ const file = opts.settingsPath ?? path29.join(opts.projectRoot ?? process.cwd(), ".agent-settings.yml");
13105
13330
  let lean;
13106
13331
  try {
13107
13332
  lean = load_agent_settings({ project_path: file, template_path: NO_TEMPLATE_LAYER })["lean_projection"];
@@ -13119,8 +13344,8 @@ function installerThinsHost(hostId, opts = {}) {
13119
13344
  });
13120
13345
  return modeExplicit && thinsHost(mode, hosts.hosts, hostId);
13121
13346
  }
13122
- var NO_PROJECT_LAYER = path28.join(
13123
- path28.sep,
13347
+ var NO_PROJECT_LAYER = path29.join(
13348
+ path29.sep,
13124
13349
  "dev",
13125
13350
  "null",
13126
13351
  "agent-config-absent-project-settings.yml"
@@ -17302,22 +17527,19 @@ var profileId = external_exports.enum(["developer", "content_creator", "founder"
17302
17527
  var accessStyle = external_exports.enum(["getters_setters", "get_attribute", "magic_properties"]);
17303
17528
  var chatFreq = external_exports.enum(["per_turn", "per_phase", "per_tool"]);
17304
17529
  var qualityCadence = external_exports.enum(["end_of_roadmap", "per_phase", "per_step"]);
17305
- var regenCadence = external_exports.enum(["per_step", "every_5_steps", "phase_boundary"]);
17306
17530
  var fidelityMode = external_exports.enum(["strict", "structural", "hard-floor"]);
17307
- var crossSourceMode = external_exports.enum(["on", "auto", "off"]);
17308
- var richSkillsMode = external_exports.enum(["on", "ask", "off"]);
17309
17531
  var replyMethod = external_exports.enum(["replies_endpoint", "create_review_comment", "auto"]);
17310
17532
  var confidenceBand = external_exports.enum(["off", "low", "medium", "high"]);
17311
17533
  var onBlock = external_exports.enum(["stop", "ask", "warn"]);
17312
- var onBlockFallback = external_exports.enum(["stop", "warn"]);
17313
17534
  var modelAutoSwitch = external_exports.enum(["auto", "suggest", "off"]);
17314
17535
  var leanProjectionMode = external_exports.enum(["eager-all", "thin", "delivery"]);
17315
17536
  var leanProjectionHost = external_exports.enum(["claude-code", "cursor", "cline"]);
17316
17537
  var projectionMode = external_exports.enum(["legacy-all", "scoped"]);
17317
- var memoryCadence = external_exports.enum(["auto", "always", "never"]);
17318
17538
  var projectAudience = external_exports.enum(["self", "internal", "client", "public"]);
17319
17539
  var deliveryMerge = external_exports.enum(["off", "on-green"]);
17320
17540
  var prTopology = external_exports.enum(["single", "stacked"]);
17541
+ var gitCommitFormat = external_exports.enum(["ticket-scope", "ticket-conventional"]);
17542
+ var gitUpdateStrategy = external_exports.enum(["merge", "rebase"]);
17321
17543
  var settingsSchema = external_exports.object({
17322
17544
  agent_config_version: external_exports.string().default("").describe(
17323
17545
  'Pin the package to an exact semver (e.g. "1.4.2") so all teammates load the same skill / rule set. Leave empty to track whatever is installed locally \u2014 useful for the maintainers of this package, risky for production projects.'
@@ -17394,18 +17616,9 @@ var settingsSchema = external_exports.object({
17394
17616
  rtk_installed: external_exports.boolean().default(false).describe(
17395
17617
  "Does this machine have rtk (Rust Token Killer, a third-party Apache-2.0 tool: https://github.com/rtk-ai/rtk) on PATH \u2014 verified as the real Token Killer, not the unrelated Rust Type Kit that shares the binary name? When true the agent wraps verbose CLI output (git, tests, linters, docker, npm, composer) with rtk (upstream reports 60-90% token savings \u2014 their estimate). Leave false if rtk is missing \u2014 the agent falls back to tail / grep. The wizard overwrites this from a live two-stage probe (PATH presence + `rtk gain` identity check)."
17396
17618
  ),
17397
- minimal_output: external_exports.boolean().default(true).describe(
17398
- "Prefer short bullets and tables (true, default) vs verbose prose with rationale (false). Affects every chat reply; flip to false during debugging when you want the agent to think out loud."
17399
- ),
17400
17619
  canary_name: external_exports.string().default("").describe(
17401
17620
  'Session canary \u2014 the name the agent addresses you with at the start of every new task (e.g. "Alex"). When the greeting silently disappears, the context window is degrading: start a fresh conversation. Also keeps the reply-close markers (end-summary, PR URL as literal last line) alive. Empty = fall back to the user-global canary_name, then to identity.name from the setup wizard; no name anywhere = off. See rules/session-canary.md.'
17402
17621
  ),
17403
- play_by_play: external_exports.boolean().default(false).describe(
17404
- `Narrate intermediate findings between tool calls ("Found it.", "Let me check Y."). Off by default \u2014 most users find it noisy. Turn on when you want to follow the agent's reasoning step by step.`
17405
- ),
17406
- pr_comment_bot_icon: external_exports.boolean().default(false).describe(
17407
- "Prefix every PR review-comment reply with \u{1F916} so humans can tell agent-authored comments apart from teammate comments at a glance. Cosmetic only; the comment body itself never changes."
17408
- ),
17409
17622
  pr_progress_comments: external_exports.boolean().default(false).describe(
17410
17623
  'Permit the agent to post unsolicited progress / status comments on an open PR (e.g. "CI fix iteration #2", "still blocked on workflow scope"). Default off \u2014 most teammates find them noisy. User-invoked flows (/fix:pr-comments, /create-pr, /code-review, explicit "post a comment that \u2026") are NOT gated by this setting. See rules/no-pr-progress-comments.md.'
17411
17624
  ),
@@ -17417,9 +17630,6 @@ var settingsSchema = external_exports.object({
17417
17630
  )
17418
17631
  }),
17419
17632
  project: external_exports.object({
17420
- pr_template: external_exports.string().default(".github/pull_request_template.md").describe(
17421
- "Path (relative to project root) to the PR-description template the agent fills in before opening a pull request. Override only if your repo keeps the template somewhere non-standard."
17422
- ),
17423
17633
  upstream_repo: external_exports.string().default("").describe(
17424
17634
  "GitHub slug (owner/repo) the upstream-contribute skill targets when you ask the agent to push a learning back to the shared agent-config package. Empty = improvement PRs are disabled."
17425
17635
  ),
@@ -17430,6 +17640,17 @@ var settingsSchema = external_exports.object({
17430
17640
  'Who this project is built for \u2014 read by the demand gate (\xA7 8-pre of docs/guidelines/agent-infra/agent-interaction-and-decision-quality.md), whose L0-L4 ladder measures MARKET demand and is meaningless where no market is intended. self = a tool its maintainer builds for themselves; the gate is inert and work is classified L-self (build) instead of being deferred for lack of a user population nobody wants. internal = a team tool; only "what breaks without it?" survives. client = built for a named client, who is the requester rather than a market segment. public (default) = a product with an intended market; full three-question gate, behaviour unchanged from before this key existed.'
17431
17641
  )
17432
17642
  }),
17643
+ git: external_exports.object({
17644
+ commit_format: gitCommitFormat.default("ticket-scope").describe(
17645
+ "Where a ticket id goes in a commit subject. ticket-scope (default) = the ticket is the Conventional-Commits scope, `feat(DEV-1234): add export filter` \u2014 the behaviour every install had before this key existed. ticket-conventional = the ticket leads the subject and the scope names the system area, `DEV-1234 feat(exporter): add export filter`; a ticket is then never a scope. Without a ticket both shapes are plain Conventional Commits. A commit-linting config in the repository (commitlint, a commit-msg hook) outranks this key."
17646
+ ),
17647
+ branch_pattern: external_exports.string().default("{type}/{slug}").describe(
17648
+ "Shape of a branch name the agent creates. Placeholders: {type} (feat, fix, \u2026), {ticket} (e.g. DEV-1234), {slug} (short kebab-case description). Default {type}/{slug}. {slug} is required, and characters outside the placeholders are limited to A-Z a-z 0-9 . _ / - so a rendered name is safe in a command; agent-config git:convention show reports anything else as invalid. A team that names branches after the ticket sets {ticket}-{slug}. A placeholder with no value is dropped together with the separator that follows it, or the one before it when it is last, so no name starts or ends with a separator ({type}/{ticket}-{slug} without a ticket gives feat/slug). Reading a ticket back out of an existing branch never depends on this pattern."
17649
+ ),
17650
+ update_strategy: gitUpdateStrategy.default("merge").describe(
17651
+ "How a feature branch is brought up to date with its base. merge (default) = merge the base into the branch, as before this key existed. rebase = rebase the branch onto origin/<base> and publish with --force-with-lease, never a merge of the base into the branch. Rebase rewrites history, so the agent still asks for it unless the git-history-discipline rule already authorises the rewrite (the user asked this turn, an unrevoked standing instruction, or a pull --rebase the user started); this key decides which operation is proposed, never whether one is authorised."
17652
+ )
17653
+ }).default({}),
17433
17654
  github: external_exports.object({
17434
17655
  pr_reply_method: replyMethod.default("create_review_comment").describe(
17435
17656
  "How the agent replies to PR review comments. create_review_comment = post a new review comment (works on every GitHub plan). replies_endpoint = thread the reply under the original comment (needs the newer REST endpoint). auto = detect at runtime, prefer threaded replies when available."
@@ -17509,32 +17730,29 @@ var settingsSchema = external_exports.object({
17509
17730
  )
17510
17731
  })
17511
17732
  }),
17512
- pipelines: external_exports.object({
17513
- skill_improvement: external_exports.boolean().default(true).describe(
17514
- "After a meaningful task the agent proposes a learning-capture turn (new skill, rule tweak, guideline). Turn off if you find the prompts noisy \u2014 you can still run /memory:promote manually."
17515
- )
17516
- }),
17517
17733
  roadmap: external_exports.object({
17518
- skip_pre_run_gate: external_exports.boolean().default(true).describe(
17519
- 'Skip the /roadmap:process-* pre-run confirmation gate. true (default) starts processing immediately and surfaces the resolved config inline; false shows the numbered-options gate and waits. A genuine "which roadmap?" ambiguity always prompts regardless.'
17520
- ),
17521
17734
  quality_cadence: qualityCadence.default("per_phase").describe(
17522
17735
  "When the agent runs the full quality / test suite during /roadmap:process-* runs. per_phase = after each phase boundary (default since 2026-09-13 \u2014 end_of_roadmap lets errors compound across phases, which is expensive in a multi-phase autonomous run nobody is watching). end_of_roadmap = once, after the last step (fastest). per_step = after every single step (slowest, highest confidence)."
17523
17736
  ),
17524
- dashboard_regen_cadence: regenCadence.default("every_5_steps").describe(
17525
- "How often the agent regenerates agents/roadmaps/dashboard.md during a roadmap run. every_5_steps = batch the regen (default). per_step = after every step (freshest dashboard, highest subprocess overhead). phase_boundary = only at phase edges. A rename, phase add, or archive always regenerates immediately regardless."
17526
- ),
17527
17737
  horizon_weeks: external_exports.number().int().min(0).default(0).describe(
17528
17738
  'Optional planning horizon (weeks) the agent shows in roadmap framing ("next 4 weeks"). Set 0 to omit the horizon \u2014 most teams prefer to ship without a hardcoded window.'
17529
17739
  ),
17530
17740
  gate_budget: external_exports.object({
17531
- max_cost_per_run_usd: external_exports.number().min(0).default(5).describe(
17532
- "Per-run USD ceiling for a CLASS-1 roadmap blocker executed via `agent-config gates --execute`. A class-1 entry whose **Budget:** field states a larger figure renders its consent line instead of running. Bounds the size of an authorised spend; never supplies the authorisation \u2014 `--confirm` is still required on every class-1 run."
17741
+ // `.min(0)` is kept deliberately, at a known cost: the settings-
17742
+ // reference generator renders a constrained nullable number as
17743
+ // type `unknown` rather than `number,null` (it reads `node.type`,
17744
+ // which a constrained nullable emits as an `anyOf` instead).
17745
+ // Eight keys already render that way. Dropping the constraint
17746
+ // would buy a nicer doc cell by letting a negative USD ceiling
17747
+ // into the schema, and a cap that refuses everything is a worse
17748
+ // outcome than an uninformative table cell.
17749
+ max_cost_per_run_usd: external_exports.number().min(0).nullable().default(null).describe(
17750
+ "Per-run USD ceiling for a CLASS-1 roadmap blocker executed via `agent-config gates --execute`. A class-1 entry whose **Budget:** field states a larger figure renders its consent line instead of running. null (default) = no per-run ceiling, per ADR-279: a spend bound applies only where one was set, and the absence of a bound is not a refusal. Bounds the size of an authorised spend; never supplies the authorisation \u2014 `--confirm` is still required on every class-1 run, set or unset."
17533
17751
  ),
17534
- max_cost_per_rolling_7d_usd: external_exports.number().min(0).default(25).describe(
17535
- "Rolling 7-day USD ceiling for class-1 gate execution, summed from the append-only receipt ledger at agents/runtime/state/gate-budget-ledger.jsonl. A run whose estimate would cross it renders instead of running. A per-run cap alone bounds one mistake, not a week of them, which is why option (a) of b-gate-budget-preauth carries two numbers."
17752
+ max_cost_per_rolling_7d_usd: external_exports.number().min(0).nullable().default(null).describe(
17753
+ "Rolling 7-day USD ceiling for class-1 gate execution, summed from the append-only receipt ledger at agents/runtime/state/gate-budget-ledger.jsonl. A run whose estimate would cross it renders instead of running. null (default) = no rolling ceiling, per ADR-279. A per-run cap alone bounds one mistake, not a week of them, which is why option (a) of b-gate-budget-preauth carries two numbers \u2014 but each cap now bounds on its own, so setting one and leaving the other null is supported."
17536
17754
  )
17537
- }).default({ max_cost_per_run_usd: 5, max_cost_per_rolling_7d_usd: 25 })
17755
+ }).default({ max_cost_per_run_usd: null, max_cost_per_rolling_7d_usd: null })
17538
17756
  }),
17539
17757
  planning: external_exports.object({
17540
17758
  closure_pass: external_exports.boolean().default(true).describe(
@@ -17589,11 +17807,6 @@ var settingsSchema = external_exports.object({
17589
17807
  "Extra project-relative paths where THIS project keeps a code-graph index another tool wrote. The built-in list is deliberately vendor-neutral (graph.json, code-graph.json, .code-graph/graph.json) and names no tool, so a tool that writes its index elsewhere is named here rather than waited for. A graph found this way LOADS and answers query and explain with every edge tagged read-from-elsewhere; the gate verbs (impact, untested, dead) refuse a graph made only of such edges and say so, because an empty answer from a gate must not read as 'nothing found' when it means 'nothing trusted'. Absolute paths and paths escaping the project root are ignored."
17590
17808
  )
17591
17809
  }).default({}),
17592
- consistency: external_exports.object({
17593
- cross_source: crossSourceMode.default("on").describe(
17594
- "Consumed by the cross-source-consistency rule. When the agent works from multiple sources (ticket text, an attached image/mockup, the spec, the codebase) it checks them against each other and asks before proceeding on a discrepancy \u2014 instead of silently guessing. on (default) = surface every real cross-source contradiction / silent-scope-expansion as one question; auto = surface only high-confidence contradictions, state low-confidence as an assumption; off = no cross-source checking."
17595
- )
17596
- }).default({ cross_source: "on" }),
17597
17810
  screenshots: external_exports.object({
17598
17811
  identity_allowlist: external_exports.array(external_exports.string()).default([]).describe(
17599
17812
  "Consumed by the doc-screenshot-hygiene rule and screenshot-hygiene skill. Public identity tokens SAFE to show unredacted in a documentation screenshot \u2014 the maintainer's own public handles plus well-known fake-data tokens. Not a general fake-data dictionary and not identity-resolution: everything not listed is treated as sensitive by default, and a public handle co-located with a real name does not whitelist the real name. Default [] = nothing auto-allowed."
@@ -17605,39 +17818,11 @@ var settingsSchema = external_exports.object({
17605
17818
  "Consumed by the doc-screenshot-hygiene rule. on (default) = a data-bearing screenshot embed is gated behind this-turn human confirmation; uncertain/unresolved regions redact-or-refuse, never ship-and-hope; illustrative/no-data screenshots may embed with a stated justification. off = no data-bearing gate (the anonymization taxonomy still applies)."
17606
17819
  )
17607
17820
  }).default({ identity_allowlist: [], forbid_terminal_capture: true, data_bearing_gate: "on" }),
17608
- telegraph: external_exports.object({
17609
- speak: external_exports.boolean().default(false).describe(
17610
- "Whether the telegraph-speak rule ships at all. false (default) = DORMANT: compile_router omits the rule from dist/router.json entirely, so its body never reaches a host. This is the only lever that stops the cost. Set true only after an output-side bench clears the kill-criterion bar (docs/adrs/telegraph/0002)."
17611
- )
17612
- }).default({ speak: false }),
17613
- tokens: external_exports.object({
17614
- rich_skills: richSkillsMode.default("on").describe(
17615
- "Whether skills marked token_budget_class: rich may load in full (exempt from telegraph-speak + thin-projector trimming), consumed by the token-budget-discipline rule. on = allowed (default); off = fall back to standard condensed behavior; ask = surface an estimated token delta (tokens, not dollars) and ask once per session before loading."
17616
- )
17617
- }).default({ rich_skills: "on" }),
17618
17821
  verbosity: external_exports.object({
17619
- intent_announcements: external_exports.boolean().default(false).describe(
17620
- 'Intent narration before tool batches ("Let me check X\u2026"). Only honored when personal.play_by_play is ALSO true (the direct-answers narration carve-out requires both). false (default) = act and emit the result.'
17621
- ),
17622
- preview_artifacts: external_exports.boolean().default(false).describe(
17623
- "Show generated commit messages, PR titles/bodies, branch names before acting. false (default) = use generated content directly (/commit terse path)."
17624
- ),
17625
- routine_confirmations: external_exports.boolean().default(false).describe(
17626
- "Confirmation prompts for routine workflow steps with one obvious answer. Iron-Law gates (commit-policy, scope-control git-ops, Hard Floor) ALWAYS ask regardless."
17627
- ),
17628
17822
  offer_council_in_delivery: external_exports.boolean().default(false).describe(
17629
17823
  'Offer "run AI Council on this?" inside delivery commands (/feature-plan, /review-changes, /roadmap-create). Council commands themselves are unaffected.'
17630
- ),
17631
- post_action_reports: external_exports.enum(["off", "minimal", "full"]).default("minimal").describe(
17632
- "Status blocks after a successful action. off = errors only; minimal (default) = one-line confirmation; full = bullet list."
17633
17824
  )
17634
- }).default({
17635
- intent_announcements: false,
17636
- preview_artifacts: false,
17637
- routine_confirmations: false,
17638
- offer_council_in_delivery: false,
17639
- post_action_reports: "minimal"
17640
- }),
17825
+ }).default({ offer_council_in_delivery: false }),
17641
17826
  code_style: external_exports.object({
17642
17827
  docblocks: external_exports.enum(["minimal", "full"]).default("minimal").describe(
17643
17828
  "Consumed by the code-comment-discipline rule. minimal (default) = no signature-mirroring docblocks; docblocks only for machine-relevant precision (generics, array shapes) or genuine why-context. full = the exported public surface of a library package may carry one-line summary docblocks; the redundancy ban still holds."
@@ -17646,44 +17831,9 @@ var settingsSchema = external_exports.object({
17646
17831
  reasoning: external_exports.object({
17647
17832
  enabled: external_exports.boolean().default(true).describe(
17648
17833
  "Master switch for the Reasoning Discipline Protocol (RDP). false = the whole layer is inert (zero overhead)."
17649
- ),
17650
- auto_gate: external_exports.boolean().default(true).describe(
17651
- "Engage the discipline only where it pays, using table-free signals (task triviality + agent-self-assessed host reasoning strength; no runtime model->band lookup, per ADR-035). false = gate on task-signal + the component toggles only."
17652
- ),
17653
- components: external_exports.object({
17654
- orchestrator: external_exports.boolean().default(true).describe(
17655
- "Sequence the reasoning chain (ground->intent->notes->gather->audit->verify) as one system; the single coordination point."
17656
- ),
17657
- notes_first: external_exports.boolean().default(true).describe(
17658
- "Keep hypotheses/predictions/decisions in session notes; the response carries conclusions + evidence only."
17659
- ),
17660
- grounding: external_exports.boolean().default(true).describe(
17661
- "Explore the environment / close info-gaps before designing."
17662
- ),
17663
- intent: external_exports.boolean().default(true).describe(
17664
- "Infer the underlying goal before solving the literal ask (standard host only)."
17665
- ),
17666
- complexity_first: external_exports.boolean().default(true).describe(
17667
- "Risk-first: resolve the load-bearing unknown before the easy parts (RDP derivation, not a Fable-documented behavior)."
17668
- ),
17669
- verifier_default: external_exports.boolean().default(true).describe(
17670
- "Run a fresh-context verifier on the structural-complexity gate (branching/constraints/stateful/irreversible + token floor)."
17671
- ),
17672
- prediction_tracking: external_exports.boolean().default(true).describe(
17673
- "Log prediction + confidence + outcome + lesson (calibration loop)."
17674
- ),
17675
- decision_ledger: external_exports.boolean().default(true).describe(
17676
- "Log decision + alternatives + reason + revisit-if; escalates to decision-record/ADR when durable."
17677
- ),
17678
- uncertainty_budget: external_exports.boolean().default(true).describe(
17679
- "Per-dimension uncertainty score that feeds adaptive effort."
17680
- )
17681
- }).default({})
17834
+ )
17682
17835
  }).default({}),
17683
17836
  subagents: external_exports.object({
17684
- downshift: external_exports.boolean().default(true).describe(
17685
- "Route delegable sub-tasks to the lowest-capable model tier (cost + speed via model downshift). false = every subagent runs on the session tier."
17686
- ),
17687
17837
  quota_arbitrage: external_exports.boolean().default(true).describe(
17688
17838
  "Prefer a separate quota-pool model for delegable sub-tasks where the host manifest reports one. Optional bonus only \u2014 identical behaviour (minus the quota win) where unsupported. Never load-bearing."
17689
17839
  ),
@@ -17704,7 +17854,7 @@ var settingsSchema = external_exports.object({
17704
17854
  "Session-wide model CEILING for subagents (spend cap). Empty (default) = no ceiling. When set, suite-owned CLI spawn wrappers export CLAUDE_CODE_SUBAGENT_MODEL to the sessions they launch. Class C: a human sets it; the agent never writes or infers one."
17705
17855
  ),
17706
17856
  max_parallel: external_exports.number().int().min(1).default(3).describe(
17707
- "Hard cap on subagents running in parallel during /do-in-parallel, /do-competitively, and /judge runs. Raise for faster fan-out, lower if you hit rate limits or want lower token spend."
17857
+ "Limit on subagents running in parallel during /do-in-parallel, /do-competitively, and /judge runs \u2014 a value the model reads from settings; no code counts spawns against it. Raise for faster fan-out, lower if you hit rate limits or want lower token spend."
17708
17858
  ),
17709
17859
  adversarial_council: external_exports.enum(["off", "ask", "on"]).default("off").describe(
17710
17860
  "Opt-in adversarial-verification-council mode (subagent-orchestration Mode 9, ADR-122). off (default) = never runs; ask = offer it on an explicit high-risk change; on = auto-run on high-risk changes. Advisory only \u2014 a panel of distinct-model skeptics red-teams a real change for defect FINDING coverage and NEVER auto-gates it (Hard Floor). Stays default-off until the adversarial-council-finding-coverage claim is backed."
@@ -17723,9 +17873,6 @@ var settingsSchema = external_exports.object({
17723
17873
  max_calls_per_day: external_exports.number().int().min(0).default(50).describe(
17724
17874
  "Per-day cap on team calls, read against the EXISTING cli_call_budget openai bucket (~/.event4u/agent-config/cli-calls.json, daily UTC reset) \u2014 one subscription, one counter, never a parallel count. 0 = block all team calls."
17725
17875
  ),
17726
- suppress_setup_hint: external_exports.boolean().default(false).describe(
17727
- "Suppress the one-line wizard/init recommendation to set up the codex plugin on Claude-Code hosts. Cosmetic only \u2014 never changes behavior."
17728
- ),
17729
17876
  review_gate: external_exports.object({
17730
17877
  managed: external_exports.boolean().default(false).describe(
17731
17878
  "Managed governance of the codex plugin's Stop-hook Review Gate (road-to-team-mode Phase 4). false (default) = byte-identical pre-Phase-4 behavior: no counting, no circuit breaker. true = count consecutive BLOCK verdicts per session and trip the circuit breaker at max_consecutive_blocks."
@@ -17734,7 +17881,7 @@ var settingsSchema = external_exports.object({
17734
17881
  "Circuit-breaker bound: after this many CONSECUTIVE BLOCK verdicts in one session, a visible notice is injected exactly once and the managed layer stops re-blocking \u2014 the user decides, never an infinite Claude\u2194Codex loop. An ALLOW verdict resets the counter. Positive integer."
17735
17882
  )
17736
17883
  }).default({ managed: false, max_consecutive_blocks: 3 })
17737
- }).default({ model: "auto", allow_delegate: false, max_calls_per_day: 50, suppress_setup_hint: false, review_gate: { managed: false, max_consecutive_blocks: 3 } }),
17884
+ }).default({ model: "auto", allow_delegate: false, max_calls_per_day: 50, review_gate: { managed: false, max_consecutive_blocks: 3 } }),
17738
17885
  emergency: external_exports.object({
17739
17886
  orchestration_halt: external_exports.boolean().default(false).describe(
17740
17887
  "The one audited incident switch over the always-on orchestration stack (subagents, council, team). NOT an activation gate: false (default) = the stack runs normally. true = halted; arming requires no ceremony. Disarming (returning to false) requires orchestration_halt_justification to be a non-empty string. Both transitions emit one telemetry line."
@@ -17749,22 +17896,7 @@ var settingsSchema = external_exports.object({
17749
17896
  )
17750
17897
  }),
17751
17898
  commands: external_exports.object({
17752
- auto_detect: external_exports.enum(["enabled", "warn", "disabled"]).default("enabled").describe(
17753
- "Global kill-switch for orchestrator auto-detection (6.1.0 non-interactive-contract). enabled (default) = /judge, /fix, /analytics, /tests, /override auto-detect their sub-command per a confidence-tiered table; warn = detect but always confirm before routing; disabled = never auto-detect (always show the menu interactively, require an explicit sub-command in CI). Per-orchestrator override: auto_detect:false in front-matter. Per-invocation: --no-auto-detect."
17754
- ),
17755
17899
  suggestion: external_exports.object({
17756
- enabled: external_exports.boolean().default(true).describe(
17757
- 'Master switch for the slash-command suggestion layer. When on, the agent offers numbered options ("did you mean /commit?") instead of guessing. Turn off if you prefer to type every command yourself.'
17758
- ),
17759
- confidence_floor: external_exports.number().min(0).max(1).default(0.6).describe(
17760
- "Minimum semantic-match score (0.0\u20131.0) before a command is offered as a suggestion. 0.6 (default) balances precision and recall. Raise toward 0.8 for fewer false positives, lower for broader hints."
17761
- ),
17762
- cooldown_seconds: external_exports.number().int().min(0).default(600).describe(
17763
- "How long (seconds) the suggester waits before offering the same command again after you ignored it. Default 600s (10 min) keeps the agent from nagging. Set 0 to disable the cooldown."
17764
- ),
17765
- max_options: external_exports.number().int().min(0).default(4).describe(
17766
- 'Maximum number of command suggestions shown in a single numbered-options block, before the "Proceed as-is" escape. Lower for terser prompts, raise if you regularly want broader fan-out.'
17767
- ),
17768
17900
  blocklist: external_exports.array(external_exports.string()).default([]).describe(
17769
17901
  'Slash-command names that should never be suggested, one per line (e.g. "commit", "create-pr"). Useful if a command misfires on your common phrasing.'
17770
17902
  )
@@ -17776,17 +17908,8 @@ var settingsSchema = external_exports.object({
17776
17908
  detail_level: external_exports.enum(["min", "med", "max"]).default("min").describe(
17777
17909
  "Verbosity tier for the generated PR description body. min (default) = title + 2-3 sentence what/why/impact + linked ticket (token-frugal); med = min + grouped changes + tests note; max = med + how-to-test + edge cases + reviewer guidance. Critical info (breaking changes, migrations, security, rollback) is ALWAYS included at every tier \u2014 the tier governs explanatory depth, never whether a critical callout appears."
17778
17910
  ),
17779
- api_examples: external_exports.boolean().default(true).describe(
17780
- "JSON request/response examples for API-endpoint changes. true (default) = include a fenced example ONLY when grounded in a real source (response DTO/resource, OpenAPI/schema, test fixture, or an actual probe); no grounded source \u2192 a one-line pointer, never an invented example. false = never add API examples."
17781
- ),
17782
17911
  screenshots: external_exports.boolean().default(false).describe(
17783
17912
  "Screenshots for frontend changes. false (default) = never attempt. true = attempt when the host has browser/preview tooling and the diff touches a frontend surface; capability-gated (emits a one-line note and leaves the placeholder when tooling is absent, never fails or blocks the PR). Before/after + changed-region highlighting is best-effort."
17784
- ),
17785
- ui_paths: external_exports.array(external_exports.string()).default([]).describe(
17786
- 'Optional glob list that makes frontend detection explicit instead of heuristic (e.g. ["resources/views/**", "src/pages/**"]). Empty (default) = a light path/extension heuristic that fails open (no false enrichment when the surface is ambiguous).'
17787
- ),
17788
- api_paths: external_exports.array(external_exports.string()).default([]).describe(
17789
- 'Optional glob list that makes API-endpoint detection explicit instead of heuristic (e.g. ["app/Http/Controllers/Api/**", "src/pages/api/**"]). Empty (default) = a light path/extension heuristic that fails open.'
17790
17913
  )
17791
17914
  })
17792
17915
  }),
@@ -17799,12 +17922,6 @@ var settingsSchema = external_exports.object({
17799
17922
  )
17800
17923
  }),
17801
17924
  memory: external_exports.object({
17802
- cadence: memoryCadence.default("always").describe(
17803
- "Cadence of the \u{1F9E0} memory-visibility line after a memory-consulting step. always (default) = show whenever a memory type was asked; auto = show only when 3+ types were consulted (less noise); never = suppress. Distinct from rule_loading_tier \u2014 owns its own key since the 2026-06-01 untangle."
17804
- ),
17805
- review_threshold: external_exports.number().int().min(0).default(10).describe(
17806
- "Maximum number of memory entries /memory:load surfaces inline before falling back to a summary view. Default 10 keeps the chat readable. Raise to see more candidates, lower to keep the context tight."
17807
- ),
17808
17925
  redact_patterns: external_exports.array(external_exports.string()).default([]).describe(
17809
17926
  "Regex patterns (one per line) that scrub matches from chat-history transcripts and memory before they hit disk. Use for secrets, customer names, internal URLs. Patterns are anchored and case-insensitive."
17810
17927
  ),
@@ -17822,38 +17939,13 @@ var settingsSchema = external_exports.object({
17822
17939
  ),
17823
17940
  allowed_tiers: external_exports.array(external_exports.string()).default(["public"]).describe(
17824
17941
  "Origin tiers auto-eligible to cross a project boundary. proprietary is manual-only regardless (the gate hard-codes it), so an in-house schema never auto-shares."
17825
- ),
17826
- redaction: external_exports.object({
17827
- enabled: external_exports.boolean().default(true).describe(
17828
- "Run the privacy-floor + source-confidentiality scan before any card goes global."
17829
- ),
17830
- halt_on_trigger: external_exports.boolean().default(true).describe(
17831
- "Halt-and-surface on a confidential-pattern hit; never silent-share, never auto-rewrite."
17832
- )
17833
- }).default({}),
17834
- auto_promote_threshold: external_exports.number().int().min(1).default(2).describe(
17835
- "Distinct-repo count at which a public/vendor card triggers a promotion suggestion (never a silent write)."
17836
- ),
17837
- freshness: external_exports.object({
17838
- hypothesis_after_days: external_exports.number().int().min(0).default(90).describe(
17839
- "A global card older than this is lead-only (positive structure must be re-confirmed before use)."
17840
- ),
17841
- stale_after_days: external_exports.number().int().min(0).default(180).describe(
17842
- "A global card older than this is skipped until re-verified."
17843
- )
17844
- }).default({})
17942
+ )
17845
17943
  }).default({})
17846
17944
  }).default({}),
17847
17945
  hooks: external_exports.object({
17848
17946
  concern_budget: external_exports.object({
17849
- max_per_event: external_exports.number().int().min(1).default(8).describe(
17850
- "Maximum number of concerns (issues / warnings) a single hook may raise per (platform, event) pair before the hook is rate-limited. Default 8 prevents noisy hooks from drowning out high-signal ones."
17851
- ),
17852
17947
  tier1_concerns: external_exports.array(external_exports.string()).default([]).describe(
17853
17948
  "Concern IDs (one per line) that are allowed to block the run on failure rather than warn. Reserved for high-confidence guards \u2014 leave empty unless you maintain custom hooks."
17854
- ),
17855
- hard_fail: external_exports.boolean().default(false).describe(
17856
- "When a hook exceeds hooks.concern_budget.max_per_event, fail the run (true) instead of warning and continuing (false, default). Turn on in CI when you want hook quality to gate merges."
17857
17949
  )
17858
17950
  }),
17859
17951
  verify_before_complete: external_exports.object({
@@ -17906,12 +17998,9 @@ var settingsSchema = external_exports.object({
17906
17998
  // fires is decided by each detector's own trigger conditions, not by a
17907
17999
  // flag. A leftover `hooks.turn_end_gate.*` block from an older install
17908
18000
  // warns once on stderr and is ignored — see REMOVED_KEYS in
17909
- // `src/scripts/_lib/agent_settings.ts`.
18001
+ // `src/scripts/_lib/settings_removed_keys.ts`.
17910
18002
  }),
17911
18003
  decision_engine: external_exports.object({
17912
- surface_traces: external_exports.boolean().default(false).describe(
17913
- "Emit DecisionTraceHook events that surface why the agent picked one option over another. Useful when debugging unexpected choices; off by default to keep chat noise low."
17914
- ),
17915
18004
  min_confidence: confidenceBand.default("off").describe(
17916
18005
  "During Phase=Plan, refuse to advance to Phase=Implement if confidence is below this band. off (default) = no gate. low / medium / high = raise the floor; on miss, decision_engine.on_block decides what happens."
17917
18006
  ),
@@ -17925,10 +18014,7 @@ var settingsSchema = external_exports.object({
17925
18014
  "What the decision engine does when a gate (min_confidence / block_on_risk / require_memory_hits) fires. stop (default) = halt and surface the reason. ask = present numbered options. warn = log and continue."
17926
18015
  ),
17927
18016
  ask_timeout_seconds: external_exports.number().int().min(0).default(30).describe(
17928
- "Non-TTY timeout (seconds) for decision_engine.on_block = ask. After this elapses without input, decision_engine.on_block_fallback takes over. Default 30s; raise for slow human review, 0 = wait forever."
17929
- ),
17930
- on_block_fallback: onBlockFallback.default("stop").describe(
17931
- "Resolution when decision_engine.on_block = ask times out (see decision_engine.ask_timeout_seconds). stop (default) = halt the run. warn = log and continue with the agent's best guess."
18017
+ "Non-TTY timeout (seconds) for decision_engine.on_block = ask. After this elapses without input, the engine stops (fail-safe). Default 30s; raise for slow human review, 0 = wait forever."
17932
18018
  )
17933
18019
  }),
17934
18020
  update_check: external_exports.object({
@@ -17936,11 +18022,6 @@ var settingsSchema = external_exports.object({
17936
18022
  "Once per day the agent checks the npm registry for a newer agent-config release and surfaces a one-line banner if one exists. Turn off in air-gapped environments or to silence the banner."
17937
18023
  )
17938
18024
  }),
17939
- explain: external_exports.object({
17940
- enable_last: external_exports.boolean().default(true).describe(
17941
- "Enable the `agent-config explain last` command, which prints the reasoning behind the agent's most recent decision (last tool call, last suggestion). Disable if you never use it and want a smaller CLI surface."
17942
- )
17943
- }),
17944
18025
  legal_review_prep: external_exports.object({
17945
18026
  acknowledged: external_exports.boolean().default(false).describe(
17946
18027
  "I understand the legal-review-prep pack provides templates and general information ONLY \u2014 it is NOT legal advice, creates no attorney-client relationship, and never replaces a licensed lawyer. Individual cases require an attorney. The pack stays inactive until this is checked."
@@ -19236,8 +19317,8 @@ var zodToJsonSchema = (schema, options) => {
19236
19317
  };
19237
19318
 
19238
19319
  // src/scripts/_lib/module_detection.ts
19239
- import * as fs29 from "node:fs";
19240
- import * as path29 from "node:path";
19320
+ import * as fs30 from "node:fs";
19321
+ import * as path30 from "node:path";
19241
19322
  var _SKIP_DIRS = /* @__PURE__ */ new Set([".module-template", ".example"]);
19242
19323
  var _RULES = [
19243
19324
  ["app/Modules", "laravel-hmvc", "App\\Modules\\{ModuleName}"],
@@ -19251,14 +19332,14 @@ var _RULES = [
19251
19332
  ];
19252
19333
  function _isDir2(p) {
19253
19334
  try {
19254
- return fs29.statSync(p).isDirectory();
19335
+ return fs30.statSync(p).isDirectory();
19255
19336
  } catch {
19256
19337
  return false;
19257
19338
  }
19258
19339
  }
19259
19340
  function _isFile2(p) {
19260
19341
  try {
19261
- return fs29.statSync(p).isFile();
19342
+ return fs30.statSync(p).isFile();
19262
19343
  } catch {
19263
19344
  return false;
19264
19345
  }
@@ -19272,13 +19353,13 @@ function _isUpperChar(ch) {
19272
19353
  function _list_module_subdirs(root) {
19273
19354
  let entries;
19274
19355
  try {
19275
- entries = fs29.readdirSync(root).sort();
19356
+ entries = fs30.readdirSync(root).sort();
19276
19357
  } catch {
19277
19358
  return [];
19278
19359
  }
19279
19360
  const out = [];
19280
19361
  for (const name of entries) {
19281
- if (!_isDir2(path29.join(root, name))) {
19362
+ if (!_isDir2(path30.join(root, name))) {
19282
19363
  continue;
19283
19364
  }
19284
19365
  if (name.startsWith(".")) {
@@ -19300,11 +19381,11 @@ function _score_confidence(stack, root, subdirs) {
19300
19381
  return capitalized.length > 0 ? "high" : "medium";
19301
19382
  }
19302
19383
  if (stack === "node-monorepo") {
19303
- const withPkgJson = subdirs.filter((name) => _isFile2(path29.join(root, name, "package.json")));
19384
+ const withPkgJson = subdirs.filter((name) => _isFile2(path30.join(root, name, "package.json")));
19304
19385
  return withPkgJson.length > 0 ? "high" : "medium";
19305
19386
  }
19306
19387
  if (stack === "python-src") {
19307
- const withInit = subdirs.filter((name) => _isFile2(path29.join(root, name, "__init__.py")));
19388
+ const withInit = subdirs.filter((name) => _isFile2(path30.join(root, name, "__init__.py")));
19308
19389
  return withInit.length > 0 ? "high" : "medium";
19309
19390
  }
19310
19391
  if (stack === "go-internal") {
@@ -19316,7 +19397,7 @@ function detect_module_roots(project_root) {
19316
19397
  const high = [];
19317
19398
  const medium = [];
19318
19399
  for (const [rel_path, stack, namespace_template] of _RULES) {
19319
- const abs_path = path29.join(project_root, rel_path);
19400
+ const abs_path = path30.join(project_root, rel_path);
19320
19401
  if (!_isDir2(abs_path)) {
19321
19402
  continue;
19322
19403
  }
@@ -19338,7 +19419,7 @@ function detect_module_roots(project_root) {
19338
19419
  }
19339
19420
 
19340
19421
  // src/scripts/_lib/model_tier.ts
19341
- import fs30 from "node:fs";
19422
+ import fs31 from "node:fs";
19342
19423
  var TIER_TO_CLAUDE_MODEL = {
19343
19424
  frontier: "fable",
19344
19425
  high: "opus",
@@ -19347,8 +19428,8 @@ var TIER_TO_CLAUDE_MODEL = {
19347
19428
  };
19348
19429
  var MODEL_TIER_RE = /^model_tier:\s*"?([a-z]+)"?\s*$/m;
19349
19430
  function read_model_tier(skill_md) {
19350
- if (!fs30.existsSync(skill_md)) return null;
19351
- const text = fs30.readFileSync(skill_md).toString("utf-8");
19431
+ if (!fs31.existsSync(skill_md)) return null;
19432
+ const text = fs31.readFileSync(skill_md).toString("utf-8");
19352
19433
  if (!text.startsWith("---\n")) return null;
19353
19434
  const end = text.indexOf("\n---\n", 4);
19354
19435
  if (end === -1) return null;
@@ -19368,39 +19449,7 @@ import { spawnSync } from "node:child_process";
19368
19449
  import * as fs32 from "node:fs";
19369
19450
  import * as path31 from "node:path";
19370
19451
  import process3 from "node:process";
19371
- import { fileURLToPath as fileURLToPath8, pathToFileURL } from "node:url";
19372
-
19373
- // src/scripts/_lib/package_root.ts
19374
- import * as fs31 from "node:fs";
19375
- import * as path30 from "node:path";
19376
- import { fileURLToPath as fileURLToPath7 } from "node:url";
19377
- var PACKAGE_NAME = "@event4u/agent-config";
19378
- var MAX_ASCENT = 16;
19379
- function resolvePackageRoot(fromUrlOrPath, legacyHops = 3) {
19380
- const start = fromUrlOrPath.startsWith("file:") ? fileURLToPath7(fromUrlOrPath) : fromUrlOrPath;
19381
- const startDir = path30.dirname(start);
19382
- let dir = startDir;
19383
- for (let i = 0; i < MAX_ASCENT; i++) {
19384
- const manifest = path30.join(dir, "package.json");
19385
- if (fs31.existsSync(manifest)) {
19386
- try {
19387
- const parsed = JSON.parse(fs31.readFileSync(manifest, "utf8"));
19388
- if (parsed.name === PACKAGE_NAME) {
19389
- return dir;
19390
- }
19391
- } catch {
19392
- }
19393
- }
19394
- const parent = path30.dirname(dir);
19395
- if (parent === dir) {
19396
- break;
19397
- }
19398
- dir = parent;
19399
- }
19400
- return path30.resolve(startDir, ...Array.from({ length: legacyHops }, () => ".."));
19401
- }
19402
-
19403
- // src/scripts/_cli/cmd_migrate.ts
19452
+ import { fileURLToPath as fileURLToPath7, pathToFileURL } from "node:url";
19404
19453
  var PACKAGE_NAME_NPM = "@event4u/agent-config";
19405
19454
  var PACKAGE_NAME_COMPOSER = "event4u/agent-config";
19406
19455
  var LEGACY_DIRS = ["vendor", "node_modules"];
@@ -19418,7 +19467,7 @@ var LEGACY_SETTINGS_FILES = [".agent-settings.yml", ".agent-user.yml"];
19418
19467
  var LEGACY_STATE_FILENAME = ".implement-ticket-state.json";
19419
19468
  var LEGACY_STATE_V1_FILENAME = ".work-state.json";
19420
19469
  var LEGACY_AGENT_CONFIG_SHELL = "agent-config";
19421
- var _HERE_DIR = path31.dirname(fileURLToPath8(import.meta.url));
19470
+ var _HERE_DIR = path31.dirname(fileURLToPath7(import.meta.url));
19422
19471
  var ArgparseExit = class extends Error {
19423
19472
  code;
19424
19473
  constructor(code) {
@@ -20070,7 +20119,7 @@ function main(argv = null, options = {}) {
20070
20119
  return _apply(project, out, err);
20071
20120
  }
20072
20121
  var _inForeignBundle = !(typeof __AGENT_CONFIG_CLI_DELEGATE__ !== "undefined" && __AGENT_CONFIG_CLI_DELEGATE__);
20073
- var _HERE3 = fileURLToPath8(import.meta.url);
20122
+ var _HERE3 = fileURLToPath7(import.meta.url);
20074
20123
  function _isCliEntry() {
20075
20124
  if (process3.argv[1] === void 0) {
20076
20125
  return false;
@@ -20085,7 +20134,7 @@ function _isCliEntry() {
20085
20134
  return true;
20086
20135
  }
20087
20136
  try {
20088
- const here = fs32.realpathSync(fileURLToPath8(import.meta.url));
20137
+ const here = fs32.realpathSync(fileURLToPath7(import.meta.url));
20089
20138
  const argv = fs32.realpathSync(path31.resolve(process3.argv[1]));
20090
20139
  return here === argv;
20091
20140
  } catch {
@@ -20129,7 +20178,7 @@ var SCOPE_DETECT_AI_DIRS = [
20129
20178
  ];
20130
20179
 
20131
20180
  // src/install/paths.ts
20132
- import { homedir as homedir13, tmpdir } from "node:os";
20181
+ import { homedir as homedir14, tmpdir } from "node:os";
20133
20182
  import { join as join33 } from "node:path";
20134
20183
  var INSTALL_ROOT_SUBPATH = ".event4u/agent-config";
20135
20184
  var INSTALL_LOG_FILENAME = "install-log.jsonl";
@@ -20137,7 +20186,7 @@ function resolveHome(home) {
20137
20186
  if (home && home.length > 0) {
20138
20187
  return home;
20139
20188
  }
20140
- const fromOs = homedir13();
20189
+ const fromOs = homedir14();
20141
20190
  if (!fromOs) {
20142
20191
  throw new Error(
20143
20192
  "Cannot resolve home directory \u2014 both $HOME (POSIX) and $USERPROFILE (Windows) are unset."
@@ -20226,7 +20275,7 @@ function tryParseEntry(line) {
20226
20275
  }
20227
20276
 
20228
20277
  // src/scripts/install.ts
20229
- var _HERE4 = fileURLToPath9(import.meta.url);
20278
+ var _HERE4 = fileURLToPath8(import.meta.url);
20230
20279
  var SystemExitError = class extends Error {
20231
20280
  constructor(code) {
20232
20281
  super(`system-exit-${code}`);
@@ -20242,9 +20291,9 @@ var ArgparseExit2 = class extends Error {
20242
20291
  code;
20243
20292
  };
20244
20293
  function expanduser8(p) {
20245
- if (p === "~") return os11.homedir();
20294
+ if (p === "~") return os12.homedir();
20246
20295
  if (p.startsWith("~/") || p.startsWith("~\\")) {
20247
- return path32.join(os11.homedir(), p.slice(2));
20296
+ return path32.join(os12.homedir(), p.slice(2));
20248
20297
  }
20249
20298
  return p;
20250
20299
  }
@@ -20375,15 +20424,10 @@ var LEGACY_RENAME_MAP = {
20375
20424
  open_edited_files: "personal.open_edited_files",
20376
20425
  user_name: "personal.user_name",
20377
20426
  rtk_installed: "personal.rtk_installed",
20378
- minimal_output: "personal.minimal_output",
20379
- play_by_play: "personal.play_by_play",
20380
- pr_comment_bot_icon: "project.pr_comment_bot_icon",
20381
- pr_template: "project.pr_template",
20382
20427
  upstream_repo: "project.upstream_repo",
20383
20428
  improvement_pr_branch_prefix: "project.improvement_pr_branch_prefix",
20384
20429
  github_pr_reply_method: "github.pr_reply_method",
20385
20430
  eloquent_access_style: "eloquent.access_style",
20386
- skill_improvement_pipeline: "pipelines.skill_improvement",
20387
20431
  subagent_implementer_model: "subagents.implementer_model",
20388
20432
  subagent_judge_model: "subagents.judge_model",
20389
20433
  subagent_max_parallel: "subagents.max_parallel"
@@ -20780,7 +20824,7 @@ function ensure_augment_bridge(project_root, force) {
20780
20824
  ".augment/settings.json"
20781
20825
  );
20782
20826
  }
20783
- var AUGMENT_USER_DIR = path32.join(os11.homedir(), ".augment");
20827
+ var AUGMENT_USER_DIR = path32.join(os12.homedir(), ".augment");
20784
20828
  var AUGMENT_USER_HOOKS_DIR = path32.join(AUGMENT_USER_DIR, "hooks");
20785
20829
  var AUGMENT_DISPATCHER_TRAMPOLINE = "augment-dispatcher.sh";
20786
20830
  var AUGMENT_LEGACY_TRAMPOLINES = [
@@ -20883,7 +20927,7 @@ function ensure_cursor_bridge(project_root, force) {
20883
20927
  ".cursor/hooks.json"
20884
20928
  );
20885
20929
  }
20886
- var CURSOR_USER_DIR = path32.join(os11.homedir(), ".cursor");
20930
+ var CURSOR_USER_DIR = path32.join(os12.homedir(), ".cursor");
20887
20931
  var CURSOR_USER_HOOKS_DIR = path32.join(CURSOR_USER_DIR, "hooks");
20888
20932
  var CURSOR_DISPATCHER_TRAMPOLINE = "cursor-dispatcher.sh";
20889
20933
  function ensure_cursor_user_hooks(package_root, force) {
@@ -20967,7 +21011,7 @@ function ensure_cline_bridge(project_root, force) {
20967
21011
  skip(".clinerules/hooks/ already up to date");
20968
21012
  }
20969
21013
  }
20970
- var CLINE_USER_DIR = path32.join(os11.homedir(), "Documents", "Cline", "Hooks");
21014
+ var CLINE_USER_DIR = path32.join(os12.homedir(), "Documents", "Cline", "Hooks");
20971
21015
  var CLINE_DISPATCHER_TRAMPOLINE = "cline-dispatcher.sh";
20972
21016
  function ensure_cline_user_hooks(package_root, force) {
20973
21017
  const src = path32.join(package_root, "scripts", "hooks", CLINE_DISPATCHER_TRAMPOLINE);
@@ -21019,7 +21063,7 @@ function ensure_windsurf_bridge(project_root, force) {
21019
21063
  ".windsurf/hooks.json"
21020
21064
  );
21021
21065
  }
21022
- var WINDSURF_USER_DIR = path32.join(os11.homedir(), ".codeium", "windsurf");
21066
+ var WINDSURF_USER_DIR = path32.join(os12.homedir(), ".codeium", "windsurf");
21023
21067
  var WINDSURF_USER_HOOKS_DIR = path32.join(WINDSURF_USER_DIR, "hooks");
21024
21068
  var WINDSURF_DISPATCHER_TRAMPOLINE = "windsurf-dispatcher.sh";
21025
21069
  function ensure_windsurf_user_hooks(package_root, force) {
@@ -21075,7 +21119,7 @@ function ensure_gemini_bridge(project_root, force) {
21075
21119
  ".gemini/settings.json"
21076
21120
  );
21077
21121
  }
21078
- var GEMINI_USER_DIR = path32.join(os11.homedir(), ".gemini");
21122
+ var GEMINI_USER_DIR = path32.join(os12.homedir(), ".gemini");
21079
21123
  var GEMINI_USER_HOOKS_DIR = path32.join(GEMINI_USER_DIR, "hooks");
21080
21124
  var GEMINI_DISPATCHER_TRAMPOLINE = "gemini-dispatcher.sh";
21081
21125
  function ensure_gemini_user_hooks(package_root, force) {
@@ -21566,7 +21610,7 @@ To remove this marker, delete this file.
21566
21610
  `;
21567
21611
  }
21568
21612
  var _CLAUDE_DESKTOP_BUNDLES_SUBPATH = "claude-desktop/bundles";
21569
- var GLOBAL_ROOT = path32.join(os11.homedir(), ".event4u", "agent-config");
21613
+ var GLOBAL_ROOT = path32.join(os12.homedir(), ".event4u", "agent-config");
21570
21614
  var GLOBAL_USER_SETTINGS_PATH = path32.join(GLOBAL_ROOT, ".agent-user.yml");
21571
21615
  var GLOBAL_AGENT_SETTINGS_PATH = path32.join(GLOBAL_ROOT, ".agent-settings.yml");
21572
21616
  function _bridge_marker(tool_id, scope) {
@@ -21954,7 +21998,7 @@ function _run_migrate_to_global(project_root) {
21954
21998
  }
21955
21999
  }
21956
22000
  function _format_global_root_for_marker(global_root) {
21957
- const home = resolvePath(os11.homedir());
22001
+ const home = resolvePath(os12.homedir());
21958
22002
  const resolved = resolvePath(global_root);
21959
22003
  const rel = path32.relative(home, resolved);
21960
22004
  if (rel === "" || rel.startsWith("..") || path32.isAbsolute(rel)) {
@@ -22332,7 +22376,7 @@ function _deploy_global_content(tools, force, package_root, lockfile_path2) {
22332
22376
  warn(`claude-code: thinned rule layer not written \u2014 ${String(e)}`);
22333
22377
  }
22334
22378
  }
22335
- if (!state.QUIET) for (const l of installReceiptBudgetLines(package_root)) info(l);
22379
+ if (!state.QUIET) for (const l of installReceiptBudgetLines(package_root, void 0, { thisDeploy: /* @__PURE__ */ new Map([[anchor, current_files]]) })) info(l);
22336
22380
  }
22337
22381
  const missing_targets = _verify_deploy_targets(anchor, plan);
22338
22382
  if (missing_targets.length > 0) {
@@ -23238,7 +23282,7 @@ function _wizard_cli_dist(_project_root) {
23238
23282
  return pathExists(cli) ? cli : null;
23239
23283
  }
23240
23284
  function _server_info_path() {
23241
- return path32.join(os11.homedir(), ".event4u", "agent-config", "local-server.json");
23285
+ return path32.join(os12.homedir(), ".event4u", "agent-config", "local-server.json");
23242
23286
  }
23243
23287
  function _pid_is_agent_config(pid) {
23244
23288
  let res;
@@ -23334,7 +23378,7 @@ function _wizard_spawn(project_root, pass_project_root = true) {
23334
23378
  function _wizard_run_sync(cmd, env, cli) {
23335
23379
  const total = _WIZARD_TIMEOUTS.reduce((a, b) => a + b, 0);
23336
23380
  const log_path = path32.join(
23337
- os11.tmpdir(),
23381
+ os12.tmpdir(),
23338
23382
  `agent-config-wizard-${process4.pid}-${Date.now()}.log`
23339
23383
  );
23340
23384
  let child;
@@ -23697,17 +23741,7 @@ function _read_consumer_auto_switch(project_root) {
23697
23741
  }
23698
23742
  return "suggest";
23699
23743
  }
23700
- function _team_setup_hint_line(project_root) {
23701
- let data;
23702
- try {
23703
- data = load_agent_settings({ project_path: _resolve_settings_read(project_root) });
23704
- } catch {
23705
- data = {};
23706
- }
23707
- const ai_team = isPlainObject(data) ? data["ai_team"] : null;
23708
- const flag = isPlainObject(ai_team) ? ai_team["suppress_setup_hint"] : null;
23709
- const suppressed = flag === true || typeof flag === "string" && ["true", "yes", "on", "1"].includes(flag.trim().toLowerCase());
23710
- if (suppressed) return null;
23744
+ function _team_setup_hint_line() {
23711
23745
  return " \u2022 Claude Code team mode (optional cross-model review via the official codex plugin): run `agent-config doctor --check team` for setup status.";
23712
23746
  }
23713
23747
  function finalize_claude_model_tiers(project_root) {
@@ -23888,11 +23922,8 @@ function _main_project_install(opts, project_root, parsed_tools, is_first_run) {
23888
23922
  }
23889
23923
  printResiduals(tools, state.QUIET);
23890
23924
  if (_is_tool_enabled(tools, "claude-code")) {
23891
- const team_hint = _team_setup_hint_line(project_root);
23892
- if (team_hint !== null) {
23893
- process4.stdout.write(team_hint + "\n");
23894
- process4.stdout.write("\n");
23895
- }
23925
+ process4.stdout.write(_team_setup_hint_line() + "\n");
23926
+ process4.stdout.write("\n");
23896
23927
  }
23897
23928
  }
23898
23929
  _propose_modules_config(project_root, is_first_run);