@event4u/agent-config 9.12.0 → 9.13.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 (130) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +80 -256
  3. package/README.md +1 -1
  4. package/dist/agent-src/rules/active-remediation.md +0 -2
  5. package/dist/agent-src/rules/architecture.md +0 -1
  6. package/dist/agent-src/rules/artifact-drafting-protocol.md +0 -4
  7. package/dist/agent-src/rules/autonomous-execution.md +1 -2
  8. package/dist/agent-src/rules/broken-access-control.md +0 -2
  9. package/dist/agent-src/rules/code-comment-discipline.md +0 -3
  10. package/dist/agent-src/rules/code-provenance.md +0 -3
  11. package/dist/agent-src/rules/communication-through-line.md +2 -3
  12. package/dist/agent-src/rules/content-quoting-floor.md +0 -2
  13. package/dist/agent-src/rules/context-hygiene.md +1 -3
  14. package/dist/agent-src/rules/decision-revisit-gate.md +0 -2
  15. package/dist/agent-src/rules/design-fidelity.md +29 -0
  16. package/dist/agent-src/rules/domain-adoption-policy.md +0 -3
  17. package/dist/agent-src/rules/downstream-changes.md +10 -1
  18. package/dist/agent-src/rules/external-reference-deep-dive.md +0 -7
  19. package/dist/agent-src/rules/fast-path-marker-visibility.md +0 -1
  20. package/dist/agent-src/rules/git-history-discipline.md +0 -7
  21. package/dist/agent-src/rules/guidelines.md +0 -2
  22. package/dist/agent-src/rules/improve-before-implement.md +4 -2
  23. package/dist/agent-src/rules/invite-challenge.md +0 -4
  24. package/dist/agent-src/rules/linked-projects-onboarding-gate.md +0 -2
  25. package/dist/agent-src/rules/markdown-safe-codeblocks.md +0 -1
  26. package/dist/agent-src/rules/minimal-safe-diff.md +2 -2
  27. package/dist/agent-src/rules/missing-tool-handling.md +0 -1
  28. package/dist/agent-src/rules/no-attribution-footers.md +0 -3
  29. package/dist/agent-src/rules/no-decorative-emojis-in-git-surfaces.md +8 -5
  30. package/dist/agent-src/rules/no-pr-progress-comments.md +1 -3
  31. package/dist/agent-src/rules/no-roadmap-references.md +0 -2
  32. package/dist/agent-src/rules/output-discipline.md +0 -1
  33. package/dist/agent-src/rules/prefer-enums-over-literals.md +0 -2
  34. package/dist/agent-src/rules/preservation-guard.md +0 -3
  35. package/dist/agent-src/rules/role-mode-adherence.md +0 -1
  36. package/dist/agent-src/rules/secret-vcs-guard.md +0 -2
  37. package/dist/agent-src/rules/senior-engineering-discipline.md +0 -2
  38. package/dist/agent-src/rules/session-canary.md +0 -2
  39. package/dist/agent-src/rules/size-enforcement.md +0 -5
  40. package/dist/agent-src/rules/source-confidentiality.md +0 -3
  41. package/dist/agent-src/rules/source-discovery-gate.md +0 -2
  42. package/dist/agent-src/rules/think-before-action.md +3 -3
  43. package/dist/agent-src/rules/token-budget-discipline.md +0 -1
  44. package/dist/agent-src/rules/token-efficiency.md +1 -2
  45. package/dist/agent-src/rules/tool-safety.md +0 -1
  46. package/dist/agent-src/rules/user-interaction.md +0 -3
  47. package/dist/agent-src/rules/user-interrupt-priority.md +0 -1
  48. package/dist/agent-src/skills/agent-docs-writing/SKILL.md +8 -0
  49. package/dist/agent-src/skills/analysis-skill-router/SKILL.md +55 -86
  50. package/dist/agent-src/skills/character-consistency/SKILL.md +7 -4
  51. package/dist/agent-src/skills/decision-record/SKILL.md +8 -0
  52. package/dist/agent-src/skills/design-review/SKILL.md +11 -0
  53. package/dist/agent-src/skills/design-system-capture/reference/design-system-json.md +8 -0
  54. package/dist/agent-src/skills/existing-ui-audit/SKILL.md +34 -3
  55. package/dist/agent-src/skills/fe-design/SKILL.md +10 -0
  56. package/dist/agent-src/skills/motion-choreographer/SKILL.md +7 -4
  57. package/dist/agent-src/skills/overbuild-review-lens/SKILL.md +201 -0
  58. package/dist/agent-src/skills/performance/SKILL.md +14 -0
  59. package/dist/agent-src/skills/pixar-storyteller/SKILL.md +8 -5
  60. package/dist/agent-src/skills/scene-expander/SKILL.md +9 -6
  61. package/dist/agent-src/skills/supply-chain-intake/SKILL.md +10 -0
  62. package/dist/agent-src/skills/universal-project-analysis/SKILL.md +14 -37
  63. package/dist/agent-src/skills/video-director/SKILL.md +9 -6
  64. package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
  65. package/dist/agent-src/templates/scripts/work_engine/directives/ui/apply.ts +154 -13
  66. package/dist/agent-src/templates/scripts/work_engine/directives/ui/design.ts +118 -0
  67. package/dist/agent-src/templates/scripts/work_engine/directives/ui/polish.ts +40 -0
  68. package/dist/agent-src/templates/scripts/work_engine/state.ts +55 -0
  69. package/dist/discovery/deprecation-report.md +1 -1
  70. package/dist/discovery/discovery-manifest.json +89 -67
  71. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  72. package/dist/discovery/discovery-manifest.summary.md +3 -3
  73. package/dist/discovery/orphan-report.md +1 -1
  74. package/dist/discovery/packs.json +6 -5
  75. package/dist/discovery/trust-report.md +2 -2
  76. package/dist/discovery/workspaces.json +5 -4
  77. package/dist/hooks/dispatch.js +174 -13
  78. package/dist/mcp/registry-manifest.json +3 -3
  79. package/dist/mcp/server.json +2 -2
  80. package/dist/mcp/server.mjs +750 -507
  81. package/dist/router.json +1 -1
  82. package/dist/scripts/condense.js +2 -2
  83. package/docs/MIGRATION.md +1 -1
  84. package/docs/guidelines/agent-infra/agent-interaction-and-decision-quality.md +71 -0
  85. package/docs/guidelines/agent-infra/minimal-safe-diff-mechanics.md +24 -1
  86. package/docs/guidelines/code-clarity.md +9 -2
  87. package/docs/guidelines/design-fidelity-mechanics.md +44 -0
  88. package/llms.txt +63 -27
  89. package/package.json +4 -4
  90. package/src/agent-src/templates/scripts/work_engine/directives/ui/apply.ts +154 -13
  91. package/src/agent-src/templates/scripts/work_engine/directives/ui/design.ts +118 -0
  92. package/src/agent-src/templates/scripts/work_engine/directives/ui/polish.ts +40 -0
  93. package/src/agent-src/templates/scripts/work_engine/state.ts +55 -0
  94. package/src/config/agent-settings.template.yml +8 -0
  95. package/src/scripts/_lib/counted_probe.ts +142 -0
  96. package/src/scripts/_lib/overbuild_lens_contract.ts +196 -0
  97. package/src/scripts/_lib/release_scope.ts +207 -0
  98. package/src/scripts/ai_council/stance_tally.ts +37 -2
  99. package/src/scripts/audit_auto_rules.ts +9 -9
  100. package/src/scripts/audit_likelihood.ts +3 -3
  101. package/src/scripts/audit_overlap.ts +2 -2
  102. package/src/scripts/audit_skill_overlap.ts +233 -95
  103. package/src/scripts/audit_skill_overlap_allowlist.json +4 -0
  104. package/src/scripts/build_proof.ts +15 -1
  105. package/src/scripts/check_dependency_floors.ts +16 -6
  106. package/src/scripts/check_gate_coverage.ts +6 -6
  107. package/src/scripts/check_kernel_rule_bundle.ts +5 -4
  108. package/src/scripts/check_token_quality_golden.ts +0 -18
  109. package/src/scripts/code_graph/loader.ts +35 -6
  110. package/src/scripts/compile_router.ts +3 -8
  111. package/src/scripts/condense.ts +2 -2
  112. package/src/scripts/explain_run.ts +0 -1
  113. package/src/scripts/generate_pack_manifests.ts +3 -20
  114. package/src/scripts/hooks/block_kernel_rule_writes.ts +145 -10
  115. package/src/scripts/hooks/block_no_verify.ts +101 -0
  116. package/src/scripts/lint_agent_security.ts +5 -4
  117. package/src/scripts/lint_framework_leakage_allowlist.json +2 -2
  118. package/src/scripts/lint_regression.ts +92 -1
  119. package/src/scripts/lint_skill_descriptions.ts +93 -5
  120. package/src/scripts/project_thin_rules.ts +2 -2
  121. package/src/scripts/release.ts +107 -3
  122. package/src/scripts/resolve_lint_scope.ts +53 -0
  123. package/src/scripts/router_telemetry.ts +0 -5
  124. package/src/scripts/runtime_dispatcher.ts +40 -0
  125. package/src/scripts/schemas/pack.schema.json +1 -5
  126. package/src/scripts/schemas/rule.schema.json +1 -2
  127. package/src/scripts/self_review_gate.ts +15 -73
  128. package/src/scripts/skill_linter.ts +93 -11
  129. package/src/scripts/sweep_dead_scan_roots.ts +550 -0
  130. package/src/scripts/trigger_coverage.ts +11 -37
@@ -1669,17 +1669,17 @@ var require_visit = __commonJS({
1669
1669
  visit.BREAK = BREAK;
1670
1670
  visit.SKIP = SKIP;
1671
1671
  visit.REMOVE = REMOVE;
1672
- function visit_(key, node, visitor, path49) {
1673
- const ctrl = callVisitor(key, node, visitor, path49);
1672
+ function visit_(key, node, visitor, path50) {
1673
+ const ctrl = callVisitor(key, node, visitor, path50);
1674
1674
  if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
1675
- replaceNode(key, path49, ctrl);
1676
- return visit_(key, ctrl, visitor, path49);
1675
+ replaceNode(key, path50, ctrl);
1676
+ return visit_(key, ctrl, visitor, path50);
1677
1677
  }
1678
1678
  if (typeof ctrl !== "symbol") {
1679
1679
  if (identity.isCollection(node)) {
1680
- path49 = Object.freeze(path49.concat(node));
1680
+ path50 = Object.freeze(path50.concat(node));
1681
1681
  for (let i = 0; i < node.items.length; ++i) {
1682
- const ci = visit_(i, node.items[i], visitor, path49);
1682
+ const ci = visit_(i, node.items[i], visitor, path50);
1683
1683
  if (typeof ci === "number")
1684
1684
  i = ci - 1;
1685
1685
  else if (ci === BREAK)
@@ -1690,13 +1690,13 @@ var require_visit = __commonJS({
1690
1690
  }
1691
1691
  }
1692
1692
  } else if (identity.isPair(node)) {
1693
- path49 = Object.freeze(path49.concat(node));
1694
- const ck = visit_("key", node.key, visitor, path49);
1693
+ path50 = Object.freeze(path50.concat(node));
1694
+ const ck = visit_("key", node.key, visitor, path50);
1695
1695
  if (ck === BREAK)
1696
1696
  return BREAK;
1697
1697
  else if (ck === REMOVE)
1698
1698
  node.key = null;
1699
- const cv = visit_("value", node.value, visitor, path49);
1699
+ const cv = visit_("value", node.value, visitor, path50);
1700
1700
  if (cv === BREAK)
1701
1701
  return BREAK;
1702
1702
  else if (cv === REMOVE)
@@ -1717,17 +1717,17 @@ var require_visit = __commonJS({
1717
1717
  visitAsync.BREAK = BREAK;
1718
1718
  visitAsync.SKIP = SKIP;
1719
1719
  visitAsync.REMOVE = REMOVE;
1720
- async function visitAsync_(key, node, visitor, path49) {
1721
- const ctrl = await callVisitor(key, node, visitor, path49);
1720
+ async function visitAsync_(key, node, visitor, path50) {
1721
+ const ctrl = await callVisitor(key, node, visitor, path50);
1722
1722
  if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
1723
- replaceNode(key, path49, ctrl);
1724
- return visitAsync_(key, ctrl, visitor, path49);
1723
+ replaceNode(key, path50, ctrl);
1724
+ return visitAsync_(key, ctrl, visitor, path50);
1725
1725
  }
1726
1726
  if (typeof ctrl !== "symbol") {
1727
1727
  if (identity.isCollection(node)) {
1728
- path49 = Object.freeze(path49.concat(node));
1728
+ path50 = Object.freeze(path50.concat(node));
1729
1729
  for (let i = 0; i < node.items.length; ++i) {
1730
- const ci = await visitAsync_(i, node.items[i], visitor, path49);
1730
+ const ci = await visitAsync_(i, node.items[i], visitor, path50);
1731
1731
  if (typeof ci === "number")
1732
1732
  i = ci - 1;
1733
1733
  else if (ci === BREAK)
@@ -1738,13 +1738,13 @@ var require_visit = __commonJS({
1738
1738
  }
1739
1739
  }
1740
1740
  } else if (identity.isPair(node)) {
1741
- path49 = Object.freeze(path49.concat(node));
1742
- const ck = await visitAsync_("key", node.key, visitor, path49);
1741
+ path50 = Object.freeze(path50.concat(node));
1742
+ const ck = await visitAsync_("key", node.key, visitor, path50);
1743
1743
  if (ck === BREAK)
1744
1744
  return BREAK;
1745
1745
  else if (ck === REMOVE)
1746
1746
  node.key = null;
1747
- const cv = await visitAsync_("value", node.value, visitor, path49);
1747
+ const cv = await visitAsync_("value", node.value, visitor, path50);
1748
1748
  if (cv === BREAK)
1749
1749
  return BREAK;
1750
1750
  else if (cv === REMOVE)
@@ -1771,23 +1771,23 @@ var require_visit = __commonJS({
1771
1771
  }
1772
1772
  return visitor;
1773
1773
  }
1774
- function callVisitor(key, node, visitor, path49) {
1774
+ function callVisitor(key, node, visitor, path50) {
1775
1775
  if (typeof visitor === "function")
1776
- return visitor(key, node, path49);
1776
+ return visitor(key, node, path50);
1777
1777
  if (identity.isMap(node))
1778
- return visitor.Map?.(key, node, path49);
1778
+ return visitor.Map?.(key, node, path50);
1779
1779
  if (identity.isSeq(node))
1780
- return visitor.Seq?.(key, node, path49);
1780
+ return visitor.Seq?.(key, node, path50);
1781
1781
  if (identity.isPair(node))
1782
- return visitor.Pair?.(key, node, path49);
1782
+ return visitor.Pair?.(key, node, path50);
1783
1783
  if (identity.isScalar(node))
1784
- return visitor.Scalar?.(key, node, path49);
1784
+ return visitor.Scalar?.(key, node, path50);
1785
1785
  if (identity.isAlias(node))
1786
- return visitor.Alias?.(key, node, path49);
1786
+ return visitor.Alias?.(key, node, path50);
1787
1787
  return void 0;
1788
1788
  }
1789
- function replaceNode(key, path49, node) {
1790
- const parent = path49[path49.length - 1];
1789
+ function replaceNode(key, path50, node) {
1790
+ const parent = path50[path50.length - 1];
1791
1791
  if (identity.isCollection(parent)) {
1792
1792
  parent.items[key] = node;
1793
1793
  } else if (identity.isPair(parent)) {
@@ -2397,10 +2397,10 @@ var require_Collection = __commonJS({
2397
2397
  var createNode = require_createNode();
2398
2398
  var identity = require_identity();
2399
2399
  var Node = require_Node();
2400
- function collectionFromPath(schema, path49, value) {
2400
+ function collectionFromPath(schema, path50, value) {
2401
2401
  let v = value;
2402
- for (let i = path49.length - 1; i >= 0; --i) {
2403
- const k = path49[i];
2402
+ for (let i = path50.length - 1; i >= 0; --i) {
2403
+ const k = path50[i];
2404
2404
  if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
2405
2405
  const a = [];
2406
2406
  a[k] = v;
@@ -2419,7 +2419,7 @@ var require_Collection = __commonJS({
2419
2419
  sourceObjects: /* @__PURE__ */ new Map()
2420
2420
  });
2421
2421
  }
2422
- var isEmptyPath = (path49) => path49 == null || typeof path49 === "object" && !!path49[Symbol.iterator]().next().done;
2422
+ var isEmptyPath = (path50) => path50 == null || typeof path50 === "object" && !!path50[Symbol.iterator]().next().done;
2423
2423
  var Collection = class extends Node.NodeBase {
2424
2424
  constructor(type, schema) {
2425
2425
  super(type);
@@ -2449,11 +2449,11 @@ var require_Collection = __commonJS({
2449
2449
  * be a Pair instance or a `{ key, value }` object, which may not have a key
2450
2450
  * that already exists in the map.
2451
2451
  */
2452
- addIn(path49, value) {
2453
- if (isEmptyPath(path49))
2452
+ addIn(path50, value) {
2453
+ if (isEmptyPath(path50))
2454
2454
  this.add(value);
2455
2455
  else {
2456
- const [key, ...rest] = path49;
2456
+ const [key, ...rest] = path50;
2457
2457
  const node = this.get(key, true);
2458
2458
  if (identity.isCollection(node))
2459
2459
  node.addIn(rest, value);
@@ -2467,8 +2467,8 @@ var require_Collection = __commonJS({
2467
2467
  * Removes a value from the collection.
2468
2468
  * @returns `true` if the item was found and removed.
2469
2469
  */
2470
- deleteIn(path49) {
2471
- const [key, ...rest] = path49;
2470
+ deleteIn(path50) {
2471
+ const [key, ...rest] = path50;
2472
2472
  if (rest.length === 0)
2473
2473
  return this.delete(key);
2474
2474
  const node = this.get(key, true);
@@ -2482,8 +2482,8 @@ var require_Collection = __commonJS({
2482
2482
  * scalar values from their surrounding node; to disable set `keepScalar` to
2483
2483
  * `true` (collections are always returned intact).
2484
2484
  */
2485
- getIn(path49, keepScalar) {
2486
- const [key, ...rest] = path49;
2485
+ getIn(path50, keepScalar) {
2486
+ const [key, ...rest] = path50;
2487
2487
  const node = this.get(key, true);
2488
2488
  if (rest.length === 0)
2489
2489
  return !keepScalar && identity.isScalar(node) ? node.value : node;
@@ -2501,8 +2501,8 @@ var require_Collection = __commonJS({
2501
2501
  /**
2502
2502
  * Checks if the collection includes a value with the key `key`.
2503
2503
  */
2504
- hasIn(path49) {
2505
- const [key, ...rest] = path49;
2504
+ hasIn(path50) {
2505
+ const [key, ...rest] = path50;
2506
2506
  if (rest.length === 0)
2507
2507
  return this.has(key);
2508
2508
  const node = this.get(key, true);
@@ -2512,8 +2512,8 @@ var require_Collection = __commonJS({
2512
2512
  * Sets a value in this collection. For `!!set`, `value` needs to be a
2513
2513
  * boolean to add/remove the item from the set.
2514
2514
  */
2515
- setIn(path49, value) {
2516
- const [key, ...rest] = path49;
2515
+ setIn(path50, value) {
2516
+ const [key, ...rest] = path50;
2517
2517
  if (rest.length === 0) {
2518
2518
  this.set(key, value);
2519
2519
  } else {
@@ -5028,9 +5028,9 @@ var require_Document = __commonJS({
5028
5028
  this.contents.add(value);
5029
5029
  }
5030
5030
  /** Adds a value to the document. */
5031
- addIn(path49, value) {
5031
+ addIn(path50, value) {
5032
5032
  if (assertCollection(this.contents))
5033
- this.contents.addIn(path49, value);
5033
+ this.contents.addIn(path50, value);
5034
5034
  }
5035
5035
  /**
5036
5036
  * Create a new `Alias` node, ensuring that the target `node` has the required anchor.
@@ -5105,14 +5105,14 @@ var require_Document = __commonJS({
5105
5105
  * Removes a value from the document.
5106
5106
  * @returns `true` if the item was found and removed.
5107
5107
  */
5108
- deleteIn(path49) {
5109
- if (Collection.isEmptyPath(path49)) {
5108
+ deleteIn(path50) {
5109
+ if (Collection.isEmptyPath(path50)) {
5110
5110
  if (this.contents == null)
5111
5111
  return false;
5112
5112
  this.contents = null;
5113
5113
  return true;
5114
5114
  }
5115
- return assertCollection(this.contents) ? this.contents.deleteIn(path49) : false;
5115
+ return assertCollection(this.contents) ? this.contents.deleteIn(path50) : false;
5116
5116
  }
5117
5117
  /**
5118
5118
  * Returns item at `key`, or `undefined` if not found. By default unwraps
@@ -5127,10 +5127,10 @@ var require_Document = __commonJS({
5127
5127
  * scalar values from their surrounding node; to disable set `keepScalar` to
5128
5128
  * `true` (collections are always returned intact).
5129
5129
  */
5130
- getIn(path49, keepScalar) {
5131
- if (Collection.isEmptyPath(path49))
5130
+ getIn(path50, keepScalar) {
5131
+ if (Collection.isEmptyPath(path50))
5132
5132
  return !keepScalar && identity.isScalar(this.contents) ? this.contents.value : this.contents;
5133
- return identity.isCollection(this.contents) ? this.contents.getIn(path49, keepScalar) : void 0;
5133
+ return identity.isCollection(this.contents) ? this.contents.getIn(path50, keepScalar) : void 0;
5134
5134
  }
5135
5135
  /**
5136
5136
  * Checks if the document includes a value with the key `key`.
@@ -5141,10 +5141,10 @@ var require_Document = __commonJS({
5141
5141
  /**
5142
5142
  * Checks if the document includes a value at `path`.
5143
5143
  */
5144
- hasIn(path49) {
5145
- if (Collection.isEmptyPath(path49))
5144
+ hasIn(path50) {
5145
+ if (Collection.isEmptyPath(path50))
5146
5146
  return this.contents !== void 0;
5147
- return identity.isCollection(this.contents) ? this.contents.hasIn(path49) : false;
5147
+ return identity.isCollection(this.contents) ? this.contents.hasIn(path50) : false;
5148
5148
  }
5149
5149
  /**
5150
5150
  * Sets a value in this document. For `!!set`, `value` needs to be a
@@ -5161,13 +5161,13 @@ var require_Document = __commonJS({
5161
5161
  * Sets a value in this document. For `!!set`, `value` needs to be a
5162
5162
  * boolean to add/remove the item from the set.
5163
5163
  */
5164
- setIn(path49, value) {
5165
- if (Collection.isEmptyPath(path49)) {
5164
+ setIn(path50, value) {
5165
+ if (Collection.isEmptyPath(path50)) {
5166
5166
  this.contents = value;
5167
5167
  } else if (this.contents == null) {
5168
- this.contents = Collection.collectionFromPath(this.schema, Array.from(path49), value);
5168
+ this.contents = Collection.collectionFromPath(this.schema, Array.from(path50), value);
5169
5169
  } else if (assertCollection(this.contents)) {
5170
- this.contents.setIn(path49, value);
5170
+ this.contents.setIn(path50, value);
5171
5171
  }
5172
5172
  }
5173
5173
  /**
@@ -7127,9 +7127,9 @@ var require_cst_visit = __commonJS({
7127
7127
  visit.BREAK = BREAK;
7128
7128
  visit.SKIP = SKIP;
7129
7129
  visit.REMOVE = REMOVE;
7130
- visit.itemAtPath = (cst, path49) => {
7130
+ visit.itemAtPath = (cst, path50) => {
7131
7131
  let item = cst;
7132
- for (const [field, index] of path49) {
7132
+ for (const [field, index] of path50) {
7133
7133
  const tok = item?.[field];
7134
7134
  if (tok && "items" in tok) {
7135
7135
  item = tok.items[index];
@@ -7138,23 +7138,23 @@ var require_cst_visit = __commonJS({
7138
7138
  }
7139
7139
  return item;
7140
7140
  };
7141
- visit.parentCollection = (cst, path49) => {
7142
- const parent = visit.itemAtPath(cst, path49.slice(0, -1));
7143
- const field = path49[path49.length - 1][0];
7141
+ visit.parentCollection = (cst, path50) => {
7142
+ const parent = visit.itemAtPath(cst, path50.slice(0, -1));
7143
+ const field = path50[path50.length - 1][0];
7144
7144
  const coll = parent?.[field];
7145
7145
  if (coll && "items" in coll)
7146
7146
  return coll;
7147
7147
  throw new Error("Parent collection not found");
7148
7148
  };
7149
- function _visit(path49, item, visitor) {
7150
- let ctrl = visitor(item, path49);
7149
+ function _visit(path50, item, visitor) {
7150
+ let ctrl = visitor(item, path50);
7151
7151
  if (typeof ctrl === "symbol")
7152
7152
  return ctrl;
7153
7153
  for (const field of ["key", "value"]) {
7154
7154
  const token = item[field];
7155
7155
  if (token && "items" in token) {
7156
7156
  for (let i = 0; i < token.items.length; ++i) {
7157
- const ci = _visit(Object.freeze(path49.concat([[field, i]])), token.items[i], visitor);
7157
+ const ci = _visit(Object.freeze(path50.concat([[field, i]])), token.items[i], visitor);
7158
7158
  if (typeof ci === "number")
7159
7159
  i = ci - 1;
7160
7160
  else if (ci === BREAK)
@@ -7165,10 +7165,10 @@ var require_cst_visit = __commonJS({
7165
7165
  }
7166
7166
  }
7167
7167
  if (typeof ctrl === "function" && field === "key")
7168
- ctrl = ctrl(item, path49);
7168
+ ctrl = ctrl(item, path50);
7169
7169
  }
7170
7170
  }
7171
- return typeof ctrl === "function" ? ctrl(item, path49) : ctrl;
7171
+ return typeof ctrl === "function" ? ctrl(item, path50) : ctrl;
7172
7172
  }
7173
7173
  exports.visit = visit;
7174
7174
  }
@@ -13808,6 +13808,205 @@ var init_validate_frontmatter = __esm({
13808
13808
  }
13809
13809
  });
13810
13810
 
13811
+ // src/scripts/_lib/counted_probe.ts
13812
+ import { spawnSync as spawnSync2 } from "node:child_process";
13813
+ function runCountedProbe(command, args, opts = {}) {
13814
+ const maxBuffer = opts.maxBuffer ?? DEFAULT_PROBE_MAX_BUFFER;
13815
+ const res = spawnSync2(command, [...args], {
13816
+ cwd: opts.cwd,
13817
+ encoding: "utf-8",
13818
+ stdio: ["ignore", "pipe", "pipe"],
13819
+ maxBuffer,
13820
+ ...opts.timeout === void 0 ? {} : { timeout: opts.timeout },
13821
+ ...opts.env === void 0 ? {} : { env: opts.env }
13822
+ });
13823
+ return interpretProbeResult(res, `${command} ${args.join(" ")}`.trim(), maxBuffer);
13824
+ }
13825
+ function interpretProbeResult(res, command, maxBuffer = DEFAULT_PROBE_MAX_BUFFER) {
13826
+ const stdout = res.stdout ?? "";
13827
+ const stderr = res.stderr ?? "";
13828
+ if (res.error) {
13829
+ if (res.error.code === "ENOBUFS") {
13830
+ throw new ProbeOverflowError(command, maxBuffer);
13831
+ }
13832
+ return {
13833
+ ok: false,
13834
+ stdout,
13835
+ stderr,
13836
+ status: res.status,
13837
+ failure: `${res.error.code ?? res.error.message}`
13838
+ };
13839
+ }
13840
+ if ((res.status ?? 1) !== 0) {
13841
+ return {
13842
+ ok: false,
13843
+ stdout,
13844
+ stderr,
13845
+ status: res.status,
13846
+ failure: `exited ${res.status ?? "(null)"}`
13847
+ };
13848
+ }
13849
+ return { ok: true, stdout, stderr, status: res.status, failure: null };
13850
+ }
13851
+ var DEFAULT_PROBE_MAX_BUFFER, ProbeOverflowError;
13852
+ var init_counted_probe = __esm({
13853
+ "src/scripts/_lib/counted_probe.ts"() {
13854
+ "use strict";
13855
+ DEFAULT_PROBE_MAX_BUFFER = 64 * 1024 * 1024;
13856
+ ProbeOverflowError = class extends Error {
13857
+ constructor(command, maxBuffer) {
13858
+ super(
13859
+ `probe \`${command}\` exceeded its ${Math.round(maxBuffer / (1024 * 1024))} MiB output buffer \u2014 the read was truncated, so any count derived from it would be wrong. This is an error rather than a zero on purpose: a counting probe that degrades to zero reports a clean result it never measured. Raise the buffer or narrow the command.`
13860
+ );
13861
+ this.command = command;
13862
+ this.maxBuffer = maxBuffer;
13863
+ this.name = "ProbeOverflowError";
13864
+ }
13865
+ command;
13866
+ maxBuffer;
13867
+ };
13868
+ }
13869
+ });
13870
+
13871
+ // src/scripts/_lib/release_scope.ts
13872
+ import { spawnSync as spawnSync3 } from "node:child_process";
13873
+ import path18 from "node:path";
13874
+ import { fileURLToPath as fileURLToPath12 } from "node:url";
13875
+ function detectReleaseVersion(patchText) {
13876
+ const addedLines = patchText.split("\n").filter((l) => l.startsWith("+") && !l.startsWith("+++")).map((l) => l.slice(1));
13877
+ let changelogVersion = null;
13878
+ let packageVersion = null;
13879
+ for (const line of addedLines) {
13880
+ const changelogMatch = /^##\s*\[(\d+\.\d+\.\d+)\]/.exec(line);
13881
+ if (changelogMatch) changelogVersion = changelogMatch[1] ?? null;
13882
+ const packageMatch = /^\s*"version"\s*:\s*"(\d+\.\d+\.\d+)"/.exec(line);
13883
+ if (packageMatch) packageVersion = packageMatch[1] ?? null;
13884
+ }
13885
+ if (changelogVersion && packageVersion && changelogVersion === packageVersion) {
13886
+ return changelogVersion;
13887
+ }
13888
+ return null;
13889
+ }
13890
+ function releaseDetectionPatch(baseRef, cwd) {
13891
+ const r = spawnSync3("git", ["diff", `${baseRef}...HEAD`, "--", "CHANGELOG.md", "package.json"], {
13892
+ cwd,
13893
+ encoding: "utf8",
13894
+ maxBuffer: 8 * 1024 * 1024
13895
+ });
13896
+ return (r.stdout ?? "").toString();
13897
+ }
13898
+ function detectReleaseVersionFromGit(baseRef, cwd = REPO_ROOT) {
13899
+ return detectReleaseVersion(releaseDetectionPatch(baseRef, cwd));
13900
+ }
13901
+ function parseSemver(raw) {
13902
+ const m = /^v?(\d+)\.(\d+)\.(\d+)$/.exec(raw.trim());
13903
+ if (!m) return null;
13904
+ return [Number(m[1]), Number(m[2]), Number(m[3])];
13905
+ }
13906
+ function semverLessThan(a, b) {
13907
+ const [aMajor, aMinor, aPatch] = a;
13908
+ const [bMajor, bMinor, bPatch] = b;
13909
+ if (aMajor !== bMajor) return aMajor < bMajor;
13910
+ if (aMinor !== bMinor) return aMinor < bMinor;
13911
+ return aPatch < bPatch;
13912
+ }
13913
+ function pickPreviousTag(version, tags) {
13914
+ const target = parseSemver(version);
13915
+ if (!target) return null;
13916
+ let best = null;
13917
+ for (const raw of tags) {
13918
+ const parsed = parseSemver(raw);
13919
+ if (!parsed) continue;
13920
+ if (!semverLessThan(parsed, target)) continue;
13921
+ if (!best || semverLessThan(best.parsed, parsed)) best = { raw, parsed };
13922
+ }
13923
+ return best ? best.raw : null;
13924
+ }
13925
+ function localTags(cwd) {
13926
+ const r = spawnSync3("git", ["tag", "--list"], { cwd, encoding: "utf8", maxBuffer: 8 * 1024 * 1024 });
13927
+ if ((r.status ?? 1) !== 0) return [];
13928
+ return (r.stdout ?? "").split("\n").map((l) => l.trim()).filter((l) => l.length > 0);
13929
+ }
13930
+ function resolveContentLintScope(opts = {}) {
13931
+ const cwd = opts.cwd ?? REPO_ROOT;
13932
+ const baseRef = opts.baseRef ?? "origin/main";
13933
+ const explicit = opts.since ?? process.env["RELEASE_LINT_BASE"] ?? null;
13934
+ if (explicit !== null && explicit.trim() !== "") {
13935
+ const base = explicit.trim();
13936
+ return {
13937
+ base,
13938
+ isRelease: false,
13939
+ version: null,
13940
+ previousTag: null,
13941
+ reason: `scope pinned to ${base} by an explicit override`
13942
+ };
13943
+ }
13944
+ const version = detectReleaseVersionFromGit(baseRef, cwd);
13945
+ if (version === null) {
13946
+ return {
13947
+ base: baseRef,
13948
+ isRelease: false,
13949
+ version: null,
13950
+ previousTag: null,
13951
+ reason: `ordinary PR \u2014 scope is ${baseRef}...HEAD`
13952
+ };
13953
+ }
13954
+ const previousTag = pickPreviousTag(version, localTags(cwd));
13955
+ if (previousTag === null) {
13956
+ return {
13957
+ base: baseRef,
13958
+ isRelease: true,
13959
+ version,
13960
+ previousTag: null,
13961
+ reason: `release ${version} detected, but no earlier semver tag is reachable \u2014 scope stays ${baseRef}...HEAD and therefore sees only the release wrapper`
13962
+ };
13963
+ }
13964
+ return {
13965
+ base: previousTag,
13966
+ isRelease: true,
13967
+ version,
13968
+ previousTag,
13969
+ reason: `release ${version} detected \u2014 scope widened to ${previousTag}...HEAD so the check sees the release, not the version bump`
13970
+ };
13971
+ }
13972
+ var __dirname, REPO_ROOT;
13973
+ var init_release_scope = __esm({
13974
+ "src/scripts/_lib/release_scope.ts"() {
13975
+ "use strict";
13976
+ __dirname = path18.dirname(fileURLToPath12(import.meta.url));
13977
+ REPO_ROOT = path18.resolve(__dirname, "..", "..", "..");
13978
+ }
13979
+ });
13980
+
13981
+ // src/scripts/_lib/scan_scope.ts
13982
+ function assertScanned(opts) {
13983
+ if (opts.scanned > 0) {
13984
+ return;
13985
+ }
13986
+ if (opts.allowEmpty !== void 0 && opts.allowEmpty.trim() !== "") {
13987
+ return;
13988
+ }
13989
+ const roots = opts.roots.length > 0 ? opts.roots.join(", ") : "(no root declared)";
13990
+ throw new DeadScopeError(
13991
+ opts.gate,
13992
+ `${opts.gate}: scanned 0 ${opts.units} under ${roots} \u2014 the scan scope is dead or the root moved. A gate that read nothing has not passed. Repoint the root (prefer the shared resolver in _lib/agent_src.ts), or declare a justified \`allowEmpty\` reason if an empty corpus is genuinely expected.`
13993
+ );
13994
+ }
13995
+ var DeadScopeError;
13996
+ var init_scan_scope = __esm({
13997
+ "src/scripts/_lib/scan_scope.ts"() {
13998
+ "use strict";
13999
+ DeadScopeError = class extends Error {
14000
+ gate;
14001
+ constructor(gate, message) {
14002
+ super(message);
14003
+ this.name = "DeadScopeError";
14004
+ this.gate = gate;
14005
+ }
14006
+ };
14007
+ }
14008
+ });
14009
+
13811
14010
  // src/scripts/skill_linter.ts
13812
14011
  var skill_linter_exports = {};
13813
14012
  __export(skill_linter_exports, {
@@ -13837,6 +14036,7 @@ __export(skill_linter_exports, {
13837
14036
  gather_all_candidate_files: () => gather_all_candidate_files,
13838
14037
  gather_candidate_files_under: () => gather_candidate_files_under,
13839
14038
  gather_changed_candidate_files: () => gather_changed_candidate_files,
14039
+ last_changed_scope_reason: () => last_changed_scope_reason,
13840
14040
  lint_command: () => lint_command,
13841
14041
  lint_file: () => lint_file,
13842
14042
  lint_guideline: () => lint_guideline,
@@ -13853,11 +14053,10 @@ __export(skill_linter_exports, {
13853
14053
  parse_output_schema: () => parse_output_schema,
13854
14054
  validate_evals_json: () => validate_evals_json
13855
14055
  });
13856
- import { spawnSync as spawnSync2 } from "node:child_process";
13857
14056
  import * as fs19 from "node:fs";
13858
- import * as path18 from "node:path";
14057
+ import * as path19 from "node:path";
13859
14058
  import process7 from "node:process";
13860
- import { fileURLToPath as fileURLToPath12, pathToFileURL as pathToFileURL7 } from "node:url";
14059
+ import { fileURLToPath as fileURLToPath13, pathToFileURL as pathToFileURL7 } from "node:url";
13861
14060
  function splitlines(text) {
13862
14061
  if (text === "") {
13863
14062
  return [];
@@ -13916,7 +14115,7 @@ function rglob(root, predicate) {
13916
14115
  return;
13917
14116
  }
13918
14117
  for (const ent of entries) {
13919
- const full = path18.join(dir, ent.name);
14118
+ const full = path19.join(dir, ent.name);
13920
14119
  if (ent.isDirectory()) {
13921
14120
  walk(full);
13922
14121
  } else if (predicate(ent.name)) {
@@ -13934,18 +14133,18 @@ function glob(dir, predicate) {
13934
14133
  } catch {
13935
14134
  return [];
13936
14135
  }
13937
- return entries.filter((e) => e.isFile() && predicate(e.name)).map((e) => path18.join(dir, e.name));
14136
+ return entries.filter((e) => e.isFile() && predicate(e.name)).map((e) => path19.join(dir, e.name));
13938
14137
  }
13939
14138
  function basename8(p) {
13940
- return path18.basename(p);
14139
+ return path19.basename(p);
13941
14140
  }
13942
14141
  function stem(p) {
13943
- const b = path18.basename(p);
14142
+ const b = path19.basename(p);
13944
14143
  const dot = b.lastIndexOf(".");
13945
14144
  return dot > 0 ? b.slice(0, dot) : b;
13946
14145
  }
13947
14146
  function parentName(p) {
13948
- return path18.basename(path18.dirname(p));
14147
+ return path19.basename(path19.dirname(p));
13949
14148
  }
13950
14149
  function dedupePreserveOrder(items) {
13951
14150
  const seen = /* @__PURE__ */ new Set();
@@ -14450,7 +14649,7 @@ function lint_router_frontmatter(ruleId, frontmatter, ruleType) {
14450
14649
  );
14451
14650
  }
14452
14651
  } else {
14453
- const repoRoot = path18.resolve(_HERE4, "..", "..");
14652
+ const repoRoot = path19.resolve(_HERE4, "..", "..");
14454
14653
  routesTo.forEach((item, idx) => {
14455
14654
  if (typeof item !== "string" || !item.includes(":")) {
14456
14655
  issues.push(new Issue("error", "route_shape_invalid", `routes_to[${idx}] must be 'kind:id'`));
@@ -14463,12 +14662,12 @@ function lint_router_frontmatter(ruleId, frontmatter, ruleType) {
14463
14662
  if (kind === "skill") {
14464
14663
  target = resolve_logical(`skills/${targetId}/SKILL.md`);
14465
14664
  } else if (kind === "guideline") {
14466
- const gpath = path18.join(repoRoot, "docs", "guidelines", `${targetId}.md`);
14665
+ const gpath = path19.join(repoRoot, "docs", "guidelines", `${targetId}.md`);
14467
14666
  target = exists(gpath) ? gpath : null;
14468
14667
  } else if (kind === "command") {
14469
14668
  target = resolve_logical(`commands/${targetId}.md`);
14470
14669
  } else if (kind === "contract") {
14471
- const cpath = path18.join(repoRoot, "docs", "contracts", `${targetId}.md`);
14670
+ const cpath = path19.join(repoRoot, "docs", "contracts", `${targetId}.md`);
14472
14671
  if (exists(cpath)) {
14473
14672
  target = cpath;
14474
14673
  } else {
@@ -15096,7 +15295,7 @@ function lint_skill(p, text) {
15096
15295
  return new LintResult(p, "skill", classify_status(issues), issues, dedupePreserveOrder(suggestions));
15097
15296
  }
15098
15297
  function validate_evals_json(skillPath) {
15099
- const evalsPath = path18.join(path18.dirname(skillPath), "evals", "evals.json");
15298
+ const evalsPath = path19.join(path19.dirname(skillPath), "evals", "evals.json");
15100
15299
  if (!isFile(evalsPath)) {
15101
15300
  return [];
15102
15301
  }
@@ -15668,14 +15867,14 @@ function gather_all_candidate_files(root) {
15668
15867
  const sources = artefact_roots();
15669
15868
  if (sources.length > 0) {
15670
15869
  for (const srcRoot of sources) {
15671
- const skillsDir = path18.join(srcRoot, "skills");
15870
+ const skillsDir = path19.join(srcRoot, "skills");
15672
15871
  if (isDir(skillsDir)) {
15673
15872
  for (const f of rglob(skillsDir, (b) => b === "SKILL.md")) {
15674
15873
  add(f, srcRoot);
15675
15874
  }
15676
15875
  }
15677
15876
  for (const sub of ["rules", "commands", "guidelines"]) {
15678
- const base = path18.join(srcRoot, sub);
15877
+ const base = path19.join(srcRoot, sub);
15679
15878
  if (exists(base)) {
15680
15879
  for (const f of rglob(base, (b) => b.endsWith(".md"))) {
15681
15880
  add(f, srcRoot);
@@ -15683,7 +15882,7 @@ function gather_all_candidate_files(root) {
15683
15882
  }
15684
15883
  }
15685
15884
  for (const sub of ["personas", "user-types"]) {
15686
- const base = path18.join(srcRoot, sub);
15885
+ const base = path19.join(srcRoot, sub);
15687
15886
  if (exists(base)) {
15688
15887
  for (const f of glob(base, (b) => b.endsWith(".md"))) {
15689
15888
  if (basename8(f).toLowerCase() === "readme.md") {
@@ -15693,13 +15892,13 @@ function gather_all_candidate_files(root) {
15693
15892
  }
15694
15893
  }
15695
15894
  }
15696
- const charter = path18.join(srcRoot, FRUGALITY_CHARTER_RELPATH);
15895
+ const charter = path19.join(srcRoot, FRUGALITY_CHARTER_RELPATH);
15697
15896
  if (exists(charter) && !isSymlink(charter)) {
15698
15897
  add(charter, srcRoot);
15699
15898
  }
15700
15899
  }
15701
15900
  } else {
15702
- const augmentRoot = path18.join(root, "dist/agent-src");
15901
+ const augmentRoot = path19.join(root, "dist/agent-src");
15703
15902
  if (exists(augmentRoot)) {
15704
15903
  const subPatterns = [
15705
15904
  ["skills", (b) => b === "SKILL.md"],
@@ -15708,7 +15907,7 @@ function gather_all_candidate_files(root) {
15708
15907
  ["guidelines", (b) => b.endsWith(".md")]
15709
15908
  ];
15710
15909
  for (const [sub, pred] of subPatterns) {
15711
- const base = path18.join(augmentRoot, sub);
15910
+ const base = path19.join(augmentRoot, sub);
15712
15911
  if (exists(base)) {
15713
15912
  for (const f of rglob(base, pred)) {
15714
15913
  add(f, augmentRoot);
@@ -15716,7 +15915,7 @@ function gather_all_candidate_files(root) {
15716
15915
  }
15717
15916
  }
15718
15917
  for (const sub of ["personas", "user-types"]) {
15719
- const base = path18.join(augmentRoot, sub);
15918
+ const base = path19.join(augmentRoot, sub);
15720
15919
  if (exists(base)) {
15721
15920
  for (const f of glob(base, (b) => b.endsWith(".md"))) {
15722
15921
  if (basename8(f).toLowerCase() === "readme.md") {
@@ -15726,7 +15925,7 @@ function gather_all_candidate_files(root) {
15726
15925
  }
15727
15926
  }
15728
15927
  }
15729
- const charter = path18.join(augmentRoot, FRUGALITY_CHARTER_RELPATH);
15928
+ const charter = path19.join(augmentRoot, FRUGALITY_CHARTER_RELPATH);
15730
15929
  if (exists(charter) && !isSymlink(charter)) {
15731
15930
  add(charter, augmentRoot);
15732
15931
  }
@@ -15751,14 +15950,14 @@ function gather_candidate_files_under(srcRoot) {
15751
15950
  seen.add(resolved);
15752
15951
  out.push(file);
15753
15952
  };
15754
- const skillsDir = path18.join(srcRoot, "skills");
15953
+ const skillsDir = path19.join(srcRoot, "skills");
15755
15954
  if (exists(skillsDir)) {
15756
15955
  for (const f of rglob(skillsDir, (b) => b === "SKILL.md")) {
15757
15956
  push(f);
15758
15957
  }
15759
15958
  }
15760
15959
  for (const sub of ["rules", "commands", "guidelines"]) {
15761
- const base = path18.join(srcRoot, sub);
15960
+ const base = path19.join(srcRoot, sub);
15762
15961
  if (exists(base)) {
15763
15962
  for (const f of rglob(base, (b) => b.endsWith(".md"))) {
15764
15963
  push(f);
@@ -15766,7 +15965,7 @@ function gather_candidate_files_under(srcRoot) {
15766
15965
  }
15767
15966
  }
15768
15967
  for (const sub of ["personas", "user-types"]) {
15769
- const base = path18.join(srcRoot, sub);
15968
+ const base = path19.join(srcRoot, sub);
15770
15969
  if (exists(base)) {
15771
15970
  for (const f of glob(base, (b) => b.endsWith(".md"))) {
15772
15971
  if (basename8(f).toLowerCase() === "readme.md") {
@@ -15776,26 +15975,25 @@ function gather_candidate_files_under(srcRoot) {
15776
15975
  }
15777
15976
  }
15778
15977
  }
15779
- const charter = path18.join(srcRoot, FRUGALITY_CHARTER_RELPATH);
15978
+ const charter = path19.join(srcRoot, FRUGALITY_CHARTER_RELPATH);
15780
15979
  if (exists(charter) && !isSymlink(charter)) {
15781
15980
  push(charter);
15782
15981
  }
15783
15982
  return sortedUnique(out);
15784
15983
  }
15785
- function gather_changed_candidate_files(root) {
15984
+ function gather_changed_candidate_files(root, since) {
15985
+ const scope = resolveContentLintScope({ cwd: root, since: since ?? null });
15986
+ last_changed_scope_reason = scope.reason;
15786
15987
  const diffCommands = [
15787
- ["git", "diff", "--name-only", "origin/main...HEAD"],
15988
+ ["git", "diff", "--name-only", `${scope.base}...HEAD`],
15788
15989
  ["git", "diff", "--name-only", "--cached", "HEAD"],
15789
15990
  ["git", "diff", "--name-only", "HEAD"]
15790
15991
  ];
15791
15992
  try {
15792
15993
  let rawLines = [];
15793
15994
  for (const cmd of diffCommands) {
15794
- const result = spawnSync2(cmd[0], cmd.slice(1), {
15795
- cwd: root,
15796
- encoding: "utf-8"
15797
- });
15798
- if (result.status === 0 && (result.stdout ?? "").trim()) {
15995
+ const result = runCountedProbe(cmd[0], cmd.slice(1), { cwd: root });
15996
+ if (result.ok && result.stdout.trim()) {
15799
15997
  rawLines = splitlines(result.stdout);
15800
15998
  break;
15801
15999
  }
@@ -15806,7 +16004,7 @@ function gather_changed_candidate_files(root) {
15806
16004
  if (!raw) {
15807
16005
  continue;
15808
16006
  }
15809
- const p = path18.join(root, raw);
16007
+ const p = path19.join(root, raw);
15810
16008
  if (!exists(p)) {
15811
16009
  continue;
15812
16010
  }
@@ -15818,14 +16016,18 @@ function gather_changed_candidate_files(root) {
15818
16016
  if (!inSource) {
15819
16017
  continue;
15820
16018
  }
15821
- const isMd = path18.extname(p) === ".md";
16019
+ const isMd = path19.extname(p) === ".md";
15822
16020
  const inEvals = norm.includes("/evals/");
15823
16021
  if (!inEvals && (basename8(p) === "SKILL.md" || isMd && (norm.includes("/rules/") || norm.includes("/commands/")))) {
15824
16022
  files.push(p);
15825
16023
  }
15826
16024
  }
15827
16025
  return sortedUnique(files);
15828
- } catch {
16026
+ } catch (exc) {
16027
+ if (exc instanceof ProbeOverflowError) {
16028
+ throw exc;
16029
+ }
16030
+ last_changed_scope_reason = `change set unresolvable (${exc instanceof Error ? exc.message : String(exc)})`;
15829
16031
  return [];
15830
16032
  }
15831
16033
  }
@@ -16356,7 +16558,7 @@ function lint_frugality_charter_index(p, text) {
16356
16558
  return [];
16357
16559
  }
16358
16560
  const issues = [];
16359
- const rulesDir = path18.join(path18.dirname(path18.dirname(path18.dirname(p))), "rules");
16561
+ const rulesDir = path19.join(path19.dirname(path19.dirname(path19.dirname(p))), "rules");
16360
16562
  const ruleSlugsCache = /* @__PURE__ */ new Map();
16361
16563
  const canonicalSatisfied = /* @__PURE__ */ new Set();
16362
16564
  for (const linkMatch of text.matchAll(_MD_LINK_PATTERN)) {
@@ -16375,7 +16577,7 @@ function lint_frugality_charter_index(p, text) {
16375
16577
  canonicalSatisfied.add(ruleName);
16376
16578
  }
16377
16579
  if (!ruleSlugsCache.has(ruleName)) {
16378
- const ruleFile = path18.join(rulesDir, ruleName);
16580
+ const ruleFile = path19.join(rulesDir, ruleName);
16379
16581
  if (!exists(ruleFile)) {
16380
16582
  issues.push(
16381
16583
  new Issue(
@@ -16442,7 +16644,7 @@ function lint_governance(p, _text, artifactType, repoRoot) {
16442
16644
  logical = idx !== -1 ? norm.slice(idx + marker.length) : null;
16443
16645
  }
16444
16646
  if (logical) {
16445
- const condensedPath = path18.join(repoRoot, "dist/agent-src", logical);
16647
+ const condensedPath = path19.join(repoRoot, "dist/agent-src", logical);
16446
16648
  if (!exists(condensedPath)) {
16447
16649
  issues.push(
16448
16650
  new Issue(
@@ -16556,7 +16758,7 @@ function load_output_schema(skillPath) {
16556
16758
  if (basename8(skillPath) !== "SKILL.md") {
16557
16759
  return null;
16558
16760
  }
16559
- const schemaPath = path18.join(path18.dirname(skillPath), "evals", "output-schema.yml");
16761
+ const schemaPath = path19.join(path19.dirname(skillPath), "evals", "output-schema.yml");
16560
16762
  if (!exists(schemaPath)) {
16561
16763
  return null;
16562
16764
  }
@@ -16627,7 +16829,7 @@ function lint_file(p, repoRoot = null) {
16627
16829
  const artifactType = detect_artifact_type(p, text);
16628
16830
  let displayPath = p;
16629
16831
  if (repoRoot) {
16630
- if (isUnder(p, repoRoot) || path18.resolve(p) === path18.resolve(repoRoot)) {
16832
+ if (isUnder(p, repoRoot) || path19.resolve(p) === path19.resolve(repoRoot)) {
16631
16833
  displayPath = relPosixNative(p, repoRoot);
16632
16834
  }
16633
16835
  }
@@ -16787,18 +16989,18 @@ function check_condensation_pairs(root) {
16787
16989
  ["commands", "*.md", false]
16788
16990
  ];
16789
16991
  for (const [subdir, pattern, isNested] of pairs) {
16790
- const condensedDir = path18.join(root, "dist/agent-src", subdir);
16992
+ const condensedDir = path19.join(root, "dist/agent-src", subdir);
16791
16993
  const uncondensedNames = /* @__PURE__ */ new Set();
16792
16994
  let anySource = false;
16793
16995
  for (const srcRoot of artefact_roots()) {
16794
- const uncondensedDir = path18.join(srcRoot, subdir);
16996
+ const uncondensedDir = path19.join(srcRoot, subdir);
16795
16997
  if (!exists(uncondensedDir)) {
16796
16998
  continue;
16797
16999
  }
16798
17000
  anySource = true;
16799
17001
  if (isNested) {
16800
17002
  for (const d of iterdir(uncondensedDir)) {
16801
- if (isDir(d) && exists(path18.join(d, pattern))) {
17003
+ if (isDir(d) && exists(path19.join(d, pattern))) {
16802
17004
  uncondensedNames.add(basename8(d));
16803
17005
  }
16804
17006
  }
@@ -16817,7 +17019,7 @@ function check_condensation_pairs(root) {
16817
17019
  if (exists(condensedDir)) {
16818
17020
  if (isNested) {
16819
17021
  for (const d of iterdir(condensedDir)) {
16820
- if (isDir(d) && exists(path18.join(d, pattern))) {
17022
+ if (isDir(d) && exists(path19.join(d, pattern))) {
16821
17023
  condensedNames.add(basename8(d));
16822
17024
  }
16823
17025
  }
@@ -16858,13 +17060,13 @@ function check_condensation_pairs(root) {
16858
17060
  }
16859
17061
  function check_condensation_quality(root) {
16860
17062
  const results = [];
16861
- const condensedDir = path18.join(root, "dist/agent-src", "skills");
17063
+ const condensedDir = path19.join(root, "dist/agent-src", "skills");
16862
17064
  if (!exists(condensedDir)) {
16863
17065
  return results;
16864
17066
  }
16865
17067
  const skillSources = [];
16866
17068
  for (const srcRoot of artefact_roots()) {
16867
- const uncondensedDir = path18.join(srcRoot, "skills");
17069
+ const uncondensedDir = path19.join(srcRoot, "skills");
16868
17070
  if (exists(uncondensedDir)) {
16869
17071
  skillSources.push(...iterdir(uncondensedDir).sort());
16870
17072
  }
@@ -16874,8 +17076,8 @@ function check_condensation_quality(root) {
16874
17076
  }
16875
17077
  const preservedSections = ["When to use", "Procedure", "Gotcha", "Gotchas", "Do NOT", "Output format", "Output"];
16876
17078
  for (const skillDir of skillSources) {
16877
- const src = path18.join(skillDir, "SKILL.md");
16878
- const dst = path18.join(condensedDir, basename8(skillDir), "SKILL.md");
17079
+ const src = path19.join(skillDir, "SKILL.md");
17080
+ const dst = path19.join(condensedDir, basename8(skillDir), "SKILL.md");
16879
17081
  if (!exists(src) || !exists(dst)) {
16880
17082
  continue;
16881
17083
  }
@@ -16947,7 +17149,7 @@ function check_duplication(root) {
16947
17149
  const skillDirs = [];
16948
17150
  const seen = /* @__PURE__ */ new Set();
16949
17151
  for (const srcRoot of artefact_roots()) {
16950
- const sd = path18.join(srcRoot, "skills");
17152
+ const sd = path19.join(srcRoot, "skills");
16951
17153
  if (!exists(sd)) {
16952
17154
  continue;
16953
17155
  }
@@ -16963,7 +17165,7 @@ function check_duplication(root) {
16963
17165
  }
16964
17166
  const skillData = [];
16965
17167
  for (const skillDir of skillDirs) {
16966
- const skillFile = path18.join(skillDir, "SKILL.md");
17168
+ const skillFile = path19.join(skillDir, "SKILL.md");
16967
17169
  if (!exists(skillFile)) {
16968
17170
  continue;
16969
17171
  }
@@ -17137,6 +17339,7 @@ function parse_args2(argv) {
17137
17339
  condensationQuality: false,
17138
17340
  strictWarnings: false,
17139
17341
  report: false,
17342
+ since: null,
17140
17343
  repoRoot: ".",
17141
17344
  quiet: false
17142
17345
  };
@@ -17146,6 +17349,15 @@ function parse_args2(argv) {
17146
17349
  args.all = true;
17147
17350
  } else if (a === "--changed") {
17148
17351
  args.changed = true;
17352
+ } else if (a === "--since") {
17353
+ const v = argv[i + 1];
17354
+ i += 1;
17355
+ if (v === void 0 || v.startsWith("--")) {
17356
+ throw new ArgError("argument --since: expected a git ref");
17357
+ }
17358
+ args.since = v;
17359
+ } else if (a.startsWith("--since=")) {
17360
+ args.since = a.slice("--since=".length);
17149
17361
  } else if (a === "--format") {
17150
17362
  const v = argv[i + 1];
17151
17363
  i += 1;
@@ -17182,6 +17394,10 @@ function parse_args2(argv) {
17182
17394
  }
17183
17395
  return args;
17184
17396
  }
17397
+ function _release_scope_requires_findings(root, since) {
17398
+ const scope = resolveContentLintScope({ cwd: root, since: since ?? null });
17399
+ return scope.isRelease && scope.previousTag !== null;
17400
+ }
17185
17401
  function main7(argv) {
17186
17402
  let args;
17187
17403
  try {
@@ -17194,17 +17410,19 @@ function main7(argv) {
17194
17410
  }
17195
17411
  throw e;
17196
17412
  }
17197
- const root = path18.resolve(args.repoRoot);
17413
+ const root = path19.resolve(args.repoRoot);
17198
17414
  try {
17199
17415
  const paths = [];
17200
17416
  if (args.all || args.report) {
17201
17417
  paths.push(...gather_all_candidate_files(root));
17202
17418
  }
17203
17419
  if (args.changed) {
17204
- paths.push(...gather_changed_candidate_files(root));
17420
+ paths.push(...gather_changed_candidate_files(root, args.since));
17421
+ process7.stderr.write(`skill_linter --changed: ${last_changed_scope_reason}
17422
+ `);
17205
17423
  }
17206
17424
  for (const raw of args.paths) {
17207
- const p = path18.isAbsolute(raw) ? raw : path18.resolve(root, raw);
17425
+ const p = path19.isAbsolute(raw) ? raw : path19.resolve(root, raw);
17208
17426
  if (!exists(p)) {
17209
17427
  continue;
17210
17428
  }
@@ -17223,6 +17441,23 @@ function main7(argv) {
17223
17441
  process7.stdout.write(`${format_json([])}
17224
17442
  `);
17225
17443
  }
17444
+ if (args.changed && _release_scope_requires_findings(root, args.since)) {
17445
+ try {
17446
+ assertScanned({
17447
+ gate: "skill_linter --changed (release PR)",
17448
+ scanned: 0,
17449
+ units: "skill/rule files",
17450
+ roots: [last_changed_scope_reason]
17451
+ });
17452
+ } catch (exc) {
17453
+ if (exc instanceof DeadScopeError) {
17454
+ process7.stderr.write(`\u274C ${exc.message}
17455
+ `);
17456
+ return 2;
17457
+ }
17458
+ throw exc;
17459
+ }
17460
+ }
17226
17461
  process7.stderr.write("No matching skill/rule files found.\n");
17227
17462
  return 0;
17228
17463
  }
@@ -17307,22 +17542,22 @@ function pyPercent(value) {
17307
17542
  }
17308
17543
  function iterdir(dir) {
17309
17544
  try {
17310
- return fs19.readdirSync(dir).map((name) => path18.join(dir, name));
17545
+ return fs19.readdirSync(dir).map((name) => path19.join(dir, name));
17311
17546
  } catch {
17312
17547
  return [];
17313
17548
  }
17314
17549
  }
17315
17550
  function isUnder(child, parent) {
17316
- const c = path18.resolve(child);
17317
- const par = path18.resolve(parent);
17318
- const rel = path18.relative(par, c);
17319
- return rel !== "" && !rel.startsWith("..") && !path18.isAbsolute(rel);
17551
+ const c = path19.resolve(child);
17552
+ const par = path19.resolve(parent);
17553
+ const rel = path19.relative(par, c);
17554
+ return rel !== "" && !rel.startsWith("..") && !path19.isAbsolute(rel);
17320
17555
  }
17321
17556
  function relPosix(child, parent) {
17322
- return path18.relative(path18.resolve(parent), path18.resolve(child)).split(path18.sep).join("/");
17557
+ return path19.relative(path19.resolve(parent), path19.resolve(child)).split(path19.sep).join("/");
17323
17558
  }
17324
17559
  function relPosixNative(child, parent) {
17325
- return path18.relative(path18.resolve(parent), path18.resolve(child));
17560
+ return path19.relative(path19.resolve(parent), path19.resolve(child));
17326
17561
  }
17327
17562
  function sortedUnique(items) {
17328
17563
  return [...new Set(items)].sort(comparePathComponents);
@@ -17388,25 +17623,28 @@ function _isCliEntry7() {
17388
17623
  if (process7.argv[1] === void 0) {
17389
17624
  return false;
17390
17625
  }
17391
- const argvUrl = pathToFileURL7(path18.resolve(process7.argv[1])).href;
17626
+ const argvUrl = pathToFileURL7(path19.resolve(process7.argv[1])).href;
17392
17627
  if (import.meta.url === argvUrl) {
17393
17628
  return true;
17394
17629
  }
17395
17630
  try {
17396
- const here = fs19.realpathSync(fileURLToPath12(import.meta.url));
17397
- const argv = fs19.realpathSync(path18.resolve(process7.argv[1]));
17631
+ const here = fs19.realpathSync(fileURLToPath13(import.meta.url));
17632
+ const argv = fs19.realpathSync(path19.resolve(process7.argv[1]));
17398
17633
  return here === argv;
17399
17634
  } catch {
17400
17635
  return false;
17401
17636
  }
17402
17637
  }
17403
- var _HERE4, REQUIRED_PERSONA_SECTIONS_CORE, REQUIRED_PERSONA_SECTIONS_SPECIALIST, VALID_PERSONA_TIERS, PERSONA_LINE_BUDGETS, REQUIRED_USERTYPE_SECTIONS, USERTYPE_LINE_BUDGET, VALID_PERSONA_WINGS, PERSONA_LINE_BUDGETS_BY_WING, REQUIRED_SKILL_SECTIONS, SECTION_ALIASES, RECOMMENDED_SKILL_SECTIONS, RULE_BAD_SIGNS, FRUGALITY_WRITER_SKILLS, FRUGALITY_CHARTER_RELPATH, FRUGALITY_CHARTER_INDEX_RULES, VAGUE_VALIDATION_PATTERNS, TRIGGER_WARNING_PATTERNS, ORDERED_STEP_PATTERN, SECTION_PATTERN, FRONTMATTER_PATTERN, DESCRIPTION_PATTERN, STATUS_PATTERN, REPLACED_BY_PATTERN, TIER_PATTERN, TYPE_PATTERN, SOURCE_PATTERN, SENIOR_RELATED_SKILLS_PATTERN, SENIOR_RELATED_WHEN_PATTERN, SENIOR_RELATED_WHEN_NOT_PATTERN, SENIOR_PROACTIVE_PATTERN, SENIOR_OUTPUT_PATTERN, H1_PATTERN, DOUBLE_BLANK_PATTERN, VALID_RULE_TYPES, VALID_RULE_SOURCES, ROUTER_ALLOWED_TRIGGER_KEYS, KERNEL_RULE_IDS, VALID_EXECUTION_TYPES, VALID_EXECUTION_HANDLERS, VALID_EXECUTION_SAFETY_MODES, VALID_EXECUTION_FIELDS, WING3_SPINE_SLOTS, CONTEXT_SPINE_INLINE_PATTERN, WING3_SAAS_URL_PATTERN, WING3_VENDOR_BLACKLIST, WING3_STACK_LOCKED_PATTERN, WING3_CHANNEL_TACTIC_PATTERN, WING4_SPINE_SLOTS, WING4_SAAS_URL_PATTERN, WING4_VENDOR_BLACKLIST, WING4_STAGE_AGNOSTIC_PATTERN, Issue, LintResult, _ROLE_CONTRACT_CANDIDATES, _ROLE_CONTRACT_SLUGS_CACHE, _ROLE_CONTRACT_REF_PATTERN, PROCEDURE_HEADING_PATTERN, COMMAND_FRONTMATTER_DELEGATION_KEYS, MD_LINK_PATTERN_G, NAME_PATTERN, DISABLE_MODEL_PATTERN, _INSPECT_VERB_PATTERN, _INTERACTION_NAME_PATTERNS, _INTERACTION_CONTENT_KEYWORDS, _EXEC_FILE_SIGNALS, _EXEC_CONTENT_SIGNALS, _TASK_TYPE_SIGNALS, _VERIFICATION_TOOLS, _FRUGALITY_STANDARDS_PATTERN, _FRUGALITY_CHARTER_LINK_PATTERN, _MD_LINK_PATTERN, _MALICE_CRED_EXFIL, _MALICE_REMOTE_EXEC, _MALICE_FORCE_PUSH, _MALICE_CHMOD_SECRETS, _MALICE_SHELL_INJECT, _MALICE_PATTERNS, _NAG_UPDATE_CHECK, _NAG_STAY_CURRENT, _NAG_SELF_PROMO, _NAG_BEST_SKILL, _NAG_MUST_USE, _NAG_ALWAYS_USE, _NAG_PATTERNS, _OUTPUT_SCHEMA_KEY_PATTERN, _SCHEMA_ARTEFACT_TYPES, ArgError, isCliEntry2;
17638
+ var _HERE4, REQUIRED_PERSONA_SECTIONS_CORE, REQUIRED_PERSONA_SECTIONS_SPECIALIST, VALID_PERSONA_TIERS, PERSONA_LINE_BUDGETS, REQUIRED_USERTYPE_SECTIONS, USERTYPE_LINE_BUDGET, VALID_PERSONA_WINGS, PERSONA_LINE_BUDGETS_BY_WING, REQUIRED_SKILL_SECTIONS, SECTION_ALIASES, RECOMMENDED_SKILL_SECTIONS, RULE_BAD_SIGNS, FRUGALITY_WRITER_SKILLS, FRUGALITY_CHARTER_RELPATH, FRUGALITY_CHARTER_INDEX_RULES, VAGUE_VALIDATION_PATTERNS, TRIGGER_WARNING_PATTERNS, ORDERED_STEP_PATTERN, SECTION_PATTERN, FRONTMATTER_PATTERN, DESCRIPTION_PATTERN, STATUS_PATTERN, REPLACED_BY_PATTERN, TIER_PATTERN, TYPE_PATTERN, SOURCE_PATTERN, SENIOR_RELATED_SKILLS_PATTERN, SENIOR_RELATED_WHEN_PATTERN, SENIOR_RELATED_WHEN_NOT_PATTERN, SENIOR_PROACTIVE_PATTERN, SENIOR_OUTPUT_PATTERN, H1_PATTERN, DOUBLE_BLANK_PATTERN, VALID_RULE_TYPES, VALID_RULE_SOURCES, ROUTER_ALLOWED_TRIGGER_KEYS, KERNEL_RULE_IDS, VALID_EXECUTION_TYPES, VALID_EXECUTION_HANDLERS, VALID_EXECUTION_SAFETY_MODES, VALID_EXECUTION_FIELDS, WING3_SPINE_SLOTS, CONTEXT_SPINE_INLINE_PATTERN, WING3_SAAS_URL_PATTERN, WING3_VENDOR_BLACKLIST, WING3_STACK_LOCKED_PATTERN, WING3_CHANNEL_TACTIC_PATTERN, WING4_SPINE_SLOTS, WING4_SAAS_URL_PATTERN, WING4_VENDOR_BLACKLIST, WING4_STAGE_AGNOSTIC_PATTERN, Issue, LintResult, _ROLE_CONTRACT_CANDIDATES, _ROLE_CONTRACT_SLUGS_CACHE, _ROLE_CONTRACT_REF_PATTERN, PROCEDURE_HEADING_PATTERN, COMMAND_FRONTMATTER_DELEGATION_KEYS, MD_LINK_PATTERN_G, NAME_PATTERN, DISABLE_MODEL_PATTERN, _INSPECT_VERB_PATTERN, last_changed_scope_reason, _INTERACTION_NAME_PATTERNS, _INTERACTION_CONTENT_KEYWORDS, _EXEC_FILE_SIGNALS, _EXEC_CONTENT_SIGNALS, _TASK_TYPE_SIGNALS, _VERIFICATION_TOOLS, _FRUGALITY_STANDARDS_PATTERN, _FRUGALITY_CHARTER_LINK_PATTERN, _MD_LINK_PATTERN, _MALICE_CRED_EXFIL, _MALICE_REMOTE_EXEC, _MALICE_FORCE_PUSH, _MALICE_CHMOD_SECRETS, _MALICE_SHELL_INJECT, _MALICE_PATTERNS, _NAG_UPDATE_CHECK, _NAG_STAY_CURRENT, _NAG_SELF_PROMO, _NAG_BEST_SKILL, _NAG_MUST_USE, _NAG_ALWAYS_USE, _NAG_PATTERNS, _OUTPUT_SCHEMA_KEY_PATTERN, _SCHEMA_ARTEFACT_TYPES, ArgError, isCliEntry2;
17404
17639
  var init_skill_linter = __esm({
17405
17640
  "src/scripts/skill_linter.ts"() {
17406
17641
  "use strict";
17407
17642
  init_validate_frontmatter();
17408
17643
  init_agent_src();
17409
- _HERE4 = path18.dirname(fileURLToPath12(import.meta.url));
17644
+ init_counted_probe();
17645
+ init_release_scope();
17646
+ init_scan_scope();
17647
+ _HERE4 = path19.dirname(fileURLToPath13(import.meta.url));
17410
17648
  REQUIRED_PERSONA_SECTIONS_CORE = [
17411
17649
  "Focus",
17412
17650
  "Mindset",
@@ -17502,7 +17740,6 @@ var init_skill_linter = __esm({
17502
17740
  ROUTER_ALLOWED_TRIGGER_KEYS = /* @__PURE__ */ new Set([
17503
17741
  "keyword",
17504
17742
  "phrase",
17505
- "intent",
17506
17743
  "file_pattern",
17507
17744
  "path_prefix",
17508
17745
  "command"
@@ -17573,6 +17810,7 @@ var init_skill_linter = __esm({
17573
17810
  NAME_PATTERN = /^name:\s*"?(.*?)"?\s*$/m;
17574
17811
  DISABLE_MODEL_PATTERN = /^disable-model-invocation:\s*"?(true|false)"?\s*$/m;
17575
17812
  _INSPECT_VERB_PATTERN = /\b(?:inspect|examine|audit|survey|read|look\s+at|check|review|understand|identify|analyze|analyse|detect|gather|discover)\b/i;
17813
+ last_changed_scope_reason = "";
17576
17814
  _INTERACTION_NAME_PATTERNS = /skill-router|handoff|analysis-skill|skill-writing|skill-reviewer|model-recommendation|developer-like-execution|universal-project-analysis|interaction|autonomous-mode|feature-planning/i;
17577
17815
  _INTERACTION_CONTENT_KEYWORDS = [
17578
17816
  "handoff",
@@ -17694,9 +17932,9 @@ __export(memory_signal_exports, {
17694
17932
  });
17695
17933
  import * as crypto3 from "node:crypto";
17696
17934
  import * as fs20 from "node:fs";
17697
- import * as path19 from "node:path";
17935
+ import * as path20 from "node:path";
17698
17936
  import process8 from "node:process";
17699
- import { fileURLToPath as fileURLToPath13, pathToFileURL as pathToFileURL8 } from "node:url";
17937
+ import { fileURLToPath as fileURLToPath14, pathToFileURL as pathToFileURL8 } from "node:url";
17700
17938
  function _setIntakeRoot2(p) {
17701
17939
  INTAKE_ROOT3 = p;
17702
17940
  }
@@ -17731,7 +17969,7 @@ function _new_id() {
17731
17969
  function _monthly_file() {
17732
17970
  const d = /* @__PURE__ */ new Date();
17733
17971
  const ym = `${d.getUTCFullYear().toString().padStart(4, "0")}-${(d.getUTCMonth() + 1).toString().padStart(2, "0")}`;
17734
- return path19.join(INTAKE_ROOT3, `signals-${ym}.jsonl`);
17972
+ return path20.join(INTAKE_ROOT3, `signals-${ym}.jsonl`);
17735
17973
  }
17736
17974
  function _parseFromIso(ts) {
17737
17975
  const m = /^(\d{4})-(\d{2})-(\d{2})[ T](\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,6}))?(Z|[+-]\d{2}:\d{2})?$/.exec(ts);
@@ -17813,7 +18051,7 @@ function _globSignals(root) {
17813
18051
  } catch {
17814
18052
  return [];
17815
18053
  }
17816
- return names.filter((n) => n.startsWith("signals-") && n.endsWith(".jsonl")).sort().map((n) => path19.join(root, n));
18054
+ return names.filter((n) => n.startsWith("signals-") && n.endsWith(".jsonl")).sort().map((n) => path20.join(root, n));
17817
18055
  }
17818
18056
  function emit(entry_type, p, body, options = {}) {
17819
18057
  const extra = options.extra ?? null;
@@ -17978,13 +18216,13 @@ function _isCliEntry8() {
17978
18216
  if (process8.argv[1] === void 0) {
17979
18217
  return false;
17980
18218
  }
17981
- const argvUrl = pathToFileURL8(path19.resolve(process8.argv[1])).href;
18219
+ const argvUrl = pathToFileURL8(path20.resolve(process8.argv[1])).href;
17982
18220
  if (import.meta.url === argvUrl) {
17983
18221
  return true;
17984
18222
  }
17985
18223
  try {
17986
- const here = fs20.realpathSync(fileURLToPath13(import.meta.url));
17987
- const argv = fs20.realpathSync(path19.resolve(process8.argv[1]));
18224
+ const here = fs20.realpathSync(fileURLToPath14(import.meta.url));
18225
+ const argv = fs20.realpathSync(path20.resolve(process8.argv[1]));
17988
18226
  return here === argv;
17989
18227
  } catch {
17990
18228
  return false;
@@ -17994,7 +18232,7 @@ var INTAKE_ROOT3, SETTINGS_FILE, VALID_TYPES, RATE_LIMIT_WINDOW_DAYS, _PROG4, _U
17994
18232
  var init_memory_signal = __esm({
17995
18233
  "src/agent-src/templates/scripts/memory_signal.ts"() {
17996
18234
  "use strict";
17997
- INTAKE_ROOT3 = path19.join("agents", "memory", "intake");
18235
+ INTAKE_ROOT3 = path20.join("agents", "memory", "intake");
17998
18236
  SETTINGS_FILE = ".agent-settings.yml";
17999
18237
  VALID_TYPES = /* @__PURE__ */ new Set([
18000
18238
  "historical-patterns",
@@ -18039,10 +18277,10 @@ __export(update_roadmap_progress_exports, {
18039
18277
  unarchived_complete: () => unarchived_complete
18040
18278
  });
18041
18279
  import { createRequire as createRequire4 } from "node:module";
18042
- import { spawnSync as spawnSync3 } from "node:child_process";
18280
+ import { spawnSync as spawnSync4 } from "node:child_process";
18043
18281
  import * as fs21 from "node:fs";
18044
- import * as path20 from "node:path";
18045
- import { fileURLToPath as fileURLToPath14, pathToFileURL as pathToFileURL9 } from "node:url";
18282
+ import * as path21 from "node:path";
18283
+ import { fileURLToPath as fileURLToPath15, pathToFileURL as pathToFileURL9 } from "node:url";
18046
18284
  function _pyRound4(x) {
18047
18285
  const floor = Math.floor(x);
18048
18286
  const diff = x - floor;
@@ -18088,14 +18326,14 @@ function is_draft(fm) {
18088
18326
  return DRAFT_VALUES.has((fm["status"] ?? "").toLowerCase());
18089
18327
  }
18090
18328
  function is_roadmap_candidate(p) {
18091
- const name = path20.basename(p);
18329
+ const name = path21.basename(p);
18092
18330
  if (EXCLUDE_NAMES.has(name)) {
18093
18331
  return false;
18094
18332
  }
18095
18333
  if (EXCLUDE_PREFIXES.some((pre) => name.startsWith(pre))) {
18096
18334
  return false;
18097
18335
  }
18098
- const parts = p.split(path20.sep).filter((s) => s !== "");
18336
+ const parts = p.split(path21.sep).filter((s) => s !== "");
18099
18337
  if (parts.some((part) => EXCLUDE_DIRS.has(part))) {
18100
18338
  return false;
18101
18339
  }
@@ -18272,12 +18510,12 @@ function parse_roadmap(p, roadmap_root) {
18272
18510
  return stats;
18273
18511
  }
18274
18512
  function _stem2(p) {
18275
- const base = path20.basename(p);
18513
+ const base = path21.basename(p);
18276
18514
  const dot = base.lastIndexOf(".");
18277
18515
  return dot > 0 ? base.slice(0, dot) : base;
18278
18516
  }
18279
18517
  function _relPosix(root, p) {
18280
- return path20.relative(root, p).split(path20.sep).join("/");
18518
+ return path21.relative(root, p).split(path21.sep).join("/");
18281
18519
  }
18282
18520
  function _blockerAnchor(rel) {
18283
18521
  const stem2 = rel.endsWith(".md") ? rel.slice(0, -3) : rel;
@@ -18297,7 +18535,7 @@ function _rglobMdSorted3(root) {
18297
18535
  return;
18298
18536
  }
18299
18537
  for (const ent of entries) {
18300
- const full = path20.join(dir, ent.name);
18538
+ const full = path21.join(dir, ent.name);
18301
18539
  if (ent.isDirectory()) {
18302
18540
  walk(full);
18303
18541
  } else if (ent.isSymbolicLink() && _isDir8(full)) {
@@ -18352,7 +18590,7 @@ function pending_iron_law_3(roadmaps) {
18352
18590
  return roadmaps.filter((r) => r.total_active > 0 && r.open_ === 0 && r.deferred > 0);
18353
18591
  }
18354
18592
  function collect_bundles(repo_root) {
18355
- const reg = path20.join(repo_root, "agents", "tickets", "_registry.yml");
18593
+ const reg = path21.join(repo_root, "agents", "tickets", "_registry.yml");
18356
18594
  if (!fs21.existsSync(reg)) {
18357
18595
  return [];
18358
18596
  }
@@ -18374,7 +18612,7 @@ function collect_bundles(repo_root) {
18374
18612
  for (const slug of Object.keys(bundleMap).sort()) {
18375
18613
  const metaRaw = bundleMap[slug];
18376
18614
  const meta = metaRaw && typeof metaRaw === "object" && !Array.isArray(metaRaw) ? metaRaw : {};
18377
- const bdir = path20.join(repo_root, "agents", "tickets", slug);
18615
+ const bdir = path21.join(repo_root, "agents", "tickets", slug);
18378
18616
  let n = 0;
18379
18617
  if (_isDir8(bdir)) {
18380
18618
  try {
@@ -18570,13 +18808,13 @@ function _parseArgs5(argv) {
18570
18808
  }
18571
18809
  function _fallback_git_toplevel(repo_root) {
18572
18810
  try {
18573
- const r = spawnSync3("git", ["rev-parse", "--show-toplevel"], {
18811
+ const r = spawnSync4("git", ["rev-parse", "--show-toplevel"], {
18574
18812
  cwd: repo_root,
18575
18813
  encoding: "utf-8",
18576
18814
  timeout: 1e4
18577
18815
  });
18578
18816
  const top = (r.stdout || "").trim();
18579
- if (r.status === 0 && top !== "" && _isDir8(path20.join(top, "agents", "roadmaps"))) {
18817
+ if (r.status === 0 && top !== "" && _isDir8(path21.join(top, "agents", "roadmaps"))) {
18580
18818
  return top;
18581
18819
  }
18582
18820
  } catch {
@@ -18586,11 +18824,11 @@ function _fallback_git_toplevel(repo_root) {
18586
18824
  function main9(argv) {
18587
18825
  const args = _parseArgs5(argv ?? process.argv.slice(2));
18588
18826
  let repo_root = args.repo_root;
18589
- if (repo_root === process.cwd() && !_isDir8(path20.join(repo_root, "agents", "roadmaps"))) {
18827
+ if (repo_root === process.cwd() && !_isDir8(path21.join(repo_root, "agents", "roadmaps"))) {
18590
18828
  repo_root = _fallback_git_toplevel(repo_root);
18591
18829
  }
18592
- const roadmap_root = path20.join(repo_root, "agents", "roadmaps");
18593
- const target = path20.join(repo_root, "agents", "roadmaps-progress.md");
18830
+ const roadmap_root = path21.join(repo_root, "agents", "roadmaps");
18831
+ const target = path21.join(repo_root, "agents", "roadmaps-progress.md");
18594
18832
  if (!_isDir8(roadmap_root)) {
18595
18833
  if (args.check) {
18596
18834
  return 0;
@@ -18688,13 +18926,13 @@ function _isCliEntry9() {
18688
18926
  if (process.argv[1] === void 0) {
18689
18927
  return false;
18690
18928
  }
18691
- const argvUrl = pathToFileURL9(path20.resolve(process.argv[1])).href;
18929
+ const argvUrl = pathToFileURL9(path21.resolve(process.argv[1])).href;
18692
18930
  if (import.meta.url === argvUrl) {
18693
18931
  return true;
18694
18932
  }
18695
18933
  try {
18696
- const here = fs21.realpathSync(fileURLToPath14(import.meta.url));
18697
- const argv = fs21.realpathSync(path20.resolve(process.argv[1]));
18934
+ const here = fs21.realpathSync(fileURLToPath15(import.meta.url));
18935
+ const argv = fs21.realpathSync(path21.resolve(process.argv[1]));
18698
18936
  return here === argv;
18699
18937
  } catch {
18700
18938
  return false;
@@ -18704,7 +18942,7 @@ var _HERE5, _require3, CHECKBOX_RE, PHASE_RE, TITLE_RE, EXCLUDE_NAMES, EXCLUDE_P
18704
18942
  var init_update_roadmap_progress = __esm({
18705
18943
  "src/agent-src/scripts/update_roadmap_progress.ts"() {
18706
18944
  "use strict";
18707
- _HERE5 = fileURLToPath14(import.meta.url);
18945
+ _HERE5 = fileURLToPath15(import.meta.url);
18708
18946
  _require3 = createRequire4(import.meta.url);
18709
18947
  CHECKBOX_RE = /^[ \t\n\r\f\v]*[-*][ \t\n\r\f\v]+\[([ xX~\-])\][ \t\n\r\f\v]/gm;
18710
18948
  PHASE_RE = /^(#{2,3})[ \t\n\r\f\v]+Phase[ \t\n\r\f\v]+(\d+(?:\.\d+)*[a-z]?|[IVX]+|[A-Z](?:\d+)?)(?:[\s:—\-]+([\s\S]*?))?[ \t\f\v\r]*$/gm;
@@ -18859,13 +19097,13 @@ __export(archive_completed_roadmaps_exports, {
18859
19097
  archive_completed: () => archive_completed,
18860
19098
  main: () => main10
18861
19099
  });
18862
- import { spawnSync as spawnSync4 } from "node:child_process";
19100
+ import { spawnSync as spawnSync5 } from "node:child_process";
18863
19101
  import * as fs22 from "node:fs";
18864
- import * as path21 from "node:path";
19102
+ import * as path22 from "node:path";
18865
19103
  import process9 from "node:process";
18866
- import { fileURLToPath as fileURLToPath15, pathToFileURL as pathToFileURL10 } from "node:url";
19104
+ import { fileURLToPath as fileURLToPath16, pathToFileURL as pathToFileURL10 } from "node:url";
18867
19105
  function _run(cmd, cwd) {
18868
- const res = spawnSync4(cmd[0], cmd.slice(1), { cwd, encoding: "utf-8" });
19106
+ const res = spawnSync5(cmd[0], cmd.slice(1), { cwd, encoding: "utf-8" });
18869
19107
  if (res.error) {
18870
19108
  return { returncode: -1, stdout: res.stdout ?? "", stderr: String(res.error.message ?? "") };
18871
19109
  }
@@ -18921,7 +19159,7 @@ function _inbound_ref_rewrite(root, old_rel, new_rel, dry_run, tracked = true) {
18921
19159
  if (!rel || rel === old_rel) {
18922
19160
  continue;
18923
19161
  }
18924
- const fp = path21.join(root, rel);
19162
+ const fp = path22.join(root, rel);
18925
19163
  let text;
18926
19164
  try {
18927
19165
  text = fs22.readFileSync(fp, { encoding: "utf-8" });
@@ -18942,17 +19180,17 @@ function _replaceAll(text, oldStr, newStr) {
18942
19180
  return text.split(oldStr).join(newStr);
18943
19181
  }
18944
19182
  function _git_mv(root, src_rel, dst_rel, dry_run) {
18945
- const dst = path21.join(root, dst_rel);
19183
+ const dst = path22.join(root, dst_rel);
18946
19184
  if (dry_run) {
18947
19185
  return { ok: true, tracked: true };
18948
19186
  }
18949
- fs22.mkdirSync(path21.dirname(dst), { recursive: true });
19187
+ fs22.mkdirSync(path22.dirname(dst), { recursive: true });
18950
19188
  const cp = _run(["git", "mv", src_rel, dst_rel], root);
18951
19189
  if (cp.returncode === 0) {
18952
19190
  return { ok: true, tracked: true };
18953
19191
  }
18954
19192
  try {
18955
- fs22.renameSync(path21.join(root, src_rel), dst);
19193
+ fs22.renameSync(path22.join(root, src_rel), dst);
18956
19194
  return { ok: true, tracked: false };
18957
19195
  } catch {
18958
19196
  return { ok: false, tracked: false };
@@ -18972,7 +19210,7 @@ function _fs_grep_files(root, needle) {
18972
19210
  if (e.name.startsWith(".git") || SKIP.has(e.name)) {
18973
19211
  continue;
18974
19212
  }
18975
- const abs = path21.join(dirAbs, e.name);
19213
+ const abs = path22.join(dirAbs, e.name);
18976
19214
  if (e.isDirectory()) {
18977
19215
  walk(abs);
18978
19216
  } else if (e.isFile() && /\.(md|json|ya?ml|ts|js|txt)$/.test(e.name)) {
@@ -18983,7 +19221,7 @@ function _fs_grep_files(root, needle) {
18983
19221
  continue;
18984
19222
  }
18985
19223
  if (text.includes(needle)) {
18986
- hits.push(path21.relative(root, abs).split(path21.sep).join("/"));
19224
+ hits.push(path22.relative(root, abs).split(path22.sep).join("/"));
18987
19225
  }
18988
19226
  }
18989
19227
  }
@@ -18993,7 +19231,7 @@ function _fs_grep_files(root, needle) {
18993
19231
  }
18994
19232
  function archive_completed(root, opts) {
18995
19233
  const { changed_only, base, dry_run } = opts;
18996
- const roadmap_root = path21.join(root, "agents", "roadmaps");
19234
+ const roadmap_root = path22.join(root, "agents", "roadmaps");
18997
19235
  if (!_isDir9(roadmap_root)) {
18998
19236
  return [];
18999
19237
  }
@@ -19047,29 +19285,29 @@ function _regen_dashboard(root, dry_run) {
19047
19285
  if (dry_run) {
19048
19286
  return;
19049
19287
  }
19050
- const script = path21.join(path21.dirname(_HERE6), "update_roadmap_progress.ts");
19288
+ const script = path22.join(path22.dirname(_HERE6), "update_roadmap_progress.ts");
19051
19289
  _runTwin(root, script);
19052
- const dash = path21.join(root, "agents", "roadmaps-progress.md");
19290
+ const dash = path22.join(root, "agents", "roadmaps-progress.md");
19053
19291
  if (_isFile8(dash)) {
19054
19292
  _run(["git", "add", "--", "agents/roadmaps-progress.md"], root);
19055
19293
  }
19056
19294
  }
19057
19295
  function _runTwin(root, script) {
19058
19296
  const binName = process9.platform === "win32" ? "tsx.cmd" : "tsx";
19059
- let dir = path21.dirname(_HERE6);
19297
+ let dir = path22.dirname(_HERE6);
19060
19298
  for (; ; ) {
19061
- const candidate = path21.join(dir, "node_modules", ".bin", binName);
19299
+ const candidate = path22.join(dir, "node_modules", ".bin", binName);
19062
19300
  if (fs22.existsSync(candidate)) {
19063
- spawnSync4(candidate, [script], { cwd: root, encoding: "utf-8" });
19301
+ spawnSync5(candidate, [script], { cwd: root, encoding: "utf-8" });
19064
19302
  return;
19065
19303
  }
19066
- const parent = path21.dirname(dir);
19304
+ const parent = path22.dirname(dir);
19067
19305
  if (parent === dir) {
19068
19306
  break;
19069
19307
  }
19070
19308
  dir = parent;
19071
19309
  }
19072
- spawnSync4("npx", ["tsx", script], { cwd: root, encoding: "utf-8" });
19310
+ spawnSync5("npx", ["tsx", script], { cwd: root, encoding: "utf-8" });
19073
19311
  }
19074
19312
  function _usage2() {
19075
19313
  return `usage: ${_PROG6} [-h] [--all] [--base BASE] [--dry-run]
@@ -19138,13 +19376,13 @@ function _isCliEntry10() {
19138
19376
  if (process9.argv[1] === void 0) {
19139
19377
  return false;
19140
19378
  }
19141
- const argvUrl = pathToFileURL10(path21.resolve(process9.argv[1])).href;
19379
+ const argvUrl = pathToFileURL10(path22.resolve(process9.argv[1])).href;
19142
19380
  if (import.meta.url === argvUrl) {
19143
19381
  return true;
19144
19382
  }
19145
19383
  try {
19146
- const here = fs22.realpathSync(fileURLToPath15(import.meta.url));
19147
- const argv = fs22.realpathSync(path21.resolve(process9.argv[1]));
19384
+ const here = fs22.realpathSync(fileURLToPath16(import.meta.url));
19385
+ const argv = fs22.realpathSync(path22.resolve(process9.argv[1]));
19148
19386
  return here === argv;
19149
19387
  } catch {
19150
19388
  return false;
@@ -19155,7 +19393,7 @@ var init_archive_completed_roadmaps = __esm({
19155
19393
  "src/agent-src/scripts/archive_completed_roadmaps.ts"() {
19156
19394
  "use strict";
19157
19395
  init_update_roadmap_progress();
19158
- _HERE6 = fileURLToPath15(import.meta.url);
19396
+ _HERE6 = fileURLToPath16(import.meta.url);
19159
19397
  ArgparseExit2 = class extends Error {
19160
19398
  code;
19161
19399
  constructor(code) {
@@ -19192,9 +19430,9 @@ __export(generate_capabilities_index_exports, {
19192
19430
  main: () => main11
19193
19431
  });
19194
19432
  import * as fs23 from "node:fs";
19195
- import * as path22 from "node:path";
19433
+ import * as path23 from "node:path";
19196
19434
  import process10 from "node:process";
19197
- import { fileURLToPath as fileURLToPath16, pathToFileURL as pathToFileURL11 } from "node:url";
19435
+ import { fileURLToPath as fileURLToPath17, pathToFileURL as pathToFileURL11 } from "node:url";
19198
19436
  function _isFile9(p) {
19199
19437
  try {
19200
19438
  return fs23.statSync(p).isFile();
@@ -19270,7 +19508,7 @@ function _globSkillMds() {
19270
19508
  }
19271
19509
  const found = [];
19272
19510
  for (const ent of entries) {
19273
- const dir = path22.join(SKILLS_DIR, ent.name);
19511
+ const dir = path23.join(SKILLS_DIR, ent.name);
19274
19512
  const isDir4 = ent.isDirectory() || ent.isSymbolicLink() && (() => {
19275
19513
  try {
19276
19514
  return fs23.statSync(dir).isDirectory();
@@ -19281,7 +19519,7 @@ function _globSkillMds() {
19281
19519
  if (!isDir4) {
19282
19520
  continue;
19283
19521
  }
19284
- const md = path22.join(dir, "SKILL.md");
19522
+ const md = path23.join(dir, "SKILL.md");
19285
19523
  if (_isFile9(md)) {
19286
19524
  found.push(md);
19287
19525
  }
@@ -19302,7 +19540,7 @@ function _skill_packs() {
19302
19540
  continue;
19303
19541
  }
19304
19542
  const fmDict = fm;
19305
- const name = _nameOr(fmDict["name"], path22.basename(path22.dirname(skillMd)));
19543
+ const name = _nameOr(fmDict["name"], path23.basename(path23.dirname(skillMd)));
19306
19544
  const packs = fmDict["packs"];
19307
19545
  const packList = _pyTruthy(packs) ? packs : [];
19308
19546
  for (const pidRaw of packList) {
@@ -19324,7 +19562,7 @@ function _command_packs() {
19324
19562
  continue;
19325
19563
  }
19326
19564
  const fmDict = fm;
19327
- const name = _nameOr(fmDict["name"], path22.basename(path22.dirname(cmdMd)));
19565
+ const name = _nameOr(fmDict["name"], path23.basename(path23.dirname(cmdMd)));
19328
19566
  const packsVal = fmDict["packs"];
19329
19567
  const pids = new Set(
19330
19568
  (_pyTruthy(packsVal) ? packsVal : []).map((x) => String(x))
@@ -19554,13 +19792,13 @@ function _isCliEntry11() {
19554
19792
  if (process10.argv[1] === void 0) {
19555
19793
  return false;
19556
19794
  }
19557
- const argvUrl = pathToFileURL11(path22.resolve(process10.argv[1])).href;
19795
+ const argvUrl = pathToFileURL11(path23.resolve(process10.argv[1])).href;
19558
19796
  if (import.meta.url === argvUrl) {
19559
19797
  return true;
19560
19798
  }
19561
19799
  try {
19562
- const here = fs23.realpathSync(fileURLToPath16(import.meta.url));
19563
- const argv = fs23.realpathSync(path22.resolve(process10.argv[1]));
19800
+ const here = fs23.realpathSync(fileURLToPath17(import.meta.url));
19801
+ const argv = fs23.realpathSync(path23.resolve(process10.argv[1]));
19564
19802
  return here === argv;
19565
19803
  } catch {
19566
19804
  return false;
@@ -19573,11 +19811,11 @@ var init_generate_capabilities_index = __esm({
19573
19811
  import_yaml4 = __toESM(require_dist(), 1);
19574
19812
  init_agent_src();
19575
19813
  init_validate_frontmatter();
19576
- _HERE7 = fileURLToPath16(import.meta.url);
19577
- ROOT2 = path22.resolve(path22.dirname(_HERE7), "..", "..");
19578
- OUT = path22.join(ROOT2, "CAPABILITIES.yaml");
19579
- PACKS_YML = path22.join(ROOT2, "src", "config", "discovery", "packs.yml");
19580
- SKILLS_DIR = path22.join(ROOT2, "src", "skills");
19814
+ _HERE7 = fileURLToPath17(import.meta.url);
19815
+ ROOT2 = path23.resolve(path23.dirname(_HERE7), "..", "..");
19816
+ OUT = path23.join(ROOT2, "CAPABILITIES.yaml");
19817
+ PACKS_YML = path23.join(ROOT2, "src", "config", "discovery", "packs.yml");
19818
+ SKILLS_DIR = path23.join(ROOT2, "src", "skills");
19581
19819
  TIME_BUDGET_S = 5;
19582
19820
  SIZE_BUDGET_BYTES = 50 * 1024;
19583
19821
  _ArgExit = class extends Error {
@@ -19591,14 +19829,14 @@ var init_generate_capabilities_index = __esm({
19591
19829
  // src/scripts/_lib/claude_plugin.ts
19592
19830
  import * as fs24 from "node:fs";
19593
19831
  import * as os4 from "node:os";
19594
- import * as path23 from "node:path";
19832
+ import * as path24 from "node:path";
19595
19833
  import process11 from "node:process";
19596
19834
  function claude_config_dir() {
19597
19835
  const env = (process11.env["CLAUDE_CONFIG_DIR"] ?? "").trim();
19598
- return env !== "" ? env : path23.join(os4.homedir(), ".claude");
19836
+ return env !== "" ? env : path24.join(os4.homedir(), ".claude");
19599
19837
  }
19600
19838
  function _plugin_id_recorded(plugin_id) {
19601
- const p = path23.join(claude_config_dir(), "plugins", "installed_plugins.json");
19839
+ const p = path24.join(claude_config_dir(), "plugins", "installed_plugins.json");
19602
19840
  let data;
19603
19841
  try {
19604
19842
  data = JSON.parse(fs24.readFileSync(p, "utf-8"));
@@ -19616,7 +19854,7 @@ function claude_plugin_installed() {
19616
19854
  return _plugin_id_recorded(CLAUDE_PLUGIN_ID);
19617
19855
  }
19618
19856
  function _plugin_marketplaces(plugin_id) {
19619
- const p = path23.join(claude_config_dir(), "plugins", "installed_plugins.json");
19857
+ const p = path24.join(claude_config_dir(), "plugins", "installed_plugins.json");
19620
19858
  let data;
19621
19859
  try {
19622
19860
  data = JSON.parse(fs24.readFileSync(p, "utf-8"));
@@ -19630,7 +19868,7 @@ function _plugin_marketplaces(plugin_id) {
19630
19868
  return Object.keys(plugins).filter((k) => k.startsWith(prefix)).map((k) => k.slice(prefix.length));
19631
19869
  }
19632
19870
  function _marketplace_source_repo(marketplace) {
19633
- const p = path23.join(claude_config_dir(), "plugins", "known_marketplaces.json");
19871
+ const p = path24.join(claude_config_dir(), "plugins", "known_marketplaces.json");
19634
19872
  let data;
19635
19873
  try {
19636
19874
  data = JSON.parse(fs24.readFileSync(p, "utf-8"));
@@ -19657,7 +19895,7 @@ function codex_plugin_identity() {
19657
19895
  return { installed: true, identity_verified };
19658
19896
  }
19659
19897
  function claude_plugin_snapshot_version() {
19660
- const p = path23.join(
19898
+ const p = path24.join(
19661
19899
  claude_config_dir(),
19662
19900
  "plugins",
19663
19901
  "marketplaces",
@@ -19796,8 +20034,8 @@ var init_claude_settings_hooks = __esm({
19796
20034
 
19797
20035
  // src/scripts/_lib/cli_wrapper.ts
19798
20036
  import fs26 from "node:fs";
19799
- import path24 from "node:path";
19800
- import { fileURLToPath as fileURLToPath17 } from "node:url";
20037
+ import path25 from "node:path";
20038
+ import { fileURLToPath as fileURLToPath18 } from "node:url";
19801
20039
  function _is_file2(p) {
19802
20040
  try {
19803
20041
  return fs26.statSync(p).isFile();
@@ -19806,7 +20044,7 @@ function _is_file2(p) {
19806
20044
  }
19807
20045
  }
19808
20046
  function _target(project_root) {
19809
- return path24.join(project_root, "agent-config");
20047
+ return path25.join(project_root, "agent-config");
19810
20048
  }
19811
20049
  function install_cli_wrapper(project_root) {
19812
20050
  if (!_is_file2(_TEMPLATE)) return null;
@@ -19819,13 +20057,13 @@ var _PACKAGE_ROOT, _TEMPLATE;
19819
20057
  var init_cli_wrapper = __esm({
19820
20058
  "src/scripts/_lib/cli_wrapper.ts"() {
19821
20059
  "use strict";
19822
- _PACKAGE_ROOT = path24.resolve(
19823
- path24.dirname(fileURLToPath17(import.meta.url)),
20060
+ _PACKAGE_ROOT = path25.resolve(
20061
+ path25.dirname(fileURLToPath18(import.meta.url)),
19824
20062
  "..",
19825
20063
  "..",
19826
20064
  ".."
19827
20065
  );
19828
- _TEMPLATE = path24.join(
20066
+ _TEMPLATE = path25.join(
19829
20067
  _PACKAGE_ROOT,
19830
20068
  "src",
19831
20069
  "templates",
@@ -19856,9 +20094,9 @@ __export(sync_gitignore_exports, {
19856
20094
  unified_diff: () => unified_diff
19857
20095
  });
19858
20096
  import * as fs27 from "node:fs";
19859
- import * as path25 from "node:path";
20097
+ import * as path26 from "node:path";
19860
20098
  import process12 from "node:process";
19861
- import { fileURLToPath as fileURLToPath18, pathToFileURL as pathToFileURL12 } from "node:url";
20099
+ import { fileURLToPath as fileURLToPath19, pathToFileURL as pathToFileURL12 } from "node:url";
19862
20100
  function _strip4(ln) {
19863
20101
  return ln.replace(/\n+$/, "").replace(/\s+$/, "");
19864
20102
  }
@@ -20259,7 +20497,7 @@ function main12(argv) {
20259
20497
  }
20260
20498
  return 0;
20261
20499
  }
20262
- fs27.mkdirSync(path25.dirname(path25.resolve(target)), { recursive: true });
20500
+ fs27.mkdirSync(path26.dirname(path26.resolve(target)), { recursive: true });
20263
20501
  fs27.writeFileSync(target, new_text, "utf-8");
20264
20502
  if (!args.quiet) {
20265
20503
  const action = args.replace ? "replaced" : "updated";
@@ -20280,13 +20518,13 @@ function _isCliEntry12() {
20280
20518
  if (process12.argv[1] === void 0) {
20281
20519
  return false;
20282
20520
  }
20283
- const argvUrl = pathToFileURL12(path25.resolve(process12.argv[1])).href;
20521
+ const argvUrl = pathToFileURL12(path26.resolve(process12.argv[1])).href;
20284
20522
  if (import.meta.url === argvUrl) {
20285
20523
  return true;
20286
20524
  }
20287
20525
  try {
20288
- const here = fs27.realpathSync(fileURLToPath18(import.meta.url));
20289
- const argv = fs27.realpathSync(path25.resolve(process12.argv[1]));
20526
+ const here = fs27.realpathSync(fileURLToPath19(import.meta.url));
20527
+ const argv = fs27.realpathSync(path26.resolve(process12.argv[1]));
20290
20528
  return here === argv;
20291
20529
  } catch {
20292
20530
  return false;
@@ -20299,9 +20537,9 @@ var init_sync_gitignore = __esm({
20299
20537
  SECTION_HEADER = "# event4u/agent-config";
20300
20538
  SECTION_FOOTER = "# event4u/agent-config \u2014 END";
20301
20539
  DEFAULT_GITIGNORE = ".gitignore";
20302
- _HERE8 = fileURLToPath18(import.meta.url);
20303
- DEFAULT_TEMPLATE = path25.join(
20304
- path25.dirname(_HERE8),
20540
+ _HERE8 = fileURLToPath19(import.meta.url);
20541
+ DEFAULT_TEMPLATE = path26.join(
20542
+ path26.dirname(_HERE8),
20305
20543
  "..",
20306
20544
  "..",
20307
20545
  "src",
@@ -20356,9 +20594,9 @@ __export(sync_gitattributes_exports, {
20356
20594
  template_entries: () => template_entries2
20357
20595
  });
20358
20596
  import * as fs28 from "node:fs";
20359
- import * as path26 from "node:path";
20597
+ import * as path27 from "node:path";
20360
20598
  import process13 from "node:process";
20361
- import { fileURLToPath as fileURLToPath19, pathToFileURL as pathToFileURL13 } from "node:url";
20599
+ import { fileURLToPath as fileURLToPath20, pathToFileURL as pathToFileURL13 } from "node:url";
20362
20600
  function _strip5(ln) {
20363
20601
  return ln.replace(/\n+$/, "").replace(/\s+$/, "");
20364
20602
  }
@@ -20531,7 +20769,7 @@ function main13(argv) {
20531
20769
  }
20532
20770
  return 1;
20533
20771
  }
20534
- fs28.mkdirSync(path26.dirname(path26.resolve(target)), { recursive: true });
20772
+ fs28.mkdirSync(path27.dirname(path27.resolve(target)), { recursive: true });
20535
20773
  fs28.writeFileSync(target, new_text, "utf-8");
20536
20774
  if (!args.quiet) {
20537
20775
  process13.stdout.write(
@@ -20545,13 +20783,13 @@ function _isCliEntry13() {
20545
20783
  if (process13.argv[1] === void 0) {
20546
20784
  return false;
20547
20785
  }
20548
- const argvUrl = pathToFileURL13(path26.resolve(process13.argv[1])).href;
20786
+ const argvUrl = pathToFileURL13(path27.resolve(process13.argv[1])).href;
20549
20787
  if (import.meta.url === argvUrl) {
20550
20788
  return true;
20551
20789
  }
20552
20790
  try {
20553
- const here = fs28.realpathSync(fileURLToPath19(import.meta.url));
20554
- const argv = fs28.realpathSync(path26.resolve(process13.argv[1]));
20791
+ const here = fs28.realpathSync(fileURLToPath20(import.meta.url));
20792
+ const argv = fs28.realpathSync(path27.resolve(process13.argv[1]));
20555
20793
  return here === argv;
20556
20794
  } catch {
20557
20795
  return false;
@@ -20564,9 +20802,9 @@ var init_sync_gitattributes = __esm({
20564
20802
  SECTION_HEADER2 = "# --- BEGIN agent-config managed: memory merge attributes ---";
20565
20803
  SECTION_FOOTER2 = "# --- END agent-config managed: memory merge attributes ---";
20566
20804
  DEFAULT_GITATTRIBUTES = ".gitattributes";
20567
- _HERE9 = fileURLToPath19(import.meta.url);
20568
- DEFAULT_TEMPLATE2 = path26.join(
20569
- path26.dirname(_HERE9),
20805
+ _HERE9 = fileURLToPath20(import.meta.url);
20806
+ DEFAULT_TEMPLATE2 = path27.join(
20807
+ path27.dirname(_HERE9),
20570
20808
  "..",
20571
20809
  "agent-src",
20572
20810
  "templates",
@@ -20588,14 +20826,14 @@ var init_sync_gitattributes = __esm({
20588
20826
 
20589
20827
  // src/scripts/_lib/package_root.ts
20590
20828
  import * as fs29 from "node:fs";
20591
- import * as path27 from "node:path";
20592
- import { fileURLToPath as fileURLToPath20 } from "node:url";
20829
+ import * as path28 from "node:path";
20830
+ import { fileURLToPath as fileURLToPath21 } from "node:url";
20593
20831
  function resolvePackageRoot(fromUrlOrPath, legacyHops = 3) {
20594
- const start = fromUrlOrPath.startsWith("file:") ? fileURLToPath20(fromUrlOrPath) : fromUrlOrPath;
20595
- const startDir = path27.dirname(start);
20832
+ const start = fromUrlOrPath.startsWith("file:") ? fileURLToPath21(fromUrlOrPath) : fromUrlOrPath;
20833
+ const startDir = path28.dirname(start);
20596
20834
  let dir = startDir;
20597
20835
  for (let i = 0; i < MAX_ASCENT; i++) {
20598
- const manifest = path27.join(dir, "package.json");
20836
+ const manifest = path28.join(dir, "package.json");
20599
20837
  if (fs29.existsSync(manifest)) {
20600
20838
  try {
20601
20839
  const parsed = JSON.parse(fs29.readFileSync(manifest, "utf8"));
@@ -20605,13 +20843,13 @@ function resolvePackageRoot(fromUrlOrPath, legacyHops = 3) {
20605
20843
  } catch {
20606
20844
  }
20607
20845
  }
20608
- const parent = path27.dirname(dir);
20846
+ const parent = path28.dirname(dir);
20609
20847
  if (parent === dir) {
20610
20848
  break;
20611
20849
  }
20612
20850
  dir = parent;
20613
20851
  }
20614
- return path27.resolve(startDir, ...Array.from({ length: legacyHops }, () => ".."));
20852
+ return path28.resolve(startDir, ...Array.from({ length: legacyHops }, () => ".."));
20615
20853
  }
20616
20854
  var PACKAGE_NAME, MAX_ASCENT;
20617
20855
  var init_package_root = __esm({
@@ -20624,10 +20862,10 @@ var init_package_root = __esm({
20624
20862
 
20625
20863
  // src/scripts/_cli/cmd_refresh.ts
20626
20864
  import * as fs30 from "node:fs";
20627
- import * as path28 from "node:path";
20628
- import { spawnSync as spawnSync5 } from "node:child_process";
20865
+ import * as path29 from "node:path";
20866
+ import { spawnSync as spawnSync6 } from "node:child_process";
20629
20867
  import process14 from "node:process";
20630
- import { fileURLToPath as fileURLToPath21, pathToFileURL as pathToFileURL14 } from "node:url";
20868
+ import { fileURLToPath as fileURLToPath22, pathToFileURL as pathToFileURL14 } from "node:url";
20631
20869
  function _print2(out, line = "") {
20632
20870
  out.write(line + "\n");
20633
20871
  }
@@ -20662,8 +20900,8 @@ function _writeText(p, text) {
20662
20900
  function _remove_legacy_consumer_bridge_marker(project_root, env = null) {
20663
20901
  const env_map = env ?? process14.env;
20664
20902
  if (env_map["AGENT_CONFIG_DEV_MODE"] === "1") return null;
20665
- if (_isDir10(path28.join(project_root, SRC_MARKER_DIR))) return null;
20666
- const target = path28.join(project_root, CONSUMER_BRIDGE_MARKER_RELPATH);
20903
+ if (_isDir10(path29.join(project_root, SRC_MARKER_DIR))) return null;
20904
+ const target = path29.join(project_root, CONSUMER_BRIDGE_MARKER_RELPATH);
20667
20905
  if (!_isFile12(target)) return null;
20668
20906
  try {
20669
20907
  fs30.rmSync(target);
@@ -20673,7 +20911,7 @@ function _remove_legacy_consumer_bridge_marker(project_root, env = null) {
20673
20911
  return target;
20674
20912
  }
20675
20913
  function _default_runner(cmd) {
20676
- const r = spawnSync5(cmd[0], cmd.slice(1), { stdio: "inherit" });
20914
+ const r = spawnSync6(cmd[0], cmd.slice(1), { stdio: "inherit" });
20677
20915
  if (r.error) {
20678
20916
  _stderr.write(`agent-config refresh: cannot run ${cmd[0]}: ${osErrorStr(r.error)}
20679
20917
  `);
@@ -20688,7 +20926,7 @@ function osErrorStr(exc) {
20688
20926
  return String(exc);
20689
20927
  }
20690
20928
  function _refresh_global(runner, out, err) {
20691
- const install_sh = path28.join(PACKAGE_ROOT, "src", "scripts", "install");
20929
+ const install_sh = path29.join(PACKAGE_ROOT, "src", "scripts", "install");
20692
20930
  if (!_isFile12(install_sh)) {
20693
20931
  _print2(err, `\u274C agent-config refresh: installer not found at ${install_sh}`);
20694
20932
  return 1;
@@ -20703,13 +20941,13 @@ function _refresh_global(runner, out, err) {
20703
20941
  return 0;
20704
20942
  }
20705
20943
  function _is_source_repo(project_root) {
20706
- if (_isDir10(path28.join(project_root, "dist/agent-src"))) {
20944
+ if (_isDir10(path29.join(project_root, "dist/agent-src"))) {
20707
20945
  return true;
20708
20946
  }
20709
20947
  if (_glob_packages_uncondensed(project_root).length > 0) {
20710
20948
  return true;
20711
20949
  }
20712
- const pkg = path28.join(project_root, "package.json");
20950
+ const pkg = path29.join(project_root, "package.json");
20713
20951
  if (_isFile12(pkg)) {
20714
20952
  try {
20715
20953
  const data = JSON.parse(_readText(pkg));
@@ -20722,7 +20960,7 @@ function _is_source_repo(project_root) {
20722
20960
  return false;
20723
20961
  }
20724
20962
  function _glob_packages_uncondensed(project_root) {
20725
- const packages = path28.join(project_root, "packages");
20963
+ const packages = path29.join(project_root, "packages");
20726
20964
  let entries;
20727
20965
  try {
20728
20966
  entries = fs30.readdirSync(packages);
@@ -20731,7 +20969,7 @@ function _glob_packages_uncondensed(project_root) {
20731
20969
  }
20732
20970
  const out = [];
20733
20971
  for (const name of entries) {
20734
- const candidate = path28.join(packages, name, SRC_MARKER_DIR);
20972
+ const candidate = path29.join(packages, name, SRC_MARKER_DIR);
20735
20973
  if (_exists5(candidate)) {
20736
20974
  out.push(candidate);
20737
20975
  }
@@ -20750,9 +20988,9 @@ function _refresh_project(project_root, out, err) {
20750
20988
  if (removed !== null) {
20751
20989
  _print2(out, `\u2705 removed legacy bridge marker: ${removed}`);
20752
20990
  }
20753
- const overrides = path28.join(project_root, "agents", "overrides");
20991
+ const overrides = path29.join(project_root, "agents", "overrides");
20754
20992
  fs30.mkdirSync(overrides, { recursive: true });
20755
- const keep = path28.join(overrides, "README.md");
20993
+ const keep = path29.join(overrides, "README.md");
20756
20994
  if (!_exists5(keep)) {
20757
20995
  _writeText(
20758
20996
  keep,
@@ -20780,7 +21018,7 @@ function _sync_gitignore(project_root, out, err) {
20780
21018
  _print2(err, `\u26A0\uFE0F refresh --project: gitignore sync unavailable (${osErrorStr(exc)})`);
20781
21019
  return 0;
20782
21020
  }
20783
- const rc = mod.main(["--path", path28.join(project_root, ".gitignore")]);
21021
+ const rc = mod.main(["--path", path29.join(project_root, ".gitignore")]);
20784
21022
  if (rc !== 0 && rc !== null && rc !== void 0) {
20785
21023
  _print2(err, `\u26A0\uFE0F refresh --project: gitignore sync returned ${rc}`);
20786
21024
  } else {
@@ -20796,7 +21034,7 @@ function _sync_gitattributes(project_root, out, err) {
20796
21034
  _print2(err, `\u26A0\uFE0F refresh --project: gitattributes sync unavailable (${osErrorStr(exc)})`);
20797
21035
  return 0;
20798
21036
  }
20799
- const rc = mod.main(["--path", path28.join(project_root, ".gitattributes")]);
21037
+ const rc = mod.main(["--path", path29.join(project_root, ".gitattributes")]);
20800
21038
  if (rc !== 0 && rc !== null && rc !== void 0) {
20801
21039
  _print2(err, `\u26A0\uFE0F refresh --project: gitattributes sync returned ${rc}`);
20802
21040
  } else {
@@ -20876,13 +21114,13 @@ function _isCliEntry14() {
20876
21114
  if (process14.argv[1] === void 0) {
20877
21115
  return false;
20878
21116
  }
20879
- const argvUrl = pathToFileURL14(path28.resolve(process14.argv[1])).href;
21117
+ const argvUrl = pathToFileURL14(path29.resolve(process14.argv[1])).href;
20880
21118
  if (import.meta.url === argvUrl) {
20881
21119
  return true;
20882
21120
  }
20883
21121
  try {
20884
- const here = fs30.realpathSync(fileURLToPath21(import.meta.url));
20885
- const argv = fs30.realpathSync(path28.resolve(process14.argv[1]));
21122
+ const here = fs30.realpathSync(fileURLToPath22(import.meta.url));
21123
+ const argv = fs30.realpathSync(path29.resolve(process14.argv[1]));
20886
21124
  return here === argv;
20887
21125
  } catch {
20888
21126
  return false;
@@ -20897,7 +21135,7 @@ var init_cmd_refresh = __esm({
20897
21135
  init_sync_gitattributes();
20898
21136
  init_package_root();
20899
21137
  PACKAGE_ROOT = resolvePackageRoot(import.meta.url);
20900
- _HERE10 = fileURLToPath21(import.meta.url);
21138
+ _HERE10 = fileURLToPath22(import.meta.url);
20901
21139
  ArgparseExit3 = class extends Error {
20902
21140
  constructor(code) {
20903
21141
  super(`argparse-exit-${code}`);
@@ -20907,7 +21145,7 @@ var init_cmd_refresh = __esm({
20907
21145
  };
20908
21146
  _stdout = { write: (t) => process14.stdout.write(t) };
20909
21147
  _stderr = { write: (t) => process14.stderr.write(t) };
20910
- CONSUMER_BRIDGE_MARKER_RELPATH = path28.join("agents", ".event4u-bridge.yml");
21148
+ CONSUMER_BRIDGE_MARKER_RELPATH = path29.join("agents", ".event4u-bridge.yml");
20911
21149
  SRC_MARKER_DIR = ".agent-src.uncondensed";
20912
21150
  PROG3 = "agent-config refresh";
20913
21151
  USAGE = `usage: ${PROG3} [-h] [--global] [--project]
@@ -20936,7 +21174,7 @@ var init_install_layout = __esm({
20936
21174
  // src/scripts/_lib/installed_lock.ts
20937
21175
  import * as fs31 from "node:fs";
20938
21176
  import * as os5 from "node:os";
20939
- import * as path29 from "node:path";
21177
+ import * as path30 from "node:path";
20940
21178
  function _default_lockfile() {
20941
21179
  return write_target("installed.lock");
20942
21180
  }
@@ -20945,7 +21183,7 @@ function expanduser2(p) {
20945
21183
  return os5.homedir();
20946
21184
  }
20947
21185
  if (p.startsWith("~/") || process.platform === "win32" && p.startsWith("~\\")) {
20948
- return path29.join(os5.homedir(), p.slice(2));
21186
+ return path30.join(os5.homedir(), p.slice(2));
20949
21187
  }
20950
21188
  return p;
20951
21189
  }
@@ -20961,8 +21199,8 @@ function lockfile_path(env) {
20961
21199
  }
20962
21200
  return write_target("installed.lock", { env: env ?? null });
20963
21201
  }
20964
- function read_lockfile(path49) {
20965
- const target = path49 ?? lockfile_path();
21202
+ function read_lockfile(path50) {
21203
+ const target = path50 ?? lockfile_path();
20966
21204
  let text;
20967
21205
  try {
20968
21206
  text = fs31.readFileSync(target, { encoding: "utf-8" });
@@ -21036,7 +21274,7 @@ var init_installed_lock = __esm({
21036
21274
 
21037
21275
  // src/scripts/_lib/fs_atomic.ts
21038
21276
  import fs32 from "node:fs";
21039
- import path30 from "node:path";
21277
+ import path31 from "node:path";
21040
21278
  import { randomBytes as randomBytes2 } from "node:crypto";
21041
21279
  function _normalize_encoding(encoding) {
21042
21280
  const compact = encoding.toLowerCase().replace(/[-_\s]/g, "");
@@ -21052,8 +21290,8 @@ function _normalize_encoding(encoding) {
21052
21290
  }
21053
21291
  function write_atomic(p, data, options = {}) {
21054
21292
  const encoding = options.encoding ?? "utf-8";
21055
- const target = path30.normalize(p);
21056
- const parent = path30.dirname(target);
21293
+ const target = path31.normalize(p);
21294
+ const parent = path31.dirname(target);
21057
21295
  fs32.mkdirSync(parent, { recursive: true });
21058
21296
  let payload;
21059
21297
  if (typeof data === "string") {
@@ -21068,9 +21306,9 @@ function write_atomic(p, data, options = {}) {
21068
21306
  let fd = null;
21069
21307
  let tmp_path = "";
21070
21308
  for (let attempt = 0; attempt < 32; attempt += 1) {
21071
- tmp_path = path30.join(
21309
+ tmp_path = path31.join(
21072
21310
  parent,
21073
- `.${path30.basename(target)}.tmp.${randomBytes2(6).toString("hex")}`
21311
+ `.${path31.basename(target)}.tmp.${randomBytes2(6).toString("hex")}`
21074
21312
  );
21075
21313
  try {
21076
21314
  fd = fs32.openSync(tmp_path, "wx", 384);
@@ -21172,18 +21410,18 @@ function manifest_path(project_root, env) {
21172
21410
  }
21173
21411
  return fsPath.join(project_root, DEFAULT_MANIFEST_RELATIVE);
21174
21412
  }
21175
- function read_manifest(path49) {
21413
+ function read_manifest(path50) {
21176
21414
  let text;
21177
21415
  try {
21178
- text = require_read_text(path49);
21416
+ text = require_read_text(path50);
21179
21417
  } catch {
21180
21418
  return null;
21181
21419
  }
21182
21420
  const data = _parse_manual(text);
21183
21421
  return _normalise_v2_shape(data);
21184
21422
  }
21185
- function require_read_text(path49) {
21186
- return fs33.readFileSync(path49, { encoding: "utf-8" });
21423
+ function require_read_text(path50) {
21424
+ return fs33.readFileSync(path50, { encoding: "utf-8" });
21187
21425
  }
21188
21426
  function _normalise_v2_shape(data) {
21189
21427
  if (data["tools"] === void 0 || data["tools"] === null) {
@@ -21364,9 +21602,9 @@ function stable_sort(items, key) {
21364
21602
  return a.index - b.index;
21365
21603
  }).map((entry) => entry.item);
21366
21604
  }
21367
- function write_manifest(path49, version, tools, options = {}) {
21605
+ function write_manifest(path50, version, tools, options = {}) {
21368
21606
  const rendered = _render(version, tools, { deploy_roots: options.deploy_roots ?? null });
21369
- return write_atomic(path49, rendered);
21607
+ return write_atomic(path50, rendered);
21370
21608
  }
21371
21609
  function upsert_tool(existing, options) {
21372
21610
  const {
@@ -21498,13 +21736,13 @@ __export(global_deploy_inventory_exports, {
21498
21736
  import { randomBytes as randomBytes3 } from "node:crypto";
21499
21737
  import * as fs34 from "node:fs";
21500
21738
  import * as os7 from "node:os";
21501
- import * as path31 from "node:path";
21739
+ import * as path32 from "node:path";
21502
21740
  function expanduser4(p) {
21503
21741
  if (p === "~") {
21504
21742
  return os7.homedir();
21505
21743
  }
21506
21744
  if (p.startsWith("~/") || process.platform === "win32" && p.startsWith("~\\")) {
21507
- return path31.join(os7.homedir(), p.slice(2));
21745
+ return path32.join(os7.homedir(), p.slice(2));
21508
21746
  }
21509
21747
  return p;
21510
21748
  }
@@ -21512,14 +21750,14 @@ function resolve_path(p) {
21512
21750
  try {
21513
21751
  return fs34.realpathSync(p);
21514
21752
  } catch {
21515
- const abs = path31.resolve(p);
21516
- const parts = abs.split(path31.sep);
21753
+ const abs = path32.resolve(p);
21754
+ const parts = abs.split(path32.sep);
21517
21755
  for (let i = parts.length; i > 0; i -= 1) {
21518
- const prefix = parts.slice(0, i).join(path31.sep) || path31.sep;
21756
+ const prefix = parts.slice(0, i).join(path32.sep) || path32.sep;
21519
21757
  try {
21520
21758
  const real = fs34.realpathSync(prefix);
21521
21759
  const rest = parts.slice(i);
21522
- return rest.length > 0 ? path31.join(real, ...rest) : real;
21760
+ return rest.length > 0 ? path32.join(real, ...rest) : real;
21523
21761
  } catch {
21524
21762
  continue;
21525
21763
  }
@@ -21558,13 +21796,13 @@ function load_inventory(p) {
21558
21796
  }
21559
21797
  function save_inventory(data, p) {
21560
21798
  const target = p ?? inventory_path();
21561
- fs34.mkdirSync(path31.dirname(target), { recursive: true });
21799
+ fs34.mkdirSync(path32.dirname(target), { recursive: true });
21562
21800
  const payload = json_dumps_sorted(data, 2) + "\n";
21563
- const parent = path31.dirname(target);
21801
+ const parent = path32.dirname(target);
21564
21802
  let fd = null;
21565
21803
  let tmp_name = "";
21566
21804
  for (let attempt = 0; attempt < 32; attempt += 1) {
21567
- tmp_name = path31.join(parent, `${path31.basename(target)}.${randomBytes3(6).toString("hex")}`);
21805
+ tmp_name = path32.join(parent, `${path32.basename(target)}.${randomBytes3(6).toString("hex")}`);
21568
21806
  try {
21569
21807
  fd = fs34.openSync(tmp_name, "wx", 384);
21570
21808
  break;
@@ -21661,7 +21899,7 @@ function expected_deploy_files(src, dest_rel, file_filter = null) {
21661
21899
  const _walk = (node, prefix) => {
21662
21900
  const entries = fs34.readdirSync(node).sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
21663
21901
  for (const name of entries) {
21664
- const entry = path31.join(node, name);
21902
+ const entry = path32.join(node, name);
21665
21903
  const rel = join_rel(prefix, name);
21666
21904
  const lst = fs34.lstatSync(entry);
21667
21905
  if (lst.isDirectory() && !lst.isSymbolicLink()) {
@@ -21688,13 +21926,13 @@ function expected_deploy_files(src, dest_rel, file_filter = null) {
21688
21926
  return out;
21689
21927
  }
21690
21928
  function join_rel(prefix, name) {
21691
- return prefix ? path31.join(prefix, name) : name;
21929
+ return prefix ? path32.join(prefix, name) : name;
21692
21930
  }
21693
21931
  function as_posix(p) {
21694
21932
  if (p === "") {
21695
21933
  return ".";
21696
21934
  }
21697
- return p.split(path31.sep).join("/");
21935
+ return p.split(path32.sep).join("/");
21698
21936
  }
21699
21937
  function reap_stale(tool_id, anchor, current_files, inventory, dry_run = false) {
21700
21938
  const tools = inventory["tools"] ?? {};
@@ -21719,9 +21957,9 @@ function reap_stale(tool_id, anchor, current_files, inventory, dry_run = false)
21719
21957
  if (typeof rel !== "string" || !rel || rel.startsWith("/") || rel.startsWith("..")) {
21720
21958
  continue;
21721
21959
  }
21722
- const target = path31.join(anchor_resolved, rel);
21960
+ const target = path32.join(anchor_resolved, rel);
21723
21961
  try {
21724
- relative_to(resolve_path(path31.dirname(target)), anchor_resolved);
21962
+ relative_to(resolve_path(path32.dirname(target)), anchor_resolved);
21725
21963
  } catch {
21726
21964
  continue;
21727
21965
  }
@@ -21746,7 +21984,7 @@ function reap_stale(tool_id, anchor, current_files, inventory, dry_run = false)
21746
21984
  continue;
21747
21985
  }
21748
21986
  deleted.push(target);
21749
- prune_candidates.add(path31.dirname(target));
21987
+ prune_candidates.add(path32.dirname(target));
21750
21988
  }
21751
21989
  prune_empty_dirs(prune_candidates, anchor_resolved);
21752
21990
  return deleted;
@@ -21757,7 +21995,7 @@ function reap_tagged_orphans(anchor, dest_subs, current_files, package_tag, dry_
21757
21995
  const prune_candidates = /* @__PURE__ */ new Set();
21758
21996
  const needle = `package: ${package_tag}`;
21759
21997
  for (const dest_sub of dest_subs) {
21760
- const root = dest_sub ? path31.join(anchor_resolved, dest_sub) : anchor_resolved;
21998
+ const root = dest_sub ? path32.join(anchor_resolved, dest_sub) : anchor_resolved;
21761
21999
  let root_stat;
21762
22000
  try {
21763
22001
  root_stat = fs34.statSync(root);
@@ -21782,7 +22020,7 @@ function reap_tagged_orphans(anchor, dest_subs, current_files, package_tag, dry_
21782
22020
  continue;
21783
22021
  }
21784
22022
  try {
21785
- relative_to(resolve_path(path31.dirname(md)), anchor_resolved);
22023
+ relative_to(resolve_path(path32.dirname(md)), anchor_resolved);
21786
22024
  } catch {
21787
22025
  continue;
21788
22026
  }
@@ -21811,7 +22049,7 @@ function reap_tagged_orphans(anchor, dest_subs, current_files, package_tag, dry_
21811
22049
  continue;
21812
22050
  }
21813
22051
  deleted.push(md);
21814
- prune_candidates.add(path31.dirname(md));
22052
+ prune_candidates.add(path32.dirname(md));
21815
22053
  }
21816
22054
  }
21817
22055
  prune_empty_dirs(prune_candidates, anchor_resolved);
@@ -21831,7 +22069,7 @@ function record_deploy(tool_id, anchor, current_files, inventory) {
21831
22069
  }
21832
22070
  function prune_empty_dirs(prune_candidates, anchor_resolved) {
21833
22071
  const ordered = [...prune_candidates].sort(
21834
- (a, b) => b.split(path31.sep).length - a.split(path31.sep).length
22072
+ (a, b) => b.split(path32.sep).length - a.split(path32.sep).length
21835
22073
  );
21836
22074
  for (const start of ordered) {
21837
22075
  let node = start;
@@ -21841,26 +22079,26 @@ function prune_empty_dirs(prune_candidates, anchor_resolved) {
21841
22079
  } catch {
21842
22080
  break;
21843
22081
  }
21844
- node = path31.dirname(node);
22082
+ node = path32.dirname(node);
21845
22083
  }
21846
22084
  }
21847
22085
  }
21848
22086
  function is_ancestor(anchor, node) {
21849
- const rel = path31.relative(anchor, node);
21850
- return rel !== "" && !rel.startsWith("..") && !path31.isAbsolute(rel);
22087
+ const rel = path32.relative(anchor, node);
22088
+ return rel !== "" && !rel.startsWith("..") && !path32.isAbsolute(rel);
21851
22089
  }
21852
22090
  function relative_to(child, parent) {
21853
22091
  if (child === parent) {
21854
22092
  return "";
21855
22093
  }
21856
- const rel = path31.relative(parent, child);
21857
- if (rel.startsWith("..") || path31.isAbsolute(rel)) {
22094
+ const rel = path32.relative(parent, child);
22095
+ if (rel.startsWith("..") || path32.isAbsolute(rel)) {
21858
22096
  throw new Error(`'${child}' is not in the subpath of '${parent}'`);
21859
22097
  }
21860
22098
  return rel;
21861
22099
  }
21862
22100
  function relative_to_posix(child, parent) {
21863
- return path31.relative(parent, child).split(path31.sep).join("/");
22101
+ return path32.relative(parent, child).split(path32.sep).join("/");
21864
22102
  }
21865
22103
  function rglob_md(root) {
21866
22104
  const out = [];
@@ -21872,7 +22110,7 @@ function rglob_md(root) {
21872
22110
  return;
21873
22111
  }
21874
22112
  for (const name of names) {
21875
- const full = path31.join(dir, name);
22113
+ const full = path32.join(dir, name);
21876
22114
  let lst;
21877
22115
  try {
21878
22116
  lst = fs34.lstatSync(full);
@@ -21927,7 +22165,7 @@ var init_global_deploy_inventory = __esm({
21927
22165
 
21928
22166
  // src/scripts/_lib/duplicate_scope_census.ts
21929
22167
  import * as fs35 from "node:fs";
21930
- import * as path32 from "node:path";
22168
+ import * as path33 from "node:path";
21931
22169
  function censusDuplicateScope(userRulesDir, projectRulesDir) {
21932
22170
  if (!fs35.existsSync(userRulesDir) || !fs35.existsSync(projectRulesDir)) {
21933
22171
  return {
@@ -21944,8 +22182,8 @@ function censusDuplicateScope(userRulesDir, projectRulesDir) {
21944
22182
  for (const f of projectFiles) {
21945
22183
  if (!userFiles.has(f)) continue;
21946
22184
  shared.push(f);
21947
- const a = fs35.statSync(path32.join(userRulesDir, f)).size;
21948
- const b = fs35.statSync(path32.join(projectRulesDir, f)).size;
22185
+ const a = fs35.statSync(path33.join(userRulesDir, f)).size;
22186
+ const b = fs35.statSync(path33.join(projectRulesDir, f)).size;
21949
22187
  duplicateChars += Math.min(a, b);
21950
22188
  }
21951
22189
  shared.sort();
@@ -22042,8 +22280,8 @@ var init_spawn_env = __esm({
22042
22280
  // src/scripts/ai_council/events_log.ts
22043
22281
  import * as crypto4 from "node:crypto";
22044
22282
  import * as fs36 from "node:fs";
22045
- import * as path33 from "node:path";
22046
- import { fileURLToPath as fileURLToPath22 } from "node:url";
22283
+ import * as path34 from "node:path";
22284
+ import { fileURLToPath as fileURLToPath23 } from "node:url";
22047
22285
  function _hash_original_ask(originalAsk) {
22048
22286
  if (!originalAsk) {
22049
22287
  return "0".repeat(12);
@@ -22138,7 +22376,7 @@ function appendEvent(event, opts = {}) {
22138
22376
  }
22139
22377
  }
22140
22378
  const target = opts.logPath != null ? opts.logPath : _DEFAULT_LOG_PATH;
22141
- fs36.mkdirSync(path33.dirname(target), { recursive: true });
22379
+ fs36.mkdirSync(path34.dirname(target), { recursive: true });
22142
22380
  const line = _pyJsonDumpsCompact(record);
22143
22381
  fs36.appendFileSync(target, line + "\n", { encoding: "utf-8" });
22144
22382
  return true;
@@ -22237,9 +22475,9 @@ var init_events_log = __esm({
22237
22475
  "block_quota"
22238
22476
  ]);
22239
22477
  _KILL_SWITCH_ENV = "AGENT_CONFIG_NO_EVENTS_LOG";
22240
- _HERE11 = fileURLToPath22(import.meta.url);
22241
- _REPO_ROOT = path33.resolve(path33.dirname(_HERE11), "..", "..", "..");
22242
- _DEFAULT_LOG_PATH = path33.join(
22478
+ _HERE11 = fileURLToPath23(import.meta.url);
22479
+ _REPO_ROOT = path34.resolve(path34.dirname(_HERE11), "..", "..", "..");
22480
+ _DEFAULT_LOG_PATH = path34.join(
22243
22481
  _REPO_ROOT,
22244
22482
  "agents",
22245
22483
  "runtime",
@@ -22304,9 +22542,9 @@ __export(clients_exports, {
22304
22542
  record_cli_call: () => record_cli_call,
22305
22543
  reset_cli_call_counts: () => reset_cli_call_counts
22306
22544
  });
22307
- import { spawnSync as spawnSync6 } from "node:child_process";
22545
+ import { spawnSync as spawnSync7 } from "node:child_process";
22308
22546
  import * as fs37 from "node:fs";
22309
- import * as path34 from "node:path";
22547
+ import * as path35 from "node:path";
22310
22548
  function _resolveKeyPath(filename) {
22311
22549
  const found = resolve_with_fallback(filename);
22312
22550
  if (found !== null) {
@@ -22396,7 +22634,7 @@ function _curlJsonPost(url, extraHeaders, body) {
22396
22634
  }
22397
22635
  args.push("--connect-timeout", "30", "--max-time", "290");
22398
22636
  args.push("-w", "\n%{http_code}", "--data-binary", "@-");
22399
- const r = spawnSync6("curl", args, {
22637
+ const r = spawnSync7("curl", args, {
22400
22638
  input: JSON.stringify(body),
22401
22639
  encoding: "utf8",
22402
22640
  maxBuffer: 64 * 1024 * 1024,
@@ -22461,7 +22699,7 @@ function record_cli_call(provider, p = null) {
22461
22699
  const target = p !== null ? p : _cliCallsStatePath();
22462
22700
  const counts = load_cli_call_counts(target);
22463
22701
  counts[provider] = (counts[provider] ?? 0) + 1;
22464
- fs37.mkdirSync(path34.dirname(target), { recursive: true });
22702
+ fs37.mkdirSync(path35.dirname(target), { recursive: true });
22465
22703
  fs37.writeFileSync(
22466
22704
  target,
22467
22705
  _jsonDumpsIndent2({ date: _today_utc_iso(), counts }),
@@ -22477,7 +22715,7 @@ function reset_cli_call_counts(provider = null, p = null) {
22477
22715
  } else {
22478
22716
  delete counts[provider];
22479
22717
  }
22480
- fs37.mkdirSync(path34.dirname(target), { recursive: true });
22718
+ fs37.mkdirSync(path35.dirname(target), { recursive: true });
22481
22719
  fs37.writeFileSync(
22482
22720
  target,
22483
22721
  _jsonDumpsIndent2({ date: _today_utc_iso(), counts }),
@@ -22773,7 +23011,7 @@ function _pyJsonStringAscii(s) {
22773
23011
  return out + '"';
22774
23012
  }
22775
23013
  function _which(name) {
22776
- if (name.includes(path34.sep) || path34.sep !== "/" && name.includes("/")) {
23014
+ if (name.includes(path35.sep) || path35.sep !== "/" && name.includes("/")) {
22777
23015
  return _isExecutable(name) ? name : null;
22778
23016
  }
22779
23017
  const pathEnv = process.env.PATH ?? "";
@@ -22781,12 +23019,12 @@ function _which(name) {
22781
23019
  return null;
22782
23020
  }
22783
23021
  const exts = process.platform === "win32" ? (process.env.PATHEXT ?? ".COM;.EXE;.BAT;.CMD").split(";").filter(Boolean) : [""];
22784
- for (const dir of pathEnv.split(path34.delimiter)) {
23022
+ for (const dir of pathEnv.split(path35.delimiter)) {
22785
23023
  if (!dir) {
22786
23024
  continue;
22787
23025
  }
22788
23026
  for (const ext of exts) {
22789
- const candidate = path34.join(dir, name + ext);
23027
+ const candidate = path35.join(dir, name + ext);
22790
23028
  if (_isExecutable(candidate)) {
22791
23029
  return candidate;
22792
23030
  }
@@ -23407,7 +23645,7 @@ ${user_prompt}`;
23407
23645
  if (stdinPayload !== null) {
23408
23646
  spawnOpts.input = stdinPayload;
23409
23647
  }
23410
- const r = spawnSync6(argv0, cmd.slice(1), spawnOpts);
23648
+ const r = spawnSync7(argv0, cmd.slice(1), spawnOpts);
23411
23649
  if (r.error) {
23412
23650
  const err = r.error;
23413
23651
  if (r.signal === "SIGTERM" || err.code === "ETIMEDOUT") {
@@ -24072,7 +24310,7 @@ __export(config_exports, {
24072
24310
  });
24073
24311
  import * as fs38 from "node:fs";
24074
24312
  import * as os8 from "node:os";
24075
- import * as path35 from "node:path";
24313
+ import * as path36 from "node:path";
24076
24314
  function _pyReprStr(s) {
24077
24315
  const hasSingle = s.includes("'");
24078
24316
  const hasDouble = s.includes('"');
@@ -24243,7 +24481,7 @@ function _expanduser2(p) {
24243
24481
  return os8.homedir();
24244
24482
  }
24245
24483
  if (p.startsWith("~/") || process.platform === "win32" && p.startsWith("~\\")) {
24246
- return path35.join(os8.homedir(), p.slice(2));
24484
+ return path36.join(os8.homedir(), p.slice(2));
24247
24485
  }
24248
24486
  return p;
24249
24487
  }
@@ -25469,10 +25707,10 @@ var init_agentSwitchDetection = __esm({
25469
25707
  });
25470
25708
 
25471
25709
  // src/scripts/_lib/environment_detector.ts
25472
- import { spawnSync as spawnSync7 } from "node:child_process";
25710
+ import { spawnSync as spawnSync8 } from "node:child_process";
25473
25711
  import * as fs39 from "node:fs";
25474
25712
  import * as os9 from "node:os";
25475
- import * as path36 from "node:path";
25713
+ import * as path37 from "node:path";
25476
25714
  function knownProviders() {
25477
25715
  return Object.keys(PROVIDER_CLI_META);
25478
25716
  }
@@ -25487,7 +25725,7 @@ function classifyBilling(provider, source) {
25487
25725
  function codexHome(env) {
25488
25726
  const map = env ?? process.env;
25489
25727
  const override = (map["CODEX_HOME"] ?? "").trim();
25490
- return override !== "" ? override : path36.join(homeOf(env), ".codex");
25728
+ return override !== "" ? override : path37.join(homeOf(env), ".codex");
25491
25729
  }
25492
25730
  function homeOf(env) {
25493
25731
  const map = env ?? process.env;
@@ -25496,7 +25734,7 @@ function homeOf(env) {
25496
25734
  }
25497
25735
  function defaultProbeVersion(binary) {
25498
25736
  try {
25499
- const res = spawnSync7(binary, ["--version"], {
25737
+ const res = spawnSync8(binary, ["--version"], {
25500
25738
  timeout: VERSION_PROBE_TIMEOUT_MS,
25501
25739
  encoding: "utf-8",
25502
25740
  windowsHide: true,
@@ -25543,18 +25781,18 @@ function cliSubscriptionEvidence(provider, home, env, claudeConfigDir) {
25543
25781
  if (provider === "anthropic") {
25544
25782
  const configDir = claudeConfigDir;
25545
25783
  for (const rel of [".credentials.json", "credentials.json"]) {
25546
- const p = path36.join(configDir, rel);
25784
+ const p = path37.join(configDir, rel);
25547
25785
  if (isFile2(p)) return { source: "cli-subscription", evidence: p };
25548
25786
  }
25549
25787
  return null;
25550
25788
  }
25551
25789
  if (provider === "openai") {
25552
- const p = path36.join(codexHome(env), "auth.json");
25790
+ const p = path37.join(codexHome(env), "auth.json");
25553
25791
  if (isFile2(p)) return { source: classifyCodexAuth(p), evidence: p };
25554
25792
  return null;
25555
25793
  }
25556
25794
  if (provider === "gemini") {
25557
- const p = path36.join(home, ".gemini", "oauth_creds.json");
25795
+ const p = path37.join(home, ".gemini", "oauth_creds.json");
25558
25796
  if (isFile2(p)) return { source: "cli-subscription", evidence: p };
25559
25797
  return null;
25560
25798
  }
@@ -25586,7 +25824,7 @@ function detectHosts(opts) {
25586
25824
  function detectAuth(opts) {
25587
25825
  const env = opts.env ?? process.env;
25588
25826
  const home = opts.home ?? homeOf(opts.env);
25589
- const claudeConfigDir = opts.home === void 0 && opts.env === void 0 ? claude_config_dir() : (env["CLAUDE_CONFIG_DIR"] ?? "").trim() || path36.join(home, ".claude");
25827
+ const claudeConfigDir = opts.home === void 0 && opts.env === void 0 ? claude_config_dir() : (env["CLAUDE_CONFIG_DIR"] ?? "").trim() || path37.join(home, ".claude");
25590
25828
  const auth = [];
25591
25829
  const keys = [];
25592
25830
  for (const provider of knownProviders()) {
@@ -25791,7 +26029,7 @@ var init_transport_resolver = __esm({
25791
26029
  });
25792
26030
 
25793
26031
  // src/scripts/_cli/detection_report.ts
25794
- import * as path37 from "node:path";
26032
+ import * as path38 from "node:path";
25795
26033
  function envRefResolves(ref, env) {
25796
26034
  if (ref === null || !ref.startsWith("env:")) return false;
25797
26035
  const name = ref.slice("env:".length).trim();
@@ -25866,7 +26104,7 @@ function cliBinaryPresent(environment, provider, binaryOverride) {
25866
26104
  const expected = PROVIDER_CLI_META[provider]?.[0];
25867
26105
  if (expected === void 0) return false;
25868
26106
  return environment.hosts.some(
25869
- (h) => h.binary !== null && stripExe(path37.basename(h.binary)) === expected
26107
+ (h) => h.binary !== null && stripExe(path38.basename(h.binary)) === expected
25870
26108
  );
25871
26109
  }
25872
26110
  function stripExe(name) {
@@ -26066,7 +26304,7 @@ var init_config2 = __esm({
26066
26304
  import * as crypto5 from "node:crypto";
26067
26305
  import * as fs40 from "node:fs";
26068
26306
  import * as os10 from "node:os";
26069
- import * as path38 from "node:path";
26307
+ import * as path39 from "node:path";
26070
26308
  function _workspace_state_segment(workspace_root) {
26071
26309
  let canonical = workspace_root;
26072
26310
  try {
@@ -26074,7 +26312,7 @@ function _workspace_state_segment(workspace_root) {
26074
26312
  } catch {
26075
26313
  canonical = workspace_root;
26076
26314
  }
26077
- const slug_source = path38.basename(workspace_root) || "workspace";
26315
+ const slug_source = path39.basename(workspace_root) || "workspace";
26078
26316
  const slug = slug_source.replace(/[^a-zA-Z0-9._-]+/g, "-").replace(/^-+|-+$/g, "") || "workspace";
26079
26317
  const hash = crypto5.createHash("sha256").update(canonical).digest("hex").slice(0, 16);
26080
26318
  return `${slug}-${hash}`;
@@ -26084,19 +26322,19 @@ function upstream_state_dir_candidates(workspace_root) {
26084
26322
  const candidates = [];
26085
26323
  const env = (process.env["CLAUDE_PLUGIN_DATA"] ?? "").trim();
26086
26324
  if (env !== "") {
26087
- candidates.push(path38.join(env, "state", segment));
26325
+ candidates.push(path39.join(env, "state", segment));
26088
26326
  }
26089
26327
  candidates.push(
26090
- path38.join(claude_config_dir(), "plugins", "data", _CODEX_PLUGIN_DATA_DIRNAME, "state", segment)
26328
+ path39.join(claude_config_dir(), "plugins", "data", _CODEX_PLUGIN_DATA_DIRNAME, "state", segment)
26091
26329
  );
26092
- candidates.push(path38.join(os10.tmpdir(), "codex-companion", segment));
26330
+ candidates.push(path39.join(os10.tmpdir(), "codex-companion", segment));
26093
26331
  return candidates;
26094
26332
  }
26095
26333
  function upstream_gate_enabled(workspace_root) {
26096
26334
  for (const dir of upstream_state_dir_candidates(workspace_root)) {
26097
26335
  let parsed;
26098
26336
  try {
26099
- parsed = JSON.parse(fs40.readFileSync(path38.join(dir, "state.json"), "utf-8"));
26337
+ parsed = JSON.parse(fs40.readFileSync(path39.join(dir, "state.json"), "utf-8"));
26100
26338
  } catch {
26101
26339
  continue;
26102
26340
  }
@@ -26149,7 +26387,7 @@ var init_review_gate = __esm({
26149
26387
  init_claude_plugin();
26150
26388
  init_state_io();
26151
26389
  init_config2();
26152
- GATE_LEDGER_RELPATH = path38.join("agents", "runtime", "team", "events.log");
26390
+ GATE_LEDGER_RELPATH = path39.join("agents", "runtime", "team", "events.log");
26153
26391
  _CODEX_PLUGIN_DATA_DIRNAME = `${CODEX_PLUGIN_ID}-${CODEX_MARKETPLACE_NAME}`;
26154
26392
  UPSTREAM_GATE_COST_WARNING = "The review gate can create a long-running Claude/Codex loop and may drain usage limits quickly.";
26155
26393
  }
@@ -26220,7 +26458,7 @@ var init_ruleInScope = __esm({
26220
26458
 
26221
26459
  // src/install/rule_scope.ts
26222
26460
  import * as fs42 from "node:fs";
26223
- import * as path39 from "node:path";
26461
+ import * as path40 from "node:path";
26224
26462
  function _list(value) {
26225
26463
  if (Array.isArray(value) && value.length > 0) {
26226
26464
  return value.map((v) => String(v));
@@ -26243,7 +26481,7 @@ function ruleFileArrives(sourcePath, scope) {
26243
26481
  if (!sourcePath.endsWith(".md")) {
26244
26482
  return true;
26245
26483
  }
26246
- const basename18 = path39.basename(sourcePath);
26484
+ const basename18 = path40.basename(sourcePath);
26247
26485
  if (COMPAT_ALWAYS_EXCLUDED.includes(basename18)) {
26248
26486
  return false;
26249
26487
  }
@@ -26261,7 +26499,7 @@ function excludedRuleBasenames(rulesDir, scope) {
26261
26499
  if (!name.endsWith(".md")) {
26262
26500
  continue;
26263
26501
  }
26264
- const full = path39.join(rulesDir, name);
26502
+ const full = path40.join(rulesDir, name);
26265
26503
  try {
26266
26504
  if (!fs42.statSync(full).isFile()) {
26267
26505
  continue;
@@ -26355,13 +26593,13 @@ __export(cmd_doctor_exports, {
26355
26593
  import * as crypto6 from "node:crypto";
26356
26594
  import * as fs43 from "node:fs";
26357
26595
  import * as os11 from "node:os";
26358
- import * as path40 from "node:path";
26596
+ import * as path41 from "node:path";
26359
26597
  import process15 from "node:process";
26360
- import { fileURLToPath as fileURLToPath23, pathToFileURL as pathToFileURL15 } from "node:url";
26598
+ import { fileURLToPath as fileURLToPath24, pathToFileURL as pathToFileURL15 } from "node:url";
26361
26599
  function expanduser5(p) {
26362
26600
  if (p === "~") return os11.homedir();
26363
26601
  if (p.startsWith("~/") || p.startsWith("~\\")) {
26364
- return path40.join(os11.homedir(), p.slice(2));
26602
+ return path41.join(os11.homedir(), p.slice(2));
26365
26603
  }
26366
26604
  return p;
26367
26605
  }
@@ -26389,9 +26627,9 @@ function isDir2(p) {
26389
26627
  }
26390
26628
  function resolvePath(p) {
26391
26629
  try {
26392
- return fs43.realpathSync(path40.resolve(p));
26630
+ return fs43.realpathSync(path41.resolve(p));
26393
26631
  } catch {
26394
- return path40.resolve(p);
26632
+ return path41.resolve(p);
26395
26633
  }
26396
26634
  }
26397
26635
  function readText2(p) {
@@ -26502,7 +26740,7 @@ function _resolve_project_root(arg) {
26502
26740
  return resolve_project_root(arg);
26503
26741
  }
26504
26742
  function _detect_install_mode(project_root) {
26505
- const marker = path40.join(project_root, _INSTALL_MODE_MARKER_REL);
26743
+ const marker = path41.join(project_root, _INSTALL_MODE_MARKER_REL);
26506
26744
  if (isFile3(marker)) {
26507
26745
  let value;
26508
26746
  try {
@@ -26514,9 +26752,9 @@ function _detect_install_mode(project_root) {
26514
26752
  return [value, "marker-file"];
26515
26753
  }
26516
26754
  }
26517
- const has_agents_md = pathExists(path40.join(project_root, "AGENTS.md"));
26755
+ const has_agents_md = pathExists(path41.join(project_root, "AGENTS.md"));
26518
26756
  const has_copilot = pathExists(
26519
- path40.join(project_root, ".github", "copilot-instructions.md")
26757
+ path41.join(project_root, ".github", "copilot-instructions.md")
26520
26758
  );
26521
26759
  if (has_agents_md && has_copilot) {
26522
26760
  return ["full", "heuristic"];
@@ -26536,7 +26774,7 @@ function _settings_layer_chain(project_root) {
26536
26774
  return layers;
26537
26775
  }
26538
26776
  function _detect_wrapper(project_root) {
26539
- const wrapper = path40.join(project_root, "agent-config");
26777
+ const wrapper = path41.join(project_root, "agent-config");
26540
26778
  if (!pathExists(wrapper)) {
26541
26779
  return { path: String(wrapper), exists: false, embedded_root: null };
26542
26780
  }
@@ -26603,8 +26841,8 @@ function _emit_context_text(ctx) {
26603
26841
  }
26604
26842
  function _resolve_path(project_root, raw) {
26605
26843
  let p = expanduser5(raw);
26606
- if (!path40.isAbsolute(p)) {
26607
- p = path40.join(project_root, p);
26844
+ if (!path41.isAbsolute(p)) {
26845
+ p = path41.join(project_root, p);
26608
26846
  }
26609
26847
  return p;
26610
26848
  }
@@ -26617,7 +26855,7 @@ function _sha256(p) {
26617
26855
  }
26618
26856
  }
26619
26857
  function _read_inline_package_tag(p) {
26620
- if (path40.extname(p) !== ".md") {
26858
+ if (path41.extname(p) !== ".md") {
26621
26859
  return NO_FRONTMATTER;
26622
26860
  }
26623
26861
  let text;
@@ -26752,7 +26990,7 @@ function rglob2(root) {
26752
26990
  }
26753
26991
  entries.sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0);
26754
26992
  for (const ent of entries) {
26755
- const full = path40.join(dir, ent.name);
26993
+ const full = path41.join(dir, ent.name);
26756
26994
  out.push(full);
26757
26995
  let dirLike = ent.isDirectory();
26758
26996
  if (ent.isSymbolicLink()) {
@@ -26827,19 +27065,19 @@ function _foreign_records(project_root, foreign) {
26827
27065
  return out;
26828
27066
  }
26829
27067
  function relativeTo(p, base) {
26830
- const rel = path40.relative(base, p);
27068
+ const rel = path41.relative(base, p);
26831
27069
  if (rel === "") return rel;
26832
- if (rel.startsWith("..") || path40.isAbsolute(rel)) {
27070
+ if (rel.startsWith("..") || path41.isAbsolute(rel)) {
26833
27071
  return null;
26834
27072
  }
26835
27073
  return rel;
26836
27074
  }
26837
27075
  function _is_global_only_consumer(project_root) {
26838
- return isFile3(path40.join(project_root, INSTALL_MODE_MARKER_RELATIVE)) || isDir2(path40.join(project_root, "agents", "overrides"));
27076
+ return isFile3(path41.join(project_root, INSTALL_MODE_MARKER_RELATIVE)) || isDir2(path41.join(project_root, "agents", "overrides"));
26839
27077
  }
26840
27078
  function _check_scope(project_root) {
26841
27079
  for (const marker of ["pnpm-workspace.yaml", "lerna.json"]) {
26842
- if (pathExists(path40.join(project_root, marker))) {
27080
+ if (pathExists(path41.join(project_root, marker))) {
26843
27081
  return {
26844
27082
  id: "scope",
26845
27083
  status: "warn",
@@ -26848,7 +27086,7 @@ function _check_scope(project_root) {
26848
27086
  };
26849
27087
  }
26850
27088
  }
26851
- const pkg = path40.join(project_root, "package.json");
27089
+ const pkg = path41.join(project_root, "package.json");
26852
27090
  if (pathExists(pkg)) {
26853
27091
  try {
26854
27092
  const data = JSON.parse(readText2(pkg));
@@ -26871,23 +27109,23 @@ function _check_scope(project_root) {
26871
27109
  };
26872
27110
  }
26873
27111
  function _git_config_path(project_root) {
26874
- const gd = path40.join(project_root, ".git");
27112
+ const gd = path41.join(project_root, ".git");
26875
27113
  try {
26876
27114
  const st = fs43.statSync(gd);
26877
27115
  if (st.isDirectory()) {
26878
- return path40.join(gd, "config");
27116
+ return path41.join(gd, "config");
26879
27117
  }
26880
27118
  const m = readText2(gd).match(/^gitdir:\s*(.+)\s*$/m);
26881
27119
  if (m === null) {
26882
27120
  return null;
26883
27121
  }
26884
- const gdPath = path40.resolve(project_root, m[1].trim());
26885
- const commondirFile = path40.join(gdPath, "commondir");
27122
+ const gdPath = path41.resolve(project_root, m[1].trim());
27123
+ const commondirFile = path41.join(gdPath, "commondir");
26886
27124
  if (pathExists(commondirFile)) {
26887
- const common = path40.resolve(gdPath, readText2(commondirFile).trim());
26888
- return path40.join(common, "config");
27125
+ const common = path41.resolve(gdPath, readText2(commondirFile).trim());
27126
+ return path41.join(common, "config");
26889
27127
  }
26890
- return path40.join(gdPath, "config");
27128
+ return path41.join(gdPath, "config");
26891
27129
  } catch {
26892
27130
  return null;
26893
27131
  }
@@ -26920,7 +27158,7 @@ function _check_git_identity(project_root) {
26920
27158
  }
26921
27159
  let ident = _parse_git_user(readText2(cfgPath));
26922
27160
  if (ident.name === null && ident.email === null) {
26923
- const globalCfg = path40.join(os11.homedir(), ".gitconfig");
27161
+ const globalCfg = path41.join(os11.homedir(), ".gitconfig");
26924
27162
  if (pathExists(globalCfg)) {
26925
27163
  ident = _parse_git_user(readText2(globalCfg));
26926
27164
  }
@@ -26981,7 +27219,7 @@ function _package_root() {
26981
27219
  }
26982
27220
  function _current_package_version() {
26983
27221
  try {
26984
- const data = JSON.parse(readText2(path40.join(_package_root(), "package.json")));
27222
+ const data = JSON.parse(readText2(path41.join(_package_root(), "package.json")));
26985
27223
  const v = data["version"];
26986
27224
  if (typeof v === "string" && v.trim()) {
26987
27225
  return v.trim();
@@ -27025,7 +27263,7 @@ function _check_lockfile_freshness(manifest) {
27025
27263
  };
27026
27264
  }
27027
27265
  function shutilWhich(name) {
27028
- if (path40.dirname(name) !== "." && (name.includes("/") || name.includes("\\"))) {
27266
+ if (path41.dirname(name) !== "." && (name.includes("/") || name.includes("\\"))) {
27029
27267
  return isExecutableFile(name) ? name : null;
27030
27268
  }
27031
27269
  const pathEnv = process15.env["PATH"] || "";
@@ -27038,12 +27276,12 @@ function shutilWhich(name) {
27038
27276
  if (seenDirs.has(d)) continue;
27039
27277
  seenDirs.add(d);
27040
27278
  for (const ext of exts) {
27041
- const candidate = path40.join(d, name + (ext === "" ? "" : ext.toLowerCase() === ext ? ext : ext));
27279
+ const candidate = path41.join(d, name + (ext === "" ? "" : ext.toLowerCase() === ext ? ext : ext));
27042
27280
  if (isExecutableFile(candidate)) {
27043
27281
  return candidate;
27044
27282
  }
27045
27283
  if (ext !== "") {
27046
- const upper = path40.join(d, name + ext);
27284
+ const upper = path41.join(d, name + ext);
27047
27285
  if (isExecutableFile(upper)) return upper;
27048
27286
  }
27049
27287
  }
@@ -27119,7 +27357,7 @@ function _check_claude_plugin() {
27119
27357
  remedy: ""
27120
27358
  };
27121
27359
  }
27122
- const projection = path40.join(os11.homedir(), ".claude", "skills");
27360
+ const projection = path41.join(os11.homedir(), ".claude", "skills");
27123
27361
  const projection_present = isDir2(projection);
27124
27362
  if (projection_present) {
27125
27363
  return {
@@ -27156,8 +27394,8 @@ function _check_claude_command_wrappers() {
27156
27394
  remedy: ""
27157
27395
  };
27158
27396
  }
27159
- const anchor = path40.join(os11.homedir(), ".claude");
27160
- const commands_dir = path40.join(anchor, "commands");
27397
+ const anchor = path41.join(os11.homedir(), ".claude");
27398
+ const commands_dir = path41.join(anchor, "commands");
27161
27399
  if (!isDir2(commands_dir)) {
27162
27400
  return {
27163
27401
  id: "claude-command-wrappers",
@@ -27166,8 +27404,8 @@ function _check_claude_command_wrappers() {
27166
27404
  remedy: ""
27167
27405
  };
27168
27406
  }
27169
- const flat_probe = fs43.existsSync(path40.join(commands_dir, "commit.md"));
27170
- const wrapper_probe = fs43.existsSync(path40.join(anchor, "skills", "commit", "SKILL.md"));
27407
+ const flat_probe = fs43.existsSync(path41.join(commands_dir, "commit.md"));
27408
+ const wrapper_probe = fs43.existsSync(path41.join(anchor, "skills", "commit", "SKILL.md"));
27171
27409
  if (wrapper_probe) {
27172
27410
  return {
27173
27411
  id: "claude-command-wrappers",
@@ -27192,7 +27430,7 @@ function _check_claude_command_wrappers() {
27192
27430
  };
27193
27431
  }
27194
27432
  function _check_surface_state() {
27195
- const matrix_path = path40.join(_package_root(), "src", "config", "surface-matrix.yml");
27433
+ const matrix_path = path41.join(_package_root(), "src", "config", "surface-matrix.yml");
27196
27434
  if (!isFile3(matrix_path)) {
27197
27435
  return {
27198
27436
  id: "surface-state",
@@ -27216,7 +27454,7 @@ function _check_surface_state() {
27216
27454
  remedy: "agent-config upgrade (reinstalls the package data files)"
27217
27455
  };
27218
27456
  }
27219
- const _expand = (p) => p.startsWith("~/") ? path40.join(os11.homedir(), p.slice(2)) : path40.join(_package_root(), p);
27457
+ const _expand = (p) => p.startsWith("~/") ? path41.join(os11.homedir(), p.slice(2)) : path41.join(_package_root(), p);
27220
27458
  const violations = [];
27221
27459
  const remedies = [];
27222
27460
  let checked = 0;
@@ -27274,11 +27512,11 @@ function _check_hook_wiring() {
27274
27512
  remedy: ""
27275
27513
  };
27276
27514
  }
27277
- const settings_path = path40.join(os11.homedir(), ".claude", "settings.json");
27515
+ const settings_path = path41.join(os11.homedir(), ".claude", "settings.json");
27278
27516
  let missing;
27279
27517
  try {
27280
27518
  const matrix = build_claude_hook_matrix(
27281
- path40.join(_package_root(), "src", "scripts", "hook_manifest.yaml")
27519
+ path41.join(_package_root(), "src", "scripts", "hook_manifest.yaml")
27282
27520
  );
27283
27521
  const settings = pathExists(settings_path) ? JSON.parse(fs43.readFileSync(settings_path, "utf8")) : {};
27284
27522
  const hooks = (settings["hooks"] ?? {}) || {};
@@ -27355,7 +27593,7 @@ function _check_mcp_mode(project_root) {
27355
27593
  ];
27356
27594
  const found = [];
27357
27595
  for (const [rel, label] of candidates) {
27358
- const p = path40.join(project_root, rel);
27596
+ const p = path41.join(project_root, rel);
27359
27597
  if (!pathExists(p)) {
27360
27598
  continue;
27361
27599
  }
@@ -27387,7 +27625,7 @@ function _check_mcp_mode(project_root) {
27387
27625
  };
27388
27626
  }
27389
27627
  function _check_offline_readiness() {
27390
- const script = path40.join(_package_root(), "src", "scripts", "hermetic-install.sh");
27628
+ const script = path41.join(_package_root(), "src", "scripts", "hermetic-install.sh");
27391
27629
  if (!pathExists(script)) {
27392
27630
  return {
27393
27631
  id: "offline-readiness",
@@ -27445,7 +27683,7 @@ function _check_stale_orphans() {
27445
27683
  (a, b) => a < b ? -1 : a > b ? 1 : 0
27446
27684
  );
27447
27685
  for (const root_name of ownedSorted) {
27448
- const root = path40.join(anchor, root_name);
27686
+ const root = path41.join(anchor, root_name);
27449
27687
  if (!isDir2(root)) {
27450
27688
  continue;
27451
27689
  }
@@ -27460,7 +27698,7 @@ function _check_stale_orphans() {
27460
27698
  if (rel === null) {
27461
27699
  continue;
27462
27700
  }
27463
- const relPosix2 = rel.split(path40.sep).join("/");
27701
+ const relPosix2 = rel.split(path41.sep).join("/");
27464
27702
  if (recorded_set.has(relPosix2)) {
27465
27703
  continue;
27466
27704
  }
@@ -27509,14 +27747,14 @@ function _check_rule_scope_drift(project_root) {
27509
27747
  let rules_dir = null;
27510
27748
  let found = 0;
27511
27749
  for (const rel of _RULE_PROJECTION_DIRS) {
27512
- const cand = path40.join(project_root, rel);
27750
+ const cand = path41.join(project_root, rel);
27513
27751
  if (!isDir2(cand)) {
27514
27752
  continue;
27515
27753
  }
27516
27754
  let count = 0;
27517
27755
  try {
27518
27756
  for (const name of fs43.readdirSync(cand)) {
27519
- if (name.endsWith(".md") && isFile3(path40.join(cand, name))) {
27757
+ if (name.endsWith(".md") && isFile3(path41.join(cand, name))) {
27520
27758
  count += 1;
27521
27759
  }
27522
27760
  }
@@ -27570,14 +27808,14 @@ function _check_rule_scope_drift(project_root) {
27570
27808
  };
27571
27809
  }
27572
27810
  function _check_duplicate_scope_rules(project_root, userRulesDirOverride) {
27573
- const user_rules_dir = userRulesDirOverride ?? path40.join(os11.homedir(), ".claude", "rules");
27811
+ const user_rules_dir = userRulesDirOverride ?? path41.join(os11.homedir(), ".claude", "rules");
27574
27812
  let project_rules_dir = null;
27575
27813
  if (_is_source_repo(project_root)) {
27576
- const cand = path40.join(project_root, "dist", "agent-src", "rules");
27814
+ const cand = path41.join(project_root, "dist", "agent-src", "rules");
27577
27815
  if (isDir2(cand)) project_rules_dir = cand;
27578
27816
  } else {
27579
27817
  for (const rel of _RULE_PROJECTION_DIRS) {
27580
- const cand = path40.join(project_root, rel);
27818
+ const cand = path41.join(project_root, rel);
27581
27819
  if (isDir2(cand)) {
27582
27820
  project_rules_dir = cand;
27583
27821
  break;
@@ -27646,7 +27884,7 @@ function _check_mcp_beta_readiness(project_root) {
27646
27884
  }
27647
27885
  const pending = [];
27648
27886
  for (const [gate_id, rel] of MCP_BETA_GATES) {
27649
- if (!pathExists(path40.join(project_root, rel))) {
27887
+ if (!pathExists(path41.join(project_root, rel))) {
27650
27888
  pending.push(`${gate_id} (${rel})`);
27651
27889
  }
27652
27890
  }
@@ -27667,7 +27905,7 @@ function _check_mcp_beta_readiness(project_root) {
27667
27905
  }
27668
27906
  function _check_tier_usage_readiness(project_root) {
27669
27907
  const settings_file = project_settings_path(project_root);
27670
- let log_path = path40.join(project_root, ".agent-tier-usage.jsonl");
27908
+ let log_path = path41.join(project_root, ".agent-tier-usage.jsonl");
27671
27909
  let enabled = false;
27672
27910
  if (isFile3(settings_file)) {
27673
27911
  let raw;
@@ -27686,7 +27924,7 @@ function _check_tier_usage_readiness(project_root) {
27686
27924
  const outputRaw = tu["output"];
27687
27925
  const output = typeof outputRaw === "object" && outputRaw !== null && !Array.isArray(outputRaw) ? outputRaw : {};
27688
27926
  if (typeof output["path"] === "string" && output["path"].trim()) {
27689
- log_path = path40.join(project_root, output["path"].trim());
27927
+ log_path = path41.join(project_root, output["path"].trim());
27690
27928
  }
27691
27929
  const val = tu["enabled"];
27692
27930
  if (typeof val === "boolean") {
@@ -27711,7 +27949,7 @@ function _check_tier_usage_readiness(project_root) {
27711
27949
  return {
27712
27950
  id: "tier-usage-readiness",
27713
27951
  status: "warn",
27714
- message: `tier-usage telemetry on but ${path40.basename(log_path)} not yet written \u2014 no signal accumulated`,
27952
+ message: `tier-usage telemetry on but ${path41.basename(log_path)} not yet written \u2014 no signal accumulated`,
27715
27953
  remedy: "run any tracked command to seed the log; the dispatcher writes one record per invocation"
27716
27954
  };
27717
27955
  }
@@ -27726,7 +27964,7 @@ function _check_tier_usage_readiness(project_root) {
27726
27964
  return {
27727
27965
  id: "tier-usage-readiness",
27728
27966
  status: "fail",
27729
- message: `cannot read ${path40.basename(log_path)}: ${osErrorStr2(exc)}`,
27967
+ message: `cannot read ${path41.basename(log_path)}: ${osErrorStr2(exc)}`,
27730
27968
  remedy: "fix permissions on the tier-usage log"
27731
27969
  };
27732
27970
  }
@@ -27757,7 +27995,7 @@ function _check_tier_usage_readiness(project_root) {
27757
27995
  return {
27758
27996
  id: "tier-usage-readiness",
27759
27997
  status: "fail",
27760
- message: `${total} record(s) in ${path40.basename(log_path)} but 0 passed the privacy floor \u2014 report would refuse to render`,
27998
+ message: `${total} record(s) in ${path41.basename(log_path)} but 0 passed the privacy floor \u2014 report would refuse to render`,
27761
27999
  remedy: "inspect the log; the dispatcher is writing records the contract forbids (paths, argv, message bodies)"
27762
28000
  };
27763
28001
  }
@@ -27765,14 +28003,14 @@ function _check_tier_usage_readiness(project_root) {
27765
28003
  return {
27766
28004
  id: "tier-usage-readiness",
27767
28005
  status: "warn",
27768
- message: `${path40.basename(log_path)} present but empty \u2014 no signal yet`,
28006
+ message: `${path41.basename(log_path)} present but empty \u2014 no signal yet`,
27769
28007
  remedy: "run any tracked command to seed the log"
27770
28008
  };
27771
28009
  }
27772
28010
  return {
27773
28011
  id: "tier-usage-readiness",
27774
28012
  status: "ok",
27775
- message: `${valid} record(s) past the privacy floor in ${path40.basename(log_path)} \u2014 retiering signal available`,
28013
+ message: `${valid} record(s) past the privacy floor in ${path41.basename(log_path)} \u2014 retiering signal available`,
27776
28014
  remedy: ""
27777
28015
  };
27778
28016
  }
@@ -28111,7 +28349,7 @@ function _check_team(project_root) {
28111
28349
  if (binary_resolved === null) {
28112
28350
  remedies.push("install the codex CLI: `npm install -g @openai/codex`");
28113
28351
  }
28114
- const auth_path = path40.join(_codex_home(), "auth.json");
28352
+ const auth_path = path41.join(_codex_home(), "auth.json");
28115
28353
  const authed = pathExists(auth_path);
28116
28354
  let auth_str;
28117
28355
  if (!authed) {
@@ -28191,7 +28429,7 @@ function _check_unsupported_combos(manifest) {
28191
28429
  };
28192
28430
  }
28193
28431
  function _wizard_state_path() {
28194
- return path40.join(event4u_root(), "state", "wizard-state.json");
28432
+ return path41.join(event4u_root(), "state", "wizard-state.json");
28195
28433
  }
28196
28434
  function _check_wizard_state() {
28197
28435
  const state_pth = _wizard_state_path();
@@ -28271,7 +28509,7 @@ function _check_wizard_state() {
28271
28509
  };
28272
28510
  }
28273
28511
  function _check_settings_review_pending() {
28274
- const delta_pth = path40.join(event4u_root(), "state", "settings-delta.json");
28512
+ const delta_pth = path41.join(event4u_root(), "state", "settings-delta.json");
28275
28513
  if (!pathExists(delta_pth)) {
28276
28514
  return {
28277
28515
  id: "settings-review-pending",
@@ -28297,7 +28535,7 @@ function _check_settings_review_pending() {
28297
28535
  }
28298
28536
  function _check_memory_merge_union(project_root) {
28299
28537
  const remedy = "run: npx tsx src/scripts/sync_gitattributes.ts (or `agent-config refresh --project`)";
28300
- const target = path40.join(project_root, DEFAULT_GITATTRIBUTES);
28538
+ const target = path41.join(project_root, DEFAULT_GITATTRIBUTES);
28301
28539
  if (!pathExists(target)) {
28302
28540
  return {
28303
28541
  id: "memory-merge-union",
@@ -28859,13 +29097,13 @@ function _isCliEntry15() {
28859
29097
  if (process15.argv[1] === void 0) {
28860
29098
  return false;
28861
29099
  }
28862
- const argvUrl = pathToFileURL15(path40.resolve(process15.argv[1])).href;
29100
+ const argvUrl = pathToFileURL15(path41.resolve(process15.argv[1])).href;
28863
29101
  if (import.meta.url === argvUrl) {
28864
29102
  return true;
28865
29103
  }
28866
29104
  try {
28867
- const here = fs43.realpathSync(fileURLToPath23(import.meta.url));
28868
- const argv = fs43.realpathSync(path40.resolve(process15.argv[1]));
29105
+ const here = fs43.realpathSync(fileURLToPath24(import.meta.url));
29106
+ const argv = fs43.realpathSync(path41.resolve(process15.argv[1]));
28869
29107
  return here === argv;
28870
29108
  } catch {
28871
29109
  return false;
@@ -28893,7 +29131,7 @@ var init_cmd_doctor = __esm({
28893
29131
  init_review_gate();
28894
29132
  init_package_root();
28895
29133
  init_rule_scope();
28896
- _HERE12 = fileURLToPath23(import.meta.url);
29134
+ _HERE12 = fileURLToPath24(import.meta.url);
28897
29135
  ArgparseExit4 = class extends Error {
28898
29136
  constructor(code) {
28899
29137
  super(`argparse-exit-${code}`);
@@ -29073,9 +29311,9 @@ function detectToolPresence(root) {
29073
29311
  agentsMd: existsSync20(join39(root, "AGENTS.md"))
29074
29312
  };
29075
29313
  }
29076
- function isDir3(path49) {
29314
+ function isDir3(path50) {
29077
29315
  try {
29078
- return statSync28(path49).isDirectory();
29316
+ return statSync28(path50).isDirectory();
29079
29317
  } catch {
29080
29318
  return false;
29081
29319
  }
@@ -29108,10 +29346,10 @@ __export(cmd_conformance_exports, {
29108
29346
  });
29109
29347
  import * as fs44 from "node:fs";
29110
29348
  import * as os12 from "node:os";
29111
- import * as path41 from "node:path";
29349
+ import * as path42 from "node:path";
29112
29350
  import process16 from "node:process";
29113
- import { spawnSync as spawnSync8 } from "node:child_process";
29114
- import { fileURLToPath as fileURLToPath24, pathToFileURL as pathToFileURL16 } from "node:url";
29351
+ import { spawnSync as spawnSync9 } from "node:child_process";
29352
+ import { fileURLToPath as fileURLToPath25, pathToFileURL as pathToFileURL16 } from "node:url";
29115
29353
  function print2(s = "") {
29116
29354
  process16.stdout.write(`${s}
29117
29355
  `);
@@ -29125,14 +29363,14 @@ function conformanceLogPath() {
29125
29363
  if (override && override.trim().length > 0) {
29126
29364
  return override;
29127
29365
  }
29128
- return path41.join(os12.homedir(), ".event4u", "agent-config", "conformance-log.jsonl");
29366
+ return path42.join(os12.homedir(), ".event4u", "agent-config", "conformance-log.jsonl");
29129
29367
  }
29130
29368
  function installLogPath() {
29131
29369
  const override = process16.env["AGENT_CONFIG_INSTALL_LOG"];
29132
29370
  if (override && override.trim().length > 0) {
29133
29371
  return override;
29134
29372
  }
29135
- return path41.join(os12.homedir(), ".event4u", "agent-config", "install-log.jsonl");
29373
+ return path42.join(os12.homedir(), ".event4u", "agent-config", "install-log.jsonl");
29136
29374
  }
29137
29375
  function _check_txlog_clean(logPath = installLogPath()) {
29138
29376
  if (!fs44.existsSync(logPath)) {
@@ -29176,22 +29414,22 @@ function routeTargetPaths(target) {
29176
29414
  if (!id) return [];
29177
29415
  switch (kind) {
29178
29416
  case "skill":
29179
- return [path41.join("dist", "agent-src", "skills", id, "SKILL.md")];
29417
+ return [path42.join("dist", "agent-src", "skills", id, "SKILL.md")];
29180
29418
  case "command":
29181
- return [path41.join("dist", "agent-src", "commands", `${id}.md`)];
29419
+ return [path42.join("dist", "agent-src", "commands", `${id}.md`)];
29182
29420
  case "guideline":
29183
- return [path41.join("docs", "guidelines", `${id}.md`)];
29421
+ return [path42.join("docs", "guidelines", `${id}.md`)];
29184
29422
  case "contract":
29185
29423
  return [
29186
- path41.join("docs", "contracts", `${id}.md`),
29187
- path41.join("dist", "agent-src", "contexts", "contracts", `${id}.md`)
29424
+ path42.join("docs", "contracts", `${id}.md`),
29425
+ path42.join("dist", "agent-src", "contexts", "contracts", `${id}.md`)
29188
29426
  ];
29189
29427
  default:
29190
29428
  return [];
29191
29429
  }
29192
29430
  }
29193
29431
  function _check_router_pointers(packageRoot = PACKAGE_ROOT2) {
29194
- const routerPath = path41.join(packageRoot, "dist", "router.json");
29432
+ const routerPath = path42.join(packageRoot, "dist", "router.json");
29195
29433
  if (!fs44.existsSync(routerPath)) {
29196
29434
  return {
29197
29435
  id: "router-pointers",
@@ -29211,13 +29449,13 @@ function _check_router_pointers(packageRoot = PACKAGE_ROOT2) {
29211
29449
  remedy: "reinstall the package \u2014 dist/router.json is corrupt"
29212
29450
  };
29213
29451
  }
29214
- const rulesDir = path41.join(packageRoot, "dist", "agent-src", "rules");
29452
+ const rulesDir = path42.join(packageRoot, "dist", "agent-src", "rules");
29215
29453
  const broken = [];
29216
29454
  let ids = 0;
29217
29455
  let targets = 0;
29218
29456
  for (const kernelId of router["kernel"] ?? []) {
29219
29457
  ids += 1;
29220
- if (!fs44.existsSync(path41.join(rulesDir, `${kernelId}.md`))) {
29458
+ if (!fs44.existsSync(path42.join(rulesDir, `${kernelId}.md`))) {
29221
29459
  broken.push(`kernel:${kernelId} \u2192 rules/${kernelId}.md missing`);
29222
29460
  }
29223
29461
  }
@@ -29225,7 +29463,7 @@ function _check_router_pointers(packageRoot = PACKAGE_ROOT2) {
29225
29463
  for (const entry of router[tier] ?? []) {
29226
29464
  const ruleId = String(entry["id"] ?? "");
29227
29465
  ids += 1;
29228
- if (!fs44.existsSync(path41.join(rulesDir, `${ruleId}.md`))) {
29466
+ if (!fs44.existsSync(path42.join(rulesDir, `${ruleId}.md`))) {
29229
29467
  broken.push(`${tier}:${ruleId} \u2192 rules/${ruleId}.md missing`);
29230
29468
  }
29231
29469
  for (const target of entry["routes_to"] ?? []) {
@@ -29235,7 +29473,7 @@ function _check_router_pointers(packageRoot = PACKAGE_ROOT2) {
29235
29473
  broken.push(`${ruleId} \u2192 unparseable routes_to ${JSON.stringify(target)}`);
29236
29474
  continue;
29237
29475
  }
29238
- if (!candidates.some((rel) => fs44.existsSync(path41.join(packageRoot, rel)))) {
29476
+ if (!candidates.some((rel) => fs44.existsSync(path42.join(packageRoot, rel)))) {
29239
29477
  broken.push(`${ruleId} \u2192 ${target} (${candidates[0]} missing)`);
29240
29478
  }
29241
29479
  }
@@ -29267,8 +29505,8 @@ function detectSmokePlatform(projectRoot) {
29267
29505
  return "claude";
29268
29506
  }
29269
29507
  function dispatcherRunner(packageRoot) {
29270
- const localTsx = path41.join(packageRoot, "node_modules", ".bin", "tsx");
29271
- const script = path41.join(packageRoot, "src", "scripts", "hooks", "dispatch_hook.ts");
29508
+ const localTsx = path42.join(packageRoot, "node_modules", ".bin", "tsx");
29509
+ const script = path42.join(packageRoot, "src", "scripts", "hooks", "dispatch_hook.ts");
29272
29510
  if (fs44.existsSync(localTsx)) {
29273
29511
  return [localTsx, script];
29274
29512
  }
@@ -29286,7 +29524,7 @@ function _check_hook_dispatcher(projectRoot, packageRoot = PACKAGE_ROOT2, opts =
29286
29524
  ...event === "stop" ? { stop_reason: "conformance-smoke" } : { source: "startup" }
29287
29525
  });
29288
29526
  const argv = [...runner, "--platform", platform, "--event", event];
29289
- const proc = spawnSync8(argv[0], argv.slice(1), {
29527
+ const proc = spawnSync9(argv[0], argv.slice(1), {
29290
29528
  input: payload,
29291
29529
  cwd: projectRoot,
29292
29530
  encoding: "utf8",
@@ -29319,7 +29557,7 @@ function _check_hook_dispatcher(projectRoot, packageRoot = PACKAGE_ROOT2, opts =
29319
29557
  };
29320
29558
  }
29321
29559
  function readSettingsMode(projectRoot) {
29322
- const settingsPath = path41.join(projectRoot, ".agent-settings.yml");
29560
+ const settingsPath = path42.join(projectRoot, ".agent-settings.yml");
29323
29561
  if (!fs44.existsSync(settingsPath)) {
29324
29562
  return "eager-all";
29325
29563
  }
@@ -29335,7 +29573,7 @@ function readSettingsMode(projectRoot) {
29335
29573
  function kernelIdsFromRouter(packageRoot) {
29336
29574
  try {
29337
29575
  const router = JSON.parse(
29338
- fs44.readFileSync(path41.join(packageRoot, "dist", "router.json"), "utf8")
29576
+ fs44.readFileSync(path42.join(packageRoot, "dist", "router.json"), "utf8")
29339
29577
  );
29340
29578
  return new Set((router["kernel"] ?? []).map(String));
29341
29579
  } catch {
@@ -29352,7 +29590,7 @@ function _check_lean_projection(projectRoot, packageRoot = PACKAGE_ROOT2, projec
29352
29590
  remedy: "set lean_projection.mode to 'eager-all' or 'thin' in .agent-settings.yml"
29353
29591
  };
29354
29592
  }
29355
- const rulesDir = projectedRulesDir ?? path41.join(projectRoot, ".augment", "rules");
29593
+ const rulesDir = projectedRulesDir ?? path42.join(projectRoot, ".augment", "rules");
29356
29594
  if (!fs44.existsSync(rulesDir)) {
29357
29595
  return {
29358
29596
  id: "lean-projection",
@@ -29376,7 +29614,7 @@ function _check_lean_projection(projectRoot, packageRoot = PACKAGE_ROOT2, projec
29376
29614
  for (const f of nonKernel) {
29377
29615
  let text = "";
29378
29616
  try {
29379
- text = fs44.readFileSync(path41.join(rulesDir, f), "utf8");
29617
+ text = fs44.readFileSync(path42.join(rulesDir, f), "utf8");
29380
29618
  } catch {
29381
29619
  continue;
29382
29620
  }
@@ -29407,7 +29645,7 @@ function _check_lean_projection(projectRoot, packageRoot = PACKAGE_ROOT2, projec
29407
29645
  function _check_host_manifest(projectRoot) {
29408
29646
  const detected = Object.entries(detectToolPresence(projectRoot)).filter(([, v]) => v === true).map(([k]) => k);
29409
29647
  const detectedNote = detected.length > 0 ? `detected surfaces: ${detected.join(", ")}` : "no surfaces detected";
29410
- const settingsPath = path41.join(projectRoot, ".agent-settings.yml");
29648
+ const settingsPath = path42.join(projectRoot, ".agent-settings.yml");
29411
29649
  if (!fs44.existsSync(settingsPath)) {
29412
29650
  return {
29413
29651
  id: "host-manifest",
@@ -29615,13 +29853,13 @@ function _isCliEntry16() {
29615
29853
  if (process16.argv[1] === void 0) {
29616
29854
  return false;
29617
29855
  }
29618
- const argvUrl = pathToFileURL16(path41.resolve(process16.argv[1])).href;
29856
+ const argvUrl = pathToFileURL16(path42.resolve(process16.argv[1])).href;
29619
29857
  if (import.meta.url === argvUrl) {
29620
29858
  return true;
29621
29859
  }
29622
29860
  try {
29623
- const here = fs44.realpathSync(fileURLToPath24(import.meta.url));
29624
- const argv = fs44.realpathSync(path41.resolve(process16.argv[1]));
29861
+ const here = fs44.realpathSync(fileURLToPath25(import.meta.url));
29862
+ const argv = fs44.realpathSync(path42.resolve(process16.argv[1]));
29625
29863
  return here === argv;
29626
29864
  } catch {
29627
29865
  return false;
@@ -29638,7 +29876,7 @@ var init_cmd_conformance = __esm({
29638
29876
  init_detect();
29639
29877
  init_package_root();
29640
29878
  init_cmd_doctor();
29641
- _HERE13 = fileURLToPath24(import.meta.url);
29879
+ _HERE13 = fileURLToPath25(import.meta.url);
29642
29880
  PACKAGE_ROOT2 = resolvePackageRoot(import.meta.url);
29643
29881
  CONFORMANCE_CHECK_IDS = [
29644
29882
  "txlog-clean",
@@ -31514,7 +31752,7 @@ not. Cite the peer-reviewer label and the targeted response label
31514
31752
 
31515
31753
  // src/scripts/ai_council/advisors.ts
31516
31754
  import * as fs48 from "node:fs";
31517
- import * as path42 from "node:path";
31755
+ import * as path43 from "node:path";
31518
31756
  function _split_frontmatter(raw) {
31519
31757
  const match = _FRONTMATTER_RE2.exec(raw);
31520
31758
  if (!match) {
@@ -31542,8 +31780,8 @@ function _display_name_from(advisor_name, frontmatter) {
31542
31780
  }
31543
31781
  function resolve_persona_text(persona_path, repo_root) {
31544
31782
  const candidates = [
31545
- path42.join(repo_root, "dist/agent-src", persona_path),
31546
- path42.join(repo_root, ".agent-src.uncondensed", persona_path)
31783
+ path43.join(repo_root, "dist/agent-src", persona_path),
31784
+ path43.join(repo_root, ".agent-src.uncondensed", persona_path)
31547
31785
  ];
31548
31786
  for (const candidate of candidates) {
31549
31787
  if (fs48.existsSync(candidate)) {
@@ -33057,7 +33295,7 @@ var init_necessity = __esm({
33057
33295
 
33058
33296
  // src/scripts/ai_council/budget_guard.ts
33059
33297
  import * as fs50 from "node:fs";
33060
- import * as path43 from "node:path";
33298
+ import * as path44 from "node:path";
33061
33299
  function _resolveLedgerPath(p) {
33062
33300
  if (p !== null) {
33063
33301
  return p;
@@ -33072,7 +33310,7 @@ function _nowUtcMs() {
33072
33310
  return Date.now();
33073
33311
  }
33074
33312
  function _ensureLedgerDir(p) {
33075
- const parent = path43.dirname(p);
33313
+ const parent = path44.dirname(p);
33076
33314
  try {
33077
33315
  fs50.mkdirSync(parent, { recursive: true });
33078
33316
  let mode;
@@ -33878,7 +34116,7 @@ __export(pricing_exports, {
33878
34116
  CACHE_WRITE_MULTIPLIER_5M: () => CACHE_WRITE_MULTIPLIER_5M,
33879
34117
  DEFAULT_PRICES: () => DEFAULT_PRICES,
33880
34118
  PRICES_FILE: () => PRICES_FILE,
33881
- REPO_ROOT: () => REPO_ROOT,
34119
+ REPO_ROOT: () => REPO_ROOT2,
33882
34120
  _render_markdown: () => _render_markdown,
33883
34121
  as_rows: () => as_rows,
33884
34122
  bootstrap_from_defaults: () => bootstrap_from_defaults,
@@ -33893,10 +34131,10 @@ __export(pricing_exports, {
33893
34131
  reprice_with_cache: () => reprice_with_cache
33894
34132
  });
33895
34133
  import * as fs51 from "node:fs";
33896
- import * as path44 from "node:path";
33897
- import { fileURLToPath as fileURLToPath25 } from "node:url";
34134
+ import * as path45 from "node:path";
34135
+ import { fileURLToPath as fileURLToPath26 } from "node:url";
33898
34136
  function prices_file_for(repo_root) {
33899
- return path44.join(repo_root, "agents", "runtime", ".agent-prices.md");
34137
+ return path45.join(repo_root, "agents", "runtime", ".agent-prices.md");
33900
34138
  }
33901
34139
  function lookup(table, provider, model) {
33902
34140
  return table.prices.get(priceKey(provider, model)) ?? null;
@@ -33996,7 +34234,7 @@ function load_prices(p = PRICES_FILE) {
33996
34234
  return _parse4(fs51.readFileSync(p, "utf-8"));
33997
34235
  }
33998
34236
  function bootstrap_from_defaults(p = PRICES_FILE) {
33999
- fs51.mkdirSync(path44.dirname(p), { recursive: true });
34237
+ fs51.mkdirSync(path45.dirname(p), { recursive: true });
34000
34238
  const rows = as_rows();
34001
34239
  const body = _render_markdown(LAST_UPDATED, "shipped-default", rows);
34002
34240
  fs51.writeFileSync(p, body, "utf-8");
@@ -34116,14 +34354,14 @@ function _pyFloat2(s) {
34116
34354
  const n = Number(t);
34117
34355
  return Number.isNaN(n) ? null : n;
34118
34356
  }
34119
- var _HERE14, REPO_ROOT, PRICES_FILE, _CHARS_PER_TOKEN, CACHE_READ_MULTIPLIER, CACHE_WRITE_MULTIPLIER_5M, CACHE_WRITE_MULTIPLIER_1H;
34357
+ var _HERE14, REPO_ROOT2, PRICES_FILE, _CHARS_PER_TOKEN, CACHE_READ_MULTIPLIER, CACHE_WRITE_MULTIPLIER_5M, CACHE_WRITE_MULTIPLIER_1H;
34120
34358
  var init_pricing = __esm({
34121
34359
  "src/scripts/ai_council/pricing.ts"() {
34122
34360
  "use strict";
34123
34361
  init_default_prices();
34124
- _HERE14 = fileURLToPath25(import.meta.url);
34125
- REPO_ROOT = path44.resolve(path44.dirname(_HERE14), "..", "..", "..");
34126
- PRICES_FILE = path44.join(REPO_ROOT, "agents", "runtime", ".agent-prices.md");
34362
+ _HERE14 = fileURLToPath26(import.meta.url);
34363
+ REPO_ROOT2 = path45.resolve(path45.dirname(_HERE14), "..", "..", "..");
34364
+ PRICES_FILE = path45.join(REPO_ROOT2, "agents", "runtime", ".agent-prices.md");
34127
34365
  _CHARS_PER_TOKEN = 4;
34128
34366
  CACHE_READ_MULTIPLIER = 0.1;
34129
34367
  CACHE_WRITE_MULTIPLIER_5M = 1.25;
@@ -34215,7 +34453,7 @@ function tally_stances(members) {
34215
34453
  }
34216
34454
  parsed.push({ member, ...p });
34217
34455
  }
34218
- const w_total = parsed.length;
34456
+ const w_total = parsed.length + needs_repair.length;
34219
34457
  const threshold = CONSENSUS_FRACTION * w_total;
34220
34458
  let abstain_count = 0;
34221
34459
  const byLabel = /* @__PURE__ */ new Map();
@@ -34263,6 +34501,11 @@ function render_vote_tally(result) {
34263
34501
  if (result.abstain_count > 0) {
34264
34502
  lines.push(`- abstain \u2014 ${result.abstain_count} member(s) (raises the bar)`);
34265
34503
  }
34504
+ if (result.needs_repair.length > 0) {
34505
+ lines.push(
34506
+ `- unparsed \u2014 ${result.needs_repair.length} member(s) responded without a readable stance (${result.needs_repair.join(", ")}); counted in the quorum, backing nothing`
34507
+ );
34508
+ }
34266
34509
  lines.push(`Threshold: \u2154 \xD7 ${result.w_total} = ${result.threshold.toFixed(2)}`);
34267
34510
  lines.push(
34268
34511
  result.consensus !== null ? `Cleared: ${result.consensus.label} (${result.consensus.weight.toFixed(2)})` : "Escalated: no option cleared the threshold \u2014 the split is returned to the user, not forced."
@@ -35659,7 +35902,7 @@ __export(project_context_exports, {
35659
35902
  detect_project_context: () => detect_project_context
35660
35903
  });
35661
35904
  import * as fs52 from "node:fs";
35662
- import * as path45 from "node:path";
35905
+ import * as path46 from "node:path";
35663
35906
  function _isPlainObject11(v) {
35664
35907
  return typeof v === "object" && v !== null && !Array.isArray(v);
35665
35908
  }
@@ -35691,7 +35934,7 @@ function _name_from(composer, pkg, root) {
35691
35934
  }
35692
35935
  }
35693
35936
  try {
35694
- const base = path45.basename(root);
35937
+ const base = path46.basename(root);
35695
35938
  return base || null;
35696
35939
  } catch {
35697
35940
  return null;
@@ -35849,13 +36092,13 @@ function _rfind(haystack, needle) {
35849
36092
  return -1;
35850
36093
  }
35851
36094
  function detect_project_context(root) {
35852
- const resolvedRoot = path45.resolve(root ?? process.cwd());
35853
- const composer = _read_json(path45.join(resolvedRoot, "composer.json"));
35854
- const pkg = _read_json(path45.join(resolvedRoot, "package.json"));
36095
+ const resolvedRoot = path46.resolve(root ?? process.cwd());
36096
+ const composer = _read_json(path46.join(resolvedRoot, "composer.json"));
36097
+ const pkg = _read_json(path46.join(resolvedRoot, "package.json"));
35855
36098
  return new ProjectContext(
35856
36099
  _name_from(composer, pkg, resolvedRoot),
35857
36100
  _stack_from(composer, pkg),
35858
- _purpose_from_readme(path45.join(resolvedRoot, "README.md"))
36101
+ _purpose_from_readme(path46.join(resolvedRoot, "README.md"))
35859
36102
  );
35860
36103
  }
35861
36104
  var REPO_PURPOSE_MAX_CHARS, _HEADING_RE, _BADGE_RE, _HTML_RE, ProjectContext;
@@ -37107,8 +37350,8 @@ __export(council_cli_exports, {
37107
37350
  main: () => main17
37108
37351
  });
37109
37352
  import * as fs54 from "node:fs";
37110
- import * as path46 from "node:path";
37111
- import { fileURLToPath as fileURLToPath26, pathToFileURL as pathToFileURL17 } from "node:url";
37353
+ import * as path47 from "node:path";
37354
+ import { fileURLToPath as fileURLToPath27, pathToFileURL as pathToFileURL17 } from "node:url";
37112
37355
  function _pyFixed6(x, ndigits) {
37113
37356
  if (!Number.isFinite(x)) {
37114
37357
  return String(x);
@@ -37835,8 +38078,8 @@ function _maybe_write_decision_replay(opts) {
37835
38078
  include_member_arguments: include_args
37836
38079
  })
37837
38080
  );
37838
- const target = path46.join(path46.dirname(opts.out_path), "decision-replay.md");
37839
- fs54.mkdirSync(path46.dirname(target), { recursive: true });
38081
+ const target = path47.join(path47.dirname(opts.out_path), "decision-replay.md");
38082
+ fs54.mkdirSync(path47.dirname(target), { recursive: true });
37840
38083
  fs54.writeFileSync(target, replay, { encoding: "utf-8" });
37841
38084
  return target;
37842
38085
  }
@@ -38028,7 +38271,7 @@ function cmd_estimate(args, opts = {}) {
38028
38271
  settings = load_settings();
38029
38272
  }
38030
38273
  const ai_cfg = _isDict3(settings) ? settings["ai_council"] || {} : {};
38031
- const advisor_plans = _build_advisor_plans(ai_cfg, REPO_ROOT2);
38274
+ const advisor_plans = _build_advisor_plans(ai_cfg, REPO_ROOT3);
38032
38275
  const explicit_overrides = _parse_model_overrides(_getattr3(args, "model", null));
38033
38276
  const skipped = [];
38034
38277
  if (members === null) {
@@ -38040,7 +38283,7 @@ function cmd_estimate(args, opts = {}) {
38040
38283
  });
38041
38284
  }
38042
38285
  if (table === null) {
38043
- table = load_prices(prices_file_for(REPO_ROOT2));
38286
+ table = load_prices(prices_file_for(REPO_ROOT3));
38044
38287
  }
38045
38288
  const [question] = build_question({
38046
38289
  input_path: args.question,
@@ -38048,7 +38291,7 @@ function cmd_estimate(args, opts = {}) {
38048
38291
  max_tokens: _resolve_max_tokens(args, ai_cfg),
38049
38292
  prompt_mode_override: _getattr3(args, "prompt_mode", null)
38050
38293
  });
38051
- const project = detect_project_context(REPO_ROOT2);
38294
+ const project = detect_project_context(REPO_ROOT3);
38052
38295
  const billable = members.filter((m) => _getattr3(m, "billable", true));
38053
38296
  const estimates = estimate(question, billable, table, {
38054
38297
  project,
@@ -38507,7 +38750,7 @@ function cmd_run(args, opts = {}) {
38507
38750
  _isDict3(settings) ? settings["ai_council"] || {} : {},
38508
38751
  _resolved_chairman_override(_getattr3(args, "chairman", null))
38509
38752
  );
38510
- const advisor_plans = _build_advisor_plans(ai_cfg, REPO_ROOT2);
38753
+ const advisor_plans = _build_advisor_plans(ai_cfg, REPO_ROOT3);
38511
38754
  const explicit_overrides = _parse_model_overrides(_getattr3(args, "model", null));
38512
38755
  const skipped = [];
38513
38756
  if (members === null) {
@@ -38527,7 +38770,7 @@ function cmd_run(args, opts = {}) {
38527
38770
  _emit_shadow_slo_banner();
38528
38771
  }
38529
38772
  if (table === null) {
38530
- table = load_prices(prices_file_for(REPO_ROOT2));
38773
+ table = load_prices(prices_file_for(REPO_ROOT3));
38531
38774
  }
38532
38775
  const [question, artefact] = build_question({
38533
38776
  input_path: args.question,
@@ -38554,7 +38797,7 @@ function cmd_run(args, opts = {}) {
38554
38797
  rounds: _getattr3(args, "rounds", 1),
38555
38798
  price_table: table
38556
38799
  });
38557
- const project = detect_project_context(REPO_ROOT2);
38800
+ const project = detect_project_context(REPO_ROOT3);
38558
38801
  const billable = members.filter((m) => _getattr3(m, "billable", true));
38559
38802
  const estimates = estimate(question, billable, table, {
38560
38803
  project,
@@ -38727,7 +38970,7 @@ function cmd_run(args, opts = {}) {
38727
38970
  kind: "responses",
38728
38971
  subcommand: "run"
38729
38972
  });
38730
- fs54.mkdirSync(path46.dirname(_resolveTarget(out_path)), { recursive: true });
38973
+ fs54.mkdirSync(path47.dirname(_resolveTarget(out_path)), { recursive: true });
38731
38974
  fs54.writeFileSync(_resolveTarget(out_path), _jsonDumpsIndent22(payload) + "\n", { encoding: "utf-8" });
38732
38975
  _stdout2(
38733
38976
  `
@@ -38777,7 +39020,7 @@ function _write_debate_round(out_dir, round_number, responses, opts) {
38777
39020
  prompt_cache_round_gap_ms: opts.cache_gap_ms_since_previous_round ?? null,
38778
39021
  responses: _serialise_responses(responses)
38779
39022
  };
38780
- const out_path = path46.join(_resolveTarget(out_dir), _debate_round_filename(round_number));
39023
+ const out_path = path47.join(_resolveTarget(out_dir), _debate_round_filename(round_number));
38781
39024
  fs54.writeFileSync(out_path, _jsonDumpsIndent22(payload) + "\n", { encoding: "utf-8" });
38782
39025
  return out_path;
38783
39026
  }
@@ -38845,7 +39088,7 @@ function cmd_debate(args, opts = {}) {
38845
39088
  settings = load_settings();
38846
39089
  }
38847
39090
  const ai_cfg = _isDict3(settings) ? settings["ai_council"] || {} : {};
38848
- const advisor_plans = _build_advisor_plans(ai_cfg, REPO_ROOT2);
39091
+ const advisor_plans = _build_advisor_plans(ai_cfg, REPO_ROOT3);
38849
39092
  const explicit_overrides = _parse_model_overrides(_getattr3(args, "model", null));
38850
39093
  const skipped = [];
38851
39094
  if (members === null) {
@@ -38857,7 +39100,7 @@ function cmd_debate(args, opts = {}) {
38857
39100
  });
38858
39101
  }
38859
39102
  if (table === null) {
38860
- table = load_prices(prices_file_for(REPO_ROOT2));
39103
+ table = load_prices(prices_file_for(REPO_ROOT3));
38861
39104
  }
38862
39105
  const [question, artefact] = build_question({
38863
39106
  input_path: args.question,
@@ -38877,7 +39120,7 @@ function cmd_debate(args, opts = {}) {
38877
39120
  return gate_exit;
38878
39121
  }
38879
39122
  _size_fit_gate({ prompt: question.user_prompt, lens: "debate", members, ai_cfg });
38880
- const project = detect_project_context(REPO_ROOT2);
39123
+ const project = detect_project_context(REPO_ROOT3);
38881
39124
  const billable = members.filter((m) => _getattr3(m, "billable", true));
38882
39125
  const max_rounds_cap = _pyInt6(ai_cfg["debate_max_rounds"] ?? 4, 4);
38883
39126
  const requested = _getattr3(args, "rounds", null) !== null ? _pyInt6(args.rounds) : 2;
@@ -39083,7 +39326,7 @@ function cmd_render(args) {
39083
39326
  kind: "sessions",
39084
39327
  subcommand: "render"
39085
39328
  });
39086
- fs54.mkdirSync(path46.dirname(_resolveTarget(out_path)), { recursive: true });
39329
+ fs54.mkdirSync(path47.dirname(_resolveTarget(out_path)), { recursive: true });
39087
39330
  fs54.writeFileSync(_resolveTarget(out_path), body + "\n", { encoding: "utf-8" });
39088
39331
  _stdout2(`council:render \xB7 wrote ${out_path}
39089
39332
  `);
@@ -39095,7 +39338,7 @@ function cmd_render(args) {
39095
39338
  function _cmd_replay_low_impact_stats(args) {
39096
39339
  const li = low_impact_exports;
39097
39340
  const responses_path = args.responses;
39098
- const log_path = path46.join(path46.dirname(responses_path), "low-impact-resolutions.md");
39341
+ const log_path = path47.join(path47.dirname(responses_path), "low-impact-resolutions.md");
39099
39342
  if (!fs54.existsSync(log_path)) {
39100
39343
  _stdout2(
39101
39344
  `council:replay \xB7 no low-impact-resolutions.md alongside ${responses_path} \u2014 session had no fast-path entries.
@@ -39111,7 +39354,7 @@ function _cmd_replay_low_impact_stats(args) {
39111
39354
  kind: "sessions",
39112
39355
  subcommand: "replay"
39113
39356
  });
39114
- fs54.mkdirSync(path46.dirname(_resolveTarget(target)), { recursive: true });
39357
+ fs54.mkdirSync(path47.dirname(_resolveTarget(target)), { recursive: true });
39115
39358
  fs54.writeFileSync(_resolveTarget(target), out, { encoding: "utf-8" });
39116
39359
  _stdout2(`council:replay \xB7 wrote ${target}
39117
39360
  `);
@@ -39149,7 +39392,7 @@ function cmd_replay(args) {
39149
39392
  kind: "sessions",
39150
39393
  subcommand: "replay"
39151
39394
  });
39152
- fs54.mkdirSync(path46.dirname(_resolveTarget(out_path)), { recursive: true });
39395
+ fs54.mkdirSync(path47.dirname(_resolveTarget(out_path)), { recursive: true });
39153
39396
  fs54.writeFileSync(_resolveTarget(out_path), body, { encoding: "utf-8" });
39154
39397
  _stdout2(`council:replay \xB7 wrote ${out_path}
39155
39398
  `);
@@ -39207,8 +39450,8 @@ function cmd_quota(args, opts = {}) {
39207
39450
  }
39208
39451
  function _validate_council_output_path(path_str, opts) {
39209
39452
  const expected_rel = COUNCIL_CANONICAL_DIRS[opts.kind];
39210
- const expected_abs = _resolveReal(path46.join(REPO_ROOT2, expected_rel));
39211
- const target = path46.isAbsolute(path_str) ? path_str : path46.join(REPO_ROOT2, path_str);
39453
+ const expected_abs = _resolveReal(path47.join(REPO_ROOT3, expected_rel));
39454
+ const target = path47.isAbsolute(path_str) ? path_str : path47.join(REPO_ROOT3, path_str);
39212
39455
  const target_resolved = _resolveReal(target);
39213
39456
  if (!_isRelativeTo(target_resolved, expected_abs)) {
39214
39457
  throw new ArgumentTypeError(
@@ -39218,10 +39461,10 @@ function _validate_council_output_path(path_str, opts) {
39218
39461
  return path_str;
39219
39462
  }
39220
39463
  function _resolveTarget(path_str) {
39221
- return path46.isAbsolute(path_str) ? path_str : path46.join(REPO_ROOT2, path_str);
39464
+ return path47.isAbsolute(path_str) ? path_str : path47.join(REPO_ROOT3, path_str);
39222
39465
  }
39223
39466
  function _resolveReal(p) {
39224
- const abs = path46.resolve(p);
39467
+ const abs = path47.resolve(p);
39225
39468
  try {
39226
39469
  return fs54.realpathSync(abs);
39227
39470
  } catch {
@@ -39232,8 +39475,8 @@ function _isRelativeTo(target, base) {
39232
39475
  if (target === base) {
39233
39476
  return true;
39234
39477
  }
39235
- const rel = path46.relative(base, target);
39236
- return rel !== "" && !rel.startsWith("..") && !path46.isAbsolute(rel);
39478
+ const rel = path47.relative(base, target);
39479
+ return rel !== "" && !rel.startsWith("..") && !path47.isAbsolute(rel);
39237
39480
  }
39238
39481
  function _topError(message) {
39239
39482
  _stderr2(_TOP_USAGE2);
@@ -39594,19 +39837,19 @@ function _isCliEntry17() {
39594
39837
  if (process.argv[1] === void 0) {
39595
39838
  return false;
39596
39839
  }
39597
- const argvUrl = pathToFileURL17(path46.resolve(process.argv[1])).href;
39840
+ const argvUrl = pathToFileURL17(path47.resolve(process.argv[1])).href;
39598
39841
  if (import.meta.url === argvUrl) {
39599
39842
  return true;
39600
39843
  }
39601
39844
  try {
39602
- const here = fs54.realpathSync(fileURLToPath26(import.meta.url));
39603
- const argv = fs54.realpathSync(path46.resolve(process.argv[1]));
39845
+ const here = fs54.realpathSync(fileURLToPath27(import.meta.url));
39846
+ const argv = fs54.realpathSync(path47.resolve(process.argv[1]));
39604
39847
  return here === argv;
39605
39848
  } catch {
39606
39849
  return false;
39607
39850
  }
39608
39851
  }
39609
- var _ArgExit2, ArgumentTypeError, _PROG9, SCHEMA_VERSION8, _API_PROVIDERS, _CLI_PROVIDERS, _HERE15, REPO_ROOT2, SETTINGS_FILE2, AI_COUNCIL_FILE, COUNCIL_CANONICAL_DIRS, CouncilDisabledError, _CLI_FACTORY, ValueError4, FileNotFoundError3, _SUBCOMMANDS, _TOP_USAGE2;
39852
+ var _ArgExit2, ArgumentTypeError, _PROG9, SCHEMA_VERSION8, _API_PROVIDERS, _CLI_PROVIDERS, _HERE15, REPO_ROOT3, SETTINGS_FILE2, AI_COUNCIL_FILE, COUNCIL_CANONICAL_DIRS, CouncilDisabledError, _CLI_FACTORY, ValueError4, FileNotFoundError3, _SUBCOMMANDS, _TOP_USAGE2;
39610
39853
  var init_council_cli = __esm({
39611
39854
  "src/scripts/council_cli.ts"() {
39612
39855
  "use strict";
@@ -39652,10 +39895,10 @@ var init_council_cli = __esm({
39652
39895
  "xai",
39653
39896
  "perplexity"
39654
39897
  ]);
39655
- _HERE15 = path46.dirname(fileURLToPath26(import.meta.url));
39656
- [REPO_ROOT2] = resolve_project_root(null);
39657
- SETTINGS_FILE2 = project_settings_path(REPO_ROOT2);
39658
- AI_COUNCIL_FILE = resolve_config_path(REPO_ROOT2);
39898
+ _HERE15 = path47.dirname(fileURLToPath27(import.meta.url));
39899
+ [REPO_ROOT3] = resolve_project_root(null);
39900
+ SETTINGS_FILE2 = project_settings_path(REPO_ROOT3);
39901
+ AI_COUNCIL_FILE = resolve_config_path(REPO_ROOT3);
39659
39902
  COUNCIL_CANONICAL_DIRS = {
39660
39903
  responses: "agents/runtime/council/responses",
39661
39904
  sessions: "agents/runtime/council/sessions",
@@ -39754,8 +39997,8 @@ var init_safety_envelope = __esm({
39754
39997
  });
39755
39998
 
39756
39999
  // src/scripts/mcp_server/__main__.ts
39757
- import * as path48 from "node:path";
39758
- import { fileURLToPath as fileURLToPath28 } from "node:url";
40000
+ import * as path49 from "node:path";
40001
+ import { fileURLToPath as fileURLToPath29 } from "node:url";
39759
40002
 
39760
40003
  // src/scripts/mcp_server/index.ts
39761
40004
  var __version__ = "0.1.0";
@@ -39803,8 +40046,8 @@ init_resources();
39803
40046
 
39804
40047
  // src/scripts/mcp_server/tools.ts
39805
40048
  import * as fs55 from "node:fs";
39806
- import * as path47 from "node:path";
39807
- import { fileURLToPath as fileURLToPath27 } from "node:url";
40049
+ import * as path48 from "node:path";
40050
+ import { fileURLToPath as fileURLToPath28 } from "node:url";
39808
40051
 
39809
40052
  // src/scripts/chat_history.ts
39810
40053
  init_memory_lookup();
@@ -42053,7 +42296,7 @@ function _resolvePath2(p) {
42053
42296
  try {
42054
42297
  return fs55.realpathSync(p);
42055
42298
  } catch {
42056
- return path47.resolve(p);
42299
+ return path48.resolve(p);
42057
42300
  }
42058
42301
  }
42059
42302
  function _resolveConsumerRoot(override) {
@@ -42063,14 +42306,14 @@ function _resolveConsumerRoot(override) {
42063
42306
  return _resolvePath2(process.cwd());
42064
42307
  }
42065
42308
  function _relativeUnder(target, root) {
42066
- const rel = path47.relative(root, target);
42309
+ const rel = path48.relative(root, target);
42067
42310
  if (rel === "") {
42068
42311
  return "";
42069
42312
  }
42070
- if (rel.startsWith("..") || path47.isAbsolute(rel)) {
42313
+ if (rel.startsWith("..") || path48.isAbsolute(rel)) {
42071
42314
  return null;
42072
42315
  }
42073
- return rel.split(path47.sep).join("/");
42316
+ return rel.split(path48.sep).join("/");
42074
42317
  }
42075
42318
  function _reprStrList(values) {
42076
42319
  return `[${values.map((v) => `'${v}'`).join(", ")}]`;
@@ -42079,11 +42322,11 @@ function _validateInTreePath(raw, consumerRoot) {
42079
42322
  const root = _resolvePath2(consumerRoot);
42080
42323
  let target;
42081
42324
  if (raw === null || raw === void 0 || raw === "") {
42082
- target = path47.join(root, "agents", "runtime", ".agent-chat-history");
42083
- } else if (path47.isAbsolute(raw)) {
42325
+ target = path48.join(root, "agents", "runtime", ".agent-chat-history");
42326
+ } else if (path48.isAbsolute(raw)) {
42084
42327
  target = _resolvePath2(raw);
42085
42328
  } else {
42086
- target = _resolvePath2(path47.join(root, raw));
42329
+ target = _resolvePath2(path48.join(root, raw));
42087
42330
  }
42088
42331
  const rel = _relativeUnder(target, root);
42089
42332
  if (rel === null) {
@@ -42121,7 +42364,7 @@ async function _lintSkillsHandler(args, consumerRoot) {
42121
42364
  if (typeof raw !== "string") {
42122
42365
  throw new Error("'paths' entries must be strings");
42123
42366
  }
42124
- const resolved = path47.isAbsolute(raw) ? _resolvePath2(raw) : _resolvePath2(path47.join(root, raw));
42367
+ const resolved = path48.isAbsolute(raw) ? _resolvePath2(raw) : _resolvePath2(path48.join(root, raw));
42125
42368
  if (_relativeUnder(resolved, root) === null) {
42126
42369
  throw new Error(`path escapes consumer_root: ${resolved}`);
42127
42370
  }
@@ -42178,7 +42421,7 @@ async function _chatHistoryAppendHandler(args, consumerRoot) {
42178
42421
  };
42179
42422
  }
42180
42423
  if (!fs55.existsSync(target) || _chReadHeader(target) === null) {
42181
- fs55.mkdirSync(path47.dirname(target), { recursive: true });
42424
+ fs55.mkdirSync(path48.dirname(target), { recursive: true });
42182
42425
  _chInit(target);
42183
42426
  }
42184
42427
  _chAppend(entry, target, session ?? null);
@@ -42324,8 +42567,8 @@ async function _memoryStatusHandler(_args, consumerRoot) {
42324
42567
  }
42325
42568
  return result;
42326
42569
  }
42327
- var _PACKAGE_ROOT2 = path47.resolve(
42328
- path47.dirname(fileURLToPath27(import.meta.url)),
42570
+ var _PACKAGE_ROOT2 = path48.resolve(
42571
+ path48.dirname(fileURLToPath28(import.meta.url)),
42329
42572
  "..",
42330
42573
  "..",
42331
42574
  ".."
@@ -42369,8 +42612,8 @@ async function _memorySignalHandler(args, consumerRoot) {
42369
42612
  async function _roadmapProgressHandler(args, consumerRoot) {
42370
42613
  const dryRun = _pyTruthy6(args.dry_run ?? false);
42371
42614
  const root = _resolvePath2(consumerRoot);
42372
- const roadmapRoot = path47.join(root, "agents", "roadmaps");
42373
- const target = path47.join(root, "agents", "roadmaps-progress.md");
42615
+ const roadmapRoot = path48.join(root, "agents", "roadmaps");
42616
+ const target = path48.join(root, "agents", "roadmaps-progress.md");
42374
42617
  const urp = await Promise.resolve().then(() => (init_update_roadmap_progress(), update_roadmap_progress_exports));
42375
42618
  if (!fs55.existsSync(roadmapRoot)) {
42376
42619
  return {
@@ -42408,11 +42651,11 @@ async function _roadmapArchiveHandler(_args, consumerRoot) {
42408
42651
  let dashboardRegenerated = false;
42409
42652
  if (archived.length > 0) {
42410
42653
  const urp = await Promise.resolve().then(() => (init_update_roadmap_progress(), update_roadmap_progress_exports));
42411
- const roadmapRoot = path47.join(root, "agents", "roadmaps");
42654
+ const roadmapRoot = path48.join(root, "agents", "roadmaps");
42412
42655
  if (fs55.existsSync(roadmapRoot)) {
42413
42656
  const roadmaps = urp.collect(roadmapRoot);
42414
42657
  fs55.writeFileSync(
42415
- path47.join(root, "agents", "roadmaps-progress.md"),
42658
+ path48.join(root, "agents", "roadmaps-progress.md"),
42416
42659
  urp.render(roadmaps, urp.collect_bundles(root)),
42417
42660
  "utf-8"
42418
42661
  );
@@ -42428,7 +42671,7 @@ async function _roadmapArchiveHandler(_args, consumerRoot) {
42428
42671
  async function _capabilitiesIndexHandler(args, consumerRoot) {
42429
42672
  const check = _pyTruthy6(args.check ?? false);
42430
42673
  const cap = await Promise.resolve().then(() => (init_generate_capabilities_index(), generate_capabilities_index_exports));
42431
- const out = path47.join(_PACKAGE_ROOT2, "CAPABILITIES.yaml");
42674
+ const out = path48.join(_PACKAGE_ROOT2, "CAPABILITIES.yaml");
42432
42675
  const content = cap.build();
42433
42676
  const onDisk = fs55.existsSync(out) ? fs55.readFileSync(out, "utf-8") : "";
42434
42677
  const drift = onDisk !== content;
@@ -42541,7 +42784,7 @@ async function _councilEstimateHandler(args, consumerRoot) {
42541
42784
  throw new Error("'depth' must be 'shallow' or 'deep' when provided");
42542
42785
  }
42543
42786
  const root = _resolvePath2(consumerRoot);
42544
- const target = path47.isAbsolute(inputRaw) ? _resolvePath2(inputRaw) : _resolvePath2(path47.join(root, inputRaw));
42787
+ const target = path48.isAbsolute(inputRaw) ? _resolvePath2(inputRaw) : _resolvePath2(path48.join(root, inputRaw));
42545
42788
  if (_relativeUnder(target, root) === null) {
42546
42789
  throw new Error(`path escapes consumer_root: ${target}`);
42547
42790
  }
@@ -42607,7 +42850,7 @@ async function _runTestsHandler(args, consumerRoot) {
42607
42850
  if (typeof relPathRaw !== "string" || !_strip8(relPathRaw)) {
42608
42851
  throw new Error("'path' must be a non-empty string when provided");
42609
42852
  }
42610
- const resolved = path47.isAbsolute(relPathRaw) ? _resolvePath2(relPathRaw) : _resolvePath2(path47.join(root, relPathRaw));
42853
+ const resolved = path48.isAbsolute(relPathRaw) ? _resolvePath2(relPathRaw) : _resolvePath2(path48.join(root, relPathRaw));
42611
42854
  const rel = _relativeUnder(resolved, root);
42612
42855
  if (rel === null) {
42613
42856
  throw new Error(`path escapes consumer_root: ${resolved}`);
@@ -42617,7 +42860,7 @@ async function _runTestsHandler(args, consumerRoot) {
42617
42860
  }
42618
42861
  relArg = rel;
42619
42862
  }
42620
- const vitestEntry = path47.join(root, "node_modules", "vitest", "vitest.mjs");
42863
+ const vitestEntry = path48.join(root, "node_modules", "vitest", "vitest.mjs");
42621
42864
  if (!fs55.existsSync(vitestEntry)) {
42622
42865
  throw new Error(
42623
42866
  "run_tests pilot supports vitest projects only \u2014 node_modules/vitest/vitest.mjs not found under consumer_root"
@@ -43224,8 +43467,8 @@ function _strCmp3(a, b) {
43224
43467
  return a < b ? -1 : a > b ? 1 : 0;
43225
43468
  }
43226
43469
  function _pathlibCompare3(a, b) {
43227
- const pa = a.split(path47.sep);
43228
- const pb = b.split(path47.sep);
43470
+ const pa = a.split(path48.sep);
43471
+ const pb = b.split(path48.sep);
43229
43472
  const n = Math.min(pa.length, pb.length);
43230
43473
  for (let i = 0; i < n; i++) {
43231
43474
  const c = _strCmp3(pa[i], pb[i]);
@@ -43449,8 +43692,8 @@ function main18() {
43449
43692
  }
43450
43693
 
43451
43694
  // src/scripts/mcp_server/__main__.ts
43452
- var _selfPath = fileURLToPath28(import.meta.url);
43453
- var _invokedDirectly2 = globalThis.__AC_MCP_BUNDLE_DIRECT === true || process.argv[1] !== void 0 && path48.resolve(process.argv[1]) === path48.resolve(_selfPath);
43695
+ var _selfPath = fileURLToPath29(import.meta.url);
43696
+ var _invokedDirectly2 = globalThis.__AC_MCP_BUNDLE_DIRECT === true || process.argv[1] !== void 0 && path49.resolve(process.argv[1]) === path49.resolve(_selfPath);
43454
43697
  if (_invokedDirectly2) {
43455
43698
  main18();
43456
43699
  }