@attalabs/vinaya 0.31.0 → 0.32.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 +1 -2
- package/aeg-root/roles/developer/reference.md +3 -3
- package/aeg-root/templates/pr-report-template.md +7 -2
- package/dist/checks/bin/check-body-bare-digits.js +229 -86
- package/dist/checks/bin/check-branch-topology.js +101 -89
- package/dist/checks/bin/check-brief-shape.js +222 -79
- package/dist/checks/bin/check-changeset-coverage.js +739 -232
- package/dist/checks/bin/check-ci-shard-coverage.js +82 -0
- package/dist/checks/bin/check-closes-n.js +101 -89
- package/dist/checks/bin/check-coherence.js +233 -129
- package/dist/checks/bin/check-dead-branch-push.js +97 -44
- package/dist/checks/bin/check-dispatch-readiness.js +238 -134
- package/dist/checks/bin/check-doc-coverage-push.js +722 -215
- package/dist/checks/bin/check-doc-coverage.js +726 -219
- package/dist/checks/bin/check-doctrine-no-procedures.js +222 -79
- package/dist/checks/bin/check-doctrine-portability.js +724 -217
- package/dist/checks/bin/check-evidence-fresh.js +720 -206
- package/dist/checks/bin/check-exec-bits.js +720 -213
- package/dist/checks/bin/check-first-push-dispatch.js +231 -129
- package/dist/checks/bin/check-issue-assignment.js +103 -91
- package/dist/checks/bin/check-issue-milestone-attach.js +94 -41
- package/dist/checks/bin/check-issue-objectives-numbering.js +94 -41
- package/dist/checks/bin/check-issue-parts-coverage.js +94 -41
- package/dist/checks/bin/check-issue-surface-globs.js +251 -127
- package/dist/checks/bin/check-issue-title-grammar.js +94 -41
- package/dist/checks/bin/check-issue-tranche-label.js +94 -41
- package/dist/checks/bin/check-main-branch-refusal.js +94 -41
- package/dist/checks/bin/check-no-disk-state.js +94 -41
- package/dist/checks/bin/check-pr-premise-reassert.js +222 -77
- package/dist/checks/bin/check-pr-report-density.js +94 -41
- package/dist/checks/bin/check-principal-test-plan-wait.js +94 -39
- package/dist/checks/bin/check-quoted-command.js +710 -201
- package/dist/checks/bin/check-reader-resolvable-prose.js +722 -213
- package/dist/checks/bin/check-registry-gates.js +104 -41
- package/dist/checks/bin/check-retired-vocabulary.js +708 -199
- package/dist/checks/bin/check-review-gate.js +224 -79
- package/dist/checks/bin/check-single-plan-pr.js +94 -41
- package/dist/checks/bin/check-surface-scope.js +101 -89
- package/dist/checks/bin/check-test-plan.js +94 -39
- package/dist/checks/bin/check-token-collection-wired.js +100 -42
- package/dist/checks/bin/check-token-report.js +96 -43
- package/dist/checks/bin/check-workspace-escape.js +722 -213
- package/dist/index.js +3725 -3148
- package/dist/lib/pre-push-cache-test-run.js +4175 -0
- package/dist/lib/pre-push-select-tests.js +709 -101
- package/package.json +3 -2
|
@@ -1034,7 +1034,7 @@ function withDefaults(oldDefaults, newDefaults) {
|
|
|
1034
1034
|
var endpoint = withDefaults(null, DEFAULTS);
|
|
1035
1035
|
|
|
1036
1036
|
// ../../node_modules/fast-content-type-parse/index.js
|
|
1037
|
-
var NullObject = function
|
|
1037
|
+
var NullObject = function NullObject() {};
|
|
1038
1038
|
NullObject.prototype = Object.create(null);
|
|
1039
1039
|
var paramRE = /; *([!#$%&'*+.^\w`|~-]+)=("(?:[\v\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\v\u0020-\u00ff])*"|[!#$%&'*+.^\w`|~-]+) */gu;
|
|
1040
1040
|
var quotedPairRE = /\\([\v\u0020-\u00ff])/gu;
|
|
@@ -1778,27 +1778,27 @@ function splitTableRow(row) {
|
|
|
1778
1778
|
return parts.map((p) => p.split(PLACEHOLDER).join("|"));
|
|
1779
1779
|
}
|
|
1780
1780
|
// ../../packages/aeg-core/src/blast-radius-domains.ts
|
|
1781
|
-
function resolveWorkspaceEntry(
|
|
1782
|
-
if (
|
|
1783
|
-
const baseDir =
|
|
1781
|
+
function resolveWorkspaceEntry(entry, listDirs) {
|
|
1782
|
+
if (entry.endsWith("/*")) {
|
|
1783
|
+
const baseDir = entry.slice(0, -2);
|
|
1784
1784
|
return listDirs(baseDir).map((name) => `${baseDir}/${name}`);
|
|
1785
1785
|
}
|
|
1786
|
-
if (
|
|
1786
|
+
if (entry.includes("*"))
|
|
1787
1787
|
return [];
|
|
1788
|
-
return [
|
|
1788
|
+
return [entry];
|
|
1789
1789
|
}
|
|
1790
1790
|
// ../../packages/aeg-core/src/consumer-enumeration.ts
|
|
1791
1791
|
function deriveWorkspaceMemberDirs(workspaces, listDirs) {
|
|
1792
|
-
const positive = workspaces.filter((
|
|
1793
|
-
const negative = workspaces.filter((
|
|
1792
|
+
const positive = workspaces.filter((entry) => !entry.startsWith("!"));
|
|
1793
|
+
const negative = workspaces.filter((entry) => entry.startsWith("!")).map((entry) => entry.slice(1));
|
|
1794
1794
|
const excluded = new Set;
|
|
1795
|
-
for (const
|
|
1796
|
-
for (const member of resolveWorkspaceEntry(
|
|
1795
|
+
for (const entry of negative) {
|
|
1796
|
+
for (const member of resolveWorkspaceEntry(entry, listDirs))
|
|
1797
1797
|
excluded.add(member);
|
|
1798
1798
|
}
|
|
1799
1799
|
const members = new Set;
|
|
1800
|
-
for (const
|
|
1801
|
-
for (const member of resolveWorkspaceEntry(
|
|
1800
|
+
for (const entry of positive) {
|
|
1801
|
+
for (const member of resolveWorkspaceEntry(entry, listDirs)) {
|
|
1802
1802
|
if (!excluded.has(member))
|
|
1803
1803
|
members.add(member);
|
|
1804
1804
|
}
|
|
@@ -2122,15 +2122,15 @@ function summarizeTranscript(jsonl) {
|
|
|
2122
2122
|
const line = rawLine.trim();
|
|
2123
2123
|
if (!line)
|
|
2124
2124
|
continue;
|
|
2125
|
-
let
|
|
2125
|
+
let entry;
|
|
2126
2126
|
try {
|
|
2127
|
-
|
|
2127
|
+
entry = JSON.parse(line);
|
|
2128
2128
|
} catch {
|
|
2129
2129
|
continue;
|
|
2130
2130
|
}
|
|
2131
|
-
if (!
|
|
2131
|
+
if (!entry || typeof entry !== "object")
|
|
2132
2132
|
continue;
|
|
2133
|
-
const obj =
|
|
2133
|
+
const obj = entry;
|
|
2134
2134
|
if (obj.type !== "assistant")
|
|
2135
2135
|
continue;
|
|
2136
2136
|
const message = obj.message;
|
|
@@ -2978,7 +2978,7 @@ function isStep0Block(content) {
|
|
|
2978
2978
|
}
|
|
2979
2979
|
function checkCommandsCarryOutput(prBody) {
|
|
2980
2980
|
const errors = [];
|
|
2981
|
-
for (const [
|
|
2981
|
+
for (const [label, num] of [
|
|
2982
2982
|
["5", 5],
|
|
2983
2983
|
["6", 6]
|
|
2984
2984
|
]) {
|
|
@@ -2992,7 +2992,7 @@ function checkCommandsCarryOutput(prBody) {
|
|
|
2992
2992
|
continue;
|
|
2993
2993
|
const next = blocks[i + 1];
|
|
2994
2994
|
if (!next || isCommandBlock(next.content)) {
|
|
2995
|
-
errors.push(`brief-validation commands carry output: §${
|
|
2995
|
+
errors.push(`brief-validation commands carry output: §${label} has a command block ("${firstNonBlankLine(block.content)}") not immediately followed by a non-command output block — the very next fenced block must hold that command's actual output, not another command.`);
|
|
2996
2996
|
}
|
|
2997
2997
|
}
|
|
2998
2998
|
}
|
|
@@ -3429,8 +3429,8 @@ function stripPartBackticks(text) {
|
|
|
3429
3429
|
function partWordCount(text) {
|
|
3430
3430
|
return text.split(/\s+/).filter((w) => /[a-z]/i.test(w)).length;
|
|
3431
3431
|
}
|
|
3432
|
-
function looksLikeFilePath(
|
|
3433
|
-
const stripped =
|
|
3432
|
+
function looksLikeFilePath(entry) {
|
|
3433
|
+
const stripped = entry.replace(/\/\*\*?$/, "");
|
|
3434
3434
|
const lastSegment = stripped.split("/").pop() ?? stripped;
|
|
3435
3435
|
const extMatch = /\.[A-Za-z0-9]{1,6}$/.exec(lastSegment);
|
|
3436
3436
|
return extMatch !== null && extMatch.index > 0;
|
|
@@ -3916,14 +3916,14 @@ function checkClosesNTopology(branch, prBody, trancheFiles, taskIssueRefs) {
|
|
|
3916
3916
|
const referenced = extractClosesReferences(prBody);
|
|
3917
3917
|
if (taskIssueRefs) {
|
|
3918
3918
|
for (const n of referenced) {
|
|
3919
|
-
const
|
|
3920
|
-
if (!
|
|
3919
|
+
const ref = taskIssueRefs.get(n);
|
|
3920
|
+
if (!ref)
|
|
3921
3921
|
continue;
|
|
3922
|
-
const expectedBranch = `task/${
|
|
3922
|
+
const expectedBranch = `task/${ref.trancheSlug}/${ref.taskId}`;
|
|
3923
3923
|
if (branch !== expectedBranch) {
|
|
3924
3924
|
return {
|
|
3925
3925
|
ok: false,
|
|
3926
|
-
message: `closes-n-reverse: branch "${branch}" closes #${n} (task ${
|
|
3926
|
+
message: `closes-n-reverse: branch "${branch}" closes #${n} (task ${ref.taskId} of tranche "${ref.trancheSlug}") but is not named "${expectedBranch}" — rename the branch and re-push, or if this work is intentionally outside AEG's dispatch flow, remove the Closes reference.`
|
|
3927
3927
|
};
|
|
3928
3928
|
}
|
|
3929
3929
|
}
|
|
@@ -3932,15 +3932,15 @@ function checkClosesNTopology(branch, prBody, trancheFiles, taskIssueRefs) {
|
|
|
3932
3932
|
if (!ref)
|
|
3933
3933
|
return { ok: true };
|
|
3934
3934
|
if (ref.kind === "issue") {
|
|
3935
|
-
const
|
|
3936
|
-
if (!referenced.has(
|
|
3935
|
+
const expectedIssue = ref.issueNumber;
|
|
3936
|
+
if (!referenced.has(expectedIssue)) {
|
|
3937
3937
|
return {
|
|
3938
3938
|
ok: false,
|
|
3939
|
-
expectedIssue
|
|
3940
|
-
message: `closes-n: PR body does not contain \`Closes #${
|
|
3939
|
+
expectedIssue,
|
|
3940
|
+
message: `closes-n: PR body does not contain \`Closes #${expectedIssue}\` (required for branch "${branch}"). Add it to the PR body Summary section.`
|
|
3941
3941
|
};
|
|
3942
3942
|
}
|
|
3943
|
-
return { ok: true, expectedIssue
|
|
3943
|
+
return { ok: true, expectedIssue };
|
|
3944
3944
|
}
|
|
3945
3945
|
const trancheSlug = ref.tranche;
|
|
3946
3946
|
const taskId = ref.taskId;
|
|
@@ -3986,8 +3986,8 @@ function extractIssue(body) {
|
|
|
3986
3986
|
const anchorNums = closesRefs(anchored);
|
|
3987
3987
|
if (anchorNums.length === 0)
|
|
3988
3988
|
return { issue: null, extraIssues: bodyNums, outsideHeader: false };
|
|
3989
|
-
const
|
|
3990
|
-
return { issue
|
|
3989
|
+
const issue = anchorNums[0];
|
|
3990
|
+
return { issue, extraIssues: bodyNums.filter((n) => n !== issue), outsideHeader: false };
|
|
3991
3991
|
}
|
|
3992
3992
|
const headerNums = closesRefs(headerRegion(stripped));
|
|
3993
3993
|
if (bodyNums.length === 0)
|
|
@@ -4056,15 +4056,15 @@ function compareManifest(echoed, current, patchIdOf) {
|
|
|
4056
4056
|
const bothFullShas = echoedShaLen >= 40 && currentShaLen >= 40;
|
|
4057
4057
|
const base = patchHead || exactHead && bothFullShas ? true : isBoundToBase(echoed, current.baseSha);
|
|
4058
4058
|
const briefHashBound = isBoundToBriefHash(echoed, current.briefHash);
|
|
4059
|
-
const
|
|
4059
|
+
const objectivesVersion = isBoundToObjectives(echoed, current.objectivesVersion);
|
|
4060
4060
|
const rulingOrdinal = isBoundToRulings(echoed, current.rulingOrdinal);
|
|
4061
4061
|
const policyDigestBound = isBoundToPolicy(echoed, current.policyDigest);
|
|
4062
4062
|
return {
|
|
4063
|
-
bound: head && base && briefHashBound &&
|
|
4063
|
+
bound: head && base && briefHashBound && objectivesVersion && rulingOrdinal && policyDigestBound,
|
|
4064
4064
|
head,
|
|
4065
4065
|
base,
|
|
4066
4066
|
briefHash: briefHashBound,
|
|
4067
|
-
objectivesVersion
|
|
4067
|
+
objectivesVersion,
|
|
4068
4068
|
rulingOrdinal,
|
|
4069
4069
|
policyDigest: policyDigestBound
|
|
4070
4070
|
};
|
|
@@ -5496,6 +5496,10 @@ function findWorkspaceEscapes(files, knownPaths, workspaceDirs = DEFAULT_WORKSPA
|
|
|
5496
5496
|
}
|
|
5497
5497
|
return findings;
|
|
5498
5498
|
}
|
|
5499
|
+
// ../../packages/aeg-core/src/dev-review-loop/types.ts
|
|
5500
|
+
var SEVERITY_COLUMNS = ["blocker", "major", "minor", "critical", "high", "medium", "low"];
|
|
5501
|
+
// ../../packages/aeg-core/src/dev-review-loop/journal-reconstruction.ts
|
|
5502
|
+
var SUMMARY_TABLE_HEADER = `| round | ${SEVERITY_COLUMNS.join(" | ")} | confidence | outcome |`;
|
|
5499
5503
|
// ../../packages/aeg-core/src/log/envelope.ts
|
|
5500
5504
|
import { createHash as createHash5 } from "node:crypto";
|
|
5501
5505
|
|
|
@@ -6034,6 +6038,7 @@ function redact(value, home) {
|
|
|
6034
6038
|
return value;
|
|
6035
6039
|
}
|
|
6036
6040
|
// ../../packages/aeg-core/src/log/store.ts
|
|
6041
|
+
var KNOWN_SCHEMA_VERSIONS = [1, 2];
|
|
6037
6042
|
function metaOf(obj) {
|
|
6038
6043
|
if (obj === null || typeof obj !== "object")
|
|
6039
6044
|
return null;
|
|
@@ -6056,11 +6061,61 @@ function recordIdentity(obj) {
|
|
|
6056
6061
|
}
|
|
6057
6062
|
return null;
|
|
6058
6063
|
}
|
|
6059
|
-
|
|
6060
|
-
|
|
6061
|
-
|
|
6062
|
-
|
|
6063
|
-
|
|
6064
|
+
function schemaVersionOf(obj) {
|
|
6065
|
+
const meta = metaOf(obj);
|
|
6066
|
+
const schema = meta?.schema;
|
|
6067
|
+
return typeof schema === "number" ? schema : null;
|
|
6068
|
+
}
|
|
6069
|
+
function isKnownSchema(version) {
|
|
6070
|
+
return version !== null && KNOWN_SCHEMA_VERSIONS.includes(version);
|
|
6071
|
+
}
|
|
6072
|
+
function classifyStoredLine(raw, home) {
|
|
6073
|
+
let obj;
|
|
6074
|
+
try {
|
|
6075
|
+
obj = JSON.parse(raw);
|
|
6076
|
+
} catch {
|
|
6077
|
+
return { status: "invalid", identity: null, raw, reason: "not valid JSON" };
|
|
6078
|
+
}
|
|
6079
|
+
const version = schemaVersionOf(obj);
|
|
6080
|
+
if (version === null) {
|
|
6081
|
+
return { status: "invalid", identity: recordIdentity(obj), raw, reason: "no readable meta.schema" };
|
|
6082
|
+
}
|
|
6083
|
+
if (!isKnownSchema(version)) {
|
|
6084
|
+
return {
|
|
6085
|
+
status: "unknown_version",
|
|
6086
|
+
identity: recordIdentity(obj),
|
|
6087
|
+
schema: version,
|
|
6088
|
+
raw,
|
|
6089
|
+
reason: `schema version ${version} is not one this build validates (${KNOWN_SCHEMA_VERSIONS.join(", ")}) — kept for diagnosis`
|
|
6090
|
+
};
|
|
6091
|
+
}
|
|
6092
|
+
const result = LogEventSchema.safeParse(obj);
|
|
6093
|
+
if (!result.success) {
|
|
6094
|
+
return {
|
|
6095
|
+
status: "invalid",
|
|
6096
|
+
identity: recordIdentity(obj),
|
|
6097
|
+
raw,
|
|
6098
|
+
reason: result.error.issues[0]?.message ?? "schema violation"
|
|
6099
|
+
};
|
|
6100
|
+
}
|
|
6101
|
+
const event = result.data;
|
|
6102
|
+
const identity = recordIdentity(event);
|
|
6103
|
+
if (identity === null) {
|
|
6104
|
+
return { status: "invalid", identity: null, raw, reason: "valid event with no derivable identity" };
|
|
6105
|
+
}
|
|
6106
|
+
const redacted = redact(event, home);
|
|
6107
|
+
const provenance = version === 2 ? event.meta.provenance ?? null : null;
|
|
6108
|
+
return {
|
|
6109
|
+
status: "ok",
|
|
6110
|
+
identity,
|
|
6111
|
+
runId: event.meta.run_id,
|
|
6112
|
+
seq: event.meta.seq,
|
|
6113
|
+
schema: version,
|
|
6114
|
+
provenance,
|
|
6115
|
+
event,
|
|
6116
|
+
postLine: JSON.stringify(redacted)
|
|
6117
|
+
};
|
|
6118
|
+
}
|
|
6064
6119
|
// ../../packages/aeg-core/src/control-store/records.ts
|
|
6065
6120
|
import { z as z3 } from "zod";
|
|
6066
6121
|
var isoTimestamp = z3.string().min(1);
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// @bun
|
|
3
|
-
import { createRequire } from "node:module";
|
|
4
|
-
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
5
3
|
|
|
6
4
|
// src/checks/bin/check-token-collection-wired.ts
|
|
7
5
|
import { lstatSync, readFileSync as readFileSync2 } from "fs";
|
|
@@ -1038,7 +1036,7 @@ function withDefaults(oldDefaults, newDefaults) {
|
|
|
1038
1036
|
var endpoint = withDefaults(null, DEFAULTS);
|
|
1039
1037
|
|
|
1040
1038
|
// ../../node_modules/fast-content-type-parse/index.js
|
|
1041
|
-
var NullObject = function
|
|
1039
|
+
var NullObject = function NullObject() {};
|
|
1042
1040
|
NullObject.prototype = Object.create(null);
|
|
1043
1041
|
var paramRE = /; *([!#$%&'*+.^\w`|~-]+)=("(?:[\v\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\v\u0020-\u00ff])*"|[!#$%&'*+.^\w`|~-]+) */gu;
|
|
1044
1042
|
var quotedPairRE = /\\([\v\u0020-\u00ff])/gu;
|
|
@@ -1782,27 +1780,27 @@ function splitTableRow(row) {
|
|
|
1782
1780
|
return parts.map((p) => p.split(PLACEHOLDER).join("|"));
|
|
1783
1781
|
}
|
|
1784
1782
|
// ../../packages/aeg-core/src/blast-radius-domains.ts
|
|
1785
|
-
function resolveWorkspaceEntry(
|
|
1786
|
-
if (
|
|
1787
|
-
const baseDir =
|
|
1783
|
+
function resolveWorkspaceEntry(entry, listDirs) {
|
|
1784
|
+
if (entry.endsWith("/*")) {
|
|
1785
|
+
const baseDir = entry.slice(0, -2);
|
|
1788
1786
|
return listDirs(baseDir).map((name) => `${baseDir}/${name}`);
|
|
1789
1787
|
}
|
|
1790
|
-
if (
|
|
1788
|
+
if (entry.includes("*"))
|
|
1791
1789
|
return [];
|
|
1792
|
-
return [
|
|
1790
|
+
return [entry];
|
|
1793
1791
|
}
|
|
1794
1792
|
// ../../packages/aeg-core/src/consumer-enumeration.ts
|
|
1795
1793
|
function deriveWorkspaceMemberDirs(workspaces, listDirs) {
|
|
1796
|
-
const positive = workspaces.filter((
|
|
1797
|
-
const negative = workspaces.filter((
|
|
1794
|
+
const positive = workspaces.filter((entry) => !entry.startsWith("!"));
|
|
1795
|
+
const negative = workspaces.filter((entry) => entry.startsWith("!")).map((entry) => entry.slice(1));
|
|
1798
1796
|
const excluded = new Set;
|
|
1799
|
-
for (const
|
|
1800
|
-
for (const member of resolveWorkspaceEntry(
|
|
1797
|
+
for (const entry of negative) {
|
|
1798
|
+
for (const member of resolveWorkspaceEntry(entry, listDirs))
|
|
1801
1799
|
excluded.add(member);
|
|
1802
1800
|
}
|
|
1803
1801
|
const members = new Set;
|
|
1804
|
-
for (const
|
|
1805
|
-
for (const member of resolveWorkspaceEntry(
|
|
1802
|
+
for (const entry of positive) {
|
|
1803
|
+
for (const member of resolveWorkspaceEntry(entry, listDirs)) {
|
|
1806
1804
|
if (!excluded.has(member))
|
|
1807
1805
|
members.add(member);
|
|
1808
1806
|
}
|
|
@@ -2126,15 +2124,15 @@ function summarizeTranscript(jsonl) {
|
|
|
2126
2124
|
const line = rawLine.trim();
|
|
2127
2125
|
if (!line)
|
|
2128
2126
|
continue;
|
|
2129
|
-
let
|
|
2127
|
+
let entry;
|
|
2130
2128
|
try {
|
|
2131
|
-
|
|
2129
|
+
entry = JSON.parse(line);
|
|
2132
2130
|
} catch {
|
|
2133
2131
|
continue;
|
|
2134
2132
|
}
|
|
2135
|
-
if (!
|
|
2133
|
+
if (!entry || typeof entry !== "object")
|
|
2136
2134
|
continue;
|
|
2137
|
-
const obj =
|
|
2135
|
+
const obj = entry;
|
|
2138
2136
|
if (obj.type !== "assistant")
|
|
2139
2137
|
continue;
|
|
2140
2138
|
const message = obj.message;
|
|
@@ -2982,7 +2980,7 @@ function isStep0Block(content) {
|
|
|
2982
2980
|
}
|
|
2983
2981
|
function checkCommandsCarryOutput(prBody) {
|
|
2984
2982
|
const errors = [];
|
|
2985
|
-
for (const [
|
|
2983
|
+
for (const [label, num] of [
|
|
2986
2984
|
["5", 5],
|
|
2987
2985
|
["6", 6]
|
|
2988
2986
|
]) {
|
|
@@ -2996,7 +2994,7 @@ function checkCommandsCarryOutput(prBody) {
|
|
|
2996
2994
|
continue;
|
|
2997
2995
|
const next = blocks[i + 1];
|
|
2998
2996
|
if (!next || isCommandBlock(next.content)) {
|
|
2999
|
-
errors.push(`brief-validation commands carry output: §${
|
|
2997
|
+
errors.push(`brief-validation commands carry output: §${label} has a command block ("${firstNonBlankLine(block.content)}") not immediately followed by a non-command output block — the very next fenced block must hold that command's actual output, not another command.`);
|
|
3000
2998
|
}
|
|
3001
2999
|
}
|
|
3002
3000
|
}
|
|
@@ -3433,8 +3431,8 @@ function stripPartBackticks(text) {
|
|
|
3433
3431
|
function partWordCount(text) {
|
|
3434
3432
|
return text.split(/\s+/).filter((w) => /[a-z]/i.test(w)).length;
|
|
3435
3433
|
}
|
|
3436
|
-
function looksLikeFilePath(
|
|
3437
|
-
const stripped =
|
|
3434
|
+
function looksLikeFilePath(entry) {
|
|
3435
|
+
const stripped = entry.replace(/\/\*\*?$/, "");
|
|
3438
3436
|
const lastSegment = stripped.split("/").pop() ?? stripped;
|
|
3439
3437
|
const extMatch = /\.[A-Za-z0-9]{1,6}$/.exec(lastSegment);
|
|
3440
3438
|
return extMatch !== null && extMatch.index > 0;
|
|
@@ -3920,14 +3918,14 @@ function checkClosesNTopology(branch, prBody, trancheFiles, taskIssueRefs) {
|
|
|
3920
3918
|
const referenced = extractClosesReferences(prBody);
|
|
3921
3919
|
if (taskIssueRefs) {
|
|
3922
3920
|
for (const n of referenced) {
|
|
3923
|
-
const
|
|
3924
|
-
if (!
|
|
3921
|
+
const ref = taskIssueRefs.get(n);
|
|
3922
|
+
if (!ref)
|
|
3925
3923
|
continue;
|
|
3926
|
-
const expectedBranch = `task/${
|
|
3924
|
+
const expectedBranch = `task/${ref.trancheSlug}/${ref.taskId}`;
|
|
3927
3925
|
if (branch !== expectedBranch) {
|
|
3928
3926
|
return {
|
|
3929
3927
|
ok: false,
|
|
3930
|
-
message: `closes-n-reverse: branch "${branch}" closes #${n} (task ${
|
|
3928
|
+
message: `closes-n-reverse: branch "${branch}" closes #${n} (task ${ref.taskId} of tranche "${ref.trancheSlug}") but is not named "${expectedBranch}" — rename the branch and re-push, or if this work is intentionally outside AEG's dispatch flow, remove the Closes reference.`
|
|
3931
3929
|
};
|
|
3932
3930
|
}
|
|
3933
3931
|
}
|
|
@@ -3936,15 +3934,15 @@ function checkClosesNTopology(branch, prBody, trancheFiles, taskIssueRefs) {
|
|
|
3936
3934
|
if (!ref)
|
|
3937
3935
|
return { ok: true };
|
|
3938
3936
|
if (ref.kind === "issue") {
|
|
3939
|
-
const
|
|
3940
|
-
if (!referenced.has(
|
|
3937
|
+
const expectedIssue = ref.issueNumber;
|
|
3938
|
+
if (!referenced.has(expectedIssue)) {
|
|
3941
3939
|
return {
|
|
3942
3940
|
ok: false,
|
|
3943
|
-
expectedIssue
|
|
3944
|
-
message: `closes-n: PR body does not contain \`Closes #${
|
|
3941
|
+
expectedIssue,
|
|
3942
|
+
message: `closes-n: PR body does not contain \`Closes #${expectedIssue}\` (required for branch "${branch}"). Add it to the PR body Summary section.`
|
|
3945
3943
|
};
|
|
3946
3944
|
}
|
|
3947
|
-
return { ok: true, expectedIssue
|
|
3945
|
+
return { ok: true, expectedIssue };
|
|
3948
3946
|
}
|
|
3949
3947
|
const trancheSlug = ref.tranche;
|
|
3950
3948
|
const taskId = ref.taskId;
|
|
@@ -3990,8 +3988,8 @@ function extractIssue(body) {
|
|
|
3990
3988
|
const anchorNums = closesRefs(anchored);
|
|
3991
3989
|
if (anchorNums.length === 0)
|
|
3992
3990
|
return { issue: null, extraIssues: bodyNums, outsideHeader: false };
|
|
3993
|
-
const
|
|
3994
|
-
return { issue
|
|
3991
|
+
const issue = anchorNums[0];
|
|
3992
|
+
return { issue, extraIssues: bodyNums.filter((n) => n !== issue), outsideHeader: false };
|
|
3995
3993
|
}
|
|
3996
3994
|
const headerNums = closesRefs(headerRegion(stripped));
|
|
3997
3995
|
if (bodyNums.length === 0)
|
|
@@ -4060,15 +4058,15 @@ function compareManifest(echoed, current, patchIdOf) {
|
|
|
4060
4058
|
const bothFullShas = echoedShaLen >= 40 && currentShaLen >= 40;
|
|
4061
4059
|
const base = patchHead || exactHead && bothFullShas ? true : isBoundToBase(echoed, current.baseSha);
|
|
4062
4060
|
const briefHashBound = isBoundToBriefHash(echoed, current.briefHash);
|
|
4063
|
-
const
|
|
4061
|
+
const objectivesVersion = isBoundToObjectives(echoed, current.objectivesVersion);
|
|
4064
4062
|
const rulingOrdinal = isBoundToRulings(echoed, current.rulingOrdinal);
|
|
4065
4063
|
const policyDigestBound = isBoundToPolicy(echoed, current.policyDigest);
|
|
4066
4064
|
return {
|
|
4067
|
-
bound: head && base && briefHashBound &&
|
|
4065
|
+
bound: head && base && briefHashBound && objectivesVersion && rulingOrdinal && policyDigestBound,
|
|
4068
4066
|
head,
|
|
4069
4067
|
base,
|
|
4070
4068
|
briefHash: briefHashBound,
|
|
4071
|
-
objectivesVersion
|
|
4069
|
+
objectivesVersion,
|
|
4072
4070
|
rulingOrdinal,
|
|
4073
4071
|
policyDigest: policyDigestBound
|
|
4074
4072
|
};
|
|
@@ -5500,6 +5498,10 @@ function findWorkspaceEscapes(files, knownPaths, workspaceDirs = DEFAULT_WORKSPA
|
|
|
5500
5498
|
}
|
|
5501
5499
|
return findings;
|
|
5502
5500
|
}
|
|
5501
|
+
// ../../packages/aeg-core/src/dev-review-loop/types.ts
|
|
5502
|
+
var SEVERITY_COLUMNS = ["blocker", "major", "minor", "critical", "high", "medium", "low"];
|
|
5503
|
+
// ../../packages/aeg-core/src/dev-review-loop/journal-reconstruction.ts
|
|
5504
|
+
var SUMMARY_TABLE_HEADER = `| round | ${SEVERITY_COLUMNS.join(" | ")} | confidence | outcome |`;
|
|
5503
5505
|
// ../../packages/aeg-core/src/log/envelope.ts
|
|
5504
5506
|
import { createHash as createHash5 } from "node:crypto";
|
|
5505
5507
|
|
|
@@ -6038,6 +6040,7 @@ function redact(value, home) {
|
|
|
6038
6040
|
return value;
|
|
6039
6041
|
}
|
|
6040
6042
|
// ../../packages/aeg-core/src/log/store.ts
|
|
6043
|
+
var KNOWN_SCHEMA_VERSIONS = [1, 2];
|
|
6041
6044
|
function metaOf(obj) {
|
|
6042
6045
|
if (obj === null || typeof obj !== "object")
|
|
6043
6046
|
return null;
|
|
@@ -6060,11 +6063,61 @@ function recordIdentity(obj) {
|
|
|
6060
6063
|
}
|
|
6061
6064
|
return null;
|
|
6062
6065
|
}
|
|
6063
|
-
|
|
6064
|
-
|
|
6065
|
-
|
|
6066
|
-
|
|
6067
|
-
|
|
6066
|
+
function schemaVersionOf(obj) {
|
|
6067
|
+
const meta = metaOf(obj);
|
|
6068
|
+
const schema = meta?.schema;
|
|
6069
|
+
return typeof schema === "number" ? schema : null;
|
|
6070
|
+
}
|
|
6071
|
+
function isKnownSchema(version) {
|
|
6072
|
+
return version !== null && KNOWN_SCHEMA_VERSIONS.includes(version);
|
|
6073
|
+
}
|
|
6074
|
+
function classifyStoredLine(raw, home) {
|
|
6075
|
+
let obj;
|
|
6076
|
+
try {
|
|
6077
|
+
obj = JSON.parse(raw);
|
|
6078
|
+
} catch {
|
|
6079
|
+
return { status: "invalid", identity: null, raw, reason: "not valid JSON" };
|
|
6080
|
+
}
|
|
6081
|
+
const version = schemaVersionOf(obj);
|
|
6082
|
+
if (version === null) {
|
|
6083
|
+
return { status: "invalid", identity: recordIdentity(obj), raw, reason: "no readable meta.schema" };
|
|
6084
|
+
}
|
|
6085
|
+
if (!isKnownSchema(version)) {
|
|
6086
|
+
return {
|
|
6087
|
+
status: "unknown_version",
|
|
6088
|
+
identity: recordIdentity(obj),
|
|
6089
|
+
schema: version,
|
|
6090
|
+
raw,
|
|
6091
|
+
reason: `schema version ${version} is not one this build validates (${KNOWN_SCHEMA_VERSIONS.join(", ")}) — kept for diagnosis`
|
|
6092
|
+
};
|
|
6093
|
+
}
|
|
6094
|
+
const result = LogEventSchema.safeParse(obj);
|
|
6095
|
+
if (!result.success) {
|
|
6096
|
+
return {
|
|
6097
|
+
status: "invalid",
|
|
6098
|
+
identity: recordIdentity(obj),
|
|
6099
|
+
raw,
|
|
6100
|
+
reason: result.error.issues[0]?.message ?? "schema violation"
|
|
6101
|
+
};
|
|
6102
|
+
}
|
|
6103
|
+
const event = result.data;
|
|
6104
|
+
const identity = recordIdentity(event);
|
|
6105
|
+
if (identity === null) {
|
|
6106
|
+
return { status: "invalid", identity: null, raw, reason: "valid event with no derivable identity" };
|
|
6107
|
+
}
|
|
6108
|
+
const redacted = redact(event, home);
|
|
6109
|
+
const provenance = version === 2 ? event.meta.provenance ?? null : null;
|
|
6110
|
+
return {
|
|
6111
|
+
status: "ok",
|
|
6112
|
+
identity,
|
|
6113
|
+
runId: event.meta.run_id,
|
|
6114
|
+
seq: event.meta.seq,
|
|
6115
|
+
schema: version,
|
|
6116
|
+
provenance,
|
|
6117
|
+
event,
|
|
6118
|
+
postLine: JSON.stringify(redacted)
|
|
6119
|
+
};
|
|
6120
|
+
}
|
|
6068
6121
|
// ../../packages/aeg-core/src/control-store/records.ts
|
|
6069
6122
|
import { z as z3 } from "zod";
|
|
6070
6123
|
var isoTimestamp = z3.string().min(1);
|
|
@@ -6195,11 +6248,16 @@ var ResolutionRecordSchema = z3.object({
|
|
|
6195
6248
|
consumedAt: isoTimestamp
|
|
6196
6249
|
}).strict();
|
|
6197
6250
|
// src/checks/contract.ts
|
|
6198
|
-
var CHECK_SCHEMA_VERSION = 1;
|
|
6199
6251
|
function emitCheckError(error) {
|
|
6200
6252
|
process.stderr.write(`${JSON.stringify(error)}
|
|
6201
6253
|
`);
|
|
6202
6254
|
}
|
|
6255
|
+
// src/checks/contract.ts
|
|
6256
|
+
var CHECK_SCHEMA_VERSION = 1;
|
|
6257
|
+
function emitCheckError2(error) {
|
|
6258
|
+
process.stderr.write(`${JSON.stringify(error)}
|
|
6259
|
+
`);
|
|
6260
|
+
}
|
|
6203
6261
|
|
|
6204
6262
|
// src/checks/token-collection-wiring-logic.ts
|
|
6205
6263
|
function evaluateTokenCollectionWiring(checkName, capability) {
|