Skip to content

CI: add base-owned per-gate attestation trust verifier for verified org members #4744

Closed

Description

@zackees

Part of #4743. Implement first; this PR adds a tested decision component without changing job routing.

Scope / exact files

  • Add ci/pr_attestation.py and ci/test_pr_attestation.py (plain-Python ci self-test discovery; no Rust test binary).
  • Update ci-attestations.yml with explicit versioned lane freshness (24 hours) and job/gate policy as needed; keep legacy Local-Gate compatibility during rollout.
  • Use pinned forge-ci/prooft APIs/CLI for trailer parsing, tree/parent or declared-input validation and freshness. Put the immutable prooft source/version pin in the verifier; do not run a floating uvx version or implement another trailer format.
  • Use ci/gh_graphql.py for cached GraphQL reads; no direct GraphQL CLI. API calls are injectable for tests.

Decision contract (implement as specified)

Inputs: immutable base/head SHAs, PR number/event, same-repo head identity, authenticated GitHub identity/signature/membership facts, time, and policy from BASE. Output stable JSON plus GitHub outputs trusted, skip_<job-id> and a per-job reason list. A missing/unknown fact means false and real selected checks, never successful skip.

Fast path requires same-repo PR; PR author and final HEAD's authenticated signature signer are active obs-rust organization members; GitHub reports that exact HEAD signature valid; signature signer is associated with the signed commit, not an arbitrary author string. Use authenticated membership lookup, not only author_association (private members can be reported as CONTRIBUTOR). A denied membership lookup or absent signer falls back to real CI without demanding new privileges. Non-member collaborators, fork heads, unsigned commits, bot identities without verified org membership, missing/stale/malformed/wrong-tree/wrong-parent evidence and trust-surface edits skip nothing. A known org member can still self-report false execution; this only establishes accountability.

BASE owns executable verifier/policy/tool pins. Reject fast path if diff touches push, ci/**, .github/**, local-gate.toml, ci-attestations.yml, rust-toolchain.toml, Cargo manifests/lock or .cargo/**. Read diff/commit objects, never import head scripts to decide trust. A policy edit cannot relax its own requirements. Reject conflicting duplicate gate records, invalid timestamps/future timestamps beyond 5 minutes, unknown policy versions and unavailable commits. Omitted gates mean not run. A job skips only if all its declared client gates pass. Compile-only gates never satisfy native runtime/Tier 2 gates. merge_group, push, schedule, release, dispatch skip no heavy lane regardless of trailers or hosted proof artifacts.

RED test first

In ci/test_pr_attestation.py, use temporary local git objects and injected GitHub responses. Demonstrate failing assertions for a member's verified signed head with valid partial evidence (only covered jobs skip), versus a fork/nonmember replaying identical trailers (no skips). Add cases for every failure listed above, denied/private membership lookup, signer different from author, untrusted head editing policy/verifier, and merge_group carrying otherwise valid evidence. Never require network or real signing keys in unit tests.

Run uv run --no-project ci/test_pr_attestation.py RED before implementation and GREEN after. Preserve command/status output in PR. Include one fixture proving legacy Local-Gate data alone cannot silently claim missing per-target Ci-Attestation gates.

Acceptance

  • Base-owned policy cannot be replaced by head code/config; all lookup failures are observable reasons with real-run outputs.
  • Valid partial evidence credits exactly declared gates; six-target naming comes from CI: make PR checks attestation-only; client runs lint/clippy/Dylint (all targets); merge queue is the heavy gate #4743's contract, not host inference.
  • No workflow routing changes, no new workflows, no membership-setting edits and no elevated fork token.
  • API/schema version and prooft pin are documented in module docstring; focused tests pass. Future routing consumes these outputs without its own trust implementation.

Activity

  1. added
    ready
    on Nov 12, 2026
  2. zackees commented on Nov 12, 2026

    @zackees
    MemberAuthor

    Claiming: #4744 on ci/4744-attestation-verifier. 1. Add offline RED tests for the specified base-owned per-gate trust contract. 2. Implement the pinned prooft verifier and versioned 24-hour policy without routing changes. 3. Record GREEN evidence, lint once, and open the PR today.

  3. moved this from In progress to Ready in obs-rust Multiviewon Nov 14, 2026
  4. zackees commented on Nov 18, 2026

    @zackees
    MemberAuthor

    Landed on master in #4761 (369ff1b); verified the merge is an ancestor of origin/master and ci/pr_attestation.py exists there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions