Skip to content

feat(proof): proof receipts, so CI can skip work a machine already proved - #18

Closed
SpoBo wants to merge 8 commits into
masterfrom
proof-receipts
Closed

SpoBo wants to merge 8 commits into
masterfrom
proof-receipts

Conversation

@SpoBo

@SpoBo SpoBo commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

Implements #17, after a design review with the user (v2, "simple integration").

What a repo adds

# 1. Where the job's command runs, in CI and in the local pipeline:
taskguard --receipt unit-tests -- <the command, unchanged>
# 2. One step in a small first CI job:
taskguard proof check unit-tests --github-output
# 3. On the heavy job:
#    if: needs.<that job>.outputs.unit-tests != 'skip'

What taskguard does

  • Run. Hashes the files on disk before and after the command (temp index; the real index does not change). Same hash: a receipt, green or red. A file changed during the run, or an ignored .env* file: no receipt.
  • Publish, by itself. Laptop: a background process watches the branch on GitHub (1 h) and posts taskguard/ID when the head has exactly the tested files; no checkout needed. GitHub Actions: posts at once on the PR head. --no-publish keeps it local.
  • Check. Reads the PR head and labels from the Actions event, waits up to 30 s. Green (from an OS --os accepts): skip. No status, red, a taskguard:ci[:ID] label, a gh error: run.
  • proof publish (by hand), proof show, proof log ID (commits on main, least proven first).

Not in the issue's design, on purpose

  • No policy file, no --partial/levels, no install/uninstall, no push hook. The receipt name is the contract.
  • A red status does not skip CI.
  • Storage: tables receipts and receipt_posts (new, additive).

Tests

Unit: status description, skip/run decision, Actions event, log ranking. CLI with a real git repo and a fake gh: receipt tree equals the later commit tree, index untouched, change during the run, red receipt, .env, background publish once the branch has the files, CI posting on the PR head, check with labels from the event, publish by tree without a checkout.

🤖 Generated with Claude Code

SpoBo and others added 8 commits October 9, 2026 12:12
…atuses, so CI can skip proven work

taskguard --receipt ID runs the policy command for ID and keeps a receipt
when the files on disk did not change during the run. proof publish posts
receipts as taskguard/ID statuses on the commit with the same tree, and
proof check tells CI per ID to skip or run. proof show, log, install and
uninstall read receipts back and set a repo up.

Refs #17

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…l ones, check runs unknown ids

- publish without --sha follows HEAD for --wait seconds, so a pipeline can
  start it with the receipt and push later; --receipt ID --publish SECS
  starts it in the background
- a partial receipt on the same files no longer hides a full one
- proof check --github-output treats a missing policy or id as run, so a
  branch without the policy does not fail CI

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…may go away; check stops waiting on a gh error

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…y name

A repo now adds three things: `taskguard --receipt ID --` in front of the
job's command, one `taskguard proof check ID --github-output` step, and an
if: on the job.

- --receipt ID takes the command; .taskguard/proof.toml, levels and
  --partial are gone
- a receipt publishes by itself: on a laptop it watches the branch on
  GitHub, in GitHub Actions it posts on the PR head at once; --no-publish
  keeps it local
- the status records a fingerprint of the command line
- proof check reads the PR head and labels from the Actions event, waits
  30 s there, and takes --os
- proof install and uninstall are gone

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…sted files gets the status

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@SpoBo

SpoBo commented Oct 12, 2026

Copy link
Copy Markdown
Owner Author

Closing for now. DALP chose a simpler route: a "verified" block in the PR description that its CI planner checks (settlemint/dalp#16490). The live demos on this branch led there. The branch proof-receipts stays, so this can come back if a repo needs receipts.

@SpoBo SpoBo closed this Oct 12, 2026
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