Repository navigation
Record task output regeneration cost and provenance (#1076, phase 1) - #1088
Merged
Merged
Conversation
scttfrdmn
force-pushed
the
feat/1076-phase1-record
branch
from
October 17, 2026 20:57
4f6e1a6 to
fdb0ce1
Compare
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
scttfrdmn
force-pushed
the
feat/1076-phase1-record
branch
from
October 17, 2026 21:23
f18f3d5 to
5ae8e44
Compare
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #1076. Phase 1 of docs/recompute-tag-design.md: record only; nothing is tiered or deleted. Applies the owner's 2026-10-17 decisions:
What a task output now carries
spawn:regen-class,spawn:regen-usd,spawn:regen-hours,spawn:run-id, andspawn:regenerable(only when opted in and every input was readable).spawn.provenance(JSON):docker inspectafter the pull), AMI, instance type, spawn/spored versions;spot(price paid),on-demand:live,on-demand:static, oron-demand(source not recorded). Windows is marked as a lower bound.completion.jsoncost_estimate, defined and never written until now.How
pkg/provenance: classification, cost, the record, tags, andObjectKey. The key mapping is pinned against the realaws s3 cpon a throwaway bucket (recursive with and without a trailing slash, root, single file to a key or a prefix).spored provenance stage-in | cost | upload.uploadreplaces the wrapper'saws s3 cpfor outputs, which is how tags are set at write time. Only an object this run just wrote is ever tagged, and the task role needs no read access to verify anything. The annotation is bound to the uploaded ETag (ObjectIfMatch).spored provenance --helpsucceeding. With an older spored, everything falls back to plainaws s3 cp, exactly as before; otherwise "unknown command" would fail the output upload. The spec copy for spored has env values stripped.spawn task run's role gainss3:PutObjectTagging+s3:PutObjectAnnotationon its write buckets only (action names from AWS's machine-readable service reference). The sharedtaskStagingPolicyused bylaunch --s3-writeand sweeps is unchanged.spawn:price-source(live/static) tagged at launch from whatresolvePricePerHouralready knew, so a cost built from a static rate is labelled static.TaskSpec.Regenerable,LaunchConfig.PriceSource,aws.PriceSourceTag. Snapshot updated.Verified on real AWS (dev account; everything cleaned up)
spored provenance uploadfrom a workstation, against a throwaway bucket: keys matchaws s3 cp --recursive, all four tags were present at upload, and thespawn.provenanceannotation is present and round-trips (run id, class, USD, rate source).PutObjectAnnotation+ObjectIfMatch: right ETag accepted; wrong ETag refused withPreconditionFailed.PutRolePolicyaccepts the exact generated task policy. Simulation: tagging and annotation are allowed on the write bucket and denied on the read bucket.Not yet verified: a real
spawn task runwriting tagged outputs. The instance's spored comes from a release, and without the subcommand the wrapper (correctly) falls back. That's the post-release check.Gates
14 reverts, each kept compiling; every one fails:
regenerable; upload using the record;Wrapper behaviour is tested by executing it under bash with a fake spored and aws. Also fixed a vacuous negative test (
launch_s3_buckets_test) that matched a literal JSON fragment and would have passed whatever the policy said.go vet, staticcheck (GOOS=linux), the hermetic suite, nested modules,check-docsand semgrep all pass.