@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.
- package/README.md +74 -0
- package/aeg-root/enforcement.md +13 -6
- package/aeg-root/milestone-model.md +3 -1
- package/aeg-root/roles/architect.md +2 -2
- package/aeg-root/roles/archivist.md +1 -1
- package/aeg-root/roles/developer.md +3 -2
- package/aeg-root/roles/planner.md +1 -1
- package/aeg-root/roles/principal.md +1 -0
- package/aeg-root/roles/tranche-archivist.md +2 -2
- package/aeg-root/templates/issue-rationale-template.md +4 -4
- package/aeg-root/tranche-model.md +1 -1
- package/dist/checks/bin/check-body-bare-digits.js +281 -5
- package/dist/checks/bin/check-branch-topology.js +274 -0
- package/dist/checks/bin/check-brief-shape.js +249 -0
- package/dist/checks/bin/check-changeset-coverage.js +4156 -0
- package/dist/checks/bin/check-closes-n.js +274 -0
- package/dist/checks/bin/check-coherence.js +305 -3
- package/dist/checks/bin/check-dead-branch-push.js +249 -0
- package/dist/checks/bin/check-dispatch-readiness.js +381 -20
- package/dist/checks/bin/check-doc-coverage-push.js +280 -3
- package/dist/checks/bin/check-doc-coverage.js +280 -3
- package/dist/checks/bin/check-doctrine-portability.js +280 -3
- package/dist/checks/bin/check-evidence-fresh.js +249 -0
- package/dist/checks/bin/check-first-push-dispatch.js +372 -14
- package/dist/checks/bin/check-issue-assignment.js +274 -0
- package/dist/checks/bin/check-main-branch-refusal.js +249 -0
- package/dist/checks/bin/check-no-disk-state.js +249 -0
- package/dist/checks/bin/check-quoted-command.js +4405 -0
- package/dist/checks/bin/check-reader-resolvable-prose.js +282 -5
- package/dist/checks/bin/check-registry-gates.js +282 -0
- package/dist/checks/bin/check-retired-vocabulary.js +282 -5
- package/dist/checks/bin/check-review-gate.js +280 -3
- package/dist/checks/bin/check-single-plan-pr.js +249 -0
- package/dist/checks/bin/check-test-plan.js +249 -0
- package/dist/checks/bin/check-token-collection-wired.js +3975 -0
- package/dist/checks/bin/check-workspace-escape.js +249 -0
- package/dist/index.js +1523 -630
- package/package.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/BUILD_ID +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/build-manifest.json +3 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/prerender-manifest.json +3 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.html +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page/server-reference-manifest.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page.js +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page/server-reference-manifest.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page.js +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page/server-reference-manifest.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page.js +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page/server-reference-manifest.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page.js +3 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page/server-reference-manifest.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page.js +3 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page/server-reference-manifest.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page.js +3 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page/server-reference-manifest.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page.js +3 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page/server-reference-manifest.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page.js +3 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page/server-reference-manifest.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page.js +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/[root-of-the-server]__02a-3g8._.js +1 -1
- 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
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0053k9k._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0112h-k._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__040smoa._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0cxtq46._.js +25 -18
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0o771t1._.js +1 -1
- 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
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0puovz5._.js +1 -1
- 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
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__18kqy4q._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__19jyp3m._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1hs0dcu._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1wc4-ip._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1widio3._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1yoa8tx._.js +3 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_03x_w6q._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0gvm3og._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0lwxg63._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0wxycau._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0x999pb._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1-6rzip._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1fqw88f._.js +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{_0zys35s._.js → _1mqrlbl._.js} +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{_1c9b9j-._.js → _1mrtj0f._.js} +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1n0cnq-._.js +1 -1
- 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
- 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
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/node_modules_1vo08dj._.js +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/middleware-build-manifest.js +3 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/pages/500.html +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/server-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/server-reference-manifest.json +3 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0r4i_ks9z02bw.js +1 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{0ea8-8nopz29h.js → 1hfhxjy577l5d.js} +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/1k916ih3p4nsg.js +1 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{29-foak16tjfu.js → 1t2kft7bxzuxn.js} +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/1ybrihl5_aocy.js +1 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{30ojnsx3p4lp4.js → 1yqs2zgvwa4p1.js} +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{0msr2a1i-x-br.js → 25kbt5k-xb2a5.js} +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{2twnwe77d4n-m.js → 2_k6j1o9q5nn4.js} +4 -4
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2hmannd4bjhzy.js +1 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/3mqu_uhluy19i.css +1 -0
- package/studio-standalone/apps/vinaya-studio/web/package.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1rku4gz._.js +0 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0la0hhmjprdxm.css +0 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/1lk7h-0buf4ab.js +0 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/25j-y57ng11hl.js +0 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/30lyvn0yzwdiz.js +0 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/35u8inxa732is.js +0 -1
- /package/studio-standalone/_node_modules/@attalabs/{aeg-core → vinaya/studio-standalone/_node_modules/@attalabs/aeg-core}/bin/verify-coherence.ts +0 -0
- /package/studio-standalone/apps/vinaya-studio/web/.next/static/{b2VfZK2AItZwlghK_pUN0 → crNCHQ9uAgKOYC6DKkZma}/_buildManifest.js +0 -0
- /package/studio-standalone/apps/vinaya-studio/web/.next/static/{b2VfZK2AItZwlghK_pUN0 → crNCHQ9uAgKOYC6DKkZma}/_clientMiddlewareManifest.js +0 -0
- /package/studio-standalone/apps/vinaya-studio/web/.next/static/{b2VfZK2AItZwlghK_pUN0 → crNCHQ9uAgKOYC6DKkZma}/_ssgManifest.js +0 -0
|
@@ -186,6 +186,12 @@ var NEXT_HEADER = /\*\*[A-Z][^*]*\*\*/;
|
|
|
186
186
|
var FIELD_LABEL = /^(Depends-on|Conflicts-with)\s*:\s*(.*)$/i;
|
|
187
187
|
var ID_TOKEN = /^(?:[\w.-]+\s+)?#?\d+[a-z]?$/i;
|
|
188
188
|
var SLUG_QUALIFIED_ID = /^([\w.-]+)\s+(#?\d+[a-z]?)$/i;
|
|
189
|
+
function splitSlugQualifiedEdge(edge) {
|
|
190
|
+
const m = edge.trim().match(SLUG_QUALIFIED_ID);
|
|
191
|
+
if (!m)
|
|
192
|
+
return null;
|
|
193
|
+
return { slug: m[1], bareId: m[2] };
|
|
194
|
+
}
|
|
189
195
|
function isEmptyMarker(s) {
|
|
190
196
|
const t = s.trim();
|
|
191
197
|
return t === "" || t === "—" || t === "-" || t === "–";
|
|
@@ -1782,6 +1788,151 @@ var DERIVED_STATUSES = [
|
|
|
1782
1788
|
"incoherent"
|
|
1783
1789
|
];
|
|
1784
1790
|
var DERIVABLE_STATUSES = DERIVED_STATUSES.filter((s) => s !== "backlog");
|
|
1791
|
+
// ../../packages/aeg-core/src/report-tokens.ts
|
|
1792
|
+
var DASH_LOOKALIKES = {
|
|
1793
|
+
"-": "‑",
|
|
1794
|
+
"–": "‒",
|
|
1795
|
+
"—": "―"
|
|
1796
|
+
};
|
|
1797
|
+
var DASH_CHARS = new Set(Object.keys(DASH_LOOKALIKES));
|
|
1798
|
+
// ../../packages/aeg-core/src/claude-code-transcript.ts
|
|
1799
|
+
function summarizeTranscript(jsonl) {
|
|
1800
|
+
const seen = new Set;
|
|
1801
|
+
const components = {
|
|
1802
|
+
inputTokens: 0,
|
|
1803
|
+
outputTokens: 0,
|
|
1804
|
+
cacheCreationInputTokens: 0,
|
|
1805
|
+
cacheReadInputTokens: 0
|
|
1806
|
+
};
|
|
1807
|
+
let model = null;
|
|
1808
|
+
let messageCount = 0;
|
|
1809
|
+
for (const rawLine of jsonl.split(/\r?\n/)) {
|
|
1810
|
+
const line = rawLine.trim();
|
|
1811
|
+
if (!line)
|
|
1812
|
+
continue;
|
|
1813
|
+
let entry2;
|
|
1814
|
+
try {
|
|
1815
|
+
entry2 = JSON.parse(line);
|
|
1816
|
+
} catch {
|
|
1817
|
+
continue;
|
|
1818
|
+
}
|
|
1819
|
+
if (!entry2 || typeof entry2 !== "object")
|
|
1820
|
+
continue;
|
|
1821
|
+
const obj = entry2;
|
|
1822
|
+
if (obj.type !== "assistant")
|
|
1823
|
+
continue;
|
|
1824
|
+
const message = obj.message;
|
|
1825
|
+
const id = message?.id;
|
|
1826
|
+
const usage = message?.usage;
|
|
1827
|
+
if (typeof id !== "string" || !id || !usage || seen.has(id))
|
|
1828
|
+
continue;
|
|
1829
|
+
seen.add(id);
|
|
1830
|
+
messageCount++;
|
|
1831
|
+
components.inputTokens += numberOr(usage.input_tokens, 0);
|
|
1832
|
+
components.outputTokens += numberOr(usage.output_tokens, 0);
|
|
1833
|
+
components.cacheCreationInputTokens += numberOr(usage.cache_creation_input_tokens, 0);
|
|
1834
|
+
components.cacheReadInputTokens += numberOr(usage.cache_read_input_tokens, 0);
|
|
1835
|
+
const messageModel = message?.model;
|
|
1836
|
+
if (typeof messageModel === "string" && messageModel)
|
|
1837
|
+
model = messageModel;
|
|
1838
|
+
}
|
|
1839
|
+
return { components, model, messageCount };
|
|
1840
|
+
}
|
|
1841
|
+
function numberOr(value, fallback) {
|
|
1842
|
+
return typeof value === "number" && Number.isFinite(value) ? value : fallback;
|
|
1843
|
+
}
|
|
1844
|
+
function sanitizeKey(value) {
|
|
1845
|
+
return value.replace(/[^A-Za-z0-9]+/g, "-");
|
|
1846
|
+
}
|
|
1847
|
+
function transcriptPointerPath(projectDir, tmpDir) {
|
|
1848
|
+
return `${tmpDir}/claude-transcript-${sanitizeKey(projectDir)}.txt`;
|
|
1849
|
+
}
|
|
1850
|
+
function resolvePointer(explicitTranscriptPath, deps) {
|
|
1851
|
+
if (explicitTranscriptPath)
|
|
1852
|
+
return { path: explicitTranscriptPath, corroborated: true };
|
|
1853
|
+
const projectDir = deps.env.CLAUDE_PROJECT_DIR ?? deps.cwd;
|
|
1854
|
+
const tmpDir = deps.env.TMPDIR ?? "/tmp";
|
|
1855
|
+
const pointerPath = transcriptPointerPath(projectDir, tmpDir);
|
|
1856
|
+
const currentSessionId = deps.env.CLAUDE_CODE_SESSION_ID;
|
|
1857
|
+
if (!deps.exists(pointerPath)) {
|
|
1858
|
+
return {
|
|
1859
|
+
pointerExisted: false,
|
|
1860
|
+
corroborated: false,
|
|
1861
|
+
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."
|
|
1862
|
+
};
|
|
1863
|
+
}
|
|
1864
|
+
let contents;
|
|
1865
|
+
try {
|
|
1866
|
+
contents = deps.readFile(pointerPath).replace(/\r?\n+$/, "");
|
|
1867
|
+
} catch (err) {
|
|
1868
|
+
return {
|
|
1869
|
+
pointerExisted: true,
|
|
1870
|
+
oursByLocation: true,
|
|
1871
|
+
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."
|
|
1872
|
+
};
|
|
1873
|
+
}
|
|
1874
|
+
const [pointerSessionId, transcriptPath] = contents.split("\t");
|
|
1875
|
+
if (!transcriptPath) {
|
|
1876
|
+
return {
|
|
1877
|
+
pointerExisted: true,
|
|
1878
|
+
oursByLocation: true,
|
|
1879
|
+
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."
|
|
1880
|
+
};
|
|
1881
|
+
}
|
|
1882
|
+
if (currentSessionId && pointerSessionId && currentSessionId !== pointerSessionId) {
|
|
1883
|
+
return {
|
|
1884
|
+
pointerExisted: true,
|
|
1885
|
+
corroborated: false,
|
|
1886
|
+
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."
|
|
1887
|
+
};
|
|
1888
|
+
}
|
|
1889
|
+
return { path: transcriptPath, corroborated: Boolean(currentSessionId && pointerSessionId) };
|
|
1890
|
+
}
|
|
1891
|
+
function resolveMeteringCapability(deps, explicitTranscriptPath) {
|
|
1892
|
+
const resolved = resolvePointer(explicitTranscriptPath, deps);
|
|
1893
|
+
if ("error" in resolved) {
|
|
1894
|
+
const ours = resolved.pointerExisted && (resolved.corroborated || resolved.oursByLocation);
|
|
1895
|
+
if (ours)
|
|
1896
|
+
return { capable: false, reason: "pointer-unusable", detail: resolved.error };
|
|
1897
|
+
return {
|
|
1898
|
+
capable: false,
|
|
1899
|
+
reason: "no-transcript-resolved",
|
|
1900
|
+
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
|
|
1901
|
+
};
|
|
1902
|
+
}
|
|
1903
|
+
const downstream = (r, detail) => resolved.corroborated ? { reason: r, detail } : {
|
|
1904
|
+
reason: "no-transcript-resolved",
|
|
1905
|
+
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})`
|
|
1906
|
+
};
|
|
1907
|
+
if (!deps.exists(resolved.path)) {
|
|
1908
|
+
return {
|
|
1909
|
+
capable: false,
|
|
1910
|
+
...downstream("transcript-unreadable", `Resolved transcript path ${resolved.path} is not readable as a regular file owned by this user.`)
|
|
1911
|
+
};
|
|
1912
|
+
}
|
|
1913
|
+
let jsonl;
|
|
1914
|
+
try {
|
|
1915
|
+
jsonl = deps.readFile(resolved.path);
|
|
1916
|
+
} catch (err) {
|
|
1917
|
+
return {
|
|
1918
|
+
capable: false,
|
|
1919
|
+
...downstream("transcript-unreadable", `Transcript at ${resolved.path} could not be read: ${err.message}`)
|
|
1920
|
+
};
|
|
1921
|
+
}
|
|
1922
|
+
const summary = summarizeTranscript(jsonl);
|
|
1923
|
+
if (summary.messageCount === 0) {
|
|
1924
|
+
return {
|
|
1925
|
+
capable: false,
|
|
1926
|
+
...downstream("transcript-empty", `Transcript at ${resolved.path} yielded zero assistant messages with usage data — ` + "it's empty, unparseable, or not yet flushed to disk.")
|
|
1927
|
+
};
|
|
1928
|
+
}
|
|
1929
|
+
return { capable: true, transcriptPath: resolved.path, summary };
|
|
1930
|
+
}
|
|
1931
|
+
function isTokenCollectionWiringBroken(capability) {
|
|
1932
|
+
if (capability.capable)
|
|
1933
|
+
return false;
|
|
1934
|
+
return capability.reason !== "no-transcript-resolved";
|
|
1935
|
+
}
|
|
1785
1936
|
// ../../packages/aeg-core/src/file-classify.ts
|
|
1786
1937
|
function isCodeFile(p) {
|
|
1787
1938
|
if (p.endsWith(".md"))
|
|
@@ -3213,6 +3364,100 @@ function parseGlossaryTerms(glossaryContent) {
|
|
|
3213
3364
|
}
|
|
3214
3365
|
return terms;
|
|
3215
3366
|
}
|
|
3367
|
+
// ../../packages/aeg-core/src/quoted-command.ts
|
|
3368
|
+
var QUOTED_COMMAND_SHIPS_PREFIX = "aeg-root/";
|
|
3369
|
+
var QUOTED_COMMAND_SWEPT_CLASSES = new Set(["ships", "reader-facing"]);
|
|
3370
|
+
var START_PATTERN = /<!--\s*AEG:QUOTES-FILE:START:(\S+?)\s*-->/g;
|
|
3371
|
+
var END_PATTERN = /<!--\s*AEG:QUOTES-FILE:END\s*-->/;
|
|
3372
|
+
function isValidCitedFilePath(path) {
|
|
3373
|
+
if (path.length === 0)
|
|
3374
|
+
return false;
|
|
3375
|
+
if (path.startsWith("/") || path.startsWith("\\"))
|
|
3376
|
+
return false;
|
|
3377
|
+
if (/^[A-Za-z]:[\\/]/.test(path))
|
|
3378
|
+
return false;
|
|
3379
|
+
return !path.split(/[\\/]+/).includes("..");
|
|
3380
|
+
}
|
|
3381
|
+
function quotedCommandLineAt(content, index) {
|
|
3382
|
+
let line = 1;
|
|
3383
|
+
for (let i = 0;i < index; i++) {
|
|
3384
|
+
if (content.charCodeAt(i) === 10)
|
|
3385
|
+
line++;
|
|
3386
|
+
}
|
|
3387
|
+
return line;
|
|
3388
|
+
}
|
|
3389
|
+
function extractQuotedText(raw) {
|
|
3390
|
+
const trimmed = raw.trim();
|
|
3391
|
+
const fenced = /^(?:`{3,}|~{3,})[^\n]*\n([\s\S]*?)\n?(?:`{3,}|~{3,})$/.exec(trimmed);
|
|
3392
|
+
if (fenced)
|
|
3393
|
+
return (fenced[1] ?? "").trim();
|
|
3394
|
+
const inline = /^`([^`]+)`$/.exec(trimmed);
|
|
3395
|
+
if (inline)
|
|
3396
|
+
return (inline[1] ?? "").trim();
|
|
3397
|
+
return trimmed;
|
|
3398
|
+
}
|
|
3399
|
+
function findQuotesInFile(path, content) {
|
|
3400
|
+
const masked = maskCode(content);
|
|
3401
|
+
const quotes = [];
|
|
3402
|
+
START_PATTERN.lastIndex = 0;
|
|
3403
|
+
let start = START_PATTERN.exec(masked);
|
|
3404
|
+
while (start !== null) {
|
|
3405
|
+
const citedFile = start[1];
|
|
3406
|
+
const innerStart = start.index + start[0].length;
|
|
3407
|
+
const end = END_PATTERN.exec(masked.slice(innerStart));
|
|
3408
|
+
if (end === null) {
|
|
3409
|
+
START_PATTERN.lastIndex = innerStart;
|
|
3410
|
+
start = START_PATTERN.exec(masked);
|
|
3411
|
+
continue;
|
|
3412
|
+
}
|
|
3413
|
+
const innerEnd = innerStart + end.index;
|
|
3414
|
+
if (isValidCitedFilePath(citedFile)) {
|
|
3415
|
+
const quotedText = extractQuotedText(content.slice(innerStart, innerEnd));
|
|
3416
|
+
if (quotedText.length > 0) {
|
|
3417
|
+
quotes.push({ file: path, line: quotedCommandLineAt(content, innerStart), quotedText, citedFile });
|
|
3418
|
+
}
|
|
3419
|
+
}
|
|
3420
|
+
START_PATTERN.lastIndex = innerEnd + end[0].length;
|
|
3421
|
+
start = START_PATTERN.exec(masked);
|
|
3422
|
+
}
|
|
3423
|
+
return quotes;
|
|
3424
|
+
}
|
|
3425
|
+
function findCitedQuotes(files, readerFacingPrefix, readerFacingSuffix, shipsPrefix = QUOTED_COMMAND_SHIPS_PREFIX) {
|
|
3426
|
+
const quotes = [];
|
|
3427
|
+
for (const file of files) {
|
|
3428
|
+
const cls = classifyProseFile(file.path, readerFacingPrefix, readerFacingSuffix, shipsPrefix);
|
|
3429
|
+
if (!cls || !QUOTED_COMMAND_SWEPT_CLASSES.has(cls))
|
|
3430
|
+
continue;
|
|
3431
|
+
quotes.push(...findQuotesInFile(file.path, file.content));
|
|
3432
|
+
}
|
|
3433
|
+
return quotes;
|
|
3434
|
+
}
|
|
3435
|
+
function evaluateCitedQuotes(citedQuotes, citedFileContents) {
|
|
3436
|
+
const findings = [];
|
|
3437
|
+
for (const quote of citedQuotes) {
|
|
3438
|
+
const content = citedFileContents.get(quote.citedFile);
|
|
3439
|
+
if (content === undefined) {
|
|
3440
|
+
findings.push({
|
|
3441
|
+
file: quote.file,
|
|
3442
|
+
line: quote.line,
|
|
3443
|
+
citedFile: quote.citedFile,
|
|
3444
|
+
quotedText: quote.quotedText,
|
|
3445
|
+
message: `${quote.file}:${quote.line} quotes "${quote.quotedText}" as citing \`${quote.citedFile}\`, but that file could not be read`
|
|
3446
|
+
});
|
|
3447
|
+
continue;
|
|
3448
|
+
}
|
|
3449
|
+
if (!content.includes(quote.quotedText)) {
|
|
3450
|
+
findings.push({
|
|
3451
|
+
file: quote.file,
|
|
3452
|
+
line: quote.line,
|
|
3453
|
+
citedFile: quote.citedFile,
|
|
3454
|
+
quotedText: quote.quotedText,
|
|
3455
|
+
message: `${quote.file}:${quote.line} quotes "${quote.quotedText}" as citing \`${quote.citedFile}\`, but \`${quote.citedFile}\` no longer contains that text verbatim`
|
|
3456
|
+
});
|
|
3457
|
+
}
|
|
3458
|
+
}
|
|
3459
|
+
return findings;
|
|
3460
|
+
}
|
|
3216
3461
|
// ../../packages/aeg-core/src/retired-vocabulary.ts
|
|
3217
3462
|
var RETIRED_PATTERNS = [
|
|
3218
3463
|
String.raw`\bD-[0-9]{3}\b`,
|
|
@@ -3326,6 +3571,10 @@ function checkDispatchReadiness(input) {
|
|
|
3326
3571
|
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.`);
|
|
3327
3572
|
}
|
|
3328
3573
|
for (const dep of input.dependsOn) {
|
|
3574
|
+
if (dep.resolved === false) {
|
|
3575
|
+
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.`);
|
|
3576
|
+
continue;
|
|
3577
|
+
}
|
|
3329
3578
|
if (!dep.merged && !isHandClosedByRecognizedPrincipal(dep, principalAllowlist)) {
|
|
3330
3579
|
const issueStr = dep.issue !== null ? ` (#${dep.issue})` : "";
|
|
3331
3580
|
blockers.push(`dispatch-gate depends-on: ${taskLabel} depends on ${dep.id}${issueStr}, whose PR is not merged yet — not dispatchable, it serializes behind it.`);
|