Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
CustomerReviewDetailexposesmerge_gate(PullRequestMergeGate | null), which records Proofline's server-evaluated deterministic merge policy for an opted-in repository and commit (status,decision,policy_version,blocking_severity,severity_applied,finding_count,assessment_count,coverage_digest,reason_code,head_sha, and bypass history).Callers using
getReview()orwaitForReview()in CI/CD pipelines previously had to manually inspectreview.merge_gate, distinguishreview === null(e.g.,TIMED_OUTbefore first response) frommerge_gate === null(not opted in), validateGateStatus/Outcomeconsistency, extract GitHub bypass metadata, and checkhead_shaalignment.Approach
Add a pure, typed helper
readReviewMergeGate(source, options?)insrc/merge-gate.tsand re-export it (and its types) fromsrc/index.ts:Review(CustomerReviewDetail) or aReviewOutcome(waitForReview)."UNAVAILABLE"(outcome.review === null) from"NOT_CONFIGURED"(review.merge_gate === null).GateStatusvalues (REQUESTED,EVALUATING,ALLOWED,BLOCKED,BYPASSED,SUPERSEDED),Outcome(ALLOW|BLOCK|null), and structuredMergeGateBypassfields.headShapinning (TypeErroron invalid 40-char SHA; returnsstatus: "HEAD_MISMATCH"withdecision: nullif the recorded gate belongs to another commit).ALLOWEDrequiresALLOW;BLOCKEDrequiresBLOCK), throwingProoflineError(0, "urn:proofline:sdk:invalid-response", ...)on malformed payloads.openapi.public.json, generated types/operations, and CI workflows untouched, and satisfiescheck-claims.mjs.Verification
npm run typecheck— passednpm run build— passed (dist/merge-gate.jsanddist/merge-gate.d.tsemitted)node generate.mjs— no changes tosrc/operations.tsorsrc/schema.d.tsnode check-claims.mjs— passed.\node_modules\.bin\biome check src/merge-gate.ts tests/merge-gate.test.mjs— passed.\node_modules\.bin\biome lint src/index.ts— passednode --test tests/merge-gate.test.mjs— 5/5 passed (covering unavailable/unconfigured states, all 6GateStatusvalues and bypass metadata,headShapinning, 14 malformed/contradictory payloads, and local HTTPwaitForReview+getReviewintegration)npm test— 110/111 passed (the single failure is the pre-existingtests/http.test.mjs:2121test"a new public operation generates a callable typed client method"failing on Windows sandbox withEPERM: operation not permitted, symlink ... -> ...\node_modules)