Skip to content

Add spawn results retention, a read-only report on retention by regeneration cost (#1076, phase 2) - #1103

Merged
scttfrdmn merged 2 commits into
mainfrom
feat/1076-phase2-report
Oct 18, 2026
Merged

scttfrdmn merged 2 commits into
mainfrom
feat/1076-phase2-report

Conversation

@scttfrdmn

@scttfrdmn scttfrdmn commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Phase 2 of #1076 (design, reviewed in #1083). Read only: nothing is tiered, tagged or deleted. Refs #1076. That issue stays open for phases 3 and 4.

spawn results retention [--bucket] [--prefix] [--objects] [-o json]. It defaults to spawn-results-<account>-<region>. Run by run, it reports:

  • the bytes stored and the monthly storage cost;
  • the cost once the decided tiering rules (Decisions 3) would have moved it, with a reason for every object they wouldn't move;
  • whether the deletion sweeper could prove the run regenerable today. That means the spec opted in, the annotation is readable and matches, the recipe is pinned, and every recorded input still exists with the same ETag, checked at its recorded version where there is one. Every failing reason is listed. An unreadable input counts as unproven, never as unchanged.

It also lists untracked objects (no spawn:run-id), which are kept. An object whose tags can't be read makes the report say INCOMPLETE and is left out of every figure.

Prices. Storage dollars come from a static us-east-1 table read from the AWS Price List API on 2026-10-17. Every figure is labelled static, with the reason (truffle, the pricing authority under #533, prices EC2 only) and the date. A static instance rate is called out with truffle#184 (no collection date), and Windows with #884 (lower bound).

Also in this PR:

Gates: each fails against a revert that compiles.

  • Unreadable input treated as unchanged
  • Opt-in not required
  • retain=false not required
  • Recorded version ignored
  • Changed ETag ignored
  • Tag-read error dropped
  • spawn:retain not written as false

The tiering table is written from the design's Decisions 3, not read off the code.

Live checks (dev account):

  • Read only, against the real spawn-results-435415984226-us-east-1: 182 untracked objects, as expected.
  • Throwaway bucket in us-west-2, with the CLI in us-east-1 (approved). Three runs were written with a locally built spored provenance upload; then one input was overwritten and another deleted. The report showed the unchanged run as provable, the overwritten input as changed (both ETags shown), and the deleted one as not opted in plus gone. The 128 KiB and under-30-days tiering reasons were correct, and the JSON matched. The bucket is deleted (HeadBucket 404).

Local checks:

  • Pass: go vet ./..., the full short suite, all 9 nested modules, staticcheck (GOOS=linux), semgrep and check-docs (with docs-gen/results.md).
  • One exception: the _Docker taskproto tests hung because the local Docker daemon is unresponsive (docker info times out). CI runs them on Linux.

@codecov

codecov Bot commented Oct 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 71.77419% with 105 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/results.go 55.47% 53 Missing and 8 partials ⚠️
pkg/provenance/report.go 87.11% 13 Missing and 12 partials ⚠️
pkg/provenance/report_aws.go 0.00% 15 Missing ⚠️
pkg/pipeline/stage_runner.go 0.00% 2 Missing ⚠️
pkg/s3transfer/bucketregion.go 91.30% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@scttfrdmn
scttfrdmn force-pushed the feat/1076-phase2-report branch from 9be514e to 7b5554f Compare October 18, 2026 01:28
@scttfrdmn
scttfrdmn merged commit 1d56138 into main Oct 18, 2026
8 checks passed
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