@event4u/agent-config 17.0.0 → 17.2.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 (164) 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 +157 -468
  5. package/README.md +4 -3
  6. package/dist/agent-src/commands/project/analyze.md +9 -6
  7. package/dist/agent-src/commands/project/map.md +58 -0
  8. package/dist/agent-src/commands/project.md +5 -3
  9. package/dist/agent-src/contexts/execution/host-capability-manifest.md +5 -3
  10. package/dist/agent-src/skills/code-intelligence/SKILL.md +6 -0
  11. package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
  12. package/dist/agent-src/templates/roadmaps.md +5 -1
  13. package/dist/cli/registry.js +1 -1
  14. package/dist/cli-delegate/{chunk-IROAQ77A.js → chunk-3PK3VZHB.js} +107 -9
  15. package/dist/cli-delegate/{chunk-2SFOOFJJ.js → chunk-BZJ4Y3CI.js} +1 -1
  16. package/dist/cli-delegate/{chunk-CAL76ADI.js → chunk-CMZEKSNN.js} +52 -10
  17. package/dist/cli-delegate/{chunk-ESUNQ5XR.js → chunk-E3CFULNX.js} +22 -4
  18. package/dist/cli-delegate/{chunk-GOMILC3O.js → chunk-QBHEI5N4.js} +4 -3
  19. package/dist/cli-delegate/{chunk-SIOMDAKL.js → chunk-VYZGJLCA.js} +29 -39
  20. package/dist/cli-delegate/chunk-W5JXMF2T.js +77 -0
  21. package/dist/cli-delegate/{chunk-4SHNERBL.js → chunk-XIAPY44N.js} +1 -1
  22. package/dist/cli-delegate/{chunk-JHMMWNJ2.js → chunk-YHAPONWV.js} +1 -1
  23. package/dist/cli-delegate/cmd_conformance.js +32 -47
  24. package/dist/cli-delegate/cmd_doctor.js +4 -4
  25. package/dist/cli-delegate/cmd_doctor_neighbours.js +2 -2
  26. package/dist/cli-delegate/cmd_explain.js +1 -1
  27. package/dist/cli-delegate/cmd_export.js +6 -6
  28. package/dist/cli-delegate/cmd_fleet.js +3 -3
  29. package/dist/cli-delegate/cmd_preflight.js +3 -3
  30. package/dist/cli-delegate/cmd_prune.js +6 -6
  31. package/dist/cli-delegate/cmd_settings_migrate.js +6 -6
  32. package/dist/cli-delegate/cmd_settings_set.js +1 -1
  33. package/dist/cli-delegate/cmd_sync.js +6 -6
  34. package/dist/cli-delegate/cmd_uninstall.js +6 -6
  35. package/dist/cli-delegate/cmd_update.js +9 -13
  36. package/dist/cli-delegate/cmd_validate.js +6 -6
  37. package/dist/discovery/deprecation-report.md +1 -1
  38. package/dist/discovery/discovery-manifest.json +41 -15
  39. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  40. package/dist/discovery/discovery-manifest.summary.md +3 -3
  41. package/dist/discovery/dormancy-report.md +1 -1
  42. package/dist/discovery/orphan-report.md +1 -1
  43. package/dist/discovery/packs.json +6 -5
  44. package/dist/discovery/trust-report.md +2 -2
  45. package/dist/discovery/workspaces.json +5 -4
  46. package/dist/hooks/dispatch.js +163 -148
  47. package/dist/hooks/dispatch.sha256 +1 -1
  48. package/dist/hooks/instructions_observer.chunk.cjs +301 -0
  49. package/dist/hooks/instructions_observer.chunk.cjs.sha256 +1 -0
  50. package/dist/install/claudeRuleRewrite.js +10 -3
  51. package/dist/install/conflict.js +24 -2
  52. package/dist/install/conflictTracker.js +14 -3
  53. package/dist/install/install.mjs +222 -117
  54. package/dist/install/installThinLayer.js +1 -0
  55. package/dist/install/loggedWrites.js +142 -0
  56. package/dist/install/paths.js +12 -2
  57. package/dist/install/preserve.js +25 -4
  58. package/dist/install/txlog.js +10 -6
  59. package/dist/mcp/registry-manifest.json +3 -3
  60. package/dist/mcp/server.json +2 -2
  61. package/dist/mcp/server.mjs +33595 -22916
  62. package/dist/scripts/_lib/egress_rules.js +4 -1
  63. package/dist/scripts/_lib/identifier_redaction.js +35 -2
  64. package/dist/scripts/ai_council/seat_policy.js +7 -1
  65. package/dist/server/schemas/settings.js +1 -1
  66. package/package.json +4 -1
  67. package/src/config/ci-local-parity.yml +1 -1
  68. package/src/config/continuity-surface.json +7 -0
  69. package/src/config/evaluator-budgets.json +4 -4
  70. package/src/config/gate-coverage.yml +27 -7
  71. package/src/config/gate-violation-baselines.json +9 -3
  72. package/src/config/gitignore-block.txt +6 -0
  73. package/src/config/hook-bundle-budget.json +19 -4
  74. package/src/config/hook-token-budget.json +1 -1
  75. package/src/config/packed-binary-manifest.json +27 -0
  76. package/src/config/production-entries.json +18 -0
  77. package/src/config/release-gate-locality.yml +0 -7
  78. package/src/config/skill-body-budget.json +7 -1
  79. package/src/install/claudeRuleRewrite.ts +10 -1
  80. package/src/install/conflict.ts +24 -1
  81. package/src/install/conflictTracker.ts +18 -2
  82. package/src/install/installThinLayer.ts +6 -0
  83. package/src/install/loggedWrites.ts +148 -0
  84. package/src/install/paths.ts +11 -2
  85. package/src/install/preserve.ts +40 -4
  86. package/src/install/txlog.ts +10 -6
  87. package/src/scripts/_cli/cmd_conformance.ts +3 -2
  88. package/src/scripts/_cli/cmd_update.ts +15 -17
  89. package/src/scripts/_lib/bench_ab_complexity.ts +14 -2
  90. package/src/scripts/_lib/collector_record.ts +1 -0
  91. package/src/scripts/_lib/council_settings_block.ts +9 -2
  92. package/src/scripts/_lib/egress_rules.ts +4 -1
  93. package/src/scripts/_lib/host_capability.ts +10 -5
  94. package/src/scripts/_lib/identifier_redaction.ts +38 -2
  95. package/src/scripts/_lib/price_freshness.ts +112 -0
  96. package/src/scripts/_lib/production_reach.ts +194 -0
  97. package/src/scripts/_lib/quota_parked.ts +17 -28
  98. package/src/scripts/_lib/release_findings_ingest.ts +13 -335
  99. package/src/scripts/_lib/runtime_journal.ts +7 -7
  100. package/src/scripts/_lib/tier_downshift_verdict.ts +81 -35
  101. package/src/scripts/ai_council/chairman.ts +5 -2
  102. package/src/scripts/ai_council/clients.ts +4 -3
  103. package/src/scripts/ai_council/free_hand_shadow.ts +24 -12
  104. package/src/scripts/ai_council/free_route_catalog.ts +142 -5
  105. package/src/scripts/ai_council/free_route_client.ts +4 -0
  106. package/src/scripts/ai_council/hand_payload.ts +115 -7
  107. package/src/scripts/ai_council/orchestrator.ts +7 -10
  108. package/src/scripts/ai_council/route_chooser.ts +1 -1
  109. package/src/scripts/ai_council/route_member.ts +66 -4
  110. package/src/scripts/ai_council/seat_policy.ts +8 -1
  111. package/src/scripts/ai_council/self_hosted_probe.ts +327 -0
  112. package/src/scripts/ai_council/status_surface.ts +2 -0
  113. package/src/scripts/ask_transport.ts +137 -15
  114. package/src/scripts/check_finding_dispositions.ts +25 -71
  115. package/src/scripts/check_release_pr_shape.ts +3 -3
  116. package/src/scripts/check_step_production_reach.ts +257 -0
  117. package/src/scripts/code_graph/build.ts +210 -10
  118. package/src/scripts/code_graph/cli.ts +168 -46
  119. package/src/scripts/code_graph/detect.ts +5 -4
  120. package/src/scripts/code_graph/docs_layer.ts +57 -0
  121. package/src/scripts/code_graph/extract.ts +58 -13
  122. package/src/scripts/code_graph/extract_more.ts +314 -0
  123. package/src/scripts/code_graph/laravel_overlay.ts +454 -0
  124. package/src/scripts/code_graph/map.ts +846 -0
  125. package/src/scripts/code_graph/map_model.ts +977 -0
  126. package/src/scripts/code_graph/map_verify.ts +140 -0
  127. package/src/scripts/code_graph/map_viewer/viewer.css +278 -0
  128. package/src/scripts/code_graph/map_viewer/viewer.js +756 -0
  129. package/src/scripts/code_graph/scip_reader.ts +201 -0
  130. package/src/scripts/code_graph/sqlite_store.ts +8 -1
  131. package/src/scripts/code_graph/types.ts +81 -15
  132. package/src/scripts/code_graph/validate.ts +16 -26
  133. package/src/scripts/code_graph/verbs.ts +7 -0
  134. package/src/scripts/council_cli.ts +10 -8
  135. package/src/scripts/hook_chunks.mjs +7 -0
  136. package/src/scripts/hook_manifest.json +1 -1
  137. package/src/scripts/hook_manifest.yaml +23 -0
  138. package/src/scripts/hooks/dispatch_hook.ts +4 -4
  139. package/src/scripts/hooks/instructions_observer_hook.ts +25 -6
  140. package/src/scripts/hooks/lazy_concern.ts +4 -0
  141. package/src/scripts/hooks/payload_stub.ts +27 -0
  142. package/src/scripts/hooks/spawn_guard_shadow_hook.ts +29 -70
  143. package/src/scripts/hooks/subagent_ledger_hook.ts +80 -0
  144. package/src/scripts/install-hooks.sh +5 -0
  145. package/src/scripts/install.ts +2 -2
  146. package/src/scripts/lint_agents_layout.ts +2 -0
  147. package/src/scripts/lint_decision_classes.ts +34 -0
  148. package/src/scripts/lint_hook_manifest.ts +25 -0
  149. package/src/scripts/lint_roadmap_blockers.ts +52 -3
  150. package/src/scripts/mcp_server/consumer_tool_catalog.json +53 -6
  151. package/src/scripts/mcp_server/graph_tools.ts +73 -1
  152. package/src/scripts/mcp_server/tools.ts +19 -36
  153. package/src/scripts/release.ts +5 -9
  154. package/src/scripts/release_drill.ts +11 -165
  155. package/src/scripts/release_publication.ts +0 -9
  156. package/src/scripts/report_production_reach.ts +35 -0
  157. package/src/scripts/worker_reuse_shadow_report.ts +399 -1
  158. package/src/server/schemas/settings.ts +1 -1
  159. package/src/vendor/grammars/README.md +10 -5
  160. package/src/vendor/grammars/tree-sitter-go.wasm +0 -0
  161. package/src/vendor/grammars/tree-sitter-java.wasm +0 -0
  162. package/src/vendor/grammars/tree-sitter-python.wasm +0 -0
  163. package/dist/cli-delegate/chunk-A4QJ6ENT.js +0 -50
  164. /package/dist/cli-delegate/{chunk-E6XNBVE4.js → chunk-KR5ZIFPO.js} +0 -0
@@ -645,7 +645,8 @@ function probeHostCapabilities(hostId) {
645
645
  const base = resolveHostCapabilities(hostId);
646
646
  const flag = process2.env.CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS;
647
647
  const probedAgentTeams = typeof flag === "string" && flag !== "";
648
- return { ...base, agent_teams: base.agent_teams || probedAgentTeams };
648
+ const probedResume = probedAgentTeams && hostId === "claude";
649
+ return { ...base, agent_teams: base.agent_teams || probedAgentTeams, worker_resume: base.worker_resume || probedResume };
649
650
  }
650
651
  var CAPABILITY_FIELDS = [
651
652
  "subagent_spawn",
@@ -667,9 +668,9 @@ function describeHostCapabilities(hostId) {
667
668
  const probedAgentTeams = typeof flag === "string" && flag !== "";
668
669
  const sources = {};
669
670
  for (const field of CAPABILITY_FIELDS) {
670
- if (row !== void 0 && typeof row[field] === "boolean") {
671
+ if (row !== void 0 && typeof row[field] === "boolean" && !(row[field] === false && manifest[field] === true)) {
671
672
  sources[field] = "registry";
672
- } else if (field === "agent_teams" && probedAgentTeams) {
673
+ } else if ((field === "agent_teams" || field === "worker_resume" && hostId === "claude") && probedAgentTeams) {
673
674
  sources[field] = "live-probe";
674
675
  } else {
675
676
  sources[field] = "default";
@@ -2,7 +2,7 @@ import { createRequire as __acCreateRequire } from 'node:module'; const require
2
2
  import {
3
3
  ZodFirstPartyTypeKind,
4
4
  settingsSchema
5
- } from "./chunk-4SHNERBL.js";
5
+ } from "./chunk-XIAPY44N.js";
6
6
  import {
7
7
  GLOBAL_DEPLOY_SOURCES,
8
8
  RULE_SOURCE_REL,
@@ -23,10 +23,14 @@ import {
23
23
  decideDeployWrite,
24
24
  foreignSidecarMessage,
25
25
  isLedgerMigration,
26
+ logProofApplies,
27
+ loggedWriteDigests,
26
28
  migrationPreservedMessage,
29
+ onlyDeployed,
27
30
  preservedFileMessage,
28
- sidecarPathFor
29
- } from "./chunk-IROAQ77A.js";
31
+ sidecarPathFor,
32
+ wroteTheseBytes
33
+ } from "./chunk-3PK3VZHB.js";
30
34
  import {
31
35
  main
32
36
  } from "./chunk-F7HLSW6P.js";
@@ -40,11 +44,12 @@ import {
40
44
  ruleBody,
41
45
  splitFrontmatter,
42
46
  split_frontmatter
43
- } from "./chunk-JHMMWNJ2.js";
47
+ } from "./chunk-YHAPONWV.js";
44
48
  import {
45
49
  SCOPE_DETECT_AI_DIRS,
46
- SCOPE_DETECT_MANIFESTS
47
- } from "./chunk-A4QJ6ENT.js";
50
+ SCOPE_DETECT_MANIFESTS,
51
+ getLogPath
52
+ } from "./chunk-W5JXMF2T.js";
48
53
  import {
49
54
  FINDER_NAME,
50
55
  _read_settings,
@@ -59,7 +64,7 @@ import {
59
64
  printResiduals,
60
65
  probeHostCapabilities,
61
66
  removeCodexFinder
62
- } from "./chunk-GOMILC3O.js";
67
+ } from "./chunk-QBHEI5N4.js";
63
68
  import {
64
69
  LEGACY_ALL,
65
70
  compute_active_pack_ids,
@@ -1296,6 +1301,7 @@ function createConflictTracker(host) {
1296
1301
  root: null,
1297
1302
  recorded: null,
1298
1303
  ledgerFiles: null,
1304
+ logged: null,
1299
1305
  preserved: [],
1300
1306
  migrated: /* @__PURE__ */ new Set(),
1301
1307
  staged: /* @__PURE__ */ new Map()
@@ -1394,6 +1400,7 @@ function createConflictTracker(host) {
1394
1400
  conflictState.root = root;
1395
1401
  conflictState.recorded = null;
1396
1402
  conflictState.ledgerFiles = null;
1403
+ conflictState.logged = null;
1397
1404
  conflictState.preserved = [];
1398
1405
  conflictState.migrated = /* @__PURE__ */ new Set();
1399
1406
  conflictState.staged = /* @__PURE__ */ new Map();
@@ -1406,13 +1413,17 @@ function createConflictTracker(host) {
1406
1413
  */
1407
1414
  resolve(target, force, would) {
1408
1415
  const exists = pathExists(target);
1409
- const base = {
1416
+ const recordedSha256 = exists ? recordedHashFor(target) : void 0;
1417
+ const unproven = {
1410
1418
  exists,
1411
- recordedSha256: exists ? recordedHashFor(target) : void 0,
1419
+ recordedSha256,
1412
1420
  onDiskSha256: exists ? sha256OfFile(target) : null,
1413
1421
  force,
1414
- ledgerListed: exists && ledgerLists(target)
1422
+ ledgerListed: exists && ledgerLists(target),
1423
+ recordedIsStaged: typeof recordedSha256 === "string" && recordedSha256 === recordedHashFor(sidecarPathFor(target))
1415
1424
  };
1425
+ const loggedWrite = logProofApplies(unproven) && wroteTheseBytes(target, unproven.onDiskSha256, conflictState.logged ??= loggedWriteDigests());
1426
+ const base = { ...unproven, loggedWrite };
1416
1427
  const migrating = isLedgerMigration(base);
1417
1428
  const decision = decideDeployWrite(
1418
1429
  migrating ? { ...base, packagedSha256: wouldWriteDigest(target, would) } : base
@@ -2460,8 +2471,8 @@ function _withPreservedKeys(rendered, original) {
2460
2471
  }
2461
2472
  return ["---", ...keep, "---", "", rendered].join("\n");
2462
2473
  }
2463
- function rewriteAndReport(rulesDir, quiet, info2, warn2, wrappers, preserved = /* @__PURE__ */ new Set()) {
2464
- const result = rewriteClaudeRules(rulesDir, preserved);
2474
+ function rewriteAndReport(rulesDir, quiet, info2, warn2, wrappers, preserved = /* @__PURE__ */ new Set(), onWrite) {
2475
+ const result = rewriteClaudeRules(rulesDir, preserved, onWrite);
2465
2476
  if (wrappers && !quiet) {
2466
2477
  if (wrappers.wrapped.length > 0) {
2467
2478
  info2(
@@ -2515,7 +2526,7 @@ function renderClaudeRule(sourceText) {
2515
2526
  lines.push(pyRstrip(body) + "\n");
2516
2527
  return { text: lines.join("\n"), globs: plan.globs, dropped: plan.dropped };
2517
2528
  }
2518
- function rewriteClaudeRules(rulesDir, preserved = /* @__PURE__ */ new Set()) {
2529
+ function rewriteClaudeRules(rulesDir, preserved = /* @__PURE__ */ new Set(), onWrite) {
2519
2530
  const result = { rewritten: 0, scoped: [], dropped: [], failed: [] };
2520
2531
  let entries;
2521
2532
  try {
@@ -2553,6 +2564,7 @@ function rewriteClaudeRules(rulesDir, preserved = /* @__PURE__ */ new Set()) {
2553
2564
  });
2554
2565
  continue;
2555
2566
  }
2567
+ onWrite?.(full);
2556
2568
  result.rewritten += 1;
2557
2569
  }
2558
2570
  const stem = name.slice(0, -3);
@@ -2898,6 +2910,7 @@ function thinInstalledRuleLayer(opts) {
2898
2910
  try {
2899
2911
  if (next !== installed) {
2900
2912
  fs16.writeFileSync(target, next, "utf-8");
2913
+ opts.onWrite?.(target);
2901
2914
  rewritten += 1;
2902
2915
  }
2903
2916
  thinned += 1;
@@ -4493,30 +4506,6 @@ function detect_module_roots(project_root) {
4493
4506
  return [...high, ...medium];
4494
4507
  }
4495
4508
 
4496
- // src/install/paths.ts
4497
- import { homedir as homedir8, tmpdir as tmpdir2 } from "node:os";
4498
- import { join as join18 } from "node:path";
4499
- var INSTALL_ROOT_SUBPATH = ".event4u/agent-config";
4500
- var INSTALL_LOG_FILENAME = "install-log.jsonl";
4501
- function resolveHome(home) {
4502
- if (home && home.length > 0) {
4503
- return home;
4504
- }
4505
- const fromOs = homedir8();
4506
- if (!fromOs) {
4507
- throw new Error(
4508
- "Cannot resolve home directory \u2014 both $HOME (POSIX) and $USERPROFILE (Windows) are unset."
4509
- );
4510
- }
4511
- return fromOs;
4512
- }
4513
- function getInstallRoot(home) {
4514
- return join18(resolveHome(home), INSTALL_ROOT_SUBPATH);
4515
- }
4516
- function getLogPath(home) {
4517
- return join18(getInstallRoot(home), INSTALL_LOG_FILENAME);
4518
- }
4519
-
4520
4509
  // src/scripts/install.ts
4521
4510
  var _HERE = fileURLToPath2(import.meta.url);
4522
4511
  var SystemExitError = class extends Error {
@@ -6600,7 +6589,8 @@ function _deploy_global_content(tools, force, package_root, lockfile_path2) {
6600
6589
  info,
6601
6590
  warn,
6602
6591
  res,
6603
- preserved_now
6592
+ preserved_now,
6593
+ onlyDeployed(anchor, current_files, (p) => _log_tx_entry("write", p))
6604
6594
  );
6605
6595
  deployClaudeCarrier({
6606
6596
  packageRoot: package_root,
@@ -6610,7 +6600,7 @@ function _deploy_global_content(tools, force, package_root, lockfile_path2) {
6610
6600
  warn,
6611
6601
  userPin: state.FULL_PIN,
6612
6602
  wantsThin: installerThinsHost(tool_id, { packageRoot: package_root }),
6613
- thin: (bodyLinkRoot) => describeThinInstalledLayer(thinInstalledRuleLayer({ rulesDir: path18.join(anchor, "rules"), packageRoot: package_root, preserved: preserved_now, bodyLinkRoot }))
6603
+ thin: (bodyLinkRoot) => describeThinInstalledLayer(thinInstalledRuleLayer({ rulesDir: path18.join(anchor, "rules"), packageRoot: package_root, preserved: preserved_now, bodyLinkRoot, onWrite: onlyDeployed(anchor, current_files, (p) => _log_tx_entry("write", p)) }))
6614
6604
  });
6615
6605
  if (!state.QUIET) for (const l of installReceiptBudgetLines(package_root, void 0, { thisDeploy: /* @__PURE__ */ new Map([[anchor, current_files]]) })) info(l);
6616
6606
  }
@@ -0,0 +1,77 @@
1
+ import { createRequire as __acCreateRequire } from 'node:module'; const require = globalThis.require ?? __acCreateRequire(import.meta.url);
2
+
3
+ // src/install/paths.ts
4
+ import { homedir, tmpdir } from "node:os";
5
+ import { join } from "node:path";
6
+ var INSTALL_ROOT_SUBPATH = ".event4u/agent-config";
7
+ var INSTALL_LOG_FILENAME = "install-log.jsonl";
8
+ function resolveHome(home) {
9
+ if (home && home.length > 0) {
10
+ return home;
11
+ }
12
+ const fromOs = homedir();
13
+ if (!fromOs) {
14
+ throw new Error(
15
+ "Cannot resolve home directory \u2014 both $HOME (POSIX) and $USERPROFILE (Windows) are unset."
16
+ );
17
+ }
18
+ return fromOs;
19
+ }
20
+ function getInstallRoot(home) {
21
+ return join(resolveHome(home), INSTALL_ROOT_SUBPATH);
22
+ }
23
+ function getLogPath(home) {
24
+ const configHome = home ? void 0 : process.env["EVENT4U_CONFIG_HOME"];
25
+ if (configHome) return join(configHome, INSTALL_LOG_FILENAME);
26
+ return join(getInstallRoot(home), INSTALL_LOG_FILENAME);
27
+ }
28
+
29
+ // src/install/detect.ts
30
+ import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
31
+ import { join as join2, resolve } from "node:path";
32
+ var SCOPE_DETECT_MANIFESTS = [
33
+ "package.json",
34
+ "composer.json",
35
+ "pyproject.toml",
36
+ "Cargo.toml",
37
+ "go.mod",
38
+ "Gemfile"
39
+ ];
40
+ var SCOPE_DETECT_AI_DIRS = [
41
+ ".claude",
42
+ ".cursor",
43
+ ".windsurf",
44
+ ".augment",
45
+ ".clinerules",
46
+ ".copilot",
47
+ ".gemini",
48
+ ".codex",
49
+ ".aider",
50
+ ".continue",
51
+ ".roo",
52
+ ".kilocode"
53
+ ];
54
+ function detectToolPresence(root) {
55
+ return {
56
+ augment: isDir(join2(root, ".augment")),
57
+ claude: isDir(join2(root, ".claude")),
58
+ cursor: isDir(join2(root, ".cursor")),
59
+ cline: isDir(join2(root, ".clinerules")),
60
+ windsurf: isDir(join2(root, ".windsurf")) || existsSync(join2(root, ".windsurfrules")),
61
+ agentsMd: existsSync(join2(root, "AGENTS.md"))
62
+ };
63
+ }
64
+ function isDir(path) {
65
+ try {
66
+ return statSync(path).isDirectory();
67
+ } catch {
68
+ return false;
69
+ }
70
+ }
71
+
72
+ export {
73
+ getLogPath,
74
+ SCOPE_DETECT_MANIFESTS,
75
+ SCOPE_DETECT_AI_DIRS,
76
+ detectToolPresence
77
+ };
@@ -4470,7 +4470,7 @@ var settingsSchema = external_exports.object({
4470
4470
  egress: external_exports.object({
4471
4471
  placeholders: external_exports.object({
4472
4472
  mode: external_exports.enum(["off", "observe", "protect", "strict"]).default("off").describe(
4473
- "Dispatcher egress stage (docs/contracts/egress-placeholders-v1.md). off (default) = nothing. observe = detect and count listed values in prompts and tool bodies, types and counts only, and change nothing a hook concern sees. protect = also give every recording and advisory concern a copy with each value replaced by a placeholder token, so local stores keep tokens; guards still see the original. strict = as protect until the host rewrite exists. No mode yet changes what reaches the model; the rule table holds credential rules only. Project layers only."
4473
+ "Dispatcher egress stage (docs/contracts/egress-placeholders-v1.md). off (default) = nothing. observe = detect and count listed values in prompts and tool bodies, types and counts only, and change nothing a hook concern sees. protect = also give every recording and advisory concern a copy with each value replaced by a placeholder token, so local stores keep tokens; guards still see the original. strict = as protect until the host rewrite exists. No mode yet changes what reaches the model; the rule table holds credential rows and the validated identifier rows. Project layers only."
4474
4474
  )
4475
4475
  }).default({})
4476
4476
  }).default({}),
@@ -3,7 +3,7 @@ import {
3
3
  atomicAppendLine,
4
4
  readConsequenceClass,
5
5
  stubLawIds
6
- } from "./chunk-GOMILC3O.js";
6
+ } from "./chunk-QBHEI5N4.js";
7
7
 
8
8
  // src/install/txlog.ts
9
9
  import { createGzip } from "node:zlib";
@@ -3,11 +3,12 @@ import {
3
3
  THIN_ENTRY_MARKER,
4
4
  TIER_TO_CLAUDE_MODEL,
5
5
  readRecentEntries
6
- } from "./chunk-JHMMWNJ2.js";
6
+ } from "./chunk-YHAPONWV.js";
7
7
  import "./chunk-LF2KKJ4Q.js";
8
8
  import {
9
- detectToolPresence
10
- } from "./chunk-A4QJ6ENT.js";
9
+ detectToolPresence,
10
+ getLogPath
11
+ } from "./chunk-W5JXMF2T.js";
11
12
  import {
12
13
  NO_RED_EVIDENCE_REASON,
13
14
  RENDER_REL,
@@ -60,7 +61,7 @@ import {
60
61
  proseEqual,
61
62
  resolveSessionRole,
62
63
  splitFrontmatter
63
- } from "./chunk-CAL76ADI.js";
64
+ } from "./chunk-CMZEKSNN.js";
64
65
  import {
65
66
  _is_global_only_consumer
66
67
  } from "./chunk-2Y5AMLMY.js";
@@ -74,7 +75,7 @@ import "./chunk-AX3U3UWJ.js";
74
75
  import {
75
76
  atomicAppendLine,
76
77
  probeHostCapabilities
77
- } from "./chunk-GOMILC3O.js";
78
+ } from "./chunk-QBHEI5N4.js";
78
79
  import "./chunk-7DRWULEQ.js";
79
80
  import "./chunk-ULQRUR23.js";
80
81
  import {
@@ -102,9 +103,9 @@ import {
102
103
  import {
103
104
  load_agent_settings
104
105
  } from "./chunk-XLY5G3CM.js";
105
- import "./chunk-2SFOOFJJ.js";
106
+ import "./chunk-BZJ4Y3CI.js";
106
107
  import "./chunk-FIEEOH5C.js";
107
- import "./chunk-E6XNBVE4.js";
108
+ import "./chunk-KR5ZIFPO.js";
108
109
  import {
109
110
  artefact_roots
110
111
  } from "./chunk-YCU3TIXH.js";
@@ -2363,19 +2364,11 @@ import * as fs4 from "node:fs";
2363
2364
  import * as path4 from "node:path";
2364
2365
 
2365
2366
  // src/scripts/code_graph/types.ts
2366
- var GUESS_RESOLVED_VIA = /* @__PURE__ */ new Set([
2367
- "name-lookup",
2368
- "dynamic",
2369
- // The accepted-edge filter is a DENYLIST, so a new value is accepted by
2370
- // default — which is exactly backwards for this one. `foreign` must be
2371
- // listed here or a consumer's graph would silently answer the gate verbs
2372
- // as if this package had resolved its edges.
2373
- "foreign"
2374
- ]);
2367
+ var GUESS_RESOLVED_VIA = /* @__PURE__ */ new Set(["name-lookup", "dynamic", "foreign"]);
2375
2368
  function isStatedResolution(resolved_via) {
2376
2369
  return !GUESS_RESOLVED_VIA.has(resolved_via);
2377
2370
  }
2378
- var SCHEMA_VERSION = 4;
2371
+ var SCHEMA_VERSION = 5;
2379
2372
  var EXT_LANG = {
2380
2373
  ".php": "php",
2381
2374
  ".ts": "typescript",
@@ -2385,37 +2378,24 @@ var EXT_LANG = {
2385
2378
  ".js": "javascript",
2386
2379
  ".jsx": "javascript",
2387
2380
  ".mjs": "javascript",
2388
- ".cjs": "javascript"
2381
+ ".cjs": "javascript",
2382
+ ".py": "python",
2383
+ ".go": "go",
2384
+ ".java": "java",
2385
+ ".vue": "typescript"
2389
2386
  };
2390
2387
 
2391
2388
  // src/scripts/code_graph/validate.ts
2392
- var RELATIONS = /* @__PURE__ */ new Set(["calls", "imports", "uses", "inherits", "member", "tests"]);
2389
+ var words = (s) => new Set(s.split(" "));
2390
+ var RELATIONS = words(
2391
+ "calls imports uses inherits member tests routes-to renders includes reads migrates persists relates documents"
2392
+ );
2393
2393
  var CONFIDENCES = /* @__PURE__ */ new Set(["EXTRACTED", "INFERRED", "AMBIGUOUS"]);
2394
- var RESOLVED_VIA = /* @__PURE__ */ new Set([
2395
- "same-file",
2396
- "import-specifier",
2397
- "path-alias",
2398
- "psr4",
2399
- "route-table",
2400
- "test-import",
2401
- "name-lookup",
2402
- "dynamic",
2403
- // Adapted from a consumer's own graph file; see `foreign.ts`.
2404
- "foreign"
2405
- ]);
2406
- var PROVIDERS = /* @__PURE__ */ new Set(["native", "foreign"]);
2407
- var KINDS = /* @__PURE__ */ new Set([
2408
- "file",
2409
- "class",
2410
- "interface",
2411
- "trait",
2412
- "function",
2413
- "method",
2414
- "constant",
2415
- "type",
2416
- "enum",
2417
- "skipped"
2418
- ]);
2394
+ var RESOLVED_VIA = words(
2395
+ "same-file import-specifier path-alias psr4 route-table directive-scan schema-call eloquent-relation compiler-index test-import name-lookup dynamic foreign"
2396
+ );
2397
+ var PROVIDERS = /* @__PURE__ */ new Set(["native", "foreign", "scip"]);
2398
+ var KINDS = words("file class interface trait function method constant type enum skipped route table");
2419
2399
  function validateGraph(g) {
2420
2400
  const errors = [];
2421
2401
  const push = (m) => {
@@ -2434,6 +2414,7 @@ function validateGraph(g) {
2434
2414
  if (typeof n !== "object" || n === null) return push(`node[${i}] not an object`);
2435
2415
  const nn = n;
2436
2416
  if (typeof nn["id"] !== "string") push(`node[${i}].id must be a string`);
2417
+ else if (ids.has(nn["id"])) push(`node[${i}].id is a duplicate: ${nn["id"]}`);
2437
2418
  else ids.add(nn["id"]);
2438
2419
  if (!KINDS.has(nn["kind"])) push(`node[${i}].kind invalid: ${String(nn["kind"])}`);
2439
2420
  if (typeof nn["source_file"] !== "string") push(`node[${i}].source_file must be a string`);
@@ -2545,7 +2526,7 @@ function detectSources(root, nativeCache) {
2545
2526
  } catch {
2546
2527
  }
2547
2528
  const scip = scipCandidates.find((p) => fs4.existsSync(p));
2548
- if (scip) out.push({ kind: "scip", path: scip, present: true, note: "SCIP detected \u2014 peer tooling required (no owned reader)" });
2529
+ if (scip) out.push({ kind: "scip", path: scip, present: true, note: "SCIP \u2014 index.scip merges into the build" });
2549
2530
  if (fs4.existsSync(nativeCache)) out.push({ kind: "native", path: nativeCache, present: true, ...freshness(abs, nativeCache, null) });
2550
2531
  return out;
2551
2532
  }
@@ -2627,6 +2608,7 @@ function emitSqliteTwin(graph, serialized, jsonPath) {
2627
2608
  db.exec(
2628
2609
  "CREATE TABLE meta (key TEXT PRIMARY KEY, value TEXT NOT NULL);CREATE TABLE nodes (id TEXT PRIMARY KEY, label TEXT NOT NULL, kind TEXT, source_file TEXT, l0 INTEGER, l1 INTEGER, l2 INTEGER, l3 INTEGER);CREATE TABLE edges (source TEXT NOT NULL, target TEXT NOT NULL, relation TEXT NOT NULL, confidence TEXT NOT NULL, candidates TEXT, ambiguity_reason TEXT, resolved_via TEXT, provider TEXT);CREATE INDEX edges_source ON edges(source);CREATE INDEX edges_target ON edges(target);CREATE INDEX nodes_label ON nodes(label);CREATE INDEX nodes_source_file ON nodes(source_file);"
2629
2610
  );
2611
+ db.exec("BEGIN");
2630
2612
  const meta = db.prepare("INSERT INTO meta (key, value) VALUES (?, ?)");
2631
2613
  meta.run("source_checksum", graph.source_checksum);
2632
2614
  meta.run("json_size", String(stat.size));
@@ -2665,14 +2647,17 @@ function emitSqliteTwin(graph, serialized, jsonPath) {
2665
2647
  e.provider
2666
2648
  );
2667
2649
  }
2650
+ db.exec("COMMIT");
2668
2651
  stampUserVersion(db, GRAPH_STORE_VERSION);
2669
2652
  } finally {
2670
2653
  db.close();
2671
2654
  }
2672
2655
  fs5.renameSync(tmp, twin);
2673
2656
  return true;
2674
- } catch {
2657
+ } catch (e) {
2675
2658
  fs5.rmSync(tmp, { force: true });
2659
+ process.stderr.write(`code-graph: index not written: ${e.message}
2660
+ `);
2676
2661
  return false;
2677
2662
  }
2678
2663
  }
@@ -7335,7 +7320,7 @@ function installLogPath() {
7335
7320
  if (override && override.trim().length > 0) {
7336
7321
  return override;
7337
7322
  }
7338
- return path19.join(os7.homedir(), ".event4u", "agent-config", "install-log.jsonl");
7323
+ return getLogPath();
7339
7324
  }
7340
7325
  function _installLogExpected(projectRoot) {
7341
7326
  return fs22.existsSync(manifest_path(projectRoot));
@@ -64,7 +64,7 @@ import {
64
64
  _wizard_state_path,
65
65
  main,
66
66
  shutilWhich
67
- } from "./chunk-CAL76ADI.js";
67
+ } from "./chunk-CMZEKSNN.js";
68
68
  import {
69
69
  INSTALL_MODE_MARKER_RELATIVE,
70
70
  _is_global_only_consumer
@@ -76,7 +76,7 @@ import "./chunk-FTAISGDQ.js";
76
76
  import "./chunk-5VO3RTMV.js";
77
77
  import "./chunk-6V6TA25H.js";
78
78
  import "./chunk-AX3U3UWJ.js";
79
- import "./chunk-GOMILC3O.js";
79
+ import "./chunk-QBHEI5N4.js";
80
80
  import "./chunk-7DRWULEQ.js";
81
81
  import "./chunk-ULQRUR23.js";
82
82
  import "./chunk-I4KJYVPB.js";
@@ -86,9 +86,9 @@ import "./chunk-PV7S5DPJ.js";
86
86
  import "./chunk-LQOCRFWT.js";
87
87
  import "./chunk-7HKRE54K.js";
88
88
  import "./chunk-XLY5G3CM.js";
89
- import "./chunk-2SFOOFJJ.js";
89
+ import "./chunk-BZJ4Y3CI.js";
90
90
  import "./chunk-FIEEOH5C.js";
91
- import "./chunk-E6XNBVE4.js";
91
+ import "./chunk-KR5ZIFPO.js";
92
92
  import "./chunk-YCU3TIXH.js";
93
93
  import "./chunk-DEIV7XP7.js";
94
94
  import "./chunk-J2SJZICO.js";
@@ -6,9 +6,9 @@ import {
6
6
  runCensus,
7
7
  runContradictions,
8
8
  summaryLine
9
- } from "./chunk-2SFOOFJJ.js";
9
+ } from "./chunk-BZJ4Y3CI.js";
10
10
  import "./chunk-FIEEOH5C.js";
11
- import "./chunk-E6XNBVE4.js";
11
+ import "./chunk-KR5ZIFPO.js";
12
12
  import "./chunk-YCU3TIXH.js";
13
13
  import "./chunk-DEIV7XP7.js";
14
14
  import "./chunk-J2SJZICO.js";
@@ -22,7 +22,7 @@ import {
22
22
  import {
23
23
  assignmentPattern,
24
24
  rawKeyPrefixPattern
25
- } from "./chunk-E6XNBVE4.js";
25
+ } from "./chunk-KR5ZIFPO.js";
26
26
  import {
27
27
  artefact_roots
28
28
  } from "./chunk-YCU3TIXH.js";
@@ -9,16 +9,16 @@ import {
9
9
  KIRO_MARKER,
10
10
  ROOCODE_MARKER,
11
11
  ZED_MARKER
12
- } from "./chunk-SIOMDAKL.js";
13
- import "./chunk-4SHNERBL.js";
12
+ } from "./chunk-VYZGJLCA.js";
13
+ import "./chunk-XIAPY44N.js";
14
14
  import "./chunk-BKALSTBZ.js";
15
15
  import "./chunk-NTM7G2V4.js";
16
- import "./chunk-IROAQ77A.js";
16
+ import "./chunk-3PK3VZHB.js";
17
17
  import "./chunk-F7HLSW6P.js";
18
- import "./chunk-JHMMWNJ2.js";
18
+ import "./chunk-YHAPONWV.js";
19
19
  import "./chunk-LF2KKJ4Q.js";
20
- import "./chunk-A4QJ6ENT.js";
21
- import "./chunk-GOMILC3O.js";
20
+ import "./chunk-W5JXMF2T.js";
21
+ import "./chunk-QBHEI5N4.js";
22
22
  import "./chunk-7DRWULEQ.js";
23
23
  import "./chunk-ULQRUR23.js";
24
24
  import "./chunk-PV7S5DPJ.js";
@@ -2,9 +2,9 @@ import { createRequire as __acCreateRequire } from 'node:module'; const require
2
2
  import {
3
3
  hasBlockingFinding,
4
4
  runPreflight
5
- } from "./chunk-ESUNQ5XR.js";
6
- import "./chunk-IROAQ77A.js";
7
- import "./chunk-A4QJ6ENT.js";
5
+ } from "./chunk-E3CFULNX.js";
6
+ import "./chunk-3PK3VZHB.js";
7
+ import "./chunk-W5JXMF2T.js";
8
8
  import "./chunk-J2SJZICO.js";
9
9
  import "./chunk-4E2W63DA.js";
10
10
  import "./chunk-MWRD5YOH.js";
@@ -6,9 +6,9 @@ import {
6
6
  import {
7
7
  hasBlockingFinding,
8
8
  runPreflight
9
- } from "./chunk-ESUNQ5XR.js";
10
- import "./chunk-IROAQ77A.js";
11
- import "./chunk-A4QJ6ENT.js";
9
+ } from "./chunk-E3CFULNX.js";
10
+ import "./chunk-3PK3VZHB.js";
11
+ import "./chunk-W5JXMF2T.js";
12
12
  import "./chunk-7DRWULEQ.js";
13
13
  import "./chunk-J2SJZICO.js";
14
14
  import "./chunk-4E2W63DA.js";
@@ -1,16 +1,16 @@
1
1
  import { createRequire as __acCreateRequire } from 'node:module'; const require = globalThis.require ?? __acCreateRequire(import.meta.url);
2
2
  import {
3
3
  PROJECT_BRIDGE_MARKERS
4
- } from "./chunk-SIOMDAKL.js";
5
- import "./chunk-4SHNERBL.js";
4
+ } from "./chunk-VYZGJLCA.js";
5
+ import "./chunk-XIAPY44N.js";
6
6
  import "./chunk-BKALSTBZ.js";
7
7
  import "./chunk-NTM7G2V4.js";
8
- import "./chunk-IROAQ77A.js";
8
+ import "./chunk-3PK3VZHB.js";
9
9
  import "./chunk-F7HLSW6P.js";
10
- import "./chunk-JHMMWNJ2.js";
10
+ import "./chunk-YHAPONWV.js";
11
11
  import "./chunk-LF2KKJ4Q.js";
12
- import "./chunk-A4QJ6ENT.js";
13
- import "./chunk-GOMILC3O.js";
12
+ import "./chunk-W5JXMF2T.js";
13
+ import "./chunk-QBHEI5N4.js";
14
14
  import "./chunk-7DRWULEQ.js";
15
15
  import "./chunk-ULQRUR23.js";
16
16
  import "./chunk-PV7S5DPJ.js";
@@ -3,16 +3,16 @@ import {
3
3
  GLOBAL_AGENT_SETTINGS_PATH,
4
4
  GLOBAL_USER_SETTINGS_PATH,
5
5
  SETTINGS_FILE
6
- } from "./chunk-SIOMDAKL.js";
7
- import "./chunk-4SHNERBL.js";
6
+ } from "./chunk-VYZGJLCA.js";
7
+ import "./chunk-XIAPY44N.js";
8
8
  import "./chunk-BKALSTBZ.js";
9
9
  import "./chunk-NTM7G2V4.js";
10
- import "./chunk-IROAQ77A.js";
10
+ import "./chunk-3PK3VZHB.js";
11
11
  import "./chunk-F7HLSW6P.js";
12
- import "./chunk-JHMMWNJ2.js";
12
+ import "./chunk-YHAPONWV.js";
13
13
  import "./chunk-LF2KKJ4Q.js";
14
- import "./chunk-A4QJ6ENT.js";
15
- import "./chunk-GOMILC3O.js";
14
+ import "./chunk-W5JXMF2T.js";
15
+ import "./chunk-QBHEI5N4.js";
16
16
  import "./chunk-7DRWULEQ.js";
17
17
  import "./chunk-ULQRUR23.js";
18
18
  import "./chunk-PV7S5DPJ.js";
@@ -7,7 +7,7 @@ import {
7
7
  import {
8
8
  external_exports,
9
9
  settingsSchema
10
- } from "./chunk-4SHNERBL.js";
10
+ } from "./chunk-XIAPY44N.js";
11
11
  import {
12
12
  dump,
13
13
  load
@@ -1,16 +1,16 @@
1
1
  import { createRequire as __acCreateRequire } from 'node:module'; const require = globalThis.require ?? __acCreateRequire(import.meta.url);
2
2
  import {
3
3
  main
4
- } from "./chunk-SIOMDAKL.js";
5
- import "./chunk-4SHNERBL.js";
4
+ } from "./chunk-VYZGJLCA.js";
5
+ import "./chunk-XIAPY44N.js";
6
6
  import "./chunk-BKALSTBZ.js";
7
7
  import "./chunk-NTM7G2V4.js";
8
- import "./chunk-IROAQ77A.js";
8
+ import "./chunk-3PK3VZHB.js";
9
9
  import "./chunk-F7HLSW6P.js";
10
- import "./chunk-JHMMWNJ2.js";
10
+ import "./chunk-YHAPONWV.js";
11
11
  import "./chunk-LF2KKJ4Q.js";
12
- import "./chunk-A4QJ6ENT.js";
13
- import "./chunk-GOMILC3O.js";
12
+ import "./chunk-W5JXMF2T.js";
13
+ import "./chunk-QBHEI5N4.js";
14
14
  import "./chunk-7DRWULEQ.js";
15
15
  import "./chunk-ULQRUR23.js";
16
16
  import "./chunk-PV7S5DPJ.js";