@event4u/agent-config 14.21.0 → 14.22.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 (181) 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 +198 -0
  5. package/CREDITS.md +37 -0
  6. package/dist/agent-src/commands/analyze/inbox.md +380 -5
  7. package/dist/agent-src/commands/analyze/repo.md +4 -2
  8. package/dist/agent-src/contexts/communication/rules-auto/token-efficiency-mechanics.md +69 -0
  9. package/dist/agent-src/contexts/execution/auto-dispatch-classification.md +5 -5
  10. package/dist/agent-src/rules/external-code-graph-interop.md +19 -14
  11. package/dist/agent-src/rules/token-efficiency.md +26 -3
  12. package/dist/agent-src/scripts/_cli_entry.ts +51 -0
  13. package/dist/agent-src/scripts/archive_completed_roadmaps.ts +14 -23
  14. package/dist/agent-src/scripts/roadmap_gates.ts +4 -20
  15. package/dist/agent-src/scripts/roadmap_set_step.ts +5 -2
  16. package/dist/agent-src/scripts/stubs_due.ts +4 -18
  17. package/dist/agent-src/scripts/update_roadmap_progress.ts +7 -24
  18. package/dist/agent-src/skills/code-intelligence/SKILL.md +25 -0
  19. package/dist/agent-src/skills/roadmap-writing/SKILL.md +17 -0
  20. package/dist/agent-src/templates/agent-settings.md +0 -1
  21. package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
  22. package/dist/cli-delegate/_cli_entry.js +8 -0
  23. package/dist/cli-delegate/_lib/pin_resolver.js +170 -0
  24. package/dist/cli-delegate/archival_sweep.js +8 -0
  25. package/dist/cli-delegate/archive_completed_roadmaps.js +494 -0
  26. package/dist/cli-delegate/check_update_banner.js +923 -0
  27. package/dist/cli-delegate/chunk-5EK5WQN6.js +28 -0
  28. package/dist/cli-delegate/chunk-7XGD2OEU.js +96 -0
  29. package/dist/cli-delegate/{chunk-643Z7FIC.js → chunk-BIXEDQPZ.js} +6 -0
  30. package/dist/cli-delegate/chunk-DBH4AHDK.js +155 -0
  31. package/dist/cli-delegate/chunk-JO25G5H7.js +20 -0
  32. package/dist/cli-delegate/chunk-LTYVIY76.js +7961 -0
  33. package/dist/cli-delegate/chunk-QAJS5YWY.js +999 -0
  34. package/dist/cli-delegate/{chunk-ZVBOHSVF.js → chunk-TGIPZBCW.js} +1 -1
  35. package/dist/cli-delegate/{chunk-YS6XTLEK.js → chunk-TYSY33MD.js} +56 -6
  36. package/dist/cli-delegate/chunk-ULET4BYS.js +328 -0
  37. package/dist/cli-delegate/chunk-YDQSHTD7.js +187 -0
  38. package/dist/cli-delegate/chunk-YWVXLR44.js +48 -0
  39. package/dist/cli-delegate/chunk-ZZQBUHFK.js +273 -0
  40. package/dist/cli-delegate/cmd_conformance.js +2 -2
  41. package/dist/cli-delegate/cmd_export.js +1 -1
  42. package/dist/cli-delegate/cmd_handoff.js +26 -2
  43. package/dist/cli-delegate/cmd_prune.js +1 -1
  44. package/dist/cli-delegate/cmd_session_recycle.js +2 -2
  45. package/dist/cli-delegate/cmd_settings_migrate.js +1 -1
  46. package/dist/cli-delegate/cmd_sync.js +1 -1
  47. package/dist/cli-delegate/cmd_uninstall.js +1 -1
  48. package/dist/cli-delegate/cmd_validate.js +1 -1
  49. package/dist/cli-delegate/dashboard_mode.js +16 -0
  50. package/dist/cli-delegate/gate_budget.js +24 -0
  51. package/dist/cli-delegate/gate_execute.js +25 -0
  52. package/dist/cli-delegate/guarded_baseline.js +18 -0
  53. package/dist/cli-delegate/resume_probe.js +22 -0
  54. package/dist/cli-delegate/roadmap_gates.js +638 -0
  55. package/dist/cli-delegate/roadmap_set_step.js +173 -0
  56. package/dist/cli-delegate/stub_queue.js +47 -0
  57. package/dist/cli-delegate/stubs_due.js +38 -0
  58. package/dist/cli-delegate/ticket_bundles.js +59 -0
  59. package/dist/cli-delegate/update_roadmap_progress.js +60 -0
  60. package/dist/discovery/deprecation-report.md +1 -1
  61. package/dist/discovery/discovery-manifest.json +8 -8
  62. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  63. package/dist/discovery/discovery-manifest.summary.md +1 -1
  64. package/dist/discovery/dormancy-report.md +1 -1
  65. package/dist/discovery/orphan-report.md +1 -1
  66. package/dist/discovery/packs.json +2 -2
  67. package/dist/discovery/trust-report.md +1 -1
  68. package/dist/discovery/workspaces.json +2 -2
  69. package/dist/hooks/dispatch.js +1193 -917
  70. package/dist/install/claudeLayerCarriage.js +237 -0
  71. package/dist/install/claudePathsPlan.js +79 -0
  72. package/dist/install/hostLayerFingerprint.js +1 -1
  73. package/dist/install/install.mjs +6 -0
  74. package/dist/install/partitionEligibility.js +231 -117
  75. package/dist/install/ruleLayerPartition.js +10 -7
  76. package/dist/mcp/registry-manifest.json +2 -2
  77. package/dist/mcp/server.json +2 -2
  78. package/dist/mcp/server.mjs +39219 -38995
  79. package/dist/scripts/condense.js +32 -25
  80. package/docs/MIGRATION.md +49 -1
  81. package/docs/contracts/settings-classes.md +1 -1
  82. package/docs/guidelines/agent-infra/minimal-safe-diff-mechanics.md +73 -0
  83. package/package.json +7 -4
  84. package/src/agent-src/scripts/_cli_entry.ts +51 -0
  85. package/src/agent-src/scripts/archive_completed_roadmaps.ts +14 -23
  86. package/src/agent-src/scripts/roadmap_gates.ts +4 -20
  87. package/src/agent-src/scripts/roadmap_set_step.ts +5 -2
  88. package/src/agent-src/scripts/stubs_due.ts +4 -18
  89. package/src/agent-src/scripts/update_roadmap_progress.ts +7 -24
  90. package/src/config/continuity-surface.json +509 -0
  91. package/src/config/estate-count-budget.json +1 -1
  92. package/src/config/gate-coverage.yml +29 -8
  93. package/src/config/gate-violation-baselines.json +8 -8
  94. package/src/config/gitignore-block.txt +19 -0
  95. package/src/config/host-injection-effect.json +73 -0
  96. package/src/config/packed-binary-manifest.json +33 -0
  97. package/src/config/preamble-payload-budget.json +112 -105
  98. package/src/config/publish-surface.json +4 -2
  99. package/src/install/claudeLayerCarriage.ts +273 -0
  100. package/src/install/claudePathsPlan.ts +76 -0
  101. package/src/install/hostLayerFingerprint.ts +1 -1
  102. package/src/install/partitionEligibility.ts +261 -127
  103. package/src/install/ruleLayerPartition.ts +19 -23
  104. package/src/scripts/_dispatch.bash +77 -27
  105. package/src/scripts/_lib/auto_dispatch.ts +2 -2
  106. package/src/scripts/_lib/catalogue_layer_parity.ts +146 -0
  107. package/src/scripts/_lib/continuity_surface.ts +296 -0
  108. package/src/scripts/_lib/corpus_manifest.ts +26 -9
  109. package/src/scripts/_lib/hook_settings.ts +1 -1
  110. package/src/scripts/_lib/injection_effect.ts +151 -0
  111. package/src/scripts/_lib/layer_overlap_notice.ts +50 -6
  112. package/src/scripts/_lib/packed_binary_predicate.ts +225 -0
  113. package/src/scripts/_lib/pin_resolver.ts +13 -0
  114. package/src/scripts/_lib/regression_neighbourhood.ts +1 -1
  115. package/src/scripts/_lib/retired_status.ts +74 -0
  116. package/src/scripts/_lib/skill_catalogue.ts +156 -21
  117. package/src/scripts/_lib/subagent_capsule.ts +117 -8
  118. package/src/scripts/ai_council/api_transport.ts +5 -0
  119. package/src/scripts/ai_council/deliberation_metrics.ts +353 -0
  120. package/src/scripts/ai_council/prompts.ts +9 -0
  121. package/src/scripts/ai_council/synthesis_disagreement.ts +206 -0
  122. package/src/scripts/capture_skill_catalogue.ts +24 -11
  123. package/src/scripts/check_candidate_lines.ts +499 -0
  124. package/src/scripts/check_continuity_surface.ts +475 -0
  125. package/src/scripts/check_dependency_floors.ts +13 -6
  126. package/src/scripts/check_estate_count.ts +40 -79
  127. package/src/scripts/check_pack_size.ts +262 -23
  128. package/src/scripts/check_roadmap_trackable.ts +19 -16
  129. package/src/scripts/check_rule_layer_partition.ts +54 -34
  130. package/src/scripts/check_single_delivery.ts +97 -31
  131. package/src/scripts/check_update_banner.ts +13 -0
  132. package/src/scripts/code_graph/build.ts +138 -15
  133. package/src/scripts/code_graph/cli.ts +76 -8
  134. package/src/scripts/code_graph/extract.ts +11 -0
  135. package/src/scripts/code_graph/grammar_probe.ts +43 -0
  136. package/src/scripts/code_graph/loader.ts +88 -14
  137. package/src/scripts/code_graph/query.ts +121 -11
  138. package/src/scripts/code_graph/resolution_tiers.ts +238 -0
  139. package/src/scripts/code_graph/sqlite_store.ts +247 -6
  140. package/src/scripts/code_graph/types.ts +66 -1
  141. package/src/scripts/code_graph/validate.ts +23 -0
  142. package/src/scripts/condense.ts +34 -22
  143. package/src/scripts/corpus_manifest.ts +5 -5
  144. package/src/scripts/council_cli.ts +11 -12
  145. package/src/scripts/count_intent_disagreement.ts +426 -0
  146. package/src/scripts/handoff_context_hook.ts +79 -0
  147. package/src/scripts/hook_effect_doctor.ts +82 -1
  148. package/src/scripts/hook_manifest.json +1 -1
  149. package/src/scripts/hook_manifest.yaml +64 -12
  150. package/src/scripts/hooks/chain_nudge_hook.ts +282 -0
  151. package/src/scripts/hooks/code_graph_context_hook.ts +212 -0
  152. package/src/scripts/hooks/concern_registry.ts +4 -2
  153. package/src/scripts/hooks/host_semantics.ts +1 -1
  154. package/src/scripts/hooks/orchestration_record_hook.ts +2 -2
  155. package/src/scripts/hooks/rule_inject_hook.ts +1 -1
  156. package/src/scripts/hooks/skill_route_hook.ts +11 -4
  157. package/src/scripts/inbox_source_census.ts +322 -0
  158. package/src/scripts/install-hooks.sh +82 -0
  159. package/src/scripts/{lint_carrier_integrity.ts → lint_deferral_integrity.ts} +60 -214
  160. package/src/scripts/lint_plan_risk_register.ts +13 -17
  161. package/src/scripts/mcp_server/suggest_skill.ts +72 -0
  162. package/src/scripts/mcp_server/tools.ts +2 -56
  163. package/src/scripts/media/lib/adapter-contract.md +7 -2
  164. package/src/scripts/media/lib/fixtures/flux/asset-0001.png +0 -0
  165. package/src/scripts/media/lib/fixtures/gemini-image/asset-0001.png +0 -0
  166. package/src/scripts/media/lib/fixtures/ideogram/asset-0001.png +0 -0
  167. package/src/scripts/rdp_candidates_delta.ts +276 -0
  168. package/src/scripts/rdp_quality_eval.ts +217 -19
  169. package/src/scripts/release_mix_taxonomy.json +3 -2
  170. package/src/scripts/report_host_injection_effect.ts +189 -0
  171. package/src/scripts/report_layer_overlap.ts +41 -0
  172. package/src/scripts/report_skill_menu_census.ts +341 -0
  173. package/src/scripts/skill_tools/score_skill_relevance.ts +70 -6
  174. package/src/scripts/skill_tools/suggest_skill_for_task.ts +37 -3
  175. package/src/vendor/grammars/README.md +61 -0
  176. package/src/vendor/grammars/tree-sitter-javascript.wasm +0 -0
  177. package/src/vendor/grammars/tree-sitter-php.wasm +0 -0
  178. package/src/vendor/grammars/tree-sitter-typescript.wasm +0 -0
  179. package/src/scripts/_lib/carrier_status.ts +0 -118
  180. package/src/scripts/_lib/estate_carrier_cases.ts +0 -72
  181. 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,7 +9,7 @@ import {
9
9
  KIRO_MARKER,
10
10
  ROOCODE_MARKER,
11
11
  ZED_MARKER
12
- } from "./chunk-643Z7FIC.js";
12
+ } from "./chunk-BIXEDQPZ.js";
13
13
  import "./chunk-4FS4WRXP.js";
14
14
  import "./chunk-6RJA2F5A.js";
15
15
  import "./chunk-WOKWX5PL.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-TGIPZBCW.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";
@@ -359,6 +359,23 @@ function consume_recycle_envelope(root, now = /* @__PURE__ */ new Date(), sessio
359
359
  warnings.length > 0 ? `recycle envelope consumed (${warnings.length} directive warning(s) surfaced)` : "recycle envelope consumed"
360
360
  );
361
361
  }
362
+ var INJECTING_SOURCES = /* @__PURE__ */ new Set(["", "startup", "clear", "compact"]);
363
+ function sourceGate(source) {
364
+ const s = source.trim();
365
+ if (INJECTING_SOURCES.has(s)) {
366
+ return { inject: true, reason: `source=${s === "" ? "absent" : s}` };
367
+ }
368
+ if (s === "resume" || s === "fork") {
369
+ return {
370
+ inject: false,
371
+ 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")
372
+ };
373
+ }
374
+ return {
375
+ inject: false,
376
+ reason: `source=${s} is not a source this reader knows \u2014 injecting nothing rather than guessing`
377
+ };
378
+ }
362
379
  function main() {
363
380
  let envelope = {};
364
381
  try {
@@ -378,6 +395,13 @@ function main() {
378
395
  return 0;
379
396
  }
380
397
  if (event === "session_start") {
398
+ const payload = envelope.payload && typeof envelope.payload === "object" && !Array.isArray(envelope.payload) ? envelope.payload : {};
399
+ const gate = sourceGate(String(payload["source"] ?? envelope["source"] ?? ""));
400
+ if (!gate.inject) {
401
+ process2.stderr.write(`handoff-context-hook: no injection (${gate.reason})
402
+ `);
403
+ return 0;
404
+ }
381
405
  const handoff = consume_handoff_context(root);
382
406
  const recycle = consume_recycle_envelope(
383
407
  root,
@@ -1,7 +1,7 @@
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";
4
+ } from "./chunk-BIXEDQPZ.js";
5
5
  import "./chunk-4FS4WRXP.js";
6
6
  import "./chunk-6RJA2F5A.js";
7
7
  import "./chunk-WOKWX5PL.js";
@@ -5,11 +5,11 @@ import {
5
5
  env_session_id,
6
6
  recycle_consumed_rel,
7
7
  recycle_envelope_rel
8
- } from "./chunk-ZVBOHSVF.js";
8
+ } from "./chunk-TGIPZBCW.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
@@ -3,7 +3,7 @@ import {
3
3
  GLOBAL_AGENT_SETTINGS_PATH,
4
4
  GLOBAL_USER_SETTINGS_PATH,
5
5
  SETTINGS_FILE
6
- } from "./chunk-643Z7FIC.js";
6
+ } from "./chunk-BIXEDQPZ.js";
7
7
  import "./chunk-4FS4WRXP.js";
8
8
  import "./chunk-6RJA2F5A.js";
9
9
  import "./chunk-WOKWX5PL.js";
@@ -1,7 +1,7 @@
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";
4
+ } from "./chunk-BIXEDQPZ.js";
5
5
  import "./chunk-4FS4WRXP.js";
6
6
  import "./chunk-6RJA2F5A.js";
7
7
  import "./chunk-WOKWX5PL.js";
@@ -3,7 +3,7 @@ import {
3
3
  PROJECT_BRIDGE_MARKERS,
4
4
  USER_SCOPE_PATHS,
5
5
  subtract_pointers
6
- } from "./chunk-643Z7FIC.js";
6
+ } from "./chunk-BIXEDQPZ.js";
7
7
  import "./chunk-4FS4WRXP.js";
8
8
  import "./chunk-6RJA2F5A.js";
9
9
  import "./chunk-WOKWX5PL.js";
@@ -3,7 +3,7 @@ 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";
6
+ } from "./chunk-BIXEDQPZ.js";
7
7
  import "./chunk-4FS4WRXP.js";
8
8
  import "./chunk-6RJA2F5A.js";
9
9
  import "./chunk-WOKWX5PL.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
+ };