Skip to content

Optional: shipping-work's local-gate attestation is available for adoption (gregoryfoster/skills#688) #456

Closed

Description

@gregoryfoster

From gregoryfoster/skills#516's coordinator, 2026-11-21. One notice like this goes to each repo that vendors gregoryfoster/skills.

shipping-work can now attest the local gate (gregoryfoster/skills#688, shipped in be7c5809). It's opt-in, and a repo that does nothing sees no change.

What it does

With .skills/attest-local-gate committed as on, shipping-work's push.sh checks the gate on the exact tree before it pushes. It pushes only a clean tree that passes. Then it posts the commit status gate/local = success on the pushed SHA, and reads it back. Your CI can then skip its heavy tier for that commit, and still run it for Dependabot's PRs, forks' PRs, scheduled runs and manual runs.

Does it pay here?

This repo is public, so its runs on standard GitHub-hosted runners are not billed and this lever saves nothing here. No action is needed; this notice is for the record, and it can be closed once read.

It pays only in a repo that is private (so its minutes are billed), whose CI cost is duration-shaped, and whose PRs come from people who ran the same gate before pushing. auditing-ci-cost's census now prints a BILLING line that says whether a repo is billed at all (gregoryfoster/skills#597).

To adopt, if it pays

The steps are on gregoryfoster/skills#688 (adopter steps), and the reference is shipping-work/references/attestation.md. In short:

  1. Bump the vendored skills to be7c5809 or later. If skills/shipping-work/scripts/ is a directory of per-file links, add one for _attest-gate.sh.
  2. Commit .skills/attest-local-gate holding on.
  3. Check the token. A classic gh token with repo covers it; a fine-grained token needs Commit statuses: Read and write.
  4. Add the CI step from the reference, with statuses: read in permissions.
  5. Run the census before, and again about 30 days after.

Know before turning it on

Activity

  1. gregoryfoster commented on Nov 22, 2026

    @gregoryfoster
    MemberAuthor

    Brief: #456, adopt the local-gate attestation anyway (epic #394 coordinator, 2026-11-22)

    Taken on the operator's decision, 2026-11-22: adopt it, even though this repo is public. The billing case doesn't apply here, so the reason to adopt is to be the first repo where the CI step actually runs, which upstream asks for. Pre-flighted read-only against origin/main 4102ae87, with the vendored skills at 284c3d9e and upstream main at be7c5809. Labels: [measured] read from the repo, a run or the API; [traced] followed through code or docs; [stated] the notice or the reference says so.

    What it saves here [measured: PR run 44797969426, #455]

    The PR's checks took about 45 s of wall clock in total. The heavy steps are pytest in test (18 s) and pytest -m integration in integration (19 s). Skipping them saves about 20 s of wall clock per agent PR, and no money, since the repo is public. The squash commit on main carries no status, so the push run on main still runs every tier, and the coordinator's verify recipe (CI by job on the squash commit's push run) is unchanged.

    Still true [measured]

    Decisions (starting the thread accepts the recommendations)

    1. [Operator decision: skip only the two pytest steps, in test and integration; lint and migrations always run — recommend.] The local gate covers what those two steps check:

      It doesn't run alembic upgrade head from an empty database, or alembic check. So migrations isn't covered, and it stays.

    2. [Operator decision: two PRs — first the skills bump plus the cadence re-render, then the attestation — recommend; or one PR.]

      • The bump is what the daily refresh would propose anyway, and the re-render changes a workflow that holds a write key. Each is easier to review on its own.
      • The second PR commits the knob, so push.sh attests that PR itself. Its own pull_request run, using its own ci.yml, is the first real run of the step.
    3. [Operator decision: report the first real run on gregoryfoster/skills#688 (closed, collecting adopter reports) — recommend; posted only with the operator's OK at the time.]

    Operator step (before PR 2's push)

    • Grant the token Commit statuses: Read and write. That means the fine-grained token that GH_TOKEN in .env holds, on CannObserv/watcher. The agent token can't check its own permissions.
    • If the grant is missing, the push still lands and prints ATTESTATION NOT POSTED. CI then runs everything, which fails safe. Never post the status by hand (attestation.md).

    Hazards (weigh them; overrule with evidence)

    1. A job's permissions replace the workflow's. Both test and integration declare their own, so statuses: read goes on each job, beside contents: read and id-token: write, not at the top of the workflow.
      • Update the two pinning tests first, so they fail.
      • Add a test that holds the skip's if:: never for a bot's PR, a fork's PR, a tag, or anything other than a push or a pull request. Copy the reference's expression as it is.
    2. integration's no integration test skipped step reads the JUnit file that the pytest step writes. Give it the same if:, or it fails on a missing file whenever the pytest step is skipped.
    3. The attest step's read must fail loudly, as the reference has it: a refused read fails the step, and it never silently skips. Use head.sha on pull_request, never github.sha (that's the merge commit).
    4. push.sh changes under the knob.
      • It refuses a dirty tree, an untracked file, or an edit inside a submodule (with the __pycache__/ above, check that ignored files really pass).
      • It asks scripts/pre-ship.sh again at the push. The vendored gate reuses its pass, but the wrapper's integration run doesn't record one, so expect about 20 s extra at each push.
      • Ship from the worktree, not a sparse checkout.
    5. The proof, PR 2's own run:
      • gate/local = success on its head;
      • in test and integration, the attest step reads yes and the pytest steps show skipped;
      • all four required checks are green, so the ruleset still merges it, since a skipped step leaves the job green;
      • the squash commit's push run on main runs every pytest step.
    6. The Dependabot half of the proof comes later. The next Dependabot PR (user.type == 'Bot') has to run the pytest steps in full. Leave it under Known limits for the coordinator to read at the next batch.
    7. Docs: one line in docs/SKILLS.md on the knob, and one in docs/COMMANDS.md's CI paragraph saying a PR from an attested push skips the two pytest steps, while main and Dependabot never do. Re-measure both, and AGENTS.md if it's touched (it's near its budget at 5,488 of 6,000; leave it alone if you can).
    8. Timing: no restart, since it's CI, docs and skills only. Keep clear of Monday 2026-11-23 01:00–03:00Z, and of the Wednesday 14:01Z cadence PR (gh pr update-branch for whichever merges second).

    Done when

    • PR 1 is merged: skills at be7c5809 or later, the cadence re-rendered with --check clean, the host pulled, and the submodule updated.
    • PR 2 is merged with the knob on, the CI step and its tests, and the docs.
    • The proof in hazard 5 is posted here.
    • The Dependabot half is left as a Known limit, and the upstream report waits on the operator's OK.

    Out of scope

    Making gate/local a required status (never, per the reference); a schedule for ci.yml, since every push to main already runs the full tier; any sibling repo.

  2. gregoryfoster commented on Nov 22, 2026

    @gregoryfoster
    MemberAuthor

    Brief review: corrections before building (2026-11-22)

    Re-checked against origin/main 4102ae87 and upstream main (still be7c5809; nothing newer). Holds as written: 132 commits ahead, skills/shipping-work is a whole-directory link, combined-status read works (pending, 0), no submodule ignore, no skip-worktree/assume-unchanged path, clean porcelain with --ignore-submodules=none.

    Corrections

    1. The reference's step body can't be copied verbatim [measured]. Its run: comment says context's: an unbalanced quote to shlex.split, which tests/test_integration_gate.py runs over every step's run (_pytest_step, test_no_job_selects_live). Pasted as is, all of TestCiJobs errors with No closing quotation. The commands and the if: go in verbatim; the explanation moves to YAML comments above run:.
    2. Hazard 1: only one pinning test needs to change [traced]. test_co_pypi_ci.py:83 is parametrized over all four syncing jobs, so it goes per-job (statuses: read on test and integration, absent on lint and migrations). test_integration_gate.py:100 asserts integration's permissions equal test's, so it keeps passing unchanged. That's the property we want, so it stays as is. The red test is the new per-job one.
    3. Placement: the attest step goes immediately before the pytest step, identical in both jobs. test_the_integration_job_sets_up_like_the_test_job compares steps[:pytest], so it then pins the two attest steps equal at no cost. integration's postgres service still starts, because job-level services can't be conditional, so the saving is the pytest steps alone, as stated.
    4. Hazard 8 and the proof: no gh pr update-branch on PR 2 [stated: attestation.md, "a merge commit made on GitHub carries no status"]. Its new head would be a GitHub merge commit with no gate/local, so that run is unattested and the hazard 5 proof would point at a superseded run. If main moves under PR 2, merge origin/main locally and run push.sh again (the gate re-runs and attests the new head). update-branch stays fine for PR 1 and the cadence PR.
    5. Worktree: git submodule update --init comes before push.sh. Without it, the skills/ links dangle, scripts/pre-ship.sh exits 2, and push.sh says Nothing was pushed. For PR 2, the worktree branches from the post-PR-1 main, with the bumped submodule checked out.

    The rest of the brief stands. Building PR 1 now.

  3. added a commit that references this issue on Nov 22, 2026
  4. gregoryfoster commented on Nov 22, 2026

    @gregoryfoster
    MemberAuthor

    PR 1 of 2: #459 (skills bump plus the cadence re-render), open and waiting for the operator's OK

    • gregoryfoster-skills is bumped from 284c3d9e to be7c5809. _attest-gate.sh comes with the whole-directory link.
    • context-cadence.yml is re-rendered by upstream install-cadence.sh (+115/−17). It adds the pr-mode default-branch hold and the merge-commit restart (curating-context: the cadence's pr render trusts GITHUB_REF_NAME, can reopen a squashed PR's rows, and discovers the PR twice gregoryfoster/skills#683). --check exits 0 and reports re-render: none. The schedule and the checkout SHA pin are kept.
    • CR --fix: one sentence in docs/DEPENDENCIES.md on the re-render's two new refusals (a run that isn't on main, and the PR merged mid-run). One finding was declined: checkout pin: kept, which is correct after a Dependabot bump.
    • Commits a4bcea0e and 31dc5bea. The PR run 45046873251 is green: lint, test, integration and migrations.

    Known limits:

    • The new hold step hasn't run on Actions yet. Its first run is the Wednesday 2026-11-25 14:01Z cadence.
    • The merge-commit restart can never fire here, because main is squash-only. A PR merged mid-run fails that run, and the remedy is a fresh dispatch, as the new docs line says.
  5. added a commit that references this issue on Nov 22, 2026
  6. gregoryfoster commented on Nov 22, 2026

    @gregoryfoster
    MemberAuthor

    PR 2 of 2: #460 (attest the local gate), open and waiting for the operator's OK

    • The knob: .skills/attest-local-gate is on. push.sh attested both of this PR's pushed heads: 9177bfab, then 002b055d after the CR fixes. Each push took about 35 s, because the wrapper's integration run re-runs at the push.
    • ci.yml: test and integration each get an attest step just before pytest, identical in both. The pytest steps and integration's no-skip check carry attestation.md's if: verbatim. statuses: read is set on each of those two jobs. lint and migrations always run.
    • Tests (red first, 9d40b238):
      • tests/ci/test_attest_local_gate.py evaluates the if:. It never skips for a bot's PR, a fork's PR, a tag, workflow_dispatch, schedule, pull_request_target or merge_group. It also pins the step, the per-job permissions, the knob (through the vendored reader) and a drift guard against the vendored attestation.md.
      • test_co_pypi_ci.py now checks permissions per job.
    • CR --fix (002b055d):
      • Added the drift guard.
      • Corrected "branch push" to "same-repo PR" (push triggers only on main).
      • Moved the schema comment back above the pytest step.
      • Docs now name NOT CONFIRMED too. One finding was declined; it's under Known limits below.
    • Docs: docs/SKILLS.md and docs/COMMANDS.md's CI section. Both are under the 10,000-token budget (8,919 and 8,880 estimated). AGENTS.md is untouched.
    • First proof (the PR's own runs):
    • Still to come: the squash push run on main (it should run every step), posted after the merge.

    Known limits:

    • The Dependabot half is unproven. The next Dependabot PR (user.type == 'Bot') has to run the pytest steps in full. The coordinator can check it at the next batch.
    • The attest step runs on every event, as the reference has it, including main's push runs, where its answer can't skip anything. A transient GitHub API error there fails test and integration without running a test. The fix is a re-run. It was declined in CR to keep the reference verbatim; it could go upstream with the #688 report.
    • The drift guard skips in CI, which doesn't initialise the submodule. It runs on the host, and fails there if the submodule is missing.
    • The attest step doesn't echo its answer. The yes is inferred, because nothing else in the if: can skip a human same-repo PR's steps.
  7. gregoryfoster commented on Nov 22, 2026

    @gregoryfoster
    MemberAuthor

    Hazard 5 proof: complete (2026-11-22)

    #460 merged as 11f4e340, and the host has pulled it. No restart: the change is CI, docs and a knob only.

    Check Evidence Result
    gate/local = success on the PR head 002b055d: push.sh printed posted … and read back, and gh pr checks lists gate/local pass ✅
    In test and integration, the attest step reads yes and the pytest steps are skipped PR run 45048784312 (and 45048089744 on 9177bfab): attest success; pytest (default…), pytest (integration) and no integration test skipped all skipped ✅
    The four required checks stay green and the ruleset merges it lint, test, integration and migrations all pass; mergeStateStatus was CLEAN, and the squash merge went through ✅
    The squash commit's push run on main runs every pytest step Push run 45049793203 on 11f4e340: attest success, both pytest steps and the no-skip check success, all four jobs success; the combined status of 11f4e340 holds no contexts ([]) ✅

    The attest step doesn't print its answer, so the yes is inferred: on a human, same-repo pull_request run, only attested == 'yes' can skip those steps.

    Known limits:

  8. gregoryfoster commented on Nov 27, 2026

    @gregoryfoster
    MemberAuthor

    The Dependabot half is discharged (epic #394 coordinator, 2026-11-27) [measured]: the first dependabot[bot] PRs since the knob turned on (11f4e340) ran CI in full. The test and integration jobs on #467 (run 46051711200, head 6d0c8fd3) and #468 (run 46051718937, head 11a9537a) ran both pytest steps and the no-skip check, all success. The attest step also ran and reported success. The two reasons it would pass, a skipped gate or a stamp, can't be told apart from here. Either way, nothing was skipped. The upstream follow-up on gregoryfoster/skills#688 (closed 2026-11-21) waits for the operator's OK.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions