@event4u/agent-config 14.17.0 → 14.19.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 (184) hide show
  1. package/.augment-plugin/marketplace.json +3 -3
  2. package/.augment-plugin/plugin.json +1 -1
  3. package/.claude-plugin/marketplace.json +1 -1
  4. package/CHANGELOG.md +207 -77
  5. package/README.md +72 -150
  6. package/dist/agent-src/README.md +1 -1
  7. package/dist/agent-src/commands/agent-handoff.md +2 -2
  8. package/dist/agent-src/commands/pr/merge.md +35 -44
  9. package/dist/agent-src/commands/review/changes.md +19 -19
  10. package/dist/agent-src/commands/review.md +2 -2
  11. package/dist/agent-src/contexts/execution/host-capability-manifest.md +30 -3
  12. package/dist/agent-src/rules/autonomous-execution.md +1 -1
  13. package/dist/agent-src/rules/git-history-discipline.md +2 -2
  14. package/dist/agent-src/rules/guidelines.md +1 -1
  15. package/dist/agent-src/rules/session-canary.md +2 -2
  16. package/dist/agent-src/rules/token-efficiency.md +1 -1
  17. package/dist/agent-src/skills/accessibility-auditor/SKILL.md +2 -0
  18. package/dist/agent-src/skills/adversarial-review/SKILL.md +0 -8
  19. package/dist/agent-src/skills/ai-code-blindspots/SKILL.md +27 -1
  20. package/dist/agent-src/skills/canvas-design/SKILL.md +1 -1
  21. package/dist/agent-src/skills/code-intelligence/SKILL.md +60 -12
  22. package/dist/agent-src/skills/complexity-first-planning/SKILL.md +27 -0
  23. package/dist/agent-src/skills/design-intelligence/SKILL.md +1 -1
  24. package/dist/agent-src/skills/design-intelligence/data/app-interface.csv +1 -1
  25. package/dist/agent-src/skills/design-intelligence/data/motion.csv +17 -17
  26. package/dist/agent-src/skills/design-intelligence/data/ux-guidelines.csv +2 -2
  27. package/dist/agent-src/skills/design-intelligence/references/context-and-registers.md +17 -0
  28. package/dist/agent-src/skills/design-intelligence/references/design-rules-checklist.md +4 -4
  29. package/dist/agent-src/skills/design-review/SKILL.md +3 -1
  30. package/dist/agent-src/skills/design-variations/SKILL.md +1 -1
  31. package/dist/agent-src/skills/existing-ui-audit/SKILL.md +1 -1
  32. package/dist/agent-src/skills/fe-design/SKILL.md +32 -5
  33. package/dist/agent-src/skills/fe-design/references/craft-floor.md +7 -0
  34. package/dist/agent-src/skills/fe-design/references/design-patterns.md +47 -2
  35. package/dist/agent-src/skills/feature-planning/SKILL.md +34 -0
  36. package/dist/agent-src/skills/git-workflow/SKILL.md +37 -12
  37. package/dist/agent-src/skills/git-workflow/references/push-closes-its-loop.md +176 -0
  38. package/dist/agent-src/skills/laravel-mail/SKILL.md +44 -0
  39. package/dist/agent-src/skills/laravel-scheduling/SKILL.md +3 -1
  40. package/dist/agent-src/skills/project-analyzer/SKILL.md +0 -6
  41. package/dist/agent-src/skills/react-native-setup/SKILL.md +3 -3
  42. package/dist/agent-src/skills/react-shadcn-ui/SKILL.md +1 -1
  43. package/dist/agent-src/skills/sequential-thinking/SKILL.md +18 -8
  44. package/dist/agent-src/skills/tailwind-engineer/SKILL.md +1 -1
  45. package/dist/agent-src/skills/testing-anti-patterns/SKILL.md +40 -0
  46. package/dist/agent-src/skills/ui-apply-generic/SKILL.md +1 -1
  47. package/dist/agent-src/skills/ui-component-architect/SKILL.md +1 -1
  48. package/dist/agent-src/skills/using-git-worktrees/SKILL.md +29 -2
  49. package/dist/agent-src/skills/verify-repair-loop/SKILL.md +53 -8
  50. package/dist/agent-src/skills/worktree-lifecycle/SKILL.md +3 -1
  51. package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
  52. package/dist/cli/commands/recordTriggerEval.js +2 -2
  53. package/dist/cli/main.js +1 -1
  54. package/dist/cli-delegate/{chunk-AKJGUQNO.js → chunk-GZTMRYCN.js} +405 -341
  55. package/dist/cli-delegate/{chunk-7RXIKF62.js → chunk-IDHUQIXP.js} +283 -132
  56. package/dist/cli-delegate/cmd_adr_effective.js +318 -81
  57. package/dist/cli-delegate/cmd_conformance.js +749 -669
  58. package/dist/cli-delegate/cmd_doctor.js +1 -1
  59. package/dist/cli-delegate/cmd_export.js +1 -1
  60. package/dist/cli-delegate/cmd_handoff.js +1 -1
  61. package/dist/cli-delegate/cmd_prune.js +1 -1
  62. package/dist/cli-delegate/cmd_route_audit.js +1 -1
  63. package/dist/cli-delegate/cmd_settings_migrate.js +1 -1
  64. package/dist/cli-delegate/cmd_sync.js +1 -1
  65. package/dist/cli-delegate/cmd_uninstall.js +1 -1
  66. package/dist/cli-delegate/cmd_validate.js +1 -1
  67. package/dist/discovery/deprecation-report.md +1 -1
  68. package/dist/discovery/discovery-manifest.json +39 -38
  69. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  70. package/dist/discovery/discovery-manifest.summary.md +1 -1
  71. package/dist/discovery/dormancy-report.md +1 -1
  72. package/dist/discovery/orphan-report.md +1 -1
  73. package/dist/discovery/packs.json +2 -2
  74. package/dist/discovery/trust-report.md +1 -1
  75. package/dist/discovery/workspaces.json +2 -2
  76. package/dist/hooks/dispatch.js +2764 -2439
  77. package/dist/install/install.mjs +588 -527
  78. package/dist/mcp/registry-manifest.json +2 -2
  79. package/dist/mcp/server.json +2 -2
  80. package/dist/mcp/server.mjs +1381 -1138
  81. package/dist/scripts/_lib/model_tier.js +1 -1
  82. package/dist/shared/settingsConsent.js +1 -1
  83. package/docs/guidelines/agent-infra/evaluator-independence-mechanics.md +1 -1
  84. package/docs/guidelines/agent-infra/roadmap-progress-mechanics.md +1 -1
  85. package/docs/guidelines/design-antipatterns.md +87 -64
  86. package/package.json +1 -1
  87. package/src/agent-src/README.md +1 -1
  88. package/src/config/ci-local-parity.yml +6 -0
  89. package/src/config/conformance-claim-baseline.json +9 -0
  90. package/src/config/gate-coverage.yml +170 -0
  91. package/src/config/gate-violation-baselines.json +4 -4
  92. package/src/config/release-gate-locality.yml +141 -0
  93. package/src/scripts/_cli/cmd_doctor.ts +2 -2
  94. package/src/scripts/_cli/cmd_handoff.ts +1 -1
  95. package/src/scripts/_cli/cmd_update.ts +1 -1
  96. package/src/scripts/_cli/cmd_versions.ts +1 -1
  97. package/src/scripts/_lib/adr_frontmatter.ts +44 -0
  98. package/src/scripts/_lib/consequence_objects.ts +152 -0
  99. package/src/scripts/_lib/exec_evidence.ts +7 -0
  100. package/src/scripts/_lib/global_deploy_inventory.ts +2 -2
  101. package/src/scripts/_lib/host_permission_checks.ts +251 -0
  102. package/src/scripts/_lib/model_tier.ts +1 -1
  103. package/src/scripts/_lib/obligation_frequency.ts +2 -2
  104. package/src/scripts/_lib/release_highlights.ts +265 -1
  105. package/src/scripts/_lib/release_material.ts +129 -0
  106. package/src/scripts/_lib/repeated_run.ts +77 -0
  107. package/src/scripts/_lib/runtime_journal.ts +26 -3
  108. package/src/scripts/_lib/runtime_wiring_checks.ts +12 -1
  109. package/src/scripts/_lib/session_register.ts +11 -6
  110. package/src/scripts/_lib/sqlite_schema.ts +22 -0
  111. package/src/scripts/_lib/surface.ts +86 -0
  112. package/src/scripts/_lib/tamper_vocabulary.ts +242 -0
  113. package/src/scripts/_lib/ui_authority.ts +116 -0
  114. package/src/scripts/_lib/unified_diff.ts +121 -0
  115. package/src/scripts/adr/regenerate_index.ts +54 -1
  116. package/src/scripts/adr_cite_check.ts +71 -15
  117. package/src/scripts/ai_council/clients.ts +1 -1
  118. package/src/scripts/autonomy_friction_corpus.ts +229 -0
  119. package/src/scripts/build_proof.ts +15 -2
  120. package/src/scripts/check_beta_review_markers.ts +141 -17
  121. package/src/scripts/check_enforcement_coverage.ts +1 -1
  122. package/src/scripts/check_enforcement_denominator.ts +121 -11
  123. package/src/scripts/check_finding_dispositions.ts +239 -6
  124. package/src/scripts/check_gate_coverage.ts +96 -0
  125. package/src/scripts/check_installed_hooks_fresh.ts +381 -0
  126. package/src/scripts/check_release_highlights.ts +99 -14
  127. package/src/scripts/check_skill_activation_claim.ts +179 -0
  128. package/src/scripts/check_suppression_hygiene.ts +11 -0
  129. package/src/scripts/check_trigger_evals.ts +1 -1
  130. package/src/scripts/code_graph/build.ts +230 -33
  131. package/src/scripts/code_graph/extract.ts +168 -33
  132. package/src/scripts/code_graph/types.ts +37 -2
  133. package/src/scripts/code_graph/validate.ts +12 -1
  134. package/src/scripts/conformance_scan.ts +45 -4
  135. package/src/scripts/detect_silent_catch.ts +403 -0
  136. package/src/scripts/detect_verification_tampering.ts +538 -0
  137. package/src/scripts/explain_run.ts +1 -1
  138. package/src/scripts/generate_capability_matrix.ts +1 -1
  139. package/src/scripts/git_authorization_hook.ts +228 -18
  140. package/src/scripts/hook_manifest.json +1 -1
  141. package/src/scripts/hook_manifest.yaml +47 -30
  142. package/src/scripts/hooks/augment-dispatcher.sh +1 -1
  143. package/src/scripts/hooks/block_no_verify.ts +3 -3
  144. package/src/scripts/hooks/category_a.ts +291 -0
  145. package/src/scripts/hooks/cline-dispatcher.sh +1 -1
  146. package/src/scripts/hooks/concern_registry.ts +2 -2
  147. package/src/scripts/hooks/cursor-dispatcher.sh +11 -5
  148. package/src/scripts/hooks/dispatch_hook.ts +17 -22
  149. package/src/scripts/hooks/evidence_independence.ts +21 -2
  150. package/src/scripts/hooks/{block_unauthorized_git.ts → git_command_classifier.ts} +175 -364
  151. package/src/scripts/hooks/host_lowering.ts +215 -0
  152. package/src/scripts/hooks/host_lowering.yaml +185 -0
  153. package/src/scripts/hooks/host_semantics.ts +105 -37
  154. package/src/scripts/hooks/journal_record_hook.ts +10 -0
  155. package/src/scripts/hooks/permission_gate.ts +117 -0
  156. package/src/scripts/hooks/push_settle_hook.ts +250 -0
  157. package/src/scripts/hooks/ship_diff_volume_hook.ts +1 -1
  158. package/src/scripts/hooks_status.ts +12 -10
  159. package/src/scripts/install-hooks.sh +134 -1
  160. package/src/scripts/install.ts +53 -82
  161. package/src/scripts/install_anthropic_key.sh +2 -2
  162. package/src/scripts/language_mirror_hook.ts +27 -5
  163. package/src/scripts/lint_design_antipattern_parity.ts +80 -0
  164. package/src/scripts/lint_evidence_artifacts.ts +45 -1
  165. package/src/scripts/lint_hook_manifest.ts +87 -3
  166. package/src/scripts/lint_motion_authority_drift.ts +731 -0
  167. package/src/scripts/lint_readme_size.ts +158 -12
  168. package/src/scripts/lint_reasoning_fixtures.ts +216 -0
  169. package/src/scripts/lint_skill_trigger_contradiction.ts +161 -0
  170. package/src/scripts/measure_sibling_naming.ts +150 -0
  171. package/src/scripts/redact_hook_capture.ts +1 -1
  172. package/src/scripts/release.ts +31 -143
  173. package/src/scripts/release_drill.ts +71 -1
  174. package/src/scripts/release_publication.ts +243 -3
  175. package/src/scripts/release_verify.ts +220 -0
  176. package/src/scripts/report_skill_activation.ts +319 -7
  177. package/src/scripts/schemas/review-findings.schema.json +6 -1
  178. package/src/scripts/schemas/skill.schema.json +12 -2
  179. package/src/scripts/self_review_gate.ts +10 -1
  180. package/src/scripts/session_canary_hook.ts +1 -1
  181. package/src/scripts/session_register_hook.ts +4 -3
  182. package/src/scripts/trigger_eval_grandfather.json +5 -1
  183. package/src/scripts/validate_agent_settings.ts +1 -1
  184. package/src/shared/settingsConsent.ts +1 -1
@@ -74,9 +74,9 @@ import {
74
74
  // src/scripts/_cli/cmd_doctor.ts
75
75
  var YAML2 = __toESM(require_dist(), 1);
76
76
  import * as crypto2 from "node:crypto";
77
- import * as fs14 from "node:fs";
78
- import * as os3 from "node:os";
79
- import * as path19 from "node:path";
77
+ import * as fs15 from "node:fs";
78
+ import * as os4 from "node:os";
79
+ import * as path20 from "node:path";
80
80
  import process3 from "node:process";
81
81
  import { fileURLToPath as fileURLToPath5, pathToFileURL as pathToFileURL6 } from "node:url";
82
82
 
@@ -2132,8 +2132,8 @@ if (_isCliEntry()) process.exit(main5(process.argv.slice(2)));
2132
2132
 
2133
2133
  // src/scripts/_lib/runtime_wiring_checks.ts
2134
2134
  var import_yaml = __toESM(require_dist(), 1);
2135
- import * as fs10 from "node:fs";
2136
- import * as path14 from "node:path";
2135
+ import * as fs11 from "node:fs";
2136
+ import * as path15 from "node:path";
2137
2137
  import process2 from "node:process";
2138
2138
 
2139
2139
  // src/scripts/_lib/repo_root.ts
@@ -2152,6 +2152,152 @@ function inheritedGitOverrides(env = process.env) {
2152
2152
  return out;
2153
2153
  }
2154
2154
 
2155
+ // src/scripts/_lib/host_permission_checks.ts
2156
+ import * as fs10 from "node:fs";
2157
+ import * as os from "node:os";
2158
+ import * as path14 from "node:path";
2159
+ var READ_SHAPED = [
2160
+ "Read",
2161
+ "Glob",
2162
+ "Grep",
2163
+ "LS",
2164
+ "NotebookRead",
2165
+ "Bash(cat",
2166
+ "Bash(ls",
2167
+ "Bash(head",
2168
+ "Bash(tail",
2169
+ "Bash(grep",
2170
+ "Bash(rg",
2171
+ "Bash(find",
2172
+ "Bash(wc",
2173
+ "Bash(git status",
2174
+ "Bash(git log",
2175
+ "Bash(git diff",
2176
+ "Bash(git show"
2177
+ ];
2178
+ var KNOWN_MODES = ["default", "acceptEdits", "plan", "bypassPermissions"];
2179
+ function _strings(value) {
2180
+ return Array.isArray(value) ? value.filter((v) => typeof v === "string") : [];
2181
+ }
2182
+ function defaultHostPermissionDeps(projectRoot) {
2183
+ return {
2184
+ projectRoot,
2185
+ homeDir: os.homedir(),
2186
+ readFile: (p) => {
2187
+ try {
2188
+ return fs10.readFileSync(p, "utf8");
2189
+ } catch {
2190
+ return null;
2191
+ }
2192
+ },
2193
+ isDirectory: (p) => {
2194
+ try {
2195
+ return fs10.statSync(p).isDirectory();
2196
+ } catch {
2197
+ return false;
2198
+ }
2199
+ }
2200
+ };
2201
+ }
2202
+ function readSettingsLayers(deps) {
2203
+ const candidates = [
2204
+ ["user-global", path14.join(deps.homeDir, ".claude", "settings.json")],
2205
+ ["project", path14.join(deps.projectRoot, ".claude", "settings.json")],
2206
+ ["project-local", path14.join(deps.projectRoot, ".claude", "settings.local.json")]
2207
+ ];
2208
+ return candidates.map(([label, file]) => {
2209
+ const raw = deps.readFile(file);
2210
+ if (raw === null) {
2211
+ return { label, file, present: false, unreadable: false, permissions: {} };
2212
+ }
2213
+ try {
2214
+ const parsed = JSON.parse(raw);
2215
+ const perms = parsed["permissions"];
2216
+ return {
2217
+ label,
2218
+ file,
2219
+ present: true,
2220
+ unreadable: false,
2221
+ permissions: perms !== null && typeof perms === "object" ? perms : {}
2222
+ };
2223
+ } catch {
2224
+ return { label, file, present: true, unreadable: true, permissions: {} };
2225
+ }
2226
+ });
2227
+ }
2228
+ function readDenyRules(layers) {
2229
+ const hits = [];
2230
+ for (const layer of layers) {
2231
+ for (const rule of _strings(layer.permissions.deny)) {
2232
+ if (READ_SHAPED.some((prefix) => rule.startsWith(prefix))) {
2233
+ hits.push([layer.label, rule]);
2234
+ }
2235
+ }
2236
+ }
2237
+ return hits;
2238
+ }
2239
+ function additionalDirectories(layers) {
2240
+ const seen = [];
2241
+ for (const layer of layers) {
2242
+ for (const dir of _strings(layer.permissions.additionalDirectories)) {
2243
+ if (!seen.includes(dir)) seen.push(dir);
2244
+ }
2245
+ }
2246
+ return seen;
2247
+ }
2248
+ function resolvedDefaultMode(layers) {
2249
+ let winner = null;
2250
+ for (const layer of layers) {
2251
+ const mode = layer.permissions.defaultMode;
2252
+ if (typeof mode === "string" && mode.trim()) winner = mode.trim();
2253
+ }
2254
+ return winner;
2255
+ }
2256
+ function isLinkedWorktree(deps) {
2257
+ const dotGit = path14.join(deps.projectRoot, ".git");
2258
+ const raw = deps.readFile(dotGit);
2259
+ if (raw === null) return false;
2260
+ return !deps.isDirectory(dotGit) && raw.trimStart().startsWith("gitdir:");
2261
+ }
2262
+ function permissionSnippet(projectRoot) {
2263
+ return JSON.stringify(
2264
+ { permissions: { additionalDirectories: [projectRoot], defaultMode: "default" } },
2265
+ null,
2266
+ 2
2267
+ );
2268
+ }
2269
+ function checkHostPermissionSettings(deps) {
2270
+ const layers = readSettingsLayers(deps);
2271
+ const unreadable = layers.filter((l) => l.unreadable);
2272
+ const denies = readDenyRules(layers);
2273
+ const dirs = additionalDirectories(layers);
2274
+ const mode = resolvedDefaultMode(layers);
2275
+ const worktree = isLinkedWorktree(deps);
2276
+ const rootListed = dirs.some(
2277
+ (d) => path14.resolve(d) === path14.resolve(deps.projectRoot)
2278
+ );
2279
+ const lines = [];
2280
+ lines.push(
2281
+ denies.length === 0 ? "read-deny rules: absent \u2014 no permissions.deny rule covers a read" : `read-deny rules: ${denies.length} \u2014 ` + denies.map(([layer, rule]) => `${rule} (${layer})`).join(", ")
2282
+ );
2283
+ lines.push(
2284
+ rootListed ? `working tree in additionalDirectories: present (${deps.projectRoot})` : `working tree in additionalDirectories: absent (${deps.projectRoot}${worktree ? ", a linked worktree" : ""})`
2285
+ );
2286
+ lines.push(
2287
+ mode === null ? "permissions.defaultMode: absent \u2014 the host's own built-in default applies" : `permissions.defaultMode: ${mode}` + (KNOWN_MODES.includes(mode) ? "" : " \u2014 not a value this tree has probed")
2288
+ );
2289
+ for (const layer of unreadable) {
2290
+ lines.push(`unreadable: ${layer.file} (${layer.label}) is not valid JSON`);
2291
+ }
2292
+ const reportable = denies.length > 0 || unreadable.length > 0 || worktree && !rootListed;
2293
+ return {
2294
+ id: "host-permission-settings",
2295
+ status: reportable ? "warn" : "ok",
2296
+ message: lines.join("; "),
2297
+ remedy: `agent-config never writes permissions \u2014 paste this into ${path14.join(deps.projectRoot, ".claude", "settings.local.json")} yourself if you want it: ` + permissionSnippet(deps.projectRoot).replace(/\s+/g, " ")
2298
+ };
2299
+ }
2300
+
2155
2301
  // src/scripts/_lib/runtime_wiring_checks.ts
2156
2302
  function checkSettingsResolution(iterOverrides) {
2157
2303
  let pairs;
@@ -2182,7 +2328,7 @@ function checkSettingsResolution(iterOverrides) {
2182
2328
  for (const [key, , file] of pairs) winner.set(key, file);
2183
2329
  const byFile = /* @__PURE__ */ new Map();
2184
2330
  for (const file of winner.values()) byFile.set(file, (byFile.get(file) ?? 0) + 1);
2185
- const summary = [...byFile.entries()].sort((a, b) => b[1] - a[1]).map(([f, n]) => `${path14.basename(f)}=${String(n)}`).join(" \xB7 ");
2331
+ const summary = [...byFile.entries()].sort((a, b) => b[1] - a[1]).map(([f, n]) => `${path15.basename(f)}=${String(n)}`).join(" \xB7 ");
2186
2332
  return {
2187
2333
  id: "settings-resolution",
2188
2334
  status: "ok",
@@ -2191,8 +2337,8 @@ function checkSettingsResolution(iterOverrides) {
2191
2337
  };
2192
2338
  }
2193
2339
  function checkRouterArtifact(repoRoot, rel = "dist/router.json") {
2194
- const abs = path14.join(repoRoot, rel);
2195
- if (!fs10.existsSync(abs)) {
2340
+ const abs = path15.join(repoRoot, rel);
2341
+ if (!fs11.existsSync(abs)) {
2196
2342
  return {
2197
2343
  id: "router-artifact",
2198
2344
  status: "warn",
@@ -2202,7 +2348,7 @@ function checkRouterArtifact(repoRoot, rel = "dist/router.json") {
2202
2348
  }
2203
2349
  let doc;
2204
2350
  try {
2205
- doc = JSON.parse(fs10.readFileSync(abs, "utf8"));
2351
+ doc = JSON.parse(fs11.readFileSync(abs, "utf8"));
2206
2352
  } catch (e) {
2207
2353
  return {
2208
2354
  id: "router-artifact",
@@ -2234,8 +2380,8 @@ function _routerRuleCount(doc) {
2234
2380
  return n;
2235
2381
  }
2236
2382
  function checkHookResolution(repoRoot, manifestRel = "src/scripts/hook_manifest.yaml", probe = null) {
2237
- const abs = path14.join(repoRoot, manifestRel);
2238
- if (!fs10.existsSync(abs)) {
2383
+ const abs = path15.join(repoRoot, manifestRel);
2384
+ if (!fs11.existsSync(abs)) {
2239
2385
  return {
2240
2386
  check: {
2241
2387
  id: "hook-resolution",
@@ -2248,7 +2394,7 @@ function checkHookResolution(repoRoot, manifestRel = "src/scripts/hook_manifest.
2248
2394
  }
2249
2395
  let concerns;
2250
2396
  try {
2251
- const doc = (0, import_yaml.parse)(fs10.readFileSync(abs, "utf8"));
2397
+ const doc = (0, import_yaml.parse)(fs11.readFileSync(abs, "utf8"));
2252
2398
  concerns = doc.concerns ?? {};
2253
2399
  } catch (e) {
2254
2400
  return {
@@ -2264,7 +2410,7 @@ function checkHookResolution(repoRoot, manifestRel = "src/scripts/hook_manifest.
2264
2410
  const probes = [];
2265
2411
  for (const [id, c] of Object.entries(concerns)) {
2266
2412
  const script = typeof c.script === "string" ? c.script : "";
2267
- const resolves = script !== "" && fs10.existsSync(path14.join(repoRoot, script));
2413
+ const resolves = script !== "" && fs11.existsSync(path15.join(repoRoot, script));
2268
2414
  probes.push({ id, script, resolves, ms: resolves && probe !== null ? probe(script) : null });
2269
2415
  }
2270
2416
  const broken = probes.filter((p) => !p.resolves);
@@ -2308,7 +2454,7 @@ function checkInheritedGitEnv(env = process2.env) {
2308
2454
  remedy: "unset them before running a gate from inside a git hook (`env -u GIT_DIR -u GIT_WORK_TREE \u2026`), or resolve the root with _lib/repo_root.ts, which refuses instead of guessing"
2309
2455
  };
2310
2456
  }
2311
- var WIRING_CHECK_IDS = ["settings-resolution", "router-artifact", "hook-resolution", "inherited-git-env", "hooks-kill-switch"];
2457
+ var WIRING_CHECK_IDS = ["settings-resolution", "router-artifact", "hook-resolution", "inherited-git-env", "hooks-kill-switch", "host-permission-settings"];
2312
2458
  function checkHooksDisabled(env = process2.env) {
2313
2459
  const raw = env["AGENT_CONFIG_DISABLE_HOOKS"];
2314
2460
  if (raw !== "1") {
@@ -2335,7 +2481,12 @@ function wiringRunners(opts) {
2335
2481
  // a multi-second one. `probeHookCost` is exported for a caller that wants it.
2336
2482
  "hook-resolution": () => checkHookResolution(opts.packageRoot).check,
2337
2483
  "inherited-git-env": () => checkInheritedGitEnv(),
2338
- "hooks-kill-switch": () => checkHooksDisabled()
2484
+ "hooks-kill-switch": () => checkHooksDisabled(),
2485
+ // The host's own permission settings, which decide how often a call is
2486
+ // confirmed. It lives with this family rather than its own because
2487
+ // `checkHookWiring` below already reads the same `~/.claude/settings.json`
2488
+ // for the same host — the question is the same surface, one key over.
2489
+ "host-permission-settings": () => checkHostPermissionSettings(defaultHostPermissionDeps(opts.projectRoot))
2339
2490
  };
2340
2491
  }
2341
2492
  function checkHookWiring(deps) {
@@ -2348,11 +2499,11 @@ function checkHookWiring(deps) {
2348
2499
  remedy: ""
2349
2500
  };
2350
2501
  }
2351
- const settings_path = path14.join(deps.homeDir, ".claude", "settings.json");
2502
+ const settings_path = path15.join(deps.homeDir, ".claude", "settings.json");
2352
2503
  let missing;
2353
2504
  try {
2354
- const matrix = deps.buildMatrix(path14.join(deps.packageRoot, "src", "scripts", "hook_manifest.yaml"));
2355
- const settings = fs10.existsSync(settings_path) ? JSON.parse(fs10.readFileSync(settings_path, "utf8")) : {};
2505
+ const matrix = deps.buildMatrix(path15.join(deps.packageRoot, "src", "scripts", "hook_manifest.yaml"));
2506
+ const settings = fs11.existsSync(settings_path) ? JSON.parse(fs11.readFileSync(settings_path, "utf8")) : {};
2356
2507
  const hooks = (settings["hooks"] ?? {}) || {};
2357
2508
  missing = Object.keys(matrix).filter((ev) => {
2358
2509
  const groups = hooks[ev];
@@ -2399,8 +2550,8 @@ function checkHookWiring(deps) {
2399
2550
  }
2400
2551
 
2401
2552
  // src/scripts/_lib/install_reach_checks.ts
2402
- import * as fs11 from "node:fs";
2403
- import * as path15 from "node:path";
2553
+ import * as fs12 from "node:fs";
2554
+ import * as path16 from "node:path";
2404
2555
  var ROOT_INSTRUCTION_FILES = [
2405
2556
  "AGENTS.md",
2406
2557
  "CLAUDE.md",
@@ -2433,7 +2584,7 @@ function _isAnchored(projectRoot, token) {
2433
2584
  const first = token.split("/")[0];
2434
2585
  if (first === void 0 || first === "" || first === token) return false;
2435
2586
  try {
2436
- return fs11.statSync(path15.join(projectRoot, first)).isDirectory();
2587
+ return fs12.statSync(path16.join(projectRoot, first)).isDirectory();
2437
2588
  } catch {
2438
2589
  return false;
2439
2590
  }
@@ -2470,19 +2621,19 @@ function classifyNamedPath(projectRoot, entry) {
2470
2621
  if (rel === "") {
2471
2622
  return { ...entry, normalised: null, outcome: "unresolvable", reason: "empty after normalisation" };
2472
2623
  }
2473
- const abs = path15.join(projectRoot, rel);
2474
- if (!path15.resolve(abs).startsWith(path15.resolve(projectRoot))) {
2624
+ const abs = path16.join(projectRoot, rel);
2625
+ if (!path16.resolve(abs).startsWith(path16.resolve(projectRoot))) {
2475
2626
  return { ...entry, normalised: rel, outcome: "unresolvable", reason: "escapes the repository root" };
2476
2627
  }
2477
- return { ...entry, normalised: rel, outcome: fs11.existsSync(abs) ? "present" : "dangling" };
2628
+ return { ...entry, normalised: rel, outcome: fs12.existsSync(abs) ? "present" : "dangling" };
2478
2629
  }
2479
2630
  function resolveInstructionPaths(projectRoot) {
2480
2631
  const out = [];
2481
2632
  for (const rel of ROOT_INSTRUCTION_FILES) {
2482
- const abs = path15.join(projectRoot, rel);
2633
+ const abs = path16.join(projectRoot, rel);
2483
2634
  let text;
2484
2635
  try {
2485
- text = fs11.readFileSync(abs, "utf8");
2636
+ text = fs12.readFileSync(abs, "utf8");
2486
2637
  } catch {
2487
2638
  continue;
2488
2639
  }
@@ -2523,7 +2674,7 @@ function checkInstructionPaths(projectRoot) {
2523
2674
  };
2524
2675
  }
2525
2676
  var SETTINGS_PIN_FILES = [
2526
- { rel: path15.join("agents", "settings", ".agent-settings.yml"), legacy: false },
2677
+ { rel: path16.join("agents", "settings", ".agent-settings.yml"), legacy: false },
2527
2678
  { rel: ".agent-settings.yml", legacy: true },
2528
2679
  { rel: ".agent-project-settings.yml", legacy: true },
2529
2680
  { rel: "agent-settings.yml", legacy: true }
@@ -2535,7 +2686,7 @@ function readVersionPins(projectRoot) {
2535
2686
  for (const { rel, legacy } of SETTINGS_PIN_FILES) {
2536
2687
  let text;
2537
2688
  try {
2538
- text = fs11.readFileSync(path15.join(projectRoot, rel), "utf8");
2689
+ text = fs12.readFileSync(path16.join(projectRoot, rel), "utf8");
2539
2690
  } catch {
2540
2691
  continue;
2541
2692
  }
@@ -2546,7 +2697,7 @@ function readVersionPins(projectRoot) {
2546
2697
  }
2547
2698
  function readInstalledVersion(projectRoot) {
2548
2699
  try {
2549
- const text = fs11.readFileSync(path15.join(projectRoot, "agents", "installed-tools.lock"), "utf8");
2700
+ const text = fs12.readFileSync(path16.join(projectRoot, "agents", "installed-tools.lock"), "utf8");
2550
2701
  return LOCK_VERSION_RE.exec(text)?.[1] ?? null;
2551
2702
  } catch {
2552
2703
  return null;
@@ -2573,8 +2724,8 @@ function checkVersionAxis(projectRoot, resolvableNow) {
2573
2724
  };
2574
2725
  }
2575
2726
  var OVERRIDE_LAYERS = [
2576
- path15.join("agents", "overrides"),
2577
- path15.join(".agent", "overrides")
2727
+ path16.join("agents", "overrides"),
2728
+ path16.join(".agent", "overrides")
2578
2729
  ];
2579
2730
  var KIND_DIRS = [
2580
2731
  { dir: "rules", kind: "rule" },
@@ -2587,7 +2738,7 @@ function collectOverrideSet(projectRoot) {
2587
2738
  for (const { dir, kind } of KIND_DIRS) {
2588
2739
  let entries;
2589
2740
  try {
2590
- entries = fs11.readdirSync(path15.join(projectRoot, layer, dir));
2741
+ entries = fs12.readdirSync(path16.join(projectRoot, layer, dir));
2591
2742
  } catch {
2592
2743
  continue;
2593
2744
  }
@@ -2666,14 +2817,14 @@ function checkHumanizerRuntime(which) {
2666
2817
 
2667
2818
  // src/scripts/_lib/environment_detector.ts
2668
2819
  import { spawnSync } from "node:child_process";
2669
- import * as fs12 from "node:fs";
2670
- import * as os from "node:os";
2671
- import * as path16 from "node:path";
2820
+ import * as fs13 from "node:fs";
2821
+ import * as os2 from "node:os";
2822
+ import * as path17 from "node:path";
2672
2823
 
2673
2824
  // src/install/toolDetection.ts
2674
2825
  import { existsSync as existsSync9 } from "node:fs";
2675
- import { homedir as homedir3 } from "node:os";
2676
- import { delimiter, join as join15 } from "node:path";
2826
+ import { homedir as homedir4 } from "node:os";
2827
+ import { delimiter, join as join16 } from "node:path";
2677
2828
  var TOOL_SIGNALS = {
2678
2829
  "claude-code": { bins: ["claude"], homePaths: [".claude", ".claude.json", ".config/claude"] },
2679
2830
  "claude-desktop": { absPaths: ["/Applications/Claude.app"], homePaths: ["Library/Application Support/Claude", ".config/Claude"] },
@@ -2718,7 +2869,7 @@ function resolveBinaryPath(name, pathEnv) {
2718
2869
  for (const dir of pathEnv.split(delimiter)) {
2719
2870
  if (dir.length === 0) continue;
2720
2871
  for (const candidate of [name, `${name}.exe`, `${name}.cmd`]) {
2721
- const full = join15(dir, candidate);
2872
+ const full = join16(dir, candidate);
2722
2873
  if (existsSync9(full)) return full;
2723
2874
  }
2724
2875
  }
@@ -2729,7 +2880,7 @@ function binOnPath(name, pathEnv) {
2729
2880
  }
2730
2881
  function isToolInstalled(signal, home, pathEnv) {
2731
2882
  for (const rel of signal.homePaths ?? []) {
2732
- if (existsSync9(join15(home, rel))) return true;
2883
+ if (existsSync9(join16(home, rel))) return true;
2733
2884
  }
2734
2885
  for (const abs of signal.absPaths ?? []) {
2735
2886
  if (existsSync9(abs)) return true;
@@ -2740,7 +2891,7 @@ function isToolInstalled(signal, home, pathEnv) {
2740
2891
  return false;
2741
2892
  }
2742
2893
  function detectInstalledTools(opts = {}) {
2743
- const home = opts.home ?? homedir3();
2894
+ const home = opts.home ?? homedir4();
2744
2895
  const pathEnv = opts.pathEnv ?? process.env["PATH"] ?? "";
2745
2896
  const out = {};
2746
2897
  for (const [id, signal] of Object.entries(TOOL_SIGNALS)) {
@@ -2791,12 +2942,12 @@ function classifyBilling(provider, source) {
2791
2942
  function codexHome(env) {
2792
2943
  const map = env ?? process.env;
2793
2944
  const override = (map["CODEX_HOME"] ?? "").trim();
2794
- return override !== "" ? override : path16.join(homeOf(env), ".codex");
2945
+ return override !== "" ? override : path17.join(homeOf(env), ".codex");
2795
2946
  }
2796
2947
  function homeOf(env) {
2797
2948
  const map = env ?? process.env;
2798
2949
  const injected = (map["HOME"] ?? "").trim();
2799
- return injected !== "" ? injected : os.homedir();
2950
+ return injected !== "" ? injected : os2.homedir();
2800
2951
  }
2801
2952
  var VERSION_PROBE_TIMEOUT_MS = 2e3;
2802
2953
  var CLAUDE_KEYCHAIN_SERVICE = "Claude Code-credentials";
@@ -2832,14 +2983,14 @@ ${res.stderr ?? ""}`;
2832
2983
  }
2833
2984
  function isFile3(p) {
2834
2985
  try {
2835
- return fs12.statSync(p).isFile();
2986
+ return fs13.statSync(p).isFile();
2836
2987
  } catch {
2837
2988
  return false;
2838
2989
  }
2839
2990
  }
2840
2991
  function exists(p) {
2841
2992
  try {
2842
- return fs12.existsSync(p);
2993
+ return fs13.existsSync(p);
2843
2994
  } catch {
2844
2995
  return false;
2845
2996
  }
@@ -2847,7 +2998,7 @@ function exists(p) {
2847
2998
  function classifyCodexAuth(authPath) {
2848
2999
  let data;
2849
3000
  try {
2850
- data = JSON.parse(fs12.readFileSync(authPath, "utf-8"));
3001
+ data = JSON.parse(fs13.readFileSync(authPath, "utf-8"));
2851
3002
  } catch {
2852
3003
  return "cli-api-key";
2853
3004
  }
@@ -2864,7 +3015,7 @@ function cliSubscriptionEvidence(provider, home, env, claudeConfigDir, probeKeyc
2864
3015
  if (provider === "anthropic") {
2865
3016
  const configDir = claudeConfigDir;
2866
3017
  for (const rel of [".credentials.json", "credentials.json"]) {
2867
- const p = path16.join(configDir, rel);
3018
+ const p = path17.join(configDir, rel);
2868
3019
  if (isFile3(p)) return { source: "cli-subscription", evidence: p };
2869
3020
  }
2870
3021
  if (probeKeychain(CLAUDE_KEYCHAIN_SERVICE)) {
@@ -2873,12 +3024,12 @@ function cliSubscriptionEvidence(provider, home, env, claudeConfigDir, probeKeyc
2873
3024
  return null;
2874
3025
  }
2875
3026
  if (provider === "openai") {
2876
- const p = path16.join(codexHome(env), "auth.json");
3027
+ const p = path17.join(codexHome(env), "auth.json");
2877
3028
  if (isFile3(p)) return { source: classifyCodexAuth(p), evidence: p };
2878
3029
  return null;
2879
3030
  }
2880
3031
  if (provider === "gemini") {
2881
- const p = path16.join(home, ".gemini", "oauth_creds.json");
3032
+ const p = path17.join(home, ".gemini", "oauth_creds.json");
2882
3033
  if (isFile3(p)) return { source: "cli-subscription", evidence: p };
2883
3034
  return null;
2884
3035
  }
@@ -2910,7 +3061,7 @@ function detectHosts(opts) {
2910
3061
  function detectAuth(opts) {
2911
3062
  const env = opts.env ?? process.env;
2912
3063
  const home = opts.home ?? homeOf(opts.env);
2913
- const claudeConfigDir = opts.home === void 0 && opts.env === void 0 ? claude_config_dir() : (env["CLAUDE_CONFIG_DIR"] ?? "").trim() || path16.join(home, ".claude");
3064
+ const claudeConfigDir = opts.home === void 0 && opts.env === void 0 ? claude_config_dir() : (env["CLAUDE_CONFIG_DIR"] ?? "").trim() || path17.join(home, ".claude");
2914
3065
  const probeKeychain = opts.probeKeychain ?? defaultProbeKeychain;
2915
3066
  const auth = [];
2916
3067
  const keys = [];
@@ -2965,7 +3116,7 @@ function detectEnvironment(opts = {}) {
2965
3116
  }
2966
3117
 
2967
3118
  // src/scripts/_cli/detection_report.ts
2968
- import * as path17 from "node:path";
3119
+ import * as path18 from "node:path";
2969
3120
 
2970
3121
  // src/scripts/ai_council/transport_resolver.ts
2971
3122
  var VALID_TRANSPORT_MODES = /* @__PURE__ */ new Set([
@@ -3167,7 +3318,7 @@ function cliBinaryPresent(environment, provider, binaryOverride) {
3167
3318
  const expected = PROVIDER_CLI_META[provider]?.[0];
3168
3319
  if (expected === void 0) return false;
3169
3320
  return environment.hosts.some(
3170
- (h) => h.binary !== null && stripExe(path17.basename(h.binary)) === expected
3321
+ (h) => h.binary !== null && stripExe(path18.basename(h.binary)) === expected
3171
3322
  );
3172
3323
  }
3173
3324
  function stripExe(name) {
@@ -3328,9 +3479,9 @@ function absentCouncilFacts(configPath) {
3328
3479
 
3329
3480
  // src/scripts/ai_team/review_gate.ts
3330
3481
  import * as crypto from "node:crypto";
3331
- import * as fs13 from "node:fs";
3332
- import * as os2 from "node:os";
3333
- import * as path18 from "node:path";
3482
+ import * as fs14 from "node:fs";
3483
+ import * as os3 from "node:os";
3484
+ import * as path19 from "node:path";
3334
3485
 
3335
3486
  // src/scripts/ai_team/config.ts
3336
3487
  var AI_TEAM_REVIEW_GATE_DEFAULTS = Object.freeze({
@@ -3346,16 +3497,16 @@ var AI_TEAM_DEFAULTS = Object.freeze({
3346
3497
  });
3347
3498
 
3348
3499
  // src/scripts/ai_team/review_gate.ts
3349
- var GATE_LEDGER_RELPATH = path18.join("agents", "runtime", "team", "events.log");
3500
+ var GATE_LEDGER_RELPATH = path19.join("agents", "runtime", "team", "events.log");
3350
3501
  var _CODEX_PLUGIN_DATA_DIRNAME = `${CODEX_PLUGIN_ID}-${CODEX_MARKETPLACE_NAME}`;
3351
3502
  function _workspace_state_segment(workspace_root) {
3352
3503
  let canonical = workspace_root;
3353
3504
  try {
3354
- canonical = fs13.realpathSync.native(workspace_root);
3505
+ canonical = fs14.realpathSync.native(workspace_root);
3355
3506
  } catch {
3356
3507
  canonical = workspace_root;
3357
3508
  }
3358
- const slug_source = path18.basename(workspace_root) || "workspace";
3509
+ const slug_source = path19.basename(workspace_root) || "workspace";
3359
3510
  const slug = slug_source.replace(/[^a-zA-Z0-9._-]+/g, "-").replace(/^-+|-+$/g, "") || "workspace";
3360
3511
  const hash = crypto.createHash("sha256").update(canonical).digest("hex").slice(0, 16);
3361
3512
  return `${slug}-${hash}`;
@@ -3365,19 +3516,19 @@ function upstream_state_dir_candidates(workspace_root) {
3365
3516
  const candidates = [];
3366
3517
  const env = (process.env["CLAUDE_PLUGIN_DATA"] ?? "").trim();
3367
3518
  if (env !== "") {
3368
- candidates.push(path18.join(env, "state", segment));
3519
+ candidates.push(path19.join(env, "state", segment));
3369
3520
  }
3370
3521
  candidates.push(
3371
- path18.join(claude_config_dir(), "plugins", "data", _CODEX_PLUGIN_DATA_DIRNAME, "state", segment)
3522
+ path19.join(claude_config_dir(), "plugins", "data", _CODEX_PLUGIN_DATA_DIRNAME, "state", segment)
3372
3523
  );
3373
- candidates.push(path18.join(os2.tmpdir(), "codex-companion", segment));
3524
+ candidates.push(path19.join(os3.tmpdir(), "codex-companion", segment));
3374
3525
  return candidates;
3375
3526
  }
3376
3527
  function upstream_gate_enabled(workspace_root) {
3377
3528
  for (const dir of upstream_state_dir_candidates(workspace_root)) {
3378
3529
  let parsed;
3379
3530
  try {
3380
- parsed = JSON.parse(fs13.readFileSync(path18.join(dir, "state.json"), "utf-8"));
3531
+ parsed = JSON.parse(fs14.readFileSync(path19.join(dir, "state.json"), "utf-8"));
3381
3532
  } catch {
3382
3533
  continue;
3383
3534
  }
@@ -3532,15 +3683,15 @@ var ArgparseExit = class extends Error {
3532
3683
  code;
3533
3684
  };
3534
3685
  function expanduser(p) {
3535
- if (p === "~") return os3.homedir();
3686
+ if (p === "~") return os4.homedir();
3536
3687
  if (p.startsWith("~/") || p.startsWith("~\\")) {
3537
- return path19.join(os3.homedir(), p.slice(2));
3688
+ return path20.join(os4.homedir(), p.slice(2));
3538
3689
  }
3539
3690
  return p;
3540
3691
  }
3541
3692
  function pathExists(p) {
3542
3693
  try {
3543
- fs14.statSync(p);
3694
+ fs15.statSync(p);
3544
3695
  return true;
3545
3696
  } catch {
3546
3697
  return false;
@@ -3548,27 +3699,27 @@ function pathExists(p) {
3548
3699
  }
3549
3700
  function isFile4(p) {
3550
3701
  try {
3551
- return fs14.statSync(p).isFile();
3702
+ return fs15.statSync(p).isFile();
3552
3703
  } catch {
3553
3704
  return false;
3554
3705
  }
3555
3706
  }
3556
3707
  function isDir3(p) {
3557
3708
  try {
3558
- return fs14.statSync(p).isDirectory();
3709
+ return fs15.statSync(p).isDirectory();
3559
3710
  } catch {
3560
3711
  return false;
3561
3712
  }
3562
3713
  }
3563
3714
  function resolvePath(p) {
3564
3715
  try {
3565
- return fs14.realpathSync(path19.resolve(p));
3716
+ return fs15.realpathSync(path20.resolve(p));
3566
3717
  } catch {
3567
- return path19.resolve(p);
3718
+ return path20.resolve(p);
3568
3719
  }
3569
3720
  }
3570
3721
  function readText(p) {
3571
- return fs14.readFileSync(p, "utf-8");
3722
+ return fs15.readFileSync(p, "utf-8");
3572
3723
  }
3573
3724
  function _jsonStrAscii(s) {
3574
3725
  let out = '"';
@@ -3679,7 +3830,7 @@ function _resolve_project_root(arg) {
3679
3830
  }
3680
3831
  var _INSTALL_MODE_MARKER_REL = "agents/.agent-state/install-mode.txt";
3681
3832
  function _detect_install_mode(project_root) {
3682
- const marker = path19.join(project_root, _INSTALL_MODE_MARKER_REL);
3833
+ const marker = path20.join(project_root, _INSTALL_MODE_MARKER_REL);
3683
3834
  if (isFile4(marker)) {
3684
3835
  let value;
3685
3836
  try {
@@ -3691,9 +3842,9 @@ function _detect_install_mode(project_root) {
3691
3842
  return [value, "marker-file"];
3692
3843
  }
3693
3844
  }
3694
- const has_agents_md = pathExists(path19.join(project_root, "AGENTS.md"));
3845
+ const has_agents_md = pathExists(path20.join(project_root, "AGENTS.md"));
3695
3846
  const has_copilot = pathExists(
3696
- path19.join(project_root, ".github", "copilot-instructions.md")
3847
+ path20.join(project_root, ".github", "copilot-instructions.md")
3697
3848
  );
3698
3849
  if (has_agents_md && has_copilot) {
3699
3850
  return ["full", "heuristic"];
@@ -3713,7 +3864,7 @@ function _settings_layer_chain(project_root) {
3713
3864
  return layers;
3714
3865
  }
3715
3866
  function _detect_wrapper(project_root) {
3716
- const wrapper = path19.join(project_root, "agent-config");
3867
+ const wrapper = path20.join(project_root, "agent-config");
3717
3868
  if (!pathExists(wrapper)) {
3718
3869
  return { path: String(wrapper), exists: false, embedded_root: null };
3719
3870
  }
@@ -3780,14 +3931,14 @@ function _emit_context_text(ctx) {
3780
3931
  }
3781
3932
  function _resolve_path(project_root, raw) {
3782
3933
  let p = expanduser(raw);
3783
- if (!path19.isAbsolute(p)) {
3784
- p = path19.join(project_root, p);
3934
+ if (!path20.isAbsolute(p)) {
3935
+ p = path20.join(project_root, p);
3785
3936
  }
3786
3937
  return p;
3787
3938
  }
3788
3939
  function _sha256(p) {
3789
3940
  try {
3790
- const data = fs14.readFileSync(p);
3941
+ const data = fs15.readFileSync(p);
3791
3942
  return crypto2.createHash("sha256").update(data).digest("hex");
3792
3943
  } catch {
3793
3944
  return null;
@@ -3796,7 +3947,7 @@ function _sha256(p) {
3796
3947
  var PACKAGE_TAG_ID2 = "event4u/agent-config";
3797
3948
  var _FRONTMATTER_PACKAGE_RE = /^package:\s*(.+?)\s*$/m;
3798
3949
  function _read_inline_package_tag(p) {
3799
- if (path19.extname(p) !== ".md") {
3950
+ if (path20.extname(p) !== ".md") {
3800
3951
  return NO_FRONTMATTER;
3801
3952
  }
3802
3953
  let text;
@@ -3925,13 +4076,13 @@ function rglob(root) {
3925
4076
  const walk = (dir) => {
3926
4077
  let entries;
3927
4078
  try {
3928
- entries = fs14.readdirSync(dir, { withFileTypes: true });
4079
+ entries = fs15.readdirSync(dir, { withFileTypes: true });
3929
4080
  } catch {
3930
4081
  return;
3931
4082
  }
3932
4083
  entries.sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0);
3933
4084
  for (const ent of entries) {
3934
- const full = path19.join(dir, ent.name);
4085
+ const full = path20.join(dir, ent.name);
3935
4086
  out.push(full);
3936
4087
  let dirLike = ent.isDirectory();
3937
4088
  if (ent.isSymbolicLink()) {
@@ -4006,9 +4157,9 @@ function _foreign_records(project_root, foreign) {
4006
4157
  return out;
4007
4158
  }
4008
4159
  function relativeTo(p, base) {
4009
- const rel = path19.relative(base, p);
4160
+ const rel = path20.relative(base, p);
4010
4161
  if (rel === "") return rel;
4011
- if (rel.startsWith("..") || path19.isAbsolute(rel)) {
4162
+ if (rel.startsWith("..") || path20.isAbsolute(rel)) {
4012
4163
  return null;
4013
4164
  }
4014
4165
  return rel;
@@ -4094,7 +4245,7 @@ var STATUS_SYMBOLS = {
4094
4245
  var MIN_PYTHON = [3, 10];
4095
4246
  function _check_scope(project_root) {
4096
4247
  for (const marker of ["pnpm-workspace.yaml", "lerna.json"]) {
4097
- if (pathExists(path19.join(project_root, marker))) {
4248
+ if (pathExists(path20.join(project_root, marker))) {
4098
4249
  return {
4099
4250
  id: "scope",
4100
4251
  status: "warn",
@@ -4103,7 +4254,7 @@ function _check_scope(project_root) {
4103
4254
  };
4104
4255
  }
4105
4256
  }
4106
- const pkg = path19.join(project_root, "package.json");
4257
+ const pkg = path20.join(project_root, "package.json");
4107
4258
  if (pathExists(pkg)) {
4108
4259
  try {
4109
4260
  const data = JSON.parse(readText(pkg));
@@ -4129,7 +4280,7 @@ var _PLACEHOLDER_EMAIL_RE = /^(t@t\.t|.*@example\.(com|org)|.*@localhost)$/i;
4129
4280
  var _PLACEHOLDER_NAME_RE = /^(t|test|user|nobody|x)$/i;
4130
4281
  function _git_config_path(project_root) {
4131
4282
  const common = git_common_dir(project_root);
4132
- return common === null ? null : path19.join(common, "config");
4283
+ return common === null ? null : path20.join(common, "config");
4133
4284
  }
4134
4285
  function _parse_git_user(configText) {
4135
4286
  let inUser = false;
@@ -4159,7 +4310,7 @@ function _check_git_identity(project_root) {
4159
4310
  }
4160
4311
  let ident = _parse_git_user(readText(cfgPath));
4161
4312
  if (ident.name === null && ident.email === null) {
4162
- const globalCfg = path19.join(os3.homedir(), ".gitconfig");
4313
+ const globalCfg = path20.join(os4.homedir(), ".gitconfig");
4163
4314
  if (pathExists(globalCfg)) {
4164
4315
  ident = _parse_git_user(readText(globalCfg));
4165
4316
  }
@@ -4220,7 +4371,7 @@ function _package_root() {
4220
4371
  }
4221
4372
  function _current_package_version() {
4222
4373
  try {
4223
- const data = JSON.parse(readText(path19.join(_package_root(), "package.json")));
4374
+ const data = JSON.parse(readText(path20.join(_package_root(), "package.json")));
4224
4375
  const v = data["version"];
4225
4376
  if (typeof v === "string" && v.trim()) {
4226
4377
  return v.trim();
@@ -4264,7 +4415,7 @@ function _check_lockfile_freshness(manifest) {
4264
4415
  };
4265
4416
  }
4266
4417
  function shutilWhich(name) {
4267
- if (path19.dirname(name) !== "." && (name.includes("/") || name.includes("\\"))) {
4418
+ if (path20.dirname(name) !== "." && (name.includes("/") || name.includes("\\"))) {
4268
4419
  return isExecutableFile(name) ? name : null;
4269
4420
  }
4270
4421
  const pathEnv = process3.env["PATH"] || "";
@@ -4277,12 +4428,12 @@ function shutilWhich(name) {
4277
4428
  if (seenDirs.has(d)) continue;
4278
4429
  seenDirs.add(d);
4279
4430
  for (const ext of exts) {
4280
- const candidate = path19.join(d, name + (ext === "" ? "" : ext.toLowerCase() === ext ? ext : ext));
4431
+ const candidate = path20.join(d, name + (ext === "" ? "" : ext.toLowerCase() === ext ? ext : ext));
4281
4432
  if (isExecutableFile(candidate)) {
4282
4433
  return candidate;
4283
4434
  }
4284
4435
  if (ext !== "") {
4285
- const upper = path19.join(d, name + ext);
4436
+ const upper = path20.join(d, name + ext);
4286
4437
  if (isExecutableFile(upper)) return upper;
4287
4438
  }
4288
4439
  }
@@ -4291,10 +4442,10 @@ function shutilWhich(name) {
4291
4442
  }
4292
4443
  function isExecutableFile(p) {
4293
4444
  try {
4294
- const st = fs14.statSync(p);
4445
+ const st = fs15.statSync(p);
4295
4446
  if (!st.isFile()) return false;
4296
4447
  if (process3.platform === "win32") return true;
4297
- fs14.accessSync(p, fs14.constants.X_OK);
4448
+ fs15.accessSync(p, fs15.constants.X_OK);
4298
4449
  return true;
4299
4450
  } catch {
4300
4451
  return false;
@@ -4358,7 +4509,7 @@ function _check_claude_plugin() {
4358
4509
  remedy: ""
4359
4510
  };
4360
4511
  }
4361
- const projection = path19.join(os3.homedir(), ".claude", "skills");
4512
+ const projection = path20.join(os4.homedir(), ".claude", "skills");
4362
4513
  const projection_present = isDir3(projection);
4363
4514
  if (projection_present) {
4364
4515
  return {
@@ -4395,8 +4546,8 @@ function _check_claude_command_wrappers() {
4395
4546
  remedy: ""
4396
4547
  };
4397
4548
  }
4398
- const anchor = path19.join(os3.homedir(), ".claude");
4399
- const commands_dir = path19.join(anchor, "commands");
4549
+ const anchor = path20.join(os4.homedir(), ".claude");
4550
+ const commands_dir = path20.join(anchor, "commands");
4400
4551
  if (!isDir3(commands_dir)) {
4401
4552
  return {
4402
4553
  id: "claude-command-wrappers",
@@ -4405,8 +4556,8 @@ function _check_claude_command_wrappers() {
4405
4556
  remedy: ""
4406
4557
  };
4407
4558
  }
4408
- const flat_probe = fs14.existsSync(path19.join(commands_dir, "commit.md"));
4409
- const wrapper_probe = fs14.existsSync(path19.join(anchor, "skills", "commit", "SKILL.md"));
4559
+ const flat_probe = fs15.existsSync(path20.join(commands_dir, "commit.md"));
4560
+ const wrapper_probe = fs15.existsSync(path20.join(anchor, "skills", "commit", "SKILL.md"));
4410
4561
  if (wrapper_probe) {
4411
4562
  return {
4412
4563
  id: "claude-command-wrappers",
@@ -4431,7 +4582,7 @@ function _check_claude_command_wrappers() {
4431
4582
  };
4432
4583
  }
4433
4584
  function _check_surface_state() {
4434
- const matrix_path = path19.join(_package_root(), "src", "config", "surface-matrix.yml");
4585
+ const matrix_path = path20.join(_package_root(), "src", "config", "surface-matrix.yml");
4435
4586
  if (!isFile4(matrix_path)) {
4436
4587
  return {
4437
4588
  id: "surface-state",
@@ -4455,7 +4606,7 @@ function _check_surface_state() {
4455
4606
  remedy: "agent-config upgrade (reinstalls the package data files)"
4456
4607
  };
4457
4608
  }
4458
- const _expand = (p) => p.startsWith("~/") ? path19.join(os3.homedir(), p.slice(2)) : path19.join(_package_root(), p);
4609
+ const _expand = (p) => p.startsWith("~/") ? path20.join(os4.homedir(), p.slice(2)) : path20.join(_package_root(), p);
4459
4610
  const violations = [];
4460
4611
  const remedies = [];
4461
4612
  let checked = 0;
@@ -4497,7 +4648,7 @@ function _check_surface_state() {
4497
4648
  }
4498
4649
  function pathExistsAny(p) {
4499
4650
  try {
4500
- fs14.statSync(p);
4651
+ fs15.statSync(p);
4501
4652
  return true;
4502
4653
  } catch {
4503
4654
  return false;
@@ -4507,7 +4658,7 @@ function _check_hook_wiring() {
4507
4658
  return checkHookWiring({
4508
4659
  which: shutilWhich,
4509
4660
  packageRoot: _package_root(),
4510
- homeDir: os3.homedir(),
4661
+ homeDir: os4.homedir(),
4511
4662
  buildMatrix: (mp) => build_claude_hook_matrix(mp),
4512
4663
  managedSignature: MANAGED_SIGNATURE,
4513
4664
  pluginInstalled: () => claude_plugin_installed()
@@ -4543,7 +4694,7 @@ function _check_mcp_mode(project_root) {
4543
4694
  ];
4544
4695
  const found = [];
4545
4696
  for (const [rel, label] of candidates) {
4546
- const p = path19.join(project_root, rel);
4697
+ const p = path20.join(project_root, rel);
4547
4698
  if (!pathExists(p)) {
4548
4699
  continue;
4549
4700
  }
@@ -4575,7 +4726,7 @@ function _check_mcp_mode(project_root) {
4575
4726
  };
4576
4727
  }
4577
4728
  function _check_offline_readiness() {
4578
- const script = path19.join(_package_root(), "src", "scripts", "hermetic-install.sh");
4729
+ const script = path20.join(_package_root(), "src", "scripts", "hermetic-install.sh");
4579
4730
  if (!pathExists(script)) {
4580
4731
  return {
4581
4732
  id: "offline-readiness",
@@ -4633,7 +4784,7 @@ function _check_stale_orphans() {
4633
4784
  (a, b) => a < b ? -1 : a > b ? 1 : 0
4634
4785
  );
4635
4786
  for (const root_name of ownedSorted) {
4636
- const root = path19.join(anchor, root_name);
4787
+ const root = path20.join(anchor, root_name);
4637
4788
  if (!isDir3(root)) {
4638
4789
  continue;
4639
4790
  }
@@ -4648,7 +4799,7 @@ function _check_stale_orphans() {
4648
4799
  if (rel === null) {
4649
4800
  continue;
4650
4801
  }
4651
- const relPosix = rel.split(path19.sep).join("/");
4802
+ const relPosix = rel.split(path20.sep).join("/");
4652
4803
  if (recorded_set.has(relPosix)) {
4653
4804
  continue;
4654
4805
  }
@@ -4703,14 +4854,14 @@ function _check_rule_scope_drift(project_root) {
4703
4854
  let rules_dir = null;
4704
4855
  let found = 0;
4705
4856
  for (const rel of _RULE_PROJECTION_DIRS) {
4706
- const cand = path19.join(project_root, rel);
4857
+ const cand = path20.join(project_root, rel);
4707
4858
  if (!isDir3(cand)) {
4708
4859
  continue;
4709
4860
  }
4710
4861
  let count = 0;
4711
4862
  try {
4712
- for (const name of fs14.readdirSync(cand)) {
4713
- if (name.endsWith(".md") && isFile4(path19.join(cand, name))) {
4863
+ for (const name of fs15.readdirSync(cand)) {
4864
+ if (name.endsWith(".md") && isFile4(path20.join(cand, name))) {
4714
4865
  count += 1;
4715
4866
  }
4716
4867
  }
@@ -4764,14 +4915,14 @@ function _check_rule_scope_drift(project_root) {
4764
4915
  };
4765
4916
  }
4766
4917
  function _check_duplicate_scope_rules(project_root, userRulesDirOverride) {
4767
- const user_rules_dir = userRulesDirOverride ?? path19.join(os3.homedir(), ".claude", "rules");
4918
+ const user_rules_dir = userRulesDirOverride ?? path20.join(os4.homedir(), ".claude", "rules");
4768
4919
  let project_rules_dir = null;
4769
4920
  if (_is_source_repo(project_root)) {
4770
- const cand = path19.join(project_root, "dist", "agent-src", "rules");
4921
+ const cand = path20.join(project_root, "dist", "agent-src", "rules");
4771
4922
  if (isDir3(cand)) project_rules_dir = cand;
4772
4923
  } else {
4773
4924
  for (const rel of _RULE_PROJECTION_DIRS) {
4774
- const cand = path19.join(project_root, rel);
4925
+ const cand = path20.join(project_root, rel);
4775
4926
  if (isDir3(cand)) {
4776
4927
  project_rules_dir = cand;
4777
4928
  break;
@@ -4817,7 +4968,7 @@ function _check_mcp_beta_readiness(project_root) {
4817
4968
  }
4818
4969
  const pending = [];
4819
4970
  for (const [gate_id, rel] of MCP_BETA_GATES) {
4820
- if (!pathExists(path19.join(project_root, rel))) {
4971
+ if (!pathExists(path20.join(project_root, rel))) {
4821
4972
  pending.push(`${gate_id} (${rel})`);
4822
4973
  }
4823
4974
  }
@@ -4838,7 +4989,7 @@ function _check_mcp_beta_readiness(project_root) {
4838
4989
  }
4839
4990
  function _check_tier_usage_readiness(project_root) {
4840
4991
  const settings_file = project_settings_path(project_root);
4841
- let log_path = path19.join(project_root, ".agent-tier-usage.jsonl");
4992
+ let log_path = path20.join(project_root, ".agent-tier-usage.jsonl");
4842
4993
  let enabled = false;
4843
4994
  if (isFile4(settings_file)) {
4844
4995
  let raw;
@@ -4857,7 +5008,7 @@ function _check_tier_usage_readiness(project_root) {
4857
5008
  const outputRaw = tu["output"];
4858
5009
  const output = typeof outputRaw === "object" && outputRaw !== null && !Array.isArray(outputRaw) ? outputRaw : {};
4859
5010
  if (typeof output["path"] === "string" && output["path"].trim()) {
4860
- log_path = path19.join(project_root, output["path"].trim());
5011
+ log_path = path20.join(project_root, output["path"].trim());
4861
5012
  }
4862
5013
  const val = tu["enabled"];
4863
5014
  if (typeof val === "boolean") {
@@ -4882,7 +5033,7 @@ function _check_tier_usage_readiness(project_root) {
4882
5033
  return {
4883
5034
  id: "tier-usage-readiness",
4884
5035
  status: "warn",
4885
- message: `tier-usage telemetry on but ${path19.basename(log_path)} not yet written \u2014 no signal accumulated`,
5036
+ message: `tier-usage telemetry on but ${path20.basename(log_path)} not yet written \u2014 no signal accumulated`,
4886
5037
  remedy: "run any tracked command to seed the log; the dispatcher writes one record per invocation"
4887
5038
  };
4888
5039
  }
@@ -4897,7 +5048,7 @@ function _check_tier_usage_readiness(project_root) {
4897
5048
  return {
4898
5049
  id: "tier-usage-readiness",
4899
5050
  status: "fail",
4900
- message: `cannot read ${path19.basename(log_path)}: ${osErrorStr(exc)}`,
5051
+ message: `cannot read ${path20.basename(log_path)}: ${osErrorStr(exc)}`,
4901
5052
  remedy: "fix permissions on the tier-usage log"
4902
5053
  };
4903
5054
  }
@@ -4928,7 +5079,7 @@ function _check_tier_usage_readiness(project_root) {
4928
5079
  return {
4929
5080
  id: "tier-usage-readiness",
4930
5081
  status: "fail",
4931
- message: `${total} record(s) in ${path19.basename(log_path)} but 0 passed the privacy floor \u2014 report would refuse to render`,
5082
+ message: `${total} record(s) in ${path20.basename(log_path)} but 0 passed the privacy floor \u2014 report would refuse to render`,
4932
5083
  remedy: "inspect the log; the dispatcher is writing records the contract forbids (paths, argv, message bodies)"
4933
5084
  };
4934
5085
  }
@@ -4936,19 +5087,19 @@ function _check_tier_usage_readiness(project_root) {
4936
5087
  return {
4937
5088
  id: "tier-usage-readiness",
4938
5089
  status: "warn",
4939
- message: `${path19.basename(log_path)} present but empty \u2014 no signal yet`,
5090
+ message: `${path20.basename(log_path)} present but empty \u2014 no signal yet`,
4940
5091
  remedy: "run any tracked command to seed the log"
4941
5092
  };
4942
5093
  }
4943
5094
  return {
4944
5095
  id: "tier-usage-readiness",
4945
5096
  status: "ok",
4946
- message: `${valid} record(s) past the privacy floor in ${path19.basename(log_path)} \u2014 retiering signal available`,
5097
+ message: `${valid} record(s) past the privacy floor in ${path20.basename(log_path)} \u2014 retiering signal available`,
4947
5098
  remedy: ""
4948
5099
  };
4949
5100
  }
4950
5101
  function readText0(p) {
4951
- return fs14.readFileSync(p, "utf-8");
5102
+ return fs15.readFileSync(p, "utf-8");
4952
5103
  }
4953
5104
  function osErrorStr(exc) {
4954
5105
  if (exc && typeof exc === "object" && "message" in exc) {
@@ -5121,7 +5272,7 @@ function _epoch_seconds(value) {
5121
5272
  function _codex_auth_expiry(auth_path) {
5122
5273
  let data;
5123
5274
  try {
5124
- data = JSON.parse(fs14.readFileSync(auth_path, "utf-8"));
5275
+ data = JSON.parse(fs15.readFileSync(auth_path, "utf-8"));
5125
5276
  } catch {
5126
5277
  return null;
5127
5278
  }
@@ -5267,7 +5418,7 @@ function _check_team(project_root) {
5267
5418
  if (binary_missing) {
5268
5419
  remedies.push("install the codex CLI: `npm install -g @openai/codex`");
5269
5420
  }
5270
- const auth_path = path19.join(_codex_home(), "auth.json");
5421
+ const auth_path = path20.join(_codex_home(), "auth.json");
5271
5422
  const authed = pathExists(auth_path);
5272
5423
  let auth_str;
5273
5424
  if (!authed) {
@@ -5355,7 +5506,7 @@ function _check_unsupported_combos(manifest) {
5355
5506
  };
5356
5507
  }
5357
5508
  function _wizard_state_path() {
5358
- return path19.join(event4u_root(), "state", "wizard-state.json");
5509
+ return path20.join(event4u_root(), "state", "wizard-state.json");
5359
5510
  }
5360
5511
  function _check_wizard_state() {
5361
5512
  const state_pth = _wizard_state_path();
@@ -5435,7 +5586,7 @@ function _check_wizard_state() {
5435
5586
  };
5436
5587
  }
5437
5588
  function _check_settings_review_pending() {
5438
- const delta_pth = path19.join(event4u_root(), "state", "settings-delta.json");
5589
+ const delta_pth = path20.join(event4u_root(), "state", "settings-delta.json");
5439
5590
  if (!pathExists(delta_pth)) {
5440
5591
  return {
5441
5592
  id: "settings-review-pending",
@@ -5461,7 +5612,7 @@ function _check_settings_review_pending() {
5461
5612
  }
5462
5613
  function _check_memory_merge_union(project_root) {
5463
5614
  const remedy = "run: npx tsx src/scripts/sync_gitattributes.ts (or `agent-config refresh --project`)";
5464
- const target = path19.join(project_root, DEFAULT_GITATTRIBUTES);
5615
+ const target = path20.join(project_root, DEFAULT_GITATTRIBUTES);
5465
5616
  if (!pathExists(target)) {
5466
5617
  return {
5467
5618
  id: "memory-merge-union",
@@ -5578,7 +5729,7 @@ function _run_checks(project_root, manifest, drift, only = null) {
5578
5729
  "claude-command-wrappers": _check_claude_command_wrappers,
5579
5730
  "surface-state": _check_surface_state,
5580
5731
  "hook-wiring": _check_hook_wiring,
5581
- ...wiringRunners({ packageRoot: _package_root(), iterOverrides: () => iter_setting_overrides({ cwd: project_root }) }),
5732
+ ...wiringRunners({ packageRoot: _package_root(), projectRoot: project_root, iterOverrides: () => iter_setting_overrides({ cwd: project_root }) }),
5582
5733
  ...reachRunners({ projectRoot: project_root, resolvableVersion: _current_package_version() }),
5583
5734
  "stale-orphans": _check_stale_orphans,
5584
5735
  overrides: () => _check_overrides(project_root),
@@ -5648,7 +5799,7 @@ function _run_checks_no_manifest(project_root, bridge_present, only = null) {
5648
5799
  "claude-command-wrappers": _check_claude_command_wrappers,
5649
5800
  "surface-state": _check_surface_state,
5650
5801
  "hook-wiring": _check_hook_wiring,
5651
- ...wiringRunners({ packageRoot: _package_root(), iterOverrides: () => iter_setting_overrides({ cwd: project_root }) }),
5802
+ ...wiringRunners({ packageRoot: _package_root(), projectRoot: project_root, iterOverrides: () => iter_setting_overrides({ cwd: project_root }) }),
5652
5803
  ...reachRunners({ projectRoot: project_root, resolvableVersion: _current_package_version() }),
5653
5804
  "stale-orphans": _check_stale_orphans,
5654
5805
  // BOTH registries need the id. Registering only the first one crashed with
@@ -5926,7 +6077,7 @@ function _run_anatomy(opts) {
5926
6077
  try {
5927
6078
  economyReport = economy.buildReport({
5928
6079
  root: economy.DEFAULT_PROJECTS_ROOT,
5929
- auditDir: path19.join(process3.cwd(), economy.DEFAULT_AUDIT_DIR),
6080
+ auditDir: path20.join(process3.cwd(), economy.DEFAULT_AUDIT_DIR),
5930
6081
  maxAgeDays: 14
5931
6082
  });
5932
6083
  } catch (err) {
@@ -5965,7 +6116,7 @@ function _run_repair(opts) {
5965
6116
  };
5966
6117
  if (exists2) {
5967
6118
  try {
5968
- fs14.unlinkSync(state_pth);
6119
+ fs15.unlinkSync(state_pth);
5969
6120
  } catch (exc) {
5970
6121
  payload["action"] = "error";
5971
6122
  payload["error"] = osErrorStr(exc);
@@ -6072,17 +6223,17 @@ function _isCliEntry2() {
6072
6223
  return false;
6073
6224
  }
6074
6225
  if (cliDelegate) {
6075
- if (path19.basename(process3.argv[1], ".js") === "cmd_doctor") {
6226
+ if (path20.basename(process3.argv[1], ".js") === "cmd_doctor") {
6076
6227
  return true;
6077
6228
  }
6078
6229
  }
6079
- const argvUrl = pathToFileURL6(path19.resolve(process3.argv[1])).href;
6230
+ const argvUrl = pathToFileURL6(path20.resolve(process3.argv[1])).href;
6080
6231
  if (import.meta.url === argvUrl) {
6081
6232
  return true;
6082
6233
  }
6083
6234
  try {
6084
- const here = fs14.realpathSync(fileURLToPath5(import.meta.url));
6085
- const argv = fs14.realpathSync(path19.resolve(process3.argv[1]));
6235
+ const here = fs15.realpathSync(fileURLToPath5(import.meta.url));
6236
+ const argv = fs15.realpathSync(path20.resolve(process3.argv[1]));
6086
6237
  return here === argv;
6087
6238
  } catch {
6088
6239
  return false;