@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
|
@@ -190,6 +190,12 @@ var NEXT_HEADER = /\*\*[A-Z][^*]*\*\*/;
|
|
|
190
190
|
var FIELD_LABEL = /^(Depends-on|Conflicts-with)\s*:\s*(.*)$/i;
|
|
191
191
|
var ID_TOKEN = /^(?:[\w.-]+\s+)?#?\d+[a-z]?$/i;
|
|
192
192
|
var SLUG_QUALIFIED_ID = /^([\w.-]+)\s+(#?\d+[a-z]?)$/i;
|
|
193
|
+
function splitSlugQualifiedEdge(edge) {
|
|
194
|
+
const m = edge.trim().match(SLUG_QUALIFIED_ID);
|
|
195
|
+
if (!m)
|
|
196
|
+
return null;
|
|
197
|
+
return { slug: m[1], bareId: m[2] };
|
|
198
|
+
}
|
|
193
199
|
function isEmptyMarker(s) {
|
|
194
200
|
const t = s.trim();
|
|
195
201
|
return t === "" || t === "—" || t === "-" || t === "–";
|
|
@@ -1786,6 +1792,151 @@ var DERIVED_STATUSES = [
|
|
|
1786
1792
|
"incoherent"
|
|
1787
1793
|
];
|
|
1788
1794
|
var DERIVABLE_STATUSES = DERIVED_STATUSES.filter((s) => s !== "backlog");
|
|
1795
|
+
// ../../packages/aeg-core/src/report-tokens.ts
|
|
1796
|
+
var DASH_LOOKALIKES = {
|
|
1797
|
+
"-": "‑",
|
|
1798
|
+
"–": "‒",
|
|
1799
|
+
"—": "―"
|
|
1800
|
+
};
|
|
1801
|
+
var DASH_CHARS = new Set(Object.keys(DASH_LOOKALIKES));
|
|
1802
|
+
// ../../packages/aeg-core/src/claude-code-transcript.ts
|
|
1803
|
+
function summarizeTranscript(jsonl) {
|
|
1804
|
+
const seen = new Set;
|
|
1805
|
+
const components = {
|
|
1806
|
+
inputTokens: 0,
|
|
1807
|
+
outputTokens: 0,
|
|
1808
|
+
cacheCreationInputTokens: 0,
|
|
1809
|
+
cacheReadInputTokens: 0
|
|
1810
|
+
};
|
|
1811
|
+
let model = null;
|
|
1812
|
+
let messageCount = 0;
|
|
1813
|
+
for (const rawLine of jsonl.split(/\r?\n/)) {
|
|
1814
|
+
const line = rawLine.trim();
|
|
1815
|
+
if (!line)
|
|
1816
|
+
continue;
|
|
1817
|
+
let entry2;
|
|
1818
|
+
try {
|
|
1819
|
+
entry2 = JSON.parse(line);
|
|
1820
|
+
} catch {
|
|
1821
|
+
continue;
|
|
1822
|
+
}
|
|
1823
|
+
if (!entry2 || typeof entry2 !== "object")
|
|
1824
|
+
continue;
|
|
1825
|
+
const obj = entry2;
|
|
1826
|
+
if (obj.type !== "assistant")
|
|
1827
|
+
continue;
|
|
1828
|
+
const message = obj.message;
|
|
1829
|
+
const id = message?.id;
|
|
1830
|
+
const usage = message?.usage;
|
|
1831
|
+
if (typeof id !== "string" || !id || !usage || seen.has(id))
|
|
1832
|
+
continue;
|
|
1833
|
+
seen.add(id);
|
|
1834
|
+
messageCount++;
|
|
1835
|
+
components.inputTokens += numberOr(usage.input_tokens, 0);
|
|
1836
|
+
components.outputTokens += numberOr(usage.output_tokens, 0);
|
|
1837
|
+
components.cacheCreationInputTokens += numberOr(usage.cache_creation_input_tokens, 0);
|
|
1838
|
+
components.cacheReadInputTokens += numberOr(usage.cache_read_input_tokens, 0);
|
|
1839
|
+
const messageModel = message?.model;
|
|
1840
|
+
if (typeof messageModel === "string" && messageModel)
|
|
1841
|
+
model = messageModel;
|
|
1842
|
+
}
|
|
1843
|
+
return { components, model, messageCount };
|
|
1844
|
+
}
|
|
1845
|
+
function numberOr(value, fallback) {
|
|
1846
|
+
return typeof value === "number" && Number.isFinite(value) ? value : fallback;
|
|
1847
|
+
}
|
|
1848
|
+
function sanitizeKey(value) {
|
|
1849
|
+
return value.replace(/[^A-Za-z0-9]+/g, "-");
|
|
1850
|
+
}
|
|
1851
|
+
function transcriptPointerPath(projectDir, tmpDir) {
|
|
1852
|
+
return `${tmpDir}/claude-transcript-${sanitizeKey(projectDir)}.txt`;
|
|
1853
|
+
}
|
|
1854
|
+
function resolvePointer(explicitTranscriptPath, deps) {
|
|
1855
|
+
if (explicitTranscriptPath)
|
|
1856
|
+
return { path: explicitTranscriptPath, corroborated: true };
|
|
1857
|
+
const projectDir = deps.env.CLAUDE_PROJECT_DIR ?? deps.cwd;
|
|
1858
|
+
const tmpDir = deps.env.TMPDIR ?? "/tmp";
|
|
1859
|
+
const pointerPath = transcriptPointerPath(projectDir, tmpDir);
|
|
1860
|
+
const currentSessionId = deps.env.CLAUDE_CODE_SESSION_ID;
|
|
1861
|
+
if (!deps.exists(pointerPath)) {
|
|
1862
|
+
return {
|
|
1863
|
+
pointerExisted: false,
|
|
1864
|
+
corroborated: false,
|
|
1865
|
+
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."
|
|
1866
|
+
};
|
|
1867
|
+
}
|
|
1868
|
+
let contents;
|
|
1869
|
+
try {
|
|
1870
|
+
contents = deps.readFile(pointerPath).replace(/\r?\n+$/, "");
|
|
1871
|
+
} catch (err) {
|
|
1872
|
+
return {
|
|
1873
|
+
pointerExisted: true,
|
|
1874
|
+
oursByLocation: true,
|
|
1875
|
+
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."
|
|
1876
|
+
};
|
|
1877
|
+
}
|
|
1878
|
+
const [pointerSessionId, transcriptPath] = contents.split("\t");
|
|
1879
|
+
if (!transcriptPath) {
|
|
1880
|
+
return {
|
|
1881
|
+
pointerExisted: true,
|
|
1882
|
+
oursByLocation: true,
|
|
1883
|
+
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."
|
|
1884
|
+
};
|
|
1885
|
+
}
|
|
1886
|
+
if (currentSessionId && pointerSessionId && currentSessionId !== pointerSessionId) {
|
|
1887
|
+
return {
|
|
1888
|
+
pointerExisted: true,
|
|
1889
|
+
corroborated: false,
|
|
1890
|
+
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."
|
|
1891
|
+
};
|
|
1892
|
+
}
|
|
1893
|
+
return { path: transcriptPath, corroborated: Boolean(currentSessionId && pointerSessionId) };
|
|
1894
|
+
}
|
|
1895
|
+
function resolveMeteringCapability(deps, explicitTranscriptPath) {
|
|
1896
|
+
const resolved = resolvePointer(explicitTranscriptPath, deps);
|
|
1897
|
+
if ("error" in resolved) {
|
|
1898
|
+
const ours = resolved.pointerExisted && (resolved.corroborated || resolved.oursByLocation);
|
|
1899
|
+
if (ours)
|
|
1900
|
+
return { capable: false, reason: "pointer-unusable", detail: resolved.error };
|
|
1901
|
+
return {
|
|
1902
|
+
capable: false,
|
|
1903
|
+
reason: "no-transcript-resolved",
|
|
1904
|
+
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
|
|
1905
|
+
};
|
|
1906
|
+
}
|
|
1907
|
+
const downstream = (r, detail) => resolved.corroborated ? { reason: r, detail } : {
|
|
1908
|
+
reason: "no-transcript-resolved",
|
|
1909
|
+
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})`
|
|
1910
|
+
};
|
|
1911
|
+
if (!deps.exists(resolved.path)) {
|
|
1912
|
+
return {
|
|
1913
|
+
capable: false,
|
|
1914
|
+
...downstream("transcript-unreadable", `Resolved transcript path ${resolved.path} is not readable as a regular file owned by this user.`)
|
|
1915
|
+
};
|
|
1916
|
+
}
|
|
1917
|
+
let jsonl;
|
|
1918
|
+
try {
|
|
1919
|
+
jsonl = deps.readFile(resolved.path);
|
|
1920
|
+
} catch (err) {
|
|
1921
|
+
return {
|
|
1922
|
+
capable: false,
|
|
1923
|
+
...downstream("transcript-unreadable", `Transcript at ${resolved.path} could not be read: ${err.message}`)
|
|
1924
|
+
};
|
|
1925
|
+
}
|
|
1926
|
+
const summary = summarizeTranscript(jsonl);
|
|
1927
|
+
if (summary.messageCount === 0) {
|
|
1928
|
+
return {
|
|
1929
|
+
capable: false,
|
|
1930
|
+
...downstream("transcript-empty", `Transcript at ${resolved.path} yielded zero assistant messages with usage data — ` + "it's empty, unparseable, or not yet flushed to disk.")
|
|
1931
|
+
};
|
|
1932
|
+
}
|
|
1933
|
+
return { capable: true, transcriptPath: resolved.path, summary };
|
|
1934
|
+
}
|
|
1935
|
+
function isTokenCollectionWiringBroken(capability) {
|
|
1936
|
+
if (capability.capable)
|
|
1937
|
+
return false;
|
|
1938
|
+
return capability.reason !== "no-transcript-resolved";
|
|
1939
|
+
}
|
|
1789
1940
|
// ../../packages/aeg-core/src/file-classify.ts
|
|
1790
1941
|
function isCodeFile(p) {
|
|
1791
1942
|
if (p.endsWith(".md"))
|
|
@@ -3217,6 +3368,100 @@ function parseGlossaryTerms(glossaryContent) {
|
|
|
3217
3368
|
}
|
|
3218
3369
|
return terms;
|
|
3219
3370
|
}
|
|
3371
|
+
// ../../packages/aeg-core/src/quoted-command.ts
|
|
3372
|
+
var QUOTED_COMMAND_SHIPS_PREFIX = "aeg-root/";
|
|
3373
|
+
var QUOTED_COMMAND_SWEPT_CLASSES = new Set(["ships", "reader-facing"]);
|
|
3374
|
+
var START_PATTERN = /<!--\s*AEG:QUOTES-FILE:START:(\S+?)\s*-->/g;
|
|
3375
|
+
var END_PATTERN = /<!--\s*AEG:QUOTES-FILE:END\s*-->/;
|
|
3376
|
+
function isValidCitedFilePath(path) {
|
|
3377
|
+
if (path.length === 0)
|
|
3378
|
+
return false;
|
|
3379
|
+
if (path.startsWith("/") || path.startsWith("\\"))
|
|
3380
|
+
return false;
|
|
3381
|
+
if (/^[A-Za-z]:[\\/]/.test(path))
|
|
3382
|
+
return false;
|
|
3383
|
+
return !path.split(/[\\/]+/).includes("..");
|
|
3384
|
+
}
|
|
3385
|
+
function quotedCommandLineAt(content, index) {
|
|
3386
|
+
let line = 1;
|
|
3387
|
+
for (let i = 0;i < index; i++) {
|
|
3388
|
+
if (content.charCodeAt(i) === 10)
|
|
3389
|
+
line++;
|
|
3390
|
+
}
|
|
3391
|
+
return line;
|
|
3392
|
+
}
|
|
3393
|
+
function extractQuotedText(raw) {
|
|
3394
|
+
const trimmed = raw.trim();
|
|
3395
|
+
const fenced = /^(?:`{3,}|~{3,})[^\n]*\n([\s\S]*?)\n?(?:`{3,}|~{3,})$/.exec(trimmed);
|
|
3396
|
+
if (fenced)
|
|
3397
|
+
return (fenced[1] ?? "").trim();
|
|
3398
|
+
const inline = /^`([^`]+)`$/.exec(trimmed);
|
|
3399
|
+
if (inline)
|
|
3400
|
+
return (inline[1] ?? "").trim();
|
|
3401
|
+
return trimmed;
|
|
3402
|
+
}
|
|
3403
|
+
function findQuotesInFile(path, content) {
|
|
3404
|
+
const masked = maskCode(content);
|
|
3405
|
+
const quotes = [];
|
|
3406
|
+
START_PATTERN.lastIndex = 0;
|
|
3407
|
+
let start = START_PATTERN.exec(masked);
|
|
3408
|
+
while (start !== null) {
|
|
3409
|
+
const citedFile = start[1];
|
|
3410
|
+
const innerStart = start.index + start[0].length;
|
|
3411
|
+
const end = END_PATTERN.exec(masked.slice(innerStart));
|
|
3412
|
+
if (end === null) {
|
|
3413
|
+
START_PATTERN.lastIndex = innerStart;
|
|
3414
|
+
start = START_PATTERN.exec(masked);
|
|
3415
|
+
continue;
|
|
3416
|
+
}
|
|
3417
|
+
const innerEnd = innerStart + end.index;
|
|
3418
|
+
if (isValidCitedFilePath(citedFile)) {
|
|
3419
|
+
const quotedText = extractQuotedText(content.slice(innerStart, innerEnd));
|
|
3420
|
+
if (quotedText.length > 0) {
|
|
3421
|
+
quotes.push({ file: path, line: quotedCommandLineAt(content, innerStart), quotedText, citedFile });
|
|
3422
|
+
}
|
|
3423
|
+
}
|
|
3424
|
+
START_PATTERN.lastIndex = innerEnd + end[0].length;
|
|
3425
|
+
start = START_PATTERN.exec(masked);
|
|
3426
|
+
}
|
|
3427
|
+
return quotes;
|
|
3428
|
+
}
|
|
3429
|
+
function findCitedQuotes(files, readerFacingPrefix, readerFacingSuffix, shipsPrefix = QUOTED_COMMAND_SHIPS_PREFIX) {
|
|
3430
|
+
const quotes = [];
|
|
3431
|
+
for (const file of files) {
|
|
3432
|
+
const cls = classifyProseFile(file.path, readerFacingPrefix, readerFacingSuffix, shipsPrefix);
|
|
3433
|
+
if (!cls || !QUOTED_COMMAND_SWEPT_CLASSES.has(cls))
|
|
3434
|
+
continue;
|
|
3435
|
+
quotes.push(...findQuotesInFile(file.path, file.content));
|
|
3436
|
+
}
|
|
3437
|
+
return quotes;
|
|
3438
|
+
}
|
|
3439
|
+
function evaluateCitedQuotes(citedQuotes, citedFileContents) {
|
|
3440
|
+
const findings = [];
|
|
3441
|
+
for (const quote of citedQuotes) {
|
|
3442
|
+
const content = citedFileContents.get(quote.citedFile);
|
|
3443
|
+
if (content === undefined) {
|
|
3444
|
+
findings.push({
|
|
3445
|
+
file: quote.file,
|
|
3446
|
+
line: quote.line,
|
|
3447
|
+
citedFile: quote.citedFile,
|
|
3448
|
+
quotedText: quote.quotedText,
|
|
3449
|
+
message: `${quote.file}:${quote.line} quotes "${quote.quotedText}" as citing \`${quote.citedFile}\`, but that file could not be read`
|
|
3450
|
+
});
|
|
3451
|
+
continue;
|
|
3452
|
+
}
|
|
3453
|
+
if (!content.includes(quote.quotedText)) {
|
|
3454
|
+
findings.push({
|
|
3455
|
+
file: quote.file,
|
|
3456
|
+
line: quote.line,
|
|
3457
|
+
citedFile: quote.citedFile,
|
|
3458
|
+
quotedText: quote.quotedText,
|
|
3459
|
+
message: `${quote.file}:${quote.line} quotes "${quote.quotedText}" as citing \`${quote.citedFile}\`, but \`${quote.citedFile}\` no longer contains that text verbatim`
|
|
3460
|
+
});
|
|
3461
|
+
}
|
|
3462
|
+
}
|
|
3463
|
+
return findings;
|
|
3464
|
+
}
|
|
3220
3465
|
// ../../packages/aeg-core/src/retired-vocabulary.ts
|
|
3221
3466
|
var RETIRED_PATTERNS = [
|
|
3222
3467
|
String.raw`\bD-[0-9]{3}\b`,
|
|
@@ -3330,6 +3575,10 @@ function checkDispatchReadiness(input) {
|
|
|
3330
3575
|
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.`);
|
|
3331
3576
|
}
|
|
3332
3577
|
for (const dep of input.dependsOn) {
|
|
3578
|
+
if (dep.resolved === false) {
|
|
3579
|
+
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.`);
|
|
3580
|
+
continue;
|
|
3581
|
+
}
|
|
3333
3582
|
if (!dep.merged && !isHandClosedByRecognizedPrincipal(dep, principalAllowlist)) {
|
|
3334
3583
|
const issueStr = dep.issue !== null ? ` (#${dep.issue})` : "";
|
|
3335
3584
|
blockers.push(`dispatch-gate depends-on: ${taskLabel} depends on ${dep.id}${issueStr}, whose PR is not merged yet — not dispatchable, it serializes behind it.`);
|
|
@@ -3739,9 +3988,9 @@ function emitCheckError(error) {
|
|
|
3739
3988
|
|
|
3740
3989
|
// src/lib/config.ts
|
|
3741
3990
|
import { execFileSync as execFileSync3 } from "node:child_process";
|
|
3742
|
-
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
3991
|
+
import { existsSync, mkdirSync, readFileSync, realpathSync, writeFileSync } from "node:fs";
|
|
3743
3992
|
import { homedir } from "node:os";
|
|
3744
|
-
import { dirname, join as join2 } from "node:path";
|
|
3993
|
+
import { dirname, join as join2, resolve } from "node:path";
|
|
3745
3994
|
import { z } from "zod";
|
|
3746
3995
|
|
|
3747
3996
|
// src/lib/agent-vendors.ts
|
|
@@ -3849,6 +4098,20 @@ var ManagedManifestSchema = z.object({
|
|
|
3849
4098
|
labels: z.array(z.string()),
|
|
3850
4099
|
agents: z.array(z.enum(AGENT_VENDORS)).optional()
|
|
3851
4100
|
});
|
|
4101
|
+
var ProjectEntrySchema = z.object({
|
|
4102
|
+
name: z.string().min(1),
|
|
4103
|
+
description: z.string().min(1).optional(),
|
|
4104
|
+
path: z.string().min(1).optional()
|
|
4105
|
+
});
|
|
4106
|
+
function parseTokensCollectDeclaration(value) {
|
|
4107
|
+
const m = value.trim().match(/^(\S+)\s+(\S+)$/);
|
|
4108
|
+
if (!m)
|
|
4109
|
+
return null;
|
|
4110
|
+
const [, interpreter, script] = m;
|
|
4111
|
+
if (!isSafeRepoRelPath(script))
|
|
4112
|
+
return null;
|
|
4113
|
+
return { interpreter, script };
|
|
4114
|
+
}
|
|
3852
4115
|
var VinayaConfigSchema = z.object({
|
|
3853
4116
|
rings: z.object({
|
|
3854
4117
|
ring1_forgeWriteInterception: z.boolean(),
|
|
@@ -3861,13 +4124,19 @@ var VinayaConfigSchema = z.object({
|
|
|
3861
4124
|
principals: z.array(z.string()).min(1).optional(),
|
|
3862
4125
|
releaseActor: z.string().min(1).optional(),
|
|
3863
4126
|
ci: z.object({ setup: z.string().min(1) }).optional(),
|
|
4127
|
+
tokens: z.object({
|
|
4128
|
+
collect: z.string().min(1).refine((v) => parseTokensCollectDeclaration(v) !== null, {
|
|
4129
|
+
message: 'tokens.collect must be exactly "<interpreter> <repo-relative-script-path>" — two whitespace-separated tokens, no flags, no shell syntax, no quoting'
|
|
4130
|
+
})
|
|
4131
|
+
}).optional(),
|
|
3864
4132
|
blastRadius: z.object({ extraDomains: z.array(z.string()).optional() }).optional(),
|
|
3865
4133
|
proseGates: z.object({
|
|
3866
4134
|
doctrineRoot: z.string().min(1).optional(),
|
|
3867
4135
|
readerFacingPrefix: z.string().min(1).optional(),
|
|
3868
4136
|
readerFacingSuffix: z.string().min(1).optional(),
|
|
3869
4137
|
legacySlugDir: z.string().min(1).optional()
|
|
3870
|
-
}).optional()
|
|
4138
|
+
}).optional(),
|
|
4139
|
+
projects: z.array(ProjectEntrySchema).optional()
|
|
3871
4140
|
});
|
|
3872
4141
|
var GLOBAL_VINAYA_HOME = join2(homedir(), ".vinaya");
|
|
3873
4142
|
var GLOBAL_CONFIG_PATH = join2(GLOBAL_VINAYA_HOME, "config.json");
|
|
@@ -3906,6 +4175,9 @@ function globalRolesIgnoredWarning(path) {
|
|
|
3906
4175
|
function globalReleaseActorIgnoredWarning(path) {
|
|
3907
4176
|
return `${path}: "releaseActor" in the global config is ignored — releaseActor may only be declared from a repo-local vinaya.config.json.`;
|
|
3908
4177
|
}
|
|
4178
|
+
function globalTokensCollectIgnoredWarning(path) {
|
|
4179
|
+
return `${path}: "tokens" in the global config is ignored — tokens.collect may only be declared from a repo-local vinaya.config.json.`;
|
|
4180
|
+
}
|
|
3909
4181
|
function stripGlobalOnlyKeys(config, path) {
|
|
3910
4182
|
if (path !== GLOBAL_CONFIG_PATH)
|
|
3911
4183
|
return config;
|
|
@@ -3926,6 +4198,10 @@ function stripGlobalOnlyKeys(config, path) {
|
|
|
3926
4198
|
console.error(`⚠ ${globalReleaseActorIgnoredWarning(path)}`);
|
|
3927
4199
|
result = { ...result, releaseActor: undefined };
|
|
3928
4200
|
}
|
|
4201
|
+
if (result.tokens) {
|
|
4202
|
+
console.error(`⚠ ${globalTokensCollectIgnoredWarning(path)}`);
|
|
4203
|
+
result = { ...result, tokens: undefined };
|
|
4204
|
+
}
|
|
3929
4205
|
return result;
|
|
3930
4206
|
}
|
|
3931
4207
|
function resolvePrincipalAllowlist(config) {
|
|
@@ -4011,6 +4287,7 @@ function loadConfig() {
|
|
|
4011
4287
|
return null;
|
|
4012
4288
|
}
|
|
4013
4289
|
}
|
|
4290
|
+
var TOKENS_COLLECT_TRUST_PATH = join2(GLOBAL_VINAYA_HOME, "tokens-collect-trust.json");
|
|
4014
4291
|
|
|
4015
4292
|
// src/checks/bin/check-doc-coverage.ts
|
|
4016
4293
|
var CHECK_NAME = "doc-coverage";
|