Skip to content

feat(ci): stage policy-driven evidence gate pilot - #851

Draft
akrock wants to merge 131 commits into
mainfrom
codex/make-it-so-issue-777-ci-evidence-gate
Draft

akrock wants to merge 131 commits into
mainfrom
codex/make-it-so-issue-777-ci-evidence-gate

Conversation

@akrock

@akrock akrock commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Problem and behavior

AppSurface needs a CI evidence result tied to the exact current pull-request revision. This draft stages the base-owned controller, credentialless subject handoff, and independent verifier for issue #777. A fresh, fully verified empty documentation profile can yield NoEvidenceRequired; missing upstream results and incomplete nonempty profiles fail closed.

The controller captures the protected base/head diff and policy plan, checks proposed policy data against protected fixtures, and hands a bounded snapshot to the credentialless job. The verifier recaptures the PR, validates the handoff and cleanup record, and recomputes the host verdict before publishing the pilot check. The fixed coverage subject transports three bounded artifacts. The latest evidence slice also binds a host-observed OCI envelope receipt to the run, base/head, profile, snapshot, and preflight image digest after supervisor cleanup. Its digest and artifact hashes establish consistency and transfer integrity; they do not independently attest the consumed checkout, runtime enforcement, or producer truth. The trusted verifier now also replays the downloaded Cobertura XML against its freshly captured source diff using the base-owned coverage thresholds. A replay failure stops the pilot; a pass remains a consistency check on subject-supplied bytes, not an independent test-execution or checkout attestation. After fresh recapture, handoff, cleanup, replay, and unique subject-job checks, the trusted verifier now writes a bounded observation of the verified plan, run/job identity, result, cleanup, and fixed artifact bytes. The artifact is canonical, short-lived, and explicitly claimEligible: false; it is not a checkout, isolation, or producer attestation and does not feed the EvidenceHost verdict.

The proposed release-publish workflow requires a dispatch from protected main, checks that its checkout matches github.workflow_sha, and rejects a missing or weakened release-publish environment before processing the tag. Each contents: write job is environment-gated; the Pages-write job depends on validation and uses the existing github-pages environment. The workflow also binds publication outputs to the validated annotated tag object and peeled commit, then compares both with exact remote tag refs before draft asset upload and final promotion. An edited branch workflow can remove its own guard, and a mutable tag still leaves a check/use race; repository and environment protections must independently restrict publication authority and release-tag replacement.

The proposed release-publish workflow calls a read-only Docs archive tuple verifier before creating or updating a draft release. The workflow selects fixed private RUNNER_TEMP upload paths; the verifier checks canonical asset names, version, tag, the archive digest recorded in the plan, and sidecar, then hashes the selected archive bytes. This closes one archive byte-consistency gap at the upload boundary. The verifier trusts that private handoff and does not establish artifact provenance or race-proof path traversal; it also does not bind NuGet packages, prevent a tag check/use race, or establish a ReleaseComplete claim.

Validation

  • The unchanged solution coverage gate on merged head 0fb8e273 passed in the PR-triggered native Ubuntu CI, as did an independent workflow-dispatch run on the same SHA. The PR run uploaded a report passing all four unchanged thresholds: 96.19% aggregate lines (118,448/123,140), 88.92% aggregate branches (49,708/55,900), 94.56% patch lines (3,110/3,289), and 93.47% patch branches (3,924/4,198), against effective floors of 94.5% for lines and 84.5% for branches.
  • The docs-only explain → host run → local verify rehearsal on this head produced matching plan digest a935646d382eb5dde80ff23161d499bfdf5506d13236354429dcd751bd2e2a54 and explicit NoEvidenceRequired (PullRequestGate); changing a source-diff byte failed with ASEVD231.
  • The merged Docs wayfinding scroll test and refreshed release screenshot baselines passed focused browser checks. Evidence-gate Python tests passed 196/196; publish guard passed 9/9; Durable doctor consumer tests passed 7/7; git diff --check is clean.
  • The Release test suite passed 709/709 and EvidenceGate passed 190/190 on the previous PR head. Native subject-image validation and strict Docs export also passed there; current-head workflow results are linked above.
  • Codecov/patch currently reports 93.32% of changed lines against its 95% target (with 0.5% tolerance). It remains red and advisory under the active ruleset, which has no required status-check rule; it uses a different measurement from the passing solution coverage gate.

Rollout

This remains a draft pilot, not a complete claim or closure of #777. The proposed pull_request_target workflow is not yet on protected main, so this PR cannot prove its own current-head check association or base-update freshness. Nonempty coverage, package, PostgreSQL, Keycloak, and release profiles still need trusted producer, resource, artifact, and attestation paths. The protected-main image publisher and ruleset safeguards also require administrator setup. The active Default ruleset has an OrganizationAdmin bypass, no last-push approval, and no required status check. The release environment is absent, and the current token sees no tag-targeting ruleset; an administrator must verify effective repository and organization tag policies, then prevent publication-capable tag replacement or deletion before live publication. The current token cannot inspect the effective organization Actions event policy (the API requires admin:org). GitHub is evaluating a default restriction on pull_request_target for affected public repositories, with enforcement scheduled for November 2, 2026; an administrator must verify the effective policy and pilot availability before this trigger can be required. See GitHub’s event-policy guidance. The policy matrix and rollout record track those gates.

akrock added 30 commits October 1, 2026 01:02
else:
try:
os.rmdir(output_path.name, dir_fd=parent_fd)
except OSError:
if output_fd >= 0:
try:
os.close(output_fd)
except OSError:
try:
process.kill()
process.wait(timeout=1)
except (OSError, subprocess.TimeoutExpired):

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant