@event4u/agent-config 14.21.0 → 14.23.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 (235) 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 +164 -187
  5. package/CREDITS.md +37 -0
  6. package/README.md +1 -1
  7. package/dist/agent-src/commands/analyze/inbox.md +380 -5
  8. package/dist/agent-src/commands/analyze/repo.md +4 -2
  9. package/dist/agent-src/commands/pr/merge.md +47 -38
  10. package/dist/agent-src/commands/roadmap/next.md +8 -0
  11. package/dist/agent-src/contexts/communication/rules-auto/token-efficiency-mechanics.md +69 -0
  12. package/dist/agent-src/contexts/execution/auto-dispatch-classification.md +5 -5
  13. package/dist/agent-src/contexts/execution/autonomy-mechanics.md +12 -0
  14. package/dist/agent-src/rules/external-code-graph-interop.md +19 -14
  15. package/dist/agent-src/rules/notes-first-reasoning.md +36 -25
  16. package/dist/agent-src/rules/token-efficiency.md +26 -3
  17. package/dist/agent-src/scripts/_cli_entry.ts +51 -0
  18. package/dist/agent-src/scripts/archive_completed_roadmaps.ts +120 -27
  19. package/dist/agent-src/scripts/roadmap_gates.ts +4 -20
  20. package/dist/agent-src/scripts/roadmap_set_step.ts +5 -2
  21. package/dist/agent-src/scripts/stubs_due.ts +4 -18
  22. package/dist/agent-src/scripts/update_roadmap_progress.ts +7 -24
  23. package/dist/agent-src/skills/code-intelligence/SKILL.md +82 -1
  24. package/dist/agent-src/skills/git-workflow/references/push-closes-its-loop.md +9 -0
  25. package/dist/agent-src/skills/roadmap-writing/SKILL.md +17 -0
  26. package/dist/agent-src/skills/tailwind-engineer/SKILL.md +52 -2
  27. package/dist/agent-src/templates/agent-settings.md +0 -1
  28. package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
  29. package/dist/cli/registry.js +1 -1
  30. package/dist/cli-delegate/_cli_entry.js +8 -0
  31. package/dist/cli-delegate/_lib/pin_resolver.js +170 -0
  32. package/dist/cli-delegate/archival_sweep.js +8 -0
  33. package/dist/cli-delegate/archive_completed_roadmaps.js +542 -0
  34. package/dist/cli-delegate/check_update_banner.js +923 -0
  35. package/dist/cli-delegate/{chunk-ZVBOHSVF.js → chunk-2KKXJW25.js} +23 -9
  36. package/dist/cli-delegate/chunk-5EK5WQN6.js +28 -0
  37. package/dist/cli-delegate/chunk-7XGD2OEU.js +96 -0
  38. package/dist/cli-delegate/chunk-DBH4AHDK.js +155 -0
  39. package/dist/cli-delegate/{chunk-4FS4WRXP.js → chunk-IAI3XL43.js} +15 -3
  40. package/dist/cli-delegate/chunk-JO25G5H7.js +20 -0
  41. package/dist/cli-delegate/{chunk-643Z7FIC.js → chunk-KCNTUSPI.js} +7 -1
  42. package/dist/cli-delegate/chunk-LTYVIY76.js +7961 -0
  43. package/dist/cli-delegate/chunk-QAJS5YWY.js +999 -0
  44. package/dist/cli-delegate/{chunk-YS6XTLEK.js → chunk-TYSY33MD.js} +56 -6
  45. package/dist/cli-delegate/chunk-ULET4BYS.js +328 -0
  46. package/dist/cli-delegate/chunk-YDQSHTD7.js +187 -0
  47. package/dist/cli-delegate/chunk-YWVXLR44.js +48 -0
  48. package/dist/cli-delegate/chunk-ZZQBUHFK.js +273 -0
  49. package/dist/cli-delegate/cmd_conformance.js +2 -2
  50. package/dist/cli-delegate/cmd_export.js +2 -2
  51. package/dist/cli-delegate/cmd_handoff.js +45 -13
  52. package/dist/cli-delegate/cmd_prune.js +2 -2
  53. package/dist/cli-delegate/cmd_session_recycle.js +4 -14
  54. package/dist/cli-delegate/cmd_settings_migrate.js +2 -2
  55. package/dist/cli-delegate/cmd_settings_set.js +1 -1
  56. package/dist/cli-delegate/cmd_sync.js +2 -2
  57. package/dist/cli-delegate/cmd_uninstall.js +2 -2
  58. package/dist/cli-delegate/cmd_validate.js +2 -2
  59. package/dist/cli-delegate/dashboard_mode.js +16 -0
  60. package/dist/cli-delegate/gate_budget.js +24 -0
  61. package/dist/cli-delegate/gate_execute.js +25 -0
  62. package/dist/cli-delegate/guarded_baseline.js +18 -0
  63. package/dist/cli-delegate/resume_probe.js +22 -0
  64. package/dist/cli-delegate/roadmap_gates.js +638 -0
  65. package/dist/cli-delegate/roadmap_set_step.js +173 -0
  66. package/dist/cli-delegate/stub_queue.js +47 -0
  67. package/dist/cli-delegate/stubs_due.js +38 -0
  68. package/dist/cli-delegate/ticket_bundles.js +59 -0
  69. package/dist/cli-delegate/update_roadmap_progress.js +60 -0
  70. package/dist/discovery/deprecation-report.md +1 -1
  71. package/dist/discovery/discovery-manifest.json +13 -13
  72. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  73. package/dist/discovery/discovery-manifest.summary.md +1 -1
  74. package/dist/discovery/dormancy-report.md +1 -1
  75. package/dist/discovery/orphan-report.md +1 -1
  76. package/dist/discovery/packs.json +2 -2
  77. package/dist/discovery/trust-report.md +1 -1
  78. package/dist/discovery/workspaces.json +2 -2
  79. package/dist/hooks/dispatch.js +1813 -946
  80. package/dist/install/claudeLayerCarriage.js +237 -0
  81. package/dist/install/claudePathsPlan.js +79 -0
  82. package/dist/install/hostLayerFingerprint.js +1 -1
  83. package/dist/install/install.mjs +21 -3
  84. package/dist/install/partitionEligibility.js +231 -117
  85. package/dist/install/ruleLayerPartition.js +10 -7
  86. package/dist/mcp/registry-manifest.json +2 -2
  87. package/dist/mcp/server.json +2 -2
  88. package/dist/mcp/server.mjs +10870 -7641
  89. package/dist/scripts/_lib/lean_projection_mode.js +108 -0
  90. package/dist/scripts/_lib/router_match.js +243 -0
  91. package/dist/scripts/_lib/rule_injection.js +216 -0
  92. package/dist/scripts/condense.js +52 -45
  93. package/dist/scripts/project_thin_rules.js +139 -19
  94. package/dist/server/schemas/settings.js +16 -3
  95. package/docs/MIGRATION.md +105 -1
  96. package/docs/contracts/settings-classes.md +40 -8
  97. package/docs/guidelines/agent-infra/minimal-safe-diff-mechanics.md +73 -0
  98. package/docs/guidelines/agent-infra/notes-horizon-mechanics.md +90 -0
  99. package/llms.txt +1 -1
  100. package/package.json +7 -4
  101. package/src/agent-src/scripts/_cli_entry.ts +51 -0
  102. package/src/agent-src/scripts/archive_completed_roadmaps.ts +120 -27
  103. package/src/agent-src/scripts/roadmap_gates.ts +4 -20
  104. package/src/agent-src/scripts/roadmap_set_step.ts +5 -2
  105. package/src/agent-src/scripts/stubs_due.ts +4 -18
  106. package/src/agent-src/scripts/update_roadmap_progress.ts +7 -24
  107. package/src/config/agent-settings.template.yml +47 -1
  108. package/src/config/continuity-surface.json +516 -0
  109. package/src/config/estate-count-budget.json +1 -1
  110. package/src/config/evaluator-budgets.json +4 -4
  111. package/src/config/gate-coverage.yml +29 -8
  112. package/src/config/gate-violation-baselines.json +8 -8
  113. package/src/config/gitignore-block.txt +19 -0
  114. package/src/config/hook-token-budget.json +7 -6
  115. package/src/config/host-injection-effect.json +73 -0
  116. package/src/config/packed-binary-manifest.json +33 -0
  117. package/src/config/preamble-payload-budget.json +112 -105
  118. package/src/config/publish-surface.json +4 -2
  119. package/src/config/routing-coverage-seed.json +9 -2
  120. package/src/install/claudeLayerCarriage.ts +273 -0
  121. package/src/install/claudePathsPlan.ts +76 -0
  122. package/src/install/hostLayerFingerprint.ts +1 -1
  123. package/src/install/partitionEligibility.ts +261 -127
  124. package/src/install/ruleLayerPartition.ts +19 -23
  125. package/src/scripts/_cli/cmd_session_recycle.ts +2 -25
  126. package/src/scripts/_cli/handoff_sessions.ts +14 -44
  127. package/src/scripts/_dispatch.bash +77 -27
  128. package/src/scripts/_lib/auto_dispatch.ts +2 -2
  129. package/src/scripts/_lib/catalogue_layer_parity.ts +146 -0
  130. package/src/scripts/_lib/continuity_slot.ts +295 -0
  131. package/src/scripts/_lib/continuity_surface.ts +296 -0
  132. package/src/scripts/_lib/continuity_writer.ts +253 -0
  133. package/src/scripts/_lib/corpus_manifest.ts +26 -9
  134. package/src/scripts/_lib/hook_settings.ts +86 -1
  135. package/src/scripts/_lib/injection_effect.ts +151 -0
  136. package/src/scripts/_lib/layer_overlap_notice.ts +50 -6
  137. package/src/scripts/_lib/lean_projection_mode.ts +127 -0
  138. package/src/scripts/_lib/packed_binary_predicate.ts +262 -0
  139. package/src/scripts/_lib/pin_resolver.ts +13 -0
  140. package/src/scripts/_lib/recycle_envelope_paths.ts +109 -21
  141. package/src/scripts/_lib/regression_neighbourhood.ts +159 -22
  142. package/src/scripts/_lib/retired_status.ts +74 -0
  143. package/src/scripts/_lib/session_eol.ts +44 -0
  144. package/src/scripts/_lib/session_index_trust.ts +346 -0
  145. package/src/scripts/_lib/skill_catalogue.ts +156 -21
  146. package/src/scripts/_lib/standing_bound_ratchet.ts +154 -0
  147. package/src/scripts/_lib/subagent_capsule.ts +117 -8
  148. package/src/scripts/_lib/vendored_grammar_upstream.ts +280 -0
  149. package/src/scripts/ai_council/api_transport.ts +5 -0
  150. package/src/scripts/ai_council/deliberation_metrics.ts +353 -0
  151. package/src/scripts/ai_council/prompts.ts +9 -0
  152. package/src/scripts/ai_council/synthesis_disagreement.ts +206 -0
  153. package/src/scripts/audit_mcp_tools.ts +69 -25
  154. package/src/scripts/build_mcp_catalog.ts +24 -1
  155. package/src/scripts/capture_skill_catalogue.ts +24 -11
  156. package/src/scripts/check_candidate_lines.ts +499 -0
  157. package/src/scripts/check_continuity_surface.ts +475 -0
  158. package/src/scripts/check_dependency_floors.ts +13 -6
  159. package/src/scripts/check_estate_count.ts +40 -79
  160. package/src/scripts/check_host_tree_parity.ts +291 -0
  161. package/src/scripts/check_pack_size.ts +262 -23
  162. package/src/scripts/check_preamble_payload_budget.ts +136 -7
  163. package/src/scripts/check_roadmap_trackable.ts +19 -16
  164. package/src/scripts/check_rule_layer_partition.ts +54 -34
  165. package/src/scripts/check_rule_projection_integrity.ts +102 -2
  166. package/src/scripts/check_single_delivery.ts +97 -31
  167. package/src/scripts/check_update_banner.ts +13 -0
  168. package/src/scripts/ci_settle.ts +205 -5
  169. package/src/scripts/code_graph/build.ts +217 -15
  170. package/src/scripts/code_graph/cli.ts +334 -15
  171. package/src/scripts/code_graph/detect.ts +38 -0
  172. package/src/scripts/code_graph/extract.ts +11 -0
  173. package/src/scripts/code_graph/grammar_probe.ts +43 -0
  174. package/src/scripts/code_graph/loader.ts +88 -14
  175. package/src/scripts/code_graph/query.ts +144 -11
  176. package/src/scripts/code_graph/resolution_tiers.ts +238 -0
  177. package/src/scripts/code_graph/sqlite_store.ts +262 -6
  178. package/src/scripts/code_graph/types.ts +117 -3
  179. package/src/scripts/code_graph/validate.ts +26 -1
  180. package/src/scripts/code_graph/verbs.ts +590 -0
  181. package/src/scripts/condense.ts +54 -42
  182. package/src/scripts/corpus_manifest.ts +5 -5
  183. package/src/scripts/council_cli.ts +11 -12
  184. package/src/scripts/count_intent_disagreement.ts +426 -0
  185. package/src/scripts/handoff_context_hook.ts +118 -1
  186. package/src/scripts/hook_effect_doctor.ts +82 -1
  187. package/src/scripts/hook_manifest.json +1 -1
  188. package/src/scripts/hook_manifest.yaml +87 -12
  189. package/src/scripts/hooks/block_speaking_inbox_dir.ts +182 -16
  190. package/src/scripts/hooks/chain_nudge_hook.ts +282 -0
  191. package/src/scripts/hooks/code_graph_context_hook.ts +201 -0
  192. package/src/scripts/hooks/concern_registry.ts +4 -2
  193. package/src/scripts/hooks/host_semantics.ts +1 -1
  194. package/src/scripts/hooks/orchestration_record_hook.ts +2 -2
  195. package/src/scripts/hooks/push_settle_hook.ts +3 -2
  196. package/src/scripts/hooks/rule_inject_hook.ts +108 -21
  197. package/src/scripts/hooks/session_eol_hook.ts +120 -2
  198. package/src/scripts/hooks/skill_route_hook.ts +11 -4
  199. package/src/scripts/hot_context_hook.ts +62 -7
  200. package/src/scripts/inbox_source_census.ts +322 -0
  201. package/src/scripts/install-hooks.sh +82 -0
  202. package/src/scripts/{lint_carrier_integrity.ts → lint_deferral_integrity.ts} +60 -214
  203. package/src/scripts/lint_plan_risk_register.ts +13 -17
  204. package/src/scripts/lint_roadmap_blockers.ts +164 -1
  205. package/src/scripts/mcp_server/consumer_tool_catalog.json +152 -2
  206. package/src/scripts/mcp_server/graph_tools.ts +294 -0
  207. package/src/scripts/mcp_server/path_util.ts +31 -0
  208. package/src/scripts/mcp_server/suggest_skill.ts +72 -0
  209. package/src/scripts/mcp_server/tool_catalog_source.ts +7 -1
  210. package/src/scripts/mcp_server/tools.ts +5 -69
  211. package/src/scripts/media/lib/adapter-contract.md +7 -2
  212. package/src/scripts/media/lib/fixtures/flux/asset-0001.png +0 -0
  213. package/src/scripts/media/lib/fixtures/gemini-image/asset-0001.png +0 -0
  214. package/src/scripts/media/lib/fixtures/ideogram/asset-0001.png +0 -0
  215. package/src/scripts/model_rule_injection.ts +61 -4
  216. package/src/scripts/project_thin_rules.ts +149 -16
  217. package/src/scripts/rdp_candidates_delta.ts +276 -0
  218. package/src/scripts/rdp_quality_eval.ts +217 -19
  219. package/src/scripts/release_mix_taxonomy.json +3 -2
  220. package/src/scripts/report_host_injection_effect.ts +189 -0
  221. package/src/scripts/report_layer_overlap.ts +41 -0
  222. package/src/scripts/report_skill_menu_census.ts +341 -0
  223. package/src/scripts/report_standing_payload_by_host.ts +650 -0
  224. package/src/scripts/schemas/agent-settings.schema.json +7 -1
  225. package/src/scripts/session_memory_index.ts +81 -8
  226. package/src/scripts/skill_tools/score_skill_relevance.ts +70 -6
  227. package/src/scripts/skill_tools/suggest_skill_for_task.ts +37 -3
  228. package/src/server/schemas/settings.ts +23 -4
  229. package/src/vendor/grammars/README.md +86 -0
  230. package/src/vendor/grammars/tree-sitter-javascript.wasm +0 -0
  231. package/src/vendor/grammars/tree-sitter-php.wasm +0 -0
  232. package/src/vendor/grammars/tree-sitter-typescript.wasm +0 -0
  233. package/src/scripts/_lib/carrier_status.ts +0 -118
  234. package/src/scripts/_lib/estate_carrier_cases.ts +0 -72
  235. package/src/scripts/hooks/code_graph_nudge_hook.ts +0 -191
@@ -3,7 +3,7 @@ import {
3
3
  pruneAgedRefusalState,
4
4
  readSessionCounts,
5
5
  statePathFor
6
- } from "./chunk-YS6XTLEK.js";
6
+ } from "./chunk-TYSY33MD.js";
7
7
  import {
8
8
  readHookStdin
9
9
  } from "./chunk-F7DQWYR5.js";
@@ -341,22 +341,35 @@ function listContinuityRecords(workspace_root) {
341
341
  }
342
342
  function resolveContinuityRecord(workspace_root, session_id) {
343
343
  const id = String(session_id ?? "").trim();
344
- if (id !== "") {
345
- const own = path3.join(workspace_root, recycle_envelope_rel(id));
346
- return fs3.existsSync(own) ? { file: own, reason: `continuity record for this session (${safe_stem(id)})` } : { file: null, reason: `no continuity record for this session (${safe_stem(id)})` };
347
- }
348
- const candidates = listContinuityRecords(workspace_root);
344
+ const own = id === "" ? null : path3.join(workspace_root, recycle_envelope_rel(id));
345
+ const candidates = listContinuityRecords(workspace_root).filter((f) => f !== own);
349
346
  if (candidates.length === 0) {
350
- return { file: null, reason: "no continuity record present" };
347
+ return {
348
+ file: null,
349
+ reason: id === "" ? "no continuity record present" : `no predecessor record in this workspace (own: ${safe_stem(id)})`
350
+ };
351
351
  }
352
352
  if (candidates.length === 1) {
353
- return { file: candidates[0], reason: "one continuity record, no session id to key on" };
353
+ return {
354
+ file: candidates[0],
355
+ reason: id === "" ? "one continuity record, no session id to key on" : `predecessor record, one candidate (own: ${safe_stem(id)})`
356
+ };
354
357
  }
355
358
  return {
356
359
  file: null,
357
- reason: `starting clean: ${candidates.length} continuity records in this workspace and no session id to tell them apart \u2014 resuming from the newest would resume a peer session, not this one`
360
+ reason: `starting clean: ${candidates.length} continuity records in this workspace and no way to tell which is the predecessor \u2014 resuming from the newest would resume a peer session, not this one`
358
361
  };
359
362
  }
363
+ function resolvePredecessor(projectRoot, sessionId) {
364
+ try {
365
+ const consumed = path3.join(projectRoot, recycle_consumed_rel(sessionId));
366
+ const raw = JSON.parse(fs3.readFileSync(consumed, "utf-8"));
367
+ const prior = String(raw.session_id ?? "").trim();
368
+ return prior === "" ? "none" : prior;
369
+ } catch {
370
+ return "none";
371
+ }
372
+ }
360
373
  function predecessorTracePresent(workspace_root, predecessor) {
361
374
  const id = String(predecessor ?? "").trim();
362
375
  if (id === "" || id === "none") {
@@ -1104,6 +1117,7 @@ export {
1104
1117
  recycle_envelope_rel,
1105
1118
  recycle_consumed_rel,
1106
1119
  resolveContinuityRecord,
1120
+ resolvePredecessor,
1107
1121
  predecessorTracePresent,
1108
1122
  env_session_id
1109
1123
  };
@@ -0,0 +1,28 @@
1
+ import { createRequire as __acCreateRequire } from 'node:module'; const require = globalThis.require ?? __acCreateRequire(import.meta.url);
2
+
3
+ // src/agent-src/scripts/_cli_entry.ts
4
+ import * as fs from "node:fs";
5
+ import * as path from "node:path";
6
+ import { fileURLToPath, pathToFileURL } from "node:url";
7
+ function isCliEntry(moduleUrl, name) {
8
+ const argv1 = process.argv[1];
9
+ if (argv1 === void 0) {
10
+ return false;
11
+ }
12
+ if (path.basename(argv1, ".js") === name) {
13
+ return true;
14
+ }
15
+ const argvPath = path.resolve(argv1);
16
+ if (moduleUrl === pathToFileURL(argvPath).href) {
17
+ return true;
18
+ }
19
+ try {
20
+ return fs.realpathSync(fileURLToPath(moduleUrl)) === fs.realpathSync(argvPath);
21
+ } catch {
22
+ return false;
23
+ }
24
+ }
25
+
26
+ export {
27
+ isCliEntry
28
+ };
@@ -0,0 +1,96 @@
1
+ import { createRequire as __acCreateRequire } from 'node:module'; const require = globalThis.require ?? __acCreateRequire(import.meta.url);
2
+
3
+ // src/agent-src/scripts/dashboard_mode.ts
4
+ import { spawnSync } from "node:child_process";
5
+ import * as fs from "node:fs";
6
+ function isTrackedInGit(abs, repo_root) {
7
+ const r = spawnSync("git", ["ls-files", "--error-unmatch", "--", abs], {
8
+ cwd: repo_root,
9
+ encoding: "utf-8",
10
+ timeout: 1e4
11
+ });
12
+ return r.status === 0;
13
+ }
14
+ var REGEN = "Run `./scripts-run src/agent-src/scripts/update_roadmap_progress` to regenerate (or `task roadmap-progress` in Taskfile projects).";
15
+ function evaluateDashboardState(inp) {
16
+ const { mode, present, trackedInGit, current, rel } = inp;
17
+ const regen = inp.regen ?? REGEN;
18
+ const noun = inp.noun ?? "dashboard";
19
+ if (mode === "untracked" && trackedInGit) {
20
+ return {
21
+ stale: true,
22
+ error: `\u274C ${rel} is still tracked by git, but this repository runs \`--untracked-mode\`. Untrack it, keeping the working-tree file:
23
+ git rm --cached ${rel}
24
+ `,
25
+ ok: null
26
+ };
27
+ }
28
+ if (!present) {
29
+ if (mode === "tracked") {
30
+ return {
31
+ stale: true,
32
+ error: `\u274C ${rel} is missing. ` + regen.replace("to regenerate", "to generate it") + ` If this repository deliberately does not commit the ${noun}, pass \`--untracked-mode\`.
33
+ `,
34
+ ok: null
35
+ };
36
+ }
37
+ return {
38
+ stale: false,
39
+ error: null,
40
+ ok: `\u2705 ${rel} is not committed here (--untracked-mode) and no stale copy is on disk.
41
+ `
42
+ };
43
+ }
44
+ if (!current) {
45
+ return { stale: true, error: `\u274C ${rel} is stale. ${regen}
46
+ `, ok: null };
47
+ }
48
+ return { stale: false, error: null, ok: `\u2705 ${rel} is up to date.
49
+ ` };
50
+ }
51
+ function evaluateDashboardOnDisk(opts) {
52
+ const present = fs.existsSync(opts.target);
53
+ return evaluateDashboardState({
54
+ mode: opts.mode,
55
+ present,
56
+ trackedInGit: opts.mode === "untracked" && isTrackedInGit(opts.target, opts.repo_root),
57
+ current: present && fs.readFileSync(opts.target, { encoding: "utf-8" }) === opts.rendered,
58
+ rel: opts.rel,
59
+ ...opts.regen === void 0 ? {} : { regen: opts.regen },
60
+ ...opts.noun === void 0 ? {} : { noun: opts.noun }
61
+ });
62
+ }
63
+ function reportCheckVerdict(inp) {
64
+ const { verdict, dashboardOnly } = inp;
65
+ const complete = dashboardOnly ? [] : inp.complete;
66
+ const pending = dashboardOnly ? [] : inp.pending;
67
+ let err = verdict.error ?? "";
68
+ if (complete.length) {
69
+ err += "\u274C Completed roadmaps are still in `agents/roadmaps/` \u2014 move them to `agents/roadmaps/archive/` (per the `roadmap-progress-sync` rule):\n";
70
+ for (const r of complete) err += ` - ${r.rel} (${r.done}/${r.total_active} done)
71
+ `;
72
+ }
73
+ if (pending.length) {
74
+ err += "\u274C Iron Law 3 \u2014 roadmaps with unresolved `[~]` deferred items must NOT auto-archive. Resolve via `roadmap-management \xA7 4b` (spawn follow-up, restore, or cancel):\n";
75
+ for (const r of pending) {
76
+ err += ` - ${r.rel} (${r.done}/${r.total_active} done \xB7 ${r.deferred} deferred)
77
+ `;
78
+ }
79
+ }
80
+ if (!dashboardOnly && inp.gatedCount > 0) inp.warnMergeGated();
81
+ const rc = verdict.stale || complete.length > 0 || pending.length > 0 ? 1 : 0;
82
+ return { rc, stdout: rc === 0 ? verdict.ok ?? "" : "", stderr: err };
83
+ }
84
+ function parseModeToken(tok) {
85
+ if (tok === "--tracked-mode") return "tracked";
86
+ if (tok === "--untracked-mode") return "untracked";
87
+ return null;
88
+ }
89
+
90
+ export {
91
+ isTrackedInGit,
92
+ evaluateDashboardState,
93
+ evaluateDashboardOnDisk,
94
+ reportCheckVerdict,
95
+ parseModeToken
96
+ };
@@ -0,0 +1,155 @@
1
+ import { createRequire as __acCreateRequire } from 'node:module'; const require = globalThis.require ?? __acCreateRequire(import.meta.url);
2
+
3
+ // src/agent-src/scripts/gate_budget.ts
4
+ import * as fs from "node:fs";
5
+ import * as path from "node:path";
6
+ var GATE_BUDGET_LEDGER_REL = path.join(
7
+ "agents",
8
+ "runtime",
9
+ "state",
10
+ "gate-budget-ledger.jsonl"
11
+ );
12
+ function gateBudgetLedgerPath(workspaceRoot) {
13
+ return path.join(workspaceRoot, GATE_BUDGET_LEDGER_REL);
14
+ }
15
+ var ROLLING_WINDOW_DAYS = 7;
16
+ function _num(value) {
17
+ if (typeof value === "number" && Number.isFinite(value)) {
18
+ return value;
19
+ }
20
+ return null;
21
+ }
22
+ function _dig(settings, keys) {
23
+ let cursor = settings;
24
+ for (const k of keys) {
25
+ if (cursor === null || typeof cursor !== "object" || Array.isArray(cursor)) {
26
+ return void 0;
27
+ }
28
+ cursor = cursor[k];
29
+ }
30
+ return cursor;
31
+ }
32
+ function readGateBudgetCaps(settings) {
33
+ const perRun = _num(_dig(settings, ["roadmap", "gate_budget", "max_cost_per_run_usd"]));
34
+ const rolling = _num(
35
+ _dig(settings, ["roadmap", "gate_budget", "max_cost_per_rolling_7d_usd"])
36
+ );
37
+ if (perRun === null || rolling === null) {
38
+ return null;
39
+ }
40
+ return { maxCostPerRunUsd: perRun, maxCostPerRolling7dUsd: rolling };
41
+ }
42
+ function parseBudgetUsd(field) {
43
+ const text = field.trim();
44
+ if (text === "") {
45
+ return null;
46
+ }
47
+ const dollar = /\$\s*([0-9]+(?:[.,][0-9]+)?)/.exec(text);
48
+ if (dollar) {
49
+ return Number.parseFloat(dollar[1].replace(",", "."));
50
+ }
51
+ const usd = /([0-9]+(?:[.,][0-9]+)?)\s*(?:usd|dollars?)\b/i.exec(text);
52
+ if (usd) {
53
+ return Number.parseFloat(usd[1].replace(",", "."));
54
+ }
55
+ return null;
56
+ }
57
+ function readGateBudgetLedger(workspaceRoot) {
58
+ const file = gateBudgetLedgerPath(workspaceRoot);
59
+ if (!fs.existsSync(file)) {
60
+ return [];
61
+ }
62
+ const out = [];
63
+ for (const line of fs.readFileSync(file, "utf-8").split("\n")) {
64
+ const trimmed = line.trim();
65
+ if (trimmed === "") {
66
+ continue;
67
+ }
68
+ let parsed;
69
+ try {
70
+ parsed = JSON.parse(trimmed);
71
+ } catch {
72
+ continue;
73
+ }
74
+ if (parsed === null || typeof parsed !== "object") {
75
+ continue;
76
+ }
77
+ const rec = parsed;
78
+ if (rec["kind"] !== "consumption" || typeof rec["blocker"] !== "string") {
79
+ continue;
80
+ }
81
+ out.push({
82
+ kind: "consumption",
83
+ blocker: rec["blocker"],
84
+ authorization: "confirm-flag",
85
+ estimated_usd: _num(rec["estimated_usd"]) ?? 0,
86
+ actual_usd: _num(rec["actual_usd"]),
87
+ at: typeof rec["at"] === "string" ? rec["at"] : "",
88
+ single_use: true
89
+ });
90
+ }
91
+ return out;
92
+ }
93
+ function appendGateBudgetReceipt(workspaceRoot, receipt) {
94
+ const file = gateBudgetLedgerPath(workspaceRoot);
95
+ fs.mkdirSync(path.dirname(file), { recursive: true });
96
+ fs.appendFileSync(file, `${JSON.stringify(receipt)}
97
+ `, "utf-8");
98
+ }
99
+ function rollingSpendUsd(records, now) {
100
+ const cutoff = now.getTime() - ROLLING_WINDOW_DAYS * 24 * 60 * 60 * 1e3;
101
+ let total = 0;
102
+ for (const r of records) {
103
+ const stamp = Date.parse(r.at);
104
+ if (Number.isFinite(stamp) && stamp < cutoff) {
105
+ continue;
106
+ }
107
+ total += r.actual_usd ?? r.estimated_usd;
108
+ }
109
+ return total;
110
+ }
111
+ function evaluateGateBudget(opts) {
112
+ const { caps, records, estimateUsd, now } = opts;
113
+ if (caps === null) {
114
+ return {
115
+ ok: false,
116
+ reason: "no_caps",
117
+ detail: "no standing class-1 budget is configured (`roadmap.gate_budget.max_cost_per_run_usd` and `roadmap.gate_budget.max_cost_per_rolling_7d_usd`)"
118
+ };
119
+ }
120
+ if (estimateUsd === null) {
121
+ return {
122
+ ok: false,
123
+ reason: "no_estimate",
124
+ detail: "the entry states no USD estimate in its **Budget:** field, so no cap can be compared against it"
125
+ };
126
+ }
127
+ if (estimateUsd > caps.maxCostPerRunUsd) {
128
+ return {
129
+ ok: false,
130
+ reason: "over_per_run",
131
+ detail: `the estimate ($${estimateUsd.toFixed(2)}) exceeds the per-run cap ($${caps.maxCostPerRunUsd.toFixed(2)})`
132
+ };
133
+ }
134
+ const spent = rollingSpendUsd(records, now);
135
+ if (spent + estimateUsd > caps.maxCostPerRolling7dUsd) {
136
+ return {
137
+ ok: false,
138
+ reason: "over_rolling_7d",
139
+ detail: `$${spent.toFixed(2)} is already receipted in the last ${String(ROLLING_WINDOW_DAYS)} days and this run would add $${estimateUsd.toFixed(2)}, over the rolling cap ($${caps.maxCostPerRolling7dUsd.toFixed(2)})`
140
+ };
141
+ }
142
+ return { ok: true, estimateUsd, rollingUsd: spent };
143
+ }
144
+
145
+ export {
146
+ GATE_BUDGET_LEDGER_REL,
147
+ gateBudgetLedgerPath,
148
+ ROLLING_WINDOW_DAYS,
149
+ readGateBudgetCaps,
150
+ parseBudgetUsd,
151
+ readGateBudgetLedger,
152
+ appendGateBudgetReceipt,
153
+ rollingSpendUsd,
154
+ evaluateGateBudget
155
+ };
@@ -4063,7 +4063,8 @@ var confidenceBand = external_exports.enum(["off", "low", "medium", "high"]);
4063
4063
  var onBlock = external_exports.enum(["stop", "ask", "warn"]);
4064
4064
  var onBlockFallback = external_exports.enum(["stop", "warn"]);
4065
4065
  var modelAutoSwitch = external_exports.enum(["auto", "suggest", "off"]);
4066
- var leanProjectionMode = external_exports.enum(["eager-all", "thin"]);
4066
+ var leanProjectionMode = external_exports.enum(["eager-all", "thin", "delivery"]);
4067
+ var leanProjectionHost = external_exports.enum(["claude-code", "cursor", "cline"]);
4067
4068
  var projectionMode = external_exports.enum(["legacy-all", "scoped"]);
4068
4069
  var memoryCadence = external_exports.enum(["auto", "always", "never"]);
4069
4070
  var projectAudience = external_exports.enum(["self", "internal", "client", "public"]);
@@ -4095,9 +4096,12 @@ var settingsSchema = external_exports.object({
4095
4096
  ),
4096
4097
  lean_projection: external_exports.object({
4097
4098
  mode: leanProjectionMode.default("eager-all").describe(
4098
- "How the per-tool projector emits the rule layer. eager-all = every rule body inlined into every projection (default, safe). thin = kernel rules full-bodied + non-kernel rules as router-resolved pointers (~45k GPT-tok lighter per session). EXPERIMENTAL: validate with the live A/B before flipping; one-flip revert to eager-all."
4099
+ "How the per-tool projector emits the rule layer. eager-all = every rule body inlined into every projection (safe; what an ABSENT key still resolves to, per ADR-267 decision point 4). thin = kernel rules full-bodied + non-kernel rules as router-resolved pointers (~45k GPT-tok lighter per session), with no delivery mechanism. delivery = thin stubs PLUS the rule-inject hook concern, which delivers a body back on a trigger match; this is the value the SHIPPED TEMPLATE carries for Claude Code since ADR-267, and the activation charge for it is paid in src/config/hook-token-budget.json (user_prompt_submit slot sum 4,096 -> 16,384)."
4100
+ ),
4101
+ hosts: external_exports.array(leanProjectionHost).default(["claude-code"]).describe(
4102
+ "Which hosts a thinning mode may thin (ADR-267). Absent resolves to [claude-code]. Only the three hosts with a per-rule rule tree are accepted, and this enum is the AUTHORING layer: an id outside it is a hard validation FAILURE here and under validate_agent_settings, never a warning. resolveLeanProjectionHosts is the READ-TIME backstop for a hand-edited .agent-settings.yml that passed neither, and THERE the id is dropped with a warning (R2 finding 6 \u2014 the two layers answer differently and neither said so). Every host outside this list receives exactly what eager-all writes, asserted byte-for-byte by check_host_tree_parity."
4099
4103
  )
4100
- }).default({ mode: "eager-all" }),
4104
+ }).default({ mode: "eager-all", hosts: ["claude-code"] }),
4101
4105
  cost: external_exports.object({
4102
4106
  budgets: external_exports.object({
4103
4107
  daily: external_exports.number().min(0).default(0).describe(
@@ -4462,6 +4466,14 @@ var settingsSchema = external_exports.object({
4462
4466
  )
4463
4467
  })
4464
4468
  }),
4469
+ continuity: external_exports.object({
4470
+ auto_record: external_exports.enum(["on", "off"]).default("off").describe(
4471
+ "Deterministic continuity-record writer at session end (road-to-continuity-writer-activation Phase 1). on = the session-eol concern writes the continuity_record capsule variant on Stop for a substantive session that has claimed a roadmap; every field is computed from on-disk state, with no model spend and no subprocess. off (default) = no automatic record \u2014 while session:recycle is still the normal path, a second producer on it before the parity evidence is in would be unverified."
4472
+ ),
4473
+ run_checkpoints: external_exports.enum(["on", "off"]).default("on").describe(
4474
+ "Deterministic run-checkpoint production at session end (road-to-continuity-writer-activation Phase 1.4). on (default) = a session above the recycle threshold and inside a running roadmap contract leaves agents/runtime/state/checkpoints/<run>.json, so a killed run resumes from a derived checkpoint rather than from bookkeeping. off = no checkpoint; continuity writing, the recycle advisory and the context-fill surface are unaffected. Default ON because it is the behaviour the tree already had \u2014 the switch exists to make the three session-end handlers independently disableable, not to change what ships."
4475
+ )
4476
+ }),
4465
4477
  memory: external_exports.object({
4466
4478
  cadence: memoryCadence.default("always").describe(
4467
4479
  "Cadence of the \u{1F9E0} memory-visibility line after a memory-consulting step. always (default) = show whenever a memory type was asked; auto = show only when 3+ types were consulted (less noise); never = suppress. Distinct from rule_loading_tier \u2014 owns its own key since the 2026-06-01 untangle."
@@ -0,0 +1,20 @@
1
+ import { createRequire as __acCreateRequire } from 'node:module'; const require = globalThis.require ?? __acCreateRequire(import.meta.url);
2
+ var __getOwnPropNames = Object.getOwnPropertyNames;
3
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
4
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
5
+ }) : x)(function(x) {
6
+ if (typeof require !== "undefined") return require.apply(this, arguments);
7
+ throw Error('Dynamic require of "' + x + '" is not supported');
8
+ });
9
+ var __commonJS = (cb, mod) => function __require2() {
10
+ try {
11
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
12
+ } catch (e) {
13
+ throw mod = 0, e;
14
+ }
15
+ };
16
+
17
+ export {
18
+ __require,
19
+ __commonJS
20
+ };
@@ -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-4FS4WRXP.js";
5
+ } from "./chunk-IAI3XL43.js";
6
6
  import {
7
7
  main
8
8
  } from "./chunk-6RJA2F5A.js";
@@ -748,6 +748,12 @@ function format_drift_report(entries) {
748
748
  // src/scripts/_lib/skill_catalogue.ts
749
749
  import * as fs4 from "node:fs";
750
750
  import * as path4 from "node:path";
751
+ var PROJECT_CATALOGUE_ROOTS = ["src/skills", ".claude/skills"];
752
+ var HOST_CATALOGUE_ROOT = ".claude/skills";
753
+ var DEFAULT_CATALOGUE_ROOTS = [
754
+ ...PROJECT_CATALOGUE_ROOTS,
755
+ `~/${HOST_CATALOGUE_ROOT}`
756
+ ];
751
757
  var OBSERVATION_LOG = path4.join(
752
758
  "agents",
753
759
  "evidence",