Document what physical_key schemes and timestamp tags actually mean - #818
Merged
Conversation
Four comments recording behavior that surprises, found while tracing whether a manifest row's `physical_key` scheme could serve as a local-vs-remote origin signal for a UI recency view. It cannot, and the reasons were not written down anywhere. - `install_paths`: the doc comment claimed installed paths get a `place` pointing at `file://`. They do not — installed rows keep the remote `s3://` key, which is what lets a later push skip the re-upload via `matches_content`. The `place` value in the loop is computed and only logged, and the plan sketch's "replace entry's physical key" step was never implemented. Corrected all three, and recorded that a `file://` key means "committed locally" (written by `commit` and `create`) and must not be read as an origin marker. - `push_package_impl`: the uploaded manifest is built into the *cached* manifests dir and never copied over the installed one on success, so `file://` rows outlive their push and clear only when a later pull or reset refreshes the installed manifest. Safe because `top_hash` excludes `physical_key`, so both copies are the same revision. - `upload_row`: the `file://` scheme check is load-bearing, not defensive. With `use_existing_row_or_upload`'s content-match branch it is what keeps a local key out of a published manifest, and it also hard-errors rather than publishing a row that addresses another bucket's objects. - `tag_timestamp`: `.quilt/named_packages/<ns>/<epoch>` is the registry's only record of revision times, since the manifest format carries none. It is write-only from this client — reading it back needs a list operation the `Remote` trait does not have. Also noted that the tag key holds the *commit* time at one-second resolution, so two commits made within one second collide even when pushed hours apart, the second push silently overwriting the first's tag. Comments only; no behavior change. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
fiskus
force-pushed
the
docs/physical-key-and-timestamp-tag-comments
branch
from
August 4, 2026 15:57
c605905 to
c3a9243
Compare
Review of c3a9243 found five comments whose stated mechanism does not match the code: - `install_paths` doc claimed retaining the remote `s3://` key is what lets a push skip the re-upload. It is not — `matches_content` compares logical_key/hash/size only, so dedup is identical with `file://` keys. Also dropped the "installed rows keep the remote `s3://` key" framing: this function copies rows verbatim, and the installed manifest it is handed carries `file://` for locally committed paths. Recorded the live consequence instead — the caching call parses `physical_key` as an `S3Uri`, so an uncached `file://` row errors rather than being fetched. - `push_package_impl` claimed a later pull or reset clears the stale `file://` keys. Neither can: both short-circuit when `latest` is the hash just pushed. They clear only when another client publishes. - `tag_timestamp`'s collision note read as if the second-pushed revision loses its history entry; it is the first. - `upload_row`'s doc credited the `file://` scheme check with keeping local keys out of published manifests. That comes from the `remote_url` rewrite plus the content-match branch; the check guards the input, and for `s3://` keys `to_file_path` would fail anyway. Comments only; no behavior change. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Member
Author
|
@greptileai please re-review — pushed e1d8c54, which corrects five comments whose stated mechanism didn't match the code (push dedup rationale, the "installed rows keep s3://" framing, the unreachable pull/reset healing path, an inverted antecedent in the tag-collision note, and the mis-attributed |
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.
Comments only — no behavior change.
just lintclean,cargo doc -p quilt-rsclean.These four comments record behavior that surprises, found while tracing whether a manifest row's
physical_keyscheme could serve as a local-vs-remote origin signal for a package-list recency view. It cannot, and none of the reasons were written down.flow::install_pathsThe doc comment claimed "installed paths have
placepointing tofile://location". They don't. Installed rows keep the remotes3://key, and that's correct:physical_keynames where the canonical bytes live, and keeping the remote key is what lets a later push skip the re-upload (matches_contentignoresphysical_key, souse_existing_row_or_uploadcopies the remote key across on a content match).Three related fixes in that function:
placevalue in the loop is marked diagnostic-only — it is computed, logged, and discarded (the error arm still works as an absolute-path assertion);It also records the conclusion that motivated the trace: a
file://key means "these bytes were committed locally" — written byflow::commitandflow::create— and must not be read as a per-row origin marker.flow::push::push_package_implThe uploaded manifest is built into the cached manifests dir, and the success path never copies it over the installed one —
copy_cached_to_installedruns only in the hash-mismatch error branch. So a locally committed row keeps itsfile://key in.quilt/installed/after a successful push, clearing only incidentally when a later pull or reset refreshes the installed manifest.That divergence is safe because
top_hashexcludesphysical_key(manifest::top_hasherhasheshash,logical_key,meta,size), so both copies are the same revision — which is also why thenew_manifest_uri.hash != commit.hashguard doesn't fire on a normal push.io::manifest::upload_rowThe
file://scheme check is load-bearing, not defensive. Together withuse_existing_row_or_upload's content-match branch it's what keeps a local key out of a published manifest: every row of an uploaded manifest goes through one of those two branches, so the key is either replaced with the S3 destination or came from the remote to begin with. It also closes the reverse leak — an already-s3://row whose content doesn't match the destination hard-errors instead of publishing a manifest that addresses another bucket's objects.io::manifest::tag_timestamp.quilt/named_packages/<ns>/<epoch>is the registry's only record of revision times — the manifest format carries no timestamps in either the header or the rows. It's write-only from this client: reading revision times back means enumerating those tag objects, and theRemotetrait has no list operation. Also noted next to the existing collision TODO that the tag key holds the commit time at one-second resolution, so two commits of the same namespace made within one second collide even if they're pushed hours apart —upload_tag's unconditional put means the second push silently overwrites the first's tag.Review pass (force-pushed): corrected two inaccurate claims from the first version —
file://keys are written bycreate_packageas well ascommit, and the tag collision window is governed by commit time, not push time — dropped a non-exhaustive enumeration ofRemote's methods, disambiguated thesuper::commitintra-doc link, and tightened all four comments (72 → 59 added lines).🤖 Generated with Claude Code
Greptile Summary
This PR documents existing manifest-key and timestamp-tag behavior without changing executable behavior.
physical_key.Confidence Score: 5/5
The PR appears safe to merge.
No blocking failure remains.
Important Files Changed
Reviews (2): Last reviewed commit: "Correct five inaccurate claims in the ph..." | Re-trigger Greptile
Context used: