Repository navigation
Open
Milestone
Description
Idea (from the owner, 2026-10-17): when spawn writes a result object to S3, tag it with what it would cost to regenerate (compute used, output size), e.g. "regenerable for $X in Y hours". Then an object can be tiered or deleted by rule, without asking the researcher. This is the data-side analogue of the TTL reaper, and it addresses the open "leave no trace" question: nothing reaps the auto-created spawn-results-* buckets today.
No issue, doc or code for this existed before; searched spore-host org issues, all repos' docs and code.
What exists today
- Only one writer tags objects:
pkg/staging/staging.go:176(scheduler params,Project/Component/ScheduleID). Task results, queue results and pipeline handoffs go tospawn-results-<account>-<region>/…with no tags. - Two kinds of write path, and they differ on tagging:
- Go uploads (
pkg/agent/queue_runner.go:407, viafeature/s3/transfermanager):UploadObjectInput.Taggingexists, so the tag can go on the same request. - The generated task wrapper (
pkg/taskproto/flush.go,wrapper.go) usesaws s3 cp, which has no--taggingoption (checked against the installed CLI v2). Those needs3api put-object --taggingper object, or aPutObjectTaggingpass after upload.
- Go uploads (
- The inputs to the number exist on the instance. spored tracks total compute seconds and the hourly rate (
spawn:price-per-hour, plus spot price), and the wrapper knows each task's runtime and output size.
Constraints the design has to meet
- Lifecycle rules can't compare numbers. S3 lifecycle filters match prefix, object size and exact key=value tags, nothing like "cost < $5". So "regenerable for $X" can't drive a rule directly. Either the writer also records a class that rules match on (e.g.
spawn:regen-class=cheap|moderate|expensive, with thresholds defined in one place), or a scheduled sweeper evaluates the numeric tags. The class is probably both simpler and auditable. - "Regenerable" must be true, not assumed. Deleting by rule is irreversible. An object is regenerable only if its inputs still exist (and aren't themselves regen-deletable) and what produced it is pinned: spawn/spored version, AMI, container digest, command/spec. Otherwise the tag is a promise nobody checked. The tag set (or a sidecar manifest it points to) should carry that provenance, and a deletion rule should require it.
- Dollar figures follow the pricing honesty rule. The rate must say where it came from (live vs static, the static table's date). Windows rates are currently a Linux lower bound (spawn launch --os windows without --ami silently launches Amazon Linux, and previews it as Windows #884, truffle#185), so a Windows-computed object would understate its regen cost unless labelled. Spot runs should use the spot rate actually paid.
- Tag budget. S3 allows 10 tags per object (key ≤128, value ≤256 chars). Keep the write-time set small: class, cost, hours, bytes, a provenance pointer. Put detail in a manifest object.
- Opt-out per run. The researcher's "never auto-delete this" must win over any rule, e.g. a
spawn:retain=truetag that every rule excludes.
Rough shape
- A small shared package computes the tag set from compute seconds, rate and source, bytes, and provenance. It's used by spored's Go uploader directly and emitted by the wrapper generator as
s3api/PutObjectTaggingcalls. - A lifecycle configuration on
spawn-results-*, created with the bucket: transitionregen-class=cheapto cheaper storage after N days, expire after M, and never touch untagged objects orretain=true. spawnsurface: show an object's regen class/cost incollect-results, and a dry-runspawn results retentionreport before any rule is enabled. Report first, arm later, same discipline as the reaper sweeps.
Refs: "leave no trace" (who reaps the reapers, spawn-results-*), #884, truffle#185.
Metadata
Metadata
Assignees
Labels
No labels
Activity
scttfrdmn commentedon Oct 17, 2026
Checked against the AWS docs (2026-10-17):
ObjectSizeGreaterThan/ObjectSizeLessThan, combined with AND. "Each tag must match both the key and value exactly." No other comparison exists, so constraint 1 (a written class, not a number a rule compares) stands. Note the default minimum object size for transitions (objects under 128 KB aren't transitioned unless the rule allows it). Many task outputs are small, so a tiering rule may need that allowance, or only expire them.PUT Objectand Initiate Multipart Upload (x-amz-tagging), so the transfermanager path can tag large outputs on the same request.Two things on that page fit this design:
s3:ObjectTagging:Putevents: if the class is ever assigned after the write (theaws s3 cpwrapper path), a notification can trigger the classification or audit instead of a periodic scan.docs: record the #1076 decisions
Record task output regeneration cost and provenance (#1076, phase 1)
Record task output regeneration cost and provenance (#1076, phase 1)
Record task output regeneration cost and provenance (#1076, phase 1) (#…
docs: design for retention by regeneration cost (#1076)
docs: record the #1076 decisions
docs: review the #1076 design against what shipped (retain needs a po…
docs: design for retention by regeneration cost (#1076)
docs: record the #1076 decisions
docs: review the #1076 design against what shipped (retain needs a po…
Add spawn results retention, a read-only report on retention by regen…
docs: design for retention by regeneration cost (#1076)
docs: record the #1076 decisions
docs: review the #1076 design against what shipped (retain needs a po…
Add spawn results retention, a read-only report on retention by regen…
Add spawn results retention, a read-only report on retention by regen…
Add spawn results retention, a read-only report on retention by regen…
docs: design for retention by regeneration cost (#1076)
docs: record the #1076 decisions
docs: review the #1076 design against what shipped (retain needs a po…
Design: retention by regeneration cost (#1076) (#1083)
Add spawn results lifecycle and spawn results retain: tiering by rege…