@attalabs/vinaya 0.25.0 → 0.27.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 +6 -4
- package/aeg-root/contracts/architect-planner.md +5 -5
- package/aeg-root/contracts/developer-reviewer.md +7 -7
- package/aeg-root/contracts/planner-developer.md +142 -0
- package/aeg-root/contracts/reviewer-archivist.md +2 -2
- package/aeg-root/contracts/tranche-archivist-planner.md +12 -11
- package/aeg-root/enforcement.md +17 -7
- package/aeg-root/milestone-model.md +2 -0
- package/aeg-root/process.md +53 -75
- package/aeg-root/roles/archivist.md +3 -3
- package/aeg-root/roles/developer.md +10 -10
- package/aeg-root/roles/planner.md +90 -23
- package/aeg-root/roles/principal.md +15 -13
- package/aeg-root/roles/reviewer.md +16 -12
- package/aeg-root/roles/security.md +13 -9
- package/aeg-root/roles/tranche-archivist.md +2 -2
- package/aeg-root/skills/aeg/SKILL.md +5 -5
- package/aeg-root/skills/aeg-roles/SKILL.md +7 -7
- package/aeg-root/state-machine.md +35 -34
- package/aeg-root/task-model.md +3 -3
- package/aeg-root/templates/brief-template.md +2 -2
- package/aeg-root/templates/issue-rationale-template.md +3 -3
- package/aeg-root/tranche-model.md +21 -21
- package/dist/checks/bin/check-body-bare-digits.js +233 -30
- package/dist/checks/bin/check-branch-topology.js +253 -32
- package/dist/checks/bin/check-brief-shape.js +291 -873
- package/dist/checks/bin/check-changeset-coverage.js +1012 -37
- package/dist/checks/bin/check-closes-n.js +253 -32
- package/dist/checks/bin/check-coherence.js +253 -32
- package/dist/checks/bin/check-dead-branch-push.js +215 -30
- package/dist/checks/bin/check-dispatch-readiness.js +256 -35
- package/dist/checks/bin/check-doc-coverage-push.js +1012 -37
- package/dist/checks/bin/check-doc-coverage.js +1014 -39
- package/dist/checks/bin/check-doctrine-no-procedures.js +215 -30
- package/dist/checks/bin/check-doctrine-portability.js +1012 -37
- package/dist/checks/bin/check-evidence-fresh.js +755 -71
- package/dist/checks/bin/check-exec-bits.js +1012 -37
- package/dist/checks/bin/check-first-push-dispatch.js +253 -32
- package/dist/checks/bin/check-issue-assignment.js +253 -32
- package/dist/checks/bin/check-main-branch-refusal.js +216 -31
- package/dist/checks/bin/check-no-disk-state.js +215 -30
- package/dist/checks/bin/check-pr-premise-reassert.js +5489 -0
- package/dist/checks/bin/check-pr-report-density.js +215 -30
- package/dist/checks/bin/check-quoted-command.js +1010 -35
- package/dist/checks/bin/check-reader-resolvable-prose.js +1010 -35
- package/dist/checks/bin/check-registry-gates.js +246 -32
- package/dist/checks/bin/check-retired-vocabulary.js +1010 -35
- package/dist/checks/bin/check-review-gate.js +274 -85
- package/dist/checks/bin/check-single-plan-pr.js +215 -30
- package/dist/checks/bin/check-surface-scope.js +5846 -0
- package/dist/checks/bin/check-test-plan.js +215 -30
- package/dist/checks/bin/check-token-collection-wired.js +215 -30
- package/dist/checks/bin/check-token-report.js +227 -37
- package/dist/checks/bin/check-workspace-escape.js +1010 -35
- package/dist/index.js +2407 -607
- package/package.json +1 -1
- package/aeg-root/contracts/brief-developer.md +0 -141
- package/aeg-root/contracts/planner-brief.md +0 -143
- package/aeg-root/roles/brief-author.md +0 -116
- package/aeg-root/skills/brief-authoring/SKILL.md +0 -509
|
@@ -3,7 +3,7 @@ import { createRequire } from "node:module";
|
|
|
3
3
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
4
4
|
|
|
5
5
|
// src/checks/bin/check-brief-shape.ts
|
|
6
|
-
import { execFileSync as
|
|
6
|
+
import { execFileSync as execFileSync3 } from "node:child_process";
|
|
7
7
|
import { readdirSync, readFileSync as readFileSync3 } from "node:fs";
|
|
8
8
|
// ../../packages/aeg-core/src/gate-audience.ts
|
|
9
9
|
var GATE_AUDIENCE = {
|
|
@@ -28,6 +28,15 @@ var GATE_AUDIENCE = {
|
|
|
28
28
|
internal: "A composite that shells this repo's own `typecheck`/`lint`/`test`/`build` scripts by name. Those names are this monorepo's toolchain (bun + turbo + biome), not an adopter's; the shipped equivalent of its intent is `vinaya check --all`, which is portable by construction."
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
|
+
var NON_GATE_BINS = [
|
|
32
|
+
"archive-task",
|
|
33
|
+
"assign-task-issue",
|
|
34
|
+
"dead-branch-audit",
|
|
35
|
+
"eval-agent-compliance",
|
|
36
|
+
"open-issue",
|
|
37
|
+
"open-pr",
|
|
38
|
+
"report-tokens"
|
|
39
|
+
];
|
|
31
40
|
function isShipped(a) {
|
|
32
41
|
return "shippedAs" in a;
|
|
33
42
|
}
|
|
@@ -295,7 +304,7 @@ function issueListByLabelArgs(owner, repo, label) {
|
|
|
295
304
|
"--state",
|
|
296
305
|
"all",
|
|
297
306
|
"--json",
|
|
298
|
-
"number,title,body,state,labels,milestone",
|
|
307
|
+
"number,title,body,state,labels,milestone,stateReason",
|
|
299
308
|
"--limit",
|
|
300
309
|
"200"
|
|
301
310
|
];
|
|
@@ -388,7 +397,7 @@ var LABELS = [
|
|
|
388
397
|
id: "vinaya/needs:brief-correction",
|
|
389
398
|
category: "needs",
|
|
390
399
|
form: "literal",
|
|
391
|
-
carries: "Waiting on the
|
|
400
|
+
carries: "Waiting on the Planner — the brief contradicts the surface it describes."
|
|
392
401
|
},
|
|
393
402
|
{
|
|
394
403
|
key: "waiver-docs",
|
|
@@ -641,14 +650,19 @@ function resolveTaskIssueRef(title, labels) {
|
|
|
641
650
|
var INTENTS_HEADING = /^#{1,6}\s*Tranche intents\s*$/im;
|
|
642
651
|
var NEXT_HEADING = /^#{1,6}\s+\S/m;
|
|
643
652
|
var INTENT_BULLET = /^-\s+([a-z0-9][a-z0-9-]*)\s*:\s*(.+)$/i;
|
|
644
|
-
function
|
|
645
|
-
const text = stripCode(description, { inlineSpans: "keep" });
|
|
653
|
+
function intentsSection(text) {
|
|
646
654
|
const start = text.match(INTENTS_HEADING);
|
|
647
655
|
if (!start || start.index === undefined)
|
|
648
|
-
return
|
|
656
|
+
return null;
|
|
649
657
|
const rest = text.slice(start.index + start[0].length);
|
|
650
658
|
const next = rest.match(NEXT_HEADING);
|
|
651
|
-
|
|
659
|
+
return rest.slice(0, next && next.index !== undefined ? next.index : rest.length);
|
|
660
|
+
}
|
|
661
|
+
function intentGoalForSlug(description, slug) {
|
|
662
|
+
const text = stripCode(description, { inlineSpans: "keep" });
|
|
663
|
+
const section = intentsSection(text);
|
|
664
|
+
if (section === null)
|
|
665
|
+
return "";
|
|
652
666
|
for (const line of section.split(`
|
|
653
667
|
`)) {
|
|
654
668
|
const trimmed = line.trim();
|
|
@@ -1940,6 +1954,7 @@ function parseInlineFieldList(section) {
|
|
|
1940
1954
|
// ../../packages/aeg-core/src/verdict-extraction.ts
|
|
1941
1955
|
var HEAD_SHA_PATTERN = /^[ \t]*(?:\*{1,3}|_{1,3})?Judged head:\s*([0-9a-f]{7,40})(?![A-Za-z0-9])/im;
|
|
1942
1956
|
var OBJECTIVES_VERSION_PATTERN = /^[ \t]*(?:\*{1,3}|_{1,3})?Objectives version:\s*([0-9a-f]{64})(?![A-Za-z0-9])/im;
|
|
1957
|
+
var RULING_ORDINAL_PATTERN = /^[ \t]*(?:\*{1,3}|_{1,3})?Ruling ordinal:\s*(\d+)(?!\d)/im;
|
|
1943
1958
|
function firstFiveLines(comment) {
|
|
1944
1959
|
return comment.split(`
|
|
1945
1960
|
`).slice(0, 5).join(`
|
|
@@ -1953,6 +1968,15 @@ function extractObjectivesVersion(comment) {
|
|
|
1953
1968
|
const m = firstFiveLines(comment).match(OBJECTIVES_VERSION_PATTERN);
|
|
1954
1969
|
return m ? m[1].toLowerCase() : null;
|
|
1955
1970
|
}
|
|
1971
|
+
function firstSevenLines(comment) {
|
|
1972
|
+
return comment.split(`
|
|
1973
|
+
`).slice(0, 7).join(`
|
|
1974
|
+
`);
|
|
1975
|
+
}
|
|
1976
|
+
function extractRulingOrdinal(comment) {
|
|
1977
|
+
const m = firstSevenLines(comment).match(RULING_ORDINAL_PATTERN);
|
|
1978
|
+
return m ? Number.parseInt(m[1], 10) : null;
|
|
1979
|
+
}
|
|
1956
1980
|
function extractVerdict(comments, valuePattern, missingLabel) {
|
|
1957
1981
|
const candidates = comments.filter((c) => valuePattern.test(c));
|
|
1958
1982
|
if (candidates.length === 0) {
|
|
@@ -1960,6 +1984,7 @@ function extractVerdict(comments, valuePattern, missingLabel) {
|
|
|
1960
1984
|
value: `no ${missingLabel} pass was run before merge — DANGLING, see below`,
|
|
1961
1985
|
headSha: null,
|
|
1962
1986
|
objectivesVersion: null,
|
|
1987
|
+
rulingOrdinal: null,
|
|
1963
1988
|
danglingNote: `no ${missingLabel} verdict comment found on this PR`
|
|
1964
1989
|
};
|
|
1965
1990
|
}
|
|
@@ -1970,6 +1995,7 @@ function extractVerdict(comments, valuePattern, missingLabel) {
|
|
|
1970
1995
|
value: `the most recent ${missingLabel} comment's VERDICT line is not within its first five lines — DANGLING, see below`,
|
|
1971
1996
|
headSha: null,
|
|
1972
1997
|
objectivesVersion: null,
|
|
1998
|
+
rulingOrdinal: null,
|
|
1973
1999
|
danglingNote: `the most recent ${missingLabel} verdict comment carries a VERDICT-shaped line outside the first-five-line read window`
|
|
1974
2000
|
};
|
|
1975
2001
|
}
|
|
@@ -1977,6 +2003,7 @@ function extractVerdict(comments, valuePattern, missingLabel) {
|
|
|
1977
2003
|
value: m[1].toUpperCase().replace(/[_-]/g, " "),
|
|
1978
2004
|
headSha: extractHeadSha(latest),
|
|
1979
2005
|
objectivesVersion: extractObjectivesVersion(latest),
|
|
2006
|
+
rulingOrdinal: extractRulingOrdinal(latest),
|
|
1980
2007
|
danglingNote: null
|
|
1981
2008
|
};
|
|
1982
2009
|
}
|
|
@@ -2338,6 +2365,9 @@ import { createHash as createHash2 } from "node:crypto";
|
|
|
2338
2365
|
var HEADING_RE = /^##[ \t]*Objectives[ \t]*$/im;
|
|
2339
2366
|
var NEXT_HEADING_RE = /^##[ \t]/m;
|
|
2340
2367
|
var OBJECTIVE_LINE_RE = /^O(\d+)\.[ \t]*(.*)$/;
|
|
2368
|
+
function maskedForHeadingSearch(body) {
|
|
2369
|
+
return maskDetailsBlocks(maskCode(body));
|
|
2370
|
+
}
|
|
2341
2371
|
function hasBacktickedPath(text) {
|
|
2342
2372
|
let i = 0;
|
|
2343
2373
|
while (i < text.length) {
|
|
@@ -2360,16 +2390,22 @@ function stripObjectiveBackticks(text) {
|
|
|
2360
2390
|
function wordCount(text) {
|
|
2361
2391
|
return text.split(/\s+/).filter((w) => /[a-z]/i.test(w)).length;
|
|
2362
2392
|
}
|
|
2363
|
-
function
|
|
2364
|
-
const
|
|
2393
|
+
function objectivesSectionBounds(body) {
|
|
2394
|
+
const masked = maskedForHeadingSearch(body);
|
|
2395
|
+
const heading = HEADING_RE.exec(masked);
|
|
2365
2396
|
if (!heading)
|
|
2366
2397
|
return null;
|
|
2367
|
-
const
|
|
2398
|
+
const start = heading.index + heading[0].length;
|
|
2399
|
+
const afterHeading = masked.slice(start);
|
|
2368
2400
|
const next = NEXT_HEADING_RE.exec(afterHeading);
|
|
2369
|
-
return next ?
|
|
2401
|
+
return { start, end: next ? start + next.index : body.length };
|
|
2402
|
+
}
|
|
2403
|
+
function objectivesSectionText(body) {
|
|
2404
|
+
const bounds = objectivesSectionBounds(body);
|
|
2405
|
+
return bounds === null ? null : body.slice(bounds.start, bounds.end);
|
|
2370
2406
|
}
|
|
2371
2407
|
function hasObjectivesHeading(body) {
|
|
2372
|
-
return HEADING_RE.test(body);
|
|
2408
|
+
return HEADING_RE.test(maskedForHeadingSearch(body));
|
|
2373
2409
|
}
|
|
2374
2410
|
function objectivesOf(body) {
|
|
2375
2411
|
const section = objectivesSectionText(body);
|
|
@@ -2395,7 +2431,7 @@ function objectivesOf(body) {
|
|
|
2395
2431
|
continue;
|
|
2396
2432
|
}
|
|
2397
2433
|
if (hasBacktickedPath(text) && wordCount(stripObjectiveBackticks(text)) < MIN_WORDS_OUTSIDE_BACKTICKS) {
|
|
2398
|
-
errors.push(`O${n} is little more than a file path — an objective states an observable outcome, never a bare path (the
|
|
2434
|
+
errors.push(`O${n} is little more than a file path — an objective states an observable outcome, never a bare path (the Planner maps it to files).`);
|
|
2399
2435
|
continue;
|
|
2400
2436
|
}
|
|
2401
2437
|
objectives.push({ id: `O${n}`, text });
|
|
@@ -2429,6 +2465,15 @@ function isIssueNotFoundError(err) {
|
|
|
2429
2465
|
`);
|
|
2430
2466
|
return /could not resolve to an (?:issue|pull request)|\b404\b|not found/i.test(haystack);
|
|
2431
2467
|
}
|
|
2468
|
+
function resolveObjectivesSource(prBody, issue, cutoverIssue) {
|
|
2469
|
+
if (issue !== null && issue < cutoverIssue)
|
|
2470
|
+
return { kind: "none" };
|
|
2471
|
+
if (issue !== null)
|
|
2472
|
+
return { kind: "issue", issue };
|
|
2473
|
+
if (hasObjectivesHeading(prBody))
|
|
2474
|
+
return { kind: "body" };
|
|
2475
|
+
return { kind: "none" };
|
|
2476
|
+
}
|
|
2432
2477
|
|
|
2433
2478
|
// ../../packages/aeg-core/src/premise-check.ts
|
|
2434
2479
|
import { createHash as createHash3 } from "node:crypto";
|
|
@@ -2607,18 +2652,14 @@ function checkTestPlanExclusivity(prBody) {
|
|
|
2607
2652
|
function checkPrincipalPlaceholder(prBody) {
|
|
2608
2653
|
const region = testPlanRegion(prBody);
|
|
2609
2654
|
const lineRe = /^-\s*\[[ xX]\]\s*\*{2}\[principal\]\*{2}(.*)$/gim;
|
|
2655
|
+
const errors = [];
|
|
2610
2656
|
for (const m of region.matchAll(lineRe)) {
|
|
2611
2657
|
const content = m[1] ?? "";
|
|
2612
2658
|
if (/^\s*None\b/i.test(content)) {
|
|
2613
|
-
|
|
2614
|
-
status: "fail",
|
|
2615
|
-
errors: [
|
|
2616
|
-
'brief-validation Test Plan shape: a `**[principal]**` checkbox item is a "None" placeholder — if there is no principal-runnable surface, omit the item entirely; an untickable placeholder box blocks the merge gate forever.'
|
|
2617
|
-
]
|
|
2618
|
-
};
|
|
2659
|
+
errors.push(`brief-validation Test Plan shape: a \`**[principal]**\` checkbox item is a "None" placeholder ("${content.trim()}") — if there is no principal-runnable surface, omit the item entirely; an untickable placeholder box blocks the merge gate forever.`);
|
|
2619
2660
|
}
|
|
2620
2661
|
}
|
|
2621
|
-
return { status: "pass", errors: [] };
|
|
2662
|
+
return errors.length > 0 ? { status: "fail", errors } : { status: "pass", errors: [] };
|
|
2622
2663
|
}
|
|
2623
2664
|
function checkSurfaceMap(prBody) {
|
|
2624
2665
|
return headingCheck(prBody, "(?:technical\\s+)?surface map", "Technical surface map");
|
|
@@ -2934,6 +2975,41 @@ function checkBriefSections(prBody, readTier, options = {}) {
|
|
|
2934
2975
|
];
|
|
2935
2976
|
return { errors: results.flatMap((r) => r.errors) };
|
|
2936
2977
|
}
|
|
2978
|
+
function contentAfterNLines(body, n) {
|
|
2979
|
+
let idx = -1;
|
|
2980
|
+
for (let i = 0;i < n; i++) {
|
|
2981
|
+
idx = body.indexOf(`
|
|
2982
|
+
`, idx + 1);
|
|
2983
|
+
if (idx === -1)
|
|
2984
|
+
return "";
|
|
2985
|
+
}
|
|
2986
|
+
return body.slice(idx + 1);
|
|
2987
|
+
}
|
|
2988
|
+
var BRIEF_MARKER_LINE_RE = /^<!-- aeg:brief:v(\d+) -->$/;
|
|
2989
|
+
function parseBriefMarkerVersion(firstLine) {
|
|
2990
|
+
const m = BRIEF_MARKER_LINE_RE.exec(firstLine.trim());
|
|
2991
|
+
if (!m)
|
|
2992
|
+
return null;
|
|
2993
|
+
const version = Number.parseInt(m[1], 10);
|
|
2994
|
+
return Number.isInteger(version) && version >= 1 ? version : null;
|
|
2995
|
+
}
|
|
2996
|
+
function frozenBriefContent(body, version) {
|
|
2997
|
+
return contentAfterNLines(body, version === 1 ? 2 : 3);
|
|
2998
|
+
}
|
|
2999
|
+
function resolveNewestFrozenBrief(comments, allowlist) {
|
|
3000
|
+
let best = null;
|
|
3001
|
+
for (const c of comments) {
|
|
3002
|
+
if (!isPrincipal(c.author, allowlist))
|
|
3003
|
+
continue;
|
|
3004
|
+
const version = parseBriefMarkerVersion(c.body.split(`
|
|
3005
|
+
`)[0] ?? "");
|
|
3006
|
+
if (version === null)
|
|
3007
|
+
continue;
|
|
3008
|
+
if (best === null || version > best.version)
|
|
3009
|
+
best = { ...c, version };
|
|
3010
|
+
}
|
|
3011
|
+
return best === null ? null : { ...best, content: frozenBriefContent(best.body, best.version) };
|
|
3012
|
+
}
|
|
2937
3013
|
// ../../packages/aeg-core/src/doctrine-portability.ts
|
|
2938
3014
|
var DEFAULT_SHIPS_PREFIX = "aeg-root/";
|
|
2939
3015
|
var STATIC_PORTABLE_PREFIXES = [
|
|
@@ -3176,6 +3252,66 @@ function checkIssueObjectives(body, issueNumber) {
|
|
|
3176
3252
|
return { status: "pass", errors: [] };
|
|
3177
3253
|
return { status: "fail", errors: result.errors.map((e) => `issue-validation objectives: ${e}`) };
|
|
3178
3254
|
}
|
|
3255
|
+
function topLevelSectionText(body, headingName) {
|
|
3256
|
+
const headingRe = new RegExp(`^##[ \\t]*${headingName}[ \\t]*$`, "im");
|
|
3257
|
+
const heading = headingRe.exec(body);
|
|
3258
|
+
if (!heading)
|
|
3259
|
+
return null;
|
|
3260
|
+
const afterHeading = body.slice(heading.index + heading[0].length);
|
|
3261
|
+
const next = /^##[ \t]/m.exec(afterHeading);
|
|
3262
|
+
return next ? afterHeading.slice(0, next.index) : afterHeading;
|
|
3263
|
+
}
|
|
3264
|
+
function looksLikeFilePath(entry2) {
|
|
3265
|
+
const stripped = entry2.replace(/\/\*\*?$/, "");
|
|
3266
|
+
const lastSegment = stripped.split("/").pop() ?? stripped;
|
|
3267
|
+
const extMatch = /\.[A-Za-z0-9]{1,6}$/.exec(lastSegment);
|
|
3268
|
+
return extMatch !== null && extMatch.index > 0;
|
|
3269
|
+
}
|
|
3270
|
+
function splitGlobList(raw) {
|
|
3271
|
+
return raw.split(",").map((s) => s.trim()).filter((s) => s.length > 0);
|
|
3272
|
+
}
|
|
3273
|
+
function parseIssueSurface(body) {
|
|
3274
|
+
const section = topLevelSectionText(body, "Surface");
|
|
3275
|
+
if (section === null)
|
|
3276
|
+
return { ok: false, errors: ["no `## Surface` heading found in the body."] };
|
|
3277
|
+
const inLine = /^in:\s*(.+)$/im.exec(section);
|
|
3278
|
+
const outLine = /^out:\s*(.+)$/im.exec(section);
|
|
3279
|
+
const errors = [];
|
|
3280
|
+
if (!inLine)
|
|
3281
|
+
errors.push("`## Surface` has no `in:` line.");
|
|
3282
|
+
if (!outLine)
|
|
3283
|
+
errors.push("`## Surface` has no `out:` line.");
|
|
3284
|
+
if (errors.length > 0)
|
|
3285
|
+
return { ok: false, errors };
|
|
3286
|
+
const inGlobs = splitGlobList(inLine[1]);
|
|
3287
|
+
const outGlobs = splitGlobList(outLine[1]);
|
|
3288
|
+
for (const g of [...inGlobs, ...outGlobs]) {
|
|
3289
|
+
if (looksLikeFilePath(g)) {
|
|
3290
|
+
errors.push(`\`${g}\` in \`## Surface\` looks like a file path — Surface entries are directory-level globs, never file paths.`);
|
|
3291
|
+
}
|
|
3292
|
+
}
|
|
3293
|
+
if (inGlobs.length === 0)
|
|
3294
|
+
errors.push("`## Surface`'s `in:` line resolved to zero globs.");
|
|
3295
|
+
if (errors.length > 0)
|
|
3296
|
+
return { ok: false, errors };
|
|
3297
|
+
return { ok: true, value: { in: inGlobs, out: outGlobs } };
|
|
3298
|
+
}
|
|
3299
|
+
function globCoversPath(glob, path) {
|
|
3300
|
+
const g = glob.replace(/\/\*\*?$/, "").replace(/\/+$/, "");
|
|
3301
|
+
const p = path.replace(/\/+$/, "");
|
|
3302
|
+
return g === p || g.startsWith(`${p}/`) || p.startsWith(`${g}/`);
|
|
3303
|
+
}
|
|
3304
|
+
function checkSurfaceScope(changedFiles, outGlobs) {
|
|
3305
|
+
if (outGlobs.length === 0)
|
|
3306
|
+
return { ok: true };
|
|
3307
|
+
const violations = [];
|
|
3308
|
+
for (const file of changedFiles) {
|
|
3309
|
+
const glob = outGlobs.find((g) => globCoversPath(g, file));
|
|
3310
|
+
if (glob)
|
|
3311
|
+
violations.push({ file, glob });
|
|
3312
|
+
}
|
|
3313
|
+
return violations.length > 0 ? { ok: false, violations } : { ok: true };
|
|
3314
|
+
}
|
|
3179
3315
|
function isTaskIssueLabelSet(labels) {
|
|
3180
3316
|
return hasLabel("tranche", labels);
|
|
3181
3317
|
}
|
|
@@ -3240,6 +3376,8 @@ function checkProjectsRegistered(body, _labels, registeredNames) {
|
|
|
3240
3376
|
}
|
|
3241
3377
|
return errors.length > 0 ? { status: "fail", errors } : { status: "pass", errors: [] };
|
|
3242
3378
|
}
|
|
3379
|
+
var DOC_PATH_RE = /(?:(?:aeg-root|apps|packages|specs|docs|tools|\.claude|\.github)\/[\w./@-]*\.(?:md|mdx)|\.claude\/(?:skills|rules)\/[\w./-]+|\b(?:docs-index|decisions|projects|state-machine|enforcement|process|README|CLAUDE)\.md\b|\b[\w-]+-(?:spec|decisions|backlog)\.md\b)/i;
|
|
3380
|
+
var DOC_PATH_RE_GLOBAL = new RegExp(DOC_PATH_RE.source, "gi");
|
|
3243
3381
|
|
|
3244
3382
|
// ../../packages/aeg-core/src/coherence-checks.ts
|
|
3245
3383
|
var COHERENCE_ENFORCED_FROM = "2026-07-01";
|
|
@@ -3597,6 +3735,11 @@ function isBoundToObjectives(extraction, currentVersion) {
|
|
|
3597
3735
|
return true;
|
|
3598
3736
|
return extraction.objectivesVersion === currentVersion;
|
|
3599
3737
|
}
|
|
3738
|
+
function isBoundToRulings(extraction, currentOrdinal) {
|
|
3739
|
+
if (extraction.rulingOrdinal === null)
|
|
3740
|
+
return currentOrdinal === 0;
|
|
3741
|
+
return extraction.rulingOrdinal === currentOrdinal;
|
|
3742
|
+
}
|
|
3600
3743
|
function checkReviewGate(input) {
|
|
3601
3744
|
const principalAllowlist = input.principalAllowlist ?? PRINCIPAL_ALLOWLIST;
|
|
3602
3745
|
const waived = isWaiverLabelActorVerified({
|
|
@@ -3625,7 +3768,9 @@ function checkReviewGate(input) {
|
|
|
3625
3768
|
const securityBound = isBoundToPatch(security, input.headSha, input.patchIdOf);
|
|
3626
3769
|
const codeReviewObjectivesBound = isBoundToObjectives(codeReview, input.objectivesVersion);
|
|
3627
3770
|
const securityObjectivesBound = isBoundToObjectives(security, input.objectivesVersion);
|
|
3628
|
-
|
|
3771
|
+
const codeReviewRulingsBound = isBoundToRulings(codeReview, input.rulingOrdinal);
|
|
3772
|
+
const securityRulingsBound = isBoundToRulings(security, input.rulingOrdinal);
|
|
3773
|
+
if (codeReviewClean && codeReviewBound && codeReviewObjectivesBound && codeReviewRulingsBound && securityClean && securityBound && securityObjectivesBound && securityRulingsBound && mechanicalChecksClean) {
|
|
3629
3774
|
return {
|
|
3630
3775
|
verdict: "pass",
|
|
3631
3776
|
reason: `code-reviewer verdict is a clean APPROVE and security-review verdict is a clean PASS, both covering head ${input.headSha}, and every reported mechanical check is green.`,
|
|
@@ -3639,6 +3784,8 @@ function checkReviewGate(input) {
|
|
|
3639
3784
|
problems.push(`the newest code-review verdict covers ${codeReview.headSha ?? "no recorded commit"}, head is ${input.headSha}`);
|
|
3640
3785
|
} else if (!codeReviewObjectivesBound) {
|
|
3641
3786
|
problems.push(`the newest code-review verdict was cast against objectives version ${codeReview.objectivesVersion ?? "none"}, the Issue's list is now ${input.objectivesVersion}`);
|
|
3787
|
+
} else if (!codeReviewRulingsBound) {
|
|
3788
|
+
problems.push(`the newest code-review verdict was cast against ruling ordinal ${codeReview.rulingOrdinal ?? "none"}, a newer ruling (ruling ${input.rulingOrdinal}) is now posted on this PR`);
|
|
3642
3789
|
}
|
|
3643
3790
|
if (!securityClean) {
|
|
3644
3791
|
problems.push(`security-review verdict is not a clean PASS (found: ${security.value})`);
|
|
@@ -3646,6 +3793,8 @@ function checkReviewGate(input) {
|
|
|
3646
3793
|
problems.push(`the newest security-review verdict covers ${security.headSha ?? "no recorded commit"}, head is ${input.headSha}`);
|
|
3647
3794
|
} else if (!securityObjectivesBound) {
|
|
3648
3795
|
problems.push(`the newest security-review verdict was cast against objectives version ${security.objectivesVersion ?? "none"}, the Issue's list is now ${input.objectivesVersion}`);
|
|
3796
|
+
} else if (!securityRulingsBound) {
|
|
3797
|
+
problems.push(`the newest security-review verdict was cast against ruling ordinal ${security.rulingOrdinal ?? "none"}, a newer ruling (ruling ${input.rulingOrdinal}) is now posted on this PR`);
|
|
3649
3798
|
}
|
|
3650
3799
|
if (!mechanicalChecksClean) {
|
|
3651
3800
|
problems.push(reportedMechanicalChecks.length === 0 ? "no mechanical checks have reported for this head yet" : `mechanical check(s) not green: ${reportedMechanicalChecks.filter((c) => c.bucket !== "pass").map((c) => `${c.name} (${c.bucket})`).join(", ")}`);
|
|
@@ -3662,6 +3811,24 @@ var DEFAULT_RELEASE_ACTOR = "github-actions[bot]";
|
|
|
3662
3811
|
function isChangesetsReleasePr(branch, author, expectedAuthor) {
|
|
3663
3812
|
return branch === CHANGESET_RELEASE_BRANCH && author === expectedAuthor;
|
|
3664
3813
|
}
|
|
3814
|
+
// ../../packages/aeg-core/src/ruling-ordinal.ts
|
|
3815
|
+
var RULING_MARKER_ORDINAL = /^<!-- aeg:principal:ruling:\d+-(\d+) -->$/;
|
|
3816
|
+
function newestPrincipalRulingOrdinal(comments, allowlist) {
|
|
3817
|
+
let best = 0;
|
|
3818
|
+
for (const c of comments) {
|
|
3819
|
+
if (!isPrincipal(c.author, allowlist))
|
|
3820
|
+
continue;
|
|
3821
|
+
const firstLine = (c.body.split(`
|
|
3822
|
+
`)[0] ?? "").trim();
|
|
3823
|
+
const m = RULING_MARKER_ORDINAL.exec(firstLine);
|
|
3824
|
+
if (!m)
|
|
3825
|
+
continue;
|
|
3826
|
+
const k = Number.parseInt(m[1], 10);
|
|
3827
|
+
if (k > best)
|
|
3828
|
+
best = k;
|
|
3829
|
+
}
|
|
3830
|
+
return best;
|
|
3831
|
+
}
|
|
3665
3832
|
// ../../packages/aeg-core/src/markdown-table.ts
|
|
3666
3833
|
function splitRow(line) {
|
|
3667
3834
|
const trimmed = line.trim().replace(/^\|/, "").replace(/\|$/, "");
|
|
@@ -3769,16 +3936,33 @@ function checkG1(rows, existsFn) {
|
|
|
3769
3936
|
return { check: "G1", status: findings.length > 0 ? "fail" : "pass", findings };
|
|
3770
3937
|
}
|
|
3771
3938
|
var SCAFFOLD_PLACEHOLDER = "[undocumented — fill in why]";
|
|
3939
|
+
var NON_GATE_BIN_NAMES = NON_GATE_BINS;
|
|
3940
|
+
var TWIN_CANDIDATE_EXCEPTIONS = {
|
|
3941
|
+
"apps/cli/src/checks/bin/check-dead-branch-push.ts": 'Ring 0 "Pushing to a branch whose pull request already resolved" (implementation: check-push-target.ts)',
|
|
3942
|
+
"apps/cli/src/checks/bin/check-issue-assignment.ts": `Ring 0 "A task branch's first push (Issue self-assignment)" (implementation: assign-task-issue.ts)`,
|
|
3943
|
+
"apps/cli/src/checks/bin/check-closes-n.ts": 'Ring 1 "Closes linkage" (implementation: verify-coherence.ts)'
|
|
3944
|
+
};
|
|
3945
|
+
var NON_GATE_HOOK_SCRIPTS = [".claude/hooks/track-transcript.sh"];
|
|
3772
3946
|
function checkG2(rows, candidateFiles) {
|
|
3773
3947
|
const implementations = new Set(rows.map((r) => r.implementation).filter((p) => p !== ""));
|
|
3948
|
+
const claimedNames = new Set(rows.flatMap((r) => claimedCheckNames(r.implementation)));
|
|
3774
3949
|
const findings = [];
|
|
3775
3950
|
for (const path of candidateFiles) {
|
|
3776
|
-
if (
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3951
|
+
if (implementations.has(path))
|
|
3952
|
+
continue;
|
|
3953
|
+
if (path.startsWith(AEG_CORE_BIN_PATH_PREFIX) && NON_GATE_BIN_NAMES.includes(basenameNoExt(path)))
|
|
3954
|
+
continue;
|
|
3955
|
+
if (NON_GATE_HOOK_SCRIPTS.includes(path))
|
|
3956
|
+
continue;
|
|
3957
|
+
if (path in TWIN_CANDIDATE_EXCEPTIONS)
|
|
3958
|
+
continue;
|
|
3959
|
+
const candidateNames = claimedCheckNames(path);
|
|
3960
|
+
if (candidateNames.length > 0 && candidateNames.some((n) => claimedNames.has(n)))
|
|
3961
|
+
continue;
|
|
3962
|
+
findings.push({
|
|
3963
|
+
path,
|
|
3964
|
+
reason: `"${path}" is not named as the implementation of any row in enforcement.md's ring tables`
|
|
3965
|
+
});
|
|
3782
3966
|
}
|
|
3783
3967
|
for (const row of rows) {
|
|
3784
3968
|
const carriesPlaceholder = [row.summary, row.description, row.spec].some((cell) => cell === SCAFFOLD_PLACEHOLDER);
|
|
@@ -3790,7 +3974,7 @@ function checkG2(rows, candidateFiles) {
|
|
|
3790
3974
|
});
|
|
3791
3975
|
}
|
|
3792
3976
|
}
|
|
3793
|
-
return { check: "G2", status: findings.length > 0 ? "
|
|
3977
|
+
return { check: "G2", status: findings.length > 0 ? "fail" : "pass", findings };
|
|
3794
3978
|
}
|
|
3795
3979
|
function checkG3(ring0Rows, crossingFiles) {
|
|
3796
3980
|
const ring0Implementations = new Set(ring0Rows.map((r) => r.implementation));
|
|
@@ -4666,7 +4850,6 @@ function findWorkspaceEscapes(files, knownPaths, workspaceDirs = DEFAULT_WORKSPA
|
|
|
4666
4850
|
import { z } from "zod";
|
|
4667
4851
|
var ROLE_VALUES = [
|
|
4668
4852
|
"planner",
|
|
4669
|
-
"brief-author",
|
|
4670
4853
|
"developer",
|
|
4671
4854
|
"code-reviewer",
|
|
4672
4855
|
"security",
|
|
@@ -4740,18 +4923,20 @@ var dispatchShared = {
|
|
|
4740
4923
|
round: z.number().int().optional(),
|
|
4741
4924
|
effect_id: z.string()
|
|
4742
4925
|
};
|
|
4926
|
+
var dispatchUsageField = z.object({ input: z.number().nonnegative(), output: z.number().nonnegative() }).strict().nullable();
|
|
4743
4927
|
var DispatchEventSchema = z.discriminatedUnion("event", [
|
|
4744
4928
|
z.object({ ...dispatchShared, event: z.literal("dispatched"), prompt_hash: z.string() }).strict(),
|
|
4745
4929
|
z.object({
|
|
4746
4930
|
...dispatchShared,
|
|
4747
4931
|
event: z.literal("outcome_received"),
|
|
4748
4932
|
outcome: DispatchOutcomeSchema,
|
|
4749
|
-
usage:
|
|
4933
|
+
usage: dispatchUsageField
|
|
4750
4934
|
}).strict(),
|
|
4751
4935
|
z.object({
|
|
4752
4936
|
...dispatchShared,
|
|
4753
4937
|
event: z.literal("dispatch_failed"),
|
|
4754
|
-
reason: z.enum(["timeout", "crash", "refused", "unattributed_write"])
|
|
4938
|
+
reason: z.enum(["timeout", "crash", "refused", "unattributed_write"]),
|
|
4939
|
+
usage: dispatchUsageField
|
|
4755
4940
|
}).strict()
|
|
4756
4941
|
]);
|
|
4757
4942
|
var loopShared = {
|
|
@@ -4885,786 +5070,32 @@ function emitCheckError(error) {
|
|
|
4885
5070
|
`);
|
|
4886
5071
|
}
|
|
4887
5072
|
|
|
4888
|
-
// ../../packages/sources/src/commands.ts
|
|
4889
|
-
var COMMANDS = [
|
|
4890
|
-
{
|
|
4891
|
-
name: "help",
|
|
4892
|
-
description: "Show this help text",
|
|
4893
|
-
status: "shipped"
|
|
4894
|
-
},
|
|
4895
|
-
{
|
|
4896
|
-
name: "version",
|
|
4897
|
-
description: "Print the CLI version",
|
|
4898
|
-
flags: [{ flag: "--json", description: "Enveloped JSON output (schema: 1)" }],
|
|
4899
|
-
status: "shipped"
|
|
4900
|
-
},
|
|
4901
|
-
{
|
|
4902
|
-
name: "init",
|
|
4903
|
-
description: "Install Vinaya's git hooks, CI workflow, and starter config (diff-and-confirm, non-destructive)",
|
|
4904
|
-
flags: [
|
|
4905
|
-
{ flag: "--dry-run", description: "Print the full diff without installing anything" },
|
|
4906
|
-
{ flag: "--yes", description: "Skip the confirmation prompt" }
|
|
4907
|
-
],
|
|
4908
|
-
details: [
|
|
4909
|
-
"It detects your repo, prints the complete diff of every intended change, and waits for your confirmation before installing anything. `--dry-run` prints that same diff and installs nothing. Nothing ever runs automatically on package install.",
|
|
4910
|
-
"It installs one CI workflow that runs `vinaya check --all --diff-only`, alongside your existing workflows — refusing to overwrite rather than touching foreign content already at that path. Git hook stubs invoke the `vinaya` binary directly; if a hook already exists, it appends a delimited managed block, shown verbatim in the diff first, rather than overwriting it.",
|
|
4911
|
-
"`vinaya.config.json` is seeded with a starter ruleset extracted from Vinaya's own battle-tested gates, not invented defaults. Issue and PR templates carrying the brief schema are added alongside your own; tier and `needs:*-input` labels are created only if they don't already exist — your existing labels are never modified.",
|
|
4912
|
-
"Two empty folders — `vinaya/checks/` and `vinaya/roles/` — are scaffolded alongside the config, each held open by a placeholder file (git does not track empty directories). `vinaya new noop-check` and `vinaya new role` write their real output into these folders later; both placeholders are recorded in the ownership manifest, so `eject` removes them exactly like everything else `init` created.",
|
|
4913
|
-
"The generated workflows reach the `vinaya` binary through `npx @attalabs/vinaya`, with no build step — unless your repo vendors the CLI itself (a workspace member declaring the name `@attalabs/vinaya`), in which case `npx` would resolve to that unbuilt local member instead of the registry. `init` detects that at generation time and writes workflows that build and run your own copy by path instead, so your CI exercises the code in the pull request. `upgrade` and `doctor` make the same determination, so regenerating is stable.",
|
|
4914
|
-
"The recommended branch-protection command is printed for you to run yourself — it is never applied, and your PATH is never touched. `eject` removes exactly the managed block it owns, or a whole file only if `init` created it."
|
|
4915
|
-
],
|
|
4916
|
-
status: "shipped"
|
|
4917
|
-
},
|
|
4918
|
-
{
|
|
4919
|
-
name: "init product",
|
|
4920
|
-
description: "Register a project in .vinaya/projects.md in an already-initialized repo",
|
|
4921
|
-
flags: [
|
|
4922
|
-
{
|
|
4923
|
-
flag: "--path <path>",
|
|
4924
|
-
description: "The project's home folder — declared, not derived. Defaults to the repo root."
|
|
4925
|
-
}
|
|
4926
|
-
],
|
|
4927
|
-
details: [
|
|
4928
|
-
"Writes (or appends to) `.vinaya/projects.md` — the registry Vinaya Studio's tranche board resolves a project's board link against. Idempotent: re-running with the same name updates nothing.",
|
|
4929
|
-
"Reaches no forge and needs no GitHub remote or credentials: the registry row is a pure local file write, and it is deliberately NOT recorded in the ownership manifest, so `eject` does not reverse adopter-declared data.",
|
|
4930
|
-
"Creates no label. Project is a field, not a label: a task Issue declares its project in the body's `**Project:**` field, and a `project:*` label is ignored wherever one still exists."
|
|
4931
|
-
],
|
|
4932
|
-
status: "shipped"
|
|
4933
|
-
},
|
|
4934
|
-
{
|
|
4935
|
-
name: "check",
|
|
4936
|
-
description: "Run one check, or every registered check",
|
|
4937
|
-
flags: [
|
|
4938
|
-
{ flag: "--all", description: "Run every registered check instead of one named check" },
|
|
4939
|
-
{ flag: "--json", description: "Enveloped JSON output (schema: 1)" },
|
|
4940
|
-
{ flag: "--diff-only", description: "Scope diff-declared checks to changed files" },
|
|
4941
|
-
{
|
|
4942
|
-
flag: "--local",
|
|
4943
|
-
description: "Skip every requiresOpenPr check (closes-n, test-plan) — set by the generated hooks, never by CI"
|
|
4944
|
-
},
|
|
4945
|
-
{ flag: "--parallel[=n]", description: "Concurrency cap (default: cpu-derived)" },
|
|
4946
|
-
{
|
|
4947
|
-
flag: "--plan",
|
|
4948
|
-
description: "Print the resolved check registry and the resolved `roles` registry (default/overridden/additive) without running anything"
|
|
4949
|
-
}
|
|
4950
|
-
],
|
|
4951
|
-
details: [
|
|
4952
|
-
"Each spawned check's child process sees only a fixed baseline (`PATH`, `LANG`, `HOME`, `HTTPS_PROXY`, `HTTP_PROXY`, `NO_PROXY`, `TMPDIR`) plus whatever its `CheckSpec['env']` declaration explicitly forwards — never the full parent environment. A required (`true`) or unsatisfied `anyOf` declaration missing from the caller's environment synthesizes a `CheckError` before the check ever spawns. Declare `env` (a core check's own registration, or `vinaya.config.json`'s `checks.<name>.env` for a custom one) for any check that reads `process.env`/`Bun.env`/`Deno.env` directly — `vinaya doctor` carries the permanent diagnostic for one that doesn't.",
|
|
4953
|
-
"The resolved registry IS what runs. A `checks` key that exactly matches a core check id REPLACES that core check (the core one does not run); any other key must be namespaced `<yourname>/<id>`. Anything the resolver cannot classify — a malformed entry, a bare un-namespaced key matching no core id, a duplicate id — makes `vinaya check` refuse the ENTIRE run: exit 1, nothing executes, never a partial ruleset and never a core-only fallback. `vinaya doctor` carries the permanent diagnostic for each rejected entry, so a refused config is still diagnosable.",
|
|
4954
|
-
"`--plan` composes with `--json`. It requires zero env vars and never prints an env value — only how each one resolves (passthrough, optional, literal, or anyOf). A `FAIL_CLOSED` entry always renders inline rather than being dropped, and exits non-zero. `--plan` and execution read the same resolution, so what the plan prints is what runs.",
|
|
4955
|
-
"`--local` exists because a `requiresOpenPr` check (the core `closes-n`/`test-plan`, or a custom check declaring the same field) can only evaluate for real once a pull request exists — the generated `pre-commit`/`pre-push` hooks pass it so the first commit on a fresh task branch is never asked to satisfy a PR-body field before a PR can possibly exist. CI's `vinaya-checks.yml` omits it, so these checks always run for real once a PR is open.",
|
|
4956
|
-
"`--plan`'s `roles` half resolves `vinaya.config.json`'s `roles` block against bundled doctrine — same override/additive shape as `checks`, with its own RENDERS AS column (the registry key and the role's own `role_id` differ for an additive entry) and a GATING column (`core` vs. `inert` — an additive role carries no core `ACTIONS` wiring). `roles.available` is `false` only when no bundled doctrine can be found next to this CLI install."
|
|
4957
|
-
],
|
|
4958
|
-
status: "shipped"
|
|
4959
|
-
},
|
|
4960
|
-
{
|
|
4961
|
-
name: "commit-msg",
|
|
4962
|
-
description: "The generated `commit-msg` hook's invocation target — validates a commit message's first line",
|
|
4963
|
-
details: [
|
|
4964
|
-
"Not meant to be run by hand day-to-day: the managed `commit-msg` hook calls `vinaya commit-msg <message-file> [source]` with the two arguments git itself passes a commit-msg hook (githooks(5)) — the message file path and, when known, the commit's source keyword.",
|
|
4965
|
-
"Validates the message file's first line against the same `Type(scope): Description` vocabulary `check`'s `forge-title`-shaped gates enforce on PR/Issue titles (`@attalabs/aeg-core`'s `COMMIT_TYPES` — the commitlint type set plus `Plan`). Exits 0 with no output on a conforming message; a `source` of `merge` is skipped outright, since a merge commit's message is written by git, not the person committing."
|
|
4966
|
-
],
|
|
4967
|
-
status: "shipped"
|
|
4968
|
-
},
|
|
4969
|
-
{
|
|
4970
|
-
name: "new check",
|
|
4971
|
-
description: "Scaffold a custom check into ./scripts/vinaya-checks/",
|
|
4972
|
-
details: [
|
|
4973
|
-
"Takes the REGISTRATION KEY, not a bare name: `vinaya new check <yourname>/<id>` writes `./scripts/vinaya-checks/<id>.ts` and prints the namespaced `checks` entry to paste. It refuses a bare, un-namespaced name — `vinaya check` refuses its entire run over a key it cannot resolve, so scaffolding one would brick every check invocation in the repo — and refuses a core check id, since registering one REPLACES that core gate and a scaffolded stub is never what an adopter means by that."
|
|
4974
|
-
],
|
|
4975
|
-
status: "shipped"
|
|
4976
|
-
},
|
|
4977
|
-
{
|
|
4978
|
-
name: "new noop-check",
|
|
4979
|
-
description: "Scaffold an explicit no-op into vinaya/checks/ that silences a core check",
|
|
4980
|
-
details: [
|
|
4981
|
-
"Takes a CORE check id — the opposite of what `new check` accepts, which refuses one. `vinaya new noop-check <core-check-id>` writes `vinaya/checks/<id>.ts`, an explicit, contract-satisfying no-op (always exits `0`, emits no findings, carries a comment marking the silencing as intentional) and prints the `checks` entry that REPLACES the named core check with it. This is the only sanctioned way to silence a core check."
|
|
4982
|
-
],
|
|
4983
|
-
status: "shipped"
|
|
4984
|
-
},
|
|
4985
|
-
{
|
|
4986
|
-
name: "new role",
|
|
4987
|
-
description: "Scaffold an additive role contract into vinaya/roles/",
|
|
4988
|
-
details: [
|
|
4989
|
-
'Takes the REGISTRATION KEY: `vinaya new role <yourname>/<id>` writes `vinaya/roles/<id>.md` — a structurally-valid role contract stub (the six frontmatter keys plus `title`/`order`, and a non-empty "## The short version" section) whose own `role_id` is set to `<id>` — and prints the `roles` entry to paste. It refuses a bare, un-namespaced key: that shape resolves as an OVERRIDE of a core role, a complete replacement of that role\'s contract and a real governance decision this scaffolder does not make for you.'
|
|
4990
|
-
],
|
|
4991
|
-
status: "shipped"
|
|
4992
|
-
},
|
|
4993
|
-
{
|
|
4994
|
-
name: "brief render",
|
|
4995
|
-
description: "Emit the twelve-section brief skeleton from the forge and the tree, every derivable section filled",
|
|
4996
|
-
flags: [
|
|
4997
|
-
{ flag: "--surfaces <glob1,glob2,...>", description: "Intended surface globs, expanded against tracked files" },
|
|
4998
|
-
{ flag: "--out <path>", description: "Write the rendered brief to a file instead of stdout" }
|
|
4999
|
-
],
|
|
5000
|
-
details: [
|
|
5001
|
-
"Reads the task Issue (`vinaya/tranche:<tranche>`-labeled, id `<n>`) and the tree, and fills every section a program can derive: the header `Project:`/`Tier:`/`Closes #N`, the Step 0 worktree line, the dispatch-gate status as the pre-flight line, §4's file list (with consumer packages and a `sha256` premise pin per file, and Out of surface from the Issue's own `## Surface` `out:` list), §6 from the Issue's `## Parts`, §7 from the `.vinaya/doc-owners` derivation, §9 from the Issue's `## Test plan`, §10 from the Issue's `## Stop conditions` plus the rationale's Stop-and-escalate field, and every remaining section from the Issue's eight-field Planner rationale. Refuses — naming the missing section — when it cannot be derived: no Issue, the dispatch gate not clear, a `--surfaces` glob matching no tracked file, or the Issue missing/malformed `## Surface`/`## Parts`/`## Test plan`/`## Stop conditions` — never a bracketed placeholder.",
|
|
5002
|
-
"Never writes under `aeg-root/` or to the Issue — a brief is pasted to the Developer, never committed. Reads `aeg-root/templates/brief-template.md` at run time for its one fixed sentence and the standing autonomy clause; every other byte is generated from the forge/tree facts."
|
|
5003
|
-
],
|
|
5004
|
-
status: "shipped"
|
|
5005
|
-
},
|
|
5006
|
-
{
|
|
5007
|
-
name: "task dispatch",
|
|
5008
|
-
description: "Render, pin, and post the brief on the Issue as the frozen original; start the developer",
|
|
5009
|
-
flags: [
|
|
5010
|
-
{ flag: "--agent <claude|codex|gemini>", description: "Start the developer through dispatchRole once posted" }
|
|
5011
|
-
],
|
|
5012
|
-
details: [
|
|
5013
|
-
"Renders the brief from the Issue and the tree (the same assembly `brief render` uses) and posts it once as an Issue comment whose first line is `<!-- aeg:brief:v1 -->` and whose second line is `Brief hash: <sha256>` — the hash covers only the body below those two lines, so any reader recomputes it. Refuses outright, naming the existing comment's URL, when a `v1` comment already exists on the Issue — the brief is frozen by design, never overwritten or silently reissued.",
|
|
5014
|
-
"With `--agent`, starts the Developer through `dispatchRole` when `apps/cli/src/lib/dispatch.ts` exports it; otherwise prints the rendered brief and the manual dispatch instruction and exits `0` — a soft dependency, never a hard block.",
|
|
5015
|
-
"Principal-only, with or without `--agent`: refuses before any render, forge read, or post when the authenticated `gh` identity is not on the Principal allowlist (or cannot be resolved at all) — dispatching is the `todo → in-flight` transition, not a general-purpose comment poster."
|
|
5016
|
-
],
|
|
5017
|
-
status: "shipped"
|
|
5018
|
-
},
|
|
5019
|
-
{
|
|
5020
|
-
name: "pr create",
|
|
5021
|
-
description: "Open a pull request after full brief-schema validation",
|
|
5022
|
-
flags: [
|
|
5023
|
-
{ flag: "--title", description: "PR title (validated against the forge-title grammar)" },
|
|
5024
|
-
{ flag: "--body-file", description: "Path to the PR body (stream-safe; the same bytes are validated and sent)" },
|
|
5025
|
-
{ flag: "--label", description: "Label(s) to apply (repeatable, comma-separated)" },
|
|
5026
|
-
{ flag: "--validate-only", description: "Run every gate and report PASS without opening the PR" },
|
|
5027
|
-
{ flag: "--json", description: "Enveloped JSON output (schema: 1)" }
|
|
5028
|
-
],
|
|
5029
|
-
details: [
|
|
5030
|
-
"Runs the config-defined brief-schema gate (`briefSchema.pr` in `vinaya.config.json`) LOCALLY before any `gh` write — prevention, not detection. On any failure it refuses with the versioned CheckError contract (one JSON line per finding on stderr, exit 1) whose `agent_recovery_prompt` names the exact corrective command.",
|
|
5031
|
-
"Which sections bind depends on the branch, matching the `brief-shape` check that runs the same grammar in CI. On a `task/<tranche>/<n>` branch every configured section binds, `closesN` included. On any other branch a body that is not brief-shaped is exempt entirely — an ordinary one-line dependency bump is not made to grow a brief — while a brief-shaped body is still graded on every other section, since a standalone fix brief is a brief; only `closesN` is dropped, because such a branch has no task Issue to close. The title grammar sits outside all of this and binds on every branch.",
|
|
5032
|
-
"A branch counts as resolvable only when HEAD is a symbolic ref that also resolves to a commit. Neither git query answers that alone: `rev-parse --abbrev-ref HEAD` reports the literal string `HEAD` on a detached HEAD, and `symbolic-ref` reports the not-yet-created branch name when HEAD is unborn. Reading either as an ordinary branch would take the relaxed path, so both states — plus running outside a repo — resolve to nothing and the gate is fail-closed: every configured section is enforced."
|
|
5033
|
-
],
|
|
5034
|
-
status: "shipped"
|
|
5035
|
-
},
|
|
5036
|
-
{
|
|
5037
|
-
name: "pr edit",
|
|
5038
|
-
description: "Edit an existing pull request (<n>) after full brief-schema validation",
|
|
5039
|
-
flags: [
|
|
5040
|
-
{ flag: "--title", description: "New PR title (validated against the forge-title grammar)" },
|
|
5041
|
-
{ flag: "--body-file", description: "Path to the new PR body (stream-safe; same bytes validated and sent)" },
|
|
5042
|
-
{ flag: "--validate-only", description: "Run every gate and report PASS without editing the PR" },
|
|
5043
|
-
{ flag: "--json", description: "Enveloped JSON output (schema: 1)" }
|
|
5044
|
-
],
|
|
5045
|
-
details: [
|
|
5046
|
-
"The target PR's real head branch and changed files are fetched from the forge to build the validation context — a failed fetch is a hard refusal, never a fall-back to the local checkout.",
|
|
5047
|
-
"That fetched head branch is what selects the section set, by the same branch grammar `pr create` uses — a property of the target PR, never of whatever the local checkout happens to have checked out."
|
|
5048
|
-
],
|
|
5049
|
-
status: "shipped"
|
|
5050
|
-
},
|
|
5051
|
-
{
|
|
5052
|
-
name: "pr report",
|
|
5053
|
-
description: "Emit the AEG:EVIDENCE block — a PR body's factual claims, from commands, never typed",
|
|
5054
|
-
flags: [
|
|
5055
|
-
{
|
|
5056
|
-
flag: "--write",
|
|
5057
|
-
description: "Path to the PR body file; replaces the content between the AEG:EVIDENCE anchors in place"
|
|
5058
|
-
},
|
|
5059
|
-
{
|
|
5060
|
-
flag: "--push",
|
|
5061
|
-
description: "PR number; splices the same content into that PR's LIVE body (fetched from the forge) and pushes it via `gh pr edit`, self-verifying nothing outside the AEG:EVIDENCE/AEG:TOKENS regions changed. Mutually exclusive with --write."
|
|
5062
|
-
}
|
|
5063
|
-
],
|
|
5064
|
-
details: [
|
|
5065
|
-
"Two groups: Group A (recomputable) is the head sha and a width-invariant `git diff --numstat` against the merge-base with `BASE_SHA` (else `origin/main`, then `main`) — `check-evidence-fresh` recomputes and byte-compares this exactly. Group B (attested) is the result of `vinaya check --all --diff-only`, this CLI's own portable gate suite — `check-evidence-fresh` can only check it for staleness (the block's recorded head still matches the PR's real head), never re-run it.",
|
|
5066
|
-
"With no `--write`/`--push`, prints the block to stdout instead of writing a file. Exits non-zero whenever the gate run failed, whether or not `--write`/`--push` was given — the block records a failing result rather than hiding one, and a non-zero exit stops a scripted `--write && open-pr` (or `--push`) from carrying a failing suite onto the forge.",
|
|
5067
|
-
"`--push` refuses before writing anything when the live body carries no real `AEG:EVIDENCE` pair (it never appends one, unlike `--write`), when the anchor resolves differently before and after normalisation, or when `<pr>` isn't a bare number. When the live body has no real `AEG:TOKENS` pair, the token splice is skipped (same reasoning, softer outcome) rather than creating one. After pushing, it re-reads the live body and restores the pre-edit body — exiting non-zero — if anything outside the two anchored regions changed."
|
|
5068
|
-
],
|
|
5069
|
-
status: "shipped"
|
|
5070
|
-
},
|
|
5071
|
-
{
|
|
5072
|
-
name: "pr rule",
|
|
5073
|
-
description: "Post a Principal ruling on a PR, marked and versioned — never mistaken for a review verdict",
|
|
5074
|
-
flags: [
|
|
5075
|
-
{ flag: "--file", description: "Path to the ruling file to post as a PR comment" },
|
|
5076
|
-
{ flag: "--json", description: "Enveloped JSON output (schema: 1)" }
|
|
5077
|
-
],
|
|
5078
|
-
details: [
|
|
5079
|
-
"Refuses before posting when the file's first line reads as an escalation (`ESCALATE:`), or when the file carries verdict grammar anywhere `extractCodeReviewVerdict`/`extractSecurityReviewVerdict` would treat as a candidate — a `VERDICT:` line past the extractor's own first-five-line window still counts, since the whole-body candidate test is what disqualifies the file, not merely a clean read.",
|
|
5080
|
-
"Marker numbers (`<!-- aeg:principal:ruling:<pr>-<k> -->`) are counted on the forge at post time from `gh pr view --json comments`, never derived from a local file — two rulings racing to the same number are a known, undocumented-lock case."
|
|
5081
|
-
],
|
|
5082
|
-
status: "shipped"
|
|
5083
|
-
},
|
|
5084
|
-
{
|
|
5085
|
-
name: "pr verify-evidence",
|
|
5086
|
-
description: "Prove a pull request's AEG:EVIDENCE region was machine-generated — regenerate it and compare",
|
|
5087
|
-
flags: [],
|
|
5088
|
-
details: [
|
|
5089
|
-
"Deliberately a command, not a check: `evidence-fresh` runs inside `vinaya check --all`, and `pr report` runs `vinaya check --all --diff-only`, so a check that regenerated the block would run the suite containing itself. That recursion is why `evidence-fresh` verifies Group A only and leaves Group B attested.",
|
|
5090
|
-
"Must be run from the repository ROOT of a CLEAN checkout at the pull request's head, and refuses otherwise. The regeneration inherits the working directory and several gates resolve their scan root from it, so a subdirectory silently narrows what the fresh run inspects. On cleanliness: Group B is regenerated by diff-scoped checks, so uncommitted or untracked files change which files are scanned and can produce a MATCH a clean checkout would not. Ignored paths are deliberately NOT inspected — `git diff` never reports one, so they cannot change the scope, and including them would refuse in every real checkout since `node_modules` is ignored and always present. The head is read from the forge and both a mismatch AND an unreadable head refuse — the verdict is bound to a commit, never merely attested. `BASE_SHA` is refused as well, since it steers the regeneration's merge-base.",
|
|
5091
|
-
"Exits 0 on MATCH; 1 on DIFFERS, HIDDEN, or no block; 2 on a refusal (dirty worktree, wrong head, usage error). HIDDEN means the anchor pair sits inside a collapsed `<details>` block, where `body-bare-digits` blanks every digit and nothing can verify what it claims.",
|
|
5092
|
-
"Comparison is a multiset of repo-relative, control-stripped lines: absolute paths (local AND foreign, so a block generated in CI compares against one generated on a laptop) and line order are ignored — a reorder is not a fabrication. Only the AEG:EVIDENCE region is read, since AEG:TOKENS appends by design. A moved merge-base is reported ALONGSIDE the differing lines, never instead of them."
|
|
5093
|
-
],
|
|
5094
|
-
status: "shipped"
|
|
5095
|
-
},
|
|
5096
|
-
{
|
|
5097
|
-
name: "issue create",
|
|
5098
|
-
description: "Open an issue after full brief-schema validation",
|
|
5099
|
-
flags: [
|
|
5100
|
-
{ flag: "--title", description: "Issue title (validated on task Issues)" },
|
|
5101
|
-
{ flag: "--body-file", description: "Path to the Issue body (stream-safe; same bytes validated and sent)" },
|
|
5102
|
-
{ flag: "--label", description: "Label(s) to apply; a `vinaya/tranche:*` label marks a task Issue" },
|
|
5103
|
-
{ flag: "--validate-only", description: "Run every gate and report PASS without opening the Issue" },
|
|
5104
|
-
{ flag: "--json", description: "Enveloped JSON output (schema: 1)" }
|
|
5105
|
-
],
|
|
5106
|
-
details: [
|
|
5107
|
-
"A task Issue (any `vinaya/tranche:*` label) must carry the full Planner rationale (`briefSchema.issue`); non-task Issues pass through unvalidated."
|
|
5108
|
-
],
|
|
5109
|
-
status: "shipped"
|
|
5110
|
-
},
|
|
5111
|
-
{
|
|
5112
|
-
name: "issue edit",
|
|
5113
|
-
description: "Edit an existing issue (<n>) after full brief-schema validation",
|
|
5114
|
-
flags: [
|
|
5115
|
-
{ flag: "--title", description: "New Issue title (validated on task Issues)" },
|
|
5116
|
-
{ flag: "--body-file", description: "Path to the new Issue body (stream-safe; same bytes validated and sent)" },
|
|
5117
|
-
{ flag: "--validate-only", description: "Run every gate and report PASS without editing the Issue" },
|
|
5118
|
-
{ flag: "--json", description: "Enveloped JSON output (schema: 1)" }
|
|
5119
|
-
],
|
|
5120
|
-
details: [
|
|
5121
|
-
"The target Issue's actual labels are fetched from the forge and unioned with argv to decide task-Issue applicability — a failed fetch is a hard refusal."
|
|
5122
|
-
],
|
|
5123
|
-
status: "shipped"
|
|
5124
|
-
},
|
|
5125
|
-
{
|
|
5126
|
-
name: "issue objectives edit",
|
|
5127
|
-
description: "Rewrite a task Issue's `## Objectives` section by command — versioned, findable on the forge",
|
|
5128
|
-
flags: [
|
|
5129
|
-
{ flag: "--add", description: "Append a new objective as `O<max+1>` with the given sentence" },
|
|
5130
|
-
{ flag: "--drop", description: "Remove an objective by id (`O<k>`) — never renumbers the survivors" },
|
|
5131
|
-
{
|
|
5132
|
-
flag: "--replace",
|
|
5133
|
-
description: 'Replace an objective\'s sentence in place, keeping its id (`O<k>` "<sentence>")'
|
|
5134
|
-
},
|
|
5135
|
-
{ flag: "--reason", description: "Required, non-empty: why this change is being made" },
|
|
5136
|
-
{ flag: "--json", description: "Enveloped JSON output (schema: 1)" }
|
|
5137
|
-
],
|
|
5138
|
-
details: [
|
|
5139
|
-
"Exactly one of `--add`/`--drop`/`--replace` is required. Every edit goes through the same validated `issue edit` write path (`writeValidatedIssueEdit`) as `vinaya issue edit` itself — no second, unvalidated write path.",
|
|
5140
|
-
"A `--drop` that leaves the surviving objectives non-contiguous from `O1` is refused with `objectivesOf`'s own parser message: dropping never renumbers survivors, and task 1's contiguous-from-O1 grammar is the one parser everything else reads, so a live contradiction between the two stops here for a Principal ruling rather than silently renumbering.",
|
|
5141
|
-
"Splices the rendered section back in place (`## Objectives` heading through the next `##` heading, or end of body) — every other byte of the Issue body is untouched. Posts one comment marked `<!-- aeg:objectives:v<k> -->` carrying the previous list, the new list, the reason, and the new `objectivesVersion`; `k` is counted on the forge at post time, never derived from a local file."
|
|
5142
|
-
],
|
|
5143
|
-
status: "shipped"
|
|
5144
|
-
},
|
|
5145
|
-
{
|
|
5146
|
-
name: "log flush",
|
|
5147
|
-
description: "Post a target Issue or PR's outbox as one or more marked comments, then truncate what the forge confirmed",
|
|
5148
|
-
flags: [
|
|
5149
|
-
{ flag: "--issue", description: "Flush this Issue's outbox (`~/.vinaya/outbox/<owner>-<repo>/<n>.ndjson`)" },
|
|
5150
|
-
{
|
|
5151
|
-
flag: "--pr",
|
|
5152
|
-
description: "Flush the Issue named by this PR's `Closes #N` line, posting the comments on the PR"
|
|
5153
|
-
},
|
|
5154
|
-
{ flag: "--json", description: "Enveloped JSON output (schema: 1)" }
|
|
5155
|
-
],
|
|
5156
|
-
details: [
|
|
5157
|
-
"Exactly one of `--issue`/`--pr` is required. `--pr` resolves the Issue from the PR body's `Closes #N` line — the same anchor every gate reads — and refuses with a check error naming the missing line when the body carries none.",
|
|
5158
|
-
"Splits the outbox first at `run_id` boundaries (a maximal run of consecutive lines sharing one `run_id`, never a global group-by, so an interleaved outbox never produces a range spanning a gap), then at `FORGE_COMMENT_MAX_CHARS` (65536) within each run. Each comment opens with `<!-- aeg:log:<run_id>:<seq_from>-<seq_to> -->` on its own line, then one fenced `ndjson` block, one outbox line per line, verbatim. A single line too large to fit alone is refused by name, never split across two comments.",
|
|
5159
|
-
"Logs its own `forge_write` line — `validated` before posting, `written` (with every returned comment id) after the last post succeeds, or `refused` (with gh's error) on any failure — through the same `log()` every other family uses, into the same outbox, before truncating. The outbox is truncated only to the lines confirmed posted; a failed chunk's lines, and anything appended to the outbox during the flush (including the flush's own `validated`/`written`/`refused` line), always survive to ride the next flush."
|
|
5160
|
-
],
|
|
5161
|
-
status: "shipped"
|
|
5162
|
-
},
|
|
5163
|
-
{
|
|
5164
|
-
name: "milestone create",
|
|
5165
|
-
description: "Create a GitHub Milestone from a validated body",
|
|
5166
|
-
flags: [
|
|
5167
|
-
{ flag: "--title", description: "Milestone title — free text, never parsed for a version" },
|
|
5168
|
-
{
|
|
5169
|
-
flag: "--body-file",
|
|
5170
|
-
description: "Path to the Milestone description (stream-safe; same bytes validated and sent)"
|
|
5171
|
-
},
|
|
5172
|
-
{ flag: "--validate-only", description: "Run every gate and report PASS without creating the Milestone" },
|
|
5173
|
-
{ flag: "--json", description: "Enveloped JSON output (schema: 1)" }
|
|
5174
|
-
],
|
|
5175
|
-
details: [
|
|
5176
|
-
"Refuses before any `gh` call when the goal is absent, an optional `Release:` field is present but not a version, or an optional `### Tranche intents` section (`- <slug>: <intent text>`) doesn't parse. `Release:` is the sole authority for the milestone's version — the title is never parsed for one."
|
|
5177
|
-
],
|
|
5178
|
-
status: "shipped"
|
|
5179
|
-
},
|
|
5180
|
-
{
|
|
5181
|
-
name: "milestone adopt",
|
|
5182
|
-
description: "Move one or more existing tranches into a target Milestone",
|
|
5183
|
-
flags: [
|
|
5184
|
-
{ flag: "--target", description: "The Milestone every named slug is adopted into" },
|
|
5185
|
-
{ flag: "--slug", description: "A tranche slug to adopt — repeatable for a multi-slug move" },
|
|
5186
|
-
{ flag: "--validate-only", description: "Run every gate and report PASS without writing anything" },
|
|
5187
|
-
{ flag: "--json", description: "Enveloped JSON output (schema: 1)" }
|
|
5188
|
-
],
|
|
5189
|
-
details: [
|
|
5190
|
-
"Reattaches every Issue carrying each named `vinaya/tranche:<slug>` label to `--target`, then closes (never deletes) each slug's old tranche-Milestone. Every fact for every named slug is gathered and checked in ONE call before any write, so a single unsafe slug — an unknown slug, a slug whose label carries no Issues, a target that does not exist or is closed, or a slug already adopted into a different Milestone — refuses the whole invocation, not just its own slug."
|
|
5191
|
-
],
|
|
5192
|
-
status: "shipped"
|
|
5193
|
-
},
|
|
5194
|
-
{
|
|
5195
|
-
name: "milestone edit",
|
|
5196
|
-
description: "Edit an existing Milestone (<n>) after full brief-schema validation",
|
|
5197
|
-
flags: [
|
|
5198
|
-
{
|
|
5199
|
-
flag: "--body-file",
|
|
5200
|
-
description: "Path to the new Milestone description (stream-safe; same bytes validated and sent)"
|
|
5201
|
-
},
|
|
5202
|
-
{ flag: "--validate-only", description: "Run every gate and report PASS without editing the Milestone" },
|
|
5203
|
-
{ flag: "--json", description: "Enveloped JSON output (schema: 1)" }
|
|
5204
|
-
],
|
|
5205
|
-
details: [
|
|
5206
|
-
"Same `checkMilestoneShape` refusal `create` runs, before any `gh` call — the gated replacement for a raw `gh api PATCH` against a Milestone. Only the description changes; the title is untouched."
|
|
5207
|
-
],
|
|
5208
|
-
status: "shipped"
|
|
5209
|
-
},
|
|
5210
|
-
{
|
|
5211
|
-
name: "milestone close",
|
|
5212
|
-
description: "Close a tranche's Milestone after verifying every labeled Issue is actually attached",
|
|
5213
|
-
flags: [
|
|
5214
|
-
{ flag: "--slug", description: "The tranche whose Milestone is being closed" },
|
|
5215
|
-
{ flag: "--validate-only", description: "Run every gate and report PASS without closing the Milestone" },
|
|
5216
|
-
{ flag: "--json", description: "Enveloped JSON output (schema: 1)" }
|
|
5217
|
-
],
|
|
5218
|
-
details: [
|
|
5219
|
-
"Resolves the target Milestone the same legacy-or-intent-declared way Issue create auto-attach does, then refuses to close on any mismatch between the label's Issues and the Milestone's natively attached Issues — naming each unattached or foreign Issue and its repair path (`gh issue edit <n> --milestone <title>`, or `vinaya milestone adopt`) — before the PATCH ever reaches the forge."
|
|
5220
|
-
],
|
|
5221
|
-
status: "shipped"
|
|
5222
|
-
},
|
|
5223
|
-
{
|
|
5224
|
-
name: "review status",
|
|
5225
|
-
description: "Print the review loop's own state for a PR, and its branch's distance from the base",
|
|
5226
|
-
details: [
|
|
5227
|
-
"Two lines at most. The first is `CONTINUE`, `PAUSE: <reason>[ <id>]` for `reappearance`, `zero-deaths` or `max-rounds` — or, for `stale`, the actionable fact itself: `push after verdict — re-review required`. The second reads `behind main by <n> — merge first` when the branch is behind its base, or `behind main: unknown — fetch origin/<base> first` when git cannot measure the distance; it is absent only when the branch is measurably not behind.",
|
|
5228
|
-
"Rounds are derived from the PR's own verdict comments — one round per `Judged head:` value, read through the same extractors the merge gate blocks on, and only from comments an allowlisted principal authored. A Developer round comment is recognised by its `<!-- aeg:developer:round-<n> -->` marker, at that fixed position, never by scanning its prose.",
|
|
5229
|
-
"Exit `0` only when the state is `CONTINUE` and the branch is not behind; `1` otherwise, so a script can gate on the exit code without parsing the text."
|
|
5230
|
-
],
|
|
5231
|
-
status: "shipped"
|
|
5232
|
-
},
|
|
5233
|
-
{
|
|
5234
|
-
name: "review post",
|
|
5235
|
-
description: "Render, post, and self-verify a code-reviewer or security-review verdict comment on a PR",
|
|
5236
|
-
flags: [
|
|
5237
|
-
{ flag: "--role", description: "`code-reviewer` or `security` — selects which role template is rendered" },
|
|
5238
|
-
{
|
|
5239
|
-
flag: "--pr",
|
|
5240
|
-
description: "Target PR number — its real head is resolved via `gh pr view`, never caller-supplied"
|
|
5241
|
-
},
|
|
5242
|
-
{
|
|
5243
|
-
flag: "--verdict",
|
|
5244
|
-
description: "Optional — derived from the findings file (code-reviewer: `APPROVE`/`REQUEST_CHANGES`; security: `PASS`/`FAIL`). Refused before posting if it disagrees with the derivation."
|
|
5245
|
-
},
|
|
5246
|
-
{
|
|
5247
|
-
flag: "--escalate",
|
|
5248
|
-
description: "`authority` | `strategy` | `product` — posts an `ESCALATE:` comment instead of a verdict. Refused together with `--verdict` or a blocking finding."
|
|
5249
|
-
},
|
|
5250
|
-
{ flag: "--summary", description: "Required with `--escalate` — the escalation body text" },
|
|
5251
|
-
{
|
|
5252
|
-
flag: "--findings-file",
|
|
5253
|
-
description: "One finding per line: `SEVERITY|file:line|description` (`|`-delimited). A re-review names a prior id in the description as `F<n> <class> <state>:`. Omit for zero findings."
|
|
5254
|
-
},
|
|
5255
|
-
{
|
|
5256
|
-
flag: "--objectives-file",
|
|
5257
|
-
description: "One line per objective: `O<n>|MET|<evidence>` or `O<n>|NOT MET|<evidence>` (`|`-delimited; evidence is the rest of the line). Required whenever the closed Issue (or the PR body's own `## Objectives`) has an objectives list to judge; its ids must cover that list exactly, and a re-review must restate every prior objective. Never together with `--escalate`."
|
|
5258
|
-
},
|
|
5259
|
-
{ flag: "--brief-conformance", description: "code-reviewer only: the BRIEF CONFORMANCE line" },
|
|
5260
|
-
{ flag: "--spec-conformance", description: "code-reviewer only: the SPEC CONFORMANCE line" },
|
|
5261
|
-
{ flag: "--scope", description: "code-reviewer only: the SCOPE line" },
|
|
5262
|
-
{
|
|
5263
|
-
flag: "--scope-evidence-file",
|
|
5264
|
-
description: "code-reviewer only: pasted diff-stat output, rendered as a fence directly below the verdict block"
|
|
5265
|
-
},
|
|
5266
|
-
{ flag: "--tests", description: "code-reviewer only: the TESTS line" },
|
|
5267
|
-
{ flag: "--docs", description: "code-reviewer only: the DOCS line" },
|
|
5268
|
-
{ flag: "--config-scan", description: "security only: the CONFIG SCAN line" },
|
|
5269
|
-
{ flag: "--secrets", description: "security only: the SECRETS line" },
|
|
5270
|
-
{
|
|
5271
|
-
flag: "--secrets-evidence-file",
|
|
5272
|
-
description: 'security only: required whenever `--secrets` claims "none found" — the pasted scanner output backing that claim'
|
|
5273
|
-
},
|
|
5274
|
-
{ flag: "--task-id", description: "the closing `Tokens:` line's task id" },
|
|
5275
|
-
{ flag: "--model", description: "the closing `Tokens:` line's model name" },
|
|
5276
|
-
{ flag: "--tokens-in", description: "a non-negative integer, or `-` if unknown" },
|
|
5277
|
-
{ flag: "--tokens-out", description: "a non-negative integer, or `-` if unknown" },
|
|
5278
|
-
{ flag: "--cost", description: "free text, or `-` if unknown" },
|
|
5279
|
-
{
|
|
5280
|
-
flag: "--print-only",
|
|
5281
|
-
description: "Render and self-check the comment, print it, and exit — never calls `gh pr comment`"
|
|
5282
|
-
},
|
|
5283
|
-
{ flag: "--json", description: "Enveloped JSON output (schema: 1)" }
|
|
5284
|
-
],
|
|
5285
|
-
details: [
|
|
5286
|
-
"`--print-only` runs the exact same render-then-self-check path as a real post, then returns before `gh pr comment` — closes atta-labs/vinaya#184, where the old command silently posted a verdict anyway after a reviewer guessed this flag existed.",
|
|
5287
|
-
"Every structural line (`VERDICT:`, `Judged head:`) is rendered from this command's own validated enum/sha inputs — never from a caller-supplied string — so a Reviewer's free-typed prose can no longer produce a shape the merge gate's line-anchored regex fails to see.",
|
|
5288
|
-
"The verdict is derived, not typed: a BLOCKER (or CRITICAL/HIGH) finding forces REQUEST_CHANGES/FAIL and its absence forces APPROVE/PASS, before posting anything — an explicit `--verdict` that disagrees is refused naming the derived value. When a same-role verdict comment already exists on the PR, a new findings file must carry every prior id with a state and no non-blocking finding outside the diff since that comment's judged head, or the post is refused.",
|
|
5289
|
-
"Renders an `OBJECTIVES:` block (one `O<n>: MET | NOT MET — <evidence>` line per objective) after `SPEC CONFORMANCE:`/before `CONFIG SCAN:`, and an `Objectives version:` line at line 5 — resolved from the closed Issue's `## Objectives` list, or the PR body's own section when it closes none. A clean verdict (`APPROVE`/`PASS`) is refused alongside any `NOT MET`; an Issue below the objectives cutover renders neither line at all, matching the merge gate's own skip.",
|
|
5290
|
-
"Before the post ever reaches the forge, runs the exact `extractCodeReviewVerdict`/`extractSecurityReviewVerdict` functions `checkReviewGate` calls over its own rendered text and refuses (exit 2) unless exactly the intended verdict extracts and the other role extracts none — an escalation requires both to extract none. Both extractors read only a comment's first five lines; a code-review or security render's caller-supplied fields never open one of those lines, but an escalation's `--summary` can (pre-cutover, it becomes line 5 unprefixed) — this pre-post re-parse, not the render's construction, is what catches that case before it ever reaches the forge.",
|
|
5291
|
-
"After posting, re-fetches the PR's comments and runs them through the same extractors `checkReviewGate` calls — the same functions, not a second implementation — and exits non-zero naming precisely what failed to re-parse if the post does not come back clean, bound to the resolved head and objectives version, and free of the other role's verdict. There is no `--skip-verify` escape."
|
|
5292
|
-
],
|
|
5293
|
-
status: "shipped"
|
|
5294
|
-
},
|
|
5295
|
-
{
|
|
5296
|
-
name: "doctor",
|
|
5297
|
-
description: "Diagnose hook, workflow, and config health — report only, never mutates",
|
|
5298
|
-
flags: [{ flag: "--json", description: "Enveloped JSON output (schema: 1)" }],
|
|
5299
|
-
details: [
|
|
5300
|
-
'Carries the same env-declaration diagnostic `vinaya check` warns with — permanently, at `info` severity, not just ahead of the spawn-default flip — plus a `warn`-severity lint over suspicious `env` literal forms (a stray `"true"`/`"false"` string, or a high-entropy literal that reads like a leaked secret committed to config).',
|
|
5301
|
-
"Also carries the two permanent `checks`-classification diagnostics: a config key that REPLACES a core check (`warn`), and a bare un-namespaced key that is REJECTED (`error`, naming the rename requirement). These are the reason a config `vinaya check` now refuses outright is still diagnosable — the refusal runs nothing, so `doctor` is the surface that explains why."
|
|
5302
|
-
],
|
|
5303
|
-
status: "shipped"
|
|
5304
|
-
},
|
|
5305
|
-
{
|
|
5306
|
-
name: "tokens",
|
|
5307
|
-
description: "Print a role's `Tokens: …` report line — the portable front door over the collection adapter",
|
|
5308
|
-
flags: [
|
|
5309
|
-
{ flag: "--phase", description: 'e.g. `"<task-id>: develop"` — required' },
|
|
5310
|
-
{ flag: "--role", description: "e.g. `Developer` — required" },
|
|
5311
|
-
{ flag: "--model", description: "Overrides the model id the adapter derived, if given" },
|
|
5312
|
-
{
|
|
5313
|
-
flag: "--transcript",
|
|
5314
|
-
description: "Read this transcript directly. Supported primary route — use it whenever you know which transcript " + "is yours, and always in a repo with no track-transcript.sh hook. Omitted resolves via the Stop-hook " + "pointer file, if this repo installs that hook."
|
|
5315
|
-
},
|
|
5316
|
-
{
|
|
5317
|
-
flag: "--in / --out",
|
|
5318
|
-
description: "Manual entry: the exact token figures, for a host whose usage arrives by some other means than a " + "Claude Code transcript. Both required together; skips transcript resolution entirely."
|
|
5319
|
-
}
|
|
5320
|
-
],
|
|
5321
|
-
details: [
|
|
5322
|
-
"Resolves the Claude Code collection adapter (`resolveMeteringCapability`, `summarizeTranscript`, `formatTokensLine`) from the INSTALLED `@attalabs/aeg-core` package, never by a repo-relative path — the fix for `packages/aeg-core/bin/report-tokens.ts` not existing in an adopter repo with no local `packages/`.",
|
|
5323
|
-
"Refuses — never emits a `0/0/—` line — when no transcript resolves, a resolved transcript can't be read, or it summarizes to zero usage records (empty, unparseable, or not yet flushed to disk). Capability is probed by actually attempting resolution, never declared from the host being Claude Code."
|
|
5324
|
-
],
|
|
5325
|
-
status: "shipped"
|
|
5326
|
-
},
|
|
5327
|
-
{
|
|
5328
|
-
name: "doctrine",
|
|
5329
|
-
description: "Print the absolute path of the bundled doctrine's front door (aeg-root/skills/aeg/SKILL.md) on this machine",
|
|
5330
|
-
flags: [{ flag: "--json", description: "Enveloped JSON output (schema: 1) — `{ root, entry }`" }],
|
|
5331
|
-
details: [
|
|
5332
|
-
"The committed root `VINAYA.md` pointer names the `@attalabs/vinaya` package, never a filesystem path — where the package sits is a property of each machine, not of the repo, and the pointer is committed for every clone. This command is the read-time resolution step the pointer hands the reader: it resolves the installed package's own bundled `aeg-root/` wherever the CLI physically sits and prints the front door's absolute path, so `cat \"$(vinaya doctrine)\"` opens the doctrine on any machine at any version.",
|
|
5333
|
-
"In a repo that vendors the CLI, the bundled copy is a gitignored pack-time artifact, so the command falls back to the monorepo root's own `aeg-root/` — the same directory `bundle-doctrine` copies from. Exits 1 with a corrective message when neither location holds a doctrine."
|
|
5334
|
-
],
|
|
5335
|
-
status: "shipped"
|
|
5336
|
-
},
|
|
5337
|
-
{
|
|
5338
|
-
name: "upgrade",
|
|
5339
|
-
description: "Regenerate hooks, workflow, and config to the current contract version (diff-and-confirm)",
|
|
5340
|
-
flags: [
|
|
5341
|
-
{ flag: "--dry-run", description: "Print the full diff without regenerating anything" },
|
|
5342
|
-
{ flag: "--yes", description: "Skip the confirmation prompt" }
|
|
5343
|
-
],
|
|
5344
|
-
details: [
|
|
5345
|
-
"When `claude` is a selected agent vendor, also retrofits the Claude Code `Stop` hook (`.claude/hooks/track-transcript.sh`, `.claude/settings.json`) the same way `init` installs it on a fresh repo — for a repo that ran `init` before this hook existed, closing the gap that left token rows reading `—/—/—` with no operator ever told to re-run `init`. Never overwrites a foreign `.claude/settings.json` (refuse-if-foreign, same as `init`); appends to a foreign Stop-hook script rather than replacing it (managed-block, same discipline as the git hooks)."
|
|
5346
|
-
],
|
|
5347
|
-
status: "shipped"
|
|
5348
|
-
},
|
|
5349
|
-
{
|
|
5350
|
-
name: "archive",
|
|
5351
|
-
description: "Run the post-merge Archivist directly: provenance + Issue close-out for a merged task PR",
|
|
5352
|
-
flags: [{ flag: "--merge-sha", description: "The merge commit to resolve (defaults to the current HEAD)" }],
|
|
5353
|
-
details: [
|
|
5354
|
-
"Resolves the merge commit's associated PR via `gh`, and — if it's a task PR without a provenance comment yet — posts the provenance block and closes the linked Issue. Idempotent: re-running against an already-archived PR is a no-op.",
|
|
5355
|
-
"The same logic the generated `vinaya-archivist.yml` workflow's `post-merge` job runs on every push to `main` — callable directly for a one-off run or local verification.",
|
|
5356
|
-
"All progress output writes through `process.stdout.write`/`process.stderr.write` (never bare `console.*`), so piping this command into a log file or a CI step captures every line in order."
|
|
5357
|
-
],
|
|
5358
|
-
status: "shipped"
|
|
5359
|
-
},
|
|
5360
|
-
{
|
|
5361
|
-
name: "archive tranche",
|
|
5362
|
-
description: "Close a tranche — the tranche-level bookend to `init product`, closing the Milestone via the CLI",
|
|
5363
|
-
flags: [{ flag: "--yes", description: "Skip the confirmation prompt" }],
|
|
5364
|
-
details: [
|
|
5365
|
-
"Refuses if any task Issue attached to the named tranche is still open, naming each one — closing a tranche with unresolved work is never silently allowed.",
|
|
5366
|
-
"Once every task Issue is closed, prompts for confirmation (unless `--yes`) and closes the GitHub Milestone."
|
|
5367
|
-
],
|
|
5368
|
-
status: "shipped"
|
|
5369
|
-
},
|
|
5370
|
-
{
|
|
5371
|
-
name: "audit",
|
|
5372
|
-
description: "Run the ring-2 dead-branch-push and direct-main-push detection checks directly",
|
|
5373
|
-
flags: [
|
|
5374
|
-
{ flag: "--only", description: "Scope to one check: 'dead-branches' or 'direct-push'" },
|
|
5375
|
-
{ flag: "--sha", description: "The commit to check for direct-main-push (defaults to the current HEAD)" },
|
|
5376
|
-
{ flag: "--json", description: "Enveloped JSON output" }
|
|
5377
|
-
],
|
|
5378
|
-
details: [
|
|
5379
|
-
"Dead-branch-push is never-red — a notification channel that flags (label + PR comment) any `task/*` branch whose tip commit lands after its own PR already resolved. Direct-main-push is a real pass/fail — it polls the merge-association API for up to ~100s before deciding, then opens an incident Issue and exits 1 if a commit on `main` genuinely has no associated merged PR.",
|
|
5380
|
-
"The same logic the generated `vinaya-archivist.yml` workflow's `daily-drift` and `direct-main-push-detection` jobs run on schedule / on every push to `main` — callable directly for a one-off run or local verification.",
|
|
5381
|
-
"All progress output writes through `process.stdout.write`/`process.stderr.write` (never bare `console.*`), so piping this command into a log file or a CI step captures every line in order."
|
|
5382
|
-
],
|
|
5383
|
-
status: "shipped"
|
|
5384
|
-
},
|
|
5385
|
-
{
|
|
5386
|
-
name: "eject",
|
|
5387
|
-
description: "Remove every Vinaya-installed artifact, restoring the repo to stock",
|
|
5388
|
-
flags: [
|
|
5389
|
-
{ flag: "--dry-run", description: "Print the full removal diff without removing anything" },
|
|
5390
|
-
{ flag: "--yes", description: "Skip the confirmation prompt" }
|
|
5391
|
-
],
|
|
5392
|
-
status: "shipped"
|
|
5393
|
-
},
|
|
5394
|
-
{
|
|
5395
|
-
name: "demo break",
|
|
5396
|
-
description: "Run a guided refusal-then-fix demo on an isolated, discardable branch",
|
|
5397
|
-
flags: [{ flag: "--keep", description: "Skip cleanup and leave the demo branch checked out to inspect" }],
|
|
5398
|
-
details: [
|
|
5399
|
-
"Creates a collision-safe `vinaya/demo-break-<id>` branch off the current one, stages a deliberately incomplete draft brief, and attempts a real `git commit` — the repo's actually-installed pre-commit hook refuses it with its real output, not a scripted string. Applies the minimal fix, commits again, then switches back and deletes the demo branch.",
|
|
5400
|
-
"Safe to run twice: refuses on a dirty working tree, refuses from a detached HEAD, and recovers automatically from a prior crashed run before starting a fresh one — never leaves the original branch touched or a stray demo branch behind."
|
|
5401
|
-
],
|
|
5402
|
-
status: "shipped"
|
|
5403
|
-
},
|
|
5404
|
-
{
|
|
5405
|
-
name: "waiver",
|
|
5406
|
-
description: "Apply the actor-verified 'vinaya/waiver:docs' or 'vinaya/waiver:review' label after prompting for a reason",
|
|
5407
|
-
flags: [
|
|
5408
|
-
{ flag: "--reason", description: "The waiver rationale, posted as a PR comment (prompted for if omitted)" },
|
|
5409
|
-
{ flag: "--print-only", description: "Print the exact `gh` commands instead of running them" }
|
|
5410
|
-
],
|
|
5411
|
-
details: [
|
|
5412
|
-
"Applies the label via `gh pr edit --add-label`, under the invoking human's own authenticated `gh` identity — this command never fabricates an actor. A waiver is never an agent-emittable string: not a PR body field, not a commit trailer, not a comment — the label plus its own labeling-timeline actor is the only mechanism ring 1 honors.",
|
|
5413
|
-
"`--print-only` prints the exact `gh pr edit`/`gh pr comment` commands and runs nothing — for a human who wants to run them itself, or a CI/non-interactive context where an agent session should never be the one applying its own waiver."
|
|
5414
|
-
],
|
|
5415
|
-
status: "shipped"
|
|
5416
|
-
},
|
|
5417
|
-
{
|
|
5418
|
-
name: "studio",
|
|
5419
|
-
description: "Launch Vinaya Studio — runs the Studio dev app when its source (apps/vinaya-studio/web) is in a checkout above the current directory; a published install launches its bundled standalone server instead",
|
|
5420
|
-
flags: [
|
|
5421
|
-
{
|
|
5422
|
-
flag: "--port <n>",
|
|
5423
|
-
description: "Bind this exact port. Without the flag the default is unchanged — 3008, falling back to 3108 when it is taken. With it there is no fallback: a taken port is refused, so you always know which server answered. Accepts `--port 3208` and `--port=3208`. Applies to a published install; in a workspace checkout Studio's own dev script owns the port and the flag is refused."
|
|
5424
|
-
}
|
|
5425
|
-
],
|
|
5426
|
-
details: [
|
|
5427
|
-
"Resolution happens in this order: a workspace checkout carrying `apps/vinaya-studio/web` (Studio's source, which lives in the attalabs monorepo — not this repository) runs the dev app directly; a published install's `studio-standalone/` bundle (fetched from attalabs' release artifact at publish time, see `scripts/bundle-studio.ts`) runs that bundled server; anything else — a publish that shipped without the bundle — gets an explicit refusal and exit 1 rather than a silent no-op.",
|
|
5428
|
-
"Every published `@attalabs/vinaya` build ships the `studio-standalone/` bundle: `prepack` fetches attalabs’ latest CI-built standalone Studio artifact and assembles it into the tarball before publish."
|
|
5429
|
-
],
|
|
5430
|
-
status: "shipped"
|
|
5431
|
-
},
|
|
5432
|
-
{
|
|
5433
|
-
name: "quickstart",
|
|
5434
|
-
description: "Guided wizard: init, doc-owners, project, commit, demo break, doctor, push — one command",
|
|
5435
|
-
details: [
|
|
5436
|
-
"Calls `init`'s own diff-and-confirm flow unchanged (pausing on Enter before the diff prints, so its own step header isn't scrolled off by a long diff), then Y/n-prompts through the workarounds a guest used to run by hand: binding `.vinaya/doc-owners` pairs (bad input offers a retry instead of silently skipping, and a pointer that doesn't exist on disk is refused outright — both loop across as many pairs as the guest wants, not just one), registering tracked projects (`init product`, same retry/loop shape), committing the install, running `demo break` as proof the gates actually work (default yes — the one step this wizard makes hardest to skip), running `doctor`, and pushing. Each declined prompt skips only that step; the install commit itself is never prompt-gated — it just no-ops when there is genuinely nothing to commit.",
|
|
5437
|
-
"Never reimplements or edits `init`/`init product`/`demo break`/`doctor` — it only calls their existing, unmodified entry points in sequence."
|
|
5438
|
-
],
|
|
5439
|
-
status: "shipped"
|
|
5440
|
-
},
|
|
5441
|
-
{
|
|
5442
|
-
name: "release",
|
|
5443
|
-
description: "Run this repo's own publish sequence in one command, refusing to start unless every precondition holds",
|
|
5444
|
-
flags: [
|
|
5445
|
-
{
|
|
5446
|
-
flag: "--dry-run",
|
|
5447
|
-
description: "Run the preconditions only and print the plan; publishes nothing"
|
|
5448
|
-
},
|
|
5449
|
-
{
|
|
5450
|
-
flag: "--allow-any-commit",
|
|
5451
|
-
description: "Skip the check that HEAD's commit is a Version Packages commit"
|
|
5452
|
-
}
|
|
5453
|
-
],
|
|
5454
|
-
details: [
|
|
5455
|
-
"Refuses unless HEAD is the default branch, the working tree is clean, HEAD equals `origin/<default>` (after `git fetch origin`), HEAD's commit subject starts with `Chore(release): Version packages` (unless `--allow-any-commit`), and `npm whoami` exits `0` — each its own refusal naming the fix.",
|
|
5456
|
-
"Then streams `bun install --frozen-lockfile`, `bun run build`, `bun run changeset:publish`, and `git push origin --tags` — a real push, so the repo's own generated pre-push hook sees it exactly as any other push would. After it, prints `npm view <pkg> version` for every tag now on HEAD, noting registry lag on `@attalabs/vinaya` (observed ~20 minutes) when it still shows the previous version.",
|
|
5457
|
-
'This is the one procedure named in `apps/cli/specs/self-hosting.md`, "How the published version is produced" — publishing itself stays manual and human-triggered; this command only removes the hand-typed four-step recipe.'
|
|
5458
|
-
],
|
|
5459
|
-
status: "shipped"
|
|
5460
|
-
},
|
|
5461
|
-
{
|
|
5462
|
-
name: "dispatch",
|
|
5463
|
-
description: "Start a role's headless agent session (claude/codex/gemini) with attribution set on its environment, recording the outcome through the Vinaya Log",
|
|
5464
|
-
flags: [
|
|
5465
|
-
{
|
|
5466
|
-
flag: "--agent",
|
|
5467
|
-
description: "Vendor to start: `claude`, `codex`, or `gemini` (falls back to `dispatch.agent` in config)"
|
|
5468
|
-
},
|
|
5469
|
-
{ flag: "--prompt-file", description: "Path to the prompt text sent to the agent (never on argv)" },
|
|
5470
|
-
{ flag: "--task", description: "This dispatch's task Issue number — mutually exclusive with `--pr`" },
|
|
5471
|
-
{
|
|
5472
|
-
flag: "--pr",
|
|
5473
|
-
description: "Flush the outbox to this PR's Issue after the dispatch — mutually exclusive with `--task`"
|
|
5474
|
-
},
|
|
5475
|
-
{ flag: "--round", description: "Round number, for a dispatch inside a review loop" },
|
|
5476
|
-
{
|
|
5477
|
-
flag: "--resume <id>",
|
|
5478
|
-
description: "Resume the vendor's own session/thread from a prior dispatch's returned `resumeId`, instead of starting a fresh one"
|
|
5479
|
-
},
|
|
5480
|
-
{ flag: "--json", description: "Enveloped JSON output (schema: 1)" }
|
|
5481
|
-
],
|
|
5482
|
-
details: [
|
|
5483
|
-
"Sets `VINAYA_RUN_ID`/`VINAYA_ROLE`/`VINAYA_TASK`/`VINAYA_ROUND` on the child only — never on this process's own environment — and refuses by name, before any spawn attempt, when the named vendor binary is absent from `PATH` or present but not executable.",
|
|
5484
|
-
"Records `dispatched` (with the prompt's sha256), `outcome_received` (duration, the vendor's own usage when its stdout prints a recognizable shape), or `dispatch_failed` (`timeout`, `crash`, or `refused`) through the Vinaya Log's one `dispatch` family writer, `dispatchRole`. A wall-time ceiling (`dispatch.timeoutMs` in config, default one hour) sends `SIGTERM` then, after a grace window, `SIGKILL`.",
|
|
5485
|
-
"When `--task` or `--pr` is given, flushes that outbox via `vinaya log flush` immediately after the child settles — `--task` and `--pr` are mutually exclusive here, matching `log flush`'s own single-target rule. Without either, the dispatch still runs and logs; nothing is flushed, and the lines ride to the next flush.",
|
|
5486
|
-
"A successful dispatch's `DispatchHandle` carries `resumeId` — the vendor's own session/thread identifier (claude/gemini: `session_id`; codex: `thread_id`), parsed from its stdout, `null` on any failure. Passing that value as `--resume <id>` on a later call swaps in that vendor's own resume invocation (`claude -p -r <id> ...`; `codex exec resume <id> ...`; `gemini ... --resume <id> ...`) in place of its first-dispatch args."
|
|
5487
|
-
],
|
|
5488
|
-
status: "shipped"
|
|
5489
|
-
},
|
|
5490
|
-
{
|
|
5491
|
-
name: "dev-review-loop",
|
|
5492
|
-
description: "Dispatch the developer, run review rounds against the forge, resume the same developer session every round, and hold every verdict until the policy says publish",
|
|
5493
|
-
flags: [
|
|
5494
|
-
{ flag: "--task <n>", description: "This task's Issue number — its frozen `aeg:brief:v1` comment is the brief" },
|
|
5495
|
-
{
|
|
5496
|
-
flag: "--agent <claude|codex|gemini>",
|
|
5497
|
-
description: "Vendor for every dispatch this loop makes (falls back to `dispatch.agent` in config)"
|
|
5498
|
-
},
|
|
5499
|
-
{ flag: "--json", description: "Enveloped JSON output (schema: 1)" }
|
|
5500
|
-
],
|
|
5501
|
-
details: [
|
|
5502
|
-
"Dispatches the developer through `dispatchRole` with the brief read from the Issue, waits for the PR it opens, then runs `assessRound` (`@attalabs/aeg-core`) — the entire policy — against observations this command reads from the forge: the head via `git ls-remote` only (never `gh pr view headRefOid`, which can lag a push), CI conclusion via the check-runs API (never run locally), and ruling comments matching `<!-- aeg:principal:ruling:<pr>-<k> -->`.",
|
|
5503
|
-
"Nothing is posted to the PR before the policy decides `publish`: each round's reviewer and security verdicts are dispatched fresh (never a resumed session) through `dispatchRole`, rendered through `review post`'s own render functions, and written to a local file under the outbox — never `gh pr comment`/`gh pr review`. Posting the held verdicts is a separate, later task.",
|
|
5504
|
-
"The developer's session is resumed every round via `dispatchRole`'s `resumeId` — never a fresh session — for every vendor; a round whose resume fails for a vendor that resumed successfully the round before stops the loop rather than silently falling back to a fresh developer session.",
|
|
5505
|
-
"Every dispatch and round transition is a log line through the Vinaya Log, flushed to the forge at each round boundary."
|
|
5506
|
-
],
|
|
5507
|
-
status: "shipped"
|
|
5508
|
-
}
|
|
5509
|
-
];
|
|
5510
|
-
// ../../packages/sources/src/forge-adapter.ts
|
|
5511
|
-
function createForgeSource(config) {
|
|
5512
|
-
return {
|
|
5513
|
-
async getTranche(slug) {
|
|
5514
|
-
return deriveTrancheFromForge(config.owner, config.repo, slug);
|
|
5515
|
-
}
|
|
5516
|
-
};
|
|
5517
|
-
}
|
|
5518
|
-
// ../../packages/sources/src/select-source.ts
|
|
5519
|
-
import { z as z2 } from "zod";
|
|
5520
|
-
var StateSourceConfigSchema = z2.discriminatedUnion("kind", [
|
|
5521
|
-
z2.object({ kind: z2.literal("forge"), owner: z2.string(), repo: z2.string() }),
|
|
5522
|
-
z2.object({ kind: z2.literal("file"), root: z2.string().optional() })
|
|
5523
|
-
]);
|
|
5524
|
-
// src/checks/edge-resolve.ts
|
|
5525
|
-
import { execFileSync as execFileSync2 } from "node:child_process";
|
|
5526
|
-
var DIRECT_ISSUE_REF = /#(\d+)/;
|
|
5527
|
-
var issueCache = new Map;
|
|
5528
|
-
function fetchIssueState(num, repo) {
|
|
5529
|
-
const key = `${repo.owner}/${repo.repo}#${num}`;
|
|
5530
|
-
if (issueCache.has(key))
|
|
5531
|
-
return issueCache.get(key) ?? null;
|
|
5532
|
-
let out = null;
|
|
5533
|
-
try {
|
|
5534
|
-
const raw = execFileSync2("gh", [
|
|
5535
|
-
"issue",
|
|
5536
|
-
"view",
|
|
5537
|
-
String(num),
|
|
5538
|
-
"-R",
|
|
5539
|
-
`${repo.owner}/${repo.repo}`,
|
|
5540
|
-
"--json",
|
|
5541
|
-
"state,stateReason,closedByPullRequestsReferences"
|
|
5542
|
-
], { encoding: "utf8", stdio: ["ignore", "pipe", "pipe"] });
|
|
5543
|
-
out = JSON.parse(raw);
|
|
5544
|
-
} catch {
|
|
5545
|
-
out = null;
|
|
5546
|
-
}
|
|
5547
|
-
issueCache.set(key, out);
|
|
5548
|
-
return out;
|
|
5549
|
-
}
|
|
5550
|
-
var defaultResolveSiblingTranche = async (slug, repo) => {
|
|
5551
|
-
let tranche;
|
|
5552
|
-
try {
|
|
5553
|
-
tranche = await deriveTrancheFromForge(repo.owner, repo.repo, slug);
|
|
5554
|
-
} catch {
|
|
5555
|
-
return null;
|
|
5556
|
-
}
|
|
5557
|
-
const taskRefs = tranche.tasks.map((t) => ({ id: t.id, issue: t.issue }));
|
|
5558
|
-
const snapshot = await fetchForgeFacts({ owner: repo.owner, repo: repo.repo, tranche: slug, tasks: taskRefs });
|
|
5559
|
-
return {
|
|
5560
|
-
tasks: new Map(tranche.tasks.map((t) => [t.id, { id: t.id, issue: t.issue }])),
|
|
5561
|
-
facts: snapshot.facts
|
|
5562
|
-
};
|
|
5563
|
-
};
|
|
5564
|
-
var siblingTrancheCache = new Map;
|
|
5565
|
-
function edgeFromIssueJson(num, json) {
|
|
5566
|
-
if (json === null) {
|
|
5567
|
-
return {
|
|
5568
|
-
issue: num,
|
|
5569
|
-
merged: false,
|
|
5570
|
-
open: false,
|
|
5571
|
-
issueState: null,
|
|
5572
|
-
stateReason: null,
|
|
5573
|
-
closedByActor: null,
|
|
5574
|
-
resolved: true
|
|
5575
|
-
};
|
|
5576
|
-
}
|
|
5577
|
-
const state = json.state === "CLOSED" ? "closed" : json.state === "OPEN" ? "open" : null;
|
|
5578
|
-
const reason = json.stateReason === "COMPLETED" ? "completed" : json.stateReason === "NOT_PLANNED" ? "not_planned" : null;
|
|
5579
|
-
const closedByMergedPr = (json.closedByPullRequestsReferences ?? []).length > 0;
|
|
5580
|
-
return {
|
|
5581
|
-
issue: num,
|
|
5582
|
-
merged: state === "closed" && closedByMergedPr,
|
|
5583
|
-
open: false,
|
|
5584
|
-
issueState: state,
|
|
5585
|
-
stateReason: reason,
|
|
5586
|
-
closedByActor: null,
|
|
5587
|
-
resolved: true
|
|
5588
|
-
};
|
|
5589
|
-
}
|
|
5590
|
-
async function resolveEdge(id, taskById, factsByTaskId, repo, resolveSibling = defaultResolveSiblingTranche) {
|
|
5591
|
-
const target = taskById.get(id);
|
|
5592
|
-
if (target) {
|
|
5593
|
-
const facts = target.issue !== null ? factsByTaskId.get(target.id) : undefined;
|
|
5594
|
-
return {
|
|
5595
|
-
issue: target.issue,
|
|
5596
|
-
merged: facts?.prState === "merged",
|
|
5597
|
-
open: facts?.prState === "open",
|
|
5598
|
-
issueState: facts?.issueState ?? null,
|
|
5599
|
-
stateReason: facts?.stateReason ?? null,
|
|
5600
|
-
closedByActor: facts?.closedByActor ?? null,
|
|
5601
|
-
resolved: true
|
|
5602
|
-
};
|
|
5603
|
-
}
|
|
5604
|
-
const direct = id.match(DIRECT_ISSUE_REF);
|
|
5605
|
-
if (direct) {
|
|
5606
|
-
const num = Number(direct[1]);
|
|
5607
|
-
return edgeFromIssueJson(num, fetchIssueState(num, repo));
|
|
5608
|
-
}
|
|
5609
|
-
const qualified = splitSlugQualifiedEdge(id);
|
|
5610
|
-
if (qualified) {
|
|
5611
|
-
const cacheKey = `${repo.owner}/${repo.repo}:${qualified.slug}`;
|
|
5612
|
-
let sibling = siblingTrancheCache.get(cacheKey);
|
|
5613
|
-
if (sibling === undefined) {
|
|
5614
|
-
sibling = await resolveSibling(qualified.slug, repo);
|
|
5615
|
-
siblingTrancheCache.set(cacheKey, sibling);
|
|
5616
|
-
}
|
|
5617
|
-
const siblingTask = sibling?.tasks.get(qualified.bareId);
|
|
5618
|
-
if (sibling && siblingTask) {
|
|
5619
|
-
const facts = siblingTask.issue !== null ? sibling.facts.get(siblingTask.id) : undefined;
|
|
5620
|
-
return {
|
|
5621
|
-
issue: siblingTask.issue,
|
|
5622
|
-
merged: facts?.prState === "merged",
|
|
5623
|
-
open: facts?.prState === "open",
|
|
5624
|
-
issueState: facts?.issueState ?? null,
|
|
5625
|
-
stateReason: facts?.stateReason ?? null,
|
|
5626
|
-
closedByActor: facts?.closedByActor ?? null,
|
|
5627
|
-
resolved: true
|
|
5628
|
-
};
|
|
5629
|
-
}
|
|
5630
|
-
}
|
|
5631
|
-
return {
|
|
5632
|
-
issue: null,
|
|
5633
|
-
merged: false,
|
|
5634
|
-
open: false,
|
|
5635
|
-
issueState: null,
|
|
5636
|
-
stateReason: null,
|
|
5637
|
-
closedByActor: null,
|
|
5638
|
-
resolved: false
|
|
5639
|
-
};
|
|
5640
|
-
}
|
|
5641
|
-
|
|
5642
5073
|
// src/lib/config.ts
|
|
5643
|
-
import { execFileSync as
|
|
5074
|
+
import { execFileSync as execFileSync2 } from "node:child_process";
|
|
5644
5075
|
import { existsSync, mkdirSync, readFileSync as readFileSync2, realpathSync, writeFileSync } from "node:fs";
|
|
5645
5076
|
import { homedir } from "node:os";
|
|
5646
5077
|
import { dirname, join, resolve } from "node:path";
|
|
5647
|
-
import { z as
|
|
5078
|
+
import { z as z2 } from "zod";
|
|
5648
5079
|
|
|
5649
5080
|
// src/lib/agent-vendors.ts
|
|
5650
5081
|
var AGENT_VENDORS = ["skills", "claude", "gemini"];
|
|
5651
5082
|
|
|
5652
5083
|
// src/lib/config.ts
|
|
5653
|
-
var EnvEntrySchema =
|
|
5654
|
-
|
|
5655
|
-
|
|
5656
|
-
|
|
5657
|
-
|
|
5084
|
+
var EnvEntrySchema = z2.union([
|
|
5085
|
+
z2.literal(true),
|
|
5086
|
+
z2.object({ optional: z2.literal(true) }),
|
|
5087
|
+
z2.object({ anyOf: z2.array(z2.string()).min(2) }),
|
|
5088
|
+
z2.string()
|
|
5658
5089
|
]);
|
|
5659
|
-
var CheckEntrySchema =
|
|
5660
|
-
run:
|
|
5661
|
-
scope:
|
|
5662
|
-
include:
|
|
5663
|
-
args:
|
|
5664
|
-
timeoutMs:
|
|
5665
|
-
env:
|
|
5666
|
-
requiresOpenPr:
|
|
5667
|
-
ownWorkflow:
|
|
5090
|
+
var CheckEntrySchema = z2.object({
|
|
5091
|
+
run: z2.string(),
|
|
5092
|
+
scope: z2.enum(["diff", "full"]),
|
|
5093
|
+
include: z2.array(z2.string()).optional(),
|
|
5094
|
+
args: z2.array(z2.string()).optional(),
|
|
5095
|
+
timeoutMs: z2.number().optional(),
|
|
5096
|
+
env: z2.record(z2.string(), EnvEntrySchema).optional(),
|
|
5097
|
+
requiresOpenPr: z2.boolean().optional(),
|
|
5098
|
+
ownWorkflow: z2.boolean().optional()
|
|
5668
5099
|
}).superRefine((entry2, ctx) => {
|
|
5669
5100
|
if (!entry2.env)
|
|
5670
5101
|
return;
|
|
@@ -5674,22 +5105,22 @@ var CheckEntrySchema = z3.object({
|
|
|
5674
5105
|
const members = value.anyOf;
|
|
5675
5106
|
if (new Set(members).size !== members.length) {
|
|
5676
5107
|
ctx.addIssue({
|
|
5677
|
-
code:
|
|
5108
|
+
code: z2.ZodIssueCode.custom,
|
|
5678
5109
|
message: `env.${key}.anyOf has duplicate members`,
|
|
5679
5110
|
path: ["env", key, "anyOf"]
|
|
5680
5111
|
});
|
|
5681
5112
|
}
|
|
5682
5113
|
if (!members.includes(key)) {
|
|
5683
5114
|
ctx.addIssue({
|
|
5684
|
-
code:
|
|
5115
|
+
code: z2.ZodIssueCode.custom,
|
|
5685
5116
|
message: `env.${key}.anyOf must include "${key}" itself as a member`,
|
|
5686
5117
|
path: ["env", key, "anyOf"]
|
|
5687
5118
|
});
|
|
5688
5119
|
}
|
|
5689
5120
|
}
|
|
5690
5121
|
});
|
|
5691
|
-
var RoleEntrySchema =
|
|
5692
|
-
contract:
|
|
5122
|
+
var RoleEntrySchema = z2.object({
|
|
5123
|
+
contract: z2.string().refine((p) => p.includes("/"), {
|
|
5693
5124
|
message: 'must be a path (contain at least one "/"), not a bare filename'
|
|
5694
5125
|
})
|
|
5695
5126
|
});
|
|
@@ -5712,17 +5143,17 @@ var BRIEF_BUILTINS = [
|
|
|
5712
5143
|
"briefSections",
|
|
5713
5144
|
"milestoneShape"
|
|
5714
5145
|
];
|
|
5715
|
-
var BriefSectionSchema =
|
|
5716
|
-
|
|
5717
|
-
|
|
5718
|
-
|
|
5719
|
-
|
|
5146
|
+
var BriefSectionSchema = z2.union([
|
|
5147
|
+
z2.object({ builtin: z2.enum(BRIEF_BUILTINS) }),
|
|
5148
|
+
z2.object({ heading: z2.string().min(1), name: z2.string().optional() }),
|
|
5149
|
+
z2.object({ field: z2.string().min(1), name: z2.string().optional() }),
|
|
5150
|
+
z2.object({ phrase: z2.string().min(1), name: z2.string().optional() })
|
|
5720
5151
|
]);
|
|
5721
|
-
var BriefSchemaSchema =
|
|
5722
|
-
pr:
|
|
5723
|
-
issue:
|
|
5724
|
-
milestone:
|
|
5725
|
-
ack:
|
|
5152
|
+
var BriefSchemaSchema = z2.object({
|
|
5153
|
+
pr: z2.object({ sections: z2.array(BriefSectionSchema) }).optional(),
|
|
5154
|
+
issue: z2.object({ sections: z2.array(BriefSectionSchema) }).optional(),
|
|
5155
|
+
milestone: z2.object({ sections: z2.array(BriefSectionSchema) }).optional(),
|
|
5156
|
+
ack: z2.array(z2.enum(BRIEF_BUILTINS)).optional()
|
|
5726
5157
|
});
|
|
5727
5158
|
function isSafeRepoRelPath(p) {
|
|
5728
5159
|
if (p.length === 0)
|
|
@@ -5731,7 +5162,7 @@ function isSafeRepoRelPath(p) {
|
|
|
5731
5162
|
return false;
|
|
5732
5163
|
return p.split(/[\\/]/).every((seg) => seg !== ".." && seg !== "");
|
|
5733
5164
|
}
|
|
5734
|
-
var SafeRepoRelPath =
|
|
5165
|
+
var SafeRepoRelPath = z2.string().refine(isSafeRepoRelPath, {
|
|
5735
5166
|
message: "must be a repo-root-relative path with no `..` segment or absolute root"
|
|
5736
5167
|
});
|
|
5737
5168
|
var CANONICAL_HOOK_BLOCK_PREFIXES = [".git/", ".husky/", ".vinaya/hooks/", ".claude/hooks/"];
|
|
@@ -5741,22 +5172,22 @@ function isCanonicalHookBlockPath(p) {
|
|
|
5741
5172
|
var ManagedHookBlockPath = SafeRepoRelPath.refine(isCanonicalHookBlockPath, {
|
|
5742
5173
|
message: `must start with one of ${CANONICAL_HOOK_BLOCK_PREFIXES.join(", ")} (byte-exact, case-sensitive)`
|
|
5743
5174
|
});
|
|
5744
|
-
var ManagedBlockRecordSchema =
|
|
5175
|
+
var ManagedBlockRecordSchema = z2.object({
|
|
5745
5176
|
path: ManagedHookBlockPath,
|
|
5746
|
-
marker:
|
|
5747
|
-
comment:
|
|
5177
|
+
marker: z2.string(),
|
|
5178
|
+
comment: z2.enum(["hash", "html"])
|
|
5748
5179
|
});
|
|
5749
|
-
var ManagedManifestSchema =
|
|
5750
|
-
version:
|
|
5751
|
-
files:
|
|
5752
|
-
blocks:
|
|
5753
|
-
labels:
|
|
5754
|
-
agents:
|
|
5180
|
+
var ManagedManifestSchema = z2.object({
|
|
5181
|
+
version: z2.number().int().positive(),
|
|
5182
|
+
files: z2.array(SafeRepoRelPath),
|
|
5183
|
+
blocks: z2.array(ManagedBlockRecordSchema),
|
|
5184
|
+
labels: z2.array(z2.string()),
|
|
5185
|
+
agents: z2.array(z2.enum(AGENT_VENDORS)).optional()
|
|
5755
5186
|
});
|
|
5756
|
-
var ProjectEntrySchema =
|
|
5757
|
-
name:
|
|
5758
|
-
description:
|
|
5759
|
-
path:
|
|
5187
|
+
var ProjectEntrySchema = z2.object({
|
|
5188
|
+
name: z2.string().min(1),
|
|
5189
|
+
description: z2.string().min(1).optional(),
|
|
5190
|
+
path: z2.string().min(1).optional()
|
|
5760
5191
|
});
|
|
5761
5192
|
function parseTokensCollectDeclaration(value) {
|
|
5762
5193
|
const m = value.trim().match(/^(\S+)\s+(\S+)$/);
|
|
@@ -5767,34 +5198,34 @@ function parseTokensCollectDeclaration(value) {
|
|
|
5767
5198
|
return null;
|
|
5768
5199
|
return { interpreter, script };
|
|
5769
5200
|
}
|
|
5770
|
-
var VinayaConfigSchema =
|
|
5771
|
-
rings:
|
|
5772
|
-
ring1_forgeWriteInterception:
|
|
5773
|
-
ring2_asyncAudits:
|
|
5201
|
+
var VinayaConfigSchema = z2.object({
|
|
5202
|
+
rings: z2.object({
|
|
5203
|
+
ring1_forgeWriteInterception: z2.boolean(),
|
|
5204
|
+
ring2_asyncAudits: z2.boolean()
|
|
5774
5205
|
}).optional(),
|
|
5775
|
-
checks:
|
|
5776
|
-
roles:
|
|
5206
|
+
checks: z2.record(z2.string(), CheckEntrySchema).optional(),
|
|
5207
|
+
roles: z2.record(z2.string(), RoleEntrySchema).optional(),
|
|
5777
5208
|
briefSchema: BriefSchemaSchema.optional(),
|
|
5778
5209
|
managed: ManagedManifestSchema.optional(),
|
|
5779
|
-
principals:
|
|
5780
|
-
releaseActor:
|
|
5781
|
-
ci:
|
|
5782
|
-
tokens:
|
|
5783
|
-
collect:
|
|
5210
|
+
principals: z2.array(z2.string()).min(1).optional(),
|
|
5211
|
+
releaseActor: z2.string().min(1).optional(),
|
|
5212
|
+
ci: z2.object({ setup: z2.string().min(1) }).optional(),
|
|
5213
|
+
tokens: z2.object({
|
|
5214
|
+
collect: z2.string().min(1).refine((v) => parseTokensCollectDeclaration(v) !== null, {
|
|
5784
5215
|
message: 'tokens.collect must be exactly "<interpreter> <repo-relative-script-path>" — two whitespace-separated tokens, no flags, no shell syntax, no quoting'
|
|
5785
5216
|
})
|
|
5786
5217
|
}).optional(),
|
|
5787
|
-
blastRadius:
|
|
5788
|
-
proseGates:
|
|
5789
|
-
doctrineRoot:
|
|
5790
|
-
readerFacingPrefix:
|
|
5791
|
-
readerFacingSuffix:
|
|
5792
|
-
legacySlugDir:
|
|
5218
|
+
blastRadius: z2.object({ extraDomains: z2.array(z2.string()).optional() }).optional(),
|
|
5219
|
+
proseGates: z2.object({
|
|
5220
|
+
doctrineRoot: z2.string().min(1).optional(),
|
|
5221
|
+
readerFacingPrefix: z2.string().min(1).optional(),
|
|
5222
|
+
readerFacingSuffix: z2.string().min(1).optional(),
|
|
5223
|
+
legacySlugDir: z2.string().min(1).optional()
|
|
5793
5224
|
}).optional(),
|
|
5794
|
-
projects:
|
|
5795
|
-
dispatch:
|
|
5796
|
-
timeoutMs:
|
|
5797
|
-
agent:
|
|
5225
|
+
projects: z2.array(ProjectEntrySchema).optional(),
|
|
5226
|
+
dispatch: z2.object({
|
|
5227
|
+
timeoutMs: z2.number().int().positive().optional(),
|
|
5228
|
+
agent: z2.enum(["claude", "codex", "gemini"]).optional()
|
|
5798
5229
|
}).optional()
|
|
5799
5230
|
});
|
|
5800
5231
|
var GLOBAL_VINAYA_HOME = join(homedir(), ".vinaya");
|
|
@@ -5878,7 +5309,7 @@ function trustAnchorRepo() {
|
|
|
5878
5309
|
return validated;
|
|
5879
5310
|
}
|
|
5880
5311
|
try {
|
|
5881
|
-
const url =
|
|
5312
|
+
const url = execFileSync2("git", ["remote", "get-url", "origin"], {
|
|
5882
5313
|
encoding: "utf-8",
|
|
5883
5314
|
stdio: ["ignore", "pipe", "pipe"]
|
|
5884
5315
|
}).trim();
|
|
@@ -5892,7 +5323,7 @@ function ghFetchTrustAnchorConfig() {
|
|
|
5892
5323
|
const repo = trustAnchorRepo();
|
|
5893
5324
|
if (!repo)
|
|
5894
5325
|
throw new Error("could not resolve repo identity for the trust-anchor read");
|
|
5895
|
-
return
|
|
5326
|
+
return execFileSync2("gh", ["api", `repos/${repo}/contents/${LOCAL_CONFIG_FILENAME}`, "--jq", ".content"], {
|
|
5896
5327
|
encoding: "utf-8",
|
|
5897
5328
|
stdio: ["ignore", "pipe", "pipe"]
|
|
5898
5329
|
});
|
|
@@ -5948,24 +5379,10 @@ function loadConfig() {
|
|
|
5948
5379
|
}
|
|
5949
5380
|
var TOKENS_COLLECT_TRUST_PATH = join(GLOBAL_VINAYA_HOME, "tokens-collect-trust.json");
|
|
5950
5381
|
|
|
5951
|
-
// src/lib/dispatch-task.ts
|
|
5952
|
-
function contentAfterTwoLines(body) {
|
|
5953
|
-
const first = body.indexOf(`
|
|
5954
|
-
`);
|
|
5955
|
-
if (first === -1)
|
|
5956
|
-
return "";
|
|
5957
|
-
const second = body.indexOf(`
|
|
5958
|
-
`, first + 1);
|
|
5959
|
-
if (second === -1)
|
|
5960
|
-
return "";
|
|
5961
|
-
return body.slice(second + 1);
|
|
5962
|
-
}
|
|
5963
|
-
|
|
5964
5382
|
// src/checks/bin/check-brief-shape.ts
|
|
5965
5383
|
var CHECK_NAME = "brief-shape";
|
|
5966
|
-
var AEG_BRIEF_V1_MARKER = "<!-- aeg:brief:v1 -->";
|
|
5967
5384
|
function fetchIssueComments(issueNumber) {
|
|
5968
|
-
const out =
|
|
5385
|
+
const out = execFileSync3("gh", ["issue", "view", String(issueNumber), "--json", "comments"], {
|
|
5969
5386
|
encoding: "utf8",
|
|
5970
5387
|
stdio: ["ignore", "pipe", "pipe"]
|
|
5971
5388
|
});
|
|
@@ -5990,12 +5407,13 @@ function resolveGradedBody(prBody, taskBranch) {
|
|
|
5990
5407
|
message: `could not fetch Issue #${issue}'s comments (\`gh issue view\`) to grade the dispatched brief: ${err instanceof Error ? err.message : String(err)}`
|
|
5991
5408
|
};
|
|
5992
5409
|
}
|
|
5993
|
-
const
|
|
5994
|
-
|
|
5995
|
-
|
|
5996
|
-
|
|
5410
|
+
const allowlist = resolvePrincipalAllowlist(loadTrustAnchorConfig());
|
|
5411
|
+
const comments = json.comments.map((c) => ({ body: c.body, author: c.author?.login ?? null }));
|
|
5412
|
+
const resolved = resolveNewestFrozenBrief(comments, allowlist);
|
|
5413
|
+
if (!resolved) {
|
|
5414
|
+
return { ok: false, message: `not dispatched — no \`aeg:brief:v<k>\` comment on Issue #${issue}.` };
|
|
5997
5415
|
}
|
|
5998
|
-
return { ok: true, body:
|
|
5416
|
+
return { ok: true, body: resolved.content };
|
|
5999
5417
|
}
|
|
6000
5418
|
function listDirs(dir) {
|
|
6001
5419
|
try {
|
|
@@ -6021,7 +5439,7 @@ function buildConsumersOf2() {
|
|
|
6021
5439
|
return buildConsumersOf(workspaces, listDirs, readManifest);
|
|
6022
5440
|
}
|
|
6023
5441
|
function fetchIssueBody(issueNumber) {
|
|
6024
|
-
return
|
|
5442
|
+
return execFileSync3("gh", ["issue", "view", String(issueNumber), "--json", "body", "--jq", ".body"], {
|
|
6025
5443
|
encoding: "utf8",
|
|
6026
5444
|
stdio: ["ignore", "pipe", "pipe"]
|
|
6027
5445
|
});
|