Skip to content

Design: retention by regeneration cost (#1076) - #1083

Merged
scttfrdmn merged 4 commits into
mainfrom
design/1076-recompute-tag
Oct 18, 2026
Merged

scttfrdmn merged 4 commits into
mainfrom
design/1076-recompute-tag

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Refs #1076

Design doc only (docs/recompute-tag-design.md). No code. Draft until the four decisions at the end of the doc are made.

The central point, grounded in a survey of every result write path: an S3 lifecycle rule matches tags by exact value and can't verify anything when it acts. A write-time "regenerable" tag can go stale, because task inputs live in buckets spawn doesn't own and nothing pins the recipe or image digest. So the design lets a rule tier (recoverable), but only a verifying sweeper may delete, after re-checking at deletion time that the inputs are unchanged and the recipe is readable.

Records: class/cost/hours/run-id tags, plus provenance in an S3 object annotation (verified as supported by the SDK in use and CLI v2). Phases: record → report → tier → delete.

@scttfrdmn

Copy link
Copy Markdown
Contributor Author

Owner decisions (2026-10-17), now in the doc:

  • cheap is < $1 and < 1h; expensive is ≥ $25 or ≥ 12h
  • deletion is opt-in per spec (regenerable: true); tiering is automatic
  • cheap: IA at 30d, Glacier IR at 90d; moderate: IA at 60d
  • phase 1 covers task results only

Phase 1 (record only, no retention change) follows as a separate PR.

@scttfrdmn
scttfrdmn marked this pull request as ready for review October 17, 2026 20:26
@codecov

codecov Bot commented Oct 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@scttfrdmn

Copy link
Copy Markdown
Contributor Author

Review, after phase 1 shipped (v0.132.1) and was verified on a real instance. Pushed as one commit.

  1. Design flaw, fixed: spawn:retain=true couldn't work as written. S3 lifecycle filters can AND a prefix, tags and size bounds, but can't negate, so "skip objects tagged retain=true" can't be expressed. Fix: the writer tags spawn:retain=false at upload, and every rule requires it. Setting true then takes the object out of every rule. Objects without the tag (everything written so far) match no rule and are kept. Because PutObjectTagging replaces the whole tag set, setting retain needs a merging command (spawn results retain, phase 3). The writer change ships with phase 2.
  2. Write path described wrongly. The doc said the wrapper tags after upload with put-object-tagging. What shipped tags in the same request as the upload, binds the annotation to the ETag with ObjectIfMatch, and has two fallbacks. Rewritten, including the CLI/spored version skew: instances install the latest spored.
  3. "Static rate with date" isn't possible yet. truffle exposes no collection date (truffle#184). The doc now says so, and the report will too.
  4. The record doesn't contain the output's key, size or ETag; the object itself has them. Prefix inputs carry an ETag but no version id, because ListObjectsV2 returns none.
  5. The phase 2 report spec is concrete now: what "provable" means, that an unreadable input counts as unproven, and that storage prices come from a labelled static table, because truffle prices EC2 only.
  6. Added shipping notes for v0.132.0: every task output fails to upload on an instance (spored provenance S3 client has no region) #1094: test on an instance, not a workstation.

Status line updated. The doc is ready to merge; it holds no code.

@scttfrdmn
scttfrdmn force-pushed the design/1076-recompute-tag branch from 8d35610 to e6d1b59 Compare October 18, 2026 01:46
@scttfrdmn
scttfrdmn merged commit 75226cd into main Oct 18, 2026
10 of 11 checks passed
@scttfrdmn scttfrdmn mentioned this pull request Oct 18, 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