Skip to content

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

Open

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 23, 2026

    @gregoryfoster
    MemberAuthor

    Notes for #147, collected by the coordinator (epic #84), 2026-11-23:

    The brief comes when this child is next, after #143's phase 2 (from 2026-11-25). The epic's #147 line names the hazards it will weigh. The main one: Processor merges by fast-forward, so main's push run tests the commit the PR attested, and the deploy gate reads that run.

  2. gregoryfoster commented on Nov 24, 2026

    @gregoryfoster
    MemberAuthor

    Brief: #147, adopt shipping-work's local-gate attestation (coordinator, epic #84, 2026-11-24)

    Authorities:

    • The reference is skills/shipping-work/references/attestation.md at the vendored 9443df67 (PR chore: update skills submodules #150, merged 2026-11-24 as c817b34).
    • This issue's body is the upstream notice. Its notes comment (7114924517) still holds: the pin table, and branch from 4127d5c or later. Branch from c817b34.
    • This brief adds a pre-flight against origin/main c817b34.

    Labels:

    • [measured]: run in this pre-flight;
    • [traced]: read in the code or a diff;
    • [stated]: a doc or issue says so.

    Why now

    Pre-flight [measured, 2026-11-24]

    • Vendored skill: skills/shipping-work is one tracked link to the vendored directory, not per-file links, so _attest-gate.sh is already present. push.sh there carries the attestation.
    • Token: GH_TOKEN (fine-grained) now has Commit statuses: Read and write, granted 2026-11-24.
      • Reading the combined status works.
      • Posting with an invalid state returned 422 (validation), not 403. Nothing was posted.
    • Push target: origin is github-processor:CannObserv/processor.git. _attest_repo_of resolves the alias through ssh -G to github.com, so the write goes to CannObserv/processor.
    • Clean-tree rule:
    • Scratch Redis: the local scratch redis-server is 7.0.15, the same as CI's image.

    The hazards, and what this brief decides

    1. The deploy gate. Processor merges by fast-forward, so main's push run tests the very SHA the PR attested.

    • scripts/deploy.sh requires lint and test to be success on that push run [traced: :56, :255-282].
    • A step the if: skips leaves its job success. With the reference step as written, the push run would skip pytest, and the deploy would pass with no runner test.
    • A job the if: skips reads skipped, which deploy.sh refuses. That is CannObserv/broker's shape, which needs a daily schedule. Here it would block every deploy of an attested commit.

    2. The local gate doesn't run the integration tests.

    • shipping-work's pre-ship.sh deselects every integration-marked test with its own plugin (:569-593) and runs --no-cov.
    • That's 60 of 1,124 tests [measured: --collect-only]: the bus contract against the broker's Redis.
    • So the reference's skip, applied to uv run pytest, drops a tier no gate ran. The runner's pytest step takes about 1m39s, of a 2m12s test job (push run on 4127d5c).

    3. Job-level permissions override the workflow's.

    • Both jobs set their own ({contents: read, id-token: write}), so statuses: read must go on the test job. At workflow level it is ignored (CannObserv/broker's finding).
    • tests/test_ci.py:58-61 (test_cloud_access_is_job_scoped) asserts the exact dictionaries, so it changes too.

    4. tests/test_ci.py reads run: lines by joining them (_runs), not by shlex. CannObserv/status's apostrophe trap doesn't apply [traced]. But test_the_whole_suite_runs_against_the_brokers_redis (:212-218) unpacks exactly one line containing pytest. A second pytest step breaks it, so it changes with the design.

    Operator decisions

    • [Operator decision: CI shape — recommend CannObserv/status's.
      • Read the attestation only on pull_request: if: github.event_name == 'pull_request' on the attest step.
      • Skip at step level inside test, with the reference's if: verbatim.
      • Every push to main then reads nothing and runs the full suite, so deploy.sh and CI_JOBS stay unchanged.]
    • [Operator decision: the integration tier on an attested PR — recommend run it.
      • An attested PR skips only what the local gate ran. Add a step that runs uv run pytest -m integration when the full suite is skipped, so every PR's runner still checks the bus contract against the broker's Redis.
      • Otherwise (CannObserv/status's choice) main's push run is the only backstop. Under fast-forward, main has already moved by then, and a red run blocks deploys until it's fixed.
      • It saves nothing billed either way.]
    • [Operator decision: no schedule — recommend none, as CannObserv/status.
      • The reference keeps a scheduled run because a directly shipped commit gets no other clean-runner run.
      • Here merge_mode is pr, and every commit that reaches main gets a full push run.]

    Starting the thread approves these recommendations.

    What it touches on main [traced on c817b34]

    Place Change
    .skills/attest-local-gate (new) on, committed: read from the shipped commit, not the work tree
    .github/workflows/ci.yml test (:84-155) job permissions gains statuses: read. The attest step goes after uv sync, if: pull_request. pytest takes the reference's if:. The integration step runs only on the inverse. Comment the step-level choice, as at CannObserv/status ci.yml:115-126
    tests/test_ci.py :58-61 exact permissions (lint unchanged, test adds statuses: read); :212-218 (the full suite still has no -m; the integration step is exactly -m integration). New: the if: never skips on push, workflow_dispatch, a bot's PR or a fork's PR; the attest step runs only on pull_request; it reads the combined status with per_page=100
    tests/test_shipping_knobs.py read the knob through the skill's own attest_read_knob (_attest-gate.sh:97), as the file already does for merge_mode and deploy_command
    docs/SKILLS.md :14's knob row, and § Shipping's table (:80-83): an attest-local-gate row
    docs/DEPENDENCIES.md :21 setup-uv → v10.4.0 (PR #148). A short attestation section, Dependencies and CI being this file's subject: what is skipped and where, the trust caveat, never a required status
    docs/DEPLOYMENT.md § The CI gate one line: the push run always runs the full suite, so the gate's meaning is unchanged
    AGENTS.md at most a word in the CI row. It sits at its budget (5,945 of 6,000 at #126); .skills/context-budget decides

    Done when

    • The knob is committed on. The PR's push printed Attestation: gate/local = success posted on <sha>, and the combined status shows it.
    • The PR's own run is the first real one, because it carries the new ci.yml. By step:
      • attest reads attested=yes;
      • pytest is skipped;
      • the integration step ran 60 and passed;
      • lint ran in full.
    • After the fast-forward, main's push run on the same SHA: attest is skipped, pytest ran the full suite, and lint and test are green.
    • Not deployed. No runtime path is touched, and the hourly drift check stays ok.
    • The PR says Refs #147: the Dependabot case stays open (below).

    Known debt to carry

    Out of scope

  3. gregoryfoster commented on Nov 24, 2026

    @gregoryfoster
    MemberAuthor

    Brief check against origin/main c817b34 (implementer, 2026-11-24)

    Every traced reference holds: ci.yml test :84-155, test_ci.py :58-61 and :212-218, deploy.sh :56 / :255-282, drift.py :63-67, pre-ship.sh :569-593, _attest-gate.sh:97. --collect-only gives 60 of 1,124 integration tests [measured]. pyproject.toml's addopts carries no -m, so -m integration on the command line replaces nothing. .gitmodules and .git/config set no ignore, and no path is skip-worktree or assume-unchanged [measured]. Building on the three recommended decisions.

    Corrections and additions:

    1. .skills/doc-sensitive-paths, not in the brief's table. It names each shipping-work knob (merge_mode … gate-stamp-inputs), so a knob edit sends doc-check to docs/SKILLS.md. attest-local-gate joins that list. test_each_doc_sensitive_path_matches_a_tracked_path covers the new entry.
    2. docs/SKILLS.md:14 also says test_shipping_knobs.py reads "the first two" knobs through the skill's readers. With this change it reads three.
    3. docs/DEPENDENCIES.md: the pin table's lead-in ("with setup-uv moved by chore: bump astral-sh/setup-uv from 10.3.2 to 10.3.3 #110") gains chore: bump astral-sh/setup-uv from 10.3.3 to 10.4.0 #148, along with :21's v10.4.0.
    4. How the if:s are tested. tests/test_ci.py evaluates both if:s with a small evaluator for GitHub's expression syntax, over an event matrix: push to main, workflow_dispatch, an attested PR, an unattested PR, a bot's PR, a fork's PR, and a tag. It does not compare strings. It also pins the integration step's if: as exactly !(<pytest's if>), so the two steps can't both skip and can't both run.
    5. Budgets [.skills/context-token-counts]:
      • AGENTS.md: 5,945 of 6,000, so 55 tokens free. The CI row gets a short parenthetical at most.
      • DEPLOYMENT.md: 9,473 of 10,000.
      • DEPENDENCIES.md: 8,643 of 10,000.
        The attestation section stays short.
    6. The status race on later pushes. On the PR's first push, push.sh posts the status before the PR exists, so the PR's first pull_request run finds it. A later push to the PR (a CR commit) starts its synchronize run as it lands, and the status follows seconds later. The attest step sits after uv sync, about 30 s into the job, so it usually finds it. If it doesn't, that run runs the full suite, which fails safe.
  4. gregoryfoster commented on Nov 24, 2026

    @gregoryfoster
    MemberAuthor

    Shipped to PR #151 (awaiting the operator's FF merge)

    PR: #151. Head is 6c09fb7a78cea98f94b9eec199f2922e181ed580, ten commits on c817b34 (51f6032..6c09fb7).

    • The knob. .skills/attest-local-gate is committed on. push.sh reused the gate's stamp for this exact tree (1,083 passed, 15 skipped, 60 deselected) and printed Attestation: gate/local = success posted on 6c09fb7…. The combined status reads gate/local success (19:40:52Z).
    • ci.yml test:
      • statuses: read sits on the job.
      • The attest step runs on pull_request only.
      • pytest takes the reference's if: verbatim, at step level.
      • pytest (integration) runs on !(<that if>).
      • No schedule. deploy.sh and CI_JOBS are untouched.
    • Tests. tests/test_ci.py evaluates both if:s over every trigger, attested and not: exactly one of the two steps runs, and the full suite never skips outside an attested human PR. tests/test_shipping_knobs.py reads the knob through attest_read_knob.
    • The first real run (PR run 45472831889, on 6c09fb7):
      • attest → attested=yes;
      • pytest → skipped;
      • pytest (integration) → 60 passed, 1,098 deselected;
      • lint ran in full;
      • both jobs succeeded.
    • CR. CR 1–5 are fixed in their own commits (eb859d9, c453ade, 48fdcd0, 3318878, 6c09fb7). CR 6 is stet: AGENTS.md is at about 5,962 of 6,000 tokens (offline estimate), which is within budget and what the brief allowed.

    Known limits:

    • main's push run on 6c09fb7 (attest skipped, full suite) can't be seen until the FF merge.
    • The Dependabot case is unverified until the next github-actions PR (weekly). That run must show pytest run in full. Refs #147, so the issue stays open for it.
    • The status race on a later push to a PR (a synchronize run that starts before the write lands) is unobserved. It fails safe: that run runs the full suite.
    • The if: evaluator in tests/test_ci.py doesn't model a step's implicit success() &&, and refuses a bare ! (CR 1, CR 3). Real syntax was proven by this PR's run, not by actionlint, which isn't installed here.

    For #84:

    • An upstream finding, for the operator to post or not:
      • The reference's skip drops a tier pre-ship.sh deselects: every integration-marked test. Processor runs that tier on the inverse condition, as a second step.
      • The vendored reference could say so, and could offer that second step.
    • skills#688 asks its first adopter to report back that an attested human PR skipped its heavy tier and a Dependabot PR didn't. Processor has the first half (run 45472831889). The second half follows the next Dependabot PR. Posting needs the operator's approval.

    For #143:

    • Phase 2's PR is the second attested push.
    • Ship from a clean worktree, submodules included. push.sh asks the gate before it pushes, which takes about 2 min unless the tree's pass is already stamped.
    • Its PR run should again skip pytest and run the integration tier.

    For #54:

    • A Redis pin move touches ci.yml's services.redis.image only. It conflicts with this change textually, not semantically.
    • The integration step runs against the same service.
  5. added 3 commits that reference this issue on Nov 24, 2026
  6. gregoryfoster commented on Nov 24, 2026

    @gregoryfoster
    MemberAuthor

    CR round 2 on PR #151, new head 056d23e0b23f898011754c05c54f979fdf99ef3c

    • CR 7 (6167391): the test docstring and ci.yml's comment now give the real reason the read is PR-only. Under fast-forward, main's SHA is the PR's head and carries its gate/local, so a read on main's push run would skip the suite on the run deploy.sh reads. The earlier text gave CannObserv/status's reason ("a merge GitHub made carries no status"), which is false here. Behaviour was already covered: test_a_status_never_skips_the_suite_outside_a_humans_pr checks the push-to-main case with the status set.
    • CR 8 (8c5719f): test_shipping_knobs.py's docstring says which checkout each reader reads.
    • CR 9 (056d23e): the knob test is renamed test_attest_local_gate_is_on.

    push.sh ran the full gate on the new tree (1,083 passed, 15 skipped, 60 deselected) and attested 056d23e.

    The synchronize run (45484170334) checks the status race the earlier comment's Known limits listed as unobserved:

    • attest read attested=yes, so the status landed before the step ran;
    • pytest was skipped;
    • pytest (integration) passed 60, with 1,098 deselected;
    • lint ran in full.

    The race stays possible on a slower write, and it fails safe.

  7. gregoryfoster commented on Nov 24, 2026

    @gregoryfoster
    MemberAuthor

    Merged: PR #151, fast-forward to 056d23e0b23f898011754c05c54f979fdf99ef3c

    main went c817b34..056d23e by git merge --ff-only and git push from the main checkout. GitHub marked PR #151 merged at 2026-11-24T21:05:37Z.

    main's push run (45487533897, same SHA):

    • attest was skipped;
    • pytest ran the full suite: 1,118 passed, 40 skipped;
    • pytest (integration) was skipped (its tests ran inside the full suite);
    • lint ran in full;
    • both jobs succeeded.

    So the run deploy.sh reads means what it did before.

    Not deployed. The merge touched no processor.drift.RUNTIME_* path. Live stays 4127d5c. The drift check before the merge read ok (20:38Z, "1 commit ahead, none that runs"). The first one to see 056d23e runs at 21:38Z.

    The worktree and branch are removed.

    Known limits:

    • The Dependabot case is still to come. The next github-actions PR must show pytest run in full and the integration step skipped. That run is this issue's last live check. Then close.
    • The drift check at 21:38Z is pending at the time of writing.
  8. gregoryfoster commented on Nov 24, 2026

    @gregoryfoster
    MemberAuthor

    For #84: both upstream notes are posted, each with the operator's approval (2026-11-24):

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