@attalabs/vinaya 0.44.1 → 0.47.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 (143) hide show
  1. package/README.md +6 -4
  2. package/dist/checks/bin/check-body-bare-digits.js +233 -195
  3. package/dist/checks/bin/check-branch-topology.js +70 -23
  4. package/dist/checks/bin/check-brief-shape.js +233 -195
  5. package/dist/checks/bin/check-changeset-coverage.js +94 -16
  6. package/dist/checks/bin/check-ci-shard-coverage.js +3 -0
  7. package/dist/checks/bin/check-closes-n.js +128 -34
  8. package/dist/checks/bin/check-coherence.js +336 -245
  9. package/dist/checks/bin/check-dispatch-readiness.js +3623 -463
  10. package/dist/checks/bin/check-doc-claims.js +233 -195
  11. package/dist/checks/bin/check-doc-coverage-push.js +243 -196
  12. package/dist/checks/bin/check-doc-coverage.js +243 -196
  13. package/dist/checks/bin/check-doctrine-no-procedures.js +233 -195
  14. package/dist/checks/bin/check-doctrine-portability.js +233 -195
  15. package/dist/checks/bin/check-evidence-fresh.js +9983 -1995
  16. package/dist/checks/bin/check-exec-bits.js +3 -0
  17. package/dist/checks/bin/check-first-push-dispatch.js +301 -224
  18. package/dist/checks/bin/check-issue-milestone-attach.js +65 -10
  19. package/dist/checks/bin/check-issue-objectives-numbering.js +233 -195
  20. package/dist/checks/bin/check-issue-parts-coverage.js +65 -10
  21. package/dist/checks/bin/check-issue-surface-globs.js +1032 -236
  22. package/dist/checks/bin/check-issue-title-grammar.js +5 -1
  23. package/dist/checks/bin/check-no-disk-state.js +5 -1
  24. package/dist/checks/bin/check-pr-premise-reassert.js +10 -1
  25. package/dist/checks/bin/check-pr-report-density.js +5 -1
  26. package/dist/checks/bin/check-principal-test-plan-wait.js +253 -201
  27. package/dist/checks/bin/check-quoted-command.js +233 -195
  28. package/dist/checks/bin/check-reader-resolvable-prose.js +233 -195
  29. package/dist/checks/bin/check-registry-gates.js +131 -34
  30. package/dist/checks/bin/check-retired-vocabulary.js +233 -195
  31. package/dist/checks/bin/check-review-gate.js +233 -195
  32. package/dist/checks/bin/check-single-plan-pr.js +5 -1
  33. package/dist/checks/bin/check-surface-scope.js +107 -32
  34. package/dist/checks/bin/check-test-plan.js +253 -201
  35. package/dist/checks/bin/check-token-collection-wired.js +3 -0
  36. package/dist/checks/bin/check-workspace-escape.js +3 -0
  37. package/dist/checks/bin/verify-coherence.js +237 -148
  38. package/dist/checks/bin/verify-dispatch.js +870 -66
  39. package/dist/checks/bin/verify-docs.js +13 -6
  40. package/dist/harness.js +57 -10
  41. package/dist/index.js +16617 -7187
  42. package/dist/lib/pre-push-cache-test-run.js +4487 -2170
  43. package/dist/lib/pre-push-changed-files.js +251 -12
  44. package/dist/lib/pre-push-mode.js +69 -19
  45. package/dist/lib/pre-push-progress-dir.js +10265 -2853
  46. package/dist/lib/pre-push-record-tests.js +67 -19
  47. package/dist/lib/pre-push-select-tests.js +520 -222
  48. package/dist/lib/push-progress-observer.js +9176 -1757
  49. package/dist/process.js +2 -0
  50. package/dist/programs/archive.js +8948 -1547
  51. package/dist/programs/audit.js +9176 -1772
  52. package/dist/programs/check.js +9248 -1845
  53. package/dist/programs/commit-msg.js +8984 -1583
  54. package/dist/programs/dev-review-loop.js +15612 -7634
  55. package/dist/programs/dispatch.js +9977 -2726
  56. package/dist/programs/log-emit.js +9011 -1660
  57. package/dist/programs/log-selftest.js +8908 -1507
  58. package/dist/programs/log-send.js +9081 -1594
  59. package/dist/programs/pr-report.js +9476 -1820
  60. package/dist/programs/pr-snapshot.js +8916 -1515
  61. package/dist/programs/pr-verify-evidence.js +9481 -1825
  62. package/dist/programs/pr.js +11709 -4033
  63. package/dist/programs/review-post.js +11140 -3496
  64. package/dist/programs/review-status.js +8996 -1533
  65. package/dist/programs/run-engine.js +22031 -18759
  66. package/dist/programs/sync.js +9030 -1629
  67. package/dist/programs/task-brief.js +10185 -1821
  68. package/dist/programs/task-sweep.js +9266 -1621
  69. package/dist/programs/task-tools-serve.js +77118 -16678
  70. package/dist/programs/tokens.js +8966 -1565
  71. package/dist/programs/waiver.js +8983 -1582
  72. package/dist/types/harness/kernel/dev-process-socket/loader/load-process.d.ts +1 -1
  73. package/dist/types/harness/processes/vinaya-strict/tools/legacy-markers.d.ts +8 -0
  74. package/dist/types/harness/processes/vinaya-strict/tools/task-contract/brief-validation.d.ts +3 -3
  75. package/dist/types/harness/processes/vinaya-strict/tools/task-contract/objectives.d.ts +5 -6
  76. package/dist/vinaya-strict/checks/registry.ts +2 -2
  77. package/dist/vinaya-strict/executing/developer/developer-doctrine-shape.test.ts +8 -0
  78. package/dist/vinaya-strict/executing/developer/developer-turn-result.ts +1 -1
  79. package/dist/vinaya-strict/executing/developer/evals/developer-capability-suite.test.ts +2 -2
  80. package/dist/vinaya-strict/executing/developer/evals/developer-capability-suite.ts +30 -20
  81. package/dist/vinaya-strict/executing/developer/reference.md +5 -3
  82. package/dist/vinaya-strict/integration/config/vinaya-config-section.ts +29 -7
  83. package/dist/vinaya-strict/integration/policies/vinaya-policies.ts +4 -4
  84. package/dist/vinaya-strict/integration/process/process-integration.ts +5 -1
  85. package/dist/vinaya-strict/process.yaml +6 -1
  86. package/dist/vinaya-strict/thinking/plan-reviewer/doctrine.md +68 -0
  87. package/dist/vinaya-strict/thinking/plan-reviewer/grants.yaml +19 -0
  88. package/dist/vinaya-strict/thinking/plan-reviewer/output.schema.json +388 -0
  89. package/dist/vinaya-strict/thinking/planner/doctrine.md +4 -1
  90. package/dist/vinaya-strict/thinking/planner/tools/amend-rationale-deps.test.ts +10 -2
  91. package/dist/vinaya-strict/thinking/planner/tools/amend-rationale-deps.ts +5 -1
  92. package/dist/vinaya-strict/thinking/planner/tools/open-issue.test.ts +198 -34
  93. package/dist/vinaya-strict/thinking/planner/tools/open-issue.ts +120 -193
  94. package/dist/vinaya-strict/thinking/planner/tools/planner-operations.test.ts +629 -15
  95. package/dist/vinaya-strict/thinking/planner/tools/planner-operations.ts +726 -62
  96. package/dist/vinaya-strict/thinking/planner/tools/planner-tools.test.ts +505 -5
  97. package/dist/vinaya-strict/thinking/planner/tools/planner-tools.ts +636 -21
  98. package/package.json +3 -2
  99. package/studio-standalone/apps/vinaya-studio/.next/BUILD_ID +1 -1
  100. package/studio-standalone/apps/vinaya-studio/.next/build-manifest.json +2 -2
  101. package/studio-standalone/apps/vinaya-studio/.next/prerender-manifest.json +3 -3
  102. package/studio-standalone/apps/vinaya-studio/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  103. package/studio-standalone/apps/vinaya-studio/.next/server/app/_global-error.html +1 -1
  104. package/studio-standalone/apps/vinaya-studio/.next/server/app/_global-error.rsc +1 -1
  105. package/studio-standalone/apps/vinaya-studio/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  106. package/studio-standalone/apps/vinaya-studio/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  107. package/studio-standalone/apps/vinaya-studio/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  108. package/studio-standalone/apps/vinaya-studio/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  109. package/studio-standalone/apps/vinaya-studio/.next/server/app/milestones/page_client-reference-manifest.js +1 -1
  110. package/studio-standalone/apps/vinaya-studio/.next/server/app/page_client-reference-manifest.js +1 -1
  111. package/studio-standalone/apps/vinaya-studio/.next/server/app/tasks/page_client-reference-manifest.js +1 -1
  112. package/studio-standalone/apps/vinaya-studio/.next/server/chunks/209.js +2 -2
  113. package/studio-standalone/apps/vinaya-studio/.next/server/chunks/951.js +1 -1
  114. package/studio-standalone/apps/vinaya-studio/.next/server/middleware-build-manifest.js +1 -1
  115. package/studio-standalone/apps/vinaya-studio/.next/server/pages/500.html +1 -1
  116. package/studio-standalone/apps/vinaya-studio/.next/server/preview-props.json +3 -3
  117. package/studio-standalone/apps/vinaya-studio/.next/server/server-reference-manifest.json +1 -1
  118. package/studio-standalone/apps/vinaya-studio/.next/static/chunks/151-c365f0ef8268ad13.js +1 -0
  119. package/studio-standalone/apps/vinaya-studio/.next/static/chunks/19-aa314f13784dcc58.js +4 -0
  120. package/studio-standalone/apps/vinaya-studio/.next/static/chunks/app/{layout-dfa2186095e797bd.js → layout-f038e8deecb2bf5f.js} +1 -1
  121. package/studio-standalone/apps/vinaya-studio/.next/static/chunks/app/milestones/{page-2fffb49104860a15.js → page-12314f4deb06a414.js} +1 -1
  122. package/studio-standalone/apps/vinaya-studio/.next/static/chunks/app/{page-6ae258f663623b2a.js → page-7a06aa3cdd046fa8.js} +1 -1
  123. package/studio-standalone/apps/vinaya-studio/.next/static/chunks/app/tasks/{page-2fffb49104860a15.js → page-12314f4deb06a414.js} +1 -1
  124. package/studio-standalone/apps/vinaya-studio/.next/static/css/8eb5ed5b65b9692e.css +1 -0
  125. package/studio-standalone/apps/vinaya-studio/log-follow.mjs +708 -93
  126. package/studio-standalone/apps/vinaya-studio/log-sync-folder-source.mjs +699 -84
  127. package/studio-standalone/apps/vinaya-studio/studio-server.mjs +4692 -3116
  128. package/vinaya-strict/artifacts/templates/brief-template.md +4 -0
  129. package/vinaya-strict/artifacts/templates/issue-rationale-template.md +7 -3
  130. package/vinaya-strict/artifacts/templates/pr-report-template.md +1 -1
  131. package/vinaya-strict/doctrine/contracts/planner-developer.md +2 -1
  132. package/vinaya-strict/doctrine/enforcement.md +4 -4
  133. package/vinaya-strict/doctrine/roles/principal.md +1 -1
  134. package/vinaya-strict/doctrine/state-machine.md +7 -2
  135. package/vinaya-strict/executing/developer/reference.md +5 -3
  136. package/vinaya-strict/thinking/plan-reviewer/doctrine.md +68 -0
  137. package/vinaya-strict/thinking/planner/doctrine.md +4 -1
  138. package/vinaya-strict/thinking/planner/reference.md +29 -8
  139. package/studio-standalone/apps/vinaya-studio/.next/static/chunks/151-23bea4cac9687151.js +0 -1
  140. package/studio-standalone/apps/vinaya-studio/.next/static/chunks/853-1d5548ff3a55a75f.js +0 -4
  141. package/studio-standalone/apps/vinaya-studio/.next/static/css/fb16828fc3128d4c.css +0 -1
  142. /package/studio-standalone/apps/vinaya-studio/.next/static/{3URbt6IPajL5OOhijN1-x → bJrgAp9Kl4JsCUYkeAYez}/_buildManifest.js +0 -0
  143. /package/studio-standalone/apps/vinaya-studio/.next/static/{3URbt6IPajL5OOhijN1-x → bJrgAp9Kl4JsCUYkeAYez}/_ssgManifest.js +0 -0
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env node
2
+ import { createRequire } from "node:module";
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -23,6 +24,7 @@ var __toCommonJS = (from) => {
23
24
  return entry;
24
25
  };
25
26
  var __moduleCache;
27
+ var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
26
28
  var __returnValue = (v) => v;
27
29
  function __exportSetter(name, newValue) {
28
30
  this[name] = __returnValue.bind(null, newValue);
@@ -47,6 +49,7 @@ var __esm = (fn, res, err) => () => {
47
49
  throw err[0];
48
50
  return res;
49
51
  };
52
+ var __require = /* @__PURE__ */ createRequire(import.meta.url);
50
53
 
51
54
  // ../../harness/processes/vinaya-strict/tools/doctrine/doctrine-map.ts
52
55
  function doctrineEntry(key) {
@@ -106,6 +109,7 @@ var init_doctrine_map = __esm(() => {
106
109
  { key: "roles/developer.md", source: "executing/developer/doctrine.md", role: "developer", ships: true },
107
110
  { key: "roles/developer/reference.md", source: "executing/developer/reference.md", ships: true },
108
111
  { key: "roles/operator.md", source: "executing/operator/doctrine.md", role: "operator", ships: true },
112
+ { key: "roles/plan-reviewer.md", source: "thinking/plan-reviewer/doctrine.md", role: "plan-reviewer", ships: true },
109
113
  { key: "roles/planner.md", source: "thinking/planner/doctrine.md", role: "planner", ships: true },
110
114
  { key: "roles/planner/reference.md", source: "thinking/planner/reference.md", ships: true },
111
115
  { key: "roles/principal.md", source: "doctrine/roles/principal.md", role: "principal", ships: true },
@@ -961,59 +965,22 @@ var init_resolve_doctrine = __esm(() => {
961
965
  });
962
966
 
963
967
  // ../../harness/kernel/log/custom.ts
964
- import { z } from "zod";
965
- var CUSTOM_EVENT_NAME_PATTERN, CUSTOM_EVENT_NAME_MAX_LENGTH = 64, CUSTOM_EVENT_RESERVED_NAMESPACE = "vinaya", CUSTOM_EVENT_MAX_FIELDS = 20, CUSTOM_FIELD_NAME_PATTERN, CUSTOM_FIELD_NAME_MAX_LENGTH = 64, CUSTOM_TEXT_MAX_LENGTH = 500, CUSTOM_WORD_PATTERN, CUSTOM_WORD_MAX_LENGTH = 64, CUSTOM_FIELD_MAX_WORDS = 50, CustomFieldTypeSchema, CustomEventDeclarationsSchema;
966
- var init_custom = __esm(() => {
967
- CUSTOM_EVENT_NAME_PATTERN = /^[a-z][a-z0-9_]*\.[a-z][a-z0-9_.]*$/;
968
- CUSTOM_FIELD_NAME_PATTERN = /^[a-z][a-z0-9_]*$/;
969
- CUSTOM_WORD_PATTERN = /^[a-z0-9][a-z0-9_-]*$/;
970
- CustomFieldTypeSchema = z.union([z.enum(["text", "number", "boolean"]), z.array(z.string())]);
971
- CustomEventDeclarationsSchema = z.record(z.string(), z.object({
972
- fields: z.record(z.string(), CustomFieldTypeSchema)
973
- }).strict()).superRefine((events, ctx) => {
974
- for (const [name, declaration] of Object.entries(events)) {
975
- const refuse = (message, path = []) => {
976
- ctx.addIssue({
977
- code: z.ZodIssueCode.custom,
978
- path: [name, ...path],
979
- message: `logs.events "${name}": ${message}`
980
- });
981
- };
982
- if (name.length > CUSTOM_EVENT_NAME_MAX_LENGTH) {
983
- refuse(`the name must be at most ${CUSTOM_EVENT_NAME_MAX_LENGTH} characters`);
984
- }
985
- if (!CUSTOM_EVENT_NAME_PATTERN.test(name)) {
986
- refuse("the name must be `<namespace>.<event>` — lowercase letters, digits and `_`, a dot between them");
987
- } else if (name.split(".")[0] === CUSTOM_EVENT_RESERVED_NAMESPACE) {
988
- refuse(`the \`${CUSTOM_EVENT_RESERVED_NAMESPACE}.\` namespace is reserved for Vinaya's own events`);
989
- }
990
- const fieldEntries = Object.entries(declaration.fields);
991
- if (fieldEntries.length > CUSTOM_EVENT_MAX_FIELDS) {
992
- refuse(`at most ${CUSTOM_EVENT_MAX_FIELDS} fields may be declared (found ${fieldEntries.length})`, ["fields"]);
993
- }
994
- for (const [field, type] of fieldEntries) {
995
- if (field.length > CUSTOM_FIELD_NAME_MAX_LENGTH || !CUSTOM_FIELD_NAME_PATTERN.test(field)) {
996
- refuse(`field "${field}": a field name is lowercase letters, digits and \`_\`, starting with a letter, at most ${CUSTOM_FIELD_NAME_MAX_LENGTH} characters`, ["fields", field]);
997
- }
998
- if (typeof type === "string")
999
- continue;
1000
- if (type.length === 0) {
1001
- refuse(`field "${field}": a list of words must name at least one word`, ["fields", field]);
1002
- }
1003
- if (type.length > CUSTOM_FIELD_MAX_WORDS) {
1004
- refuse(`field "${field}": a list of words may name at most ${CUSTOM_FIELD_MAX_WORDS}`, ["fields", field]);
1005
- }
1006
- const bad = type.filter((w) => w.length > CUSTOM_WORD_MAX_LENGTH || !CUSTOM_WORD_PATTERN.test(w));
1007
- if (bad.length > 0) {
1008
- refuse(`field "${field}": a listed word is lowercase letters, digits, \`_\` and \`-\`, at most ${CUSTOM_WORD_MAX_LENGTH} characters`, ["fields", field]);
1009
- }
1010
- if (new Set(type).size !== type.length) {
1011
- refuse(`field "${field}": a list of words names a word twice`, ["fields", field]);
1012
- }
1013
- }
1014
- }
1015
- });
1016
- });
968
+ import {
969
+ CUSTOM_EVENT_MAX_FIELDS,
970
+ CUSTOM_EVENT_NAME_MAX_LENGTH,
971
+ CUSTOM_EVENT_NAME_PATTERN,
972
+ CUSTOM_EVENT_RESERVED_NAMESPACE,
973
+ CUSTOM_FIELD_MAX_WORDS,
974
+ CUSTOM_FIELD_NAME_MAX_LENGTH,
975
+ CUSTOM_FIELD_NAME_PATTERN,
976
+ CUSTOM_TEXT_MAX_LENGTH,
977
+ CUSTOM_WORD_MAX_LENGTH,
978
+ CUSTOM_WORD_PATTERN,
979
+ CustomEventDeclarationsSchema,
980
+ checkCustomEvent,
981
+ UNRECORDABLE_FIELD_NAME
982
+ } from "@attalabs/vinaya-log-sdk";
983
+ var init_custom = () => {};
1017
984
 
1018
985
  // ../../harness/kernel/gates/checks/contract.ts
1019
986
  function emitCheckError(error) {
@@ -1360,14 +1327,15 @@ ${detail}`;
1360
1327
  return null;
1361
1328
  }
1362
1329
  }
1363
- function loadTrustAnchorConfig(fetcher = fetchTrustAnchorConfig) {
1330
+ function loadTrustAnchorConfig(fetcher = fetchTrustAnchorConfig, loadOptions = {}) {
1331
+ const warn = loadOptions.quiet ? () => {} : warnTrustAnchorFallback;
1364
1332
  let base64;
1365
1333
  try {
1366
1334
  base64 = fetcher();
1367
1335
  } catch (err) {
1368
- return trustAnchorFetchFailed(err);
1336
+ return trustAnchorFetchFailed(err, warn);
1369
1337
  }
1370
- return parseTrustAnchorContent(base64);
1338
+ return parseTrustAnchorContent(base64, warn);
1371
1339
  }
1372
1340
  function loadTrustAnchorConfigOrThrow(fetcher = fetchTrustAnchorConfig) {
1373
1341
  let base64;
@@ -1426,9 +1394,9 @@ var installed = null, NO_CONFIG_PROVIDER_MESSAGE = "no configuration provider is
1426
1394
 
1427
1395
  // ../../harness/kernel/config/schema/config-schema.ts
1428
1396
  import { isAbsolute } from "node:path";
1429
- import { z as z2 } from "zod";
1397
+ import { z } from "zod";
1430
1398
  function checkEntrySchema(fields) {
1431
- return z2.object(fields).superRefine((entry, ctx) => {
1399
+ return z.object(fields).superRefine((entry, ctx) => {
1432
1400
  const env = entry.env;
1433
1401
  if (!env)
1434
1402
  return;
@@ -1438,14 +1406,14 @@ function checkEntrySchema(fields) {
1438
1406
  const members = value.anyOf;
1439
1407
  if (new Set(members).size !== members.length) {
1440
1408
  ctx.addIssue({
1441
- code: z2.ZodIssueCode.custom,
1409
+ code: z.ZodIssueCode.custom,
1442
1410
  message: `env.${key}.anyOf has duplicate members`,
1443
1411
  path: ["env", key, "anyOf"]
1444
1412
  });
1445
1413
  }
1446
1414
  if (!members.includes(key)) {
1447
1415
  ctx.addIssue({
1448
- code: z2.ZodIssueCode.custom,
1416
+ code: z.ZodIssueCode.custom,
1449
1417
  message: `env.${key}.anyOf must include "${key}" itself as a member`,
1450
1418
  path: ["env", key, "anyOf"]
1451
1419
  });
@@ -1468,26 +1436,31 @@ function hookBlockPathRule(prefixes) {
1468
1436
  return { isCanonical, schema };
1469
1437
  }
1470
1438
  function managedManifestSchemas(agentVendors, hookBlockPrefixes) {
1471
- const block = z2.object({
1439
+ const block = z.object({
1472
1440
  path: hookBlockPathRule(hookBlockPrefixes).schema,
1473
- marker: z2.string(),
1474
- comment: z2.enum(["hash", "html"])
1441
+ marker: z.string(),
1442
+ comment: z.enum(["hash", "html"])
1475
1443
  });
1476
- const manifest = z2.object({
1477
- version: z2.number().int().positive(),
1478
- files: z2.array(SafeRepoRelPath),
1479
- blocks: z2.array(block),
1480
- labels: z2.array(z2.string()),
1481
- agents: z2.array(z2.enum(agentVendors)).optional()
1444
+ const manifest = z.object({
1445
+ version: z.number().int().positive(),
1446
+ files: z.array(SafeRepoRelPath),
1447
+ blocks: z.array(block),
1448
+ labels: z.array(z.string()),
1449
+ agents: z.array(z.enum(agentVendors)).optional()
1482
1450
  });
1483
1451
  return { block, manifest };
1484
1452
  }
1485
1453
  function logsSchema(events) {
1486
- return z2.object({
1487
- folder: z2.string().min(1).refine((v) => isAbsolute(v), { message: "logs.folder: must be an absolute path" }).optional(),
1488
- url: z2.string().url().optional(),
1489
- headers: z2.record(z2.string()).optional(),
1490
- readHeaders: z2.record(z2.string()).optional(),
1454
+ return z.object({
1455
+ folder: z.string().min(1).refine((v) => isAbsolute(v), { message: "logs.folder: must be an absolute path" }).optional(),
1456
+ url: z.string().url().optional(),
1457
+ otlp: z.object({
1458
+ url: z.string().url().regex(/^https?:\/\//i),
1459
+ headers: z.record(z.string()).optional()
1460
+ }).strict().optional(),
1461
+ headers: z.record(z.string()).optional(),
1462
+ readHeaders: z.record(z.string()).optional(),
1463
+ keepDays: z.number({ invalid_type_error: "must be a whole number of days" }).int({ message: "must be a whole number of days" }).min(1, { message: "must be at least 1" }).optional(),
1491
1464
  events: events.optional()
1492
1465
  }).refine((v) => [v.folder, v.url].filter((x) => x !== undefined).length <= 1, {
1493
1466
  message: "logs: set at most one of folder/url"
@@ -1495,22 +1468,22 @@ function logsSchema(events) {
1495
1468
  message: "logs: headers requires url"
1496
1469
  }).refine((v) => v.readHeaders === undefined || v.url !== undefined, {
1497
1470
  message: "logs: readHeaders requires url"
1498
- }).or(z2.literal(false)).optional();
1471
+ }).or(z.literal(false)).optional();
1499
1472
  }
1500
1473
  function kernelConfigFragment(leaves) {
1501
1474
  return {
1502
- rings: z2.object({
1503
- ring1_forgeWriteInterception: z2.boolean(),
1504
- ring2_asyncAudits: z2.boolean()
1475
+ rings: z.object({
1476
+ ring1_forgeWriteInterception: z.boolean(),
1477
+ ring2_asyncAudits: z.boolean()
1505
1478
  }).optional(),
1506
- checks: z2.record(z2.string(), checkEntrySchema(leaves.checkEntryFields)).optional(),
1479
+ checks: z.record(z.string(), checkEntrySchema(leaves.checkEntryFields)).optional(),
1507
1480
  managed: managedManifestSchemas(leaves.agentVendors, leaves.hookBlockPrefixes).manifest.optional(),
1508
- ci: z2.object({ setup: z2.string().min(1) }).optional(),
1509
- logPublish: z2.unknown().refine((v) => v === undefined, {
1481
+ ci: z.object({ setup: z.string().min(1) }).optional(),
1482
+ logPublish: z.unknown().refine((v) => v === undefined, {
1510
1483
  message: "logPublish is removed — telemetry is never posted to a tracker or a code host; configure `logs` instead (a folder or a server destination)"
1511
1484
  }),
1512
- runtimeDir: z2.string().min(1).refine((v) => isAbsolute(v), { message: "runtimeDir: must be an absolute path" }).optional(),
1513
- runner: z2.enum(["standalone", "atta-engine"]).optional(),
1485
+ runtimeDir: z.string().min(1).refine((v) => isAbsolute(v), { message: "runtimeDir: must be an absolute path" }).optional(),
1486
+ runner: z.enum(["standalone", "atta-engine"]).optional(),
1514
1487
  logs: logsSchema(leaves.logEvents)
1515
1488
  };
1516
1489
  }
@@ -1550,25 +1523,25 @@ function resolveLogsHeaderValues(headers, env) {
1550
1523
  }
1551
1524
  var EnvEntrySchema, KERNEL_CHECK_ENTRY_FIELDS, SafeRepoRelPath, KERNEL_CONFIG_REFINEMENTS;
1552
1525
  var init_config_schema = __esm(() => {
1553
- EnvEntrySchema = z2.union([
1554
- z2.literal(true),
1555
- z2.object({ optional: z2.literal(true) }),
1556
- z2.object({ anyOf: z2.array(z2.string()).min(2) }),
1557
- z2.string()
1526
+ EnvEntrySchema = z.union([
1527
+ z.literal(true),
1528
+ z.object({ optional: z.literal(true) }),
1529
+ z.object({ anyOf: z.array(z.string()).min(2) }),
1530
+ z.string()
1558
1531
  ]);
1559
1532
  KERNEL_CHECK_ENTRY_FIELDS = {
1560
- run: z2.string(),
1561
- scope: z2.enum(["diff", "full"]),
1562
- include: z2.array(z2.string()).optional(),
1563
- args: z2.array(z2.string()).optional(),
1564
- timeoutMs: z2.number().optional(),
1565
- env: z2.record(z2.string(), EnvEntrySchema).optional(),
1566
- requiresOpenPr: z2.boolean().optional(),
1567
- ownWorkflow: z2.boolean().optional(),
1568
- validates: z2.enum(["body", "issue"]).optional(),
1569
- advisory: z2.literal(true).optional()
1533
+ run: z.string(),
1534
+ scope: z.enum(["diff", "full"]),
1535
+ include: z.array(z.string()).optional(),
1536
+ args: z.array(z.string()).optional(),
1537
+ timeoutMs: z.number().optional(),
1538
+ env: z.record(z.string(), EnvEntrySchema).optional(),
1539
+ requiresOpenPr: z.boolean().optional(),
1540
+ ownWorkflow: z.boolean().optional(),
1541
+ validates: z.enum(["body", "issue"]).optional(),
1542
+ advisory: z.literal(true).optional()
1570
1543
  };
1571
- SafeRepoRelPath = z2.string().refine(isSafeRepoRelPath, {
1544
+ SafeRepoRelPath = z.string().refine(isSafeRepoRelPath, {
1572
1545
  message: "must be a repo-root-relative path with no `..` segment or absolute root"
1573
1546
  });
1574
1547
  KERNEL_CONFIG_REFINEMENTS = [];
@@ -2031,6 +2004,23 @@ async function ghApiGetAllPagesAsync(pathWithoutPage, opts) {
2031
2004
  }
2032
2005
  throw new Error(`ghApiGetAllPagesAsync: "${pathWithoutPage}" did not terminate within ${MAX_PAGES} pages (${MAX_PAGES * MAX_PER_PAGE} items) — refusing to keep walking.`);
2033
2006
  }
2007
+ async function ghLabelIssueCountsAsync(owner, repo, labelQuery) {
2008
+ const stdout = await runAsync([
2009
+ "api",
2010
+ "graphql",
2011
+ "--paginate",
2012
+ "-f",
2013
+ `query=${LABEL_ISSUE_COUNTS_QUERY.replace("$labelQuery", JSON.stringify(labelQuery))}`,
2014
+ "-f",
2015
+ `owner=${owner}`,
2016
+ "-f",
2017
+ `name=${repo}`,
2018
+ "--jq",
2019
+ ".data.repository.labels.nodes[] | {name, open: .open.totalCount, total: .all.totalCount}"
2020
+ ]);
2021
+ return stdout.split(`
2022
+ `).filter((line) => line.trim() !== "").map((line) => JSON.parse(line));
2023
+ }
2034
2024
  function issueListByLabelArgs(owner, repo, label) {
2035
2025
  return [
2036
2026
  "issue",
@@ -2064,7 +2054,14 @@ async function ghIssueListByAnyLabelAsync(owner, repo, labels) {
2064
2054
  const perLabel = await Promise.all(labels.map((l) => ghIssueListByLabelAsync(owner, repo, l)));
2065
2055
  return dedupeByNumber(perLabel.flat());
2066
2056
  }
2067
- var execFileAsync2, systemEnv, MAX_PER_PAGE = 100, MAX_PAGES = 100;
2057
+ var execFileAsync2, systemEnv, MAX_PER_PAGE = 100, MAX_PAGES = 100, LABEL_ISSUE_COUNTS_QUERY = `query($owner: String!, $name: String!, $endCursor: String) {
2058
+ repository(owner: $owner, name: $name) {
2059
+ labels(first: 100, after: $endCursor, query: $labelQuery) {
2060
+ pageInfo { hasNextPage endCursor }
2061
+ nodes { name open: issues(states: OPEN) { totalCount } all: issues { totalCount } }
2062
+ }
2063
+ }
2064
+ }`;
2068
2065
  var init_gh = __esm(() => {
2069
2066
  execFileAsync2 = promisify2(execFile2);
2070
2067
  systemEnv = {
@@ -2405,7 +2402,7 @@ function commentMarkerFamily(name) {
2405
2402
  function anchorAlternation(spellings) {
2406
2403
  return `(?:${spellings.map((spelling) => spelling.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|")})`;
2407
2404
  }
2408
- var REGION_PREFIX, PROVENANCE_HEADING, CLAIM_ANCHOR, QUOTES_FILE_ANCHOR, VENDOR_EXAMPLE_ANCHOR, COMMENT_MARKER_PREFIX, FROZEN_BRIEF_MARKER, DEVELOPER_ROUND_MARKER, DEVELOPER_STOP_MARKER, LOOP_PUBLISHED_MARKER, LOOP_PAUSED_MARKER, LOOP_UNPUSHED_WORK_RESUME_MARKER, PRINCIPAL_RULING_MARKER, OBJECTIVES_VERSION_MARKER, DEFERRED_FINDINGS_MARKER, COMMENT_MARKER_PREFIX_CURRENT, COMMENT_MARKER_PREFIXES, COMMENT_MARKER_PREFIX_PATTERN, REGION_PREFIX_CURRENT, REGION_PREFIXES, PROVENANCE_HEADINGS, CLAIM_ANCHORS, QUOTES_FILE_ANCHORS, VENDOR_EXAMPLE_ANCHORS;
2405
+ var REGION_PREFIX, PROVENANCE_HEADING, CLAIM_ANCHOR, QUOTES_FILE_ANCHOR, VENDOR_EXAMPLE_ANCHOR, COMMENT_MARKER_PREFIX, FROZEN_BRIEF_MARKER, DEVELOPER_ROUND_MARKER, DEVELOPER_STOP_MARKER, LOOP_PUBLISHED_MARKER, LOOP_PAUSED_MARKER, LOOP_UNPUSHED_WORK_RESUME_MARKER, PRINCIPAL_RULING_MARKER, OBJECTIVES_VERSION_MARKER, DOCUMENTATION_EDIT_MARKER, DEFERRED_FINDINGS_MARKER, COMMENT_MARKER_PREFIX_CURRENT, COMMENT_MARKER_PREFIXES, COMMENT_MARKER_PREFIX_PATTERN, REGION_PREFIX_CURRENT, REGION_PREFIXES, PROVENANCE_HEADINGS, CLAIM_ANCHORS, QUOTES_FILE_ANCHORS, VENDOR_EXAMPLE_ANCHORS;
2409
2406
  var init_legacy_markers = __esm(() => {
2410
2407
  REGION_PREFIX = { old: "AEG", current: "VINAYA" };
2411
2408
  PROVENANCE_HEADING = {
@@ -2427,6 +2424,7 @@ var init_legacy_markers = __esm(() => {
2427
2424
  LOOP_UNPUSHED_WORK_RESUME_MARKER = commentMarkerFamily("loop:unpushed-work-resume");
2428
2425
  PRINCIPAL_RULING_MARKER = commentMarkerFamily("principal:ruling");
2429
2426
  OBJECTIVES_VERSION_MARKER = commentMarkerFamily("objectives");
2427
+ DOCUMENTATION_EDIT_MARKER = commentMarkerFamily("documentation");
2430
2428
  DEFERRED_FINDINGS_MARKER = commentMarkerFamily("deferred-findings");
2431
2429
  COMMENT_MARKER_PREFIX_CURRENT = COMMENT_MARKER_PREFIX.current;
2432
2430
  COMMENT_MARKER_PREFIXES = [COMMENT_MARKER_PREFIX.current, COMMENT_MARKER_PREFIX.old];
@@ -3506,7 +3504,13 @@ function isMechanicallyNeutralDiff(diffText, path) {
3506
3504
  }
3507
3505
  return sawChange;
3508
3506
  }
3509
- function evaluateC5(changed, docOwnersContent, prBody, fileExists, waiverActive, getDiff) {
3507
+ function prBodyGiven(env = process.env) {
3508
+ return env.PR_BODY !== undefined || env.PR_BODY_FILE !== undefined;
3509
+ }
3510
+ function owedNeutralNotes(result) {
3511
+ return result.notes.filter((n) => n.startsWith(DOC_NEUTRAL_OWED_PREFIX));
3512
+ }
3513
+ function evaluateC5(changed, docOwnersContent, prBody, fileExists, waiverActive, getDiff, bodyGiven = true) {
3510
3514
  const out = { errors: [], notes: [] };
3511
3515
  if (docOwnersContent === null)
3512
3516
  return out;
@@ -3546,24 +3550,28 @@ function evaluateC5(changed, docOwnersContent, prBody, fileExists, waiverActive,
3546
3550
  }
3547
3551
  if (changed.includes(pointerPath))
3548
3552
  continue;
3553
+ const evidenced = () => getDiff !== undefined && matchedFiles.every((f) => {
3554
+ const diff = getDiff(f);
3555
+ return diff !== null && isMechanicallyNeutralDiff(diff, f);
3556
+ });
3549
3557
  const declared = neutrals.find((n) => n.surface === b.pointer);
3550
3558
  if (declared) {
3551
- const evidenced = getDiff !== undefined && matchedFiles.every((f) => {
3552
- const diff = getDiff(f);
3553
- return diff !== null && isMechanicallyNeutralDiff(diff, f);
3554
- });
3555
- if (evidenced) {
3559
+ if (evidenced()) {
3556
3560
  out.notes.push(`C5 doc-neutral: ${b.pointer} not required for ${DOC_OWNERS_PATH}:${b.lineNum} (glob \`${b.glob}\`) — declared neutral ("${declared.note}"), diff of ${matchedFiles.join(", ")} confirmed comment/whitespace-only.`);
3557
3561
  continue;
3558
3562
  }
3559
3563
  out.errors.push(`C5 doc-neutral-unverified: ${DOC_OWNERS_PATH}:${b.lineNum} (glob \`${b.glob}\` → ${b.pointer}) declared \`Doc-neutral: ${b.pointer} — ${declared.note}\`, but the diff of ${matchedFiles.join(", ")} contains changes beyond comments/whitespace. Update ${pointerPath}, or have a principal apply the \`${WAIVER_LABEL}\` label.`);
3560
3564
  continue;
3561
3565
  }
3566
+ if (!bodyGiven && evidenced()) {
3567
+ out.notes.push(`${DOC_NEUTRAL_OWED_PREFIX} ${b.pointer} not required in this run for ${DOC_OWNERS_PATH}:${b.lineNum} (glob \`${b.glob}\`) — no pull request body was given, and the diff of ${matchedFiles.join(", ")} is comment/whitespace-only. The pull request body owes \`Doc-neutral: ${b.pointer} — <why>\`.`);
3568
+ continue;
3569
+ }
3562
3570
  out.errors.push(`C5 doc-coverage: code change matched ${DOC_OWNERS_PATH}:${b.lineNum} (glob \`${b.glob}\` → ${b.pointer}), but ${pointerPath} is not in the PR diff. Update it, declare \`Doc-neutral: ${b.pointer} — <why>\` if the change is genuinely mechanically-neutral, or have a principal apply the \`${WAIVER_LABEL}\` label.`);
3563
3571
  }
3564
3572
  return out;
3565
3573
  }
3566
- var DOC_OWNERS_PATH = ".vinaya/doc-owners", SEPARATOR, LANGUAGE_COMMENT_PREFIXES;
3574
+ var DOC_OWNERS_PATH = ".vinaya/doc-owners", SEPARATOR, LANGUAGE_COMMENT_PREFIXES, DOC_NEUTRAL_OWED_PREFIX = "C5 doc-neutral-owed:";
3567
3575
  var init_doc_owners = __esm(() => {
3568
3576
  init_file_classify();
3569
3577
  init_waiver_label();
@@ -3618,6 +3626,20 @@ var init_protected_paths = __esm(() => {
3618
3626
  ];
3619
3627
  });
3620
3628
 
3629
+ // ../../harness/processes/vinaya-strict/tools/task-contract/test-plan-proof.ts
3630
+ function stripObjectiveIdSpans(text) {
3631
+ return text.replace(ITEM_IDS_SPAN_RE, "").trim();
3632
+ }
3633
+ var ID_LIST, LINE_IDS_RE, ITEM_IDS_SPAN_RE;
3634
+ var init_test_plan_proof = __esm(() => {
3635
+ init_brief_validation();
3636
+ init_objectives();
3637
+ init_test_plan_section();
3638
+ ID_LIST = String.raw`O\d+(?:\s*,\s*O\d+)*`;
3639
+ LINE_IDS_RE = new RegExp(String.raw`\(\s*(${ID_LIST})\s*\)\s*$`);
3640
+ ITEM_IDS_SPAN_RE = new RegExp(String.raw`(?<!\`)(\`+)\s*\(?\s*(${ID_LIST})\s*\)?\s*\1(?!\`)`, "g");
3641
+ });
3642
+
3621
3643
  // ../../harness/processes/vinaya-strict/tools/task-contract/issue-validation.ts
3622
3644
  function hasRationaleField(body, labelPattern) {
3623
3645
  const re = new RegExp(`(?:\\*\\*|^#{1,4}\\s+)\\s*(?:${labelPattern})`, "im");
@@ -3816,7 +3838,7 @@ function checkPartsCiteDefinedObjectives(body) {
3816
3838
  return { status: errors.length > 0 ? "fail" : "pass", errors };
3817
3839
  }
3818
3840
  function liveCommand(text) {
3819
- const trimmed = text.trim();
3841
+ const trimmed = stripObjectiveIdSpans(text);
3820
3842
  const span = /^(`+)(.+)\1$/.exec(trimmed);
3821
3843
  return span ? span[2].trim() : trimmed;
3822
3844
  }
@@ -3951,11 +3973,13 @@ var init_issue_validation = __esm(() => {
3951
3973
  init_derive_section7();
3952
3974
  init_doctrine_map();
3953
3975
  init_objectives();
3976
+ init_waiver_label();
3954
3977
  init_issue_documentation();
3955
3978
  init_touched_path();
3956
3979
  init_protected_paths();
3957
3980
  init_quoted_command();
3958
3981
  init_test_plan_section();
3982
+ init_test_plan_proof();
3959
3983
  RATIONALE_FIELDS = [
3960
3984
  { name: "Boundary", pattern: "Boundary" },
3961
3985
  { name: "Sizing", pattern: "Sizing" },
@@ -4452,7 +4476,7 @@ var init_review_gate = __esm(() => {
4452
4476
 
4453
4477
  // ../../harness/processes/vinaya-strict/tools/prose-rules-config.ts
4454
4478
  import safeRegex from "safe-regex2";
4455
- import { z as z3 } from "zod";
4479
+ import { z as z2 } from "zod";
4456
4480
  function isPlainObject(value) {
4457
4481
  return typeof value === "object" && value !== null && !Array.isArray(value);
4458
4482
  }
@@ -4722,18 +4746,18 @@ var init_prose_rules_config = __esm(() => {
4722
4746
  FIXED_DEFAULT_KEYS = ["pattern", "patterns", "flags", "means", "message", "id"];
4723
4747
  CUSTOM_KEYS = ["id", "pattern", "patterns", "flags", "means", "scopes", "severity", "exempt"];
4724
4748
  DEFAULT_IDS = new Set([...DEFAULT_PROSE_RULES.map((rule) => rule.id), DECISION_RECORD_CITATION_ID]);
4725
- RepoRelativePathSchema = z3.string().min(1).superRefine((entry, ctx) => {
4749
+ RepoRelativePathSchema = z2.string().min(1).superRefine((entry, ctx) => {
4726
4750
  const reason = outsideRepositoryReason(entry);
4727
4751
  if (reason)
4728
- ctx.addIssue({ code: z3.ZodIssueCode.custom, message: reason });
4752
+ ctx.addIssue({ code: z2.ZodIssueCode.custom, message: reason });
4729
4753
  });
4730
- ProseRulesSchema = z3.unknown().superRefine((value, ctx) => {
4754
+ ProseRulesSchema = z2.unknown().superRefine((value, ctx) => {
4731
4755
  for (const issue of proseRulesIssues(value)) {
4732
- ctx.addIssue({ code: z3.ZodIssueCode.custom, path: issue.path, message: issue.message });
4756
+ ctx.addIssue({ code: z2.ZodIssueCode.custom, path: issue.path, message: issue.message });
4733
4757
  }
4734
4758
  }).transform((value) => value);
4735
- PublishedProseSchema = z3.object({
4736
- allow: z3.array(z3.string().min(1)).optional()
4759
+ PublishedProseSchema = z2.object({
4760
+ allow: z2.array(z2.string().min(1)).optional()
4737
4761
  }).strict();
4738
4762
  });
4739
4763
 
@@ -4748,10 +4772,13 @@ var exports_vinaya_config_section = {};
4748
4772
  __export(exports_vinaya_config_section, {
4749
4773
  BRIEF_BUILTINS: () => BRIEF_BUILTINS,
4750
4774
  CANONICAL_HOOK_BLOCK_PREFIXES: () => CANONICAL_HOOK_BLOCK_PREFIXES,
4775
+ DEFAULT_REVIEW_AGENT: () => DEFAULT_REVIEW_AGENT,
4776
+ DEFAULT_REVIEW_ROUND_LIMIT: () => DEFAULT_REVIEW_ROUND_LIMIT,
4751
4777
  LOCAL_OVERRIDABLE_KEYS: () => LOCAL_OVERRIDABLE_KEYS,
4752
4778
  LOCAL_OVERRIDE_FILENAME: () => LOCAL_OVERRIDE_FILENAME,
4753
4779
  PRINCIPALS_FIX: () => PRINCIPALS_FIX,
4754
4780
  PrincipalsUnresolvedError: () => PrincipalsUnresolvedError,
4781
+ REVIEW_AGENT_SETTINGS: () => REVIEW_AGENT_SETTINGS,
4755
4782
  VINAYA_CHECK_ENTRY_FIELDS: () => VINAYA_CHECK_ENTRY_FIELDS,
4756
4783
  VINAYA_CONFIG_FILENAME: () => VINAYA_CONFIG_FILENAME,
4757
4784
  VINAYA_CONFIG_FRAGMENT: () => VINAYA_CONFIG_FRAGMENT,
@@ -4773,7 +4800,9 @@ __export(exports_vinaya_config_section, {
4773
4800
  resolveGateCutovers: () => resolveGateCutovers,
4774
4801
  resolveLocalPacingOverride: () => resolveLocalPacingOverride,
4775
4802
  resolveReleaseActor: () => resolveReleaseActor,
4803
+ resolveReviewAgent: () => resolveReviewAgent,
4776
4804
  resolveReviewPolicy: () => resolveReviewPolicy,
4805
+ resolveReviewRoundLimit: () => resolveReviewRoundLimit,
4777
4806
  resolveSecurityScanCommand: () => resolveSecurityScanCommand,
4778
4807
  tokensCollectTrustKey: () => tokensCollectTrustKey,
4779
4808
  trustAnchorFallbackWarning: () => trustAnchorFallbackWarning,
@@ -4784,7 +4813,7 @@ import { execFileSync as execFileSync4 } from "node:child_process";
4784
4813
  import { existsSync as existsSync4, mkdirSync as mkdirSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2 } from "node:fs";
4785
4814
  import { homedir } from "node:os";
4786
4815
  import { dirname as dirname4, join as join4 } from "node:path";
4787
- import { z as z4 } from "zod";
4816
+ import { z as z3 } from "zod";
4788
4817
  function isDefaultedAgentVendorPath(path, manifest) {
4789
4818
  if (manifest.agents !== undefined)
4790
4819
  return false;
@@ -4818,7 +4847,7 @@ function decisionRecordsOutsideDoctrine(config, ctx) {
4818
4847
  return;
4819
4848
  const issue = decisionRecordsPathIssue(path, config.proseGates?.doctrineRoot);
4820
4849
  if (issue)
4821
- ctx.addIssue({ code: z4.ZodIssueCode.custom, path: ["decisionRecords", "path"], message: issue });
4850
+ ctx.addIssue({ code: z3.ZodIssueCode.custom, path: ["decisionRecords", "path"], message: issue });
4822
4851
  }
4823
4852
  function globalPrincipalsIgnoredWarning(path) {
4824
4853
  return `${path}: "principals" in the global config is ignored — principals may only be declared from a repo-local vinaya.config.json.`;
@@ -4922,6 +4951,12 @@ function resolveGateCutovers(config) {
4922
4951
  function resolveCollisionThreshold(config) {
4923
4952
  return config?.planning?.collisionThreshold ?? DEFAULT_COLLISION_THRESHOLD;
4924
4953
  }
4954
+ function resolveReviewRoundLimit(config) {
4955
+ return config?.planning?.reviewRoundLimit ?? DEFAULT_REVIEW_ROUND_LIMIT;
4956
+ }
4957
+ function resolveReviewAgent(config) {
4958
+ return config?.planning?.reviewAgent ?? DEFAULT_REVIEW_AGENT;
4959
+ }
4925
4960
  function principalsNotConfigured(why) {
4926
4961
  return new PrincipalsUnresolvedError("not-configured", `no Principal is configured (${why}) — ${PRINCIPALS_FIX}.`);
4927
4962
  }
@@ -4936,7 +4971,7 @@ function createTrustedPrincipalsResolver(reads) {
4936
4971
  }
4937
4972
  if (isMissingFileError(err))
4938
4973
  throw principalsNotConfigured("the default branch has no vinaya.config.json");
4939
- throw new PrincipalsUnresolvedError("read-failed", `could not read "principals" from vinaya.config.json on the default branch: ${fetchFailureReason(err)}`);
4974
+ throw new PrincipalsUnresolvedError("read-failed", `could not read "principals" from vinaya.config.json on the default branch: ${fetchFailureReason(err)}`, { cause: err });
4940
4975
  }
4941
4976
  const unusable = { why: "" };
4942
4977
  const config = reads.parse(content, (why) => {
@@ -4996,7 +5031,7 @@ function trustTokensCollectCommand(repoGitCommonDir, interpreter, script, script
4996
5031
  store[key] = { interpreter, script, scriptBlobHash, trustedAt: new Date().toISOString() };
4997
5032
  writeTokensCollectTrustStore(storePath, store);
4998
5033
  }
4999
- var VINAYA_HOME, VINAYA_GLOBAL_CONFIG_FILENAME = "config.json", VINAYA_CONFIG_FILENAME = "vinaya.config.json", CANONICAL_HOOK_BLOCK_PREFIXES, VINAYA_CHECK_ENTRY_FIELDS, AGENTS_SKILLS_PREFIX = ".agents/skills/", CLAUDE_SKILLS_PREFIX = ".claude/skills/vinaya-", RoleEntrySchema, MAX_REPORT_COMMAND_TIMEOUT_MS = 3600000, BRIEF_BUILTINS, BriefSectionSchema, BriefSchemaSchema, ProjectEntrySchema, VINAYA_CONFIG_FRAGMENT, LOCAL_OVERRIDE_FILENAME = "vinaya.config.local.json", LOCAL_OVERRIDABLE_KEYS, PrincipalsUnresolvedError, PRINCIPALS_FIX = 'add "principals": [...] to vinaya.config.json on the default branch', TOKENS_COLLECT_TRUST_PATH, VINAYA_GLOBAL_ONLY_KEYS, VINAYA_CONFIG_SECTION;
5034
+ var VINAYA_HOME, VINAYA_GLOBAL_CONFIG_FILENAME = "config.json", VINAYA_CONFIG_FILENAME = "vinaya.config.json", CANONICAL_HOOK_BLOCK_PREFIXES, VINAYA_CHECK_ENTRY_FIELDS, AGENTS_SKILLS_PREFIX = ".agents/skills/", CLAUDE_SKILLS_PREFIX = ".claude/skills/vinaya-", RoleEntrySchema, MAX_REPORT_COMMAND_TIMEOUT_MS = 3600000, BRIEF_BUILTINS, BriefSectionSchema, BriefSchemaSchema, ProjectEntrySchema, VINAYA_CONFIG_FRAGMENT, LOCAL_OVERRIDE_FILENAME = "vinaya.config.local.json", LOCAL_OVERRIDABLE_KEYS, DEFAULT_REVIEW_ROUND_LIMIT = 2, REVIEW_AGENT_SETTINGS, DEFAULT_REVIEW_AGENT = "same", PrincipalsUnresolvedError, PRINCIPALS_FIX = 'add "principals": [...] to vinaya.config.json on the default branch', TOKENS_COLLECT_TRUST_PATH, VINAYA_GLOBAL_ONLY_KEYS, VINAYA_CONFIG_SECTION;
5000
5035
  var init_vinaya_config_section = __esm(() => {
5001
5036
  init_review_policy();
5002
5037
  init_issue_validation();
@@ -5010,10 +5045,10 @@ var init_vinaya_config_section = __esm(() => {
5010
5045
  VINAYA_HOME = join4(homedir(), ".vinaya");
5011
5046
  CANONICAL_HOOK_BLOCK_PREFIXES = [".git/", ".husky/", ".vinaya/hooks/", ".claude/hooks/"];
5012
5047
  VINAYA_CHECK_ENTRY_FIELDS = {
5013
- principalOwed: z4.literal(true).optional()
5048
+ principalOwed: z3.literal(true).optional()
5014
5049
  };
5015
- RoleEntrySchema = z4.object({
5016
- contract: z4.string().refine((p) => p.includes("/"), {
5050
+ RoleEntrySchema = z3.object({
5051
+ contract: z3.string().refine((p) => p.includes("/"), {
5017
5052
  message: 'must be a path (contain at least one "/"), not a bare filename'
5018
5053
  })
5019
5054
  });
@@ -5036,102 +5071,104 @@ var init_vinaya_config_section = __esm(() => {
5036
5071
  "briefSections",
5037
5072
  "milestoneShape"
5038
5073
  ];
5039
- BriefSectionSchema = z4.union([
5040
- z4.object({ builtin: z4.enum(BRIEF_BUILTINS) }),
5041
- z4.object({ heading: z4.string().min(1), name: z4.string().optional() }),
5042
- z4.object({ field: z4.string().min(1), name: z4.string().optional() }),
5043
- z4.object({ phrase: z4.string().min(1), name: z4.string().optional() })
5074
+ BriefSectionSchema = z3.union([
5075
+ z3.object({ builtin: z3.enum(BRIEF_BUILTINS) }),
5076
+ z3.object({ heading: z3.string().min(1), name: z3.string().optional() }),
5077
+ z3.object({ field: z3.string().min(1), name: z3.string().optional() }),
5078
+ z3.object({ phrase: z3.string().min(1), name: z3.string().optional() })
5044
5079
  ]);
5045
- BriefSchemaSchema = z4.object({
5046
- pr: z4.object({ sections: z4.array(BriefSectionSchema) }).optional(),
5047
- issue: z4.object({ sections: z4.array(BriefSectionSchema) }).optional(),
5048
- milestone: z4.object({ sections: z4.array(BriefSectionSchema) }).optional(),
5049
- ack: z4.array(z4.enum(BRIEF_BUILTINS)).optional()
5080
+ BriefSchemaSchema = z3.object({
5081
+ pr: z3.object({ sections: z3.array(BriefSectionSchema) }).optional(),
5082
+ issue: z3.object({ sections: z3.array(BriefSectionSchema) }).optional(),
5083
+ milestone: z3.object({ sections: z3.array(BriefSectionSchema) }).optional(),
5084
+ ack: z3.array(z3.enum(BRIEF_BUILTINS)).optional()
5050
5085
  });
5051
- ProjectEntrySchema = z4.object({
5052
- name: z4.string().min(1),
5053
- description: z4.string().min(1).optional(),
5054
- path: z4.string().min(1).optional()
5086
+ ProjectEntrySchema = z3.object({
5087
+ name: z3.string().min(1),
5088
+ description: z3.string().min(1).optional(),
5089
+ path: z3.string().min(1).optional()
5055
5090
  });
5056
5091
  VINAYA_CONFIG_FRAGMENT = {
5057
- roles: z4.record(z4.string(), RoleEntrySchema).optional(),
5092
+ roles: z3.record(z3.string(), RoleEntrySchema).optional(),
5058
5093
  briefSchema: BriefSchemaSchema.optional(),
5059
- principals: z4.array(z4.string()).min(1).optional(),
5060
- releaseActor: z4.string().min(1).optional(),
5061
- tokens: z4.object({
5062
- collect: z4.string().min(1).refine((v) => parseTokensCollectDeclaration(v) !== null, {
5094
+ principals: z3.array(z3.string()).min(1).optional(),
5095
+ releaseActor: z3.string().min(1).optional(),
5096
+ tokens: z3.object({
5097
+ collect: z3.string().min(1).refine((v) => parseTokensCollectDeclaration(v) !== null, {
5063
5098
  message: 'tokens.collect must be exactly "<interpreter> <repo-relative-script-path>" — two whitespace-separated tokens, no flags, no shell syntax, no quoting'
5064
5099
  })
5065
5100
  }).optional(),
5066
- blastRadius: z4.object({ extraDomains: z4.array(z4.string()).optional() }).optional(),
5067
- proseGates: z4.object({
5068
- doctrineRoot: z4.string().min(1).optional(),
5069
- readerFacingPrefix: z4.string().min(1).optional(),
5070
- readerFacingSuffix: z4.string().min(1).optional(),
5071
- legacySlugDir: z4.string().min(1).optional(),
5072
- sourceComments: z4.object({
5073
- globs: z4.array(z4.string().min(1)).optional(),
5074
- allowlist: z4.array(z4.string().min(1)).optional(),
5075
- severity: z4.enum(["warning", "error"]).optional()
5101
+ blastRadius: z3.object({ extraDomains: z3.array(z3.string()).optional() }).optional(),
5102
+ proseGates: z3.object({
5103
+ doctrineRoot: z3.string().min(1).optional(),
5104
+ readerFacingPrefix: z3.string().min(1).optional(),
5105
+ readerFacingSuffix: z3.string().min(1).optional(),
5106
+ legacySlugDir: z3.string().min(1).optional(),
5107
+ sourceComments: z3.object({
5108
+ globs: z3.array(z3.string().min(1)).optional(),
5109
+ allowlist: z3.array(z3.string().min(1)).optional(),
5110
+ severity: z3.enum(["warning", "error"]).optional()
5076
5111
  }).optional(),
5077
- specGrandfather: z4.union([z4.array(z4.string().min(1)), z4.record(z4.string().min(1), z4.number().int().min(0))]).optional(),
5078
- specPaths: z4.array(RepoRelativePathSchema).optional(),
5079
- productPaths: z4.array(RepoRelativePathSchema).optional(),
5112
+ specGrandfather: z3.union([z3.array(z3.string().min(1)), z3.record(z3.string().min(1), z3.number().int().min(0))]).optional(),
5113
+ specPaths: z3.array(RepoRelativePathSchema).optional(),
5114
+ productPaths: z3.array(RepoRelativePathSchema).optional(),
5080
5115
  published: PublishedProseSchema.optional(),
5081
5116
  rules: ProseRulesSchema.optional()
5082
5117
  }).optional(),
5083
- projects: z4.array(ProjectEntrySchema).optional(),
5084
- dispatch: z4.object({
5085
- timeoutMs: z4.number().int().positive().optional(),
5086
- reviewerTimeoutMs: z4.number().int().positive().optional(),
5087
- killGraceMs: z4.number().int().positive().optional(),
5088
- agent: z4.enum(["claude", "codex"]).optional()
5118
+ projects: z3.array(ProjectEntrySchema).optional(),
5119
+ dispatch: z3.object({
5120
+ timeoutMs: z3.number().int().positive().optional(),
5121
+ reviewerTimeoutMs: z3.number().int().positive().optional(),
5122
+ killGraceMs: z3.number().int().positive().optional(),
5123
+ agent: z3.enum(["claude", "codex"]).optional()
5089
5124
  }).optional(),
5090
- reviewPolicy: z4.object({
5091
- codeReviewThreshold: z4.string().min(1).optional(),
5092
- securityThreshold: z4.string().min(1).optional(),
5093
- maxRounds: z4.number().optional(),
5094
- maxTaskMinutes: z4.number().optional(),
5095
- readyPushTimeoutMinutes: z4.number().optional()
5125
+ reviewPolicy: z3.object({
5126
+ codeReviewThreshold: z3.string().min(1).optional(),
5127
+ securityThreshold: z3.string().min(1).optional(),
5128
+ maxRounds: z3.number().optional(),
5129
+ maxTaskMinutes: z3.number().optional(),
5130
+ readyPushTimeoutMinutes: z3.number().optional()
5096
5131
  }).optional(),
5097
- securityScan: z4.object({
5098
- command: z4.array(z4.string().min(1)).min(1)
5132
+ securityScan: z3.object({
5133
+ command: z3.array(z3.string().min(1)).min(1)
5099
5134
  }).optional(),
5100
- gateCutovers: z4.object({
5101
- objectivesSinceIssue: z4.number().int().nonnegative().optional(),
5102
- briefSectionsSinceIssue: z4.number().int().nonnegative().optional(),
5103
- documentationSinceIssue: z4.number().int().nonnegative().optional(),
5104
- briefRulesSincePr: z4.number().int().nonnegative().optional(),
5105
- agentBoxesRefusedSincePr: z4.number().int().nonnegative().optional()
5135
+ gateCutovers: z3.object({
5136
+ objectivesSinceIssue: z3.number().int().nonnegative().optional(),
5137
+ briefSectionsSinceIssue: z3.number().int().nonnegative().optional(),
5138
+ documentationSinceIssue: z3.number().int().nonnegative().optional(),
5139
+ briefRulesSincePr: z3.number().int().nonnegative().optional(),
5140
+ agentBoxesRefusedSincePr: z3.number().int().nonnegative().optional()
5106
5141
  }).optional(),
5107
- planning: z4.object({
5108
- collisionThreshold: z4.number().int().nonnegative().optional()
5142
+ planning: z3.object({
5143
+ collisionThreshold: z3.number().int().nonnegative().optional(),
5144
+ reviewRoundLimit: z3.number().int().positive().optional(),
5145
+ reviewAgent: z3.enum(["same", "different"]).optional()
5109
5146
  }).optional(),
5110
- prePush: z4.object({
5111
- alwaysRun: z4.array(z4.string()).optional(),
5112
- readyTests: z4.object({
5113
- mode: z4.literal("ci"),
5114
- workflow: z4.literal(".github/workflows/ci.yml"),
5115
- check: z4.literal("Vinaya CI")
5147
+ prePush: z3.object({
5148
+ alwaysRun: z3.array(z3.string()).optional(),
5149
+ readyTests: z3.object({
5150
+ mode: z3.literal("ci"),
5151
+ workflow: z3.literal(".github/workflows/ci.yml"),
5152
+ check: z3.literal("Vinaya CI")
5116
5153
  }).strict().optional(),
5117
- requiredCi: z4.object({
5118
- workflow: z4.literal(".github/workflows/ci.yml"),
5119
- check: z4.literal("Vinaya CI")
5154
+ requiredCi: z3.object({
5155
+ workflow: z3.literal(".github/workflows/ci.yml"),
5156
+ check: z3.literal("Vinaya CI")
5120
5157
  }).strict().optional()
5121
5158
  }).optional(),
5122
- report: z4.object({
5123
- commandTimeoutMs: z4.number().int().positive().optional()
5159
+ report: z3.object({
5160
+ commandTimeoutMs: z3.number().int().positive().optional()
5124
5161
  }).superRefine((report, ctx) => {
5125
5162
  const commandTimeoutMs = report.commandTimeoutMs;
5126
5163
  if (commandTimeoutMs !== undefined && commandTimeoutMs > MAX_REPORT_COMMAND_TIMEOUT_MS) {
5127
5164
  ctx.addIssue({
5128
- code: z4.ZodIssueCode.custom,
5165
+ code: z3.ZodIssueCode.custom,
5129
5166
  path: ["commandTimeoutMs"],
5130
5167
  message: "must be at most 3600000 (1 hour)"
5131
5168
  });
5132
5169
  }
5133
5170
  }).optional(),
5134
- decisionRecords: z4.object({
5171
+ decisionRecords: z3.object({
5135
5172
  path: RepoRelativePathSchema
5136
5173
  }).strict().optional()
5137
5174
  };
@@ -5140,10 +5177,11 @@ var init_vinaya_config_section = __esm(() => {
5140
5177
  "reviewPolicy.maxTaskMinutes",
5141
5178
  "reviewPolicy.readyPushTimeoutMinutes"
5142
5179
  ];
5180
+ REVIEW_AGENT_SETTINGS = ["same", "different"];
5143
5181
  PrincipalsUnresolvedError = class PrincipalsUnresolvedError extends Error {
5144
5182
  kind;
5145
- constructor(kind, message) {
5146
- super(message);
5183
+ constructor(kind, message, options) {
5184
+ super(message, options);
5147
5185
  this.name = "PrincipalsUnresolvedError";
5148
5186
  this.kind = kind;
5149
5187
  }
@@ -5187,7 +5225,7 @@ var init_vinaya_config_section = __esm(() => {
5187
5225
  });
5188
5226
 
5189
5227
  // ../../harness/processes/vinaya-strict/integration/config/compose.ts
5190
- import { z as z5 } from "zod";
5228
+ import { z as z4 } from "zod";
5191
5229
  function globalChecksIgnoredWarning(path) {
5192
5230
  return `${path}: "checks" registration in the global config is ignored — checks may only be registered from a repo-local vinaya.config.json.`;
5193
5231
  }
@@ -5259,7 +5297,7 @@ var init_compose = __esm(() => {
5259
5297
  "logs",
5260
5298
  "decisionRecords"
5261
5299
  ];
5262
- VinayaConfigObjectSchema = z5.object(orderedShape(CONFIG_KEY_ORDER, KERNEL_FRAGMENT, VINAYA_CONFIG_SECTION.fragment));
5300
+ VinayaConfigObjectSchema = z4.object(orderedShape(CONFIG_KEY_ORDER, KERNEL_FRAGMENT, VINAYA_CONFIG_SECTION.fragment));
5263
5301
  VinayaConfigSchema = VinayaConfigObjectSchema.superRefine((config, ctx) => {
5264
5302
  for (const refine of KERNEL_CONFIG_REFINEMENTS)
5265
5303
  refine(config, ctx);
@@ -5310,7 +5348,7 @@ var init_compose = __esm(() => {
5310
5348
  vinayaConfigProvider = {
5311
5349
  homeDir: VINAYA_HOME,
5312
5350
  loadConfig: () => loadConfig(),
5313
- loadTrustAnchorConfig: () => loadTrustAnchorConfig(),
5351
+ loadTrustAnchorConfig: (options) => loadTrustAnchorConfig(undefined, options),
5314
5352
  loadTrustAnchorConfigAsync: (fetcher, options) => loadTrustAnchorConfigAsync(fetcher, options)
5315
5353
  };
5316
5354
  installVinayaConfigProvider();