The adapter converts authenticated, read-only GitHub metadata into the same
validated EvaluationInput consumed by the deterministic evaluator. It keeps
the richer immutable identity outside the legacy scalar input in a
SnapshotIdentity and returns it beside the snapshot envelope.
npm run build
node dist/src/cli.js github snapshot \
--mock-fixture fixtures/api/happy-path.json \
--output /tmp/patchgate-github-snapshot.jsonThe mock transport is keyed by method, path, query, operation, and variables. It rejects unexpected requests and proves that the finalization pass consumed the recorded responses. The fixture contains no token, PR body, review body, comment, workflow log, artifact, or source-code payload.
Live retrieval requires an explicit opt-in and an environment token:
PATCHGATE_GITHUB_TOKEN='read-only-token' \
node dist/src/cli.js github snapshot \
--live --repo OWNER/REPOSITORY --pull 123 --target head \
--output /tmp/patchgate-github-snapshot.jsonThe command refuses live mode without --live and refuses to run without the
environment token. An authorized GET-only run against public
daichunghy/patchgate#9 is recorded in
docs/reviews/2026-08-20-g3-live-smoke.md.
The output contains identity, capability, request metrics, diagnostics,
the normalized snapshot, and the evaluator's final status. A rejected build
contains a stable diagnostic and exit code 2. A complete but non-ready
evaluation returns exit code 1; ready_for_review returns exit code 0.
ready_for_review means that the declared, represented requirements passed. It
does not mean that the code is correct, that a human read it, or that a native
GitHub control was bypassed.
- Policy and CODEOWNERS are read at the PR base SHA, never from the proposed head.
- Head target evidence is bound to the PR head SHA. Merge target evidence is bound to the immutable merge SHA returned by GitHub.
- Initial identity and decision-bearing observations are re-read during finalization. A changed identity or normalized observation discards the snapshot.
- Required CI and CodeQL workflows also trigger on
merge_group/checks_requested, so a future merge queue will not wait for missing required checks. The current scalar evaluator still cannot represent authenticated merge-group membership; merge-group requests remain explicitly unsupported and the Action reportsevidence_missingrather than treating a merge-group SHA as an ordinary PR head. - Branch protection required checks, required approvals and applicable
CODEOWNERS gates are represented in the versioned native-control contract and
remain bound to the base revision. Rulesets with
required_status_checksandpull_requestreview parameters use the same contract; active rulesets with unsupported rule semantics are rejected. Therequire_last_push_approvalsetting remains an explicit evidence-missing result because this snapshot does not yet include immutable last-pusher data.
The contract decisions are recorded in
docs/decisions/2026-08-13-g3-contract.md.