@event4u/agent-config 14.20.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 (242) 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 +441 -0
  5. package/CREDITS.md +37 -0
  6. package/README.md +1 -1
  7. package/agents/templates/.ai-council.yml.example +10 -0
  8. package/dist/agent-src/commands/analyze/inbox.md +381 -6
  9. package/dist/agent-src/commands/analyze/{reference-repo.md → repo.md} +251 -34
  10. package/dist/agent-src/commands/analyze/roadmap-repos.md +129 -0
  11. package/dist/agent-src/commands/analyze.md +12 -7
  12. package/dist/agent-src/commands/feature/plan.md +55 -16
  13. package/dist/agent-src/commands/feature/refactor.md +8 -3
  14. package/dist/agent-src/commands/humanize.md +48 -4
  15. package/dist/agent-src/contexts/communication/rules-auto/token-efficiency-mechanics.md +69 -0
  16. package/dist/agent-src/contexts/execution/auto-dispatch-classification.md +5 -5
  17. package/dist/agent-src/contexts/execution/contract-decision-sheet.md +22 -1
  18. package/dist/agent-src/contexts/execution/host-capability-manifest.md +4 -1
  19. package/dist/agent-src/contexts/execution/roadmap-process-loop.md +35 -2
  20. package/dist/agent-src/contexts/execution/terminal-states.md +4 -1
  21. package/dist/agent-src/rules/evaluator-independence.md +4 -4
  22. package/dist/agent-src/rules/external-code-graph-interop.md +19 -14
  23. package/dist/agent-src/rules/external-reference-deep-dive.md +2 -2
  24. package/dist/agent-src/rules/token-efficiency.md +26 -3
  25. package/dist/agent-src/scripts/_cli_entry.ts +51 -0
  26. package/dist/agent-src/scripts/archive_completed_roadmaps.ts +14 -23
  27. package/dist/agent-src/scripts/roadmap_gates.ts +4 -20
  28. package/dist/agent-src/scripts/roadmap_set_step.ts +5 -2
  29. package/dist/agent-src/scripts/stubs_due.ts +4 -18
  30. package/dist/agent-src/scripts/update_roadmap_progress.ts +7 -24
  31. package/dist/agent-src/skills/code-intelligence/SKILL.md +25 -0
  32. package/dist/agent-src/skills/competitive-positioning/SKILL.md +2 -2
  33. package/dist/agent-src/skills/humanizer/references/anti-aiisms.md +27 -11
  34. package/dist/agent-src/skills/learning-to-rule-or-skill/SKILL.md +1 -1
  35. package/dist/agent-src/skills/markitdown/SKILL.md +1 -1
  36. package/dist/agent-src/skills/repomix-packer/SKILL.md +1 -1
  37. package/dist/agent-src/skills/roadmap-writing/SKILL.md +17 -0
  38. package/dist/agent-src/skills/technical-specification/SKILL.md +4 -0
  39. package/dist/agent-src/templates/agent-settings.md +0 -1
  40. package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
  41. package/dist/agent-src/templates/features.md +5 -0
  42. package/dist/agent-src/templates/roadmaps.md +15 -0
  43. package/dist/cli-delegate/_cli_entry.js +8 -0
  44. package/dist/cli-delegate/_lib/pin_resolver.js +170 -0
  45. package/dist/cli-delegate/archival_sweep.js +8 -0
  46. package/dist/cli-delegate/archive_completed_roadmaps.js +494 -0
  47. package/dist/cli-delegate/check_update_banner.js +923 -0
  48. package/dist/cli-delegate/{chunk-KPBWFOPZ.js → chunk-2FTMENJL.js} +194 -37
  49. package/dist/cli-delegate/{chunk-PI2GU3DP.js → chunk-2TAQ2K4V.js} +4 -1
  50. package/dist/cli-delegate/chunk-5EK5WQN6.js +28 -0
  51. package/dist/cli-delegate/chunk-7XGD2OEU.js +96 -0
  52. package/dist/cli-delegate/{chunk-C6IPZRDA.js → chunk-BIXEDQPZ.js} +7 -1
  53. package/dist/cli-delegate/chunk-DBH4AHDK.js +155 -0
  54. package/dist/cli-delegate/{chunk-NUMQHLS5.js → chunk-J3RFNKG4.js} +21 -2
  55. package/dist/cli-delegate/chunk-JO25G5H7.js +20 -0
  56. package/dist/cli-delegate/chunk-LTYVIY76.js +7961 -0
  57. package/dist/cli-delegate/chunk-QAJS5YWY.js +999 -0
  58. package/dist/cli-delegate/{chunk-ZVBOHSVF.js → chunk-TGIPZBCW.js} +1 -1
  59. package/dist/cli-delegate/{chunk-YS6XTLEK.js → chunk-TYSY33MD.js} +56 -6
  60. package/dist/cli-delegate/chunk-ULET4BYS.js +328 -0
  61. package/dist/cli-delegate/chunk-YDQSHTD7.js +187 -0
  62. package/dist/cli-delegate/chunk-YWVXLR44.js +48 -0
  63. package/dist/cli-delegate/chunk-ZZQBUHFK.js +273 -0
  64. package/dist/cli-delegate/cmd_conformance.js +19 -5
  65. package/dist/cli-delegate/cmd_doctor.js +3 -3
  66. package/dist/cli-delegate/cmd_export.js +2 -2
  67. package/dist/cli-delegate/cmd_handoff.js +27 -3
  68. package/dist/cli-delegate/cmd_prune.js +2 -2
  69. package/dist/cli-delegate/cmd_session_recycle.js +2 -2
  70. package/dist/cli-delegate/cmd_settings_migrate.js +2 -2
  71. package/dist/cli-delegate/cmd_sync.js +2 -2
  72. package/dist/cli-delegate/cmd_uninstall.js +2 -2
  73. package/dist/cli-delegate/cmd_validate.js +2 -2
  74. package/dist/cli-delegate/dashboard_mode.js +16 -0
  75. package/dist/cli-delegate/gate_budget.js +24 -0
  76. package/dist/cli-delegate/gate_execute.js +25 -0
  77. package/dist/cli-delegate/guarded_baseline.js +18 -0
  78. package/dist/cli-delegate/resume_probe.js +22 -0
  79. package/dist/cli-delegate/roadmap_gates.js +638 -0
  80. package/dist/cli-delegate/roadmap_set_step.js +173 -0
  81. package/dist/cli-delegate/stub_queue.js +47 -0
  82. package/dist/cli-delegate/stubs_due.js +38 -0
  83. package/dist/cli-delegate/ticket_bundles.js +59 -0
  84. package/dist/cli-delegate/update_roadmap_progress.js +60 -0
  85. package/dist/discovery/deprecation-report.md +1 -1
  86. package/dist/discovery/discovery-manifest.json +60 -29
  87. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  88. package/dist/discovery/discovery-manifest.summary.md +3 -3
  89. package/dist/discovery/dormancy-report.md +1 -1
  90. package/dist/discovery/orphan-report.md +1 -1
  91. package/dist/discovery/packs.json +7 -6
  92. package/dist/discovery/trust-report.md +2 -2
  93. package/dist/discovery/workspaces.json +6 -5
  94. package/dist/hooks/dispatch.js +1522 -1008
  95. package/dist/install/claudeLayerCarriage.js +237 -0
  96. package/dist/install/claudePathsPlan.js +79 -0
  97. package/dist/install/hostLayerFingerprint.js +1 -1
  98. package/dist/install/install.mjs +10 -1
  99. package/dist/install/partitionEligibility.js +231 -117
  100. package/dist/install/ruleLayerPartition.js +10 -7
  101. package/dist/mcp/registry-manifest.json +3 -3
  102. package/dist/mcp/server.json +2 -2
  103. package/dist/mcp/server.mjs +39376 -38902
  104. package/dist/scripts/ai_council/content_ceiling.js +63 -0
  105. package/dist/scripts/ai_council/seat_policy.js +106 -0
  106. package/dist/scripts/ai_council/transport_resolver.js +21 -0
  107. package/dist/scripts/condense.js +32 -25
  108. package/docs/MIGRATION.md +49 -1
  109. package/docs/contracts/settings-classes.md +1 -1
  110. package/docs/guidelines/agent-infra/minimal-safe-diff-mechanics.md +73 -0
  111. package/llms.txt +14 -14
  112. package/package.json +7 -4
  113. package/src/agent-src/scripts/_cli_entry.ts +51 -0
  114. package/src/agent-src/scripts/archive_completed_roadmaps.ts +14 -23
  115. package/src/agent-src/scripts/roadmap_gates.ts +4 -20
  116. package/src/agent-src/scripts/roadmap_set_step.ts +5 -2
  117. package/src/agent-src/scripts/stubs_due.ts +4 -18
  118. package/src/agent-src/scripts/update_roadmap_progress.ts +7 -24
  119. package/src/config/continuity-surface.json +509 -0
  120. package/src/config/estate-count-budget.json +1 -1
  121. package/src/config/gate-coverage.yml +29 -8
  122. package/src/config/gate-violation-baselines.json +8 -8
  123. package/src/config/gitignore-block.txt +19 -0
  124. package/src/config/host-injection-effect.json +73 -0
  125. package/src/config/packed-binary-manifest.json +33 -0
  126. package/src/config/preamble-payload-budget.json +112 -105
  127. package/src/config/publish-surface.json +4 -2
  128. package/src/config/release-gate-locality.yml +4 -3
  129. package/src/install/claudeLayerCarriage.ts +273 -0
  130. package/src/install/claudePathsPlan.ts +76 -0
  131. package/src/install/hostLayerFingerprint.ts +1 -1
  132. package/src/install/partitionEligibility.ts +261 -127
  133. package/src/install/ruleLayerPartition.ts +19 -23
  134. package/src/scripts/_dispatch.bash +77 -27
  135. package/src/scripts/_lib/auto_dispatch.ts +2 -2
  136. package/src/scripts/_lib/blocked_by_marker.ts +189 -0
  137. package/src/scripts/_lib/catalogue_layer_parity.ts +146 -0
  138. package/src/scripts/_lib/continuity_surface.ts +296 -0
  139. package/src/scripts/_lib/corpus_manifest.ts +26 -9
  140. package/src/scripts/_lib/hook_settings.ts +1 -1
  141. package/src/scripts/_lib/host_capability.ts +38 -1
  142. package/src/scripts/_lib/injection_effect.ts +151 -0
  143. package/src/scripts/_lib/layer_overlap_notice.ts +50 -6
  144. package/src/scripts/_lib/packed_binary_predicate.ts +225 -0
  145. package/src/scripts/_lib/pin_resolver.ts +13 -0
  146. package/src/scripts/_lib/regression_neighbourhood.ts +1 -1
  147. package/src/scripts/_lib/release_highlights.ts +19 -211
  148. package/src/scripts/_lib/release_material.ts +27 -77
  149. package/src/scripts/_lib/retired_status.ts +74 -0
  150. package/src/scripts/_lib/skill_catalogue.ts +156 -21
  151. package/src/scripts/_lib/structured_ask.ts +117 -0
  152. package/src/scripts/_lib/subagent_capsule.ts +117 -8
  153. package/src/scripts/_lib/tty_prompt.ts +76 -0
  154. package/src/scripts/ai_council/api_transport.ts +168 -0
  155. package/src/scripts/ai_council/clients.ts +58 -63
  156. package/src/scripts/ai_council/config.ts +13 -0
  157. package/src/scripts/ai_council/content_ceiling.ts +79 -0
  158. package/src/scripts/ai_council/deliberation_metrics.ts +353 -0
  159. package/src/scripts/ai_council/jury_aggregate.ts +178 -0
  160. package/src/scripts/ai_council/prompts.ts +9 -0
  161. package/src/scripts/ai_council/seat_policy.ts +137 -0
  162. package/src/scripts/ai_council/status_surface.ts +79 -0
  163. package/src/scripts/ai_council/synthesis_disagreement.ts +206 -0
  164. package/src/scripts/ai_council/transport_resolver.ts +59 -1
  165. package/src/scripts/ai_tells_rules.ts +446 -5
  166. package/src/scripts/ask_block_census.ts +499 -0
  167. package/src/scripts/bench_humanizer_eval.ts +264 -40
  168. package/src/scripts/bench_prose_tells_fp.ts +198 -0
  169. package/src/scripts/capture_skill_catalogue.ts +24 -11
  170. package/src/scripts/check_branch_work_committed.ts +234 -0
  171. package/src/scripts/check_candidate_lines.ts +499 -0
  172. package/src/scripts/check_continuity_surface.ts +475 -0
  173. package/src/scripts/check_dependency_floors.ts +13 -6
  174. package/src/scripts/check_estate_count.ts +40 -79
  175. package/src/scripts/check_pack_size.ts +263 -24
  176. package/src/scripts/check_release_highlights.ts +0 -157
  177. package/src/scripts/check_roadmap_trackable.ts +19 -16
  178. package/src/scripts/check_rule_layer_partition.ts +54 -34
  179. package/src/scripts/check_single_delivery.ts +97 -31
  180. package/src/scripts/check_update_banner.ts +13 -0
  181. package/src/scripts/code_graph/build.ts +138 -15
  182. package/src/scripts/code_graph/cli.ts +76 -8
  183. package/src/scripts/code_graph/extract.ts +11 -0
  184. package/src/scripts/code_graph/grammar_probe.ts +43 -0
  185. package/src/scripts/code_graph/loader.ts +88 -14
  186. package/src/scripts/code_graph/query.ts +121 -11
  187. package/src/scripts/code_graph/resolution_tiers.ts +238 -0
  188. package/src/scripts/code_graph/sqlite_store.ts +247 -6
  189. package/src/scripts/code_graph/types.ts +66 -1
  190. package/src/scripts/code_graph/validate.ts +23 -0
  191. package/src/scripts/condense.ts +34 -22
  192. package/src/scripts/corpus_manifest.ts +5 -5
  193. package/src/scripts/council_cli.ts +29 -39
  194. package/src/scripts/count_intent_disagreement.ts +426 -0
  195. package/src/scripts/detect_ai_tells.ts +142 -20
  196. package/src/scripts/handoff_context_hook.ts +79 -0
  197. package/src/scripts/harvest_reference_tokens.ts +698 -0
  198. package/src/scripts/hook_effect_doctor.ts +82 -1
  199. package/src/scripts/hook_manifest.json +1 -1
  200. package/src/scripts/hook_manifest.yaml +94 -12
  201. package/src/scripts/hooks/chain_nudge_hook.ts +282 -0
  202. package/src/scripts/hooks/code_graph_context_hook.ts +212 -0
  203. package/src/scripts/hooks/concern_registry.ts +6 -2
  204. package/src/scripts/hooks/delegation_nudge_hook.ts +45 -1
  205. package/src/scripts/hooks/host_semantics.ts +1 -1
  206. package/src/scripts/hooks/one_question_per_ask_hook.ts +191 -0
  207. package/src/scripts/hooks/orchestration_record_hook.ts +2 -2
  208. package/src/scripts/hooks/rule_inject_hook.ts +1 -1
  209. package/src/scripts/hooks/skill_route_hook.ts +11 -4
  210. package/src/scripts/inbox_source_census.ts +322 -0
  211. package/src/scripts/install-hooks.sh +134 -0
  212. package/src/scripts/{lint_carrier_integrity.ts → lint_deferral_integrity.ts} +60 -214
  213. package/src/scripts/lint_plan_risk_register.ts +13 -17
  214. package/src/scripts/lint_roadmap_blockers.ts +51 -1
  215. package/src/scripts/mcp_server/suggest_skill.ts +72 -0
  216. package/src/scripts/mcp_server/tools.ts +2 -56
  217. package/src/scripts/media/lib/adapter-contract.md +7 -2
  218. package/src/scripts/media/lib/fixtures/flux/asset-0001.png +0 -0
  219. package/src/scripts/media/lib/fixtures/gemini-image/asset-0001.png +0 -0
  220. package/src/scripts/media/lib/fixtures/ideogram/asset-0001.png +0 -0
  221. package/src/scripts/migrate_command_suggestions.ts +1 -1
  222. package/src/scripts/probe_unblocked_ask.ts +135 -2
  223. package/src/scripts/rdp_candidates_delta.ts +276 -0
  224. package/src/scripts/rdp_quality_eval.ts +217 -19
  225. package/src/scripts/release.ts +26 -71
  226. package/src/scripts/release_drill.ts +6 -10
  227. package/src/scripts/release_env.ts +1 -0
  228. package/src/scripts/release_mix_taxonomy.json +3 -2
  229. package/src/scripts/release_publication.ts +34 -29
  230. package/src/scripts/report_host_injection_effect.ts +189 -0
  231. package/src/scripts/report_layer_overlap.ts +41 -0
  232. package/src/scripts/report_skill_menu_census.ts +341 -0
  233. package/src/scripts/self_review_gate.ts +409 -15
  234. package/src/scripts/skill_tools/score_skill_relevance.ts +70 -6
  235. package/src/scripts/skill_tools/suggest_skill_for_task.ts +37 -3
  236. package/src/vendor/grammars/README.md +61 -0
  237. package/src/vendor/grammars/tree-sitter-javascript.wasm +0 -0
  238. package/src/vendor/grammars/tree-sitter-php.wasm +0 -0
  239. package/src/vendor/grammars/tree-sitter-typescript.wasm +0 -0
  240. package/src/scripts/_lib/carrier_status.ts +0 -118
  241. package/src/scripts/_lib/estate_carrier_cases.ts +0 -72
  242. 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";
@@ -34,14 +34,14 @@ import {
34
34
  frontmatterPaths,
35
35
  proseEqual,
36
36
  splitFrontmatter
37
- } from "./chunk-NUMQHLS5.js";
37
+ } from "./chunk-J3RFNKG4.js";
38
38
  import "./chunk-FTAISGDQ.js";
39
39
  import "./chunk-M2DPGFZ4.js";
40
40
  import "./chunk-BTWUYDGN.js";
41
41
  import {
42
42
  projectStoreSlug,
43
43
  resolveSessionRole
44
- } from "./chunk-KPBWFOPZ.js";
44
+ } from "./chunk-2FTMENJL.js";
45
45
  import {
46
46
  atomic_write_json,
47
47
  atomic_write_text,
@@ -60,7 +60,7 @@ import {
60
60
  manifest_path,
61
61
  probeHostCapabilities,
62
62
  read_manifest
63
- } from "./chunk-PI2GU3DP.js";
63
+ } from "./chunk-2TAQ2K4V.js";
64
64
  import "./chunk-MWRD5YOH.js";
65
65
  import "./chunk-T7L2QK3K.js";
66
66
  import "./chunk-DMSZHXZS.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
  }
@@ -3853,6 +3853,12 @@ function buildNudgeLine(rung, classification, sliceCount, tier) {
3853
3853
  if (rung === 0.5) {
3854
3854
  return `<delegation-nudge>rung-0.5: ask, est. <1k tokens. This is a single bounded question \u2014 answer it via ONE completion (\`./scripts-run src/scripts/ask_transport "<question>"\`) instead of a subagent spawn (measured spawn floor: ~251k tokens) \u2014 ${classification.reason}.</delegation-nudge>`;
3855
3855
  }
3856
+ if (rung === 4) {
3857
+ return `<delegation-nudge>rung-4: council. This is contested judgment, not a slice to dispatch \u2014 route it to the council yourself via \`./scripts-run src/scripts/council_cli run --input <file>\` (check reachability first with \`agent-config council:status\`; the file path is the input, never an inline question). Not a spawn, and not run for you \u2014 ${classification.reason}.</delegation-nudge>`;
3858
+ }
3859
+ if (rung === 3) {
3860
+ return `<delegation-nudge>rung-3: team. These slices must see each other's state during the run, so a set of independent subagent spawns cannot express it \u2014 use the host teams primitive, or fall back to \`./scripts-run src/scripts/ask_transport "<question>"\` for a bounded sub-question. Not a spawn, and not run for you \u2014 ${classification.reason}.</delegation-nudge>`;
3861
+ }
3856
3862
  const modeLabel = classification.mode ?? "single-slice";
3857
3863
  return `<delegation-nudge>${rungLabel}: dispatch ${modeLabel} (${sliceCount} ${unit}, ${tier} tier recommended). Consider dispatching via subagent-orchestration instead of doing every slice in-session \u2014 ${classification.reason}.</delegation-nudge>`;
3858
3864
  }
@@ -3871,6 +3877,14 @@ function classifyPrompt(prompt, workspace_root, hostId) {
3871
3877
  agentTeams,
3872
3878
  insideSubagentSession: sessionRole !== "orchestrator"
3873
3879
  });
3880
+ if (ladder.verdict === "team" || ladder.verdict === "council") {
3881
+ return {
3882
+ classification: { delegable: false, action: "ask", mode: null, reason: ladder.reason },
3883
+ sliceCount: 0,
3884
+ tier: recommendSliceTier(downshift, separate_quota_pool),
3885
+ rung: ladder.rung
3886
+ };
3887
+ }
3874
3888
  if (ladder.verdict !== "subagent") {
3875
3889
  return null;
3876
3890
  }
@@ -66,13 +66,13 @@ import {
66
66
  _wizard_state_path,
67
67
  main,
68
68
  shutilWhich
69
- } from "./chunk-NUMQHLS5.js";
69
+ } from "./chunk-J3RFNKG4.js";
70
70
  import "./chunk-FTAISGDQ.js";
71
71
  import "./chunk-M2DPGFZ4.js";
72
72
  import "./chunk-BTWUYDGN.js";
73
- import "./chunk-KPBWFOPZ.js";
73
+ import "./chunk-2FTMENJL.js";
74
74
  import "./chunk-E4XIZDIB.js";
75
- import "./chunk-PI2GU3DP.js";
75
+ import "./chunk-2TAQ2K4V.js";
76
76
  import "./chunk-MWRD5YOH.js";
77
77
  import "./chunk-T7L2QK3K.js";
78
78
  import "./chunk-DMSZHXZS.js";
@@ -9,13 +9,13 @@ import {
9
9
  KIRO_MARKER,
10
10
  ROOCODE_MARKER,
11
11
  ZED_MARKER
12
- } from "./chunk-C6IPZRDA.js";
12
+ } from "./chunk-BIXEDQPZ.js";
13
13
  import "./chunk-4FS4WRXP.js";
14
14
  import "./chunk-6RJA2F5A.js";
15
15
  import "./chunk-WOKWX5PL.js";
16
16
  import "./chunk-523HCFYO.js";
17
17
  import "./chunk-A4QJ6ENT.js";
18
- import "./chunk-PI2GU3DP.js";
18
+ import "./chunk-2TAQ2K4V.js";
19
19
  import "./chunk-MWRD5YOH.js";
20
20
  import "./chunk-T7L2QK3K.js";
21
21
  import "./chunk-DMSZHXZS.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";
@@ -29,7 +29,7 @@ import {
29
29
  _RAW_KEY_PREFIXES,
30
30
  hardenedSpawnEnv,
31
31
  projectStoreSlug
32
- } from "./chunk-KPBWFOPZ.js";
32
+ } from "./chunk-2FTMENJL.js";
33
33
  import "./chunk-E4XIZDIB.js";
34
34
  import "./chunk-MWRD5YOH.js";
35
35
  import "./chunk-T7L2QK3K.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-C6IPZRDA.js";
4
+ } from "./chunk-BIXEDQPZ.js";
5
5
  import "./chunk-4FS4WRXP.js";
6
6
  import "./chunk-6RJA2F5A.js";
7
7
  import "./chunk-WOKWX5PL.js";
@@ -10,7 +10,7 @@ import "./chunk-A4QJ6ENT.js";
10
10
  import {
11
11
  manifest_path,
12
12
  read_manifest
13
- } from "./chunk-PI2GU3DP.js";
13
+ } from "./chunk-2TAQ2K4V.js";
14
14
  import "./chunk-MWRD5YOH.js";
15
15
  import "./chunk-T7L2QK3K.js";
16
16
  import "./chunk-DMSZHXZS.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,13 +3,13 @@ import {
3
3
  GLOBAL_AGENT_SETTINGS_PATH,
4
4
  GLOBAL_USER_SETTINGS_PATH,
5
5
  SETTINGS_FILE
6
- } from "./chunk-C6IPZRDA.js";
6
+ } from "./chunk-BIXEDQPZ.js";
7
7
  import "./chunk-4FS4WRXP.js";
8
8
  import "./chunk-6RJA2F5A.js";
9
9
  import "./chunk-WOKWX5PL.js";
10
10
  import "./chunk-523HCFYO.js";
11
11
  import "./chunk-A4QJ6ENT.js";
12
- import "./chunk-PI2GU3DP.js";
12
+ import "./chunk-2TAQ2K4V.js";
13
13
  import "./chunk-MWRD5YOH.js";
14
14
  import "./chunk-T7L2QK3K.js";
15
15
  import "./chunk-DMSZHXZS.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-C6IPZRDA.js";
4
+ } from "./chunk-BIXEDQPZ.js";
5
5
  import "./chunk-4FS4WRXP.js";
6
6
  import "./chunk-6RJA2F5A.js";
7
7
  import "./chunk-WOKWX5PL.js";
@@ -10,7 +10,7 @@ import "./chunk-A4QJ6ENT.js";
10
10
  import {
11
11
  manifest_path,
12
12
  read_manifest
13
- } from "./chunk-PI2GU3DP.js";
13
+ } from "./chunk-2TAQ2K4V.js";
14
14
  import "./chunk-MWRD5YOH.js";
15
15
  import "./chunk-T7L2QK3K.js";
16
16
  import "./chunk-DMSZHXZS.js";
@@ -3,7 +3,7 @@ import {
3
3
  PROJECT_BRIDGE_MARKERS,
4
4
  USER_SCOPE_PATHS,
5
5
  subtract_pointers
6
- } from "./chunk-C6IPZRDA.js";
6
+ } from "./chunk-BIXEDQPZ.js";
7
7
  import "./chunk-4FS4WRXP.js";
8
8
  import "./chunk-6RJA2F5A.js";
9
9
  import "./chunk-WOKWX5PL.js";
@@ -14,7 +14,7 @@ import {
14
14
  read_manifest,
15
15
  remove_managed_hooks,
16
16
  write_manifest
17
- } from "./chunk-PI2GU3DP.js";
17
+ } from "./chunk-2TAQ2K4V.js";
18
18
  import {
19
19
  write_atomic
20
20
  } from "./chunk-MWRD5YOH.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-C6IPZRDA.js";
6
+ } from "./chunk-BIXEDQPZ.js";
7
7
  import "./chunk-4FS4WRXP.js";
8
8
  import "./chunk-6RJA2F5A.js";
9
9
  import "./chunk-WOKWX5PL.js";
@@ -12,7 +12,7 @@ import "./chunk-A4QJ6ENT.js";
12
12
  import {
13
13
  manifest_path,
14
14
  read_manifest
15
- } from "./chunk-PI2GU3DP.js";
15
+ } from "./chunk-2TAQ2K4V.js";
16
16
  import "./chunk-MWRD5YOH.js";
17
17
  import {
18
18
  current_package_version
@@ -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
+ };