Repository navigation
perf(http): a derived body is versioned by its code, not by the release - #291
Merged
Merged
Conversation
Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
count-patchula | fb8e5a7 | Commit Preview URL Branch Preview URL |
Nov 13 2026, 02:44 AM |
…e bytes Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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.
Consult 7, PR 12 (approved by the user). Every derived registry representation was keyed by the release (
name+{BUILD}), so each release made every repository cold at once: a full registry download everywhere, the moment the cache peaks hardest.Derivedcarries{name, version, derive}and keys bodies asname@v{version}.BUILDis gone from the http crate. All 38Derivedsites in datasource and notes pass an explicit version; the Docker anonymous pull token, a persisted representation that is not aDerived, carries its own.tests/derived-versions.tsvlists every representation (35): name, version, the source files whose text produces its bytes, the dependency crates whose behaviour does (their locked versions fromCargo.lockare hashed in, socargo update -p pep440_rsfails the guard until the affected rows are bumped), and the SHA-256. The guard also scans each crate's sources forDerived::new("…"and the pull-token constant and fails on any representation not registered.patchula_testkit::derived::checkfails when a source hash changes without a version bump, and checks coverage both ways. Both crates' parity modules run it. To hash precisely, the shared derive engine moved tocrates/http/src/derive.rs(hashed into every row, since it reads and parses every body), and the catalog types, truncation and notes' mirror and changelog compactions moved into their own files; call sites are unchanged.internals/cache.md).name+buildhttp rows; a+in a URL or credential scope is not matched.Behaviour change: a new release keeps cached registry representations whose compaction code did not change.
Proof:
a_derived_body_is_versioned_by_its_code_not_the_release: an entry stored asdoc@v1is read by a later build with zero fetches; a bumped version misses and fetches; adoc+0.0.0entry is never read.opening_drops_per_build_http_representations.every_derive_versions_its_compaction_sourcewith "compaction source changed — bump its version", and passes again once reverted.Follow-ups (not changed here): the extraction cache, lookup hints and catalog views are still per-build state namespaces, so they also go cold on each release; versioning them by their code the same way is the next candidate.
Review round: added
upstream.rstohelm-index,markdown.rsto the changelog rows, the versioning sources to the six rows that sort or filter versions while deriving, the per-row dependency versions and the registration scan. Each gap was demonstrated: editing the file (or a locked dependency version, or adding an unregisteredDerived::new) fails the guard, and the clean tree passes.