Repository navigation
fix(tests): authenticate unpinned clones and realign the lineage fixture - #4573
Merged
Merged
Conversation
The immutable-tree clone read its expected file set from `_archive_files`, which returns manifest dicts, through an unpacking that assumes the `(path, size, digest)` records `_manifest_file_entries` produces. Every clone of a source without a pinned manifest therefore compared the literal keys "path"/"size"/"sha256" against the real tree and refused. The lineage-validation census reads through the production envelope route, so the hand-built partial index it runs against must declare every production column of the tables that route selects. Index schema v85 added `attachment_refs.direction` and `producer_ref`; the fixture kept the v84 subset and every composed read failed. Set the seeded-artifact GC grace default to the bound the locks already imply rather than a 24 h retention window. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01YGi8wLWGR2HYBh8p8fXFXz
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Team Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
Summary
Two red test classes, one product-code-adjacent bug each in test infrastructure, plus the seeded-cache GC grace default.
Problem (evidence)
Class A — 7 errors in
tests/unit/infra/test_pathology_zoo.py, all at fixture setup withValueError: immutable fixture clone failed authenticated file-set validation.Not a stale cache entry: the cached tree validates byte-for-byte against its manifest.
_clone_immutable_tree_unlockedcomputed its expected set as_manifest_file_entriesreturns(path, size, digest)records;_archive_filesreturns{"path":…, "size":…, "sha256":…}dicts. Iterating the dict branch unpacks its keys, soexpectedwas the single entry{"path": ("size", "sha256")}. Adding the diverging paths to the error message showed it directly:missing=['path'] extra=[<the entire real tree>].The unpinned branch is
clone_pathology_zoo, which clones an already-materialized tree by passingfiles=(). Every such clone refused unconditionally.Class B — 8 failures in
tests/unit/devtools/test_lineage_validation.py. The envelope is right; the fixture is wrong. The census reads throughread_archive_session_envelope, the production route, against a hand-built partial index. Index schema v85 (#4563) addedattachment_refs.directionandproducer_ref, whichpolylogue/storage/sqlite/queries/attachment_records.pyselects; the fixture still declared the v84 subset, so every composed read raisedOperationalError: no such column: r.directionand surfaced ascomposed_messages=None/safe=False.GC grace period.
gc_seeded_archive_artifactsdefaulted to a 24 h window. The cache, per-key, and final-root flocks already hold across every inspect/delete interval, so an in-flight build, lease, or clone is excluded without reference to age; the window was retention, not protection.Solution
_manifest_file_entriesso the comparison always sees(path, size, digest).attachment_native_idstable the same query joins.test_hand_built_index_declares_every_production_column_of_route_backed_tables: the next schema bump fails by name here instead of as "no such column" inside an envelope read. Layeringinitialize_archive_tierover the shaped tables was tried first and does not work — its indexes and views reference columns the deliberately-partial tables do not carry (no such column: sort_key_ms).SEEDED_ARTIFACT_GC_GRACE_PERIOD_S = 10 * 60, used by both the function default and--grace-period-s. Leases are flock markers with no time bound of their own, so there is no lease bound to adopt; ten minutes covers only the unlocked instant between publication and a new tree's first lease.Verification
Anti-vacuity for the new clone test: the first clone is red if the enumerated records are not normalized before comparison; the tampered clone is wrongly accepted if the comparison is dropped.
Residuals
Four failures in
tests/unit/infra/test_workload_artifacts.pyare inherited, verified by stashing this diff and rerunning at the clean branch base (ec8d119) — identical set, identical failures:test_seeded_archive_is_reused_by_a_later_commit,test_seeded_archive_publishes_valid_immutable_real_pipeline_artifact,test_seeded_archive_corruption_is_refused_by_a_fresh_process,test_artifact_gc_preserves_active_per_key_lock_and_query_lease. The first reportsNameError: name '_SMALL_SPECS' is not definedfrom apython -csubprocess program that does not define it. All four passgrace_period_sexplicitly where relevant, so the GC default change is not implicated. Not fixed here; out of both beads' scope.Verification is selected, not the corpus.
🤖 Generated with Claude Code
https://claude.ai/code/session_01YGi8wLWGR2HYBh8p8fXFXz