@event4u/agent-config 9.14.0 → 9.16.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 (287) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +118 -99
  3. package/README.md +8 -0
  4. package/dist/agent-src/commands/agents/audit.md +7 -7
  5. package/dist/agent-src/commands/agents/optimize.md +1 -1
  6. package/dist/agent-src/commands/analyze/reference-repo.md +1 -1
  7. package/dist/agent-src/commands/chat-history.md +1 -0
  8. package/dist/agent-src/commands/context.md +1 -0
  9. package/dist/agent-src/commands/council.md +1 -1
  10. package/dist/agent-src/commands/ghostwriter.md +1 -1
  11. package/dist/agent-src/commands/memory.md +2 -1
  12. package/dist/agent-src/commands/module.md +1 -0
  13. package/dist/agent-src/commands/optimize/agents-dir.md +1 -1
  14. package/dist/agent-src/commands/optimize/deep.md +5 -2
  15. package/dist/agent-src/commands/optimize/skills.md +5 -5
  16. package/dist/agent-src/commands/override.md +1 -0
  17. package/dist/agent-src/commands/prediction-pool.md +4 -4
  18. package/dist/agent-src/commands/research/deep.md +1 -1
  19. package/dist/agent-src/commands/roadmap.md +2 -1
  20. package/dist/agent-src/commands/rule-compliance-audit.md +1 -1
  21. package/dist/agent-src/commands/tdd.md +1 -0
  22. package/dist/agent-src/commands/tests.md +1 -0
  23. package/dist/agent-src/commands/upstream-contribute.md +5 -5
  24. package/dist/agent-src/commands/video/from-script.md +1 -1
  25. package/dist/agent-src/commands/video/from-song.md +1 -1
  26. package/dist/agent-src/commands/video/scene.md +1 -1
  27. package/dist/agent-src/commands/video/stitch.md +1 -1
  28. package/dist/agent-src/commands/video/storyboard.md +1 -1
  29. package/dist/agent-src/commands/worktree/create.md +2 -1
  30. package/dist/agent-src/contexts/augment-infrastructure.md +1 -1
  31. package/dist/agent-src/contexts/contracts/artifact-engagement-flow.md +5 -5
  32. package/dist/agent-src/contexts/contracts/command-suggestion-flow.md +3 -3
  33. package/dist/agent-src/contexts/contracts/emergency-triage-block.md +2 -2
  34. package/dist/agent-src/contexts/execution/roadmap-process-loop.md +4 -3
  35. package/dist/agent-src/contexts/execution/subagent-routing.md +19 -0
  36. package/dist/agent-src/contexts/override-system.md +1 -1
  37. package/dist/agent-src/ghostwriter/fictional-fixture-v1.md +1 -1
  38. package/dist/agent-src/rules/augment-edit-discipline.md +1 -1
  39. package/dist/agent-src/rules/autonomous-execution.md +2 -1
  40. package/dist/agent-src/rules/brand-consistency.md +1 -0
  41. package/dist/agent-src/rules/brand-source-of-truth.md +1 -0
  42. package/dist/agent-src/rules/code-comment-discipline.md +2 -0
  43. package/dist/agent-src/rules/communication-through-line.md +1 -0
  44. package/dist/agent-src/rules/content-quoting-floor.md +1 -0
  45. package/dist/agent-src/rules/cross-source-consistency.md +0 -1
  46. package/dist/agent-src/rules/downstream-changes.md +1 -0
  47. package/dist/agent-src/rules/external-code-graph-interop.md +1 -0
  48. package/dist/agent-src/rules/external-reference-deep-dive.md +1 -0
  49. package/dist/agent-src/rules/fast-path-marker-visibility.md +1 -0
  50. package/dist/agent-src/rules/finance-safety-floor.md +0 -1
  51. package/dist/agent-src/rules/icon-consistency.md +1 -0
  52. package/dist/agent-src/rules/image-likeness-and-rights.md +1 -0
  53. package/dist/agent-src/rules/improve-before-implement.md +1 -1
  54. package/dist/agent-src/rules/invite-challenge.md +1 -0
  55. package/dist/agent-src/rules/lethal-trifecta-guard.md +1 -0
  56. package/dist/agent-src/rules/low-impact-corpus-privacy-floor.md +1 -0
  57. package/dist/agent-src/rules/markdown-safe-codeblocks.md +1 -0
  58. package/dist/agent-src/rules/media-governance-routing.md +4 -3
  59. package/dist/agent-src/rules/media-sync-ground-truth.md +1 -0
  60. package/dist/agent-src/rules/no-attribution-footers.md +1 -0
  61. package/dist/agent-src/rules/no-decorative-emojis-in-git-surfaces.md +1 -0
  62. package/dist/agent-src/rules/no-pr-progress-comments.md +1 -0
  63. package/dist/agent-src/rules/onboarding-gate.md +1 -0
  64. package/dist/agent-src/rules/output-discipline.md +1 -0
  65. package/dist/agent-src/rules/prefer-enums-over-literals.md +1 -0
  66. package/dist/agent-src/rules/preservation-guard.md +1 -0
  67. package/dist/agent-src/rules/question-not-instruction.md +1 -0
  68. package/dist/agent-src/rules/roadmap-ci-steps-policy.md +1 -0
  69. package/dist/agent-src/rules/role-mode-adherence.md +1 -0
  70. package/dist/agent-src/rules/runtime-safety.md +1 -0
  71. package/dist/agent-src/rules/security-sensitive-stop.md +1 -0
  72. package/dist/agent-src/rules/session-canary.md +9 -2
  73. package/dist/agent-src/rules/source-confidentiality.md +1 -0
  74. package/dist/agent-src/rules/source-of-truth.md +1 -0
  75. package/dist/agent-src/rules/spreadsheet-source-quality.md +1 -0
  76. package/dist/agent-src/rules/think-before-action.md +1 -0
  77. package/dist/agent-src/rules/token-budget-discipline.md +1 -0
  78. package/dist/agent-src/rules/token-efficiency.md +1 -0
  79. package/dist/agent-src/rules/token-optimizer-maintenance.md +5 -5
  80. package/dist/agent-src/rules/tool-safety.md +1 -0
  81. package/dist/agent-src/rules/untrusted-input-defense.md +2 -0
  82. package/dist/agent-src/rules/user-interaction.md +1 -0
  83. package/dist/agent-src/rules/user-interrupt-priority.md +1 -0
  84. package/dist/agent-src/skills/adr-create/SKILL.md +1 -1
  85. package/dist/agent-src/skills/check-refs/SKILL.md +1 -1
  86. package/dist/agent-src/skills/competitive-positioning/SKILL.md +1 -1
  87. package/dist/agent-src/skills/condense-memory/SKILL.md +1 -1
  88. package/dist/agent-src/skills/context-authoring/SKILL.md +1 -1
  89. package/dist/agent-src/skills/copilot-agents-optimization/SKILL.md +1 -1
  90. package/dist/agent-src/skills/description-assist/SKILL.md +1 -1
  91. package/dist/agent-src/skills/github-ci/SKILL.md +1 -0
  92. package/dist/agent-src/skills/guideline-writing/SKILL.md +1 -1
  93. package/dist/agent-src/skills/lint-skills/SKILL.md +1 -1
  94. package/dist/agent-src/skills/readme-reviewer/SKILL.md +1 -1
  95. package/dist/agent-src/skills/roadmap-management/SKILL.md +8 -1
  96. package/dist/agent-src/skills/roadmap-writing/SKILL.md +1 -1
  97. package/dist/agent-src/skills/skill-improvement-pipeline/SKILL.md +1 -1
  98. package/dist/agent-src/skills/skill-writing/SKILL.md +4 -4
  99. package/dist/agent-src/skills/token-optimizer/SKILL.md +4 -4
  100. package/dist/agent-src/skills/upstream-contribute/SKILL.md +6 -6
  101. package/dist/agent-src/skills/using-git-worktrees/SKILL.md +25 -0
  102. package/dist/agent-src/templates/AGENTS.md +1 -1
  103. package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
  104. package/dist/agent-src/templates/command.md +1 -1
  105. package/dist/agent-src/templates/copilot-instructions.md +3 -3
  106. package/dist/agent-src/templates/rule.md +2 -2
  107. package/dist/agent-src/templates/scripts/work_engine/orchestration.ts +1 -1
  108. package/dist/agent-src/templates/skill-archive-note.md +5 -5
  109. package/dist/agent-src/templates/skill.md +1 -1
  110. package/dist/cli/agent-config.js +66 -19
  111. package/dist/cli/agent-config.js.map +1 -1
  112. package/dist/cli/main.js +9 -4
  113. package/dist/cli/main.js.map +1 -1
  114. package/dist/cli/mcp/content.js +1 -1
  115. package/dist/cli/mcp/content.js.map +1 -1
  116. package/dist/cli/python/workspace_drive.js +2 -0
  117. package/dist/cli/python/workspace_drive.js.map +1 -1
  118. package/dist/cli/python/workspace_drive_health.js +2 -0
  119. package/dist/cli/python/workspace_drive_health.js.map +1 -1
  120. package/dist/cli/python/workspace_hosts.js +2 -0
  121. package/dist/cli/python/workspace_hosts.js.map +1 -1
  122. package/dist/cli/python/workspace_sessions.js +2 -0
  123. package/dist/cli/python/workspace_sessions.js.map +1 -1
  124. package/dist/cli/registry.js +1 -0
  125. package/dist/cli/registry.js.map +1 -1
  126. package/dist/cli-delegate/{chunk-A3HJ6NTI.js → chunk-63WSP6YZ.js} +2 -1
  127. package/dist/cli-delegate/{chunk-EJYIGZ3T.js → chunk-BKO2AZ7Z.js} +1 -1
  128. package/dist/cli-delegate/{chunk-GCVFLBP2.js → chunk-H574KOUH.js} +338 -494
  129. package/dist/cli-delegate/chunk-NXFWFAYV.js +339 -0
  130. package/dist/cli-delegate/{chunk-TEGJU2JX.js → chunk-ZXXJLL5K.js} +2 -2
  131. package/dist/cli-delegate/cmd_conformance.js +29 -23
  132. package/dist/cli-delegate/cmd_doctor.js +3 -3
  133. package/dist/cli-delegate/cmd_export.js +4 -4
  134. package/dist/cli-delegate/cmd_preflight.js +2 -2
  135. package/dist/cli-delegate/cmd_prune.js +4 -4
  136. package/dist/cli-delegate/cmd_settings_migrate.js +4 -4
  137. package/dist/cli-delegate/cmd_sync.js +4 -4
  138. package/dist/cli-delegate/cmd_uninstall.js +4 -4
  139. package/dist/cli-delegate/cmd_validate.js +4 -4
  140. package/dist/discovery/deprecation-report.md +1 -1
  141. package/dist/discovery/discovery-manifest.json +127 -95
  142. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  143. package/dist/discovery/discovery-manifest.summary.md +1 -1
  144. package/dist/discovery/orphan-report.md +1 -1
  145. package/dist/discovery/packs.json +2 -2
  146. package/dist/discovery/trust-report.md +1 -1
  147. package/dist/discovery/workspaces.json +2 -2
  148. package/dist/hooks/dispatch.js +729 -430
  149. package/dist/install/install.mjs +52 -11
  150. package/dist/install/rule_scope.js +18 -2
  151. package/dist/install/rule_scope.js.map +1 -1
  152. package/dist/mcp/registry-manifest.json +2 -2
  153. package/dist/mcp/server.json +2 -2
  154. package/dist/mcp/server.mjs +518 -411
  155. package/dist/router.json +1 -1
  156. package/dist/scripts/_lib/claude_settings_hooks.js +30 -5
  157. package/dist/scripts/_lib/claude_settings_hooks.js.map +1 -1
  158. package/dist/scripts/_lib/scoped_projection.js +223 -0
  159. package/dist/scripts/_lib/scoped_projection.js.map +1 -0
  160. package/dist/scripts/_lib/surface_tiers.js +125 -0
  161. package/dist/scripts/_lib/surface_tiers.js.map +1 -0
  162. package/dist/scripts/_lib/token_count.js +166 -0
  163. package/dist/scripts/_lib/token_count.js.map +1 -0
  164. package/dist/scripts/_lib/trigger_eval_floors.js +8 -0
  165. package/dist/scripts/_lib/trigger_eval_floors.js.map +1 -1
  166. package/dist/scripts/condense.js +139 -9
  167. package/dist/scripts/condense.js.map +1 -1
  168. package/dist/scripts/project_thin_rules.js +450 -0
  169. package/dist/scripts/project_thin_rules.js.map +1 -0
  170. package/dist/server/routes/workspace.js +3 -1
  171. package/dist/server/routes/workspace.js.map +1 -1
  172. package/dist/server/schemas/settings.js +9 -3
  173. package/dist/server/schemas/settings.js.map +1 -1
  174. package/dist/shared/userMd/utils.js +1 -1
  175. package/dist/shared/userMd/utils.js.map +1 -1
  176. package/dist/ui/assets/index-DmR0mbk4.js +26 -0
  177. package/dist/ui/assets/index-DmR0mbk4.js.map +1 -0
  178. package/dist/ui/index.html +1 -1
  179. package/docs/guidelines/agent-infra/roadmap-progress-mechanics.md +1 -1
  180. package/package.json +14 -14
  181. package/src/agent-src/templates/AGENTS.md +1 -1
  182. package/src/agent-src/templates/scripts/work_engine/orchestration.ts +1 -1
  183. package/src/config/agent-settings.template.yml +61 -11
  184. package/src/config/budget-routing.json +7 -0
  185. package/src/config/ci-local-parity.yml +8 -0
  186. package/src/config/discovery/unassigned-artefacts.yml +23 -25
  187. package/src/config/evaluator-budgets.json +35 -5
  188. package/src/config/gate-coverage.yml +147 -0
  189. package/src/config/gate-violation-baselines.json +25 -0
  190. package/src/install/rule_scope.ts +27 -2
  191. package/src/scripts/_cli/cmd_conformance.ts +13 -24
  192. package/src/scripts/_dispatch.bash +10 -0
  193. package/src/scripts/_lib/claude_settings_hooks.ts +30 -4
  194. package/src/scripts/_lib/gate_baseline.ts +213 -0
  195. package/src/scripts/_lib/scoped_projection.ts +50 -0
  196. package/src/scripts/_lib/tier_budget_routing.ts +360 -0
  197. package/src/scripts/_lib/tool_adapter_registry.ts +8 -1
  198. package/src/scripts/_lib/trigger_eval_floors.ts +9 -0
  199. package/src/scripts/_lib/trigger_routers.ts +17 -5
  200. package/src/scripts/adr/regenerate_index.ts +4 -3
  201. package/src/scripts/ai-video/lib/parse-blueprint.sh +1 -1
  202. package/src/scripts/ai_council/compile_corpus.ts +1 -1
  203. package/src/scripts/anchor_scoring_run.ts +1 -1
  204. package/src/scripts/audit_cloud_compatibility.ts +37 -2
  205. package/src/scripts/audit_initial_context.ts +53 -19
  206. package/src/scripts/audit_likelihood.ts +31 -2
  207. package/src/scripts/audit_user_type_axis.ts +58 -11
  208. package/src/scripts/bench_hook_latency.ts +172 -41
  209. package/src/scripts/bench_persona_placebo.ts +1 -1
  210. package/src/scripts/bench_quality_run.ts +1 -1
  211. package/src/scripts/build_mcp_catalog.ts +12 -1
  212. package/src/scripts/check_always_budget.ts +122 -11
  213. package/src/scripts/check_augment_description_cap.ts +24 -3
  214. package/src/scripts/check_ci_strict_superset.ts +150 -0
  215. package/src/scripts/check_cli_registry_budget_sync.ts +168 -0
  216. package/src/scripts/check_cluster_patterns.ts +100 -0
  217. package/src/scripts/check_consumer_scope_flip.ts +26 -4
  218. package/src/scripts/check_evaluator_budgets.ts +198 -19
  219. package/src/scripts/check_gate_coverage.ts +338 -2
  220. package/src/scripts/check_generator_output_coverage.ts +2 -1
  221. package/src/scripts/check_iron_law_prominence.ts +1 -1
  222. package/src/scripts/check_kernel_rule_bundle.ts +1 -1
  223. package/src/scripts/check_no_new_legacy_path.ts +167 -3
  224. package/src/scripts/check_pack_size.ts +18 -4
  225. package/src/scripts/check_portability.ts +37 -7
  226. package/src/scripts/check_references.ts +19 -3
  227. package/src/scripts/check_release_pr_shape.ts +13 -0
  228. package/src/scripts/check_token_quality_golden.ts +1 -1
  229. package/src/scripts/check_token_regression.ts +9 -2
  230. package/src/scripts/condense.ts +155 -12
  231. package/src/scripts/cost/budget.mjs +77 -2
  232. package/src/scripts/evaluator_umbrella.sh +34 -1
  233. package/src/scripts/generate_capability_matrix.ts +8 -0
  234. package/src/scripts/generate_router_coverage_from_matrix.ts +155 -0
  235. package/src/scripts/hook_manifest.yaml +17 -3
  236. package/src/scripts/hooks/block_config_weakening.ts +337 -0
  237. package/src/scripts/hooks/concern_registry.ts +2 -0
  238. package/src/scripts/hooks/probe_throttle.ts +75 -0
  239. package/src/scripts/install-hooks.sh +24 -2
  240. package/src/scripts/install.ts +2 -2
  241. package/src/scripts/lint_agents_md.ts +9 -3
  242. package/src/scripts/lint_archived_skills.ts +1 -1
  243. package/src/scripts/lint_artefact_frontmatter.ts +185 -37
  244. package/src/scripts/lint_command_routing.ts +21 -52
  245. package/src/scripts/lint_command_verbs.ts +47 -28
  246. package/src/scripts/lint_context_spine_usage.ts +38 -12
  247. package/src/scripts/lint_framework_leakage.ts +25 -6
  248. package/src/scripts/lint_handoffs.ts +49 -2
  249. package/src/scripts/lint_media_policy_linkage.ts +62 -30
  250. package/src/scripts/lint_namespace.ts +92 -7
  251. package/src/scripts/lint_new_skill_gate.ts +39 -31
  252. package/src/scripts/lint_originality_shingles.ts +7 -1
  253. package/src/scripts/lint_override_kernel_guard.ts +21 -3
  254. package/src/scripts/lint_pack_boundaries.ts +461 -91
  255. package/src/scripts/lint_pack_dependencies.ts +24 -57
  256. package/src/scripts/lint_persona_governance.ts +1 -1
  257. package/src/scripts/lint_role_experiences.ts +34 -5
  258. package/src/scripts/lint_trigger_precision.ts +142 -0
  259. package/src/scripts/mcp_server/consumer_tool_catalog.json +12 -201
  260. package/src/scripts/mcp_server/tools.ts +1 -1
  261. package/src/scripts/prepack-check.mjs +40 -1
  262. package/src/scripts/prepack_router_targets.d.mts +7 -0
  263. package/src/scripts/prepack_router_targets.mjs +93 -0
  264. package/src/scripts/print_required_checks.ts +72 -18
  265. package/src/scripts/profile_staleness_hook.ts +12 -0
  266. package/src/scripts/record_evaluator_measurements.mjs +105 -0
  267. package/src/scripts/recruit_preflight.sh +1 -1
  268. package/src/scripts/release.ts +214 -7
  269. package/src/scripts/router_target_paths.d.mts +4 -0
  270. package/src/scripts/router_target_paths.mjs +69 -0
  271. package/src/scripts/router_telemetry.ts +52 -1
  272. package/src/scripts/routing_doctor.ts +560 -0
  273. package/src/scripts/rule_trigger_eval.ts +403 -0
  274. package/src/scripts/schemas/rule.schema.json +5 -1
  275. package/src/scripts/session_canary_hook.ts +96 -5
  276. package/src/scripts/skill_linter.ts +9 -28
  277. package/src/scripts/smoke/skills.sh +1 -1
  278. package/src/scripts/sweep_dead_scan_roots.ts +356 -10
  279. package/src/scripts/trigger_coverage.ts +13 -2
  280. package/src/scripts/update_counts.ts +1 -1
  281. package/src/scripts/validate_telegraph_carveouts.ts +1 -1
  282. package/src/scripts/wrapper_freshness_hook.ts +14 -0
  283. package/src/server/schemas/settings.ts +19 -5
  284. package/src/shared/userMd/utils.ts +1 -1
  285. package/dist/cli-delegate/chunk-TJIAM5FW.js +0 -133
  286. package/dist/ui/assets/index-BpSQt5vm.js +0 -40
  287. package/dist/ui/assets/index-BpSQt5vm.js.map +0 -1
@@ -0,0 +1,339 @@
1
+ import { createRequire as __acCreateRequire } from 'node:module'; const require = globalThis.require ?? __acCreateRequire(import.meta.url);
2
+ import {
3
+ require_dist
4
+ } from "./chunk-OY53J6II.js";
5
+ import {
6
+ __toESM
7
+ } from "./chunk-J55WI3RR.js";
8
+
9
+ // src/install/rule_scope.ts
10
+ import * as fs4 from "node:fs";
11
+ import * as path3 from "node:path";
12
+
13
+ // src/scripts/_lib/scoped_projection.ts
14
+ import * as fs2 from "node:fs";
15
+ import { createRequire } from "node:module";
16
+ import * as path2 from "node:path";
17
+
18
+ // src/scripts/_lib/surface_tiers.ts
19
+ import * as fs from "node:fs";
20
+ import * as path from "node:path";
21
+ var _LAB_FALLBACK = /* @__PURE__ */ new Set(["ai-video", "ai-image", "fun"]);
22
+ function load_lab_pack_ids(repo_root) {
23
+ const vocab = path.join(repo_root, "src", "config", "discovery", "packs.yml");
24
+ const ids = /* @__PURE__ */ new Set();
25
+ try {
26
+ const YAML2 = require_dist();
27
+ const data = YAML2.parse(fs.readFileSync(vocab, "utf-8"), { version: "1.1" });
28
+ for (const entry of data ?? []) {
29
+ if (entry && typeof entry === "object" && !Array.isArray(entry)) {
30
+ const rec = entry;
31
+ if (rec["surface_tier"] === "lab") {
32
+ const pid = rec["id"];
33
+ if (typeof pid === "string") {
34
+ ids.add(pid);
35
+ }
36
+ }
37
+ }
38
+ }
39
+ } catch {
40
+ return new Set(_LAB_FALLBACK);
41
+ }
42
+ return ids.size > 0 ? ids : new Set(_LAB_FALLBACK);
43
+ }
44
+ function frontmatter_packs(md_path) {
45
+ let text;
46
+ try {
47
+ text = fs.readFileSync(md_path, "utf-8");
48
+ } catch {
49
+ return /* @__PURE__ */ new Set();
50
+ }
51
+ if (!text.startsWith("---")) {
52
+ return /* @__PURE__ */ new Set();
53
+ }
54
+ const end = text.indexOf("\n---", 3);
55
+ const block = end !== -1 ? text.slice(3, end) : text.slice(3);
56
+ const packs = /* @__PURE__ */ new Set();
57
+ let in_packs_list = false;
58
+ for (const raw of block.split("\n")) {
59
+ const line = raw.replace(/\s+$/, "");
60
+ const stripped = line.trim();
61
+ if (in_packs_list) {
62
+ if (stripped.startsWith("- ")) {
63
+ packs.add(_strip_quotes(stripped.slice(2).trim()));
64
+ continue;
65
+ }
66
+ in_packs_list = false;
67
+ }
68
+ if (stripped.startsWith("pack:")) {
69
+ const val = _strip_quotes(stripped.split(":").slice(1).join(":").trim());
70
+ if (val) {
71
+ packs.add(val);
72
+ }
73
+ } else if (stripped.startsWith("packs:")) {
74
+ const inline = stripped.split(":").slice(1).join(":").trim();
75
+ if (inline.startsWith("[") && inline.endsWith("]")) {
76
+ for (const raw_item of inline.slice(1, -1).split(",")) {
77
+ const item = _strip_quotes(raw_item.trim());
78
+ if (item) {
79
+ packs.add(item);
80
+ }
81
+ }
82
+ } else {
83
+ in_packs_list = true;
84
+ }
85
+ }
86
+ }
87
+ return packs;
88
+ }
89
+ function is_lab_artefact(md_path, lab_ids) {
90
+ for (const p of frontmatter_packs(md_path)) {
91
+ if (lab_ids.has(p)) {
92
+ return true;
93
+ }
94
+ }
95
+ return false;
96
+ }
97
+ function _strip_quotes(s) {
98
+ let out = s;
99
+ while (out.length > 0 && (out[0] === "'" || out[0] === '"')) {
100
+ out = out.slice(1);
101
+ }
102
+ while (out.length > 0 && (out[out.length - 1] === "'" || out[out.length - 1] === '"')) {
103
+ out = out.slice(0, -1);
104
+ }
105
+ return out;
106
+ }
107
+
108
+ // src/scripts/_lib/scoped_projection.ts
109
+ var _require = createRequire(import.meta.url);
110
+ var SCOPED_ACTIVE_WORKSPACES = /* @__PURE__ */ new Set([
111
+ "engineering",
112
+ "agent-config-maintainer"
113
+ ]);
114
+ function isPlainObject(v) {
115
+ return typeof v === "object" && v !== null && !Array.isArray(v);
116
+ }
117
+ function yamlSafeLoad(text) {
118
+ let YAML2;
119
+ try {
120
+ YAML2 = _require("yaml");
121
+ } catch {
122
+ return null;
123
+ }
124
+ try {
125
+ return YAML2.parse(text, { version: "1.1" }) ?? null;
126
+ } catch {
127
+ return null;
128
+ }
129
+ }
130
+ var PACKS_YML_REL = path2.join("src", "config", "discovery", "packs.yml");
131
+ function load_packs_registry(package_root) {
132
+ const vocab_path = path2.join(package_root, PACKS_YML_REL);
133
+ const data = yamlSafeLoad(fs2.readFileSync(vocab_path, "utf-8"));
134
+ if (!Array.isArray(data)) {
135
+ throw new Error(`packs.yml did not parse to a list: ${vocab_path}`);
136
+ }
137
+ const out = [];
138
+ for (const entry of data) {
139
+ if (!isPlainObject(entry)) continue;
140
+ const id = entry["id"];
141
+ if (typeof id !== "string" || id === "") continue;
142
+ const workspaces_raw = entry["workspaces"];
143
+ const workspaces = Array.isArray(workspaces_raw) ? workspaces_raw.filter((w) => typeof w === "string") : [];
144
+ const requires_raw = entry["requires"] ?? entry["requires_hint"];
145
+ const requires = Array.isArray(requires_raw) ? requires_raw.filter((r) => typeof r === "string") : [];
146
+ out.push({ id, workspaces, requires });
147
+ }
148
+ return out;
149
+ }
150
+ function compute_active_pack_ids(packs, runtime_active_packs) {
151
+ const by_id = /* @__PURE__ */ new Map();
152
+ for (const p of packs) by_id.set(p.id, p);
153
+ const active = /* @__PURE__ */ new Set();
154
+ for (const p of packs) {
155
+ if (p.workspaces.some((w) => SCOPED_ACTIVE_WORKSPACES.has(w))) {
156
+ active.add(p.id);
157
+ }
158
+ }
159
+ for (const id of runtime_active_packs) {
160
+ active.add(id);
161
+ }
162
+ let frontier = [...active];
163
+ while (frontier.length > 0) {
164
+ const next = [];
165
+ for (const id of frontier) {
166
+ const rec = by_id.get(id);
167
+ if (rec === void 0) continue;
168
+ for (const dep of rec.requires) {
169
+ if (!active.has(dep)) {
170
+ active.add(dep);
171
+ next.push(dep);
172
+ }
173
+ }
174
+ }
175
+ frontier = next;
176
+ }
177
+ return active;
178
+ }
179
+ function is_pruned_under_scoped(md_path, active_ids) {
180
+ const packs = frontmatter_packs(md_path);
181
+ if (packs.size === 0) return false;
182
+ for (const id of packs) {
183
+ if (active_ids.has(id)) return false;
184
+ }
185
+ return true;
186
+ }
187
+ var RULE_PACKS_AUTO = "auto";
188
+ function resolve_rule_pack_scope(raw, package_root, runtime_active_packs = []) {
189
+ const is_auto = raw === RULE_PACKS_AUTO || Array.isArray(raw) && raw.length === 1 && raw[0] === RULE_PACKS_AUTO;
190
+ if (is_auto) {
191
+ try {
192
+ return [
193
+ ...compute_active_pack_ids(load_packs_registry(package_root), runtime_active_packs)
194
+ ].sort();
195
+ } catch {
196
+ return null;
197
+ }
198
+ }
199
+ if (Array.isArray(raw) && raw.length > 0) {
200
+ return raw.map((v) => String(v));
201
+ }
202
+ return null;
203
+ }
204
+
205
+ // src/install/ruleInScope.ts
206
+ var YAML = __toESM(require_dist(), 1);
207
+ import * as fs3 from "node:fs";
208
+ function parseYaml(text) {
209
+ try {
210
+ const data = YAML.parse(text, { version: "1.1" });
211
+ return data === void 0 ? null : data;
212
+ } catch {
213
+ return null;
214
+ }
215
+ }
216
+ function strip(s) {
217
+ return s.replace(/^\s+/u, "").replace(/\s+$/u, "");
218
+ }
219
+ function lstripNewlines(s) {
220
+ return s.replace(/^\n+/, "");
221
+ }
222
+ function parseFrontmatter(content) {
223
+ if (!content.startsWith("---")) {
224
+ return [{}, content];
225
+ }
226
+ const end = content.indexOf("\n---", 3);
227
+ if (end === -1) {
228
+ return [{}, content];
229
+ }
230
+ const raw = strip(content.slice(3, end));
231
+ const body = lstripNewlines(content.slice(end + 4));
232
+ let meta = parseYaml(raw);
233
+ if (meta === null || meta === void 0) {
234
+ meta = {};
235
+ }
236
+ if (typeof meta === "object" && meta !== null && !Array.isArray(meta)) {
237
+ return [meta, body];
238
+ }
239
+ return [{}, body];
240
+ }
241
+ function rule_in_scope(source_path, scope, pack_scope = null, role_scope = null) {
242
+ if (scope === null && pack_scope === null && role_scope === null) {
243
+ return true;
244
+ }
245
+ const [meta] = parseFrontmatter(fs3.readFileSync(source_path, "utf-8"));
246
+ if (meta["type"] === "always" || meta["alwaysApply"] === true) {
247
+ return true;
248
+ }
249
+ const axis = (key, configured) => {
250
+ if (configured === null) {
251
+ return true;
252
+ }
253
+ const values = Array.isArray(meta[key]) ? meta[key].map((w) => String(w)) : [];
254
+ if (values.length === 0) {
255
+ return true;
256
+ }
257
+ return values.some((v) => configured.includes(v));
258
+ };
259
+ return axis("workspaces", scope) && axis("packs", pack_scope) && axis("roles", role_scope);
260
+ }
261
+
262
+ // src/install/rule_scope.ts
263
+ var COMPAT_ALWAYS_EXCLUDED = ["source-of-truth.md"];
264
+ var LEGACY_ALL = { workspaces: null, packs: null };
265
+ function _list(value) {
266
+ if (Array.isArray(value) && value.length > 0) {
267
+ return value.map((v) => String(v));
268
+ }
269
+ return null;
270
+ }
271
+ function ruleScopeFromSettings(settings, packageRoot) {
272
+ const proj = settings["projection"];
273
+ if (typeof proj !== "object" || proj === null || Array.isArray(proj)) {
274
+ return LEGACY_ALL;
275
+ }
276
+ const p = proj;
277
+ const packs = packageRoot === void 0 ? _list(p["rule_packs"]) : resolve_rule_pack_scope(
278
+ p["rule_packs"],
279
+ packageRoot,
280
+ _list(_runtimeActivePacks(settings)) ?? []
281
+ );
282
+ return {
283
+ workspaces: _list(p["rule_workspaces"]),
284
+ packs,
285
+ roles: _list(p["rule_roles"])
286
+ };
287
+ }
288
+ function _runtimeActivePacks(settings) {
289
+ const rt = settings["runtime"];
290
+ return typeof rt === "object" && rt !== null && !Array.isArray(rt) ? rt["active_packs"] : null;
291
+ }
292
+ function ruleFileArrives(sourcePath, scope) {
293
+ if (!sourcePath.endsWith(".md")) {
294
+ return true;
295
+ }
296
+ const basename2 = path3.basename(sourcePath);
297
+ if (COMPAT_ALWAYS_EXCLUDED.includes(basename2)) {
298
+ return false;
299
+ }
300
+ return rule_in_scope(sourcePath, scope.workspaces, scope.packs, scope.roles ?? null);
301
+ }
302
+ function excludedRuleBasenames(rulesDir, scope) {
303
+ let entries;
304
+ try {
305
+ entries = fs4.readdirSync(rulesDir).sort();
306
+ } catch {
307
+ return [];
308
+ }
309
+ const out = [];
310
+ for (const name of entries) {
311
+ if (!name.endsWith(".md")) {
312
+ continue;
313
+ }
314
+ const full = path3.join(rulesDir, name);
315
+ try {
316
+ if (!fs4.statSync(full).isFile()) {
317
+ continue;
318
+ }
319
+ } catch {
320
+ continue;
321
+ }
322
+ if (!ruleFileArrives(full, scope)) {
323
+ out.push(name);
324
+ }
325
+ }
326
+ return out;
327
+ }
328
+
329
+ export {
330
+ load_lab_pack_ids,
331
+ is_lab_artefact,
332
+ load_packs_registry,
333
+ compute_active_pack_ids,
334
+ is_pruned_under_scoped,
335
+ LEGACY_ALL,
336
+ ruleScopeFromSettings,
337
+ ruleFileArrives,
338
+ excludedRuleBasenames
339
+ };
@@ -23,7 +23,7 @@ import {
23
23
  global_deploy_inventory_exports,
24
24
  manifest_path,
25
25
  read_manifest
26
- } from "./chunk-A3HJ6NTI.js";
26
+ } from "./chunk-63WSP6YZ.js";
27
27
  import {
28
28
  read_lockfile
29
29
  } from "./chunk-GRRPEPRN.js";
@@ -31,7 +31,7 @@ import {
31
31
  LEGACY_ALL,
32
32
  excludedRuleBasenames,
33
33
  ruleScopeFromSettings
34
- } from "./chunk-TJIAM5FW.js";
34
+ } from "./chunk-NXFWFAYV.js";
35
35
  import {
36
36
  PROJECT_ROOT_ENV,
37
37
  ProjectRootError,
@@ -11,16 +11,16 @@ import {
11
11
  _run_checks,
12
12
  _run_checks_no_manifest,
13
13
  _scan_foreign
14
- } from "./chunk-TEGJU2JX.js";
14
+ } from "./chunk-ZXXJLL5K.js";
15
15
  import "./chunk-FTAISGDQ.js";
16
16
  import "./chunk-736JCWLM.js";
17
17
  import {
18
18
  atomicAppendLine,
19
19
  manifest_path,
20
20
  read_manifest
21
- } from "./chunk-A3HJ6NTI.js";
21
+ } from "./chunk-63WSP6YZ.js";
22
22
  import "./chunk-GRRPEPRN.js";
23
- import "./chunk-TJIAM5FW.js";
23
+ import "./chunk-NXFWFAYV.js";
24
24
  import "./chunk-HJ6DAJHR.js";
25
25
  import "./chunk-NDJLNC6Q.js";
26
26
  import {
@@ -78,6 +78,31 @@ function tryParseEntry(line) {
78
78
  }
79
79
  }
80
80
 
81
+ // src/scripts/router_target_paths.mjs
82
+ var ROUTE_TARGET_TEMPLATES = Object.freeze({
83
+ skill: Object.freeze(["dist/agent-src/skills/{id}/SKILL.md"]),
84
+ command: Object.freeze(["dist/agent-src/commands/{id}.md"]),
85
+ guideline: Object.freeze(["docs/guidelines/{id}.md"]),
86
+ contract: Object.freeze([
87
+ "docs/contracts/{id}.md",
88
+ "dist/agent-src/contexts/contracts/{id}.md"
89
+ ])
90
+ });
91
+ function parseRouteTarget(target) {
92
+ const sep = target.indexOf(":");
93
+ if (sep <= 0) return null;
94
+ const kind = target.slice(0, sep);
95
+ const id = target.slice(sep + 1);
96
+ if (!id) return null;
97
+ if (!Object.prototype.hasOwnProperty.call(ROUTE_TARGET_TEMPLATES, kind)) return null;
98
+ return { kind, id };
99
+ }
100
+ function routeTargetPathsPosix(target) {
101
+ const parsed = parseRouteTarget(target);
102
+ if (parsed === null) return [];
103
+ return ROUTE_TARGET_TEMPLATES[parsed.kind].map((tpl) => tpl.replace("{id}", parsed.id));
104
+ }
105
+
81
106
  // src/scripts/_cli/cmd_conformance.ts
82
107
  var _HERE = fileURLToPath(import.meta.url);
83
108
  var PACKAGE_ROOT = resolvePackageRoot(import.meta.url);
@@ -146,26 +171,7 @@ function _check_txlog_clean(logPath = installLogPath()) {
146
171
  };
147
172
  }
148
173
  function routeTargetPaths(target) {
149
- const sep = target.indexOf(":");
150
- if (sep <= 0) return [];
151
- const kind = target.slice(0, sep);
152
- const id = target.slice(sep + 1);
153
- if (!id) return [];
154
- switch (kind) {
155
- case "skill":
156
- return [path.join("dist", "agent-src", "skills", id, "SKILL.md")];
157
- case "command":
158
- return [path.join("dist", "agent-src", "commands", `${id}.md`)];
159
- case "guideline":
160
- return [path.join("docs", "guidelines", `${id}.md`)];
161
- case "contract":
162
- return [
163
- path.join("docs", "contracts", `${id}.md`),
164
- path.join("dist", "agent-src", "contexts", "contracts", `${id}.md`)
165
- ];
166
- default:
167
- return [];
168
- }
174
+ return routeTargetPathsPosix(target).map((rel) => path.join(...rel.split("/")));
169
175
  }
170
176
  function _check_router_pointers(packageRoot = PACKAGE_ROOT) {
171
177
  const routerPath = path.join(packageRoot, "dist", "router.json");
@@ -64,12 +64,12 @@ import {
64
64
  _skipped_manifest_check,
65
65
  _wizard_state_path,
66
66
  main
67
- } from "./chunk-TEGJU2JX.js";
67
+ } from "./chunk-ZXXJLL5K.js";
68
68
  import "./chunk-FTAISGDQ.js";
69
69
  import "./chunk-736JCWLM.js";
70
- import "./chunk-A3HJ6NTI.js";
70
+ import "./chunk-63WSP6YZ.js";
71
71
  import "./chunk-GRRPEPRN.js";
72
- import "./chunk-TJIAM5FW.js";
72
+ import "./chunk-NXFWFAYV.js";
73
73
  import "./chunk-HJ6DAJHR.js";
74
74
  import "./chunk-NDJLNC6Q.js";
75
75
  import "./chunk-MCJYCQPF.js";
@@ -9,12 +9,12 @@ import {
9
9
  KIRO_MARKER,
10
10
  ROOCODE_MARKER,
11
11
  ZED_MARKER
12
- } from "./chunk-GCVFLBP2.js";
12
+ } from "./chunk-H574KOUH.js";
13
13
  import "./chunk-XX6TOPD7.js";
14
- import "./chunk-EJYIGZ3T.js";
15
- import "./chunk-A3HJ6NTI.js";
14
+ import "./chunk-BKO2AZ7Z.js";
15
+ import "./chunk-63WSP6YZ.js";
16
16
  import "./chunk-GRRPEPRN.js";
17
- import "./chunk-TJIAM5FW.js";
17
+ import "./chunk-NXFWFAYV.js";
18
18
  import "./chunk-HJ6DAJHR.js";
19
19
  import "./chunk-NDJLNC6Q.js";
20
20
  import "./chunk-523HCFYO.js";
@@ -2,8 +2,8 @@ import { createRequire as __acCreateRequire } from 'node:module'; const require
2
2
  import {
3
3
  GLOBAL_DEPLOY_SOURCES,
4
4
  expandWizardSources
5
- } from "./chunk-EJYIGZ3T.js";
6
- import "./chunk-TJIAM5FW.js";
5
+ } from "./chunk-BKO2AZ7Z.js";
6
+ import "./chunk-NXFWFAYV.js";
7
7
  import {
8
8
  hasBlockingFinding,
9
9
  runPreflight
@@ -1,15 +1,15 @@
1
1
  import { createRequire as __acCreateRequire } from 'node:module'; const require = globalThis.require ?? __acCreateRequire(import.meta.url);
2
2
  import {
3
3
  PROJECT_BRIDGE_MARKERS
4
- } from "./chunk-GCVFLBP2.js";
4
+ } from "./chunk-H574KOUH.js";
5
5
  import "./chunk-XX6TOPD7.js";
6
- import "./chunk-EJYIGZ3T.js";
6
+ import "./chunk-BKO2AZ7Z.js";
7
7
  import {
8
8
  manifest_path,
9
9
  read_manifest
10
- } from "./chunk-A3HJ6NTI.js";
10
+ } from "./chunk-63WSP6YZ.js";
11
11
  import "./chunk-GRRPEPRN.js";
12
- import "./chunk-TJIAM5FW.js";
12
+ import "./chunk-NXFWFAYV.js";
13
13
  import {
14
14
  resolve_project_root
15
15
  } from "./chunk-HJ6DAJHR.js";
@@ -3,12 +3,12 @@ import {
3
3
  GLOBAL_AGENT_SETTINGS_PATH,
4
4
  GLOBAL_USER_SETTINGS_PATH,
5
5
  SETTINGS_FILE
6
- } from "./chunk-GCVFLBP2.js";
6
+ } from "./chunk-H574KOUH.js";
7
7
  import "./chunk-XX6TOPD7.js";
8
- import "./chunk-EJYIGZ3T.js";
9
- import "./chunk-A3HJ6NTI.js";
8
+ import "./chunk-BKO2AZ7Z.js";
9
+ import "./chunk-63WSP6YZ.js";
10
10
  import "./chunk-GRRPEPRN.js";
11
- import "./chunk-TJIAM5FW.js";
11
+ import "./chunk-NXFWFAYV.js";
12
12
  import "./chunk-HJ6DAJHR.js";
13
13
  import "./chunk-NDJLNC6Q.js";
14
14
  import "./chunk-523HCFYO.js";
@@ -1,15 +1,15 @@
1
1
  import { createRequire as __acCreateRequire } from 'node:module'; const require = globalThis.require ?? __acCreateRequire(import.meta.url);
2
2
  import {
3
3
  main
4
- } from "./chunk-GCVFLBP2.js";
4
+ } from "./chunk-H574KOUH.js";
5
5
  import "./chunk-XX6TOPD7.js";
6
- import "./chunk-EJYIGZ3T.js";
6
+ import "./chunk-BKO2AZ7Z.js";
7
7
  import {
8
8
  manifest_path,
9
9
  read_manifest
10
- } from "./chunk-A3HJ6NTI.js";
10
+ } from "./chunk-63WSP6YZ.js";
11
11
  import "./chunk-GRRPEPRN.js";
12
- import "./chunk-TJIAM5FW.js";
12
+ import "./chunk-NXFWFAYV.js";
13
13
  import {
14
14
  resolve_project_root
15
15
  } from "./chunk-HJ6DAJHR.js";
@@ -3,23 +3,23 @@ import {
3
3
  PROJECT_BRIDGE_MARKERS,
4
4
  USER_SCOPE_PATHS,
5
5
  subtract_pointers
6
- } from "./chunk-GCVFLBP2.js";
6
+ } from "./chunk-H574KOUH.js";
7
7
  import "./chunk-XX6TOPD7.js";
8
- import "./chunk-EJYIGZ3T.js";
8
+ import "./chunk-BKO2AZ7Z.js";
9
9
  import {
10
10
  manifest_path,
11
11
  read_manifest,
12
12
  remove_managed_hooks,
13
13
  write_atomic,
14
14
  write_manifest
15
- } from "./chunk-A3HJ6NTI.js";
15
+ } from "./chunk-63WSP6YZ.js";
16
16
  import {
17
17
  lockfile_path,
18
18
  lockfile_write_path,
19
19
  read_lockfile,
20
20
  write_lockfile
21
21
  } from "./chunk-GRRPEPRN.js";
22
- import "./chunk-TJIAM5FW.js";
22
+ import "./chunk-NXFWFAYV.js";
23
23
  import {
24
24
  resolve_project_root
25
25
  } from "./chunk-HJ6DAJHR.js";
@@ -3,17 +3,17 @@ import { createRequire as __acCreateRequire } from 'node:module'; const require
3
3
  import {
4
4
  PROJECT_BRIDGE_MARKERS,
5
5
  USER_SCOPE_PATHS
6
- } from "./chunk-GCVFLBP2.js";
6
+ } from "./chunk-H574KOUH.js";
7
7
  import "./chunk-XX6TOPD7.js";
8
- import "./chunk-EJYIGZ3T.js";
8
+ import "./chunk-BKO2AZ7Z.js";
9
9
  import {
10
10
  manifest_path,
11
11
  read_manifest
12
- } from "./chunk-A3HJ6NTI.js";
12
+ } from "./chunk-63WSP6YZ.js";
13
13
  import {
14
14
  current_package_version
15
15
  } from "./chunk-GRRPEPRN.js";
16
- import "./chunk-TJIAM5FW.js";
16
+ import "./chunk-NXFWFAYV.js";
17
17
  import {
18
18
  resolve_project_root
19
19
  } from "./chunk-HJ6DAJHR.js";
@@ -1,6 +1,6 @@
1
1
  # Discovery — Deprecation Report
2
2
 
3
- - Generated: `2026-08-02T13:19:19Z`
3
+ - Generated: `2026-08-03T19:31:00Z`
4
4
  - Deprecated artefacts: **0**
5
5
 
6
6
  _None. Tree is clean._