@attalabs/vinaya 0.32.0 → 0.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/aeg-root/contracts/principal-operator.md +18 -5
- package/aeg-root/enforcement.md +1 -1
- package/aeg-root/glossary.md +4 -0
- package/aeg-root/roles/developer.md +3 -0
- package/aeg-root/roles/operator.md +89 -16
- package/aeg-root/roles/planner/reference.md +3 -2
- package/aeg-root/roles/planner.md +3 -1
- package/aeg-root/roles/tranche-archivist.md +1 -0
- package/aeg-root/skills/aeg-context-packets/SKILL.md +1 -1
- package/aeg-root/skills/aeg-context-packets/examples/operator-start.md +1 -1
- package/aeg-root/templates/brief-template.md +9 -7
- package/aeg-root/templates/pr-report-template.md +3 -1
- package/dist/checks/bin/check-body-bare-digits.js +213 -41
- package/dist/checks/bin/check-branch-topology.js +164 -41
- package/dist/checks/bin/check-brief-shape.js +219 -46
- package/dist/checks/bin/check-changeset-coverage.js +669 -152
- package/dist/checks/bin/check-closes-n.js +164 -41
- package/dist/checks/bin/check-coherence.js +220 -43
- package/dist/checks/bin/check-dead-branch-push.js +159 -40
- package/dist/checks/bin/check-dispatch-readiness.js +218 -42
- package/dist/checks/bin/check-doc-coverage-push.js +665 -148
- package/dist/checks/bin/check-doc-coverage.js +667 -150
- package/dist/checks/bin/check-doctrine-no-procedures.js +213 -41
- package/dist/checks/bin/check-doctrine-portability.js +666 -149
- package/dist/checks/bin/check-evidence-fresh.js +643 -125
- package/dist/checks/bin/check-exec-bits.js +663 -146
- package/dist/checks/bin/check-first-push-dispatch.js +218 -42
- package/dist/checks/bin/check-issue-assignment.js +164 -41
- package/dist/checks/bin/check-issue-milestone-attach.js +159 -40
- package/dist/checks/bin/check-issue-objectives-numbering.js +685 -41
- package/dist/checks/bin/check-issue-parts-coverage.js +159 -40
- package/dist/checks/bin/check-issue-surface-globs.js +258 -48
- package/dist/checks/bin/check-issue-title-grammar.js +159 -40
- package/dist/checks/bin/check-issue-tranche-label.js +159 -40
- package/dist/checks/bin/check-main-branch-refusal.js +159 -40
- package/dist/checks/bin/check-no-disk-state.js +159 -40
- package/dist/checks/bin/check-pr-premise-reassert.js +213 -41
- package/dist/checks/bin/check-pr-report-density.js +159 -40
- package/dist/checks/bin/check-principal-test-plan-wait.js +159 -40
- package/dist/checks/bin/check-quoted-command.js +586 -103
- package/dist/checks/bin/check-reader-resolvable-prose.js +637 -111
- package/dist/checks/bin/check-registry-gates.js +159 -40
- package/dist/checks/bin/check-retired-vocabulary.js +586 -103
- package/dist/checks/bin/check-review-gate.js +284 -152
- package/dist/checks/bin/check-single-plan-pr.js +159 -40
- package/dist/checks/bin/check-surface-scope.js +164 -41
- package/dist/checks/bin/check-test-plan.js +159 -40
- package/dist/checks/bin/check-token-collection-wired.js +159 -40
- package/dist/checks/bin/check-token-report.js +159 -40
- package/dist/checks/bin/check-workspace-escape.js +664 -147
- package/dist/index.js +3932 -1118
- package/dist/lib/pre-push-cache-test-run.js +507 -72
- package/dist/lib/pre-push-select-tests.js +136 -13
- package/package.json +1 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/actions.ts +10 -12
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/anchored-region.ts +5 -5
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/archive-task.ts +42 -17
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/baseline-capture.ts +1 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/branch-topology-gate.ts +3 -3
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/brief-render.ts +554 -95
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/brief-validation.ts +264 -44
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/claude-code-transcript.ts +9 -9
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/coherence-checks.ts +211 -30
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/consumer-enumeration.ts +2 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/index.ts +75 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/local.ts +961 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/migration.ts +222 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/outcomes.ts +135 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/control-store/records.ts +394 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dead-branch-push-audit.ts +1 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dead-branch-push-guard.ts +1 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/derive-section7.ts +2 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/assess-round.ts +514 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/fakes.ts +110 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/index.ts +30 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/journal-reconstruction.ts +219 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/render-summary.ts +97 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dev-review-loop/types.ts +240 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/diagram-model.ts +1 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/direct-main-push.ts +1 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/dispatch-gate.ts +65 -22
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/doc-claim.ts +238 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/doc-owners.ts +14 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/docs/docs-coherence.ts +1 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/docs/legacy-anchors.ts +1 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/docs/node-route.ts +1 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/docs/surfaced-manifest.ts +1 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/doctrine-no-procedures.ts +1 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/doctrine-portability.ts +5 -5
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/ensure-label.ts +1 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/first-push-dispatch-gate.ts +1 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/gate-audience.ts +14 -3
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/index.ts +425 -11
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/issue-assignment.ts +3 -4
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/issue-validation.ts +1450 -33
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/leftover-detection.ts +1 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/local-anchor-coverage.ts +2 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/envelope.ts +119 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/index.ts +75 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/redact.ts +87 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/schema.ts +801 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/log/store.ts +373 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/main-branch-refusal.ts +2 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/metering-io-guard.ts +1 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/milestone-validation.ts +2 -3
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/no-disk-state.ts +2 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/objectives.ts +288 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/parse-token-report.ts +3 -3
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/parse-tranche.ts +1 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/pr-report-density.ts +30 -16
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/pr-tier.ts +17 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/premise-check.ts +1 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/quoted-command.ts +1 -1
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/reader-resolvable-prose.ts +267 -19
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/registry-checks.ts +91 -24
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/registry-scaffold.ts +6 -6
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/report-tokens.ts +4 -4
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-gate.ts +254 -110
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-input-manifest.ts +384 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-policy.ts +208 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/review-status.ts +80 -28
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/ruling-ordinal.ts +92 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/single-plan-pr.ts +4 -4
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/state-machine-model.ts +40 -27
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/symbol-collisions.ts +2 -2
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/task-branch-identity.ts +38 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/task-phase-history.ts +194 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/task-tools.ts +712 -0
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/test-plan-gate.ts +7 -9
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/test-plan-section.ts +5 -5
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/types.ts +4 -4
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/verdict-extraction.ts +368 -56
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/waiver-label.ts +2 -3
- package/studio-standalone/_node_modules/@attalabs/aeg-core/src/workspace-escape.ts +3 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/BUILD_ID +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/build-manifest.json +3 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/prerender-manifest.json +3 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.html +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page/server-reference-manifest.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/api/coherence/route.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page/server-reference-manifest.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page/server-reference-manifest.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/backlog/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page/server-reference-manifest.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page/server-reference-manifest.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page/server-reference-manifest.json +3 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page.js +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page/server-reference-manifest.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/[name]/tranches/[slug]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page/server-reference-manifest.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/projects/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page/server-reference-manifest.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page.js.nft.json +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/app/studio/tranches/page_client-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/{[externals]__1agj1ww._.js → [externals]__0cki-x_._.js} +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/[root-of-the-server]__02a-3g8._.js +6 -6
- 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
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__074w9nf._.js +3 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{[root-of-the-server]__0r7e54g._.js → [root-of-the-server]__07uhu5z._.js} +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0ls23oh._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1gjqmhq._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__1wc4-ip._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/{[root-of-the-server]__1r47dr7._.js → _08onyya._.js} +3 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_096f46i._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0af2one._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0e5tkdd._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0kf2g72._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0y1jv16._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_0zf4d27._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1-wo68i._.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_15gdg48._.js +5 -5
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/_1achbh9._.js +1 -1
- 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
- package/studio-standalone/apps/vinaya-studio/web/.next/server/middleware-build-manifest.js +3 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/server/pages/500.html +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/server-reference-manifest.js +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/server/server-reference-manifest.json +4 -4
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0bjnj-5fy4e7l.js +1 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0ko698wh8xx2g.css +1 -0
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{1dc2_-c_gavj1.js → 0q9p7c6vn-x2w.js} +4 -4
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/{3xg6-flovrcx-.js → 2174nz5he_oc4.js} +1 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/3xnma0-359j17.js +1 -0
- package/studio-standalone/apps/vinaya-studio/web/package.json +2 -2
- package/studio-standalone/apps/vinaya-studio/web/.next/server/chunks/ssr/[root-of-the-server]__0hstap0._.js +0 -3
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/0bm4nrrzwc7zi.css +0 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/2t_rfsztmwu6y.js +0 -1
- package/studio-standalone/apps/vinaya-studio/web/.next/static/chunks/3ua4rm5f-a9k6.js +0 -1
- /package/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/{aeg-core → vinaya/studio-standalone/_node_modules/@attalabs/vinaya/studio-standalone/_node_modules/@attalabs/aeg-core}/bin/verify-coherence.ts +0 -0
- /package/studio-standalone/apps/vinaya-studio/web/.next/static/{e8XbZ2vlVz40KzHmlqhwP → HmoeqXdX1E4drt7GReFOO}/_buildManifest.js +0 -0
- /package/studio-standalone/apps/vinaya-studio/web/.next/static/{e8XbZ2vlVz40KzHmlqhwP → HmoeqXdX1E4drt7GReFOO}/_clientMiddlewareManifest.js +0 -0
- /package/studio-standalone/apps/vinaya-studio/web/.next/static/{e8XbZ2vlVz40KzHmlqhwP → HmoeqXdX1E4drt7GReFOO}/_ssgManifest.js +0 -0
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
4
|
-
|
|
5
|
-
// src/checks/bin/check-review-gate.ts
|
|
6
|
-
import { execFileSync as execFileSync4 } from "node:child_process";
|
|
7
4
|
// ../../packages/aeg-core/src/gate-audience.ts
|
|
8
5
|
var GATE_AUDIENCE = {
|
|
9
6
|
"check-branch-topology": { shippedAs: "branch-topology", ring: 0 },
|
|
@@ -198,8 +195,8 @@ function maskIndentedCode(body, fill) {
|
|
|
198
195
|
var SECTION_HEADER = /\*\*Dependency rationale\*\*/i;
|
|
199
196
|
var NEXT_HEADER = /\*\*[A-Z][^*]*\*\*/;
|
|
200
197
|
var FIELD_LABEL = /^(Depends-on|Conflicts-with)\s*:\s*(.*)$/i;
|
|
201
|
-
var ID_TOKEN = /^(?:[\w.-]+\s+)?#?\d
|
|
202
|
-
var SLUG_QUALIFIED_ID = /^([\w.-]+)\s+(#?\d+
|
|
198
|
+
var ID_TOKEN = /^(?:[\w.-]+\s+)?#?\d+$/i;
|
|
199
|
+
var SLUG_QUALIFIED_ID = /^([\w.-]+)\s+(#?\d+)$/i;
|
|
203
200
|
function splitSlugQualifiedEdge(edge) {
|
|
204
201
|
const m = edge.trim().match(SLUG_QUALIFIED_ID);
|
|
205
202
|
if (!m)
|
|
@@ -2047,12 +2044,24 @@ function extractBaseSha(comment) {
|
|
|
2047
2044
|
const m = firstThirteenLines(comment).match(BASE_SHA_PATTERN);
|
|
2048
2045
|
return m ? m[1].toLowerCase() : null;
|
|
2049
2046
|
}
|
|
2050
|
-
var
|
|
2047
|
+
var FINDING_DESCRIPTION_STATE = /^F(\d+)(?:\s+\S+)?(?:\s+(open|fix-claimed|reproduced|resolved))?:/;
|
|
2048
|
+
function parseFindingState(description) {
|
|
2049
|
+
const m = FINDING_DESCRIPTION_STATE.exec(description.trim());
|
|
2050
|
+
if (!m)
|
|
2051
|
+
return { id: null, state: null };
|
|
2052
|
+
return { id: `F${m[1]}`, state: m[2] ?? null };
|
|
2053
|
+
}
|
|
2054
|
+
var FINDING_SEVERITY_LINE = /^\d+\.\s+\[([A-Z][A-Z]*)\]\s+(.+?)\s+—(?:\s+(.*))?$/gm;
|
|
2051
2055
|
function extractFindingSeverities(comment) {
|
|
2052
|
-
return [...comment.matchAll(FINDING_SEVERITY_LINE)].map((m) =>
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
+
return [...comment.matchAll(FINDING_SEVERITY_LINE)].map((m) => {
|
|
2057
|
+
const { id, state } = parseFindingState(m[3] ?? "");
|
|
2058
|
+
return {
|
|
2059
|
+
severity: m[1],
|
|
2060
|
+
location: m[2],
|
|
2061
|
+
id,
|
|
2062
|
+
state
|
|
2063
|
+
};
|
|
2064
|
+
});
|
|
2056
2065
|
}
|
|
2057
2066
|
function extractVerdict(comments, valuePattern, missingLabel) {
|
|
2058
2067
|
const candidates = comments.filter((c) => valuePattern.test(c));
|
|
@@ -2466,6 +2475,12 @@ function evaluateReviewFindings(findings, scale, threshold) {
|
|
|
2466
2475
|
});
|
|
2467
2476
|
return { outcome: blockingFindings.length > 0 ? "blocked" : "clean", blockingFindings };
|
|
2468
2477
|
}
|
|
2478
|
+
function isConsequentialFinding(finding) {
|
|
2479
|
+
return finding.state !== "resolved";
|
|
2480
|
+
}
|
|
2481
|
+
function consequentialFindings(findings) {
|
|
2482
|
+
return findings.filter((f) => isConsequentialFinding(f));
|
|
2483
|
+
}
|
|
2469
2484
|
function evaluateCodeReview(findings, policy) {
|
|
2470
2485
|
return evaluateReviewFindings(findings, CODE_REVIEW_SEVERITY_ORDER, policy.codeReviewThreshold);
|
|
2471
2486
|
}
|
|
@@ -2602,7 +2617,7 @@ function isIssueNotFoundError(err) {
|
|
|
2602
2617
|
return /could not resolve to an (?:issue|pull request)|\b404\b|not found/i.test(haystack);
|
|
2603
2618
|
}
|
|
2604
2619
|
function resolveObjectivesSource(prBody, issue, cutoverIssue) {
|
|
2605
|
-
if (issue !== null && issue < cutoverIssue)
|
|
2620
|
+
if (issue !== null && cutoverIssue !== null && issue < cutoverIssue)
|
|
2606
2621
|
return { kind: "none" };
|
|
2607
2622
|
if (issue !== null)
|
|
2608
2623
|
return { kind: "issue", issue };
|
|
@@ -2878,9 +2893,18 @@ var COMMIT_TYPES = [
|
|
|
2878
2893
|
];
|
|
2879
2894
|
var COMMIT_TYPE_STYLE = new RegExp(`^(${COMMIT_TYPES.join("|")})(\\([a-z0-9-]+\\))?: \\S`);
|
|
2880
2895
|
function checkForgeTitle(title) {
|
|
2881
|
-
const taskStyle = /^\[[a-z0-9._-]+\] \
|
|
2896
|
+
const taskStyle = /^\[[a-z0-9._-]+\] \d+ — \S/;
|
|
2882
2897
|
if (COMMIT_TYPE_STYLE.test(title) || taskStyle.test(title))
|
|
2883
2898
|
return { status: "pass", errors: [] };
|
|
2899
|
+
const letteredTaskId = /^\[[a-z0-9._-]+\] (\S+) — \S/.exec(title);
|
|
2900
|
+
if (letteredTaskId) {
|
|
2901
|
+
return {
|
|
2902
|
+
status: "fail",
|
|
2903
|
+
errors: [
|
|
2904
|
+
`brief-validation title: "${title}" names task id \`${letteredTaskId[1]}\` — task ids are whole numbers (\`1\`, \`2\`), never lettered (\`2a\`). \`vinaya task run\` and \`task dispatch\` refuse a non-numeric id, so a plan titled this way names a task that cannot be started.`
|
|
2905
|
+
]
|
|
2906
|
+
};
|
|
2907
|
+
}
|
|
2884
2908
|
return {
|
|
2885
2909
|
status: "fail",
|
|
2886
2910
|
errors: [
|
|
@@ -2913,19 +2937,31 @@ function checkNoAgentBoxes(prBody) {
|
|
|
2913
2937
|
]
|
|
2914
2938
|
};
|
|
2915
2939
|
}
|
|
2916
|
-
function
|
|
2940
|
+
function rolloutRuleFor(message) {
|
|
2917
2941
|
if (message.startsWith("brief-validation unpinned code claim:") || message.startsWith("brief-validation commands carry output:") || message.startsWith("brief-validation consumer tests:") || message.startsWith("brief-validation defeat cases:")) {
|
|
2918
|
-
return
|
|
2942
|
+
return "briefRules";
|
|
2919
2943
|
}
|
|
2920
2944
|
if (message.startsWith("brief-validation no agent boxes:"))
|
|
2921
|
-
return
|
|
2945
|
+
return "agentBoxes";
|
|
2922
2946
|
return null;
|
|
2923
2947
|
}
|
|
2924
|
-
|
|
2948
|
+
var DEFAULT_BRIEF_ROLLOUT_CUTOVERS = {
|
|
2949
|
+
briefRulesSincePr: BRIEF_RULES_SINCE_PR,
|
|
2950
|
+
agentBoxesRefusedSincePr: AGENT_BOXES_REFUSED_SINCE_PR
|
|
2951
|
+
};
|
|
2952
|
+
function rolloutThresholdFor(message, cutovers) {
|
|
2953
|
+
const rule = rolloutRuleFor(message);
|
|
2954
|
+
if (rule === "briefRules")
|
|
2955
|
+
return cutovers.briefRulesSincePr;
|
|
2956
|
+
if (rule === "agentBoxes")
|
|
2957
|
+
return cutovers.agentBoxesRefusedSincePr;
|
|
2958
|
+
return null;
|
|
2959
|
+
}
|
|
2960
|
+
function partitionBriefErrorsByRollout(errors, prNumber, cutovers = DEFAULT_BRIEF_ROLLOUT_CUTOVERS) {
|
|
2925
2961
|
const blocking = [];
|
|
2926
2962
|
const info = [];
|
|
2927
2963
|
for (const e of errors) {
|
|
2928
|
-
const threshold = rolloutThresholdFor(e);
|
|
2964
|
+
const threshold = rolloutThresholdFor(e, cutovers);
|
|
2929
2965
|
const grandfathered = threshold !== null && prNumber !== null && prNumber < threshold;
|
|
2930
2966
|
(grandfathered ? info : blocking).push(e);
|
|
2931
2967
|
}
|
|
@@ -3393,8 +3429,8 @@ function checkIssueRationale(body) {
|
|
|
3393
3429
|
return { status: errors.length > 0 ? "fail" : "pass", errors };
|
|
3394
3430
|
}
|
|
3395
3431
|
var OBJECTIVES_SINCE_ISSUE = 404;
|
|
3396
|
-
function checkIssueObjectives(body, issueNumber) {
|
|
3397
|
-
if (issueNumber !== null && issueNumber <
|
|
3432
|
+
function checkIssueObjectives(body, issueNumber, sinceIssue = OBJECTIVES_SINCE_ISSUE) {
|
|
3433
|
+
if (sinceIssue !== null && issueNumber !== null && issueNumber < sinceIssue)
|
|
3398
3434
|
return { status: "pass", errors: [] };
|
|
3399
3435
|
const result = objectivesOf(body);
|
|
3400
3436
|
if (result.ok)
|
|
@@ -3839,7 +3875,7 @@ function resolveDepEntry(dep, trancheSlug, issueToEntry, taskToEntry) {
|
|
|
3839
3875
|
return issueToEntry.get(Number(issueMatch[1]));
|
|
3840
3876
|
return taskToEntry.get(`${trancheSlug}/${dep}`) ?? taskToEntry.get(dep);
|
|
3841
3877
|
}
|
|
3842
|
-
function checkR1(issuesBySlug, grandfatheredIssues, registeredNames = []) {
|
|
3878
|
+
function checkR1(issuesBySlug, grandfatheredIssues, registeredNames = [], objectivesSinceIssue) {
|
|
3843
3879
|
const failures = [];
|
|
3844
3880
|
for (const [slug, issues] of issuesBySlug) {
|
|
3845
3881
|
for (const issue of issues) {
|
|
@@ -3848,7 +3884,7 @@ function checkR1(issuesBySlug, grandfatheredIssues, registeredNames = []) {
|
|
|
3848
3884
|
const errors = [
|
|
3849
3885
|
...checkIssueRationale(issue.body).errors,
|
|
3850
3886
|
...checkProjectsRegistered(issue.body, issue.labels, registeredNames).errors,
|
|
3851
|
-
...checkIssueObjectives(issue.body, issue.number).errors,
|
|
3887
|
+
...checkIssueObjectives(issue.body, issue.number, objectivesSinceIssue).errors,
|
|
3852
3888
|
...checkPartsCiteDefinedObjectives(issue.body).errors
|
|
3853
3889
|
];
|
|
3854
3890
|
if (errors.length === 0)
|
|
@@ -4098,8 +4134,8 @@ function checkReviewGate(input) {
|
|
|
4098
4134
|
let codeReviewPolicyEvaluation;
|
|
4099
4135
|
let securityPolicyEvaluation;
|
|
4100
4136
|
try {
|
|
4101
|
-
codeReviewPolicyEvaluation = evaluateCodeReview(codeReview.findingSeverities, policy);
|
|
4102
|
-
securityPolicyEvaluation = evaluateSecurityReview(security.findingSeverities, policy);
|
|
4137
|
+
codeReviewPolicyEvaluation = evaluateCodeReview(consequentialFindings(codeReview.findingSeverities), policy);
|
|
4138
|
+
securityPolicyEvaluation = evaluateSecurityReview(consequentialFindings(security.findingSeverities), policy);
|
|
4103
4139
|
} catch (err) {
|
|
4104
4140
|
return {
|
|
4105
4141
|
verdict: "fail",
|
|
@@ -4471,13 +4507,27 @@ var SHIPS_PREFIX = "aeg-root/";
|
|
|
4471
4507
|
function shipsArchivePrefix(shipsPrefix) {
|
|
4472
4508
|
return `${shipsPrefix}tranches/completed/`;
|
|
4473
4509
|
}
|
|
4474
|
-
|
|
4475
|
-
|
|
4510
|
+
var DEFAULT_SPEC_PATHS = ["SPEC.md", "CONTEXT.md", "docs/adr"];
|
|
4511
|
+
function normalizeSpecPath(entry) {
|
|
4512
|
+
let out = entry.replace(/\\/g, "/");
|
|
4513
|
+
while (out.startsWith("./"))
|
|
4514
|
+
out = out.slice(2);
|
|
4515
|
+
out = out.replace(/\/{2,}/g, "/");
|
|
4516
|
+
while (out.endsWith("/"))
|
|
4517
|
+
out = out.slice(0, -1);
|
|
4518
|
+
return out;
|
|
4519
|
+
}
|
|
4520
|
+
function isSpecFile2(path, specPaths) {
|
|
4521
|
+
if (path.startsWith("apps/") && path.includes("/specs/") && path.endsWith(".md"))
|
|
4522
|
+
return true;
|
|
4523
|
+
if (!path.endsWith(".md"))
|
|
4524
|
+
return false;
|
|
4525
|
+
return specPaths.some((entry) => isUnderOrEqual(path, normalizeSpecPath(entry)));
|
|
4476
4526
|
}
|
|
4477
4527
|
function isClaudeMdFile(path) {
|
|
4478
4528
|
return path === "CLAUDE.md" || path.endsWith("/CLAUDE.md");
|
|
4479
4529
|
}
|
|
4480
|
-
function classifyProseFile(path, readerFacingPrefix, readerFacingSuffix, shipsPrefix = SHIPS_PREFIX) {
|
|
4530
|
+
function classifyProseFile(path, readerFacingPrefix, readerFacingSuffix, shipsPrefix = SHIPS_PREFIX, specPaths = DEFAULT_SPEC_PATHS) {
|
|
4481
4531
|
if (path.startsWith(shipsPrefix)) {
|
|
4482
4532
|
return path.startsWith(shipsArchivePrefix(shipsPrefix)) ? "internal" : "ships";
|
|
4483
4533
|
}
|
|
@@ -4486,7 +4536,7 @@ function classifyProseFile(path, readerFacingPrefix, readerFacingSuffix, shipsPr
|
|
|
4486
4536
|
}
|
|
4487
4537
|
if (isClaudeMdFile(path))
|
|
4488
4538
|
return "internal";
|
|
4489
|
-
if (isSpecFile2(path))
|
|
4539
|
+
if (isSpecFile2(path, specPaths))
|
|
4490
4540
|
return "spec";
|
|
4491
4541
|
if (isProductScopeFile(path))
|
|
4492
4542
|
return "product";
|
|
@@ -4515,13 +4565,14 @@ function lineAt(content, index) {
|
|
|
4515
4565
|
}
|
|
4516
4566
|
var FORGE_NUMBER_PATTERN = /#[0-9]{2,4}/g;
|
|
4517
4567
|
var TRANCHE_SLUG_VN_PATTERN = /[a-z][a-z-]+-v[0-9]/g;
|
|
4568
|
+
var TASK_NUMBER_PATTERN = /(^|[^a-z0-9-])(tasks?[ \t]+#?[0-9]+)/gi;
|
|
4518
4569
|
function legacySlugPattern(legacySlugs) {
|
|
4519
4570
|
if (legacySlugs.length === 0)
|
|
4520
4571
|
return null;
|
|
4521
4572
|
const alternation = legacySlugs.map((s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|");
|
|
4522
4573
|
return new RegExp(`(^|[^a-zA-Z0-9\\n-])(${alternation})([^a-zA-Z0-9\\n-]|$)`, "g");
|
|
4523
4574
|
}
|
|
4524
|
-
function checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuffix, legacySlugs = [], shipsPrefix = SHIPS_PREFIX, specGrandfather = []) {
|
|
4575
|
+
function checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuffix, legacySlugs = [], shipsPrefix = SHIPS_PREFIX, specGrandfather = [], specPaths = DEFAULT_SPEC_PATHS) {
|
|
4525
4576
|
const findings = [];
|
|
4526
4577
|
const legacyPattern = legacySlugPattern(legacySlugs);
|
|
4527
4578
|
const grandfathered = new Set(specGrandfather);
|
|
@@ -4533,8 +4584,12 @@ function checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuff
|
|
|
4533
4584
|
const productPatterns = [
|
|
4534
4585
|
{ pattern: TRANCHE_SLUG_VN_PATTERN, what: "an internal tranche slug in product code" }
|
|
4535
4586
|
];
|
|
4587
|
+
const specPatterns = [
|
|
4588
|
+
...patterns,
|
|
4589
|
+
{ pattern: TASK_NUMBER_PATTERN, what: "a task number", group: 2 }
|
|
4590
|
+
];
|
|
4536
4591
|
for (const file of files) {
|
|
4537
|
-
const cls = classifyProseFile(file.path, readerFacingPrefix, readerFacingSuffix, shipsPrefix);
|
|
4592
|
+
const cls = classifyProseFile(file.path, readerFacingPrefix, readerFacingSuffix, shipsPrefix, specPaths);
|
|
4538
4593
|
if (!cls || cls === "internal")
|
|
4539
4594
|
continue;
|
|
4540
4595
|
if (cls !== "product" && cls !== "spec" && !SWEPT_CLASSES.has(cls))
|
|
@@ -4543,15 +4598,16 @@ function checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuff
|
|
|
4543
4598
|
continue;
|
|
4544
4599
|
const blocking = cls === "product" || cls === "spec";
|
|
4545
4600
|
const scrubbed = cls === "product" ? stripNonProseForProduct(file.path, file.content) : stripNonProse(file.path, file.content);
|
|
4546
|
-
const patternsToRun = cls === "product" ? productPatterns : patterns;
|
|
4601
|
+
const patternsToRun = cls === "product" ? productPatterns : cls === "spec" ? specPatterns : patterns;
|
|
4547
4602
|
for (const { pattern, what, group } of patternsToRun) {
|
|
4548
4603
|
pattern.lastIndex = 0;
|
|
4549
4604
|
let match = pattern.exec(scrubbed);
|
|
4550
4605
|
while (match !== null) {
|
|
4551
4606
|
const cited = group !== undefined ? match[group] ?? match[0] : match[0];
|
|
4607
|
+
const citedIndex = match.index + match[0].indexOf(cited);
|
|
4552
4608
|
findings.push({
|
|
4553
4609
|
file: file.path,
|
|
4554
|
-
line: lineAt(scrubbed,
|
|
4610
|
+
line: lineAt(scrubbed, citedIndex),
|
|
4555
4611
|
message: `references ${what} ("${cited}") a reader outside this repo's tracker cannot resolve`,
|
|
4556
4612
|
blocking
|
|
4557
4613
|
});
|
|
@@ -4737,9 +4793,9 @@ function checkSourceComments(files, allowlist = []) {
|
|
|
4737
4793
|
}
|
|
4738
4794
|
return findings;
|
|
4739
4795
|
}
|
|
4740
|
-
function checkReaderResolvableProse(files, glossaryTerms, readerFacingPrefix, readerFacingSuffix, legacySlugs = [], shipsPrefix = SHIPS_PREFIX, specGrandfather = []) {
|
|
4796
|
+
function checkReaderResolvableProse(files, glossaryTerms, readerFacingPrefix, readerFacingSuffix, legacySlugs = [], shipsPrefix = SHIPS_PREFIX, specGrandfather = [], specPaths = DEFAULT_SPEC_PATHS) {
|
|
4741
4797
|
return [
|
|
4742
|
-
...checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuffix, legacySlugs, shipsPrefix, specGrandfather),
|
|
4798
|
+
...checkUnresolvableReferences(files, readerFacingPrefix, readerFacingSuffix, legacySlugs, shipsPrefix, specGrandfather, specPaths),
|
|
4743
4799
|
...checkUndefinedVocabulary(files, glossaryTerms, readerFacingPrefix, readerFacingSuffix, shipsPrefix)
|
|
4744
4800
|
];
|
|
4745
4801
|
}
|
|
@@ -5180,15 +5236,32 @@ var ObservedSchema = z.object({
|
|
|
5180
5236
|
var TaskStatusInputSchema = z.object({
|
|
5181
5237
|
task: TaskToolRefSchema.optional()
|
|
5182
5238
|
}).merge(PageRequestSchema).strict();
|
|
5239
|
+
var TaskConfidenceSchema = z.object({
|
|
5240
|
+
round: z.number().int().positive(),
|
|
5241
|
+
percent: z.number().int().min(0).max(100).nullable(),
|
|
5242
|
+
source: z.enum(["stated", "published-summary"])
|
|
5243
|
+
}).strict();
|
|
5244
|
+
var TaskPhaseHistorySchema = z.object({
|
|
5245
|
+
typicalPhaseMinutes: z.number().nonnegative(),
|
|
5246
|
+
typicalPhaseSamples: z.number().int().positive()
|
|
5247
|
+
}).strict();
|
|
5183
5248
|
var TaskStatusItemSchema = z.object({
|
|
5184
5249
|
task: TaskToolRefSchema,
|
|
5185
5250
|
issue: z.number().int().positive(),
|
|
5186
5251
|
pr: z.number().int().positive().nullable(),
|
|
5187
|
-
state: z.string()
|
|
5252
|
+
state: z.string(),
|
|
5253
|
+
round: z.number().int().positive().nullable().optional(),
|
|
5254
|
+
phase: z.string().min(1).nullable().optional(),
|
|
5255
|
+
minutesInPhase: z.number().nonnegative().nullable().optional(),
|
|
5256
|
+
phaseIsCurrent: z.boolean().nullable().optional(),
|
|
5257
|
+
lastConfidence: TaskConfidenceSchema.nullable().optional(),
|
|
5258
|
+
lastConfidenceUnread: z.boolean().optional(),
|
|
5259
|
+
phaseHistory: TaskPhaseHistorySchema.nullable().optional()
|
|
5188
5260
|
}).merge(ObservedSchema);
|
|
5189
5261
|
var TaskStatusResultSchema = z.object({
|
|
5190
5262
|
items: z.array(TaskStatusItemSchema),
|
|
5191
|
-
nextCursor: z.string().nullable()
|
|
5263
|
+
nextCursor: z.string().nullable(),
|
|
5264
|
+
table: z.string()
|
|
5192
5265
|
});
|
|
5193
5266
|
var RequestedAuthoritySchema = z.enum(["planner", "principal", "operator", "self"]);
|
|
5194
5267
|
var EscalationInputsSchema = z.object({
|
|
@@ -5196,7 +5269,7 @@ var EscalationInputsSchema = z.object({
|
|
|
5196
5269
|
round: z.number().int().nonnegative(),
|
|
5197
5270
|
head: z.string(),
|
|
5198
5271
|
branch: z.string(),
|
|
5199
|
-
prNumber: z.number().int().positive()
|
|
5272
|
+
prNumber: z.number().int().positive().nullable()
|
|
5200
5273
|
});
|
|
5201
5274
|
var EscalationEvidenceSchema = z.object({
|
|
5202
5275
|
round: z.number().int().nonnegative(),
|
|
@@ -5232,13 +5305,45 @@ var TaskEscalationReadResultSchema = z.object({
|
|
|
5232
5305
|
items: z.array(TaskEscalationPacketSchema),
|
|
5233
5306
|
nextCursor: z.string().nullable()
|
|
5234
5307
|
}).merge(ObservedSchema);
|
|
5235
|
-
var
|
|
5236
|
-
|
|
5237
|
-
|
|
5308
|
+
var TaskPrCheckSchema = z.object({
|
|
5309
|
+
name: z.string(),
|
|
5310
|
+
required: z.boolean(),
|
|
5311
|
+
status: z.string(),
|
|
5312
|
+
conclusion: z.string().nullable(),
|
|
5313
|
+
detailsUrl: z.string().nullable(),
|
|
5314
|
+
failureSummary: z.string().nullable()
|
|
5315
|
+
});
|
|
5316
|
+
var TaskPrVerdictSchema = z.object({
|
|
5317
|
+
role: z.enum(["code-review", "security"]),
|
|
5318
|
+
value: z.string(),
|
|
5319
|
+
judgedHead: z.string().nullable(),
|
|
5320
|
+
objectivesVersion: z.string().nullable()
|
|
5321
|
+
});
|
|
5322
|
+
var TaskPrPauseSchema = z.object({
|
|
5323
|
+
reason: z.string(),
|
|
5324
|
+
body: z.string()
|
|
5325
|
+
});
|
|
5326
|
+
var TaskPrReviewRecordSchema = z.object({
|
|
5327
|
+
verdicts: z.array(TaskPrVerdictSchema),
|
|
5328
|
+
roundMarkers: z.array(z.number().int().nonnegative()),
|
|
5329
|
+
summaryTable: z.string().nullable(),
|
|
5330
|
+
pause: TaskPrPauseSchema.nullable()
|
|
5331
|
+
});
|
|
5332
|
+
var TaskPrReadInputSchema = z.object({
|
|
5333
|
+
task: TaskToolRefSchema,
|
|
5334
|
+
pr: z.number().int().positive().optional()
|
|
5238
5335
|
}).strict();
|
|
5336
|
+
var TaskPrReadResultSchema = z.object({
|
|
5337
|
+
task: TaskToolRefSchema,
|
|
5338
|
+
issue: z.number().int().positive(),
|
|
5339
|
+
pr: z.number().int().positive(),
|
|
5340
|
+
head: z.string().nullable(),
|
|
5341
|
+
checks: z.array(TaskPrCheckSchema),
|
|
5342
|
+
review: TaskPrReviewRecordSchema
|
|
5343
|
+
}).merge(ObservedSchema);
|
|
5239
5344
|
var TaskStartResultSchema = z.object({
|
|
5240
5345
|
requestId: z.string().min(1),
|
|
5241
|
-
run:
|
|
5346
|
+
run: TaskToolRefSchema,
|
|
5242
5347
|
started: z.boolean(),
|
|
5243
5348
|
startedAt: z.string(),
|
|
5244
5349
|
mode: z.literal("attended")
|
|
@@ -5252,7 +5357,7 @@ var TaskCancelInputSchema = z.object({
|
|
|
5252
5357
|
}).strict();
|
|
5253
5358
|
var TaskResumeResultSchema = z.object({
|
|
5254
5359
|
task: z.number().int().positive(),
|
|
5255
|
-
pr: z.number().int().positive(),
|
|
5360
|
+
pr: z.number().int().positive().nullable(),
|
|
5256
5361
|
escalationId: z.string().min(1),
|
|
5257
5362
|
outcome: z.enum(["started", "already_resumed"]),
|
|
5258
5363
|
authenticatedBy: z.string().min(1),
|
|
@@ -5261,7 +5366,7 @@ var TaskResumeResultSchema = z.object({
|
|
|
5261
5366
|
var TaskCancelOutcomeSchema = z.enum(["confirmed", "pending", "uncertain"]);
|
|
5262
5367
|
var TaskCancelResultSchema = z.object({
|
|
5263
5368
|
task: z.number().int().positive(),
|
|
5264
|
-
pr: z.number().int().positive(),
|
|
5369
|
+
pr: z.number().int().positive().nullable(),
|
|
5265
5370
|
escalationId: z.string().min(1),
|
|
5266
5371
|
outcome: TaskCancelOutcomeSchema,
|
|
5267
5372
|
authenticatedBy: z.string().min(1),
|
|
@@ -5272,6 +5377,7 @@ var TASK_TOOL_NAMES = [
|
|
|
5272
5377
|
"task_start",
|
|
5273
5378
|
"task_status",
|
|
5274
5379
|
"task_escalation_read",
|
|
5380
|
+
"task_pr_read",
|
|
5275
5381
|
"task_resume",
|
|
5276
5382
|
"task_cancel"
|
|
5277
5383
|
];
|
|
@@ -5499,6 +5605,14 @@ function findWorkspaceEscapes(files, knownPaths, workspaceDirs = DEFAULT_WORKSPA
|
|
|
5499
5605
|
}
|
|
5500
5606
|
return findings;
|
|
5501
5607
|
}
|
|
5608
|
+
// ../../packages/aeg-core/src/gate-cutovers.ts
|
|
5609
|
+
var NO_GATE_CUTOVERS = {
|
|
5610
|
+
objectivesSinceIssue: null,
|
|
5611
|
+
briefSectionsSinceIssue: null,
|
|
5612
|
+
documentationSinceIssue: null,
|
|
5613
|
+
briefRulesSincePr: null,
|
|
5614
|
+
agentBoxesRefusedSincePr: null
|
|
5615
|
+
};
|
|
5502
5616
|
// ../../packages/aeg-core/src/dev-review-loop/types.ts
|
|
5503
5617
|
var SEVERITY_COLUMNS = ["blocker", "major", "minor", "critical", "high", "medium", "low"];
|
|
5504
5618
|
// ../../packages/aeg-core/src/dev-review-loop/journal-reconstruction.ts
|
|
@@ -5948,6 +6062,8 @@ function attemptFromEnv(value) {
|
|
|
5948
6062
|
function provenanceFor(input) {
|
|
5949
6063
|
if (input.provenance)
|
|
5950
6064
|
return input.provenance;
|
|
6065
|
+
if (issueFromTask(input.env.task) === null && (input.branchIssue ?? null) !== null)
|
|
6066
|
+
return "unavailable";
|
|
5951
6067
|
if (input.env.role || input.env.task)
|
|
5952
6068
|
return "env_correlated";
|
|
5953
6069
|
return "unavailable";
|
|
@@ -5968,7 +6084,7 @@ function buildHeader(input) {
|
|
|
5968
6084
|
const role = isRole(input.env.role) ? input.env.role : "unattributed";
|
|
5969
6085
|
const round = roundFromEnv(input.env.round);
|
|
5970
6086
|
const subject = {
|
|
5971
|
-
issue: issueFromTask(input.env.task),
|
|
6087
|
+
issue: issueFromTask(input.env.task) ?? input.branchIssue ?? null,
|
|
5972
6088
|
role,
|
|
5973
6089
|
...round !== undefined ? { round } : {},
|
|
5974
6090
|
...input.subject ?? {}
|
|
@@ -6255,6 +6371,9 @@ function emitCheckError(error) {
|
|
|
6255
6371
|
`);
|
|
6256
6372
|
}
|
|
6257
6373
|
|
|
6374
|
+
// src/lib/review-gate-input.ts
|
|
6375
|
+
import { execFileSync as execFileSync4 } from "node:child_process";
|
|
6376
|
+
|
|
6258
6377
|
// src/lib/config.ts
|
|
6259
6378
|
import { execFile as execFile4, execFileSync as execFileSync2 } from "node:child_process";
|
|
6260
6379
|
import { promisify as promisify4 } from "node:util";
|
|
@@ -6415,7 +6534,12 @@ var VinayaConfigSchema = z4.object({
|
|
|
6415
6534
|
allowlist: z4.array(z4.string().min(1)).optional(),
|
|
6416
6535
|
severity: z4.enum(["warning", "error"]).optional()
|
|
6417
6536
|
}).optional(),
|
|
6418
|
-
specGrandfather: z4.array(z4.string().min(1)).optional()
|
|
6537
|
+
specGrandfather: z4.array(z4.string().min(1)).optional(),
|
|
6538
|
+
specPaths: z4.array(z4.string().min(1).refine((entry) => !entry.startsWith("/") && !/^[A-Za-z]:/.test(entry), {
|
|
6539
|
+
message: "must be a repository-relative path, not an absolute one"
|
|
6540
|
+
}).refine((entry) => !entry.split(/[\\/]/).includes(".."), {
|
|
6541
|
+
message: "must stay inside the repository — no `..` segment"
|
|
6542
|
+
})).optional()
|
|
6419
6543
|
}).optional(),
|
|
6420
6544
|
projects: z4.array(ProjectEntrySchema).optional(),
|
|
6421
6545
|
dispatch: z4.object({
|
|
@@ -6429,6 +6553,13 @@ var VinayaConfigSchema = z4.object({
|
|
|
6429
6553
|
securityThreshold: z4.string().min(1).optional(),
|
|
6430
6554
|
maxRounds: z4.number().optional()
|
|
6431
6555
|
}).optional(),
|
|
6556
|
+
gateCutovers: z4.object({
|
|
6557
|
+
objectivesSinceIssue: z4.number().int().nonnegative().optional(),
|
|
6558
|
+
briefSectionsSinceIssue: z4.number().int().nonnegative().optional(),
|
|
6559
|
+
documentationSinceIssue: z4.number().int().nonnegative().optional(),
|
|
6560
|
+
briefRulesSincePr: z4.number().int().nonnegative().optional(),
|
|
6561
|
+
agentBoxesRefusedSincePr: z4.number().int().nonnegative().optional()
|
|
6562
|
+
}).optional(),
|
|
6432
6563
|
prePush: z4.object({
|
|
6433
6564
|
alwaysRun: z4.array(z4.string()).optional()
|
|
6434
6565
|
}).optional(),
|
|
@@ -6566,6 +6697,18 @@ function resolveReviewPolicy(config) {
|
|
|
6566
6697
|
maxRounds
|
|
6567
6698
|
};
|
|
6568
6699
|
}
|
|
6700
|
+
function resolveGateCutovers(config) {
|
|
6701
|
+
const raw = config?.gateCutovers;
|
|
6702
|
+
if (!raw)
|
|
6703
|
+
return NO_GATE_CUTOVERS;
|
|
6704
|
+
return {
|
|
6705
|
+
objectivesSinceIssue: raw.objectivesSinceIssue ?? null,
|
|
6706
|
+
briefSectionsSinceIssue: raw.briefSectionsSinceIssue ?? null,
|
|
6707
|
+
documentationSinceIssue: raw.documentationSinceIssue ?? null,
|
|
6708
|
+
briefRulesSincePr: raw.briefRulesSincePr ?? null,
|
|
6709
|
+
agentBoxesRefusedSincePr: raw.agentBoxesRefusedSincePr ?? null
|
|
6710
|
+
};
|
|
6711
|
+
}
|
|
6569
6712
|
function resolveRuntimeDirSetting(config) {
|
|
6570
6713
|
return config?.runtimeDir ?? null;
|
|
6571
6714
|
}
|
|
@@ -6640,7 +6783,28 @@ function trustAnchorRepoFromRemoteUrl(url) {
|
|
|
6640
6783
|
return m?.[1] && m[2] ? wellFormedRepoSlug(`${m[1]}/${m[2]}`) : null;
|
|
6641
6784
|
}
|
|
6642
6785
|
var execFileAsync4 = promisify4(execFile4);
|
|
6786
|
+
function resolveCiTrustAnchorProbeRef(env = process.env) {
|
|
6787
|
+
const ref = env.VINAYA_CI_CONFIG_PROBE_REF?.trim();
|
|
6788
|
+
if (!ref)
|
|
6789
|
+
return null;
|
|
6790
|
+
if (env.GITHUB_ACTIONS !== "true")
|
|
6791
|
+
return null;
|
|
6792
|
+
if ((env.GH_TOKEN ?? "").length > 0 || (env.GITHUB_TOKEN ?? "").length > 0)
|
|
6793
|
+
return null;
|
|
6794
|
+
return ref;
|
|
6795
|
+
}
|
|
6796
|
+
function readTrustAnchorConfigAtRef(ref) {
|
|
6797
|
+
const raw = execFileSync2("git", ["show", `${ref}:${LOCAL_CONFIG_FILENAME}`], {
|
|
6798
|
+
encoding: "utf-8",
|
|
6799
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
6800
|
+
timeout: 1e4
|
|
6801
|
+
});
|
|
6802
|
+
return Buffer.from(raw, "utf-8").toString("base64");
|
|
6803
|
+
}
|
|
6643
6804
|
function ghFetchTrustAnchorConfig() {
|
|
6805
|
+
const probeRef = resolveCiTrustAnchorProbeRef();
|
|
6806
|
+
if (probeRef)
|
|
6807
|
+
return readTrustAnchorConfigAtRef(probeRef);
|
|
6644
6808
|
const repo = trustAnchorRepo();
|
|
6645
6809
|
if (!repo)
|
|
6646
6810
|
throw new Error("could not resolve repo identity for the trust-anchor read");
|
|
@@ -6650,6 +6814,14 @@ function ghFetchTrustAnchorConfig() {
|
|
|
6650
6814
|
});
|
|
6651
6815
|
}
|
|
6652
6816
|
async function ghFetchTrustAnchorConfigAsync() {
|
|
6817
|
+
const probeRef = resolveCiTrustAnchorProbeRef();
|
|
6818
|
+
if (probeRef) {
|
|
6819
|
+
const { stdout } = await execFileAsync4("git", ["show", `${probeRef}:${LOCAL_CONFIG_FILENAME}`], {
|
|
6820
|
+
encoding: "utf-8",
|
|
6821
|
+
timeout: 1e4
|
|
6822
|
+
});
|
|
6823
|
+
return Buffer.from(stdout, "utf-8").toString("base64");
|
|
6824
|
+
}
|
|
6653
6825
|
const repo = await trustAnchorRepoAsync();
|
|
6654
6826
|
if (!repo)
|
|
6655
6827
|
throw new Error("could not resolve repo identity for the trust-anchor read");
|
|
@@ -6752,8 +6924,10 @@ function patchIdAt(base, sha) {
|
|
|
6752
6924
|
}
|
|
6753
6925
|
}
|
|
6754
6926
|
|
|
6755
|
-
// src/
|
|
6756
|
-
|
|
6927
|
+
// src/lib/review-gate-input.ts
|
|
6928
|
+
function failure(message, agentRecoveryPrompt) {
|
|
6929
|
+
return { ok: false, failure: { message, agentRecoveryPrompt } };
|
|
6930
|
+
}
|
|
6757
6931
|
function fetchPr(prNumber) {
|
|
6758
6932
|
try {
|
|
6759
6933
|
const out = execFileSync4("gh", ["pr", "view", String(prNumber), "--json", "number,comments,labels,headRefName,headRefOid,baseRefName,body"], {
|
|
@@ -6782,87 +6956,45 @@ function fetchIssueCommentsForBrief(issueNumber) {
|
|
|
6782
6956
|
function resolveBriefHash(pr, principalAllowlist) {
|
|
6783
6957
|
const { issue } = extractIssue(pr.body);
|
|
6784
6958
|
if (issue === null)
|
|
6785
|
-
return null;
|
|
6959
|
+
return { ok: true, value: null };
|
|
6786
6960
|
let comments;
|
|
6787
6961
|
try {
|
|
6788
6962
|
comments = fetchIssueCommentsForBrief(issue);
|
|
6789
6963
|
} catch (err) {
|
|
6790
6964
|
if (isIssueNotFoundError(err)) {
|
|
6791
|
-
|
|
6792
|
-
schema: CHECK_SCHEMA_VERSION,
|
|
6793
|
-
check: CHECK_NAME,
|
|
6794
|
-
severity: "error",
|
|
6795
|
-
message: `review-gate severity:infra — Issue #${issue} does not resolve via \`gh issue view\` — cannot verify the brief-hash binding for a PR whose linked Issue no longer exists.`,
|
|
6796
|
-
agent_recovery_prompt: `Restore Issue #${issue}, fix \`Closes #N\` to name a real Issue, or have a principal apply the \`vinaya/waiver:review\` label, then re-run \`vinaya check review-gate\`.`
|
|
6797
|
-
});
|
|
6798
|
-
process.exit(1);
|
|
6965
|
+
return failure(`review-gate severity:infra — Issue #${issue} does not resolve via \`gh issue view\` — cannot verify the brief-hash binding for a PR whose linked Issue no longer exists.`, `Restore Issue #${issue}, fix \`Closes #N\` to name a real Issue, or have a principal apply the \`vinaya/waiver:review\` label, then re-run \`vinaya check review-gate\`.`);
|
|
6799
6966
|
}
|
|
6800
|
-
|
|
6801
|
-
schema: CHECK_SCHEMA_VERSION,
|
|
6802
|
-
check: CHECK_NAME,
|
|
6803
|
-
severity: "error",
|
|
6804
|
-
message: `review-gate severity:infra — could not fetch Issue #${issue}'s comments via \`gh issue view\` to resolve its frozen-brief hash: ${err.message}`,
|
|
6805
|
-
agent_recovery_prompt: "Confirm `gh auth status` passes and the Issue number is correct, then re-run `vinaya check review-gate`."
|
|
6806
|
-
});
|
|
6807
|
-
process.exit(1);
|
|
6967
|
+
return failure(`review-gate severity:infra — could not fetch Issue #${issue}'s comments via \`gh issue view\` to resolve its frozen-brief hash: ${err.message}`, "Confirm `gh auth status` passes and the Issue number is correct, then re-run `vinaya check review-gate`.");
|
|
6808
6968
|
}
|
|
6809
6969
|
const frozen = resolveNewestFrozenBrief(comments, principalAllowlist);
|
|
6810
|
-
return frozen ? briefHash(frozen.content) : null;
|
|
6970
|
+
return { ok: true, value: frozen ? briefHash(frozen.content) : null };
|
|
6811
6971
|
}
|
|
6812
|
-
function resolveObjectivesVersion(pr) {
|
|
6972
|
+
function resolveObjectivesVersion(pr, objectivesSinceIssue) {
|
|
6813
6973
|
const { issue } = extractIssue(pr.body);
|
|
6814
|
-
const source = resolveObjectivesSource(pr.body, issue,
|
|
6974
|
+
const source = resolveObjectivesSource(pr.body, issue, objectivesSinceIssue);
|
|
6815
6975
|
if (source.kind === "none")
|
|
6816
|
-
return null;
|
|
6976
|
+
return { ok: true, value: null };
|
|
6817
6977
|
if (source.kind === "issue") {
|
|
6818
6978
|
let issueBody;
|
|
6819
6979
|
try {
|
|
6820
6980
|
issueBody = fetchIssueBodyForObjectives(source.issue);
|
|
6821
6981
|
} catch (err) {
|
|
6822
6982
|
if (isIssueNotFoundError(err)) {
|
|
6823
|
-
|
|
6824
|
-
schema: CHECK_SCHEMA_VERSION,
|
|
6825
|
-
check: CHECK_NAME,
|
|
6826
|
-
severity: "error",
|
|
6827
|
-
message: `review-gate severity:infra — Issue #${source.issue} does not resolve via \`gh issue view\` — cannot verify the objectives-version binding for a PR whose linked Issue is at/above the objectives cutover.`,
|
|
6828
|
-
agent_recovery_prompt: `Restore Issue #${source.issue}, fix \`Closes #N\` to name a real Issue, or have a principal apply the \`vinaya/waiver:review\` label, then re-run \`vinaya check review-gate\`.`
|
|
6829
|
-
});
|
|
6830
|
-
process.exit(1);
|
|
6983
|
+
return failure(`review-gate severity:infra — Issue #${source.issue} does not resolve via \`gh issue view\` — cannot verify the objectives-version binding for a PR whose linked Issue is at/above the objectives cutover.`, `Restore Issue #${source.issue}, fix \`Closes #N\` to name a real Issue, or have a principal apply the \`vinaya/waiver:review\` label, then re-run \`vinaya check review-gate\`.`);
|
|
6831
6984
|
}
|
|
6832
|
-
|
|
6833
|
-
schema: CHECK_SCHEMA_VERSION,
|
|
6834
|
-
check: CHECK_NAME,
|
|
6835
|
-
severity: "error",
|
|
6836
|
-
message: `review-gate severity:infra — could not fetch Issue #${source.issue}'s body via \`gh issue view\` to resolve its objectives version: ${err.message}`,
|
|
6837
|
-
agent_recovery_prompt: "Confirm `gh auth status` passes and the Issue number is correct, then re-run `vinaya check review-gate`."
|
|
6838
|
-
});
|
|
6839
|
-
process.exit(1);
|
|
6985
|
+
return failure(`review-gate severity:infra — could not fetch Issue #${source.issue}'s body via \`gh issue view\` to resolve its objectives version: ${err.message}`, "Confirm `gh auth status` passes and the Issue number is correct, then re-run `vinaya check review-gate`.");
|
|
6840
6986
|
}
|
|
6841
6987
|
const parsed = objectivesOf(issueBody);
|
|
6842
6988
|
if (!parsed.ok) {
|
|
6843
|
-
|
|
6844
|
-
schema: CHECK_SCHEMA_VERSION,
|
|
6845
|
-
check: CHECK_NAME,
|
|
6846
|
-
severity: "error",
|
|
6847
|
-
message: `review-gate severity:infra — Issue #${source.issue}'s \`## Objectives\` section does not parse (${parsed.errors.join("; ")}) — cannot verify the objectives-version binding.`,
|
|
6848
|
-
agent_recovery_prompt: `Fix Issue #${source.issue}'s \`## Objectives\` section, or have a principal apply the \`vinaya/waiver:review\` label, then re-run \`vinaya check review-gate\`.`
|
|
6849
|
-
});
|
|
6850
|
-
process.exit(1);
|
|
6989
|
+
return failure(`review-gate severity:infra — Issue #${source.issue}'s \`## Objectives\` section does not parse (${parsed.errors.join("; ")}) — cannot verify the objectives-version binding.`, `Fix Issue #${source.issue}'s \`## Objectives\` section, or have a principal apply the \`vinaya/waiver:review\` label, then re-run \`vinaya check review-gate\`.`);
|
|
6851
6990
|
}
|
|
6852
|
-
return objectivesVersion(parsed.objectives);
|
|
6991
|
+
return { ok: true, value: objectivesVersion(parsed.objectives) };
|
|
6853
6992
|
}
|
|
6854
6993
|
const own = objectivesOf(pr.body);
|
|
6855
6994
|
if (!own.ok) {
|
|
6856
|
-
|
|
6857
|
-
schema: CHECK_SCHEMA_VERSION,
|
|
6858
|
-
check: CHECK_NAME,
|
|
6859
|
-
severity: "error",
|
|
6860
|
-
message: `review-gate severity:infra — this PR body's own \`## Objectives\` section does not parse (${own.errors.join("; ")}) — cannot verify the objectives-version binding.`,
|
|
6861
|
-
agent_recovery_prompt: "Fix the PR body's `## Objectives` section, or have a principal apply the `vinaya/waiver:review` label, then re-run `vinaya check review-gate`."
|
|
6862
|
-
});
|
|
6863
|
-
process.exit(1);
|
|
6995
|
+
return failure(`review-gate severity:infra — this PR body's own \`## Objectives\` section does not parse (${own.errors.join("; ")}) — cannot verify the objectives-version binding.`, "Fix the PR body's `## Objectives` section, or have a principal apply the `vinaya/waiver:review` label, then re-run `vinaya check review-gate`.");
|
|
6864
6996
|
}
|
|
6865
|
-
return objectivesVersion(own.objectives);
|
|
6997
|
+
return { ok: true, value: objectivesVersion(own.objectives) };
|
|
6866
6998
|
}
|
|
6867
6999
|
function shaFromLsRemote(branch) {
|
|
6868
7000
|
try {
|
|
@@ -6912,46 +7044,20 @@ function fetchWaiverLabelActor(prNumber, label) {
|
|
|
6912
7044
|
return null;
|
|
6913
7045
|
}
|
|
6914
7046
|
}
|
|
6915
|
-
function
|
|
6916
|
-
const prNumberStr = process.env.PR_NUMBER;
|
|
6917
|
-
if (!prNumberStr) {
|
|
6918
|
-
process.exit(0);
|
|
6919
|
-
}
|
|
6920
|
-
const prNumber = Number(prNumberStr);
|
|
7047
|
+
function assembleReviewGateInput(prNumber) {
|
|
6921
7048
|
const pr = fetchPr(prNumber);
|
|
6922
7049
|
if (!pr) {
|
|
6923
|
-
|
|
6924
|
-
schema: CHECK_SCHEMA_VERSION,
|
|
6925
|
-
check: CHECK_NAME,
|
|
6926
|
-
severity: "error",
|
|
6927
|
-
message: `review-gate severity:infra — could not fetch PR #${prNumber} via \`gh\`.`,
|
|
6928
|
-
agent_recovery_prompt: "Confirm `gh auth status` passes and PR_NUMBER is correct, then re-run `vinaya check review-gate`."
|
|
6929
|
-
});
|
|
6930
|
-
process.exit(1);
|
|
7050
|
+
return failure(`review-gate severity:infra — could not fetch PR #${prNumber} via \`gh\`.`, "Confirm `gh auth status` passes and PR_NUMBER is correct, then re-run `vinaya check review-gate`.");
|
|
6931
7051
|
}
|
|
6932
7052
|
const labels = pr.labels.map((l) => l.name);
|
|
6933
7053
|
const waiverLabelActor = labels.includes(WAIVER_LABEL_REVIEW) ? fetchWaiverLabelActor(prNumber, WAIVER_LABEL_REVIEW) : null;
|
|
6934
7054
|
const headSha = resolveTrueHeadSha(pr);
|
|
6935
7055
|
if (!headSha) {
|
|
6936
|
-
|
|
6937
|
-
schema: CHECK_SCHEMA_VERSION,
|
|
6938
|
-
check: CHECK_NAME,
|
|
6939
|
-
severity: "error",
|
|
6940
|
-
message: `review-gate severity:infra — could not resolve PR #${prNumber}'s true head via \`git ls-remote\` or the forge's \`git/ref/heads\` API.`,
|
|
6941
|
-
agent_recovery_prompt: "Confirm the branch still exists on origin and `gh auth status` passes, then re-run `vinaya check review-gate`."
|
|
6942
|
-
});
|
|
6943
|
-
process.exit(1);
|
|
7056
|
+
return failure(`review-gate severity:infra — could not resolve PR #${prNumber}'s true head via \`git ls-remote\` or the forge's \`git/ref/heads\` API.`, "Confirm the branch still exists on origin and `gh auth status` passes, then re-run `vinaya check review-gate`.");
|
|
6944
7057
|
}
|
|
6945
7058
|
const baseSha = resolveBaseSha(pr);
|
|
6946
7059
|
if (!baseSha) {
|
|
6947
|
-
|
|
6948
|
-
schema: CHECK_SCHEMA_VERSION,
|
|
6949
|
-
check: CHECK_NAME,
|
|
6950
|
-
severity: "error",
|
|
6951
|
-
message: `review-gate severity:infra — could not resolve PR #${prNumber}'s base branch \`${pr.baseRefName}\`'s tip via \`git ls-remote\` or the forge's \`git/ref/heads\` API.`,
|
|
6952
|
-
agent_recovery_prompt: "Confirm the base branch still exists on origin and `gh auth status` passes, then re-run `vinaya check review-gate`."
|
|
6953
|
-
});
|
|
6954
|
-
process.exit(1);
|
|
7060
|
+
return failure(`review-gate severity:infra — could not resolve PR #${prNumber}'s base branch \`${pr.baseRefName}\`'s tip via \`git ls-remote\` or the forge's \`git/ref/heads\` API.`, "Confirm the base branch still exists on origin and `gh auth status` passes, then re-run `vinaya check review-gate`.");
|
|
6955
7061
|
}
|
|
6956
7062
|
const trustAnchorConfig = loadTrustAnchorConfig();
|
|
6957
7063
|
const principalAllowlist = resolvePrincipalAllowlist(trustAnchorConfig);
|
|
@@ -6959,14 +7065,7 @@ function main() {
|
|
|
6959
7065
|
try {
|
|
6960
7066
|
reviewPolicy = resolveReviewPolicy(trustAnchorConfig);
|
|
6961
7067
|
} catch (err) {
|
|
6962
|
-
|
|
6963
|
-
schema: CHECK_SCHEMA_VERSION,
|
|
6964
|
-
check: CHECK_NAME,
|
|
6965
|
-
severity: "error",
|
|
6966
|
-
message: `review-gate severity:infra — ${err instanceof Error ? err.message : String(err)}`,
|
|
6967
|
-
agent_recovery_prompt: "Fix `reviewPolicy` in the default branch's `vinaya.config.json` to a known severity on each role's own scale, then re-run `vinaya check review-gate`."
|
|
6968
|
-
});
|
|
6969
|
-
process.exit(1);
|
|
7068
|
+
return failure(`review-gate severity:infra — ${err instanceof Error ? err.message : String(err)}`, "Fix `reviewPolicy` in the default branch's `vinaya.config.json` to a known severity on each role's own scale, then re-run `vinaya check review-gate`.");
|
|
6970
7069
|
}
|
|
6971
7070
|
const waived = isWaiverLabelActorVerified({
|
|
6972
7071
|
label: WAIVER_LABEL_REVIEW,
|
|
@@ -6974,19 +7073,52 @@ function main() {
|
|
|
6974
7073
|
labelActor: waiverLabelActor,
|
|
6975
7074
|
principalAllowlist
|
|
6976
7075
|
});
|
|
6977
|
-
const
|
|
6978
|
-
|
|
6979
|
-
|
|
6980
|
-
|
|
6981
|
-
|
|
6982
|
-
|
|
6983
|
-
|
|
6984
|
-
|
|
6985
|
-
|
|
6986
|
-
|
|
6987
|
-
|
|
6988
|
-
|
|
6989
|
-
|
|
7076
|
+
const comments = pr.comments.map((c) => ({ body: c.body, author: c.author?.login ?? null }));
|
|
7077
|
+
const { objectivesSinceIssue } = resolveGateCutovers(trustAnchorConfig);
|
|
7078
|
+
const resolvedObjectivesVersion = waived ? { ok: true, value: null } : resolveObjectivesVersion(pr, objectivesSinceIssue);
|
|
7079
|
+
if (!resolvedObjectivesVersion.ok)
|
|
7080
|
+
return resolvedObjectivesVersion;
|
|
7081
|
+
const resolvedBriefHash = waived ? { ok: true, value: null } : resolveBriefHash(pr, principalAllowlist);
|
|
7082
|
+
if (!resolvedBriefHash.ok)
|
|
7083
|
+
return resolvedBriefHash;
|
|
7084
|
+
return {
|
|
7085
|
+
ok: true,
|
|
7086
|
+
input: {
|
|
7087
|
+
comments,
|
|
7088
|
+
labels,
|
|
7089
|
+
waiverLabelActor,
|
|
7090
|
+
principalAllowlist,
|
|
7091
|
+
headSha,
|
|
7092
|
+
patchIdOf: (sha) => patchIdAt(pr.baseRefName, sha),
|
|
7093
|
+
baseSha,
|
|
7094
|
+
objectivesVersion: resolvedObjectivesVersion.value,
|
|
7095
|
+
rulingOrdinal: newestPrincipalRulingOrdinal(comments, principalAllowlist),
|
|
7096
|
+
policy: reviewPolicy,
|
|
7097
|
+
briefHash: resolvedBriefHash.value
|
|
7098
|
+
}
|
|
7099
|
+
};
|
|
7100
|
+
}
|
|
7101
|
+
|
|
7102
|
+
// src/checks/bin/check-review-gate.ts
|
|
7103
|
+
var CHECK_NAME = "review-gate";
|
|
7104
|
+
function main() {
|
|
7105
|
+
const prNumberStr = process.env.PR_NUMBER;
|
|
7106
|
+
if (!prNumberStr) {
|
|
7107
|
+
process.exit(0);
|
|
7108
|
+
}
|
|
7109
|
+
const prNumber = Number(prNumberStr);
|
|
7110
|
+
const assembly = assembleReviewGateInput(prNumber);
|
|
7111
|
+
if (!assembly.ok) {
|
|
7112
|
+
emitCheckError({
|
|
7113
|
+
schema: CHECK_SCHEMA_VERSION,
|
|
7114
|
+
check: CHECK_NAME,
|
|
7115
|
+
severity: "error",
|
|
7116
|
+
message: assembly.failure.message,
|
|
7117
|
+
agent_recovery_prompt: assembly.failure.agentRecoveryPrompt
|
|
7118
|
+
});
|
|
7119
|
+
process.exit(1);
|
|
7120
|
+
}
|
|
7121
|
+
const result = checkReviewGate(assembly.input);
|
|
6990
7122
|
if (result.verdict === "fail") {
|
|
6991
7123
|
emitCheckError({
|
|
6992
7124
|
schema: CHECK_SCHEMA_VERSION,
|