@attalabs/vinaya 0.20.1 → 0.21.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 (139) hide show
  1. package/README.md +74 -0
  2. package/aeg-root/enforcement.md +13 -6
  3. package/aeg-root/milestone-model.md +3 -1
  4. package/aeg-root/roles/architect.md +2 -2
  5. package/aeg-root/roles/archivist.md +1 -1
  6. package/aeg-root/roles/developer.md +3 -2
  7. package/aeg-root/roles/planner.md +1 -1
  8. package/aeg-root/roles/principal.md +1 -0
  9. package/aeg-root/roles/tranche-archivist.md +2 -2
  10. package/aeg-root/templates/issue-rationale-template.md +4 -4
  11. package/aeg-root/tranche-model.md +1 -1
  12. package/dist/checks/bin/check-body-bare-digits.js +281 -5
  13. package/dist/checks/bin/check-branch-topology.js +274 -0
  14. package/dist/checks/bin/check-brief-shape.js +249 -0
  15. package/dist/checks/bin/check-changeset-coverage.js +4156 -0
  16. package/dist/checks/bin/check-closes-n.js +274 -0
  17. package/dist/checks/bin/check-coherence.js +305 -3
  18. package/dist/checks/bin/check-dead-branch-push.js +249 -0
  19. package/dist/checks/bin/check-dispatch-readiness.js +381 -20
  20. package/dist/checks/bin/check-doc-coverage-push.js +280 -3
  21. package/dist/checks/bin/check-doc-coverage.js +280 -3
  22. package/dist/checks/bin/check-doctrine-portability.js +280 -3
  23. package/dist/checks/bin/check-evidence-fresh.js +249 -0
  24. package/dist/checks/bin/check-first-push-dispatch.js +372 -14
  25. package/dist/checks/bin/check-issue-assignment.js +274 -0
  26. package/dist/checks/bin/check-main-branch-refusal.js +249 -0
  27. package/dist/checks/bin/check-no-disk-state.js +249 -0
  28. package/dist/checks/bin/check-quoted-command.js +4405 -0
  29. package/dist/checks/bin/check-reader-resolvable-prose.js +282 -5
  30. package/dist/checks/bin/check-registry-gates.js +282 -0
  31. package/dist/checks/bin/check-retired-vocabulary.js +282 -5
  32. package/dist/checks/bin/check-review-gate.js +280 -3
  33. package/dist/checks/bin/check-single-plan-pr.js +249 -0
  34. package/dist/checks/bin/check-test-plan.js +249 -0
  35. package/dist/checks/bin/check-token-collection-wired.js +3975 -0
  36. package/dist/checks/bin/check-workspace-escape.js +249 -0
  37. package/dist/index.js +1523 -630
  38. package/package.json +1 -1
  39. package/studio-standalone/apps/vinaya-studio/web/.next/BUILD_ID +1 -1
  40. package/studio-standalone/apps/vinaya-studio/web/.next/build-manifest.json +3 -3
  41. package/studio-standalone/apps/vinaya-studio/web/.next/prerender-manifest.json +3 -3
  42. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.html +1 -1
  43. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.rsc +1 -1
  44. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  45. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  46. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  47. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  48. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  49. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page/server-reference-manifest.json +2 -2
  50. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page.js +2 -2
  51. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  52. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  53. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route.js.nft.json +1 -1
  54. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page/server-reference-manifest.json +2 -2
  55. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page.js +2 -2
  56. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page.js.nft.json +1 -1
  57. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page_client-reference-manifest.js +1 -1
  58. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page/server-reference-manifest.json +2 -2
  59. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page.js +2 -2
  60. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page.js.nft.json +1 -1
  61. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page_client-reference-manifest.js +1 -1
  62. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page/server-reference-manifest.json +2 -2
  63. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page.js +3 -3
  64. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page.js.nft.json +1 -1
  65. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page_client-reference-manifest.js +1 -1
  66. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page/server-reference-manifest.json +2 -2
  67. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page.js +3 -3
  68. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page.js.nft.json +1 -1
  69. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page_client-reference-manifest.js +1 -1
  70. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page/server-reference-manifest.json +2 -2
  71. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page.js +3 -3
  72. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page.js.nft.json +1 -1
  73. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page_client-reference-manifest.js +1 -1
  74. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page/server-reference-manifest.json +2 -2
  75. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page.js +3 -3
  76. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page.js.nft.json +1 -1
  77. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
  78. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page/server-reference-manifest.json +2 -2
  79. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page.js +3 -3
  80. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page.js.nft.json +1 -1
  81. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page_client-reference-manifest.js +1 -1
  82. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page/server-reference-manifest.json +2 -2
  83. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page.js +2 -2
  84. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page.js.nft.json +1 -1
  85. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page_client-reference-manifest.js +1 -1
  86. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/[root-of-the-server]__02a-3g8._.js +1 -1
  87. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/1q96_modules_@clerk_nextjs_dist_esm_app-router_client_keyless-creator-reader_0lom2js.js +1 -1
  88. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0053k9k._.js +1 -1
  89. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0112h-k._.js +1 -1
  90. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__040smoa._.js +1 -1
  91. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0cxtq46._.js +25 -18
  92. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0o771t1._.js +1 -1
  93. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{[root-of-the-server]__16cuydh._.js → [root-of-the-server]__0ozbaq0._.js} +1 -1
  94. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0puovz5._.js +1 -1
  95. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{[root-of-the-server]__0ykun-j._.js → [root-of-the-server]__0z6dav-._.js} +3 -3
  96. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__18kqy4q._.js +1 -1
  97. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__19jyp3m._.js +1 -1
  98. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1hs0dcu._.js +1 -1
  99. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1wc4-ip._.js +1 -1
  100. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1widio3._.js +1 -1
  101. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1yoa8tx._.js +3 -0
  102. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_03x_w6q._.js +1 -1
  103. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0gvm3og._.js +1 -1
  104. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0lwxg63._.js +1 -1
  105. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0wxycau._.js +1 -1
  106. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0x999pb._.js +1 -1
  107. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1-6rzip._.js +1 -1
  108. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1fqw88f._.js +2 -2
  109. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{_0zys35s._.js → _1mqrlbl._.js} +2 -2
  110. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{_1c9b9j-._.js → _1mrtj0f._.js} +2 -2
  111. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1n0cnq-._.js +1 -1
  112. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{apps_vinaya-studio_web_src_app_studio_18kqbvs._.js → apps_vinaya-studio_web_src_app_studio_06it6s-._.js} +2 -2
  113. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/apps_vinaya-studio_web_src_app_studio_projects_[name]_tranches_[slug]_05ufo8i._.js +1 -1
  114. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/node_modules_1vo08dj._.js +2 -2
  115. package/studio-standalone/apps/vinaya-studio/web/.next/server/middleware-build-manifest.js +3 -3
  116. package/studio-standalone/apps/vinaya-studio/web/.next/server/pages/500.html +1 -1
  117. package/studio-standalone/apps/vinaya-studio/web/.next/server/server-reference-manifest.js +1 -1
  118. package/studio-standalone/apps/vinaya-studio/web/.next/server/server-reference-manifest.json +3 -3
  119. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0r4i_ks9z02bw.js +1 -0
  120. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{0ea8-8nopz29h.js → 1hfhxjy577l5d.js} +1 -1
  121. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/1k916ih3p4nsg.js +1 -0
  122. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{29-foak16tjfu.js → 1t2kft7bxzuxn.js} +1 -1
  123. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/1ybrihl5_aocy.js +1 -0
  124. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{30ojnsx3p4lp4.js → 1yqs2zgvwa4p1.js} +1 -1
  125. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{0msr2a1i-x-br.js → 25kbt5k-xb2a5.js} +1 -1
  126. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{2twnwe77d4n-m.js → 2_k6j1o9q5nn4.js} +4 -4
  127. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2hmannd4bjhzy.js +1 -0
  128. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/3mqu_uhluy19i.css +1 -0
  129. package/studio-standalone/apps/vinaya-studio/web/package.json +2 -2
  130. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1rku4gz._.js +0 -3
  131. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0la0hhmjprdxm.css +0 -1
  132. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/1lk7h-0buf4ab.js +0 -1
  133. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/25j-y57ng11hl.js +0 -1
  134. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/30lyvn0yzwdiz.js +0 -1
  135. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/35u8inxa732is.js +0 -1
  136. /package/studio-standalone/_node_modules/@attalabs/{aeg-core → vinaya/studio-standalone/_node_modules/@attalabs/aeg-core}/bin/verify-coherence.ts +0 -0
  137. /package/studio-standalone/apps/vinaya-studio/web/.next/static/{b2VfZK2AItZwlghK_pUN0 → crNCHQ9uAgKOYC6DKkZma}/_buildManifest.js +0 -0
  138. /package/studio-standalone/apps/vinaya-studio/web/.next/static/{b2VfZK2AItZwlghK_pUN0 → crNCHQ9uAgKOYC6DKkZma}/_clientMiddlewareManifest.js +0 -0
  139. /package/studio-standalone/apps/vinaya-studio/web/.next/static/{b2VfZK2AItZwlghK_pUN0 → crNCHQ9uAgKOYC6DKkZma}/_ssgManifest.js +0 -0
@@ -191,6 +191,12 @@ var NEXT_HEADER = /\*\*[A-Z][^*]*\*\*/;
191
191
  var FIELD_LABEL = /^(Depends-on|Conflicts-with)\s*:\s*(.*)$/i;
192
192
  var ID_TOKEN = /^(?:[\w.-]+\s+)?#?\d+[a-z]?$/i;
193
193
  var SLUG_QUALIFIED_ID = /^([\w.-]+)\s+(#?\d+[a-z]?)$/i;
194
+ function splitSlugQualifiedEdge(edge) {
195
+ const m = edge.trim().match(SLUG_QUALIFIED_ID);
196
+ if (!m)
197
+ return null;
198
+ return { slug: m[1], bareId: m[2] };
199
+ }
194
200
  function isEmptyMarker(s) {
195
201
  const t = s.trim();
196
202
  return t === "" || t === "—" || t === "-" || t === "–";
@@ -1787,6 +1793,151 @@ var DERIVED_STATUSES = [
1787
1793
  "incoherent"
1788
1794
  ];
1789
1795
  var DERIVABLE_STATUSES = DERIVED_STATUSES.filter((s) => s !== "backlog");
1796
+ // ../../packages/aeg-core/src/report-tokens.ts
1797
+ var DASH_LOOKALIKES = {
1798
+ "-": "‑",
1799
+ "–": "‒",
1800
+ "—": "―"
1801
+ };
1802
+ var DASH_CHARS = new Set(Object.keys(DASH_LOOKALIKES));
1803
+ // ../../packages/aeg-core/src/claude-code-transcript.ts
1804
+ function summarizeTranscript(jsonl) {
1805
+ const seen = new Set;
1806
+ const components = {
1807
+ inputTokens: 0,
1808
+ outputTokens: 0,
1809
+ cacheCreationInputTokens: 0,
1810
+ cacheReadInputTokens: 0
1811
+ };
1812
+ let model = null;
1813
+ let messageCount = 0;
1814
+ for (const rawLine of jsonl.split(/\r?\n/)) {
1815
+ const line = rawLine.trim();
1816
+ if (!line)
1817
+ continue;
1818
+ let entry2;
1819
+ try {
1820
+ entry2 = JSON.parse(line);
1821
+ } catch {
1822
+ continue;
1823
+ }
1824
+ if (!entry2 || typeof entry2 !== "object")
1825
+ continue;
1826
+ const obj = entry2;
1827
+ if (obj.type !== "assistant")
1828
+ continue;
1829
+ const message = obj.message;
1830
+ const id = message?.id;
1831
+ const usage = message?.usage;
1832
+ if (typeof id !== "string" || !id || !usage || seen.has(id))
1833
+ continue;
1834
+ seen.add(id);
1835
+ messageCount++;
1836
+ components.inputTokens += numberOr(usage.input_tokens, 0);
1837
+ components.outputTokens += numberOr(usage.output_tokens, 0);
1838
+ components.cacheCreationInputTokens += numberOr(usage.cache_creation_input_tokens, 0);
1839
+ components.cacheReadInputTokens += numberOr(usage.cache_read_input_tokens, 0);
1840
+ const messageModel = message?.model;
1841
+ if (typeof messageModel === "string" && messageModel)
1842
+ model = messageModel;
1843
+ }
1844
+ return { components, model, messageCount };
1845
+ }
1846
+ function numberOr(value, fallback) {
1847
+ return typeof value === "number" && Number.isFinite(value) ? value : fallback;
1848
+ }
1849
+ function sanitizeKey(value) {
1850
+ return value.replace(/[^A-Za-z0-9]+/g, "-");
1851
+ }
1852
+ function transcriptPointerPath(projectDir, tmpDir) {
1853
+ return `${tmpDir}/claude-transcript-${sanitizeKey(projectDir)}.txt`;
1854
+ }
1855
+ function resolvePointer(explicitTranscriptPath, deps) {
1856
+ if (explicitTranscriptPath)
1857
+ return { path: explicitTranscriptPath, corroborated: true };
1858
+ const projectDir = deps.env.CLAUDE_PROJECT_DIR ?? deps.cwd;
1859
+ const tmpDir = deps.env.TMPDIR ?? "/tmp";
1860
+ const pointerPath = transcriptPointerPath(projectDir, tmpDir);
1861
+ const currentSessionId = deps.env.CLAUDE_CODE_SESSION_ID;
1862
+ if (!deps.exists(pointerPath)) {
1863
+ return {
1864
+ pointerExisted: false,
1865
+ corroborated: false,
1866
+ error: `No transcript pointer at ${pointerPath} and no --transcript given. ` + "Either this repo installs no track-transcript.sh Stop hook (lacking one is not a defect — " + "name the transcript directly instead), or no session has completed a turn yet."
1867
+ };
1868
+ }
1869
+ let contents;
1870
+ try {
1871
+ contents = deps.readFile(pointerPath).replace(/\r?\n+$/, "");
1872
+ } catch (err) {
1873
+ return {
1874
+ pointerExisted: true,
1875
+ oursByLocation: true,
1876
+ error: `Transcript pointer at ${pointerPath} could not be read: ${err.message}. ` + "Remove that file to clear this — the Stop hook rewrites it on the next turn."
1877
+ };
1878
+ }
1879
+ const [pointerSessionId, transcriptPath] = contents.split("\t");
1880
+ if (!transcriptPath) {
1881
+ return {
1882
+ pointerExisted: true,
1883
+ oursByLocation: true,
1884
+ error: `Transcript pointer file ${pointerPath} is malformed: "${contents.slice(0, 120)}${contents.length > 120 ? "…" : ""}". ` + "Remove that file to clear this — the Stop hook rewrites it on the next turn."
1885
+ };
1886
+ }
1887
+ if (currentSessionId && pointerSessionId && currentSessionId !== pointerSessionId) {
1888
+ return {
1889
+ pointerExisted: true,
1890
+ corroborated: false,
1891
+ error: `Transcript pointer at ${pointerPath} is stale: written for session ${pointerSessionId}, ` + `but this session is ${currentSessionId}. Name your own transcript with --transcript instead of ` + "reporting another session's figures as yours."
1892
+ };
1893
+ }
1894
+ return { path: transcriptPath, corroborated: Boolean(currentSessionId && pointerSessionId) };
1895
+ }
1896
+ function resolveMeteringCapability(deps, explicitTranscriptPath) {
1897
+ const resolved = resolvePointer(explicitTranscriptPath, deps);
1898
+ if ("error" in resolved) {
1899
+ const ours = resolved.pointerExisted && (resolved.corroborated || resolved.oursByLocation);
1900
+ if (ours)
1901
+ return { capable: false, reason: "pointer-unusable", detail: resolved.error };
1902
+ return {
1903
+ capable: false,
1904
+ reason: "no-transcript-resolved",
1905
+ detail: resolved.pointerExisted ? `A transcript pointer exists but belongs to another session, so this session has no wiring of its own to use. (Underlying condition, for diagnosis only: ${resolved.error})` : resolved.error
1906
+ };
1907
+ }
1908
+ const downstream = (r, detail) => resolved.corroborated ? { reason: r, detail } : {
1909
+ reason: "no-transcript-resolved",
1910
+ detail: `A transcript pointer was found but could not be shown to belong to this session, so it is not treated as this session's wiring. (Underlying condition, for diagnosis only: ${detail})`
1911
+ };
1912
+ if (!deps.exists(resolved.path)) {
1913
+ return {
1914
+ capable: false,
1915
+ ...downstream("transcript-unreadable", `Resolved transcript path ${resolved.path} is not readable as a regular file owned by this user.`)
1916
+ };
1917
+ }
1918
+ let jsonl;
1919
+ try {
1920
+ jsonl = deps.readFile(resolved.path);
1921
+ } catch (err) {
1922
+ return {
1923
+ capable: false,
1924
+ ...downstream("transcript-unreadable", `Transcript at ${resolved.path} could not be read: ${err.message}`)
1925
+ };
1926
+ }
1927
+ const summary = summarizeTranscript(jsonl);
1928
+ if (summary.messageCount === 0) {
1929
+ return {
1930
+ capable: false,
1931
+ ...downstream("transcript-empty", `Transcript at ${resolved.path} yielded zero assistant messages with usage data — ` + "it's empty, unparseable, or not yet flushed to disk.")
1932
+ };
1933
+ }
1934
+ return { capable: true, transcriptPath: resolved.path, summary };
1935
+ }
1936
+ function isTokenCollectionWiringBroken(capability) {
1937
+ if (capability.capable)
1938
+ return false;
1939
+ return capability.reason !== "no-transcript-resolved";
1940
+ }
1790
1941
  // ../../packages/aeg-core/src/file-classify.ts
1791
1942
  function isCodeFile(p) {
1792
1943
  if (p.endsWith(".md"))
@@ -3218,6 +3369,100 @@ function parseGlossaryTerms(glossaryContent) {
3218
3369
  }
3219
3370
  return terms;
3220
3371
  }
3372
+ // ../../packages/aeg-core/src/quoted-command.ts
3373
+ var QUOTED_COMMAND_SHIPS_PREFIX = "aeg-root/";
3374
+ var QUOTED_COMMAND_SWEPT_CLASSES = new Set(["ships", "reader-facing"]);
3375
+ var START_PATTERN = /<!--\s*AEG:QUOTES-FILE:START:(\S+?)\s*-->/g;
3376
+ var END_PATTERN = /<!--\s*AEG:QUOTES-FILE:END\s*-->/;
3377
+ function isValidCitedFilePath(path) {
3378
+ if (path.length === 0)
3379
+ return false;
3380
+ if (path.startsWith("/") || path.startsWith("\\"))
3381
+ return false;
3382
+ if (/^[A-Za-z]:[\\/]/.test(path))
3383
+ return false;
3384
+ return !path.split(/[\\/]+/).includes("..");
3385
+ }
3386
+ function quotedCommandLineAt(content, index) {
3387
+ let line = 1;
3388
+ for (let i = 0;i < index; i++) {
3389
+ if (content.charCodeAt(i) === 10)
3390
+ line++;
3391
+ }
3392
+ return line;
3393
+ }
3394
+ function extractQuotedText(raw) {
3395
+ const trimmed = raw.trim();
3396
+ const fenced = /^(?:`{3,}|~{3,})[^\n]*\n([\s\S]*?)\n?(?:`{3,}|~{3,})$/.exec(trimmed);
3397
+ if (fenced)
3398
+ return (fenced[1] ?? "").trim();
3399
+ const inline = /^`([^`]+)`$/.exec(trimmed);
3400
+ if (inline)
3401
+ return (inline[1] ?? "").trim();
3402
+ return trimmed;
3403
+ }
3404
+ function findQuotesInFile(path, content) {
3405
+ const masked = maskCode(content);
3406
+ const quotes = [];
3407
+ START_PATTERN.lastIndex = 0;
3408
+ let start = START_PATTERN.exec(masked);
3409
+ while (start !== null) {
3410
+ const citedFile = start[1];
3411
+ const innerStart = start.index + start[0].length;
3412
+ const end = END_PATTERN.exec(masked.slice(innerStart));
3413
+ if (end === null) {
3414
+ START_PATTERN.lastIndex = innerStart;
3415
+ start = START_PATTERN.exec(masked);
3416
+ continue;
3417
+ }
3418
+ const innerEnd = innerStart + end.index;
3419
+ if (isValidCitedFilePath(citedFile)) {
3420
+ const quotedText = extractQuotedText(content.slice(innerStart, innerEnd));
3421
+ if (quotedText.length > 0) {
3422
+ quotes.push({ file: path, line: quotedCommandLineAt(content, innerStart), quotedText, citedFile });
3423
+ }
3424
+ }
3425
+ START_PATTERN.lastIndex = innerEnd + end[0].length;
3426
+ start = START_PATTERN.exec(masked);
3427
+ }
3428
+ return quotes;
3429
+ }
3430
+ function findCitedQuotes(files, readerFacingPrefix, readerFacingSuffix, shipsPrefix = QUOTED_COMMAND_SHIPS_PREFIX) {
3431
+ const quotes = [];
3432
+ for (const file of files) {
3433
+ const cls = classifyProseFile(file.path, readerFacingPrefix, readerFacingSuffix, shipsPrefix);
3434
+ if (!cls || !QUOTED_COMMAND_SWEPT_CLASSES.has(cls))
3435
+ continue;
3436
+ quotes.push(...findQuotesInFile(file.path, file.content));
3437
+ }
3438
+ return quotes;
3439
+ }
3440
+ function evaluateCitedQuotes(citedQuotes, citedFileContents) {
3441
+ const findings = [];
3442
+ for (const quote of citedQuotes) {
3443
+ const content = citedFileContents.get(quote.citedFile);
3444
+ if (content === undefined) {
3445
+ findings.push({
3446
+ file: quote.file,
3447
+ line: quote.line,
3448
+ citedFile: quote.citedFile,
3449
+ quotedText: quote.quotedText,
3450
+ message: `${quote.file}:${quote.line} quotes "${quote.quotedText}" as citing \`${quote.citedFile}\`, but that file could not be read`
3451
+ });
3452
+ continue;
3453
+ }
3454
+ if (!content.includes(quote.quotedText)) {
3455
+ findings.push({
3456
+ file: quote.file,
3457
+ line: quote.line,
3458
+ citedFile: quote.citedFile,
3459
+ quotedText: quote.quotedText,
3460
+ message: `${quote.file}:${quote.line} quotes "${quote.quotedText}" as citing \`${quote.citedFile}\`, but \`${quote.citedFile}\` no longer contains that text verbatim`
3461
+ });
3462
+ }
3463
+ }
3464
+ return findings;
3465
+ }
3221
3466
  // ../../packages/aeg-core/src/retired-vocabulary.ts
3222
3467
  var RETIRED_PATTERNS = [
3223
3468
  String.raw`\bD-[0-9]{3}\b`,
@@ -3331,6 +3576,10 @@ function checkDispatchReadiness(input) {
3331
3576
  blockers.push(`dispatch-gate rationale: Issue #${input.issue.number} for ${taskLabel} fails the rationale gate (checkIssueRationale) — the Planner must complete the eight-field rationale before this task is dispatchable.`);
3332
3577
  }
3333
3578
  for (const dep of input.dependsOn) {
3579
+ if (dep.resolved === false) {
3580
+ blockers.push(`dispatch-gate depends-on: ${taskLabel} depends on "${dep.id}", which is UNRESOLVABLE — the resolver could not find a matching tranche/task/Issue for this edge (not a claim about merge status). Not dispatchable until the edge is corrected.`);
3581
+ continue;
3582
+ }
3334
3583
  if (!dep.merged && !isHandClosedByRecognizedPrincipal(dep, principalAllowlist)) {
3335
3584
  const issueStr = dep.issue !== null ? ` (#${dep.issue})` : "";
3336
3585
  blockers.push(`dispatch-gate depends-on: ${taskLabel} depends on ${dep.id}${issueStr}, whose PR is not merged yet — not dispatchable, it serializes behind it.`);
@@ -3668,9 +3917,9 @@ function findWorkspaceEscapes(files, knownPaths, workspaceDirs = DEFAULT_WORKSPA
3668
3917
  }
3669
3918
  // src/lib/config.ts
3670
3919
  import { execFileSync as execFileSync2 } from "node:child_process";
3671
- import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
3920
+ import { existsSync, mkdirSync, readFileSync, realpathSync, writeFileSync } from "node:fs";
3672
3921
  import { homedir } from "node:os";
3673
- import { dirname, join } from "node:path";
3922
+ import { dirname, join, resolve } from "node:path";
3674
3923
  import { z } from "zod";
3675
3924
 
3676
3925
  // src/lib/agent-vendors.ts
@@ -3778,6 +4027,20 @@ var ManagedManifestSchema = z.object({
3778
4027
  labels: z.array(z.string()),
3779
4028
  agents: z.array(z.enum(AGENT_VENDORS)).optional()
3780
4029
  });
4030
+ var ProjectEntrySchema = z.object({
4031
+ name: z.string().min(1),
4032
+ description: z.string().min(1).optional(),
4033
+ path: z.string().min(1).optional()
4034
+ });
4035
+ function parseTokensCollectDeclaration(value) {
4036
+ const m = value.trim().match(/^(\S+)\s+(\S+)$/);
4037
+ if (!m)
4038
+ return null;
4039
+ const [, interpreter, script] = m;
4040
+ if (!isSafeRepoRelPath(script))
4041
+ return null;
4042
+ return { interpreter, script };
4043
+ }
3781
4044
  var VinayaConfigSchema = z.object({
3782
4045
  rings: z.object({
3783
4046
  ring1_forgeWriteInterception: z.boolean(),
@@ -3790,13 +4053,19 @@ var VinayaConfigSchema = z.object({
3790
4053
  principals: z.array(z.string()).min(1).optional(),
3791
4054
  releaseActor: z.string().min(1).optional(),
3792
4055
  ci: z.object({ setup: z.string().min(1) }).optional(),
4056
+ tokens: z.object({
4057
+ collect: z.string().min(1).refine((v) => parseTokensCollectDeclaration(v) !== null, {
4058
+ message: 'tokens.collect must be exactly "<interpreter> <repo-relative-script-path>" — two whitespace-separated tokens, no flags, no shell syntax, no quoting'
4059
+ })
4060
+ }).optional(),
3793
4061
  blastRadius: z.object({ extraDomains: z.array(z.string()).optional() }).optional(),
3794
4062
  proseGates: z.object({
3795
4063
  doctrineRoot: z.string().min(1).optional(),
3796
4064
  readerFacingPrefix: z.string().min(1).optional(),
3797
4065
  readerFacingSuffix: z.string().min(1).optional(),
3798
4066
  legacySlugDir: z.string().min(1).optional()
3799
- }).optional()
4067
+ }).optional(),
4068
+ projects: z.array(ProjectEntrySchema).optional()
3800
4069
  });
3801
4070
  var GLOBAL_VINAYA_HOME = join(homedir(), ".vinaya");
3802
4071
  var GLOBAL_CONFIG_PATH = join(GLOBAL_VINAYA_HOME, "config.json");
@@ -3835,6 +4104,9 @@ function globalRolesIgnoredWarning(path) {
3835
4104
  function globalReleaseActorIgnoredWarning(path) {
3836
4105
  return `${path}: "releaseActor" in the global config is ignored — releaseActor may only be declared from a repo-local vinaya.config.json.`;
3837
4106
  }
4107
+ function globalTokensCollectIgnoredWarning(path) {
4108
+ return `${path}: "tokens" in the global config is ignored — tokens.collect may only be declared from a repo-local vinaya.config.json.`;
4109
+ }
3838
4110
  function stripGlobalOnlyKeys(config, path) {
3839
4111
  if (path !== GLOBAL_CONFIG_PATH)
3840
4112
  return config;
@@ -3855,6 +4127,10 @@ function stripGlobalOnlyKeys(config, path) {
3855
4127
  console.error(`⚠ ${globalReleaseActorIgnoredWarning(path)}`);
3856
4128
  result = { ...result, releaseActor: undefined };
3857
4129
  }
4130
+ if (result.tokens) {
4131
+ console.error(`⚠ ${globalTokensCollectIgnoredWarning(path)}`);
4132
+ result = { ...result, tokens: undefined };
4133
+ }
3858
4134
  return result;
3859
4135
  }
3860
4136
  function resolvePrincipalAllowlist(config) {
@@ -3940,6 +4216,7 @@ function loadConfig() {
3940
4216
  return null;
3941
4217
  }
3942
4218
  }
4219
+ var TOKENS_COLLECT_TRUST_PATH = join(GLOBAL_VINAYA_HOME, "tokens-collect-trust.json");
3943
4220
 
3944
4221
  // src/checks/contract.ts
3945
4222
  var CHECK_SCHEMA_VERSION = 1;
@@ -218,6 +218,12 @@ var NEXT_HEADER = /\*\*[A-Z][^*]*\*\*/;
218
218
  var FIELD_LABEL = /^(Depends-on|Conflicts-with)\s*:\s*(.*)$/i;
219
219
  var ID_TOKEN = /^(?:[\w.-]+\s+)?#?\d+[a-z]?$/i;
220
220
  var SLUG_QUALIFIED_ID = /^([\w.-]+)\s+(#?\d+[a-z]?)$/i;
221
+ function splitSlugQualifiedEdge(edge) {
222
+ const m = edge.trim().match(SLUG_QUALIFIED_ID);
223
+ if (!m)
224
+ return null;
225
+ return { slug: m[1], bareId: m[2] };
226
+ }
221
227
  function isEmptyMarker(s) {
222
228
  const t = s.trim();
223
229
  return t === "" || t === "—" || t === "-" || t === "–";
@@ -1814,6 +1820,151 @@ var DERIVED_STATUSES = [
1814
1820
  "incoherent"
1815
1821
  ];
1816
1822
  var DERIVABLE_STATUSES = DERIVED_STATUSES.filter((s) => s !== "backlog");
1823
+ // ../../packages/aeg-core/src/report-tokens.ts
1824
+ var DASH_LOOKALIKES = {
1825
+ "-": "‑",
1826
+ "–": "‒",
1827
+ "—": "―"
1828
+ };
1829
+ var DASH_CHARS = new Set(Object.keys(DASH_LOOKALIKES));
1830
+ // ../../packages/aeg-core/src/claude-code-transcript.ts
1831
+ function summarizeTranscript(jsonl) {
1832
+ const seen = new Set;
1833
+ const components = {
1834
+ inputTokens: 0,
1835
+ outputTokens: 0,
1836
+ cacheCreationInputTokens: 0,
1837
+ cacheReadInputTokens: 0
1838
+ };
1839
+ let model = null;
1840
+ let messageCount = 0;
1841
+ for (const rawLine of jsonl.split(/\r?\n/)) {
1842
+ const line = rawLine.trim();
1843
+ if (!line)
1844
+ continue;
1845
+ let entry2;
1846
+ try {
1847
+ entry2 = JSON.parse(line);
1848
+ } catch {
1849
+ continue;
1850
+ }
1851
+ if (!entry2 || typeof entry2 !== "object")
1852
+ continue;
1853
+ const obj = entry2;
1854
+ if (obj.type !== "assistant")
1855
+ continue;
1856
+ const message = obj.message;
1857
+ const id = message?.id;
1858
+ const usage = message?.usage;
1859
+ if (typeof id !== "string" || !id || !usage || seen.has(id))
1860
+ continue;
1861
+ seen.add(id);
1862
+ messageCount++;
1863
+ components.inputTokens += numberOr(usage.input_tokens, 0);
1864
+ components.outputTokens += numberOr(usage.output_tokens, 0);
1865
+ components.cacheCreationInputTokens += numberOr(usage.cache_creation_input_tokens, 0);
1866
+ components.cacheReadInputTokens += numberOr(usage.cache_read_input_tokens, 0);
1867
+ const messageModel = message?.model;
1868
+ if (typeof messageModel === "string" && messageModel)
1869
+ model = messageModel;
1870
+ }
1871
+ return { components, model, messageCount };
1872
+ }
1873
+ function numberOr(value, fallback) {
1874
+ return typeof value === "number" && Number.isFinite(value) ? value : fallback;
1875
+ }
1876
+ function sanitizeKey(value) {
1877
+ return value.replace(/[^A-Za-z0-9]+/g, "-");
1878
+ }
1879
+ function transcriptPointerPath(projectDir, tmpDir) {
1880
+ return `${tmpDir}/claude-transcript-${sanitizeKey(projectDir)}.txt`;
1881
+ }
1882
+ function resolvePointer(explicitTranscriptPath, deps) {
1883
+ if (explicitTranscriptPath)
1884
+ return { path: explicitTranscriptPath, corroborated: true };
1885
+ const projectDir = deps.env.CLAUDE_PROJECT_DIR ?? deps.cwd;
1886
+ const tmpDir = deps.env.TMPDIR ?? "/tmp";
1887
+ const pointerPath = transcriptPointerPath(projectDir, tmpDir);
1888
+ const currentSessionId = deps.env.CLAUDE_CODE_SESSION_ID;
1889
+ if (!deps.exists(pointerPath)) {
1890
+ return {
1891
+ pointerExisted: false,
1892
+ corroborated: false,
1893
+ error: `No transcript pointer at ${pointerPath} and no --transcript given. ` + "Either this repo installs no track-transcript.sh Stop hook (lacking one is not a defect — " + "name the transcript directly instead), or no session has completed a turn yet."
1894
+ };
1895
+ }
1896
+ let contents;
1897
+ try {
1898
+ contents = deps.readFile(pointerPath).replace(/\r?\n+$/, "");
1899
+ } catch (err) {
1900
+ return {
1901
+ pointerExisted: true,
1902
+ oursByLocation: true,
1903
+ error: `Transcript pointer at ${pointerPath} could not be read: ${err.message}. ` + "Remove that file to clear this — the Stop hook rewrites it on the next turn."
1904
+ };
1905
+ }
1906
+ const [pointerSessionId, transcriptPath] = contents.split("\t");
1907
+ if (!transcriptPath) {
1908
+ return {
1909
+ pointerExisted: true,
1910
+ oursByLocation: true,
1911
+ error: `Transcript pointer file ${pointerPath} is malformed: "${contents.slice(0, 120)}${contents.length > 120 ? "…" : ""}". ` + "Remove that file to clear this — the Stop hook rewrites it on the next turn."
1912
+ };
1913
+ }
1914
+ if (currentSessionId && pointerSessionId && currentSessionId !== pointerSessionId) {
1915
+ return {
1916
+ pointerExisted: true,
1917
+ corroborated: false,
1918
+ error: `Transcript pointer at ${pointerPath} is stale: written for session ${pointerSessionId}, ` + `but this session is ${currentSessionId}. Name your own transcript with --transcript instead of ` + "reporting another session's figures as yours."
1919
+ };
1920
+ }
1921
+ return { path: transcriptPath, corroborated: Boolean(currentSessionId && pointerSessionId) };
1922
+ }
1923
+ function resolveMeteringCapability(deps, explicitTranscriptPath) {
1924
+ const resolved = resolvePointer(explicitTranscriptPath, deps);
1925
+ if ("error" in resolved) {
1926
+ const ours = resolved.pointerExisted && (resolved.corroborated || resolved.oursByLocation);
1927
+ if (ours)
1928
+ return { capable: false, reason: "pointer-unusable", detail: resolved.error };
1929
+ return {
1930
+ capable: false,
1931
+ reason: "no-transcript-resolved",
1932
+ detail: resolved.pointerExisted ? `A transcript pointer exists but belongs to another session, so this session has no wiring of its own to use. (Underlying condition, for diagnosis only: ${resolved.error})` : resolved.error
1933
+ };
1934
+ }
1935
+ const downstream = (r, detail) => resolved.corroborated ? { reason: r, detail } : {
1936
+ reason: "no-transcript-resolved",
1937
+ detail: `A transcript pointer was found but could not be shown to belong to this session, so it is not treated as this session's wiring. (Underlying condition, for diagnosis only: ${detail})`
1938
+ };
1939
+ if (!deps.exists(resolved.path)) {
1940
+ return {
1941
+ capable: false,
1942
+ ...downstream("transcript-unreadable", `Resolved transcript path ${resolved.path} is not readable as a regular file owned by this user.`)
1943
+ };
1944
+ }
1945
+ let jsonl;
1946
+ try {
1947
+ jsonl = deps.readFile(resolved.path);
1948
+ } catch (err) {
1949
+ return {
1950
+ capable: false,
1951
+ ...downstream("transcript-unreadable", `Transcript at ${resolved.path} could not be read: ${err.message}`)
1952
+ };
1953
+ }
1954
+ const summary = summarizeTranscript(jsonl);
1955
+ if (summary.messageCount === 0) {
1956
+ return {
1957
+ capable: false,
1958
+ ...downstream("transcript-empty", `Transcript at ${resolved.path} yielded zero assistant messages with usage data — ` + "it's empty, unparseable, or not yet flushed to disk.")
1959
+ };
1960
+ }
1961
+ return { capable: true, transcriptPath: resolved.path, summary };
1962
+ }
1963
+ function isTokenCollectionWiringBroken(capability) {
1964
+ if (capability.capable)
1965
+ return false;
1966
+ return capability.reason !== "no-transcript-resolved";
1967
+ }
1817
1968
  // ../../packages/aeg-core/src/file-classify.ts
1818
1969
  function isCodeFile(p) {
1819
1970
  if (p.endsWith(".md"))
@@ -3245,6 +3396,100 @@ function parseGlossaryTerms(glossaryContent) {
3245
3396
  }
3246
3397
  return terms;
3247
3398
  }
3399
+ // ../../packages/aeg-core/src/quoted-command.ts
3400
+ var QUOTED_COMMAND_SHIPS_PREFIX = "aeg-root/";
3401
+ var QUOTED_COMMAND_SWEPT_CLASSES = new Set(["ships", "reader-facing"]);
3402
+ var START_PATTERN = /<!--\s*AEG:QUOTES-FILE:START:(\S+?)\s*-->/g;
3403
+ var END_PATTERN = /<!--\s*AEG:QUOTES-FILE:END\s*-->/;
3404
+ function isValidCitedFilePath(path) {
3405
+ if (path.length === 0)
3406
+ return false;
3407
+ if (path.startsWith("/") || path.startsWith("\\"))
3408
+ return false;
3409
+ if (/^[A-Za-z]:[\\/]/.test(path))
3410
+ return false;
3411
+ return !path.split(/[\\/]+/).includes("..");
3412
+ }
3413
+ function quotedCommandLineAt(content, index) {
3414
+ let line = 1;
3415
+ for (let i = 0;i < index; i++) {
3416
+ if (content.charCodeAt(i) === 10)
3417
+ line++;
3418
+ }
3419
+ return line;
3420
+ }
3421
+ function extractQuotedText(raw) {
3422
+ const trimmed = raw.trim();
3423
+ const fenced = /^(?:`{3,}|~{3,})[^\n]*\n([\s\S]*?)\n?(?:`{3,}|~{3,})$/.exec(trimmed);
3424
+ if (fenced)
3425
+ return (fenced[1] ?? "").trim();
3426
+ const inline = /^`([^`]+)`$/.exec(trimmed);
3427
+ if (inline)
3428
+ return (inline[1] ?? "").trim();
3429
+ return trimmed;
3430
+ }
3431
+ function findQuotesInFile(path, content) {
3432
+ const masked = maskCode(content);
3433
+ const quotes = [];
3434
+ START_PATTERN.lastIndex = 0;
3435
+ let start = START_PATTERN.exec(masked);
3436
+ while (start !== null) {
3437
+ const citedFile = start[1];
3438
+ const innerStart = start.index + start[0].length;
3439
+ const end = END_PATTERN.exec(masked.slice(innerStart));
3440
+ if (end === null) {
3441
+ START_PATTERN.lastIndex = innerStart;
3442
+ start = START_PATTERN.exec(masked);
3443
+ continue;
3444
+ }
3445
+ const innerEnd = innerStart + end.index;
3446
+ if (isValidCitedFilePath(citedFile)) {
3447
+ const quotedText = extractQuotedText(content.slice(innerStart, innerEnd));
3448
+ if (quotedText.length > 0) {
3449
+ quotes.push({ file: path, line: quotedCommandLineAt(content, innerStart), quotedText, citedFile });
3450
+ }
3451
+ }
3452
+ START_PATTERN.lastIndex = innerEnd + end[0].length;
3453
+ start = START_PATTERN.exec(masked);
3454
+ }
3455
+ return quotes;
3456
+ }
3457
+ function findCitedQuotes(files, readerFacingPrefix, readerFacingSuffix, shipsPrefix = QUOTED_COMMAND_SHIPS_PREFIX) {
3458
+ const quotes = [];
3459
+ for (const file of files) {
3460
+ const cls = classifyProseFile(file.path, readerFacingPrefix, readerFacingSuffix, shipsPrefix);
3461
+ if (!cls || !QUOTED_COMMAND_SWEPT_CLASSES.has(cls))
3462
+ continue;
3463
+ quotes.push(...findQuotesInFile(file.path, file.content));
3464
+ }
3465
+ return quotes;
3466
+ }
3467
+ function evaluateCitedQuotes(citedQuotes, citedFileContents) {
3468
+ const findings = [];
3469
+ for (const quote of citedQuotes) {
3470
+ const content = citedFileContents.get(quote.citedFile);
3471
+ if (content === undefined) {
3472
+ findings.push({
3473
+ file: quote.file,
3474
+ line: quote.line,
3475
+ citedFile: quote.citedFile,
3476
+ quotedText: quote.quotedText,
3477
+ message: `${quote.file}:${quote.line} quotes "${quote.quotedText}" as citing \`${quote.citedFile}\`, but that file could not be read`
3478
+ });
3479
+ continue;
3480
+ }
3481
+ if (!content.includes(quote.quotedText)) {
3482
+ findings.push({
3483
+ file: quote.file,
3484
+ line: quote.line,
3485
+ citedFile: quote.citedFile,
3486
+ quotedText: quote.quotedText,
3487
+ message: `${quote.file}:${quote.line} quotes "${quote.quotedText}" as citing \`${quote.citedFile}\`, but \`${quote.citedFile}\` no longer contains that text verbatim`
3488
+ });
3489
+ }
3490
+ }
3491
+ return findings;
3492
+ }
3248
3493
  // ../../packages/aeg-core/src/retired-vocabulary.ts
3249
3494
  var RETIRED_PATTERNS = [
3250
3495
  String.raw`\bD-[0-9]{3}\b`,
@@ -3358,6 +3603,10 @@ function checkDispatchReadiness(input) {
3358
3603
  blockers.push(`dispatch-gate rationale: Issue #${input.issue.number} for ${taskLabel} fails the rationale gate (checkIssueRationale) — the Planner must complete the eight-field rationale before this task is dispatchable.`);
3359
3604
  }
3360
3605
  for (const dep of input.dependsOn) {
3606
+ if (dep.resolved === false) {
3607
+ blockers.push(`dispatch-gate depends-on: ${taskLabel} depends on "${dep.id}", which is UNRESOLVABLE — the resolver could not find a matching tranche/task/Issue for this edge (not a claim about merge status). Not dispatchable until the edge is corrected.`);
3608
+ continue;
3609
+ }
3361
3610
  if (!dep.merged && !isHandClosedByRecognizedPrincipal(dep, principalAllowlist)) {
3362
3611
  const issueStr = dep.issue !== null ? ` (#${dep.issue})` : "";
3363
3612
  blockers.push(`dispatch-gate depends-on: ${taskLabel} depends on ${dep.id}${issueStr}, whose PR is not merged yet — not dispatchable, it serializes behind it.`);