@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,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Required pre-merge review gate
|
|
2
|
+
* Required pre-merge review gate. Blocks a
|
|
3
3
|
* PR from merging unless a clean code-reviewer `APPROVE` verdict
|
|
4
4
|
* AND a clean security-review `PASS` verdict both exist on the PR — the same
|
|
5
5
|
* `extractCodeReviewVerdict`/`extractSecurityReviewVerdict` detection
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* now gated pre-merge and blocking instead of post-merge and advisory-only.
|
|
8
8
|
*
|
|
9
9
|
* Verdict comments are ONLY counted when their author is on the same
|
|
10
|
-
* `PRINCIPAL_ALLOWLIST` the waiver actor-check trusts (security finding
|
|
11
|
-
*
|
|
10
|
+
* `PRINCIPAL_ALLOWLIST` the waiver actor-check trusts (a security finding):
|
|
11
|
+
* body-shape alone is never sufficient on a public repo. Unverified
|
|
12
12
|
* comments are ignored, not fatal.
|
|
13
13
|
*
|
|
14
14
|
* A verified `vinaya/waiver:review` label (the exact actor-verification pattern,
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* one PR. Label presence alone is never sufficient — only an actor-verified
|
|
18
18
|
* label waives the gate, mirroring exactly.
|
|
19
19
|
*
|
|
20
|
-
* Reviewed-commit binding
|
|
20
|
+
* Reviewed-commit binding. A clean
|
|
21
21
|
* verdict is no longer sufficient on its own — it must also cover the PR's
|
|
22
22
|
* CURRENT head. Design record (the four questions this fix had to answer,
|
|
23
23
|
* argued in full in the closing PR's body):
|
|
@@ -51,6 +51,23 @@
|
|
|
51
51
|
* `vinaya/waiver:review` actor-verified label, applied by a principal, the
|
|
52
52
|
* same mechanism that already exists for any other one-off skip.
|
|
53
53
|
*
|
|
54
|
+
* Ruling-freshness binding. A
|
|
55
|
+
* verdict is also bound to the newest PRINCIPAL RULING on the PR at cast
|
|
56
|
+
* time, the same shape as the objectives-version binding above but with
|
|
57
|
+
* `0` (never `null`) standing in for "nothing to bind against yet" — a
|
|
58
|
+
* ruling's existence on a PR is never ambiguous the way an Issue's
|
|
59
|
+
* objectives-cutover status is, so there is no "skip this binding" input
|
|
60
|
+
* value here. `input.rulingOrdinal` is the caller-resolved newest ordinal
|
|
61
|
+
* (`isBoundToRulings`, below); a verdict cast against an older ordinal, or
|
|
62
|
+
* carrying no `Ruling ordinal:` line at all on a PR that now has one,
|
|
63
|
+
* reads as unbound — a ruling posted after approval turns a previously
|
|
64
|
+
* clean gate red until reviewers re-cast against it.
|
|
65
|
+
*
|
|
66
|
+
* This gate answers one question — are the required review verdicts present,
|
|
67
|
+
* clean, and bound to what is being merged — and nothing else. It reads no
|
|
68
|
+
* other check's result and no Test Plan tick-state; each of those is its own
|
|
69
|
+
* check, owned elsewhere.
|
|
70
|
+
*
|
|
54
71
|
* Pure — no `fs`, no `fetch`, no `process.env`. The CLI shim
|
|
55
72
|
* (`bin/verify-review-gate.ts`) resolves the PR's comments/labels/label-actor/
|
|
56
73
|
* head sha via `gh` and calls `checkReviewGate`.
|
|
@@ -58,6 +75,19 @@
|
|
|
58
75
|
|
|
59
76
|
import { isPrincipal, isWaiverLabelActorVerified, PRINCIPAL_ALLOWLIST, WAIVER_LABEL_REVIEW } from './waiver-label'
|
|
60
77
|
import { extractCodeReviewVerdict, extractSecurityReviewVerdict } from './verdict-extraction'
|
|
78
|
+
import {
|
|
79
|
+
consequentialFindings,
|
|
80
|
+
DEFAULT_REVIEW_POLICY,
|
|
81
|
+
evaluateCodeReview,
|
|
82
|
+
evaluateSecurityReview,
|
|
83
|
+
type ReviewPolicy
|
|
84
|
+
} from './review-policy'
|
|
85
|
+
import {
|
|
86
|
+
compareManifest,
|
|
87
|
+
policyDigest as computePolicyDigest,
|
|
88
|
+
type EchoedManifest,
|
|
89
|
+
type ReviewInputManifest
|
|
90
|
+
} from './review-input-manifest'
|
|
61
91
|
|
|
62
92
|
export type ReviewGateVerdict = 'pass' | 'fail'
|
|
63
93
|
|
|
@@ -73,13 +103,6 @@ export type ReviewGateComment = {
|
|
|
73
103
|
author: string | null
|
|
74
104
|
}
|
|
75
105
|
|
|
76
|
-
export type MechanicalCheckStatus = {
|
|
77
|
-
/** The check-run's display name, as GitHub reports it (`gh pr checks`' own `name` field). */
|
|
78
|
-
name: string
|
|
79
|
-
/** GitHub's own coalesced status vocabulary for this check-run — forwarded verbatim from `gh pr checks --json name,bucket`'s `bucket` field (e.g. "pass", "fail", "pending", "skipping", "cancel"). Not re-mapped to a smaller enum here — that would be a second copy of a vocabulary `gh` already owns. */
|
|
80
|
-
bucket: string
|
|
81
|
-
}
|
|
82
|
-
|
|
83
106
|
export type ReviewGateInput = {
|
|
84
107
|
/** Every comment on the PR, with its author. */
|
|
85
108
|
comments: ReviewGateComment[]
|
|
@@ -91,22 +114,13 @@ export type ReviewGateInput = {
|
|
|
91
114
|
* The PR's current head commit sha (`gh pr view --json headRefOid`),
|
|
92
115
|
* resolved from GitHub — never from local git, an env var, or the PR's own
|
|
93
116
|
* checkout, all three of which a `pull_request`-triggered workflow's
|
|
94
|
-
* PR-editable YAML could steer
|
|
117
|
+
* PR-editable YAML could steer. REQUIRED, not optional: an omitted
|
|
95
118
|
* head would have to mean either skip-the-binding-check (fail-open, the
|
|
96
119
|
* exact defect this field exists to close) or unconditional-fail, and a
|
|
97
120
|
* required field makes that choice a compile error instead of a runtime
|
|
98
121
|
* default. Every verdict must cover this value to count as clean.
|
|
99
122
|
*/
|
|
100
123
|
headSha: string
|
|
101
|
-
/**
|
|
102
|
-
* Every check-run reported for the PR's current head, EXCLUDING this
|
|
103
|
-
* repo's own review-gate check-run (the caller filters that out before
|
|
104
|
-
* calling in — see check-review-gate.ts's own comment for why the
|
|
105
|
-
* exclusion must not live here). An empty array means no mechanical
|
|
106
|
-
* check-run has reported yet, which does NOT count as clean — there is
|
|
107
|
-
* no proof to point to, not an implicit pass.
|
|
108
|
-
*/
|
|
109
|
-
mechanicalChecks: MechanicalCheckStatus[]
|
|
110
124
|
/**
|
|
111
125
|
* Overrides `PRINCIPAL_ALLOWLIST` for this evaluation when provided — an
|
|
112
126
|
* adopter repo's own `vinaya.config.json` `principals` field, resolved by
|
|
@@ -137,8 +151,8 @@ export type ReviewGateInput = {
|
|
|
137
151
|
* A base that moved under an identical patch can carry a semantic conflict
|
|
138
152
|
* the earlier review could not have seen, and this binding will still
|
|
139
153
|
* hold. That is the same limit GitHub's own stale-review rule has, and CI
|
|
140
|
-
* at the new head —
|
|
141
|
-
* for it.
|
|
154
|
+
* at the new head — a required check in its own right, never read from
|
|
155
|
+
* here — is the guard for it.
|
|
142
156
|
*
|
|
143
157
|
* `git patch-id --stable` ignores whitespace, so a push that changes only
|
|
144
158
|
* whitespace produces the same patch identity and KEEPS the verdict. That
|
|
@@ -149,6 +163,68 @@ export type ReviewGateInput = {
|
|
|
149
163
|
* the verdict; only the whitespace-only case survives unreviewed.
|
|
150
164
|
*/
|
|
151
165
|
patchIdOf?: (sha: string) => string | null
|
|
166
|
+
/**
|
|
167
|
+
* The current `objectivesVersion` of the list the PR is judged against
|
|
168
|
+
* — the Issue's `objectivesOf`
|
|
169
|
+
* build, or the PR body's own `## Objectives` section below the cutover,
|
|
170
|
+
* resolved by the caller (never here; this stays pure). `null` means the
|
|
171
|
+
* objectives binding is SKIPPED entirely — a pre-cutover Issue, no Issue at
|
|
172
|
+
* all, or no objectives section resolvable — so the pre-cutover PR stock
|
|
173
|
+
* keeps passing exactly as it did before this field existed. A non-null
|
|
174
|
+
* value requires every clean verdict's own `extraction.objectivesVersion`
|
|
175
|
+
* to equal it; a mismatch (including a verdict with no version line at
|
|
176
|
+
* all) reads as unbound, the same fail-closed shape as a stale head.
|
|
177
|
+
*/
|
|
178
|
+
objectivesVersion: string | null
|
|
179
|
+
/**
|
|
180
|
+
* The newest principal ruling ordinal on this PR — `0` when the PR carries no ruling at all, NEVER
|
|
181
|
+
* `null`: unlike `objectivesVersion`, there is no "skip this binding"
|
|
182
|
+
* case here — a PR either has rulings or it doesn't, and `0` says so.
|
|
183
|
+
* Resolved by the caller (never here; this stays pure) by counting
|
|
184
|
+
* principal-authored `<!-- aeg:principal:ruling:<pr>-<k> -->` comments.
|
|
185
|
+
* A verdict's own `extraction.rulingOrdinal` binds only when it equals
|
|
186
|
+
* this value exactly — `null` (pre-cutover stock, no `Ruling ordinal:`
|
|
187
|
+
* line at all) binds only when this value is `0`, the same "the PR truly
|
|
188
|
+
* had nothing to see" case `isBoundToObjectives`'s `null`-current-version
|
|
189
|
+
* skip covers for objectives, but expressed as equality rather than an
|
|
190
|
+
* unconditional skip, since a ruling's existence is never ambiguous.
|
|
191
|
+
*/
|
|
192
|
+
rulingOrdinal: number
|
|
193
|
+
/**
|
|
194
|
+
* Which severities block is repository policy — resolved by the caller from the DEFAULT BRANCH's
|
|
195
|
+
* `vinaya.config.json` (`resolveReviewPolicy(loadTrustAnchorConfig())`),
|
|
196
|
+
* never from here (this stays pure) and never from the PR's own checkout,
|
|
197
|
+
* so a change cannot lower its own threshold. Defaults to
|
|
198
|
+
* `DEFAULT_REVIEW_POLICY` (`BLOCKER`/`HIGH`) when omitted — every existing
|
|
199
|
+
* caller that predates this field is unaffected, the same optional-with-
|
|
200
|
+
* fallback shape `principalAllowlist` already uses above.
|
|
201
|
+
*/
|
|
202
|
+
policy?: ReviewPolicy
|
|
203
|
+
/**
|
|
204
|
+
* The frozen brief's own hash at evaluation time — resolved by the caller (never here; this stays
|
|
205
|
+
* pure) from the linked Issue's newest principal-authored frozen brief.
|
|
206
|
+
* Optional, defaulting to `null` (skip the binding) when omitted — every
|
|
207
|
+
* existing caller that predates this field is unaffected, the same
|
|
208
|
+
* optional-with-fallback shape `patchIdOf`/`policy` already use above.
|
|
209
|
+
* `null` (explicit, or via omission) means no frozen brief is resolvable
|
|
210
|
+
* for this PR — nothing to bind against, so every verdict passes this
|
|
211
|
+
* check unconditionally, the same "skip" meaning `objectivesVersion: null`
|
|
212
|
+
* already carries.
|
|
213
|
+
*/
|
|
214
|
+
briefHash?: string | null
|
|
215
|
+
/**
|
|
216
|
+
* The base commit the PR's candidate is judged against at evaluation time
|
|
217
|
+
* (O1) — resolved by the caller (never
|
|
218
|
+
* here; this stays pure) from the PR's base branch tip, the same
|
|
219
|
+
* `origin/<baseRefName>` `patchIdOf` already diffs against. Optional,
|
|
220
|
+
* defaulting to `null` (skip the base binding) when omitted — every existing
|
|
221
|
+
* caller and every fixture that predates base identity is unaffected, the
|
|
222
|
+
* same optional-with-fallback shape `patchIdOf`/`policy`/`briefHash` already
|
|
223
|
+
* use. Bounded, not an always-checked equality: a base move under an exact
|
|
224
|
+
* head sha invalidates, while a proven patch-identity rebase tolerates it —
|
|
225
|
+
* see `compareManifest`'s own base rule.
|
|
226
|
+
*/
|
|
227
|
+
baseSha?: string | null
|
|
152
228
|
}
|
|
153
229
|
|
|
154
230
|
/**
|
|
@@ -164,64 +240,31 @@ export function isReviewGateExemptBranch(_branch: string): boolean {
|
|
|
164
240
|
return false
|
|
165
241
|
}
|
|
166
242
|
|
|
167
|
-
/**
|
|
168
|
-
* True when `extraction.headSha` covers `headSha` — an exact match, or
|
|
169
|
-
* `headSha` starting with `extraction.headSha` (the abbreviated-sha case:
|
|
170
|
-
* a verdict may bind against a 7-char prefix, and `headSha` itself is always
|
|
171
|
-
* the full 40-char form GitHub's API returns). `false` when the extraction
|
|
172
|
-
* carries no `headSha` at all (no `Judged head:` line was found) — an
|
|
173
|
-
* unbound verdict never counts as covering anything.
|
|
174
|
-
*/
|
|
175
|
-
function isBoundToHead(extraction: { headSha: string | null }, headSha: string): boolean {
|
|
176
|
-
if (!extraction.headSha) return false
|
|
177
|
-
return headSha.toLowerCase().startsWith(extraction.headSha.toLowerCase())
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
* True when the judged head and the current head carry the SAME patch — the
|
|
182
|
-
* verdict was cast on this exact set of changes, whatever sha now addresses
|
|
183
|
-
* it. Composed BESIDE `isBoundToHead`, never in place of it: sha binding
|
|
184
|
-
* still counts on its own, and this only widens what else counts.
|
|
185
|
-
*
|
|
186
|
-
* Fails closed on every uncertainty. `null` on either side is "git could not
|
|
187
|
-
* answer", not "they match" — a force-push that makes the judged head
|
|
188
|
-
* unreachable resolves to `null` and the verdict correctly stops counting.
|
|
189
|
-
*/
|
|
190
|
-
function isBoundByPatchIdentity(
|
|
191
|
-
extraction: { headSha: string | null },
|
|
192
|
-
headSha: string,
|
|
193
|
-
patchIdOf?: (sha: string) => string | null
|
|
194
|
-
): boolean {
|
|
195
|
-
if (patchIdOf === undefined || !extraction.headSha) return false
|
|
196
|
-
const judged = patchIdOf(extraction.headSha)
|
|
197
|
-
const current = patchIdOf(headSha)
|
|
198
|
-
if (judged === null || current === null) return false
|
|
199
|
-
return judged === current
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
/** A verdict covers the current head when its sha binds it, or its patch identity does. */
|
|
203
|
-
function isBoundToPatch(
|
|
204
|
-
extraction: { headSha: string | null },
|
|
205
|
-
headSha: string,
|
|
206
|
-
patchIdOf?: (sha: string) => string | null
|
|
207
|
-
): boolean {
|
|
208
|
-
return isBoundToHead(extraction, headSha) || isBoundByPatchIdentity(extraction, headSha, patchIdOf)
|
|
209
|
-
}
|
|
210
|
-
|
|
211
243
|
/**
|
|
212
244
|
* `pass` when either (a) `vinaya/waiver:review` is present and actor-verified against
|
|
213
245
|
* `PRINCIPAL_ALLOWLIST`, or (b) both verdicts are clean AND bound — code-reviewer
|
|
214
246
|
* `APPROVE` (not `REQUEST_CHANGES`, not missing, not unclear) covering the PR's
|
|
215
247
|
* current `headSha` — by that sha, or by an equal patch identity when
|
|
216
248
|
* `patchIdOf` is supplied — and security-review `PASS` (not `FAIL`, not
|
|
217
|
-
* missing, not unclear) covering it too
|
|
218
|
-
*
|
|
219
|
-
*
|
|
220
|
-
*
|
|
221
|
-
*
|
|
222
|
-
*
|
|
223
|
-
*
|
|
224
|
-
* all
|
|
249
|
+
* missing, not unclear) covering it too, both also bound to the current
|
|
250
|
+
* objectives version and the current newest ruling ordinal. `fail`
|
|
251
|
+
* otherwise, naming exactly which verdict(s) are not clean or not bound to
|
|
252
|
+
* the current head.
|
|
253
|
+
*
|
|
254
|
+
* Reviews and nothing else. No other check's result, and no Test Plan
|
|
255
|
+
* tick-state, is an input here or may become one: every merge condition is
|
|
256
|
+
* its own independent check, so that all green means mergeable, and a gate
|
|
257
|
+
* that re-reported a sibling check's red answered a question it does not
|
|
258
|
+
* own. Adding such an input back is a deliberate regression a dedicated
|
|
259
|
+
* architecture test refuses.
|
|
260
|
+
*
|
|
261
|
+
* A verdict's own `VERDICT:` text is not, by itself, sufficient for "clean":
|
|
262
|
+
* the comment's own FINDINGS block
|
|
263
|
+
* is re-evaluated against `input.policy` (`evaluateCodeReview`/
|
|
264
|
+
* `evaluateSecurityReview`, `@attalabs/aeg-core`'s pure evaluator), and an
|
|
265
|
+
* `APPROVE`/`PASS` beside a finding at or above the threshold reads as not
|
|
266
|
+
* clean here regardless — a reviewer's own clean-sounding verdict never
|
|
267
|
+
* overrides the evaluator.
|
|
225
268
|
*/
|
|
226
269
|
export function checkReviewGate(input: ReviewGateInput): ReviewGateResult {
|
|
227
270
|
const principalAllowlist = input.principalAllowlist ?? PRINCIPAL_ALLOWLIST
|
|
@@ -239,22 +282,7 @@ export function checkReviewGate(input: ReviewGateInput): ReviewGateResult {
|
|
|
239
282
|
}
|
|
240
283
|
}
|
|
241
284
|
|
|
242
|
-
//
|
|
243
|
-
// ABSENT, never a failure (Issue #402 O4): a job whose own `if:` is false
|
|
244
|
-
// for this event still reports a check-run — `vinaya-review.yml`'s
|
|
245
|
-
// `retrigger-on-ci-green` job reports `skipped` on every ordinary
|
|
246
|
-
// `pull_request_target` run — and counting that as "not green" blocked
|
|
247
|
-
// every PR (first seen on PR #401: "vinaya review gate (retrigger on CI
|
|
248
|
-
// green) (skipping)"). Filtered out before both the emptiness check and
|
|
249
|
-
// the clean-check, so a head reporting only skipped/neutral runs reads as
|
|
250
|
-
// "nothing has reported yet", not as a false pass.
|
|
251
|
-
const reportedMechanicalChecks = input.mechanicalChecks.filter(
|
|
252
|
-
(c) => c.bucket !== 'skipping' && c.bucket !== 'neutral'
|
|
253
|
-
)
|
|
254
|
-
const mechanicalChecksClean =
|
|
255
|
-
reportedMechanicalChecks.length > 0 && reportedMechanicalChecks.every((c) => c.bucket === 'pass')
|
|
256
|
-
|
|
257
|
-
// Verdict-AUTHOR verification (security finding on PR #806): on a public
|
|
285
|
+
// Verdict-AUTHOR verification (a security finding): on a public
|
|
258
286
|
// repo any GitHub account can post a `VERDICT: APPROVE`-shaped comment, and
|
|
259
287
|
// most-recent-clear-hit-wins extraction would let a forged later APPROVE
|
|
260
288
|
// override a real earlier REQUEST CHANGES. Only comments whose author is on
|
|
@@ -267,7 +295,7 @@ export function checkReviewGate(input: ReviewGateInput): ReviewGateResult {
|
|
|
267
295
|
const verified = input.comments.filter((c) => isPrincipal(c.author, principalAllowlist))
|
|
268
296
|
// Count only VERDICT-shaped ignored comments — deployment bots and ordinary
|
|
269
297
|
// chat are also non-allowlisted, and counting them would imply forgery
|
|
270
|
-
// where there is only noise (review finding
|
|
298
|
+
// where there is only noise (a review finding).
|
|
271
299
|
const ignoredCount = input.comments.filter(
|
|
272
300
|
(c) => !isPrincipal(c.author, principalAllowlist) && c.body.includes('VERDICT')
|
|
273
301
|
).length
|
|
@@ -275,42 +303,158 @@ export function checkReviewGate(input: ReviewGateInput): ReviewGateResult {
|
|
|
275
303
|
|
|
276
304
|
const codeReview = extractCodeReviewVerdict(verifiedBodies)
|
|
277
305
|
const security = extractSecurityReviewVerdict(verifiedBodies)
|
|
278
|
-
const
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
306
|
+
const policy = input.policy ?? DEFAULT_REVIEW_POLICY
|
|
307
|
+
// O3: a reviewer's own APPROVE/PASS never overrides the evaluator — clean
|
|
308
|
+
// requires BOTH a clean text value AND the evaluator finding nothing at or
|
|
309
|
+
// above policy in the comment's own FINDINGS block. A finding the text
|
|
310
|
+
// claims to be clean beside is read as not clean here, regardless of what
|
|
311
|
+
// the VERDICT: line says.
|
|
312
|
+
//
|
|
313
|
+
// `findingSeverities` is a bare regex extraction over a hand-typed
|
|
314
|
+
// principal comment (`verdict-extraction.ts`'s `FINDING_SEVERITY_LINE`),
|
|
315
|
+
// not validated output — `evaluateReviewFindings` throws on any token
|
|
316
|
+
// outside the role's own scale. Every other refusal in this function
|
|
317
|
+
// returns a named `fail` result; an uncaught throw here would crash the
|
|
318
|
+
// check-run instead, on nothing worse than a typo in a manually-posted
|
|
319
|
+
// comment. Caught and failed closed the same way.
|
|
320
|
+
//
|
|
321
|
+
// O1/O4: only CONSEQUENTIAL findings are evaluated — a finding the reviewer
|
|
322
|
+
// marked `resolved` keeps its severity in the record but no longer blocks,
|
|
323
|
+
// the SAME `consequentialFindings` filter `deriveCodeReviewVerdict` applies
|
|
324
|
+
// before it derives APPROVE/PASS, so an APPROVE whose only blocking findings
|
|
325
|
+
// are `resolved` passes the gate exactly as it made derivation approve. A
|
|
326
|
+
// finding at or above the threshold in any other state — `open`,
|
|
327
|
+
// `fix-claimed`, `reproduced`, or no state token — is untouched by the
|
|
328
|
+
// filter and still blocks (O2).
|
|
329
|
+
let codeReviewPolicyEvaluation: ReturnType<typeof evaluateCodeReview>
|
|
330
|
+
let securityPolicyEvaluation: ReturnType<typeof evaluateSecurityReview>
|
|
331
|
+
try {
|
|
332
|
+
codeReviewPolicyEvaluation = evaluateCodeReview(consequentialFindings(codeReview.findingSeverities), policy)
|
|
333
|
+
securityPolicyEvaluation = evaluateSecurityReview(consequentialFindings(security.findingSeverities), policy)
|
|
334
|
+
} catch (err) {
|
|
335
|
+
return {
|
|
336
|
+
verdict: 'fail',
|
|
337
|
+
reason: `a verdict comment carries a finding severity this repository's policy does not recognize: ${err instanceof Error ? err.message : String(err)}`,
|
|
338
|
+
waived: false
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
const codeReviewTextClean = codeReview.value === 'APPROVE'
|
|
342
|
+
const securityTextClean = security.value === 'PASS'
|
|
343
|
+
const codeReviewPolicyClean = codeReviewPolicyEvaluation.outcome === 'clean'
|
|
344
|
+
const securityPolicyClean = securityPolicyEvaluation.outcome === 'clean'
|
|
345
|
+
const codeReviewClean = codeReviewTextClean && codeReviewPolicyClean
|
|
346
|
+
const securityClean = securityTextClean && securityPolicyClean
|
|
347
|
+
// task 4: ONE comparison — the same `compareManifest` the
|
|
348
|
+
// loop's own publication self-check calls — behind every binding below,
|
|
349
|
+
// rather than four separate hand-rolled predicates. `current` is this
|
|
350
|
+
// evaluation's own manifest; each verdict's own echoed fields (read by
|
|
351
|
+
// `extractCodeReviewVerdict`/`extractSecurityReviewVerdict` above) are
|
|
352
|
+
// compared against it, never trusted as provenance on their own. Built
|
|
353
|
+
// directly (not via `buildReviewInputManifest`, which hashes a caller
|
|
354
|
+
// brief string) since the caller already resolved `briefHash` itself and
|
|
355
|
+
// this module stays pure — no hashing of forge content here.
|
|
356
|
+
const currentManifest: ReviewInputManifest = {
|
|
357
|
+
headSha: input.headSha,
|
|
358
|
+
baseSha: input.baseSha ?? null,
|
|
359
|
+
briefHash: input.briefHash ?? null,
|
|
360
|
+
objectivesVersion: input.objectivesVersion,
|
|
361
|
+
rulingOrdinal: input.rulingOrdinal,
|
|
362
|
+
policyDigest: computePolicyDigest(policy)
|
|
363
|
+
}
|
|
364
|
+
const codeReviewEchoed: EchoedManifest = {
|
|
365
|
+
headSha: codeReview.headSha,
|
|
366
|
+
baseSha: codeReview.baseSha,
|
|
367
|
+
briefHash: codeReview.briefHash,
|
|
368
|
+
objectivesVersion: codeReview.objectivesVersion,
|
|
369
|
+
rulingOrdinal: codeReview.rulingOrdinal,
|
|
370
|
+
policyDigest: codeReview.policyDigest
|
|
371
|
+
}
|
|
372
|
+
const securityEchoed: EchoedManifest = {
|
|
373
|
+
headSha: security.headSha,
|
|
374
|
+
baseSha: security.baseSha,
|
|
375
|
+
briefHash: security.briefHash,
|
|
376
|
+
objectivesVersion: security.objectivesVersion,
|
|
377
|
+
rulingOrdinal: security.rulingOrdinal,
|
|
378
|
+
policyDigest: security.policyDigest
|
|
379
|
+
}
|
|
380
|
+
const codeReviewBinding = compareManifest(codeReviewEchoed, currentManifest, input.patchIdOf)
|
|
381
|
+
const securityBinding = compareManifest(securityEchoed, currentManifest, input.patchIdOf)
|
|
382
|
+
const codeReviewBound = codeReviewBinding.head
|
|
383
|
+
const securityBound = securityBinding.head
|
|
384
|
+
const codeReviewObjectivesBound = codeReviewBinding.objectivesVersion
|
|
385
|
+
const securityObjectivesBound = securityBinding.objectivesVersion
|
|
386
|
+
const codeReviewRulingsBound = codeReviewBinding.rulingOrdinal
|
|
387
|
+
const securityRulingsBound = securityBinding.rulingOrdinal
|
|
282
388
|
|
|
283
|
-
if (codeReviewClean &&
|
|
389
|
+
if (codeReviewClean && codeReviewBinding.bound && securityClean && securityBinding.bound) {
|
|
284
390
|
return {
|
|
285
391
|
verdict: 'pass',
|
|
286
|
-
reason: `code-reviewer verdict is a clean APPROVE and security-review verdict is a clean PASS, both covering head ${input.headSha}
|
|
392
|
+
reason: `code-reviewer verdict is a clean APPROVE and security-review verdict is a clean PASS, both covering head ${input.headSha}.`,
|
|
287
393
|
waived: false
|
|
288
394
|
}
|
|
289
395
|
}
|
|
290
396
|
|
|
291
397
|
const problems: string[] = []
|
|
292
|
-
if (!
|
|
398
|
+
if (!codeReviewTextClean) {
|
|
293
399
|
problems.push(`code-reviewer verdict is not a clean APPROVE (found: ${codeReview.value})`)
|
|
400
|
+
} else if (!codeReviewPolicyClean) {
|
|
401
|
+
problems.push(
|
|
402
|
+
`code-reviewer verdict says APPROVE but carries a finding (${codeReviewPolicyEvaluation.blockingFindings.map((f) => f.severity).join(', ')}) at or above this repository's code-review policy threshold (${policy.codeReviewThreshold}) — a reviewer's own APPROVE never overrides policy`
|
|
403
|
+
)
|
|
294
404
|
} else if (!codeReviewBound) {
|
|
295
405
|
problems.push(
|
|
296
406
|
`the newest code-review verdict covers ${codeReview.headSha ?? 'no recorded commit'}, head is ${input.headSha}`
|
|
297
407
|
)
|
|
408
|
+
} else if (!codeReviewBinding.base) {
|
|
409
|
+
problems.push(
|
|
410
|
+
`the newest code-review verdict was cast against base ${codeReview.baseSha ?? 'no recorded base'}, the PR's base is now ${currentManifest.baseSha ?? 'unresolved'} (a base-only change under an unchanged candidate — same patch text on a new base is not automatically equivalent)`
|
|
411
|
+
)
|
|
412
|
+
} else if (!codeReviewObjectivesBound) {
|
|
413
|
+
problems.push(
|
|
414
|
+
`the newest code-review verdict was cast against objectives version ${codeReview.objectivesVersion ?? 'none'}, the Issue's list is now ${input.objectivesVersion}`
|
|
415
|
+
)
|
|
416
|
+
} else if (!codeReviewRulingsBound) {
|
|
417
|
+
problems.push(
|
|
418
|
+
`the newest code-review verdict was cast against ruling ordinal ${codeReview.rulingOrdinal ?? 'none'}, a newer ruling (ruling ${input.rulingOrdinal}) is now posted on this PR`
|
|
419
|
+
)
|
|
420
|
+
} else if (!codeReviewBinding.briefHash) {
|
|
421
|
+
problems.push(
|
|
422
|
+
`the newest code-review verdict was cast against brief hash ${codeReview.briefHash ?? 'none'}, the frozen brief's current hash is ${currentManifest.briefHash ?? 'none'}`
|
|
423
|
+
)
|
|
424
|
+
} else if (!codeReviewBinding.policyDigest) {
|
|
425
|
+
problems.push(
|
|
426
|
+
`the newest code-review verdict was cast against review policy digest ${codeReview.policyDigest ?? 'none'}, this repository's current policy digest is ${currentManifest.policyDigest}`
|
|
427
|
+
)
|
|
298
428
|
}
|
|
299
|
-
if (!
|
|
429
|
+
if (!securityTextClean) {
|
|
300
430
|
problems.push(`security-review verdict is not a clean PASS (found: ${security.value})`)
|
|
431
|
+
} else if (!securityPolicyClean) {
|
|
432
|
+
problems.push(
|
|
433
|
+
`security-review verdict says PASS but carries a finding (${securityPolicyEvaluation.blockingFindings.map((f) => f.severity).join(', ')}) at or above this repository's security policy threshold (${policy.securityThreshold}) — a reviewer's own PASS never overrides policy`
|
|
434
|
+
)
|
|
301
435
|
} else if (!securityBound) {
|
|
302
436
|
problems.push(
|
|
303
437
|
`the newest security-review verdict covers ${security.headSha ?? 'no recorded commit'}, head is ${input.headSha}`
|
|
304
438
|
)
|
|
305
|
-
}
|
|
306
|
-
|
|
439
|
+
} else if (!securityBinding.base) {
|
|
440
|
+
problems.push(
|
|
441
|
+
`the newest security-review verdict was cast against base ${security.baseSha ?? 'no recorded base'}, the PR's base is now ${currentManifest.baseSha ?? 'unresolved'} (a base-only change under an unchanged candidate — same patch text on a new base is not automatically equivalent)`
|
|
442
|
+
)
|
|
443
|
+
} else if (!securityObjectivesBound) {
|
|
444
|
+
problems.push(
|
|
445
|
+
`the newest security-review verdict was cast against objectives version ${security.objectivesVersion ?? 'none'}, the Issue's list is now ${input.objectivesVersion}`
|
|
446
|
+
)
|
|
447
|
+
} else if (!securityRulingsBound) {
|
|
448
|
+
problems.push(
|
|
449
|
+
`the newest security-review verdict was cast against ruling ordinal ${security.rulingOrdinal ?? 'none'}, a newer ruling (ruling ${input.rulingOrdinal}) is now posted on this PR`
|
|
450
|
+
)
|
|
451
|
+
} else if (!securityBinding.briefHash) {
|
|
452
|
+
problems.push(
|
|
453
|
+
`the newest security-review verdict was cast against brief hash ${security.briefHash ?? 'none'}, the frozen brief's current hash is ${currentManifest.briefHash ?? 'none'}`
|
|
454
|
+
)
|
|
455
|
+
} else if (!securityBinding.policyDigest) {
|
|
307
456
|
problems.push(
|
|
308
|
-
|
|
309
|
-
? 'no mechanical checks have reported for this head yet'
|
|
310
|
-
: `mechanical check(s) not green: ${reportedMechanicalChecks
|
|
311
|
-
.filter((c) => c.bucket !== 'pass')
|
|
312
|
-
.map((c) => `${c.name} (${c.bucket})`)
|
|
313
|
-
.join(', ')}`
|
|
457
|
+
`the newest security-review verdict was cast against review policy digest ${security.policyDigest ?? 'none'}, this repository's current policy digest is ${currentManifest.policyDigest}`
|
|
314
458
|
)
|
|
315
459
|
}
|
|
316
460
|
const ignoredNote =
|
|
@@ -330,7 +474,7 @@ export function checkReviewGate(input: ReviewGateInput): ReviewGateResult {
|
|
|
330
474
|
* whatever it takes to resolve `expectedAuthor` — resolving that value is a
|
|
331
475
|
* network round-trip (`resolveReleaseActor(loadTrustAnchorConfig())`) that
|
|
332
476
|
* must not run on every ordinary PR just because it is one of three
|
|
333
|
-
* arguments to `isChangesetsReleasePr`. Found live
|
|
477
|
+
* arguments to `isChangesetsReleasePr`. Found live in code review:
|
|
334
478
|
* evaluating it inline as a function argument runs it unconditionally,
|
|
335
479
|
* regardless of branch, since JS evaluates arguments eagerly.
|
|
336
480
|
*/
|
|
@@ -367,7 +511,7 @@ export const DEFAULT_RELEASE_ACTOR = 'github-actions[bot]'
|
|
|
367
511
|
* an expression evaluated from the workflow file on the DEFAULT BRANCH, a
|
|
368
512
|
* pull request cannot edit that file to substitute a different literal
|
|
369
513
|
* (the same `pull_request_target` boundary `vinaya-review.yml` already
|
|
370
|
-
* uses). Found live
|
|
514
|
+
* uses). Found live: the identical exemption on a plain
|
|
371
515
|
* `pull_request` trigger let an attacker redirect `PR_NUMBER`/`BRANCH` to
|
|
372
516
|
* any already-approved PR by the configured release actor — verified no
|
|
373
517
|
* env-var or git-state signal inside that trigger type is a safe anchor,
|