@attalabs/vinaya 0.25.0 → 0.26.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 +4 -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 +15 -5
- 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 +88 -23
- package/aeg-root/roles/principal.md +11 -11
- package/aeg-root/roles/reviewer.md +10 -10
- package/aeg-root/roles/security.md +7 -7
- 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 +116 -19
- package/dist/checks/bin/check-branch-topology.js +116 -19
- package/dist/checks/bin/check-brief-shape.js +121 -1101
- package/dist/checks/bin/check-changeset-coverage.js +877 -26
- package/dist/checks/bin/check-closes-n.js +116 -19
- package/dist/checks/bin/check-coherence.js +116 -19
- package/dist/checks/bin/check-dead-branch-push.js +116 -19
- package/dist/checks/bin/check-dispatch-readiness.js +119 -22
- package/dist/checks/bin/check-doc-coverage-push.js +877 -26
- package/dist/checks/bin/check-doc-coverage.js +879 -28
- package/dist/checks/bin/check-doctrine-no-procedures.js +116 -19
- package/dist/checks/bin/check-doctrine-portability.js +877 -26
- package/dist/checks/bin/check-evidence-fresh.js +116 -19
- package/dist/checks/bin/check-exec-bits.js +877 -26
- package/dist/checks/bin/check-first-push-dispatch.js +116 -19
- package/dist/checks/bin/check-issue-assignment.js +116 -19
- package/dist/checks/bin/check-main-branch-refusal.js +117 -20
- package/dist/checks/bin/check-no-disk-state.js +116 -19
- package/dist/checks/bin/check-pr-premise-reassert.js +5401 -0
- package/dist/checks/bin/check-pr-report-density.js +116 -19
- package/dist/checks/bin/check-quoted-command.js +875 -24
- package/dist/checks/bin/check-reader-resolvable-prose.js +875 -24
- package/dist/checks/bin/check-registry-gates.js +147 -21
- package/dist/checks/bin/check-retired-vocabulary.js +875 -24
- package/dist/checks/bin/check-review-gate.js +116 -19
- package/dist/checks/bin/check-single-plan-pr.js +116 -19
- package/dist/checks/bin/check-surface-scope.js +5722 -0
- package/dist/checks/bin/check-test-plan.js +116 -19
- package/dist/checks/bin/check-token-collection-wired.js +116 -19
- package/dist/checks/bin/check-token-report.js +128 -26
- package/dist/checks/bin/check-workspace-escape.js +875 -24
- package/dist/index.js +1002 -214
- 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-doc-coverage.ts
|
|
6
|
-
import { execFileSync as
|
|
6
|
+
import { execFileSync as execFileSync5 } from "node:child_process";
|
|
7
7
|
import { existsSync as existsSync2, 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
|
}
|
|
@@ -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",
|
|
@@ -2395,7 +2404,7 @@ function objectivesOf(body) {
|
|
|
2395
2404
|
continue;
|
|
2396
2405
|
}
|
|
2397
2406
|
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
|
|
2407
|
+
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
2408
|
continue;
|
|
2400
2409
|
}
|
|
2401
2410
|
objectives.push({ id: `O${n}`, text });
|
|
@@ -2607,18 +2616,14 @@ function checkTestPlanExclusivity(prBody) {
|
|
|
2607
2616
|
function checkPrincipalPlaceholder(prBody) {
|
|
2608
2617
|
const region = testPlanRegion(prBody);
|
|
2609
2618
|
const lineRe = /^-\s*\[[ xX]\]\s*\*{2}\[principal\]\*{2}(.*)$/gim;
|
|
2619
|
+
const errors = [];
|
|
2610
2620
|
for (const m of region.matchAll(lineRe)) {
|
|
2611
2621
|
const content = m[1] ?? "";
|
|
2612
2622
|
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
|
-
};
|
|
2623
|
+
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
2624
|
}
|
|
2620
2625
|
}
|
|
2621
|
-
return { status: "pass", errors: [] };
|
|
2626
|
+
return errors.length > 0 ? { status: "fail", errors } : { status: "pass", errors: [] };
|
|
2622
2627
|
}
|
|
2623
2628
|
function checkSurfaceMap(prBody) {
|
|
2624
2629
|
return headingCheck(prBody, "(?:technical\\s+)?surface map", "Technical surface map");
|
|
@@ -2934,6 +2939,18 @@ function checkBriefSections(prBody, readTier, options = {}) {
|
|
|
2934
2939
|
];
|
|
2935
2940
|
return { errors: results.flatMap((r) => r.errors) };
|
|
2936
2941
|
}
|
|
2942
|
+
var AEG_BRIEF_V1_MARKER = "<!-- aeg:brief:v1 -->";
|
|
2943
|
+
function contentAfterTwoLines(body) {
|
|
2944
|
+
const first = body.indexOf(`
|
|
2945
|
+
`);
|
|
2946
|
+
if (first === -1)
|
|
2947
|
+
return "";
|
|
2948
|
+
const second = body.indexOf(`
|
|
2949
|
+
`, first + 1);
|
|
2950
|
+
if (second === -1)
|
|
2951
|
+
return "";
|
|
2952
|
+
return body.slice(second + 1);
|
|
2953
|
+
}
|
|
2937
2954
|
// ../../packages/aeg-core/src/doctrine-portability.ts
|
|
2938
2955
|
var DEFAULT_SHIPS_PREFIX = "aeg-root/";
|
|
2939
2956
|
var STATIC_PORTABLE_PREFIXES = [
|
|
@@ -3176,6 +3193,66 @@ function checkIssueObjectives(body, issueNumber) {
|
|
|
3176
3193
|
return { status: "pass", errors: [] };
|
|
3177
3194
|
return { status: "fail", errors: result.errors.map((e) => `issue-validation objectives: ${e}`) };
|
|
3178
3195
|
}
|
|
3196
|
+
function topLevelSectionText(body, headingName) {
|
|
3197
|
+
const headingRe = new RegExp(`^##[ \\t]*${headingName}[ \\t]*$`, "im");
|
|
3198
|
+
const heading = headingRe.exec(body);
|
|
3199
|
+
if (!heading)
|
|
3200
|
+
return null;
|
|
3201
|
+
const afterHeading = body.slice(heading.index + heading[0].length);
|
|
3202
|
+
const next = /^##[ \t]/m.exec(afterHeading);
|
|
3203
|
+
return next ? afterHeading.slice(0, next.index) : afterHeading;
|
|
3204
|
+
}
|
|
3205
|
+
function looksLikeFilePath(entry2) {
|
|
3206
|
+
const stripped = entry2.replace(/\/\*\*?$/, "");
|
|
3207
|
+
const lastSegment = stripped.split("/").pop() ?? stripped;
|
|
3208
|
+
const extMatch = /\.[A-Za-z0-9]{1,6}$/.exec(lastSegment);
|
|
3209
|
+
return extMatch !== null && extMatch.index > 0;
|
|
3210
|
+
}
|
|
3211
|
+
function splitGlobList(raw) {
|
|
3212
|
+
return raw.split(",").map((s) => s.trim()).filter((s) => s.length > 0);
|
|
3213
|
+
}
|
|
3214
|
+
function parseIssueSurface(body) {
|
|
3215
|
+
const section = topLevelSectionText(body, "Surface");
|
|
3216
|
+
if (section === null)
|
|
3217
|
+
return { ok: false, errors: ["no `## Surface` heading found in the body."] };
|
|
3218
|
+
const inLine = /^in:\s*(.+)$/im.exec(section);
|
|
3219
|
+
const outLine = /^out:\s*(.+)$/im.exec(section);
|
|
3220
|
+
const errors = [];
|
|
3221
|
+
if (!inLine)
|
|
3222
|
+
errors.push("`## Surface` has no `in:` line.");
|
|
3223
|
+
if (!outLine)
|
|
3224
|
+
errors.push("`## Surface` has no `out:` line.");
|
|
3225
|
+
if (errors.length > 0)
|
|
3226
|
+
return { ok: false, errors };
|
|
3227
|
+
const inGlobs = splitGlobList(inLine[1]);
|
|
3228
|
+
const outGlobs = splitGlobList(outLine[1]);
|
|
3229
|
+
for (const g of [...inGlobs, ...outGlobs]) {
|
|
3230
|
+
if (looksLikeFilePath(g)) {
|
|
3231
|
+
errors.push(`\`${g}\` in \`## Surface\` looks like a file path — Surface entries are directory-level globs, never file paths.`);
|
|
3232
|
+
}
|
|
3233
|
+
}
|
|
3234
|
+
if (inGlobs.length === 0)
|
|
3235
|
+
errors.push("`## Surface`'s `in:` line resolved to zero globs.");
|
|
3236
|
+
if (errors.length > 0)
|
|
3237
|
+
return { ok: false, errors };
|
|
3238
|
+
return { ok: true, value: { in: inGlobs, out: outGlobs } };
|
|
3239
|
+
}
|
|
3240
|
+
function globCoversPath(glob, path) {
|
|
3241
|
+
const g = glob.replace(/\/\*\*?$/, "").replace(/\/+$/, "");
|
|
3242
|
+
const p = path.replace(/\/+$/, "");
|
|
3243
|
+
return g === p || g.startsWith(`${p}/`) || p.startsWith(`${g}/`);
|
|
3244
|
+
}
|
|
3245
|
+
function checkSurfaceScope(changedFiles, outGlobs) {
|
|
3246
|
+
if (outGlobs.length === 0)
|
|
3247
|
+
return { ok: true };
|
|
3248
|
+
const violations = [];
|
|
3249
|
+
for (const file of changedFiles) {
|
|
3250
|
+
const glob = outGlobs.find((g) => globCoversPath(g, file));
|
|
3251
|
+
if (glob)
|
|
3252
|
+
violations.push({ file, glob });
|
|
3253
|
+
}
|
|
3254
|
+
return violations.length > 0 ? { ok: false, violations } : { ok: true };
|
|
3255
|
+
}
|
|
3179
3256
|
function isTaskIssueLabelSet(labels) {
|
|
3180
3257
|
return hasLabel("tranche", labels);
|
|
3181
3258
|
}
|
|
@@ -3240,6 +3317,8 @@ function checkProjectsRegistered(body, _labels, registeredNames) {
|
|
|
3240
3317
|
}
|
|
3241
3318
|
return errors.length > 0 ? { status: "fail", errors } : { status: "pass", errors: [] };
|
|
3242
3319
|
}
|
|
3320
|
+
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;
|
|
3321
|
+
var DOC_PATH_RE_GLOBAL = new RegExp(DOC_PATH_RE.source, "gi");
|
|
3243
3322
|
|
|
3244
3323
|
// ../../packages/aeg-core/src/coherence-checks.ts
|
|
3245
3324
|
var COHERENCE_ENFORCED_FROM = "2026-07-01";
|
|
@@ -3769,16 +3848,33 @@ function checkG1(rows, existsFn) {
|
|
|
3769
3848
|
return { check: "G1", status: findings.length > 0 ? "fail" : "pass", findings };
|
|
3770
3849
|
}
|
|
3771
3850
|
var SCAFFOLD_PLACEHOLDER = "[undocumented — fill in why]";
|
|
3851
|
+
var NON_GATE_BIN_NAMES = NON_GATE_BINS;
|
|
3852
|
+
var TWIN_CANDIDATE_EXCEPTIONS = {
|
|
3853
|
+
"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)',
|
|
3854
|
+
"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)`,
|
|
3855
|
+
"apps/cli/src/checks/bin/check-closes-n.ts": 'Ring 1 "Closes linkage" (implementation: verify-coherence.ts)'
|
|
3856
|
+
};
|
|
3857
|
+
var NON_GATE_HOOK_SCRIPTS = [".claude/hooks/track-transcript.sh"];
|
|
3772
3858
|
function checkG2(rows, candidateFiles) {
|
|
3773
3859
|
const implementations = new Set(rows.map((r) => r.implementation).filter((p) => p !== ""));
|
|
3860
|
+
const claimedNames = new Set(rows.flatMap((r) => claimedCheckNames(r.implementation)));
|
|
3774
3861
|
const findings = [];
|
|
3775
3862
|
for (const path of candidateFiles) {
|
|
3776
|
-
if (
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3863
|
+
if (implementations.has(path))
|
|
3864
|
+
continue;
|
|
3865
|
+
if (path.startsWith(AEG_CORE_BIN_PATH_PREFIX) && NON_GATE_BIN_NAMES.includes(basenameNoExt(path)))
|
|
3866
|
+
continue;
|
|
3867
|
+
if (NON_GATE_HOOK_SCRIPTS.includes(path))
|
|
3868
|
+
continue;
|
|
3869
|
+
if (path in TWIN_CANDIDATE_EXCEPTIONS)
|
|
3870
|
+
continue;
|
|
3871
|
+
const candidateNames = claimedCheckNames(path);
|
|
3872
|
+
if (candidateNames.length > 0 && candidateNames.some((n) => claimedNames.has(n)))
|
|
3873
|
+
continue;
|
|
3874
|
+
findings.push({
|
|
3875
|
+
path,
|
|
3876
|
+
reason: `"${path}" is not named as the implementation of any row in enforcement.md's ring tables`
|
|
3877
|
+
});
|
|
3782
3878
|
}
|
|
3783
3879
|
for (const row of rows) {
|
|
3784
3880
|
const carriesPlaceholder = [row.summary, row.description, row.spec].some((cell) => cell === SCAFFOLD_PLACEHOLDER);
|
|
@@ -3790,7 +3886,7 @@ function checkG2(rows, candidateFiles) {
|
|
|
3790
3886
|
});
|
|
3791
3887
|
}
|
|
3792
3888
|
}
|
|
3793
|
-
return { check: "G2", status: findings.length > 0 ? "
|
|
3889
|
+
return { check: "G2", status: findings.length > 0 ? "fail" : "pass", findings };
|
|
3794
3890
|
}
|
|
3795
3891
|
function checkG3(ring0Rows, crossingFiles) {
|
|
3796
3892
|
const ring0Implementations = new Set(ring0Rows.map((r) => r.implementation));
|
|
@@ -4666,7 +4762,6 @@ function findWorkspaceEscapes(files, knownPaths, workspaceDirs = DEFAULT_WORKSPA
|
|
|
4666
4762
|
import { z } from "zod";
|
|
4667
4763
|
var ROLE_VALUES = [
|
|
4668
4764
|
"planner",
|
|
4669
|
-
"brief-author",
|
|
4670
4765
|
"developer",
|
|
4671
4766
|
"code-reviewer",
|
|
4672
4767
|
"security",
|
|
@@ -4740,18 +4835,20 @@ var dispatchShared = {
|
|
|
4740
4835
|
round: z.number().int().optional(),
|
|
4741
4836
|
effect_id: z.string()
|
|
4742
4837
|
};
|
|
4838
|
+
var dispatchUsageField = z.object({ input: z.number().nonnegative(), output: z.number().nonnegative() }).strict().nullable();
|
|
4743
4839
|
var DispatchEventSchema = z.discriminatedUnion("event", [
|
|
4744
4840
|
z.object({ ...dispatchShared, event: z.literal("dispatched"), prompt_hash: z.string() }).strict(),
|
|
4745
4841
|
z.object({
|
|
4746
4842
|
...dispatchShared,
|
|
4747
4843
|
event: z.literal("outcome_received"),
|
|
4748
4844
|
outcome: DispatchOutcomeSchema,
|
|
4749
|
-
usage:
|
|
4845
|
+
usage: dispatchUsageField
|
|
4750
4846
|
}).strict(),
|
|
4751
4847
|
z.object({
|
|
4752
4848
|
...dispatchShared,
|
|
4753
4849
|
event: z.literal("dispatch_failed"),
|
|
4754
|
-
reason: z.enum(["timeout", "crash", "refused", "unattributed_write"])
|
|
4850
|
+
reason: z.enum(["timeout", "crash", "refused", "unattributed_write"]),
|
|
4851
|
+
usage: dispatchUsageField
|
|
4755
4852
|
}).strict()
|
|
4756
4853
|
]);
|
|
4757
4854
|
var loopShared = {
|
|
@@ -4879,7 +4976,7 @@ var ForgeWriteEventSchema = z.discriminatedUnion("event", [
|
|
|
4879
4976
|
]);
|
|
4880
4977
|
var LogEventSchema = z.union([DispatchEventSchema, DevReviewLoopEventSchema, ForgeWriteEventSchema]);
|
|
4881
4978
|
// src/lib/diff-evidence.ts
|
|
4882
|
-
import { execFileSync as
|
|
4979
|
+
import { execFileSync as execFileSync4 } from "node:child_process";
|
|
4883
4980
|
import { join as join2, relative, resolve as resolve2 } from "node:path";
|
|
4884
4981
|
|
|
4885
4982
|
// src/lib/config.ts
|
|
@@ -5191,6 +5288,760 @@ function loadConfig() {
|
|
|
5191
5288
|
}
|
|
5192
5289
|
var TOKENS_COLLECT_TRUST_PATH = join(GLOBAL_VINAYA_HOME, "tokens-collect-trust.json");
|
|
5193
5290
|
|
|
5291
|
+
// ../../packages/sources/src/commands.ts
|
|
5292
|
+
var COMMANDS = [
|
|
5293
|
+
{
|
|
5294
|
+
name: "help",
|
|
5295
|
+
description: "Show this help text",
|
|
5296
|
+
status: "shipped"
|
|
5297
|
+
},
|
|
5298
|
+
{
|
|
5299
|
+
name: "version",
|
|
5300
|
+
description: "Print the CLI version",
|
|
5301
|
+
flags: [{ flag: "--json", description: "Enveloped JSON output (schema: 1)" }],
|
|
5302
|
+
status: "shipped"
|
|
5303
|
+
},
|
|
5304
|
+
{
|
|
5305
|
+
name: "init",
|
|
5306
|
+
description: "Install Vinaya's git hooks, CI workflow, and starter config (diff-and-confirm, non-destructive)",
|
|
5307
|
+
flags: [
|
|
5308
|
+
{ flag: "--dry-run", description: "Print the full diff without installing anything" },
|
|
5309
|
+
{ flag: "--yes", description: "Skip the confirmation prompt" }
|
|
5310
|
+
],
|
|
5311
|
+
details: [
|
|
5312
|
+
"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.",
|
|
5313
|
+
"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.",
|
|
5314
|
+
"`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.",
|
|
5315
|
+
"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.",
|
|
5316
|
+
"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.",
|
|
5317
|
+
"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."
|
|
5318
|
+
],
|
|
5319
|
+
status: "shipped"
|
|
5320
|
+
},
|
|
5321
|
+
{
|
|
5322
|
+
name: "init product",
|
|
5323
|
+
description: "Register a project in .vinaya/projects.md in an already-initialized repo",
|
|
5324
|
+
flags: [
|
|
5325
|
+
{
|
|
5326
|
+
flag: "--path <path>",
|
|
5327
|
+
description: "The project's home folder — declared, not derived. Defaults to the repo root."
|
|
5328
|
+
}
|
|
5329
|
+
],
|
|
5330
|
+
details: [
|
|
5331
|
+
"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.",
|
|
5332
|
+
"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.",
|
|
5333
|
+
"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."
|
|
5334
|
+
],
|
|
5335
|
+
status: "shipped"
|
|
5336
|
+
},
|
|
5337
|
+
{
|
|
5338
|
+
name: "check",
|
|
5339
|
+
description: "Run one check, or every registered check",
|
|
5340
|
+
flags: [
|
|
5341
|
+
{ flag: "--all", description: "Run every registered check instead of one named check" },
|
|
5342
|
+
{ flag: "--json", description: "Enveloped JSON output (schema: 1)" },
|
|
5343
|
+
{ flag: "--diff-only", description: "Scope diff-declared checks to changed files" },
|
|
5344
|
+
{
|
|
5345
|
+
flag: "--local",
|
|
5346
|
+
description: "Skip every requiresOpenPr check (closes-n, test-plan) — set by the generated hooks, never by CI"
|
|
5347
|
+
},
|
|
5348
|
+
{ flag: "--parallel[=n]", description: "Concurrency cap (default: cpu-derived)" },
|
|
5349
|
+
{
|
|
5350
|
+
flag: "--plan",
|
|
5351
|
+
description: "Print the resolved check registry and the resolved `roles` registry (default/overridden/additive) without running anything"
|
|
5352
|
+
}
|
|
5353
|
+
],
|
|
5354
|
+
details: [
|
|
5355
|
+
"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.",
|
|
5356
|
+
"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.",
|
|
5357
|
+
"`--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.",
|
|
5358
|
+
"`--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.",
|
|
5359
|
+
"`--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."
|
|
5360
|
+
],
|
|
5361
|
+
status: "shipped"
|
|
5362
|
+
},
|
|
5363
|
+
{
|
|
5364
|
+
name: "commit-msg",
|
|
5365
|
+
description: "The generated `commit-msg` hook's invocation target — validates a commit message's first line",
|
|
5366
|
+
details: [
|
|
5367
|
+
"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.",
|
|
5368
|
+
"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."
|
|
5369
|
+
],
|
|
5370
|
+
status: "shipped"
|
|
5371
|
+
},
|
|
5372
|
+
{
|
|
5373
|
+
name: "new check",
|
|
5374
|
+
description: "Scaffold a custom check into ./scripts/vinaya-checks/",
|
|
5375
|
+
details: [
|
|
5376
|
+
"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."
|
|
5377
|
+
],
|
|
5378
|
+
status: "shipped"
|
|
5379
|
+
},
|
|
5380
|
+
{
|
|
5381
|
+
name: "new noop-check",
|
|
5382
|
+
description: "Scaffold an explicit no-op into vinaya/checks/ that silences a core check",
|
|
5383
|
+
details: [
|
|
5384
|
+
"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."
|
|
5385
|
+
],
|
|
5386
|
+
status: "shipped"
|
|
5387
|
+
},
|
|
5388
|
+
{
|
|
5389
|
+
name: "new role",
|
|
5390
|
+
description: "Scaffold an additive role contract into vinaya/roles/",
|
|
5391
|
+
details: [
|
|
5392
|
+
'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.'
|
|
5393
|
+
],
|
|
5394
|
+
status: "shipped"
|
|
5395
|
+
},
|
|
5396
|
+
{
|
|
5397
|
+
name: "brief render",
|
|
5398
|
+
description: "Emit the twelve-section brief skeleton from the forge and the tree, every derivable section filled",
|
|
5399
|
+
flags: [
|
|
5400
|
+
{ flag: "--surfaces <glob1,glob2,...>", description: "Intended surface globs, expanded against tracked files" },
|
|
5401
|
+
{ flag: "--out <path>", description: "Write the rendered brief to a file instead of stdout" }
|
|
5402
|
+
],
|
|
5403
|
+
details: [
|
|
5404
|
+
"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.",
|
|
5405
|
+
"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."
|
|
5406
|
+
],
|
|
5407
|
+
status: "shipped"
|
|
5408
|
+
},
|
|
5409
|
+
{
|
|
5410
|
+
name: "task dispatch",
|
|
5411
|
+
description: "Render, pin, and post the brief on the Issue as the frozen original; start the developer",
|
|
5412
|
+
flags: [
|
|
5413
|
+
{ flag: "--agent <claude|codex|gemini>", description: "Start the developer through dispatchRole once posted" }
|
|
5414
|
+
],
|
|
5415
|
+
details: [
|
|
5416
|
+
"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.",
|
|
5417
|
+
"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.",
|
|
5418
|
+
"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."
|
|
5419
|
+
],
|
|
5420
|
+
status: "shipped"
|
|
5421
|
+
},
|
|
5422
|
+
{
|
|
5423
|
+
name: "pr create",
|
|
5424
|
+
description: "Open a pull request after full brief-schema validation",
|
|
5425
|
+
flags: [
|
|
5426
|
+
{ flag: "--title", description: "PR title (validated against the forge-title grammar)" },
|
|
5427
|
+
{ flag: "--body-file", description: "Path to the PR body (stream-safe; the same bytes are validated and sent)" },
|
|
5428
|
+
{ flag: "--label", description: "Label(s) to apply (repeatable, comma-separated)" },
|
|
5429
|
+
{ flag: "--validate-only", description: "Run every gate and report PASS without opening the PR" },
|
|
5430
|
+
{ flag: "--json", description: "Enveloped JSON output (schema: 1)" }
|
|
5431
|
+
],
|
|
5432
|
+
details: [
|
|
5433
|
+
"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.",
|
|
5434
|
+
"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.",
|
|
5435
|
+
"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."
|
|
5436
|
+
],
|
|
5437
|
+
status: "shipped"
|
|
5438
|
+
},
|
|
5439
|
+
{
|
|
5440
|
+
name: "pr edit",
|
|
5441
|
+
description: "Edit an existing pull request (<n>) after full brief-schema validation",
|
|
5442
|
+
flags: [
|
|
5443
|
+
{ flag: "--title", description: "New PR title (validated against the forge-title grammar)" },
|
|
5444
|
+
{ flag: "--body-file", description: "Path to the new PR body (stream-safe; same bytes validated and sent)" },
|
|
5445
|
+
{ flag: "--validate-only", description: "Run every gate and report PASS without editing the PR" },
|
|
5446
|
+
{ flag: "--json", description: "Enveloped JSON output (schema: 1)" }
|
|
5447
|
+
],
|
|
5448
|
+
details: [
|
|
5449
|
+
"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.",
|
|
5450
|
+
"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."
|
|
5451
|
+
],
|
|
5452
|
+
status: "shipped"
|
|
5453
|
+
},
|
|
5454
|
+
{
|
|
5455
|
+
name: "pr report",
|
|
5456
|
+
description: "Emit the AEG:EVIDENCE block — a PR body's factual claims, from commands, never typed",
|
|
5457
|
+
flags: [
|
|
5458
|
+
{
|
|
5459
|
+
flag: "--write",
|
|
5460
|
+
description: "Path to the PR body file; replaces the content between the AEG:EVIDENCE anchors in place"
|
|
5461
|
+
},
|
|
5462
|
+
{
|
|
5463
|
+
flag: "--push",
|
|
5464
|
+
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."
|
|
5465
|
+
}
|
|
5466
|
+
],
|
|
5467
|
+
details: [
|
|
5468
|
+
"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.",
|
|
5469
|
+
"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.",
|
|
5470
|
+
"`--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."
|
|
5471
|
+
],
|
|
5472
|
+
status: "shipped"
|
|
5473
|
+
},
|
|
5474
|
+
{
|
|
5475
|
+
name: "pr rule",
|
|
5476
|
+
description: "Post a Principal ruling on a PR, marked and versioned — never mistaken for a review verdict",
|
|
5477
|
+
flags: [
|
|
5478
|
+
{ flag: "--file", description: "Path to the ruling file to post as a PR comment" },
|
|
5479
|
+
{ flag: "--json", description: "Enveloped JSON output (schema: 1)" }
|
|
5480
|
+
],
|
|
5481
|
+
details: [
|
|
5482
|
+
"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.",
|
|
5483
|
+
"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."
|
|
5484
|
+
],
|
|
5485
|
+
status: "shipped"
|
|
5486
|
+
},
|
|
5487
|
+
{
|
|
5488
|
+
name: "pr verify-evidence",
|
|
5489
|
+
description: "Prove a pull request's AEG:EVIDENCE region was machine-generated — regenerate it and compare",
|
|
5490
|
+
flags: [],
|
|
5491
|
+
details: [
|
|
5492
|
+
"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.",
|
|
5493
|
+
"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.",
|
|
5494
|
+
"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.",
|
|
5495
|
+
"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."
|
|
5496
|
+
],
|
|
5497
|
+
status: "shipped"
|
|
5498
|
+
},
|
|
5499
|
+
{
|
|
5500
|
+
name: "issue create",
|
|
5501
|
+
description: "Open an issue after full brief-schema validation",
|
|
5502
|
+
flags: [
|
|
5503
|
+
{ flag: "--title", description: "Issue title (validated on task Issues)" },
|
|
5504
|
+
{ flag: "--body-file", description: "Path to the Issue body (stream-safe; same bytes validated and sent)" },
|
|
5505
|
+
{ flag: "--label", description: "Label(s) to apply; a `vinaya/tranche:*` label marks a task Issue" },
|
|
5506
|
+
{ flag: "--validate-only", description: "Run every gate and report PASS without opening the Issue" },
|
|
5507
|
+
{ flag: "--json", description: "Enveloped JSON output (schema: 1)" }
|
|
5508
|
+
],
|
|
5509
|
+
details: [
|
|
5510
|
+
"A task Issue (any `vinaya/tranche:*` label) must carry the full Planner rationale (`briefSchema.issue`); non-task Issues pass through unvalidated."
|
|
5511
|
+
],
|
|
5512
|
+
status: "shipped"
|
|
5513
|
+
},
|
|
5514
|
+
{
|
|
5515
|
+
name: "issue edit",
|
|
5516
|
+
description: "Edit an existing issue (<n>) after full brief-schema validation",
|
|
5517
|
+
flags: [
|
|
5518
|
+
{ flag: "--title", description: "New Issue title (validated on task Issues)" },
|
|
5519
|
+
{ flag: "--body-file", description: "Path to the new Issue body (stream-safe; same bytes validated and sent)" },
|
|
5520
|
+
{ flag: "--validate-only", description: "Run every gate and report PASS without editing the Issue" },
|
|
5521
|
+
{ flag: "--json", description: "Enveloped JSON output (schema: 1)" }
|
|
5522
|
+
],
|
|
5523
|
+
details: [
|
|
5524
|
+
"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."
|
|
5525
|
+
],
|
|
5526
|
+
status: "shipped"
|
|
5527
|
+
},
|
|
5528
|
+
{
|
|
5529
|
+
name: "issue objectives edit",
|
|
5530
|
+
description: "Rewrite a task Issue's `## Objectives` section by command — versioned, findable on the forge",
|
|
5531
|
+
flags: [
|
|
5532
|
+
{ flag: "--add", description: "Append a new objective as `O<max+1>` with the given sentence" },
|
|
5533
|
+
{ flag: "--drop", description: "Remove an objective by id (`O<k>`) — never renumbers the survivors" },
|
|
5534
|
+
{
|
|
5535
|
+
flag: "--replace",
|
|
5536
|
+
description: 'Replace an objective\'s sentence in place, keeping its id (`O<k>` "<sentence>")'
|
|
5537
|
+
},
|
|
5538
|
+
{ flag: "--reason", description: "Required, non-empty: why this change is being made" },
|
|
5539
|
+
{ flag: "--json", description: "Enveloped JSON output (schema: 1)" }
|
|
5540
|
+
],
|
|
5541
|
+
details: [
|
|
5542
|
+
"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.",
|
|
5543
|
+
"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.",
|
|
5544
|
+
"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."
|
|
5545
|
+
],
|
|
5546
|
+
status: "shipped"
|
|
5547
|
+
},
|
|
5548
|
+
{
|
|
5549
|
+
name: "log flush",
|
|
5550
|
+
description: "Post a target Issue or PR's outbox as one or more marked comments, then truncate what the forge confirmed",
|
|
5551
|
+
flags: [
|
|
5552
|
+
{ flag: "--issue", description: "Flush this Issue's outbox (`~/.vinaya/outbox/<owner>-<repo>/<n>.ndjson`)" },
|
|
5553
|
+
{
|
|
5554
|
+
flag: "--pr",
|
|
5555
|
+
description: "Flush the Issue named by this PR's `Closes #N` line, posting the comments on the PR"
|
|
5556
|
+
},
|
|
5557
|
+
{ flag: "--json", description: "Enveloped JSON output (schema: 1)" }
|
|
5558
|
+
],
|
|
5559
|
+
details: [
|
|
5560
|
+
"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.",
|
|
5561
|
+
"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.",
|
|
5562
|
+
"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."
|
|
5563
|
+
],
|
|
5564
|
+
status: "shipped"
|
|
5565
|
+
},
|
|
5566
|
+
{
|
|
5567
|
+
name: "milestone create",
|
|
5568
|
+
description: "Create a GitHub Milestone from a validated body",
|
|
5569
|
+
flags: [
|
|
5570
|
+
{ flag: "--title", description: "Milestone title — free text, never parsed for a version" },
|
|
5571
|
+
{
|
|
5572
|
+
flag: "--body-file",
|
|
5573
|
+
description: "Path to the Milestone description (stream-safe; same bytes validated and sent)"
|
|
5574
|
+
},
|
|
5575
|
+
{ flag: "--validate-only", description: "Run every gate and report PASS without creating the Milestone" },
|
|
5576
|
+
{ flag: "--json", description: "Enveloped JSON output (schema: 1)" }
|
|
5577
|
+
],
|
|
5578
|
+
details: [
|
|
5579
|
+
"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."
|
|
5580
|
+
],
|
|
5581
|
+
status: "shipped"
|
|
5582
|
+
},
|
|
5583
|
+
{
|
|
5584
|
+
name: "milestone adopt",
|
|
5585
|
+
description: "Move one or more existing tranches into a target Milestone",
|
|
5586
|
+
flags: [
|
|
5587
|
+
{ flag: "--target", description: "The Milestone every named slug is adopted into" },
|
|
5588
|
+
{ flag: "--slug", description: "A tranche slug to adopt — repeatable for a multi-slug move" },
|
|
5589
|
+
{ flag: "--validate-only", description: "Run every gate and report PASS without writing anything" },
|
|
5590
|
+
{ flag: "--json", description: "Enveloped JSON output (schema: 1)" }
|
|
5591
|
+
],
|
|
5592
|
+
details: [
|
|
5593
|
+
"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."
|
|
5594
|
+
],
|
|
5595
|
+
status: "shipped"
|
|
5596
|
+
},
|
|
5597
|
+
{
|
|
5598
|
+
name: "milestone edit",
|
|
5599
|
+
description: "Edit an existing Milestone (<n>) after full brief-schema validation",
|
|
5600
|
+
flags: [
|
|
5601
|
+
{
|
|
5602
|
+
flag: "--body-file",
|
|
5603
|
+
description: "Path to the new Milestone description (stream-safe; same bytes validated and sent)"
|
|
5604
|
+
},
|
|
5605
|
+
{ flag: "--validate-only", description: "Run every gate and report PASS without editing the Milestone" },
|
|
5606
|
+
{ flag: "--json", description: "Enveloped JSON output (schema: 1)" }
|
|
5607
|
+
],
|
|
5608
|
+
details: [
|
|
5609
|
+
"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."
|
|
5610
|
+
],
|
|
5611
|
+
status: "shipped"
|
|
5612
|
+
},
|
|
5613
|
+
{
|
|
5614
|
+
name: "milestone close",
|
|
5615
|
+
description: "Close a tranche's Milestone after verifying every labeled Issue is actually attached",
|
|
5616
|
+
flags: [
|
|
5617
|
+
{ flag: "--slug", description: "The tranche whose Milestone is being closed" },
|
|
5618
|
+
{ flag: "--validate-only", description: "Run every gate and report PASS without closing the Milestone" },
|
|
5619
|
+
{ flag: "--json", description: "Enveloped JSON output (schema: 1)" }
|
|
5620
|
+
],
|
|
5621
|
+
details: [
|
|
5622
|
+
"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."
|
|
5623
|
+
],
|
|
5624
|
+
status: "shipped"
|
|
5625
|
+
},
|
|
5626
|
+
{
|
|
5627
|
+
name: "review status",
|
|
5628
|
+
description: "Print the review loop's own state for a PR, and its branch's distance from the base",
|
|
5629
|
+
details: [
|
|
5630
|
+
"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.",
|
|
5631
|
+
"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.",
|
|
5632
|
+
"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."
|
|
5633
|
+
],
|
|
5634
|
+
status: "shipped"
|
|
5635
|
+
},
|
|
5636
|
+
{
|
|
5637
|
+
name: "review post",
|
|
5638
|
+
description: "Render, post, and self-verify a code-reviewer or security-review verdict comment on a PR",
|
|
5639
|
+
flags: [
|
|
5640
|
+
{ flag: "--role", description: "`code-reviewer` or `security` — selects which role template is rendered" },
|
|
5641
|
+
{
|
|
5642
|
+
flag: "--pr",
|
|
5643
|
+
description: "Target PR number — its real head is resolved via `gh pr view`, never caller-supplied"
|
|
5644
|
+
},
|
|
5645
|
+
{
|
|
5646
|
+
flag: "--verdict",
|
|
5647
|
+
description: "Optional — derived from the findings file (code-reviewer: `APPROVE`/`REQUEST_CHANGES`; security: `PASS`/`FAIL`). Refused before posting if it disagrees with the derivation."
|
|
5648
|
+
},
|
|
5649
|
+
{
|
|
5650
|
+
flag: "--escalate",
|
|
5651
|
+
description: "`authority` | `strategy` | `product` — posts an `ESCALATE:` comment instead of a verdict. Refused together with `--verdict` or a blocking finding."
|
|
5652
|
+
},
|
|
5653
|
+
{ flag: "--summary", description: "Required with `--escalate` — the escalation body text" },
|
|
5654
|
+
{
|
|
5655
|
+
flag: "--findings-file",
|
|
5656
|
+
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."
|
|
5657
|
+
},
|
|
5658
|
+
{
|
|
5659
|
+
flag: "--objectives-file",
|
|
5660
|
+
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`."
|
|
5661
|
+
},
|
|
5662
|
+
{ flag: "--brief-conformance", description: "code-reviewer only: the BRIEF CONFORMANCE line" },
|
|
5663
|
+
{ flag: "--spec-conformance", description: "code-reviewer only: the SPEC CONFORMANCE line" },
|
|
5664
|
+
{ flag: "--scope", description: "code-reviewer only: the SCOPE line" },
|
|
5665
|
+
{
|
|
5666
|
+
flag: "--scope-evidence-file",
|
|
5667
|
+
description: "code-reviewer only: pasted diff-stat output, rendered as a fence directly below the verdict block"
|
|
5668
|
+
},
|
|
5669
|
+
{ flag: "--tests", description: "code-reviewer only: the TESTS line" },
|
|
5670
|
+
{ flag: "--docs", description: "code-reviewer only: the DOCS line" },
|
|
5671
|
+
{ flag: "--config-scan", description: "security only: the CONFIG SCAN line" },
|
|
5672
|
+
{ flag: "--secrets", description: "security only: the SECRETS line" },
|
|
5673
|
+
{
|
|
5674
|
+
flag: "--secrets-evidence-file",
|
|
5675
|
+
description: 'security only: required whenever `--secrets` claims "none found" — the pasted scanner output backing that claim'
|
|
5676
|
+
},
|
|
5677
|
+
{ flag: "--task-id", description: "the closing `Tokens:` line's task id" },
|
|
5678
|
+
{ flag: "--model", description: "the closing `Tokens:` line's model name" },
|
|
5679
|
+
{ flag: "--tokens-in", description: "a non-negative integer, or `-` if unknown" },
|
|
5680
|
+
{ flag: "--tokens-out", description: "a non-negative integer, or `-` if unknown" },
|
|
5681
|
+
{ flag: "--cost", description: "free text, or `-` if unknown" },
|
|
5682
|
+
{
|
|
5683
|
+
flag: "--print-only",
|
|
5684
|
+
description: "Render and self-check the comment, print it, and exit — never calls `gh pr comment`"
|
|
5685
|
+
},
|
|
5686
|
+
{ flag: "--json", description: "Enveloped JSON output (schema: 1)" }
|
|
5687
|
+
],
|
|
5688
|
+
details: [
|
|
5689
|
+
"`--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.",
|
|
5690
|
+
"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.",
|
|
5691
|
+
"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.",
|
|
5692
|
+
"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.",
|
|
5693
|
+
"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.",
|
|
5694
|
+
"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."
|
|
5695
|
+
],
|
|
5696
|
+
status: "shipped"
|
|
5697
|
+
},
|
|
5698
|
+
{
|
|
5699
|
+
name: "doctor",
|
|
5700
|
+
description: "Diagnose hook, workflow, and config health — report only, never mutates",
|
|
5701
|
+
flags: [{ flag: "--json", description: "Enveloped JSON output (schema: 1)" }],
|
|
5702
|
+
details: [
|
|
5703
|
+
'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).',
|
|
5704
|
+
"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."
|
|
5705
|
+
],
|
|
5706
|
+
status: "shipped"
|
|
5707
|
+
},
|
|
5708
|
+
{
|
|
5709
|
+
name: "tokens",
|
|
5710
|
+
description: "Print a role's `Tokens: …` report line — the portable front door over the collection adapter",
|
|
5711
|
+
flags: [
|
|
5712
|
+
{ flag: "--phase", description: 'e.g. `"<task-id>: develop"` — required' },
|
|
5713
|
+
{ flag: "--role", description: "e.g. `Developer` — required" },
|
|
5714
|
+
{ flag: "--model", description: "Overrides the model id the adapter derived, if given" },
|
|
5715
|
+
{
|
|
5716
|
+
flag: "--transcript",
|
|
5717
|
+
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."
|
|
5718
|
+
},
|
|
5719
|
+
{
|
|
5720
|
+
flag: "--in / --out",
|
|
5721
|
+
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."
|
|
5722
|
+
}
|
|
5723
|
+
],
|
|
5724
|
+
details: [
|
|
5725
|
+
"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/`.",
|
|
5726
|
+
"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."
|
|
5727
|
+
],
|
|
5728
|
+
status: "shipped"
|
|
5729
|
+
},
|
|
5730
|
+
{
|
|
5731
|
+
name: "doctrine",
|
|
5732
|
+
description: "Print the absolute path of the bundled doctrine's front door (aeg-root/skills/aeg/SKILL.md) on this machine",
|
|
5733
|
+
flags: [{ flag: "--json", description: "Enveloped JSON output (schema: 1) — `{ root, entry }`" }],
|
|
5734
|
+
details: [
|
|
5735
|
+
"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.",
|
|
5736
|
+
"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."
|
|
5737
|
+
],
|
|
5738
|
+
status: "shipped"
|
|
5739
|
+
},
|
|
5740
|
+
{
|
|
5741
|
+
name: "upgrade",
|
|
5742
|
+
description: "Regenerate hooks, workflow, and config to the current contract version (diff-and-confirm)",
|
|
5743
|
+
flags: [
|
|
5744
|
+
{ flag: "--dry-run", description: "Print the full diff without regenerating anything" },
|
|
5745
|
+
{ flag: "--yes", description: "Skip the confirmation prompt" }
|
|
5746
|
+
],
|
|
5747
|
+
details: [
|
|
5748
|
+
"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)."
|
|
5749
|
+
],
|
|
5750
|
+
status: "shipped"
|
|
5751
|
+
},
|
|
5752
|
+
{
|
|
5753
|
+
name: "archive",
|
|
5754
|
+
description: "Run the post-merge Archivist directly: provenance + Issue close-out for a merged task PR",
|
|
5755
|
+
flags: [{ flag: "--merge-sha", description: "The merge commit to resolve (defaults to the current HEAD)" }],
|
|
5756
|
+
details: [
|
|
5757
|
+
"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.",
|
|
5758
|
+
"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.",
|
|
5759
|
+
"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."
|
|
5760
|
+
],
|
|
5761
|
+
status: "shipped"
|
|
5762
|
+
},
|
|
5763
|
+
{
|
|
5764
|
+
name: "archive tranche",
|
|
5765
|
+
description: "Close a tranche — the tranche-level bookend to `init product`, closing the Milestone via the CLI",
|
|
5766
|
+
flags: [{ flag: "--yes", description: "Skip the confirmation prompt" }],
|
|
5767
|
+
details: [
|
|
5768
|
+
"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.",
|
|
5769
|
+
"Once every task Issue is closed, prompts for confirmation (unless `--yes`) and closes the GitHub Milestone."
|
|
5770
|
+
],
|
|
5771
|
+
status: "shipped"
|
|
5772
|
+
},
|
|
5773
|
+
{
|
|
5774
|
+
name: "audit",
|
|
5775
|
+
description: "Run the ring-2 dead-branch-push and direct-main-push detection checks directly",
|
|
5776
|
+
flags: [
|
|
5777
|
+
{ flag: "--only", description: "Scope to one check: 'dead-branches' or 'direct-push'" },
|
|
5778
|
+
{ flag: "--sha", description: "The commit to check for direct-main-push (defaults to the current HEAD)" },
|
|
5779
|
+
{ flag: "--json", description: "Enveloped JSON output" }
|
|
5780
|
+
],
|
|
5781
|
+
details: [
|
|
5782
|
+
"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.",
|
|
5783
|
+
"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.",
|
|
5784
|
+
"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."
|
|
5785
|
+
],
|
|
5786
|
+
status: "shipped"
|
|
5787
|
+
},
|
|
5788
|
+
{
|
|
5789
|
+
name: "eject",
|
|
5790
|
+
description: "Remove every Vinaya-installed artifact, restoring the repo to stock",
|
|
5791
|
+
flags: [
|
|
5792
|
+
{ flag: "--dry-run", description: "Print the full removal diff without removing anything" },
|
|
5793
|
+
{ flag: "--yes", description: "Skip the confirmation prompt" }
|
|
5794
|
+
],
|
|
5795
|
+
status: "shipped"
|
|
5796
|
+
},
|
|
5797
|
+
{
|
|
5798
|
+
name: "demo break",
|
|
5799
|
+
description: "Run a guided refusal-then-fix demo on an isolated, discardable branch",
|
|
5800
|
+
flags: [{ flag: "--keep", description: "Skip cleanup and leave the demo branch checked out to inspect" }],
|
|
5801
|
+
details: [
|
|
5802
|
+
"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.",
|
|
5803
|
+
"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."
|
|
5804
|
+
],
|
|
5805
|
+
status: "shipped"
|
|
5806
|
+
},
|
|
5807
|
+
{
|
|
5808
|
+
name: "waiver",
|
|
5809
|
+
description: "Apply the actor-verified 'vinaya/waiver:docs' or 'vinaya/waiver:review' label after prompting for a reason",
|
|
5810
|
+
flags: [
|
|
5811
|
+
{ flag: "--reason", description: "The waiver rationale, posted as a PR comment (prompted for if omitted)" },
|
|
5812
|
+
{ flag: "--print-only", description: "Print the exact `gh` commands instead of running them" }
|
|
5813
|
+
],
|
|
5814
|
+
details: [
|
|
5815
|
+
"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.",
|
|
5816
|
+
"`--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."
|
|
5817
|
+
],
|
|
5818
|
+
status: "shipped"
|
|
5819
|
+
},
|
|
5820
|
+
{
|
|
5821
|
+
name: "studio",
|
|
5822
|
+
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",
|
|
5823
|
+
flags: [
|
|
5824
|
+
{
|
|
5825
|
+
flag: "--port <n>",
|
|
5826
|
+
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."
|
|
5827
|
+
}
|
|
5828
|
+
],
|
|
5829
|
+
details: [
|
|
5830
|
+
"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.",
|
|
5831
|
+
"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."
|
|
5832
|
+
],
|
|
5833
|
+
status: "shipped"
|
|
5834
|
+
},
|
|
5835
|
+
{
|
|
5836
|
+
name: "quickstart",
|
|
5837
|
+
description: "Guided wizard: init, doc-owners, project, commit, demo break, doctor, push — one command",
|
|
5838
|
+
details: [
|
|
5839
|
+
"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.",
|
|
5840
|
+
"Never reimplements or edits `init`/`init product`/`demo break`/`doctor` — it only calls their existing, unmodified entry points in sequence."
|
|
5841
|
+
],
|
|
5842
|
+
status: "shipped"
|
|
5843
|
+
},
|
|
5844
|
+
{
|
|
5845
|
+
name: "release",
|
|
5846
|
+
description: "Run this repo's own publish sequence in one command, refusing to start unless every precondition holds",
|
|
5847
|
+
flags: [
|
|
5848
|
+
{
|
|
5849
|
+
flag: "--dry-run",
|
|
5850
|
+
description: "Run the preconditions only and print the plan; publishes nothing"
|
|
5851
|
+
},
|
|
5852
|
+
{
|
|
5853
|
+
flag: "--allow-any-commit",
|
|
5854
|
+
description: "Skip the check that HEAD's commit is a Version Packages commit"
|
|
5855
|
+
}
|
|
5856
|
+
],
|
|
5857
|
+
details: [
|
|
5858
|
+
"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.",
|
|
5859
|
+
"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.",
|
|
5860
|
+
'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.'
|
|
5861
|
+
],
|
|
5862
|
+
status: "shipped"
|
|
5863
|
+
},
|
|
5864
|
+
{
|
|
5865
|
+
name: "dispatch",
|
|
5866
|
+
description: "Start a role's headless agent session (claude/codex/gemini) with attribution set on its environment, recording the outcome through the Vinaya Log",
|
|
5867
|
+
flags: [
|
|
5868
|
+
{
|
|
5869
|
+
flag: "--agent",
|
|
5870
|
+
description: "Vendor to start: `claude`, `codex`, or `gemini` (falls back to `dispatch.agent` in config)"
|
|
5871
|
+
},
|
|
5872
|
+
{ flag: "--prompt-file", description: "Path to the prompt text sent to the agent (never on argv)" },
|
|
5873
|
+
{ flag: "--task", description: "This dispatch's task Issue number — mutually exclusive with `--pr`" },
|
|
5874
|
+
{
|
|
5875
|
+
flag: "--pr",
|
|
5876
|
+
description: "Flush the outbox to this PR's Issue after the dispatch — mutually exclusive with `--task`"
|
|
5877
|
+
},
|
|
5878
|
+
{ flag: "--round", description: "Round number, for a dispatch inside a review loop" },
|
|
5879
|
+
{
|
|
5880
|
+
flag: "--resume <id>",
|
|
5881
|
+
description: "Resume the vendor's own session/thread from a prior dispatch's returned `resumeId`, instead of starting a fresh one"
|
|
5882
|
+
},
|
|
5883
|
+
{ flag: "--json", description: "Enveloped JSON output (schema: 1)" }
|
|
5884
|
+
],
|
|
5885
|
+
details: [
|
|
5886
|
+
"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.",
|
|
5887
|
+
"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`.",
|
|
5888
|
+
"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.",
|
|
5889
|
+
"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."
|
|
5890
|
+
],
|
|
5891
|
+
status: "shipped"
|
|
5892
|
+
},
|
|
5893
|
+
{
|
|
5894
|
+
name: "dev-review-loop",
|
|
5895
|
+
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",
|
|
5896
|
+
flags: [
|
|
5897
|
+
{ flag: "--task <n>", description: "This task's Issue number — its frozen `aeg:brief:v1` comment is the brief" },
|
|
5898
|
+
{
|
|
5899
|
+
flag: "--agent <claude|codex|gemini>",
|
|
5900
|
+
description: "Vendor for every dispatch this loop makes (falls back to `dispatch.agent` in config)"
|
|
5901
|
+
},
|
|
5902
|
+
{ flag: "--json", description: "Enveloped JSON output (schema: 1)" }
|
|
5903
|
+
],
|
|
5904
|
+
details: [
|
|
5905
|
+
"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> -->`.",
|
|
5906
|
+
"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.",
|
|
5907
|
+
"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.",
|
|
5908
|
+
"Every dispatch and round transition is a log line through the Vinaya Log, flushed to the forge at each round boundary."
|
|
5909
|
+
],
|
|
5910
|
+
status: "shipped"
|
|
5911
|
+
}
|
|
5912
|
+
];
|
|
5913
|
+
// ../../packages/sources/src/forge-adapter.ts
|
|
5914
|
+
function createForgeSource(config) {
|
|
5915
|
+
return {
|
|
5916
|
+
async getTranche(slug) {
|
|
5917
|
+
return deriveTrancheFromForge(config.owner, config.repo, slug);
|
|
5918
|
+
}
|
|
5919
|
+
};
|
|
5920
|
+
}
|
|
5921
|
+
// ../../packages/sources/src/select-source.ts
|
|
5922
|
+
import { z as z3 } from "zod";
|
|
5923
|
+
var StateSourceConfigSchema = z3.discriminatedUnion("kind", [
|
|
5924
|
+
z3.object({ kind: z3.literal("forge"), owner: z3.string(), repo: z3.string() }),
|
|
5925
|
+
z3.object({ kind: z3.literal("file"), root: z3.string().optional() })
|
|
5926
|
+
]);
|
|
5927
|
+
// src/checks/edge-resolve.ts
|
|
5928
|
+
import { execFileSync as execFileSync3 } from "node:child_process";
|
|
5929
|
+
var DIRECT_ISSUE_REF = /#(\d+)/;
|
|
5930
|
+
var issueCache = new Map;
|
|
5931
|
+
function fetchIssueState(num, repo) {
|
|
5932
|
+
const key = `${repo.owner}/${repo.repo}#${num}`;
|
|
5933
|
+
if (issueCache.has(key))
|
|
5934
|
+
return issueCache.get(key) ?? null;
|
|
5935
|
+
let out = null;
|
|
5936
|
+
try {
|
|
5937
|
+
const raw = execFileSync3("gh", [
|
|
5938
|
+
"issue",
|
|
5939
|
+
"view",
|
|
5940
|
+
String(num),
|
|
5941
|
+
"-R",
|
|
5942
|
+
`${repo.owner}/${repo.repo}`,
|
|
5943
|
+
"--json",
|
|
5944
|
+
"state,stateReason,closedByPullRequestsReferences"
|
|
5945
|
+
], { encoding: "utf8", stdio: ["ignore", "pipe", "pipe"] });
|
|
5946
|
+
out = JSON.parse(raw);
|
|
5947
|
+
} catch {
|
|
5948
|
+
out = null;
|
|
5949
|
+
}
|
|
5950
|
+
issueCache.set(key, out);
|
|
5951
|
+
return out;
|
|
5952
|
+
}
|
|
5953
|
+
var defaultResolveSiblingTranche = async (slug, repo) => {
|
|
5954
|
+
let tranche;
|
|
5955
|
+
try {
|
|
5956
|
+
tranche = await deriveTrancheFromForge(repo.owner, repo.repo, slug);
|
|
5957
|
+
} catch {
|
|
5958
|
+
return null;
|
|
5959
|
+
}
|
|
5960
|
+
const taskRefs = tranche.tasks.map((t) => ({ id: t.id, issue: t.issue }));
|
|
5961
|
+
const snapshot = await fetchForgeFacts({ owner: repo.owner, repo: repo.repo, tranche: slug, tasks: taskRefs });
|
|
5962
|
+
return {
|
|
5963
|
+
tasks: new Map(tranche.tasks.map((t) => [t.id, { id: t.id, issue: t.issue }])),
|
|
5964
|
+
facts: snapshot.facts
|
|
5965
|
+
};
|
|
5966
|
+
};
|
|
5967
|
+
var siblingTrancheCache = new Map;
|
|
5968
|
+
function edgeFromIssueJson(num, json) {
|
|
5969
|
+
if (json === null) {
|
|
5970
|
+
return {
|
|
5971
|
+
issue: num,
|
|
5972
|
+
merged: false,
|
|
5973
|
+
open: false,
|
|
5974
|
+
issueState: null,
|
|
5975
|
+
stateReason: null,
|
|
5976
|
+
closedByActor: null,
|
|
5977
|
+
resolved: true
|
|
5978
|
+
};
|
|
5979
|
+
}
|
|
5980
|
+
const state = json.state === "CLOSED" ? "closed" : json.state === "OPEN" ? "open" : null;
|
|
5981
|
+
const reason = json.stateReason === "COMPLETED" ? "completed" : json.stateReason === "NOT_PLANNED" ? "not_planned" : null;
|
|
5982
|
+
const closedByMergedPr = (json.closedByPullRequestsReferences ?? []).length > 0;
|
|
5983
|
+
return {
|
|
5984
|
+
issue: num,
|
|
5985
|
+
merged: state === "closed" && closedByMergedPr,
|
|
5986
|
+
open: false,
|
|
5987
|
+
issueState: state,
|
|
5988
|
+
stateReason: reason,
|
|
5989
|
+
closedByActor: null,
|
|
5990
|
+
resolved: true
|
|
5991
|
+
};
|
|
5992
|
+
}
|
|
5993
|
+
async function resolveEdge(id, taskById, factsByTaskId, repo, resolveSibling = defaultResolveSiblingTranche) {
|
|
5994
|
+
const target = taskById.get(id);
|
|
5995
|
+
if (target) {
|
|
5996
|
+
const facts = target.issue !== null ? factsByTaskId.get(target.id) : undefined;
|
|
5997
|
+
return {
|
|
5998
|
+
issue: target.issue,
|
|
5999
|
+
merged: facts?.prState === "merged",
|
|
6000
|
+
open: facts?.prState === "open",
|
|
6001
|
+
issueState: facts?.issueState ?? null,
|
|
6002
|
+
stateReason: facts?.stateReason ?? null,
|
|
6003
|
+
closedByActor: facts?.closedByActor ?? null,
|
|
6004
|
+
resolved: true
|
|
6005
|
+
};
|
|
6006
|
+
}
|
|
6007
|
+
const direct = id.match(DIRECT_ISSUE_REF);
|
|
6008
|
+
if (direct) {
|
|
6009
|
+
const num = Number(direct[1]);
|
|
6010
|
+
return edgeFromIssueJson(num, fetchIssueState(num, repo));
|
|
6011
|
+
}
|
|
6012
|
+
const qualified = splitSlugQualifiedEdge(id);
|
|
6013
|
+
if (qualified) {
|
|
6014
|
+
const cacheKey = `${repo.owner}/${repo.repo}:${qualified.slug}`;
|
|
6015
|
+
let sibling = siblingTrancheCache.get(cacheKey);
|
|
6016
|
+
if (sibling === undefined) {
|
|
6017
|
+
sibling = await resolveSibling(qualified.slug, repo);
|
|
6018
|
+
siblingTrancheCache.set(cacheKey, sibling);
|
|
6019
|
+
}
|
|
6020
|
+
const siblingTask = sibling?.tasks.get(qualified.bareId);
|
|
6021
|
+
if (sibling && siblingTask) {
|
|
6022
|
+
const facts = siblingTask.issue !== null ? sibling.facts.get(siblingTask.id) : undefined;
|
|
6023
|
+
return {
|
|
6024
|
+
issue: siblingTask.issue,
|
|
6025
|
+
merged: facts?.prState === "merged",
|
|
6026
|
+
open: facts?.prState === "open",
|
|
6027
|
+
issueState: facts?.issueState ?? null,
|
|
6028
|
+
stateReason: facts?.stateReason ?? null,
|
|
6029
|
+
closedByActor: facts?.closedByActor ?? null,
|
|
6030
|
+
resolved: true
|
|
6031
|
+
};
|
|
6032
|
+
}
|
|
6033
|
+
}
|
|
6034
|
+
return {
|
|
6035
|
+
issue: null,
|
|
6036
|
+
merged: false,
|
|
6037
|
+
open: false,
|
|
6038
|
+
issueState: null,
|
|
6039
|
+
stateReason: null,
|
|
6040
|
+
closedByActor: null,
|
|
6041
|
+
resolved: false
|
|
6042
|
+
};
|
|
6043
|
+
}
|
|
6044
|
+
|
|
5194
6045
|
// src/checks/contract.ts
|
|
5195
6046
|
var CHECK_SCHEMA_VERSION = 1;
|
|
5196
6047
|
function emitCheckError(error) {
|
|
@@ -5229,7 +6080,7 @@ function parseChangedLineRanges(diffOutput) {
|
|
|
5229
6080
|
function fileDiffAgainst(ref, path) {
|
|
5230
6081
|
let out;
|
|
5231
6082
|
try {
|
|
5232
|
-
out =
|
|
6083
|
+
out = execFileSync4("git", ["diff", `${ref}...HEAD`, "--", path], {
|
|
5233
6084
|
encoding: "utf8",
|
|
5234
6085
|
stdio: ["ignore", "pipe", "pipe"]
|
|
5235
6086
|
}).trim();
|
|
@@ -5240,7 +6091,7 @@ function fileDiffAgainst(ref, path) {
|
|
|
5240
6091
|
}
|
|
5241
6092
|
function revParse(ref) {
|
|
5242
6093
|
try {
|
|
5243
|
-
return
|
|
6094
|
+
return execFileSync4("git", ["rev-parse", "--verify", ref], {
|
|
5244
6095
|
encoding: "utf8",
|
|
5245
6096
|
stdio: ["ignore", "pipe", "pipe"]
|
|
5246
6097
|
}).trim();
|
|
@@ -5250,7 +6101,7 @@ function revParse(ref) {
|
|
|
5250
6101
|
}
|
|
5251
6102
|
function repoRoot() {
|
|
5252
6103
|
try {
|
|
5253
|
-
return
|
|
6104
|
+
return execFileSync4("git", ["rev-parse", "--show-toplevel"], {
|
|
5254
6105
|
encoding: "utf8",
|
|
5255
6106
|
stdio: ["ignore", "pipe", "pipe"]
|
|
5256
6107
|
}).trim();
|
|
@@ -5261,7 +6112,7 @@ function repoRoot() {
|
|
|
5261
6112
|
function changedFiles(base) {
|
|
5262
6113
|
let out;
|
|
5263
6114
|
try {
|
|
5264
|
-
out =
|
|
6115
|
+
out = execFileSync4("git", ["diff", "--name-only", `${base}...HEAD`], {
|
|
5265
6116
|
encoding: "utf8",
|
|
5266
6117
|
stdio: ["ignore", "pipe", "pipe"]
|
|
5267
6118
|
}).trim();
|
|
@@ -5321,7 +6172,7 @@ function findingsInThisDiff(findings) {
|
|
|
5321
6172
|
var CHECK_NAME = "doc-coverage";
|
|
5322
6173
|
function git(args) {
|
|
5323
6174
|
try {
|
|
5324
|
-
return
|
|
6175
|
+
return execFileSync5("git", args, { encoding: "utf8", stdio: ["ignore", "pipe", "pipe"] }).trim();
|
|
5325
6176
|
} catch {
|
|
5326
6177
|
return "";
|
|
5327
6178
|
}
|
|
@@ -5344,7 +6195,7 @@ function resolvePrBody() {
|
|
|
5344
6195
|
}
|
|
5345
6196
|
function fetchPrLabels(prNumber) {
|
|
5346
6197
|
try {
|
|
5347
|
-
const out =
|
|
6198
|
+
const out = execFileSync5("gh", ["pr", "view", String(prNumber), "--json", "labels"], {
|
|
5348
6199
|
encoding: "utf8",
|
|
5349
6200
|
stdio: ["ignore", "pipe", "pipe"]
|
|
5350
6201
|
});
|
|
@@ -5355,7 +6206,7 @@ function fetchPrLabels(prNumber) {
|
|
|
5355
6206
|
}
|
|
5356
6207
|
function fetchWaiverLabelActor(prNumber, label2) {
|
|
5357
6208
|
try {
|
|
5358
|
-
const out =
|
|
6209
|
+
const out = execFileSync5("gh", ["api", `repos/{owner}/{repo}/issues/${prNumber}/timeline`, "--paginate"], {
|
|
5359
6210
|
encoding: "utf8",
|
|
5360
6211
|
stdio: ["ignore", "pipe", "pipe"]
|
|
5361
6212
|
});
|