@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
@@ -0,0 +1,273 @@
1
+ import { createRequire as __acCreateRequire } from 'node:module'; const require = globalThis.require ?? __acCreateRequire(import.meta.url);
2
+
3
+ // src/agent-src/scripts/resume_probe.ts
4
+ import * as fs from "node:fs";
5
+ import * as path from "node:path";
6
+ var RESUME_LINE_RE = /\b(blocked until|resume when|blocked-until|resume-when)\b/i;
7
+ var COMPOUND_RE = /\bboth\b|\band\b|\([1-9]\)|\([a-e]\)|`[ \t]*\+|\+[ \t]*`/i;
8
+ var FIELD_LABEL_RE = /\*\*[^*]+:\*\*/;
9
+ var ROADMAP_REF_RE = /\broad-to-[a-z0-9][a-z0-9-]*\b/g;
10
+ var REPO_PATH_RE = /`((?:agents|docs|src|tests|internal|scripts|evals|\.github)\/[A-Za-z0-9._\-/]*[A-Za-z0-9_\-]\.[A-Za-z0-9]{2,5})`/g;
11
+ var STEP_REF_RE = /\b(?:P|Phase[ \t]+)?(\d+\.\d+)\b/;
12
+ function _read(p) {
13
+ try {
14
+ return fs.readFileSync(p, "utf-8");
15
+ } catch {
16
+ return "";
17
+ }
18
+ }
19
+ function _exists(p) {
20
+ try {
21
+ return fs.statSync(p).isFile();
22
+ } catch {
23
+ return false;
24
+ }
25
+ }
26
+ function roadmapDisposition(roadmapRoot, slug) {
27
+ const name = `${slug}.md`;
28
+ if (_exists(path.join(roadmapRoot, name))) {
29
+ return "active";
30
+ }
31
+ for (const dir of ["archive", "later", "skipped"]) {
32
+ if (_exists(path.join(roadmapRoot, dir, name))) {
33
+ return dir;
34
+ }
35
+ }
36
+ return "missing";
37
+ }
38
+ function extractCondition(text) {
39
+ const lines = _blankFencedCode(text).split(/\r?\n/);
40
+ const start = lines.findIndex(
41
+ (l) => _strip(l).startsWith(">") && RESUME_LINE_RE.test(l)
42
+ );
43
+ if (start === -1) {
44
+ return "";
45
+ }
46
+ const parts = [_strip(lines[start])];
47
+ for (let i = start + 1; i < lines.length; i++) {
48
+ const l = _strip(lines[i]);
49
+ if (!l.startsWith(">")) {
50
+ break;
51
+ }
52
+ const body = _strip(l.replace(/^>[ \t]?/, ""));
53
+ if (body === "") {
54
+ break;
55
+ }
56
+ parts.push(body);
57
+ }
58
+ const joined = parts.map((p) => _strip(p.replace(/^>[ \t]?/, ""))).join(" ").trim();
59
+ return _truncateAtNextField(joined);
60
+ }
61
+ function _truncateAtNextField(condition) {
62
+ let cut = condition.length;
63
+ const re = new RegExp(FIELD_LABEL_RE.source, "g");
64
+ let m;
65
+ while ((m = re.exec(condition)) !== null) {
66
+ const label = m[0];
67
+ if (RESUME_LINE_RE.test(label)) {
68
+ continue;
69
+ }
70
+ if (m.index === 0) {
71
+ continue;
72
+ }
73
+ cut = m.index;
74
+ break;
75
+ }
76
+ return _strip(condition.slice(0, cut));
77
+ }
78
+ function _strip(s) {
79
+ return s.replace(/^[ \t\f\v]+|[ \t\f\v\r]+$/g, "");
80
+ }
81
+ function _blankFencedCode(text) {
82
+ return text.replace(
83
+ /^[ \t]*```[^\n]*\n[\s\S]*?^[ \t]*```[ \t]*$/gm,
84
+ (m) => "\n".repeat((m.match(/\n/g) ?? []).length)
85
+ );
86
+ }
87
+ function _sentenceHead(s) {
88
+ const balanced = (s.match(/`/g) ?? []).length % 2 === 0;
89
+ let inCode = false;
90
+ for (let i = 0; i < s.length; i++) {
91
+ const ch = s[i];
92
+ if (ch === "`" && balanced) {
93
+ inCode = !inCode;
94
+ continue;
95
+ }
96
+ if (!inCode && (ch === "." || ch === "\u2014" || ch === "\u2013")) {
97
+ return s.slice(0, i);
98
+ }
99
+ }
100
+ return s;
101
+ }
102
+ function conditionClause(condition) {
103
+ const re = /\*\*([^*]+)\*\*/g;
104
+ let m;
105
+ while ((m = re.exec(condition)) !== null) {
106
+ const span = m[1];
107
+ if (RESUME_LINE_RE.test(span)) {
108
+ const after = condition.slice(m.index + m[0].length);
109
+ return `${span}${_sentenceHead(after)}`;
110
+ }
111
+ }
112
+ return condition;
113
+ }
114
+ var EXISTENCE_PREDICATE_RE = /`(?:agents|docs|src|tests|internal|scripts|evals|\.github)\/[A-Za-z0-9._\-/]+`[ \t]*(?:currently[ \t]+)?exists\b/i;
115
+ function referencedPath(condition) {
116
+ if (!EXISTENCE_PREDICATE_RE.test(condition)) {
117
+ return null;
118
+ }
119
+ const paths = _pathsIn(condition);
120
+ return paths.length === 1 ? paths[0] : null;
121
+ }
122
+ function _pathsIn(condition) {
123
+ REPO_PATH_RE.lastIndex = 0;
124
+ const found = /* @__PURE__ */ new Set();
125
+ let m;
126
+ while ((m = REPO_PATH_RE.exec(condition)) !== null) {
127
+ found.add(m[1]);
128
+ }
129
+ return [...found].sort();
130
+ }
131
+ function referencedRoadmaps(condition, ownSlug) {
132
+ const out = /* @__PURE__ */ new Set();
133
+ ROADMAP_REF_RE.lastIndex = 0;
134
+ let m;
135
+ while ((m = ROADMAP_REF_RE.exec(condition)) !== null) {
136
+ const slug = m[0].replace(/\.md$/, "");
137
+ if (slug !== ownSlug) {
138
+ out.add(slug);
139
+ }
140
+ }
141
+ return [...out].sort();
142
+ }
143
+ function stepIsDone(text, stepId) {
144
+ const escaped = stepId.replace(/\./g, "\\.");
145
+ const re = new RegExp(
146
+ `^[ \\t]*-[ \\t]*\\[([ xX~-])\\][ \\t]*\\*{0,2}(?:P|Phase[ \\t]+)?${escaped}\\b`,
147
+ "m"
148
+ );
149
+ const m = re.exec(text);
150
+ if (!m) {
151
+ return null;
152
+ }
153
+ return m[1].toLowerCase() === "x";
154
+ }
155
+ function probeLater(roadmapRoot, repoRootArg) {
156
+ const repoRoot = repoRootArg ?? path.resolve(roadmapRoot, "..", "..");
157
+ const laterDir = path.join(roadmapRoot, "later");
158
+ let entries;
159
+ try {
160
+ entries = fs.readdirSync(laterDir, { withFileTypes: true }).filter((e) => e.isFile() && e.name.endsWith(".md") && e.name !== "README.md").map((e) => e.name).sort();
161
+ } catch {
162
+ return [];
163
+ }
164
+ const findings = [];
165
+ for (const name of entries) {
166
+ const text = _read(path.join(laterDir, name));
167
+ const ownSlug = name.replace(/\.md$/, "");
168
+ const condition = extractCondition(text);
169
+ if (condition === "") {
170
+ findings.push({
171
+ file: `later/${name}`,
172
+ condition: "",
173
+ refs: [],
174
+ verdict: "undecidable",
175
+ why: "no resume-condition line \u2014 lint_roadmap_later_disposition owns that gap"
176
+ });
177
+ continue;
178
+ }
179
+ const clause = conditionClause(condition);
180
+ if (COMPOUND_RE.test(clause)) {
181
+ findings.push({
182
+ file: `later/${name}`,
183
+ condition,
184
+ refs: referencedRoadmaps(clause, ownSlug),
185
+ verdict: "undecidable",
186
+ why: "compound condition \u2014 the probe reads the roadmap references and not the rest"
187
+ });
188
+ continue;
189
+ }
190
+ const refs = referencedRoadmaps(clause, ownSlug);
191
+ if (refs.length > 0 && _pathsIn(clause).length > 0) {
192
+ findings.push({
193
+ file: `later/${name}`,
194
+ condition,
195
+ refs,
196
+ verdict: "undecidable",
197
+ why: "names a roadmap and a repo path \u2014 a conjunction the probe can only half-weigh"
198
+ });
199
+ continue;
200
+ }
201
+ if (refs.length === 0) {
202
+ const rel = referencedPath(clause);
203
+ if (rel !== null) {
204
+ const there = _exists(path.join(repoRoot, rel));
205
+ findings.push({
206
+ file: `later/${name}`,
207
+ condition,
208
+ refs,
209
+ verdict: there ? "fired" : "unmet",
210
+ why: there ? `${rel} exists` : `${rel} does not exist`
211
+ });
212
+ continue;
213
+ }
214
+ findings.push({
215
+ file: `later/${name}`,
216
+ condition,
217
+ refs,
218
+ verdict: "undecidable",
219
+ why: "the condition names no roadmap or repo path this tree can resolve"
220
+ });
221
+ continue;
222
+ }
223
+ const stepMatch = STEP_REF_RE.exec(clause);
224
+ const stepId = stepMatch ? stepMatch[1] : null;
225
+ const reasons = [];
226
+ let unmet = false;
227
+ let unresolvable = false;
228
+ for (const slug of refs) {
229
+ const where = roadmapDisposition(roadmapRoot, slug);
230
+ if (where === "archive") {
231
+ reasons.push(`${slug} archived`);
232
+ continue;
233
+ }
234
+ if (where === "missing") {
235
+ unresolvable = true;
236
+ reasons.push(`${slug} resolves nowhere`);
237
+ continue;
238
+ }
239
+ if (where === "active" && stepId !== null) {
240
+ const done = stepIsDone(_read(path.join(roadmapRoot, `${slug}.md`)), stepId);
241
+ if (done === true) {
242
+ reasons.push(`${slug} step ${stepId} is ticked`);
243
+ continue;
244
+ }
245
+ reasons.push(done === null ? `${slug} has no step ${stepId}` : `${slug} step ${stepId} still open`);
246
+ unmet = true;
247
+ continue;
248
+ }
249
+ reasons.push(`${slug} still in ${where}`);
250
+ unmet = true;
251
+ }
252
+ const verdict = unmet ? "unmet" : unresolvable ? "undecidable" : "fired";
253
+ findings.push({
254
+ file: `later/${name}`,
255
+ condition,
256
+ refs,
257
+ verdict,
258
+ why: reasons.join("; ")
259
+ });
260
+ }
261
+ return findings;
262
+ }
263
+
264
+ export {
265
+ RESUME_LINE_RE,
266
+ roadmapDisposition,
267
+ extractCondition,
268
+ conditionClause,
269
+ referencedPath,
270
+ referencedRoadmaps,
271
+ stepIsDone,
272
+ probeLater
273
+ };
@@ -10,7 +10,7 @@ import {
10
10
  sessionRefusalFile,
11
11
  statePathFor,
12
12
  validateAssumption
13
- } from "./chunk-YS6XTLEK.js";
13
+ } from "./chunk-TYSY33MD.js";
14
14
  import {
15
15
  readHookStdin
16
16
  } from "./chunk-F7DQWYR5.js";
@@ -3521,7 +3521,7 @@ function classifyLookup(taskText, opts = {}) {
3521
3521
  lookup_class: p.cls,
3522
3522
  route: "primitive",
3523
3523
  primitive,
3524
- reason: primitive === p.primitive ? `lookup-class ${p.cls} \u2014 deterministic primitive, no spawn` : `lookup-class ${p.cls} \u2014 capped grep; the code-graph accelerant is gated on hooks.code_graph.enabled and it is not on`
3524
+ reason: primitive === p.primitive ? `lookup-class ${p.cls} \u2014 deterministic primitive, no spawn` : `lookup-class ${p.cls} \u2014 capped grep; the code-graph accelerant needs a usable graph and the caller passed none`
3525
3525
  };
3526
3526
  }
3527
3527
  }
@@ -9,8 +9,8 @@ import {
9
9
  KIRO_MARKER,
10
10
  ROOCODE_MARKER,
11
11
  ZED_MARKER
12
- } from "./chunk-643Z7FIC.js";
13
- import "./chunk-4FS4WRXP.js";
12
+ } from "./chunk-KCNTUSPI.js";
13
+ import "./chunk-IAI3XL43.js";
14
14
  import "./chunk-6RJA2F5A.js";
15
15
  import "./chunk-WOKWX5PL.js";
16
16
  import "./chunk-523HCFYO.js";
@@ -13,14 +13,14 @@ import {
13
13
  predecessorTracePresent,
14
14
  recycle_consumed_rel,
15
15
  resolveContinuityRecord
16
- } from "./chunk-ZVBOHSVF.js";
16
+ } from "./chunk-2KKXJW25.js";
17
17
  import "./chunk-I6RHFQEG.js";
18
18
  import {
19
19
  hasBoundaryMarker,
20
20
  scanEnvelopeDirectives,
21
21
  validateRecycleEnvelope,
22
22
  wrapAsPriorSessionData
23
- } from "./chunk-YS6XTLEK.js";
23
+ } from "./chunk-TYSY33MD.js";
24
24
  import {
25
25
  readHookStdin
26
26
  } from "./chunk-F7DQWYR5.js";
@@ -340,7 +340,15 @@ function consume_recycle_envelope(root, now = /* @__PURE__ */ new Date(), sessio
340
340
  reason: `recycle envelope names predecessor "${predecessor}", which has no trace in this workspace`
341
341
  };
342
342
  }
343
- const drift = describeDrift(envelope, collectRepoAnchor(root));
343
+ const anchor = collectRepoAnchor(root);
344
+ const envelopeBranch = String(envelope["branch"] ?? "").trim();
345
+ if (envelopeBranch !== "" && anchor.branch !== null && envelopeBranch !== anchor.branch) {
346
+ return {
347
+ action: "absent",
348
+ reason: `recycle envelope is for branch "${envelopeBranch}" and this tree is on "${anchor.branch}" \u2014 left unclaimed for a session on that branch rather than consumed`
349
+ };
350
+ }
351
+ const drift = describeDrift(envelope, anchor);
344
352
  const warnings = scanEnvelopeDirectives(envelope);
345
353
  const focus = (process2.env.AGENT_RESUME_FOCUS ?? "").trim();
346
354
  const block = wrapAsPriorSessionData(JSON.stringify(envelope, null, 2), {
@@ -359,6 +367,23 @@ function consume_recycle_envelope(root, now = /* @__PURE__ */ new Date(), sessio
359
367
  warnings.length > 0 ? `recycle envelope consumed (${warnings.length} directive warning(s) surfaced)` : "recycle envelope consumed"
360
368
  );
361
369
  }
370
+ var INJECTING_SOURCES = /* @__PURE__ */ new Set(["", "startup", "clear", "compact"]);
371
+ function sourceGate(source) {
372
+ const s = source.trim();
373
+ if (INJECTING_SOURCES.has(s)) {
374
+ return { inject: true, reason: `source=${s === "" ? "absent" : s}` };
375
+ }
376
+ if (s === "resume" || s === "fork") {
377
+ return {
378
+ inject: false,
379
+ reason: `source=${s} \u2014 the host already restored this conversation; injecting would ` + (s === "fork" ? "consume a record belonging to a session that is still running" : "duplicate context the host just replayed")
380
+ };
381
+ }
382
+ return {
383
+ inject: false,
384
+ reason: `source=${s} is not a source this reader knows \u2014 injecting nothing rather than guessing`
385
+ };
386
+ }
362
387
  function main() {
363
388
  let envelope = {};
364
389
  try {
@@ -378,6 +403,13 @@ function main() {
378
403
  return 0;
379
404
  }
380
405
  if (event === "session_start") {
406
+ const payload = envelope.payload && typeof envelope.payload === "object" && !Array.isArray(envelope.payload) ? envelope.payload : {};
407
+ const gate = sourceGate(String(payload["source"] ?? envelope["source"] ?? ""));
408
+ if (!gate.inject) {
409
+ process2.stderr.write(`handoff-context-hook: no injection (${gate.reason})
410
+ `);
411
+ return 0;
412
+ }
381
413
  const handoff = consume_handoff_context(root);
382
414
  const recycle = consume_recycle_envelope(
383
415
  root,
@@ -768,12 +800,21 @@ function readEolCounters(workspaceRoot, sessionKey) {
768
800
  return null;
769
801
  }
770
802
  }
803
+ var SUBSTANTIVE_TOKEN_FLOOR = 1e4;
804
+ function is_substantive(counters) {
805
+ if (counters === null) return true;
806
+ if (!Number.isFinite(counters.assistant_records)) return true;
807
+ if (counters.assistant_records < 1) return false;
808
+ if (!Number.isFinite(counters.tool_calls)) return true;
809
+ if (counters.tool_calls >= 1) return true;
810
+ if (!Number.isFinite(counters.final_context_tokens)) return true;
811
+ return counters.final_context_tokens >= SUBSTANTIVE_TOKEN_FLOOR;
812
+ }
771
813
 
772
814
  // src/scripts/_cli/handoff_sessions.ts
773
815
  var DEFAULT_CAP = 15;
774
816
  var FETCH_OVERSHOOT = 3;
775
817
  var SUMMARY_SNIPPET_CHARS = 120;
776
- var SUBSTANTIVE_TOKEN_FLOOR = 1e4;
777
818
  function encode_project_path(cwd) {
778
819
  return projectStoreSlug(cwd);
779
820
  }
@@ -1036,15 +1077,6 @@ function _codex_sessions(opts, cap) {
1036
1077
  function _sort_key(s) {
1037
1078
  return s.endedAt ?? s.startedAt ?? "";
1038
1079
  }
1039
- function is_substantive(counters) {
1040
- if (counters === null) return true;
1041
- if (!Number.isFinite(counters.assistant_records)) return true;
1042
- if (counters.assistant_records < 1) return false;
1043
- if (!Number.isFinite(counters.tool_calls)) return true;
1044
- if (counters.tool_calls >= 1) return true;
1045
- if (!Number.isFinite(counters.final_context_tokens)) return true;
1046
- return counters.final_context_tokens >= SUBSTANTIVE_TOKEN_FLOOR;
1047
- }
1048
1080
  function _derive_tag(id) {
1049
1081
  try {
1050
1082
  return derive_session_tag(id);
@@ -1,8 +1,8 @@
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-643Z7FIC.js";
5
- import "./chunk-4FS4WRXP.js";
4
+ } from "./chunk-KCNTUSPI.js";
5
+ import "./chunk-IAI3XL43.js";
6
6
  import "./chunk-6RJA2F5A.js";
7
7
  import "./chunk-WOKWX5PL.js";
8
8
  import "./chunk-523HCFYO.js";
@@ -3,13 +3,13 @@ import {
3
3
  RECYCLE_ENVELOPE_MAX_BYTES,
4
4
  collectGrounding,
5
5
  env_session_id,
6
- recycle_consumed_rel,
7
- recycle_envelope_rel
8
- } from "./chunk-ZVBOHSVF.js";
6
+ recycle_envelope_rel,
7
+ resolvePredecessor
8
+ } from "./chunk-2KKXJW25.js";
9
9
  import {
10
10
  CAPSULE_SCHEMA_VERSION,
11
11
  validateRecycleEnvelope
12
- } from "./chunk-YS6XTLEK.js";
12
+ } from "./chunk-TYSY33MD.js";
13
13
  import "./chunk-F7DQWYR5.js";
14
14
  import {
15
15
  atomic_write_json
@@ -60,16 +60,6 @@ function templateEnvelope() {
60
60
  predecessor: "none"
61
61
  };
62
62
  }
63
- function resolvePredecessor(projectRoot, sessionId) {
64
- try {
65
- const consumed = path.join(projectRoot, recycle_consumed_rel(sessionId));
66
- const raw = JSON.parse(fs.readFileSync(consumed, "utf-8"));
67
- const prior = String(raw.session_id ?? "").trim();
68
- return prior === "" ? "none" : prior;
69
- } catch {
70
- return "none";
71
- }
72
- }
73
63
  function parseArgv(argv) {
74
64
  const parsed = { ok: true };
75
65
  for (let i = 0; i < argv.length; i += 1) {
@@ -3,8 +3,8 @@ import {
3
3
  GLOBAL_AGENT_SETTINGS_PATH,
4
4
  GLOBAL_USER_SETTINGS_PATH,
5
5
  SETTINGS_FILE
6
- } from "./chunk-643Z7FIC.js";
7
- import "./chunk-4FS4WRXP.js";
6
+ } from "./chunk-KCNTUSPI.js";
7
+ import "./chunk-IAI3XL43.js";
8
8
  import "./chunk-6RJA2F5A.js";
9
9
  import "./chunk-WOKWX5PL.js";
10
10
  import "./chunk-523HCFYO.js";
@@ -11,7 +11,7 @@ import {
11
11
  import {
12
12
  external_exports,
13
13
  settingsSchema
14
- } from "./chunk-4FS4WRXP.js";
14
+ } from "./chunk-IAI3XL43.js";
15
15
  import {
16
16
  resolvePackageRoot
17
17
  } from "./chunk-MCJYCQPF.js";
@@ -1,8 +1,8 @@
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-643Z7FIC.js";
5
- import "./chunk-4FS4WRXP.js";
4
+ } from "./chunk-KCNTUSPI.js";
5
+ import "./chunk-IAI3XL43.js";
6
6
  import "./chunk-6RJA2F5A.js";
7
7
  import "./chunk-WOKWX5PL.js";
8
8
  import "./chunk-523HCFYO.js";
@@ -3,8 +3,8 @@ import {
3
3
  PROJECT_BRIDGE_MARKERS,
4
4
  USER_SCOPE_PATHS,
5
5
  subtract_pointers
6
- } from "./chunk-643Z7FIC.js";
7
- import "./chunk-4FS4WRXP.js";
6
+ } from "./chunk-KCNTUSPI.js";
7
+ import "./chunk-IAI3XL43.js";
8
8
  import "./chunk-6RJA2F5A.js";
9
9
  import "./chunk-WOKWX5PL.js";
10
10
  import "./chunk-523HCFYO.js";
@@ -3,8 +3,8 @@ import { createRequire as __acCreateRequire } from 'node:module'; const require
3
3
  import {
4
4
  PROJECT_BRIDGE_MARKERS,
5
5
  USER_SCOPE_PATHS
6
- } from "./chunk-643Z7FIC.js";
7
- import "./chunk-4FS4WRXP.js";
6
+ } from "./chunk-KCNTUSPI.js";
7
+ import "./chunk-IAI3XL43.js";
8
8
  import "./chunk-6RJA2F5A.js";
9
9
  import "./chunk-WOKWX5PL.js";
10
10
  import "./chunk-523HCFYO.js";
@@ -0,0 +1,16 @@
1
+ import { createRequire as __acCreateRequire } from 'node:module'; const require = globalThis.require ?? __acCreateRequire(import.meta.url);
2
+ import {
3
+ evaluateDashboardOnDisk,
4
+ evaluateDashboardState,
5
+ isTrackedInGit,
6
+ parseModeToken,
7
+ reportCheckVerdict
8
+ } from "./chunk-7XGD2OEU.js";
9
+ import "./chunk-JO25G5H7.js";
10
+ export {
11
+ evaluateDashboardOnDisk,
12
+ evaluateDashboardState,
13
+ isTrackedInGit,
14
+ parseModeToken,
15
+ reportCheckVerdict
16
+ };
@@ -0,0 +1,24 @@
1
+ import { createRequire as __acCreateRequire } from 'node:module'; const require = globalThis.require ?? __acCreateRequire(import.meta.url);
2
+ import {
3
+ GATE_BUDGET_LEDGER_REL,
4
+ ROLLING_WINDOW_DAYS,
5
+ appendGateBudgetReceipt,
6
+ evaluateGateBudget,
7
+ gateBudgetLedgerPath,
8
+ parseBudgetUsd,
9
+ readGateBudgetCaps,
10
+ readGateBudgetLedger,
11
+ rollingSpendUsd
12
+ } from "./chunk-DBH4AHDK.js";
13
+ import "./chunk-JO25G5H7.js";
14
+ export {
15
+ GATE_BUDGET_LEDGER_REL,
16
+ ROLLING_WINDOW_DAYS,
17
+ appendGateBudgetReceipt,
18
+ evaluateGateBudget,
19
+ gateBudgetLedgerPath,
20
+ parseBudgetUsd,
21
+ readGateBudgetCaps,
22
+ readGateBudgetLedger,
23
+ rollingSpendUsd
24
+ };
@@ -0,0 +1,25 @@
1
+ import { createRequire as __acCreateRequire } from 'node:module'; const require = globalThis.require ?? __acCreateRequire(import.meta.url);
2
+ import {
3
+ LEDGER_REL,
4
+ appendEvidence,
5
+ commandOf,
6
+ consentLine,
7
+ execute,
8
+ locate
9
+ } from "./chunk-LTYVIY76.js";
10
+ import "./chunk-QAJS5YWY.js";
11
+ import "./chunk-ULET4BYS.js";
12
+ import "./chunk-5EK5WQN6.js";
13
+ import "./chunk-YWVXLR44.js";
14
+ import "./chunk-7XGD2OEU.js";
15
+ import "./chunk-DBH4AHDK.js";
16
+ import "./chunk-YDQSHTD7.js";
17
+ import "./chunk-JO25G5H7.js";
18
+ export {
19
+ LEDGER_REL,
20
+ appendEvidence,
21
+ commandOf,
22
+ consentLine,
23
+ execute,
24
+ locate
25
+ };
@@ -0,0 +1,18 @@
1
+ import { createRequire as __acCreateRequire } from 'node:module'; const require = globalThis.require ?? __acCreateRequire(import.meta.url);
2
+ import {
3
+ GUARDED_BASELINE_RE,
4
+ GUARDED_CATEGORIES,
5
+ guardedBaselineProblems,
6
+ guardedBaselineStaleness,
7
+ parseGuardedBaselines,
8
+ reportGuardedBaselines
9
+ } from "./chunk-YDQSHTD7.js";
10
+ import "./chunk-JO25G5H7.js";
11
+ export {
12
+ GUARDED_BASELINE_RE,
13
+ GUARDED_CATEGORIES,
14
+ guardedBaselineProblems,
15
+ guardedBaselineStaleness,
16
+ parseGuardedBaselines,
17
+ reportGuardedBaselines
18
+ };
@@ -0,0 +1,22 @@
1
+ import { createRequire as __acCreateRequire } from 'node:module'; const require = globalThis.require ?? __acCreateRequire(import.meta.url);
2
+ import {
3
+ RESUME_LINE_RE,
4
+ conditionClause,
5
+ extractCondition,
6
+ probeLater,
7
+ referencedPath,
8
+ referencedRoadmaps,
9
+ roadmapDisposition,
10
+ stepIsDone
11
+ } from "./chunk-ZZQBUHFK.js";
12
+ import "./chunk-JO25G5H7.js";
13
+ export {
14
+ RESUME_LINE_RE,
15
+ conditionClause,
16
+ extractCondition,
17
+ probeLater,
18
+ referencedPath,
19
+ referencedRoadmaps,
20
+ roadmapDisposition,
21
+ stepIsDone
22
+ };