@attalabs/vinaya 0.37.0 → 0.38.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 (174) hide show
  1. package/aeg-root/enforcement.md +5 -4
  2. package/aeg-root/roles/developer/reference.md +24 -22
  3. package/aeg-root/roles/developer.md +4 -4
  4. package/aeg-root/roles/planner/reference.md +11 -0
  5. package/aeg-root/roles/reviewer.md +5 -3
  6. package/aeg-root/roles/security.md +3 -2
  7. package/aeg-root/state-machine.md +1 -1
  8. package/aeg-root/templates/brief-template.md +4 -4
  9. package/aeg-root/tranche-model.md +6 -0
  10. package/dist/checks/bin/check-body-bare-digits.js +139 -12
  11. package/dist/checks/bin/check-branch-topology.js +171 -13
  12. package/dist/checks/bin/check-brief-shape.js +139 -12
  13. package/dist/checks/bin/check-changeset-coverage.js +177 -17
  14. package/dist/checks/bin/check-closes-n.js +171 -13
  15. package/dist/checks/bin/check-coherence.js +171 -13
  16. package/dist/checks/bin/check-dead-branch-push.js +139 -12
  17. package/dist/checks/bin/check-dispatch-readiness.js +195 -23
  18. package/dist/checks/bin/check-doc-coverage-push.js +173 -13
  19. package/dist/checks/bin/check-doc-coverage.js +180 -13
  20. package/dist/checks/bin/check-doctrine-no-procedures.js +139 -12
  21. package/dist/checks/bin/check-doctrine-portability.js +173 -13
  22. package/dist/checks/bin/check-evidence-fresh.js +173 -13
  23. package/dist/checks/bin/check-exec-bits.js +173 -13
  24. package/dist/checks/bin/check-first-push-dispatch.js +171 -13
  25. package/dist/checks/bin/check-issue-assignment.js +171 -13
  26. package/dist/checks/bin/check-issue-milestone-attach.js +139 -12
  27. package/dist/checks/bin/check-issue-objectives-numbering.js +139 -12
  28. package/dist/checks/bin/check-issue-parts-coverage.js +139 -12
  29. package/dist/checks/bin/check-issue-surface-globs.js +171 -13
  30. package/dist/checks/bin/check-issue-title-grammar.js +139 -12
  31. package/dist/checks/bin/check-issue-tranche-label.js +139 -12
  32. package/dist/checks/bin/check-main-branch-refusal.js +139 -12
  33. package/dist/checks/bin/check-no-disk-state.js +139 -12
  34. package/dist/checks/bin/check-pr-premise-reassert.js +139 -12
  35. package/dist/checks/bin/check-pr-report-density.js +139 -12
  36. package/dist/checks/bin/check-principal-test-plan-wait.js +139 -12
  37. package/dist/checks/bin/check-quoted-command.js +173 -13
  38. package/dist/checks/bin/check-reader-resolvable-prose.js +173 -13
  39. package/dist/checks/bin/check-registry-gates.js +406 -68
  40. package/dist/checks/bin/check-retired-vocabulary.js +173 -13
  41. package/dist/checks/bin/check-review-gate.js +139 -12
  42. package/dist/checks/bin/check-single-plan-pr.js +139 -12
  43. package/dist/checks/bin/check-surface-scope.js +171 -13
  44. package/dist/checks/bin/check-test-plan.js +139 -12
  45. package/dist/checks/bin/check-token-collection-wired.js +139 -12
  46. package/dist/checks/bin/check-workspace-escape.js +173 -13
  47. package/dist/checks/bin/verify-dispatch.js +3849 -0
  48. package/dist/index.js +7348 -2095
  49. package/dist/lib/pre-push-cache-test-run.js +42 -2
  50. package/dist/lib/pre-push-changed-files.js +16 -11
  51. package/dist/lib/pre-push-select-tests.js +177 -21
  52. package/package.json +1 -1
  53. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/anchored-region.ts +7 -6
  54. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/brief-render.ts +33 -15
  55. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/brief-validation.ts +51 -12
  56. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/index.ts +1 -0
  57. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/local.ts +31 -0
  58. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/records.ts +31 -2
  59. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/assess-round.ts +214 -24
  60. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/fakes.ts +11 -3
  61. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/index.ts +5 -4
  62. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/journal-reconstruction.ts +13 -13
  63. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/render-summary.ts +46 -145
  64. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/types.ts +63 -14
  65. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/docs/index.ts +3 -1
  66. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/docs/published-prose.ts +30 -0
  67. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/doctrine-portability.ts +6 -2
  68. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/gate-audience.ts +0 -1
  69. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/index.ts +56 -7
  70. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/issue-validation.ts +7 -7
  71. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/leftover-detection.ts +24 -6
  72. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/custom.ts +157 -0
  73. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/envelope.ts +44 -6
  74. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/fixtures/executions.ts +493 -0
  75. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/fixtures/fact-sheets.ts +111 -0
  76. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/fixtures/generator.ts +155 -0
  77. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/fixtures/index.ts +12 -0
  78. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/index.ts +128 -0
  79. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/catches.ts +63 -0
  80. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/checks.ts +146 -0
  81. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/common.ts +137 -0
  82. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/completion.ts +137 -0
  83. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/convergence.ts +420 -0
  84. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/determinism.ts +65 -0
  85. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/index.ts +69 -0
  86. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/judgment.ts +132 -0
  87. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/labels.ts +21 -0
  88. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/time.ts +167 -0
  89. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/questions/usage.ts +139 -0
  90. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/schema.ts +219 -15
  91. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/store.ts +7 -7
  92. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/cache-contract.ts +207 -0
  93. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/contracts.ts +105 -0
  94. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/engine.ts +308 -0
  95. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/index.ts +34 -0
  96. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/measured.ts +20 -0
  97. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/memory-cache.ts +78 -0
  98. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/normalize.ts +156 -0
  99. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/sync/row.ts +103 -0
  100. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/reader-resolvable-prose.ts +34 -6
  101. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/registry-checks.ts +70 -6
  102. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-input-manifest.ts +19 -14
  103. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-policy.ts +38 -3
  104. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-status.ts +5 -2
  105. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/task-phase-history.ts +46 -0
  106. package/studio-standalone/_node_modules/@attalabs/aeg-core/src/task-tools.ts +15 -28
  107. package/studio-standalone/apps/vinaya-studio/web/.next/BUILD_ID +1 -1
  108. package/studio-standalone/apps/vinaya-studio/web/.next/build-manifest.json +3 -3
  109. package/studio-standalone/apps/vinaya-studio/web/.next/prerender-manifest.json +3 -3
  110. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  111. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.html +1 -1
  112. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.rsc +1 -1
  113. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  114. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  115. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  116. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  117. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  118. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page/server-reference-manifest.json +2 -2
  119. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  120. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  121. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page/server-reference-manifest.json +2 -2
  122. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page.js.nft.json +1 -1
  123. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page_client-reference-manifest.js +1 -1
  124. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page/server-reference-manifest.json +2 -2
  125. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page.js.nft.json +1 -1
  126. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page_client-reference-manifest.js +1 -1
  127. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page/server-reference-manifest.json +2 -2
  128. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page.js.nft.json +1 -1
  129. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page_client-reference-manifest.js +1 -1
  130. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page/server-reference-manifest.json +2 -2
  131. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page.js.nft.json +1 -1
  132. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page_client-reference-manifest.js +1 -1
  133. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page/server-reference-manifest.json +3 -3
  134. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page.js.nft.json +1 -1
  135. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page_client-reference-manifest.js +1 -1
  136. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page/server-reference-manifest.json +2 -2
  137. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page.js.nft.json +1 -1
  138. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
  139. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page/server-reference-manifest.json +2 -2
  140. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page.js.nft.json +1 -1
  141. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page_client-reference-manifest.js +1 -1
  142. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page/server-reference-manifest.json +2 -2
  143. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page.js.nft.json +1 -1
  144. package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page_client-reference-manifest.js +1 -1
  145. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/1q96_modules_@clerk_nextjs_dist_esm_app-router_client_keyless-creator-reader_0lom2js.js +1 -1
  146. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__04adkz-._.js +1 -1
  147. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__08e39jo._.js +1 -1
  148. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0h9yhwx._.js +1 -1
  149. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{[root-of-the-server]__14ui9sz._.js → [root-of-the-server]__0jdjsxe._.js} +1 -1
  150. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0ls23oh._.js +1 -1
  151. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1gjqmhq._.js +1 -1
  152. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1wc4-ip._.js +1 -1
  153. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_08onyya._.js +1 -1
  154. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_096f46i._.js +1 -1
  155. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0af2one._.js +1 -1
  156. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0e5tkdd._.js +1 -1
  157. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0kf2g72._.js +1 -1
  158. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0zf4d27._.js +1 -1
  159. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1-wo68i._.js +1 -1
  160. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1achbh9._.js +1 -1
  161. package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/node_modules_@clerk_nextjs_dist_esm_app-router_server-actions_1x7vfhn.js +2 -2
  162. package/studio-standalone/apps/vinaya-studio/web/.next/server/middleware-build-manifest.js +3 -3
  163. package/studio-standalone/apps/vinaya-studio/web/.next/server/pages/500.html +1 -1
  164. package/studio-standalone/apps/vinaya-studio/web/.next/server/server-reference-manifest.js +1 -1
  165. package/studio-standalone/apps/vinaya-studio/web/.next/server/server-reference-manifest.json +4 -4
  166. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/1-acpmtfmrc35.js +1 -0
  167. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{3qtt1v3ya-ofe.js → 2f2y8xxok8zph.js} +1 -1
  168. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{3l56x8wjdzvaw.js → 2xevgia1h8g0y.js} +4 -4
  169. package/studio-standalone/apps/vinaya-studio/web/package.json +2 -2
  170. package/dist/checks/bin/check-token-report.js +0 -6526
  171. package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0vtfb0g813gki.js +0 -1
  172. /package/studio-standalone/apps/vinaya-studio/web/.next/static/{yR5RsCxb1OGnYggiaO09S → yNZEFRSjP9BLUfdf96Eol}/_buildManifest.js +0 -0
  173. /package/studio-standalone/apps/vinaya-studio/web/.next/static/{yR5RsCxb1OGnYggiaO09S → yNZEFRSjP9BLUfdf96Eol}/_clientMiddlewareManifest.js +0 -0
  174. /package/studio-standalone/apps/vinaya-studio/web/.next/static/{yR5RsCxb1OGnYggiaO09S → yNZEFRSjP9BLUfdf96Eol}/_ssgManifest.js +0 -0
@@ -628,6 +628,33 @@ function tasksFromIssues(issues) {
628
628
  }
629
629
  return tasks.sort((a, b) => compareTaskIds(a.id, b.id));
630
630
  }
631
+ function resolveDuplicateTasks(tasks, isOpen) {
632
+ const byId = new Map;
633
+ for (const t of tasks)
634
+ byId.set(t.id, [...byId.get(t.id) ?? [], t]);
635
+ const resolved = [];
636
+ const conflicts = [];
637
+ for (const [id, group] of byId) {
638
+ const first = group[0];
639
+ if (!first)
640
+ continue;
641
+ if (group.length === 1) {
642
+ resolved.push(first);
643
+ continue;
644
+ }
645
+ const number = (t) => t.issue ?? 0;
646
+ const open = group.filter((t) => t.issue !== null && isOpen(t.issue)).sort((a, b) => number(a) - number(b));
647
+ if (open.length > 1) {
648
+ conflicts.push({ id, issues: open.map(number) });
649
+ resolved.push(open[0]);
650
+ } else if (open.length === 1) {
651
+ resolved.push(open[0]);
652
+ } else {
653
+ resolved.push([...group].sort((a, b) => number(b) - number(a))[0]);
654
+ }
655
+ }
656
+ return { tasks: resolved.sort((a, b) => compareTaskIds(a.id, b.id)), conflicts };
657
+ }
631
658
  async function fetchTrancheIssuesAsync(owner, repo, slug) {
632
659
  return ghIssueListByAnyLabelAsync(owner, repo, [trancheLabel(slug)]);
633
660
  }
@@ -1435,7 +1462,7 @@ function mapReviewDecision(decision) {
1435
1462
  function buildBranchName(tranche, taskId) {
1436
1463
  return `task/${tranche}/${taskId}`;
1437
1464
  }
1438
- async function fetchForgeFacts(input) {
1465
+ async function fetchForgeFactsByIssue(input) {
1439
1466
  const token = await resolveGithubToken(input.token);
1440
1467
  if (!token) {
1441
1468
  return {
@@ -1445,7 +1472,13 @@ async function fetchForgeFacts(input) {
1445
1472
  reason: "No GitHub token available (set GITHUB_TOKEN/GH_TOKEN or `gh auth login`)."
1446
1473
  };
1447
1474
  }
1448
- const queriedTasks = input.tasks.filter((t) => t.issue !== null);
1475
+ const seen = new Set;
1476
+ const queriedTasks = input.tasks.filter((t) => {
1477
+ if (t.issue === null || seen.has(t.issue))
1478
+ return false;
1479
+ seen.add(t.issue);
1480
+ return true;
1481
+ });
1449
1482
  if (queriedTasks.length === 0) {
1450
1483
  return { facts: new Map, prRefs: new Map, unavailable: false };
1451
1484
  }
@@ -1473,21 +1506,52 @@ async function fetchForgeFacts(input) {
1473
1506
  };
1474
1507
  }
1475
1508
  for (const task of queriedTasks) {
1476
- const alias = aliasFor(task.id);
1477
- const raw = extractRawFromResponse(response.repository, alias);
1509
+ const raw = extractRawFromResponse(response.repository, aliasFor(task.issue));
1478
1510
  const mapped = mapForgeFacts(raw);
1479
1511
  if (mapped)
1480
- facts.set(task.id, mapped);
1512
+ facts.set(task.issue, mapped);
1481
1513
  const pr = raw.pullRequest;
1482
1514
  if (pr && typeof pr.number === "number" && typeof pr.url === "string") {
1483
- prRefs.set(task.id, { number: pr.number, url: pr.url, state: pr.state });
1515
+ prRefs.set(task.issue, { number: pr.number, url: pr.url, state: pr.state });
1484
1516
  }
1485
1517
  }
1486
1518
  return { facts, prRefs, unavailable: false };
1487
1519
  }
1520
+ async function fetchForgeFacts(input) {
1521
+ const byIssue = await fetchForgeFactsByIssue(input);
1522
+ if (byIssue.unavailable) {
1523
+ return { facts: new Map, prRefs: new Map, unavailable: true, reason: byIssue.reason };
1524
+ }
1525
+ const facts = new Map;
1526
+ const prRefs = new Map;
1527
+ const winner = new Map;
1528
+ for (const task of input.tasks) {
1529
+ if (task.issue === null)
1530
+ continue;
1531
+ const current = winner.get(task.id);
1532
+ if (current === undefined || outranks(byIssue.facts, task.issue, current))
1533
+ winner.set(task.id, task.issue);
1534
+ }
1535
+ for (const [taskId, issue] of winner) {
1536
+ const f = byIssue.facts.get(issue);
1537
+ if (f)
1538
+ facts.set(taskId, f);
1539
+ const pr = byIssue.prRefs.get(issue);
1540
+ if (pr)
1541
+ prRefs.set(taskId, pr);
1542
+ }
1543
+ return { facts, prRefs, unavailable: false };
1544
+ }
1545
+ function outranks(facts, candidate, current) {
1546
+ const candidateOpen = facts.get(candidate)?.issueState === "open";
1547
+ const currentOpen = facts.get(current)?.issueState === "open";
1548
+ if (candidateOpen !== currentOpen)
1549
+ return candidateOpen;
1550
+ return candidate > current;
1551
+ }
1488
1552
  function buildBatchQuery(tranche, tasks) {
1489
1553
  const perTask = tasks.map((task) => {
1490
- const a = aliasFor(task.id);
1554
+ const a = aliasFor(task.issue);
1491
1555
  const branch = buildBranchName(tranche, task.id);
1492
1556
  return `
1493
1557
  ${a}_issue: issue(number: ${task.issue}) {
@@ -1529,9 +1593,8 @@ function buildBatchQuery(tranche, tasks) {
1529
1593
  }
1530
1594
  }`;
1531
1595
  }
1532
- function aliasFor(taskId) {
1533
- const sanitized = taskId.replace(/[^a-zA-Z0-9_]/g, "_");
1534
- return `t_${sanitized}`;
1596
+ function aliasFor(issue) {
1597
+ return `i_${issue}`;
1535
1598
  }
1536
1599
  function extractRawFromResponse(repository, alias) {
1537
1600
  const issue = repository[`${alias}_issue`];
@@ -2362,6 +2425,9 @@ var ROLE_FILE_LOCATION = /(^|\/)aeg-root\/roles\//i;
2362
2425
  function isProseLocation(location) {
2363
2426
  if (ROLE_FILE_LOCATION.test(location))
2364
2427
  return true;
2428
+ return isBodyOrCommentLocation(location);
2429
+ }
2430
+ function isBodyOrCommentLocation(location) {
2365
2431
  if (FILE_SHAPED_LOCATION.test(location))
2366
2432
  return false;
2367
2433
  return PROSE_LOCATION_PATTERNS.some((pattern) => pattern.test(location));
@@ -2388,7 +2454,7 @@ function classifyFinding(finding, scale, threshold, context = {}) {
2388
2454
  const wouldBlock = blockingSeverities(scale, threshold).includes(effectiveSeverity);
2389
2455
  if (!wouldBlock)
2390
2456
  return { outcome: "non_blocking", deferralReason: null };
2391
- const hasLocation = location !== undefined && location.length > 0;
2457
+ const hasLocation = location !== undefined && location.length > 0 && !isBodyOrCommentLocation(location);
2392
2458
  if (hasLocation && context.inSurface && !context.inSurface(location)) {
2393
2459
  return { outcome: "deferred", deferralReason: "outside-surface" };
2394
2460
  }
@@ -4058,6 +4124,8 @@ var FILE_EXTENSIONS = new Set([
4058
4124
  "html",
4059
4125
  "css"
4060
4126
  ]);
4127
+ var CI_SHARD_DIR = "apps/cli/tests/ci-shards";
4128
+ var CI_SHARD_PROBE = `${CI_SHARD_DIR}/shard-1.txt`;
4061
4129
 
4062
4130
  // ../../packages/aeg-core/src/task-branch-identity.ts
4063
4131
  var ISSUE_BRANCH_PATTERN = /^task\/issue-(\d+)$/;
@@ -4935,6 +5003,55 @@ function checkG6(rows, registeredCheckNames) {
4935
5003
  }
4936
5004
  return { check: "G6", status: findings.length > 0 ? "fail" : "pass", findings };
4937
5005
  }
5006
+ function reachesProducer(file, producers, imports) {
5007
+ const seen = new Set([file]);
5008
+ const queue = [file];
5009
+ for (let next = queue.pop();next !== undefined; next = queue.pop()) {
5010
+ if (producers.has(next))
5011
+ return true;
5012
+ for (const dep of imports.get(next) ?? []) {
5013
+ if (!seen.has(dep)) {
5014
+ seen.add(dep);
5015
+ queue.push(dep);
5016
+ }
5017
+ }
5018
+ }
5019
+ return false;
5020
+ }
5021
+ function checkG7(input) {
5022
+ if (!input.enforcementMapPresent)
5023
+ return { check: "G7", status: "info", findings: [] };
5024
+ const subjects = new Set([...input.crossingFiles, ...input.blockingFiles]);
5025
+ const findings = [];
5026
+ for (const path of subjects) {
5027
+ if (path in input.exemptions)
5028
+ continue;
5029
+ if (!reachesProducer(path, input.producers, input.imports)) {
5030
+ findings.push({
5031
+ path,
5032
+ reason: `"${path}" ${input.crossingFiles.includes(path) ? "makes a GitHub-writing call" : "implements a blocking gate"} but neither is a log producer nor imports one, and it is not exempted with a reason`
5033
+ });
5034
+ }
5035
+ }
5036
+ for (const [path, reason] of Object.entries(input.exemptions)) {
5037
+ if (reason.trim() === "") {
5038
+ findings.push({ path, reason: `exemption for "${path}" states no reason` });
5039
+ } else if (!input.existsFn(path)) {
5040
+ findings.push({ path, reason: `exemption names "${path}", which no longer exists` });
5041
+ } else if (!subjects.has(path)) {
5042
+ findings.push({
5043
+ path,
5044
+ reason: `exemption names "${path}", which is neither a GitHub-writing file nor a blocking gate's implementation`
5045
+ });
5046
+ } else if (reachesProducer(path, input.producers, input.imports)) {
5047
+ findings.push({
5048
+ path,
5049
+ reason: `exemption names "${path}", which does reach a log producer — remove the exemption`
5050
+ });
5051
+ }
5052
+ }
5053
+ return { check: "G7", status: findings.length > 0 ? "fail" : "pass", findings };
5054
+ }
4938
5055
  // ../../packages/aeg-core/src/dead-branch-push-guard.ts
4939
5056
  function checkDeadBranchPush(input) {
4940
5057
  const { branch, prState, prNumber } = input;
@@ -5114,6 +5231,11 @@ function checkDispatchReadiness(input) {
5114
5231
  push("depends-on-unresolvable", `dispatch-gate depends-on: ${taskLabel} depends on "${dep.id}", which is UNRESOLVABLE — the resolver could not find a matching tranche/task/Issue for this edge (not a claim about merge status). Not dispatchable until the edge is corrected.`);
5115
5232
  continue;
5116
5233
  }
5234
+ if (dep.readFailed === true) {
5235
+ const issueStr = dep.issue !== null ? ` (#${dep.issue})` : "";
5236
+ push("depends-on-read-failed", `dispatch-gate depends-on: ${taskLabel} depends on ${dep.id}${issueStr}, but the forge could not be read for that dependency — not a claim about its merge status. Retry the check.`);
5237
+ continue;
5238
+ }
5117
5239
  if (!dep.merged && !isHandClosedByRecognizedPrincipal(dep, principalAllowlist)) {
5118
5240
  const issueStr = dep.issue !== null ? ` (#${dep.issue})` : "";
5119
5241
  push("depends-on-not-merged", `dispatch-gate depends-on: ${taskLabel} depends on ${dep.id}${issueStr}, whose PR is not merged yet — not dispatchable, it serializes behind it.`);
@@ -5696,6 +5818,7 @@ var CustomEventDeclarationsSchema = z2.record(z2.string(), z2.object({
5696
5818
 
5697
5819
  // ../../packages/aeg-core/src/log/schema.ts
5698
5820
  var CONFIDENCE_REASON_MAX_LENGTH = 280;
5821
+ var REVIEW_FINDING_DESCRIPTION_MAX_LENGTH = 1000;
5699
5822
  var ROLE_VALUES = [
5700
5823
  "planner",
5701
5824
  "developer",
@@ -5789,6 +5912,9 @@ var envelopeTail = {
5789
5912
  var ReviewFindingSchema = z3.object({
5790
5913
  id: z3.string(),
5791
5914
  severity: z3.string(),
5915
+ location: z3.string().optional(),
5916
+ deferral_reason: z3.enum(["outside-surface", "unchanged-line"]).optional(),
5917
+ description: z3.string().max(REVIEW_FINDING_DESCRIPTION_MAX_LENGTH).optional(),
5792
5918
  state: z3.string().optional(),
5793
5919
  severity_scale: z3.string().optional(),
5794
5920
  policy_treatment: z3.enum(["blocking", "non_blocking", "unavailable"]).optional(),
@@ -5844,7 +5970,8 @@ var DispatchEventSchema = z3.discriminatedUnion("event", [
5844
5970
  z3.object({
5845
5971
  ...dispatchShared,
5846
5972
  event: z3.literal("dispatch_failed"),
5847
- reason: z3.enum(["timeout", "crash", "refused", "unattributed_write"]),
5973
+ reason: z3.enum(["timeout", "crash", "refused", "unattributed_write", "usage_limit"]),
5974
+ usage_limit: z3.object({ agent: z3.string().min(1), reset_at: z3.string().nullable() }).strict().optional(),
5848
5975
  usage: dispatchUsageField
5849
5976
  }).strict()
5850
5977
  ]);
@@ -629,6 +629,33 @@ function tasksFromIssues(issues) {
629
629
  }
630
630
  return tasks.sort((a, b) => compareTaskIds(a.id, b.id));
631
631
  }
632
+ function resolveDuplicateTasks(tasks, isOpen) {
633
+ const byId = new Map;
634
+ for (const t of tasks)
635
+ byId.set(t.id, [...byId.get(t.id) ?? [], t]);
636
+ const resolved = [];
637
+ const conflicts = [];
638
+ for (const [id, group] of byId) {
639
+ const first = group[0];
640
+ if (!first)
641
+ continue;
642
+ if (group.length === 1) {
643
+ resolved.push(first);
644
+ continue;
645
+ }
646
+ const number = (t) => t.issue ?? 0;
647
+ const open = group.filter((t) => t.issue !== null && isOpen(t.issue)).sort((a, b) => number(a) - number(b));
648
+ if (open.length > 1) {
649
+ conflicts.push({ id, issues: open.map(number) });
650
+ resolved.push(open[0]);
651
+ } else if (open.length === 1) {
652
+ resolved.push(open[0]);
653
+ } else {
654
+ resolved.push([...group].sort((a, b) => number(b) - number(a))[0]);
655
+ }
656
+ }
657
+ return { tasks: resolved.sort((a, b) => compareTaskIds(a.id, b.id)), conflicts };
658
+ }
632
659
  async function fetchTrancheIssuesAsync(owner, repo, slug) {
633
660
  return ghIssueListByAnyLabelAsync(owner, repo, [trancheLabel(slug)]);
634
661
  }
@@ -1436,7 +1463,7 @@ function mapReviewDecision(decision) {
1436
1463
  function buildBranchName(tranche, taskId) {
1437
1464
  return `task/${tranche}/${taskId}`;
1438
1465
  }
1439
- async function fetchForgeFacts(input) {
1466
+ async function fetchForgeFactsByIssue(input) {
1440
1467
  const token = await resolveGithubToken(input.token);
1441
1468
  if (!token) {
1442
1469
  return {
@@ -1446,7 +1473,13 @@ async function fetchForgeFacts(input) {
1446
1473
  reason: "No GitHub token available (set GITHUB_TOKEN/GH_TOKEN or `gh auth login`)."
1447
1474
  };
1448
1475
  }
1449
- const queriedTasks = input.tasks.filter((t) => t.issue !== null);
1476
+ const seen = new Set;
1477
+ const queriedTasks = input.tasks.filter((t) => {
1478
+ if (t.issue === null || seen.has(t.issue))
1479
+ return false;
1480
+ seen.add(t.issue);
1481
+ return true;
1482
+ });
1450
1483
  if (queriedTasks.length === 0) {
1451
1484
  return { facts: new Map, prRefs: new Map, unavailable: false };
1452
1485
  }
@@ -1474,21 +1507,52 @@ async function fetchForgeFacts(input) {
1474
1507
  };
1475
1508
  }
1476
1509
  for (const task of queriedTasks) {
1477
- const alias = aliasFor(task.id);
1478
- const raw = extractRawFromResponse(response.repository, alias);
1510
+ const raw = extractRawFromResponse(response.repository, aliasFor(task.issue));
1479
1511
  const mapped = mapForgeFacts(raw);
1480
1512
  if (mapped)
1481
- facts.set(task.id, mapped);
1513
+ facts.set(task.issue, mapped);
1482
1514
  const pr = raw.pullRequest;
1483
1515
  if (pr && typeof pr.number === "number" && typeof pr.url === "string") {
1484
- prRefs.set(task.id, { number: pr.number, url: pr.url, state: pr.state });
1516
+ prRefs.set(task.issue, { number: pr.number, url: pr.url, state: pr.state });
1485
1517
  }
1486
1518
  }
1487
1519
  return { facts, prRefs, unavailable: false };
1488
1520
  }
1521
+ async function fetchForgeFacts(input) {
1522
+ const byIssue = await fetchForgeFactsByIssue(input);
1523
+ if (byIssue.unavailable) {
1524
+ return { facts: new Map, prRefs: new Map, unavailable: true, reason: byIssue.reason };
1525
+ }
1526
+ const facts = new Map;
1527
+ const prRefs = new Map;
1528
+ const winner = new Map;
1529
+ for (const task of input.tasks) {
1530
+ if (task.issue === null)
1531
+ continue;
1532
+ const current = winner.get(task.id);
1533
+ if (current === undefined || outranks(byIssue.facts, task.issue, current))
1534
+ winner.set(task.id, task.issue);
1535
+ }
1536
+ for (const [taskId, issue] of winner) {
1537
+ const f = byIssue.facts.get(issue);
1538
+ if (f)
1539
+ facts.set(taskId, f);
1540
+ const pr = byIssue.prRefs.get(issue);
1541
+ if (pr)
1542
+ prRefs.set(taskId, pr);
1543
+ }
1544
+ return { facts, prRefs, unavailable: false };
1545
+ }
1546
+ function outranks(facts, candidate, current) {
1547
+ const candidateOpen = facts.get(candidate)?.issueState === "open";
1548
+ const currentOpen = facts.get(current)?.issueState === "open";
1549
+ if (candidateOpen !== currentOpen)
1550
+ return candidateOpen;
1551
+ return candidate > current;
1552
+ }
1489
1553
  function buildBatchQuery(tranche, tasks) {
1490
1554
  const perTask = tasks.map((task) => {
1491
- const a = aliasFor(task.id);
1555
+ const a = aliasFor(task.issue);
1492
1556
  const branch = buildBranchName(tranche, task.id);
1493
1557
  return `
1494
1558
  ${a}_issue: issue(number: ${task.issue}) {
@@ -1530,9 +1594,8 @@ function buildBatchQuery(tranche, tasks) {
1530
1594
  }
1531
1595
  }`;
1532
1596
  }
1533
- function aliasFor(taskId) {
1534
- const sanitized = taskId.replace(/[^a-zA-Z0-9_]/g, "_");
1535
- return `t_${sanitized}`;
1597
+ function aliasFor(issue) {
1598
+ return `i_${issue}`;
1536
1599
  }
1537
1600
  function extractRawFromResponse(repository, alias) {
1538
1601
  const issue = repository[`${alias}_issue`];
@@ -2363,6 +2426,9 @@ var ROLE_FILE_LOCATION = /(^|\/)aeg-root\/roles\//i;
2363
2426
  function isProseLocation(location) {
2364
2427
  if (ROLE_FILE_LOCATION.test(location))
2365
2428
  return true;
2429
+ return isBodyOrCommentLocation(location);
2430
+ }
2431
+ function isBodyOrCommentLocation(location) {
2366
2432
  if (FILE_SHAPED_LOCATION.test(location))
2367
2433
  return false;
2368
2434
  return PROSE_LOCATION_PATTERNS.some((pattern) => pattern.test(location));
@@ -2389,7 +2455,7 @@ function classifyFinding(finding, scale, threshold, context = {}) {
2389
2455
  const wouldBlock = blockingSeverities(scale, threshold).includes(effectiveSeverity);
2390
2456
  if (!wouldBlock)
2391
2457
  return { outcome: "non_blocking", deferralReason: null };
2392
- const hasLocation = location !== undefined && location.length > 0;
2458
+ const hasLocation = location !== undefined && location.length > 0 && !isBodyOrCommentLocation(location);
2393
2459
  if (hasLocation && context.inSurface && !context.inSurface(location)) {
2394
2460
  return { outcome: "deferred", deferralReason: "outside-surface" };
2395
2461
  }
@@ -4059,6 +4125,8 @@ var FILE_EXTENSIONS = new Set([
4059
4125
  "html",
4060
4126
  "css"
4061
4127
  ]);
4128
+ var CI_SHARD_DIR = "apps/cli/tests/ci-shards";
4129
+ var CI_SHARD_PROBE = `${CI_SHARD_DIR}/shard-1.txt`;
4062
4130
 
4063
4131
  // ../../packages/aeg-core/src/task-branch-identity.ts
4064
4132
  var ISSUE_BRANCH_PATTERN = /^task\/issue-(\d+)$/;
@@ -4936,6 +5004,55 @@ function checkG6(rows, registeredCheckNames) {
4936
5004
  }
4937
5005
  return { check: "G6", status: findings.length > 0 ? "fail" : "pass", findings };
4938
5006
  }
5007
+ function reachesProducer(file, producers, imports) {
5008
+ const seen = new Set([file]);
5009
+ const queue = [file];
5010
+ for (let next = queue.pop();next !== undefined; next = queue.pop()) {
5011
+ if (producers.has(next))
5012
+ return true;
5013
+ for (const dep of imports.get(next) ?? []) {
5014
+ if (!seen.has(dep)) {
5015
+ seen.add(dep);
5016
+ queue.push(dep);
5017
+ }
5018
+ }
5019
+ }
5020
+ return false;
5021
+ }
5022
+ function checkG7(input) {
5023
+ if (!input.enforcementMapPresent)
5024
+ return { check: "G7", status: "info", findings: [] };
5025
+ const subjects = new Set([...input.crossingFiles, ...input.blockingFiles]);
5026
+ const findings = [];
5027
+ for (const path of subjects) {
5028
+ if (path in input.exemptions)
5029
+ continue;
5030
+ if (!reachesProducer(path, input.producers, input.imports)) {
5031
+ findings.push({
5032
+ path,
5033
+ reason: `"${path}" ${input.crossingFiles.includes(path) ? "makes a GitHub-writing call" : "implements a blocking gate"} but neither is a log producer nor imports one, and it is not exempted with a reason`
5034
+ });
5035
+ }
5036
+ }
5037
+ for (const [path, reason] of Object.entries(input.exemptions)) {
5038
+ if (reason.trim() === "") {
5039
+ findings.push({ path, reason: `exemption for "${path}" states no reason` });
5040
+ } else if (!input.existsFn(path)) {
5041
+ findings.push({ path, reason: `exemption names "${path}", which no longer exists` });
5042
+ } else if (!subjects.has(path)) {
5043
+ findings.push({
5044
+ path,
5045
+ reason: `exemption names "${path}", which is neither a GitHub-writing file nor a blocking gate's implementation`
5046
+ });
5047
+ } else if (reachesProducer(path, input.producers, input.imports)) {
5048
+ findings.push({
5049
+ path,
5050
+ reason: `exemption names "${path}", which does reach a log producer — remove the exemption`
5051
+ });
5052
+ }
5053
+ }
5054
+ return { check: "G7", status: findings.length > 0 ? "fail" : "pass", findings };
5055
+ }
4939
5056
  // ../../packages/aeg-core/src/dead-branch-push-guard.ts
4940
5057
  function checkDeadBranchPush(input) {
4941
5058
  const { branch, prState, prNumber } = input;
@@ -5115,6 +5232,11 @@ function checkDispatchReadiness(input) {
5115
5232
  push("depends-on-unresolvable", `dispatch-gate depends-on: ${taskLabel} depends on "${dep.id}", which is UNRESOLVABLE — the resolver could not find a matching tranche/task/Issue for this edge (not a claim about merge status). Not dispatchable until the edge is corrected.`);
5116
5233
  continue;
5117
5234
  }
5235
+ if (dep.readFailed === true) {
5236
+ const issueStr = dep.issue !== null ? ` (#${dep.issue})` : "";
5237
+ push("depends-on-read-failed", `dispatch-gate depends-on: ${taskLabel} depends on ${dep.id}${issueStr}, but the forge could not be read for that dependency — not a claim about its merge status. Retry the check.`);
5238
+ continue;
5239
+ }
5118
5240
  if (!dep.merged && !isHandClosedByRecognizedPrincipal(dep, principalAllowlist)) {
5119
5241
  const issueStr = dep.issue !== null ? ` (#${dep.issue})` : "";
5120
5242
  push("depends-on-not-merged", `dispatch-gate depends-on: ${taskLabel} depends on ${dep.id}${issueStr}, whose PR is not merged yet — not dispatchable, it serializes behind it.`);
@@ -5697,6 +5819,7 @@ var CustomEventDeclarationsSchema = z2.record(z2.string(), z2.object({
5697
5819
 
5698
5820
  // ../../packages/aeg-core/src/log/schema.ts
5699
5821
  var CONFIDENCE_REASON_MAX_LENGTH = 280;
5822
+ var REVIEW_FINDING_DESCRIPTION_MAX_LENGTH = 1000;
5700
5823
  var ROLE_VALUES = [
5701
5824
  "planner",
5702
5825
  "developer",
@@ -5790,6 +5913,9 @@ var envelopeTail = {
5790
5913
  var ReviewFindingSchema = z3.object({
5791
5914
  id: z3.string(),
5792
5915
  severity: z3.string(),
5916
+ location: z3.string().optional(),
5917
+ deferral_reason: z3.enum(["outside-surface", "unchanged-line"]).optional(),
5918
+ description: z3.string().max(REVIEW_FINDING_DESCRIPTION_MAX_LENGTH).optional(),
5793
5919
  state: z3.string().optional(),
5794
5920
  severity_scale: z3.string().optional(),
5795
5921
  policy_treatment: z3.enum(["blocking", "non_blocking", "unavailable"]).optional(),
@@ -5845,7 +5971,8 @@ var DispatchEventSchema = z3.discriminatedUnion("event", [
5845
5971
  z3.object({
5846
5972
  ...dispatchShared,
5847
5973
  event: z3.literal("dispatch_failed"),
5848
- reason: z3.enum(["timeout", "crash", "refused", "unattributed_write"]),
5974
+ reason: z3.enum(["timeout", "crash", "refused", "unattributed_write", "usage_limit"]),
5975
+ usage_limit: z3.object({ agent: z3.string().min(1), reset_at: z3.string().nullable() }).strict().optional(),
5849
5976
  usage: dispatchUsageField
5850
5977
  }).strict()
5851
5978
  ]);
@@ -7249,6 +7376,10 @@ var COMMANDS = [
7249
7376
  {
7250
7377
  flag: "--agent <claude|codex|gemini>",
7251
7378
  description: "Vendor for the developer and both reviewers this run dispatches"
7379
+ },
7380
+ {
7381
+ flag: "--quiet",
7382
+ description: "Hide the detail lines (an agent's prose, full commands, failed-result tails) on the live terminal; the driver log file keeps them"
7252
7383
  }
7253
7384
  ],
7254
7385
  details: [
@@ -7262,7 +7393,14 @@ var COMMANDS = [
7262
7393
  {
7263
7394
  name: "task status",
7264
7395
  description: "Every open task with a frozen brief, its pull request, and whether its loop is running, paused, or published",
7265
- flags: [{ flag: "--json", description: "Enveloped JSON output (schema: 1)" }],
7396
+ flags: [
7397
+ { flag: "--json", description: "Enveloped JSON output (schema: 1)" },
7398
+ {
7399
+ flag: "--follow",
7400
+ description: "Tail the task's driver log live, with its detail lines, on either the `<tranche> <n>` form or `--issue <n>`"
7401
+ },
7402
+ { flag: "--quiet", description: "With `--follow`, hide the detail lines; the log file is unchanged" }
7403
+ ],
7266
7404
  details: [
7267
7405
  "Read-only: one `gh issue list` for every open task Issue across every tranche (title/label resolved through the same `resolveTaskIssueRef` `list-tasks.ts` already uses), the open pull request per branch, and the driver pid record / pause record / publish effect markers under `<outboxRoot>/dev-review-loop/<task>/` — never a `ps` scan, never a re-parse of posted verdict comments to decide `published`.",
7268
7406
  "`running` names the driver's pid (`review-validity-v1` task 7's pid record); `paused` names the reason from the pause record; `published` means the newest round's reviewer and security verdict effect markers both read `posted`; `no driver` is the fallback when none of the above holds.",
@@ -7298,6 +7436,26 @@ var COMMANDS = [
7298
7436
  ],
7299
7437
  status: "shipped"
7300
7438
  },
7439
+ {
7440
+ name: "task-tools result-proof",
7441
+ description: "Prove, live on this host, that a CLI delivers the Developer's turn result as its own structured final output",
7442
+ flags: [{ flag: "--agent <claude|codex>", description: "The CLI to prove" }],
7443
+ details: [
7444
+ "Runs real Developer-shaped dispatches on this host — the driver-run dev-tools registered and called, the agent's own sandbox where the host supports it, the subscription login, and the dispatch's own argv — and asks for the versioned `DeveloperTurnResult` (`completed`, `blocked` or `needs_ruling`) through the CLI's native structured output: Claude Code `--json-schema` under `--output-format stream-json`, with the dispatch's Stop hook plus one that rejects the first stop; Codex `--output-schema` under `exec --json` and `exec resume --json`.",
7445
+ "Cases: a first and a resumed session (the same provider session, a fresh result, exactly one accepted); a schema-valid but semantically invalid result (an unknown finding id, a ruling request naming no permissible decision), which the driver rejects; malformed output, which never reaches the driver; and a cancelled run, a provider error and context exhaustion, each ending with no accepted result. Each case prints whether a schema-valid result reached the driver, the result, and the event it was read from; exits 1 when any case fails. Never publishes, opens a pull request or writes the forge."
7446
+ ],
7447
+ status: "shipped"
7448
+ },
7449
+ {
7450
+ name: "task-tools review-result-proof",
7451
+ description: "Prove, live on this host, that a CLI delivers a reviewer's result as its own structured final output, concurrent and fresh",
7452
+ flags: [{ flag: "--agent <claude|codex>", description: "The CLI to prove" }],
7453
+ details: [
7454
+ "Runs real reviewer-shaped dispatches on this host — fresh, non-resumed sessions, the agent's own sandbox where the host supports it, the subscription login, read-only grants, and the staged diff and review-input manifest — and asks for the versioned `ReviewResult` (`completed` or `blocked`, bound to the controller's role, head and manifest digest) through the CLI's native structured output: Claude Code `--json-schema` under `--output-format stream-json`; Codex `--output-schema` under `exec --json`. Both the code-reviewer and the security-reviewer role run, concurrently against one manifest, each accepted result attributed to its own role.",
7455
+ "Cases: a role mismatch, a wrong head and a wrong manifest digest; an objective id outside the brief, a severity outside the role's scale and a finding without a file (all refused) and a finding without a line (accepted); and a blocked, malformed, missing, cancelled, provider-error and context-exhausted outcome, each recorded as no review, never approval. Each case prints whether a schema-valid result reached the driver and what the controller made of it; exits 1 when any case fails. Never writes the forge and leaves the loop's reviewer dispatch and result files untouched."
7456
+ ],
7457
+ status: "shipped"
7458
+ },
7301
7459
  {
7302
7460
  name: "pr create",
7303
7461
  description: "Open a pull request after full brief-schema validation",
@@ -8124,6 +8282,8 @@ var REGISTRY = [
8124
8282
  timeoutMs: 15000,
8125
8283
  env: {
8126
8284
  BASE_SHA: { optional: true },
8285
+ GIT_INDEX_FILE: { optional: true },
8286
+ VINAYA_COMMIT_HOOK: { optional: true },
8127
8287
  PR_BODY: { optional: true },
8128
8288
  PR_BODY_FILE: { optional: true },
8129
8289
  PR_NUMBER: { optional: true },
@@ -10185,11 +10345,11 @@ function main() {
10185
10345
  emitCheckError({
10186
10346
  schema: CHECK_SCHEMA_VERSION,
10187
10347
  check: CHECK_NAME,
10188
- severity: "warning",
10189
- message: `changeset-coverage: this diff changes a published package's shipped file(s) with no \`.changeset/*.md\` in the same diff: ${result.shippedPathsHit.join(", ")}`,
10190
- agent_recovery_prompt: "Add a `.changeset/*.md` entry in this PR describing the change (run the repo's changeset CLI, e.g. `bunx changeset`), then commit it in the same PR — a shipped-package change with no changeset means adopters get nothing on the next release."
10348
+ severity: "error",
10349
+ message: `changeset-coverage: this diff changes a published package's shipped file(s) with no \`.changeset/*.md\` in the same diff: ${result.shippedPathsHit.join(", ")}. Add a changeset describing the change, or add an empty one when the change ships nothing users see.`,
10350
+ agent_recovery_prompt: "Either add a `.changeset/*.md` entry describing the change in user terms (run the repo's changeset CLI, e.g. `bunx changeset`), or, when the change ships nothing users see, add an empty changeset (`bunx changeset add --empty`). Commit it in the same PR."
10191
10351
  });
10352
+ process.exit(1);
10192
10353
  }
10193
- process.exit(0);
10194
10354
  }
10195
10355
  main();