@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/legacy-markers.ts
52
55
  function commentMarkerFamily(name) {
@@ -55,7 +58,7 @@ function commentMarkerFamily(name) {
55
58
  function anchorAlternation(spellings) {
56
59
  return `(?:${spellings.map((spelling) => spelling.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|")})`;
57
60
  }
58
- 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;
61
+ 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;
59
62
  var init_legacy_markers = __esm(() => {
60
63
  REGION_PREFIX = { old: "AEG", current: "VINAYA" };
61
64
  PROVENANCE_HEADING = {
@@ -77,6 +80,7 @@ var init_legacy_markers = __esm(() => {
77
80
  LOOP_UNPUSHED_WORK_RESUME_MARKER = commentMarkerFamily("loop:unpushed-work-resume");
78
81
  PRINCIPAL_RULING_MARKER = commentMarkerFamily("principal:ruling");
79
82
  OBJECTIVES_VERSION_MARKER = commentMarkerFamily("objectives");
83
+ DOCUMENTATION_EDIT_MARKER = commentMarkerFamily("documentation");
80
84
  DEFERRED_FINDINGS_MARKER = commentMarkerFamily("deferred-findings");
81
85
  COMMENT_MARKER_PREFIX_CURRENT = COMMENT_MARKER_PREFIX.current;
82
86
  COMMENT_MARKER_PREFIXES = [COMMENT_MARKER_PREFIX.current, COMMENT_MARKER_PREFIX.old];
@@ -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/task-contract/forge/parse-rationale-deps.ts
52
55
  function splitSlugQualifiedEdge(edge) {
@@ -392,6 +395,23 @@ async function ghApiGetAllPagesAsync(pathWithoutPage, opts) {
392
395
  }
393
396
  throw new Error(`ghApiGetAllPagesAsync: "${pathWithoutPage}" did not terminate within ${MAX_PAGES} pages (${MAX_PAGES * MAX_PER_PAGE} items) — refusing to keep walking.`);
394
397
  }
398
+ async function ghLabelIssueCountsAsync(owner, repo, labelQuery) {
399
+ const stdout = await runAsync([
400
+ "api",
401
+ "graphql",
402
+ "--paginate",
403
+ "-f",
404
+ `query=${LABEL_ISSUE_COUNTS_QUERY.replace("$labelQuery", JSON.stringify(labelQuery))}`,
405
+ "-f",
406
+ `owner=${owner}`,
407
+ "-f",
408
+ `name=${repo}`,
409
+ "--jq",
410
+ ".data.repository.labels.nodes[] | {name, open: .open.totalCount, total: .all.totalCount}"
411
+ ]);
412
+ return stdout.split(`
413
+ `).filter((line) => line.trim() !== "").map((line) => JSON.parse(line));
414
+ }
395
415
  function issueListByLabelArgs(owner, repo, label) {
396
416
  return [
397
417
  "issue",
@@ -425,7 +445,14 @@ async function ghIssueListByAnyLabelAsync(owner, repo, labels) {
425
445
  const perLabel = await Promise.all(labels.map((l) => ghIssueListByLabelAsync(owner, repo, l)));
426
446
  return dedupeByNumber(perLabel.flat());
427
447
  }
428
- var execFileAsync, systemEnv, MAX_PER_PAGE = 100, MAX_PAGES = 100;
448
+ var execFileAsync, systemEnv, MAX_PER_PAGE = 100, MAX_PAGES = 100, LABEL_ISSUE_COUNTS_QUERY = `query($owner: String!, $name: String!, $endCursor: String) {
449
+ repository(owner: $owner, name: $name) {
450
+ labels(first: 100, after: $endCursor, query: $labelQuery) {
451
+ pageInfo { hasNextPage endCursor }
452
+ nodes { name open: issues(states: OPEN) { totalCount } all: issues { totalCount } }
453
+ }
454
+ }
455
+ }`;
429
456
  var init_gh = __esm(() => {
430
457
  execFileAsync = promisify(execFile);
431
458
  systemEnv = {
@@ -766,7 +793,7 @@ function commentMarkerFamily(name) {
766
793
  function anchorAlternation(spellings) {
767
794
  return `(?:${spellings.map((spelling) => spelling.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|")})`;
768
795
  }
769
- 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;
796
+ 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;
770
797
  var init_legacy_markers = __esm(() => {
771
798
  REGION_PREFIX = { old: "AEG", current: "VINAYA" };
772
799
  PROVENANCE_HEADING = {
@@ -788,6 +815,7 @@ var init_legacy_markers = __esm(() => {
788
815
  LOOP_UNPUSHED_WORK_RESUME_MARKER = commentMarkerFamily("loop:unpushed-work-resume");
789
816
  PRINCIPAL_RULING_MARKER = commentMarkerFamily("principal:ruling");
790
817
  OBJECTIVES_VERSION_MARKER = commentMarkerFamily("objectives");
818
+ DOCUMENTATION_EDIT_MARKER = commentMarkerFamily("documentation");
791
819
  DEFERRED_FINDINGS_MARKER = commentMarkerFamily("deferred-findings");
792
820
  COMMENT_MARKER_PREFIX_CURRENT = COMMENT_MARKER_PREFIX.current;
793
821
  COMMENT_MARKER_PREFIXES = [COMMENT_MARKER_PREFIX.current, COMMENT_MARKER_PREFIX.old];
@@ -1598,6 +1626,7 @@ var init_doctrine_map = __esm(() => {
1598
1626
  { key: "roles/developer.md", source: "executing/developer/doctrine.md", role: "developer", ships: true },
1599
1627
  { key: "roles/developer/reference.md", source: "executing/developer/reference.md", ships: true },
1600
1628
  { key: "roles/operator.md", source: "executing/operator/doctrine.md", role: "operator", ships: true },
1629
+ { key: "roles/plan-reviewer.md", source: "thinking/plan-reviewer/doctrine.md", role: "plan-reviewer", ships: true },
1601
1630
  { key: "roles/planner.md", source: "thinking/planner/doctrine.md", role: "planner", ships: true },
1602
1631
  { key: "roles/planner/reference.md", source: "thinking/planner/reference.md", ships: true },
1603
1632
  { key: "roles/principal.md", source: "doctrine/roles/principal.md", role: "principal", ships: true },
@@ -2720,7 +2749,13 @@ function isMechanicallyNeutralDiff(diffText, path) {
2720
2749
  }
2721
2750
  return sawChange;
2722
2751
  }
2723
- function evaluateC5(changed, docOwnersContent, prBody, fileExists, waiverActive, getDiff) {
2752
+ function prBodyGiven(env = process.env) {
2753
+ return env.PR_BODY !== undefined || env.PR_BODY_FILE !== undefined;
2754
+ }
2755
+ function owedNeutralNotes(result) {
2756
+ return result.notes.filter((n) => n.startsWith(DOC_NEUTRAL_OWED_PREFIX));
2757
+ }
2758
+ function evaluateC5(changed, docOwnersContent, prBody, fileExists, waiverActive, getDiff, bodyGiven = true) {
2724
2759
  const out = { errors: [], notes: [] };
2725
2760
  if (docOwnersContent === null)
2726
2761
  return out;
@@ -2760,24 +2795,28 @@ function evaluateC5(changed, docOwnersContent, prBody, fileExists, waiverActive,
2760
2795
  }
2761
2796
  if (changed.includes(pointerPath))
2762
2797
  continue;
2798
+ const evidenced = () => getDiff !== undefined && matchedFiles.every((f) => {
2799
+ const diff = getDiff(f);
2800
+ return diff !== null && isMechanicallyNeutralDiff(diff, f);
2801
+ });
2763
2802
  const declared = neutrals.find((n) => n.surface === b.pointer);
2764
2803
  if (declared) {
2765
- const evidenced = getDiff !== undefined && matchedFiles.every((f) => {
2766
- const diff = getDiff(f);
2767
- return diff !== null && isMechanicallyNeutralDiff(diff, f);
2768
- });
2769
- if (evidenced) {
2804
+ if (evidenced()) {
2770
2805
  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.`);
2771
2806
  continue;
2772
2807
  }
2773
2808
  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.`);
2774
2809
  continue;
2775
2810
  }
2811
+ if (!bodyGiven && evidenced()) {
2812
+ 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>\`.`);
2813
+ continue;
2814
+ }
2776
2815
  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.`);
2777
2816
  }
2778
2817
  return out;
2779
2818
  }
2780
- var DOC_OWNERS_PATH = ".vinaya/doc-owners", SEPARATOR, LANGUAGE_COMMENT_PREFIXES;
2819
+ var DOC_OWNERS_PATH = ".vinaya/doc-owners", SEPARATOR, LANGUAGE_COMMENT_PREFIXES, DOC_NEUTRAL_OWED_PREFIX = "C5 doc-neutral-owed:";
2781
2820
  var init_doc_owners = __esm(() => {
2782
2821
  init_file_classify();
2783
2822
  init_waiver_label();
@@ -2832,6 +2871,20 @@ var init_protected_paths = __esm(() => {
2832
2871
  ];
2833
2872
  });
2834
2873
 
2874
+ // ../../harness/processes/vinaya-strict/tools/task-contract/test-plan-proof.ts
2875
+ function stripObjectiveIdSpans(text) {
2876
+ return text.replace(ITEM_IDS_SPAN_RE, "").trim();
2877
+ }
2878
+ var ID_LIST, LINE_IDS_RE, ITEM_IDS_SPAN_RE;
2879
+ var init_test_plan_proof = __esm(() => {
2880
+ init_brief_validation();
2881
+ init_objectives();
2882
+ init_test_plan_section();
2883
+ ID_LIST = String.raw`O\d+(?:\s*,\s*O\d+)*`;
2884
+ LINE_IDS_RE = new RegExp(String.raw`\(\s*(${ID_LIST})\s*\)\s*$`);
2885
+ ITEM_IDS_SPAN_RE = new RegExp(String.raw`(?<!\`)(\`+)\s*\(?\s*(${ID_LIST})\s*\)?\s*\1(?!\`)`, "g");
2886
+ });
2887
+
2835
2888
  // ../../harness/processes/vinaya-strict/tools/task-contract/issue-validation.ts
2836
2889
  function hasRationaleField(body, labelPattern) {
2837
2890
  const re = new RegExp(`(?:\\*\\*|^#{1,4}\\s+)\\s*(?:${labelPattern})`, "im");
@@ -3030,7 +3083,7 @@ function checkPartsCiteDefinedObjectives(body) {
3030
3083
  return { status: errors.length > 0 ? "fail" : "pass", errors };
3031
3084
  }
3032
3085
  function liveCommand(text) {
3033
- const trimmed = text.trim();
3086
+ const trimmed = stripObjectiveIdSpans(text);
3034
3087
  const span = /^(`+)(.+)\1$/.exec(trimmed);
3035
3088
  return span ? span[2].trim() : trimmed;
3036
3089
  }
@@ -3165,11 +3218,13 @@ var init_issue_validation = __esm(() => {
3165
3218
  init_derive_section7();
3166
3219
  init_doctrine_map();
3167
3220
  init_objectives();
3221
+ init_waiver_label();
3168
3222
  init_issue_documentation();
3169
3223
  init_touched_path();
3170
3224
  init_protected_paths();
3171
3225
  init_quoted_command();
3172
3226
  init_test_plan_section();
3227
+ init_test_plan_proof();
3173
3228
  RATIONALE_FIELDS = [
3174
3229
  { name: "Boundary", pattern: "Boundary" },
3175
3230
  { name: "Sizing", pattern: "Sizing" },
@@ -3298,6 +3353,19 @@ function lifecycleFromIssues(issues) {
3298
3353
  return "planned";
3299
3354
  return issues.some((i) => i.state === "OPEN") ? "active" : "complete";
3300
3355
  }
3356
+ function lifecycleFromCounts(open, total) {
3357
+ if (total === 0)
3358
+ return "planned";
3359
+ return open > 0 ? "active" : "complete";
3360
+ }
3361
+ function resolveLegacyFactsFromCounts(milestone, open, total) {
3362
+ if (milestone.state === "closed" && total > 0) {
3363
+ return { goal: milestone.description ?? "", lifecycle: lifecycleFromCounts(open, total) };
3364
+ }
3365
+ return factsFromLegacyMilestone(milestone);
3366
+ }
3367
+ var TRANCHE_LABEL_QUERY = "vinaya/tranche:";
3368
+ var ACTIVE_ISSUE_READ_CONCURRENCY = 4;
3301
3369
  function goalFromMilestones(milestones, slug) {
3302
3370
  for (const m of milestones) {
3303
3371
  const goal = intentGoalForSlug(m.description ?? "", slug);
@@ -3325,10 +3393,20 @@ function trancheSlugsFromLabels(labels) {
3325
3393
  }
3326
3394
  async function indexTrancheMilestonesAsync(owner, repo, options = {}) {
3327
3395
  const read = (fetch) => options.retryFailedReads ? retryOnce(fetch) : fetch();
3328
- const [milestones, labels] = await Promise.all([
3396
+ const [milestones, labels, counts] = await Promise.all([
3329
3397
  read(() => ghApiGetAllPagesAsync(`repos/${owner}/${repo}/milestones?state=all&per_page=100`)),
3330
- read(() => ghApiGetAllPagesAsync(`repos/${owner}/${repo}/labels?per_page=100`))
3398
+ read(() => ghApiGetAllPagesAsync(`repos/${owner}/${repo}/labels?per_page=100`)),
3399
+ read(() => ghLabelIssueCountsAsync(owner, repo, TRANCHE_LABEL_QUERY))
3331
3400
  ]);
3401
+ const countsByLabel = new Map(counts.map((c) => [c.name, c]));
3402
+ const uncounted = trancheSlugsFromLabels(labels).map((slug) => trancheLabel(slug)).filter((label) => !countsByLabel.has(label));
3403
+ if (uncounted.length > 0) {
3404
+ throw new Error(`the label Issue-count query returned no count for ${uncounted.join(", ")}`);
3405
+ }
3406
+ const lifecycleOf = (slug) => {
3407
+ const c = countsByLabel.get(trancheLabel(slug));
3408
+ return lifecycleFromCounts(c?.open ?? 0, c?.total ?? 0);
3409
+ };
3332
3410
  const active = [];
3333
3411
  const archived = [];
3334
3412
  const facts = new Map;
@@ -3336,33 +3414,21 @@ async function indexTrancheMilestonesAsync(owner, repo, options = {}) {
3336
3414
  const legacyMilestoneBySlug = new Map(milestones.filter((m) => legacySlugs.has(m.title)).map((m) => [m.title, m]));
3337
3415
  const newPathSlugs = trancheSlugsFromLabels(labels).filter((slug) => !legacySlugs.has(slug));
3338
3416
  const uniqueNewPathSlugs = [...new Set(newPathSlugs)];
3339
- const uniqueLegacySlugs = [...legacySlugs];
3340
- const [legacyIssuesBySlug, newPathIssuesBySlug] = await Promise.all([
3341
- Promise.all(uniqueLegacySlugs.map((slug) => read(() => ghIssueListByLabelAsync(owner, repo, trancheLabel(slug))))),
3342
- Promise.all(uniqueNewPathSlugs.map((slug) => read(() => ghIssueListByLabelAsync(owner, repo, trancheLabel(slug)))))
3343
- ]);
3344
- const issuesBySlug = new Map;
3345
- uniqueLegacySlugs.forEach((slug, i) => {
3346
- issuesBySlug.set(slug, legacyIssuesBySlug[i] ?? []);
3347
- });
3348
- uniqueNewPathSlugs.forEach((slug, i) => {
3349
- issuesBySlug.set(slug, newPathIssuesBySlug[i] ?? []);
3350
- });
3351
- uniqueLegacySlugs.forEach((slug, i) => {
3417
+ for (const slug of legacySlugs) {
3352
3418
  const m = legacyMilestoneBySlug.get(slug);
3353
3419
  if (!m)
3354
- return;
3420
+ continue;
3355
3421
  const ref = { slug, goal: m.description ?? "" };
3356
- const f = resolveLegacyFacts(m, legacyIssuesBySlug[i] ?? []);
3422
+ const c = countsByLabel.get(trancheLabel(slug));
3423
+ const f = resolveLegacyFactsFromCounts(m, c?.open ?? 0, c?.total ?? 0);
3357
3424
  if (f.lifecycle === "complete")
3358
3425
  archived.push(ref);
3359
3426
  else if (f.lifecycle === "active")
3360
3427
  active.push(ref);
3361
3428
  facts.set(slug, f);
3362
- });
3363
- uniqueNewPathSlugs.forEach((slug, i) => {
3364
- const issues = newPathIssuesBySlug[i] ?? [];
3365
- const lifecycle = lifecycleFromIssues(issues);
3429
+ }
3430
+ for (const slug of uniqueNewPathSlugs) {
3431
+ const lifecycle = lifecycleOf(slug);
3366
3432
  const goal = goalFromMilestones(milestones, slug);
3367
3433
  const f = { goal, lifecycle };
3368
3434
  facts.set(slug, f);
@@ -3370,7 +3436,16 @@ async function indexTrancheMilestonesAsync(owner, repo, options = {}) {
3370
3436
  active.push({ slug, goal });
3371
3437
  else if (lifecycle === "complete")
3372
3438
  archived.push({ slug, goal });
3373
- });
3439
+ }
3440
+ const issuesBySlug = new Map;
3441
+ const activeSlugs = active.map((r) => r.slug);
3442
+ for (let i = 0;i < activeSlugs.length; i += ACTIVE_ISSUE_READ_CONCURRENCY) {
3443
+ const batch = activeSlugs.slice(i, i + ACTIVE_ISSUE_READ_CONCURRENCY);
3444
+ const lists = await Promise.all(batch.map((slug) => read(() => ghIssueListByLabelAsync(owner, repo, trancheLabel(slug)))));
3445
+ batch.forEach((slug, j) => {
3446
+ issuesBySlug.set(slug, lists[j] ?? []);
3447
+ });
3448
+ }
3374
3449
  return { active, archived, facts, legacySlugs, issuesBySlug };
3375
3450
  }
3376
3451
  async function retryOnce(fetch) {