@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.
Files changed (46) hide show
  1. package/README.md +1 -2
  2. package/aeg-root/roles/developer/reference.md +3 -3
  3. package/aeg-root/templates/pr-report-template.md +7 -2
  4. package/dist/checks/bin/check-body-bare-digits.js +229 -86
  5. package/dist/checks/bin/check-branch-topology.js +101 -89
  6. package/dist/checks/bin/check-brief-shape.js +222 -79
  7. package/dist/checks/bin/check-changeset-coverage.js +739 -232
  8. package/dist/checks/bin/check-ci-shard-coverage.js +82 -0
  9. package/dist/checks/bin/check-closes-n.js +101 -89
  10. package/dist/checks/bin/check-coherence.js +233 -129
  11. package/dist/checks/bin/check-dead-branch-push.js +97 -44
  12. package/dist/checks/bin/check-dispatch-readiness.js +238 -134
  13. package/dist/checks/bin/check-doc-coverage-push.js +722 -215
  14. package/dist/checks/bin/check-doc-coverage.js +726 -219
  15. package/dist/checks/bin/check-doctrine-no-procedures.js +222 -79
  16. package/dist/checks/bin/check-doctrine-portability.js +724 -217
  17. package/dist/checks/bin/check-evidence-fresh.js +720 -206
  18. package/dist/checks/bin/check-exec-bits.js +720 -213
  19. package/dist/checks/bin/check-first-push-dispatch.js +231 -129
  20. package/dist/checks/bin/check-issue-assignment.js +103 -91
  21. package/dist/checks/bin/check-issue-milestone-attach.js +94 -41
  22. package/dist/checks/bin/check-issue-objectives-numbering.js +94 -41
  23. package/dist/checks/bin/check-issue-parts-coverage.js +94 -41
  24. package/dist/checks/bin/check-issue-surface-globs.js +251 -127
  25. package/dist/checks/bin/check-issue-title-grammar.js +94 -41
  26. package/dist/checks/bin/check-issue-tranche-label.js +94 -41
  27. package/dist/checks/bin/check-main-branch-refusal.js +94 -41
  28. package/dist/checks/bin/check-no-disk-state.js +94 -41
  29. package/dist/checks/bin/check-pr-premise-reassert.js +222 -77
  30. package/dist/checks/bin/check-pr-report-density.js +94 -41
  31. package/dist/checks/bin/check-principal-test-plan-wait.js +94 -39
  32. package/dist/checks/bin/check-quoted-command.js +710 -201
  33. package/dist/checks/bin/check-reader-resolvable-prose.js +722 -213
  34. package/dist/checks/bin/check-registry-gates.js +104 -41
  35. package/dist/checks/bin/check-retired-vocabulary.js +708 -199
  36. package/dist/checks/bin/check-review-gate.js +224 -79
  37. package/dist/checks/bin/check-single-plan-pr.js +94 -41
  38. package/dist/checks/bin/check-surface-scope.js +101 -89
  39. package/dist/checks/bin/check-test-plan.js +94 -39
  40. package/dist/checks/bin/check-token-collection-wired.js +100 -42
  41. package/dist/checks/bin/check-token-report.js +96 -43
  42. package/dist/checks/bin/check-workspace-escape.js +722 -213
  43. package/dist/index.js +3725 -3148
  44. package/dist/lib/pre-push-cache-test-run.js +4175 -0
  45. package/dist/lib/pre-push-select-tests.js +709 -101
  46. package/package.json +3 -2
@@ -1,6 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import { createRequire } from "node:module";
3
- var __require = /* @__PURE__ */ createRequire(import.meta.url);
4
2
 
5
3
  // src/checks/bin/check-registry-gates.ts
6
4
  import { execSync, execFileSync as execFileSync2 } from "node:child_process";
@@ -1039,7 +1037,7 @@ function withDefaults(oldDefaults, newDefaults) {
1039
1037
  var endpoint = withDefaults(null, DEFAULTS);
1040
1038
 
1041
1039
  // ../../node_modules/fast-content-type-parse/index.js
1042
- var NullObject = function NullObject2() {};
1040
+ var NullObject = function NullObject() {};
1043
1041
  NullObject.prototype = Object.create(null);
1044
1042
  var paramRE = /; *([!#$%&'*+.^\w`|~-]+)=("(?:[\v\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\v\u0020-\u00ff])*"|[!#$%&'*+.^\w`|~-]+) */gu;
1045
1043
  var quotedPairRE = /\\([\v\u0020-\u00ff])/gu;
@@ -1783,27 +1781,27 @@ function splitTableRow(row) {
1783
1781
  return parts.map((p) => p.split(PLACEHOLDER).join("|"));
1784
1782
  }
1785
1783
  // ../../packages/aeg-core/src/blast-radius-domains.ts
1786
- function resolveWorkspaceEntry(entry2, listDirs) {
1787
- if (entry2.endsWith("/*")) {
1788
- const baseDir = entry2.slice(0, -2);
1784
+ function resolveWorkspaceEntry(entry, listDirs) {
1785
+ if (entry.endsWith("/*")) {
1786
+ const baseDir = entry.slice(0, -2);
1789
1787
  return listDirs(baseDir).map((name) => `${baseDir}/${name}`);
1790
1788
  }
1791
- if (entry2.includes("*"))
1789
+ if (entry.includes("*"))
1792
1790
  return [];
1793
- return [entry2];
1791
+ return [entry];
1794
1792
  }
1795
1793
  // ../../packages/aeg-core/src/consumer-enumeration.ts
1796
1794
  function deriveWorkspaceMemberDirs(workspaces, listDirs) {
1797
- const positive = workspaces.filter((entry2) => !entry2.startsWith("!"));
1798
- const negative = workspaces.filter((entry2) => entry2.startsWith("!")).map((entry2) => entry2.slice(1));
1795
+ const positive = workspaces.filter((entry) => !entry.startsWith("!"));
1796
+ const negative = workspaces.filter((entry) => entry.startsWith("!")).map((entry) => entry.slice(1));
1799
1797
  const excluded = new Set;
1800
- for (const entry2 of negative) {
1801
- for (const member of resolveWorkspaceEntry(entry2, listDirs))
1798
+ for (const entry of negative) {
1799
+ for (const member of resolveWorkspaceEntry(entry, listDirs))
1802
1800
  excluded.add(member);
1803
1801
  }
1804
1802
  const members = new Set;
1805
- for (const entry2 of positive) {
1806
- for (const member of resolveWorkspaceEntry(entry2, listDirs)) {
1803
+ for (const entry of positive) {
1804
+ for (const member of resolveWorkspaceEntry(entry, listDirs)) {
1807
1805
  if (!excluded.has(member))
1808
1806
  members.add(member);
1809
1807
  }
@@ -2127,15 +2125,15 @@ function summarizeTranscript(jsonl) {
2127
2125
  const line = rawLine.trim();
2128
2126
  if (!line)
2129
2127
  continue;
2130
- let entry2;
2128
+ let entry;
2131
2129
  try {
2132
- entry2 = JSON.parse(line);
2130
+ entry = JSON.parse(line);
2133
2131
  } catch {
2134
2132
  continue;
2135
2133
  }
2136
- if (!entry2 || typeof entry2 !== "object")
2134
+ if (!entry || typeof entry !== "object")
2137
2135
  continue;
2138
- const obj = entry2;
2136
+ const obj = entry;
2139
2137
  if (obj.type !== "assistant")
2140
2138
  continue;
2141
2139
  const message = obj.message;
@@ -2983,7 +2981,7 @@ function isStep0Block(content) {
2983
2981
  }
2984
2982
  function checkCommandsCarryOutput(prBody) {
2985
2983
  const errors = [];
2986
- for (const [label2, num] of [
2984
+ for (const [label, num] of [
2987
2985
  ["5", 5],
2988
2986
  ["6", 6]
2989
2987
  ]) {
@@ -2997,7 +2995,7 @@ function checkCommandsCarryOutput(prBody) {
2997
2995
  continue;
2998
2996
  const next = blocks[i + 1];
2999
2997
  if (!next || isCommandBlock(next.content)) {
3000
- errors.push(`brief-validation commands carry output: §${label2} 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.`);
2998
+ 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.`);
3001
2999
  }
3002
3000
  }
3003
3001
  }
@@ -3434,8 +3432,8 @@ function stripPartBackticks(text) {
3434
3432
  function partWordCount(text) {
3435
3433
  return text.split(/\s+/).filter((w) => /[a-z]/i.test(w)).length;
3436
3434
  }
3437
- function looksLikeFilePath(entry2) {
3438
- const stripped = entry2.replace(/\/\*\*?$/, "");
3435
+ function looksLikeFilePath(entry) {
3436
+ const stripped = entry.replace(/\/\*\*?$/, "");
3439
3437
  const lastSegment = stripped.split("/").pop() ?? stripped;
3440
3438
  const extMatch = /\.[A-Za-z0-9]{1,6}$/.exec(lastSegment);
3441
3439
  return extMatch !== null && extMatch.index > 0;
@@ -3921,14 +3919,14 @@ function checkClosesNTopology(branch, prBody, trancheFiles, taskIssueRefs) {
3921
3919
  const referenced = extractClosesReferences(prBody);
3922
3920
  if (taskIssueRefs) {
3923
3921
  for (const n of referenced) {
3924
- const ref2 = taskIssueRefs.get(n);
3925
- if (!ref2)
3922
+ const ref = taskIssueRefs.get(n);
3923
+ if (!ref)
3926
3924
  continue;
3927
- const expectedBranch = `task/${ref2.trancheSlug}/${ref2.taskId}`;
3925
+ const expectedBranch = `task/${ref.trancheSlug}/${ref.taskId}`;
3928
3926
  if (branch !== expectedBranch) {
3929
3927
  return {
3930
3928
  ok: false,
3931
- message: `closes-n-reverse: branch "${branch}" closes #${n} (task ${ref2.taskId} of tranche "${ref2.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.`
3929
+ 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.`
3932
3930
  };
3933
3931
  }
3934
3932
  }
@@ -3937,15 +3935,15 @@ function checkClosesNTopology(branch, prBody, trancheFiles, taskIssueRefs) {
3937
3935
  if (!ref)
3938
3936
  return { ok: true };
3939
3937
  if (ref.kind === "issue") {
3940
- const expectedIssue2 = ref.issueNumber;
3941
- if (!referenced.has(expectedIssue2)) {
3938
+ const expectedIssue = ref.issueNumber;
3939
+ if (!referenced.has(expectedIssue)) {
3942
3940
  return {
3943
3941
  ok: false,
3944
- expectedIssue: expectedIssue2,
3945
- message: `closes-n: PR body does not contain \`Closes #${expectedIssue2}\` (required for branch "${branch}"). Add it to the PR body Summary section.`
3942
+ expectedIssue,
3943
+ message: `closes-n: PR body does not contain \`Closes #${expectedIssue}\` (required for branch "${branch}"). Add it to the PR body Summary section.`
3946
3944
  };
3947
3945
  }
3948
- return { ok: true, expectedIssue: expectedIssue2 };
3946
+ return { ok: true, expectedIssue };
3949
3947
  }
3950
3948
  const trancheSlug = ref.tranche;
3951
3949
  const taskId = ref.taskId;
@@ -3991,8 +3989,8 @@ function extractIssue(body) {
3991
3989
  const anchorNums = closesRefs(anchored);
3992
3990
  if (anchorNums.length === 0)
3993
3991
  return { issue: null, extraIssues: bodyNums, outsideHeader: false };
3994
- const issue2 = anchorNums[0];
3995
- return { issue: issue2, extraIssues: bodyNums.filter((n) => n !== issue2), outsideHeader: false };
3992
+ const issue = anchorNums[0];
3993
+ return { issue, extraIssues: bodyNums.filter((n) => n !== issue), outsideHeader: false };
3996
3994
  }
3997
3995
  const headerNums = closesRefs(headerRegion(stripped));
3998
3996
  if (bodyNums.length === 0)
@@ -4061,15 +4059,15 @@ function compareManifest(echoed, current, patchIdOf) {
4061
4059
  const bothFullShas = echoedShaLen >= 40 && currentShaLen >= 40;
4062
4060
  const base = patchHead || exactHead && bothFullShas ? true : isBoundToBase(echoed, current.baseSha);
4063
4061
  const briefHashBound = isBoundToBriefHash(echoed, current.briefHash);
4064
- const objectivesVersion2 = isBoundToObjectives(echoed, current.objectivesVersion);
4062
+ const objectivesVersion = isBoundToObjectives(echoed, current.objectivesVersion);
4065
4063
  const rulingOrdinal = isBoundToRulings(echoed, current.rulingOrdinal);
4066
4064
  const policyDigestBound = isBoundToPolicy(echoed, current.policyDigest);
4067
4065
  return {
4068
- bound: head && base && briefHashBound && objectivesVersion2 && rulingOrdinal && policyDigestBound,
4066
+ bound: head && base && briefHashBound && objectivesVersion && rulingOrdinal && policyDigestBound,
4069
4067
  head,
4070
4068
  base,
4071
4069
  briefHash: briefHashBound,
4072
- objectivesVersion: objectivesVersion2,
4070
+ objectivesVersion,
4073
4071
  rulingOrdinal,
4074
4072
  policyDigest: policyDigestBound
4075
4073
  };
@@ -5501,6 +5499,10 @@ function findWorkspaceEscapes(files, knownPaths, workspaceDirs = DEFAULT_WORKSPA
5501
5499
  }
5502
5500
  return findings;
5503
5501
  }
5502
+ // ../../packages/aeg-core/src/dev-review-loop/types.ts
5503
+ var SEVERITY_COLUMNS = ["blocker", "major", "minor", "critical", "high", "medium", "low"];
5504
+ // ../../packages/aeg-core/src/dev-review-loop/journal-reconstruction.ts
5505
+ var SUMMARY_TABLE_HEADER = `| round | ${SEVERITY_COLUMNS.join(" | ")} | confidence | outcome |`;
5504
5506
  // ../../packages/aeg-core/src/log/envelope.ts
5505
5507
  import { createHash as createHash5 } from "node:crypto";
5506
5508
 
@@ -6039,6 +6041,7 @@ function redact(value, home) {
6039
6041
  return value;
6040
6042
  }
6041
6043
  // ../../packages/aeg-core/src/log/store.ts
6044
+ var KNOWN_SCHEMA_VERSIONS = [1, 2];
6042
6045
  function metaOf(obj) {
6043
6046
  if (obj === null || typeof obj !== "object")
6044
6047
  return null;
@@ -6061,11 +6064,61 @@ function recordIdentity(obj) {
6061
6064
  }
6062
6065
  return null;
6063
6066
  }
6064
-
6065
- // ../../packages/aeg-core/src/log/artifact.ts
6066
- var TASK_LOG_ARTIFACT_MAX_BYTES = 8 * 1024 * 1024;
6067
- // ../../packages/aeg-core/src/dev-review-loop/journal-reconstruction.ts
6068
- var STOPPED_CONDITIONS = new Set(["confidence", "reappearance", "no_progress", "max_rounds"]);
6067
+ function schemaVersionOf(obj) {
6068
+ const meta = metaOf(obj);
6069
+ const schema = meta?.schema;
6070
+ return typeof schema === "number" ? schema : null;
6071
+ }
6072
+ function isKnownSchema(version) {
6073
+ return version !== null && KNOWN_SCHEMA_VERSIONS.includes(version);
6074
+ }
6075
+ function classifyStoredLine(raw, home) {
6076
+ let obj;
6077
+ try {
6078
+ obj = JSON.parse(raw);
6079
+ } catch {
6080
+ return { status: "invalid", identity: null, raw, reason: "not valid JSON" };
6081
+ }
6082
+ const version = schemaVersionOf(obj);
6083
+ if (version === null) {
6084
+ return { status: "invalid", identity: recordIdentity(obj), raw, reason: "no readable meta.schema" };
6085
+ }
6086
+ if (!isKnownSchema(version)) {
6087
+ return {
6088
+ status: "unknown_version",
6089
+ identity: recordIdentity(obj),
6090
+ schema: version,
6091
+ raw,
6092
+ reason: `schema version ${version} is not one this build validates (${KNOWN_SCHEMA_VERSIONS.join(", ")}) — kept for diagnosis`
6093
+ };
6094
+ }
6095
+ const result = LogEventSchema.safeParse(obj);
6096
+ if (!result.success) {
6097
+ return {
6098
+ status: "invalid",
6099
+ identity: recordIdentity(obj),
6100
+ raw,
6101
+ reason: result.error.issues[0]?.message ?? "schema violation"
6102
+ };
6103
+ }
6104
+ const event = result.data;
6105
+ const identity = recordIdentity(event);
6106
+ if (identity === null) {
6107
+ return { status: "invalid", identity: null, raw, reason: "valid event with no derivable identity" };
6108
+ }
6109
+ const redacted = redact(event, home);
6110
+ const provenance = version === 2 ? event.meta.provenance ?? null : null;
6111
+ return {
6112
+ status: "ok",
6113
+ identity,
6114
+ runId: event.meta.run_id,
6115
+ seq: event.meta.seq,
6116
+ schema: version,
6117
+ provenance,
6118
+ event,
6119
+ postLine: JSON.stringify(redacted)
6120
+ };
6121
+ }
6069
6122
  // ../../packages/aeg-core/src/control-store/records.ts
6070
6123
  import { z as z3 } from "zod";
6071
6124
  var isoTimestamp = z3.string().min(1);
@@ -6641,6 +6694,16 @@ var REGISTRY = [
6641
6694
  },
6642
6695
  0
6643
6696
  ],
6697
+ [
6698
+ {
6699
+ name: "ci-shard-coverage",
6700
+ run: bin("check-ci-shard-coverage"),
6701
+ scope: "diff",
6702
+ timeoutMs: 15000,
6703
+ env: {}
6704
+ },
6705
+ 0
6706
+ ],
6644
6707
  [
6645
6708
  {
6646
6709
  name: "workspace-escape",