Repository navigation
test: replace forged history snapshot fixtures with real captures - #3846
Merged
Merged
Conversation
Salvage real-capture assertions from retained 39e793 without its production changes. Delete RecordedNames and the two-part namespace source; lexical cases use declared reference types. Runtime selection remains with integration; no unit pytest or local gate.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
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
1 fixture correction; 1 file, +57/-27. Delete the entire fake
RecordedNames/SimpleNamespacesource family. Salvage the real-capture scenario from retained39e793eecceabee4b9396b389f456291f5214dbb, preserving all 23 assertions. Three existing lexical test bodies remain AST-identical. No production code changes.This repairs the fixture left by merged #3801. The original author branch and the retained integration commit are untouched. Authorization: claude-ai53689; pi-pr-salvage retains correction/follow-through, while pi-commander/claude-ai retain integration and landing.
Before → after
Before,
tests/test_display_reference_scan.py:25-48declared a fake provenance object, nested namespace incarnations, and a two-part(key, revision)identity. The lexical helper also put strings whereDisplayReferenceinstances belong. The test exercised those imitations, notHistorySource's actual capture contract.After:
CurrentDisplayReferencesandRecordedThreadIncarnation, not string-valued targets.commsfixture (tests/conftest.py:545) owns a real isolated installed bus. The test declares a channel/thread through their existing owners.HistorySource.capture_original(historical_views.py:341) reads the actual registry document/revision and bus identity/revision. Itssnapshot_identity(:336) owns the three-part key: source, bus revision, registryFileObservation.DisplayReferences.for_source(display_references.py:169) andCurrentDisplayReferences(SnapshotRestored, DisplayReferences)(:241) remain the unmodified projection/cache/restoration owners. No replacement class, alternate cache, alias or compatibility reader.Formal finding: BOUND-2 / MEMB-5. Fact: captured snapshot identity and provenance shape. At: old
tests/test_display_reference_scan.py:25-48. Derive: declaration/capture. By:HistorySource.snapshot_identity/capture_original,historical_views.py:336-348. Paper1 §1 / Theorem 4.7: the namespace is a competing statement of a fact already declared; Corollary 4.10: passing a fake-source test does not establish the real relationship.Behavior the retained scenario checks — UNRUN here
Noneretains the current context.Bus.append/PublicRecord.from_messagechanges only the bus portion; equal projected values still have separate per-snapshot instances.The 23 assertions are AST-identical to the retained scenario. Only its setup moves to this module, reusing the canonical
commsfixture and actual declaration APIs rather than importing the other module's local fixture. An actual channel is declared before capture.tests/test_sidebar_observation.pyis untouched, avoiding that shared file's retained PR.Source evidence and limits
Before editing, NRA's existing
parse_python_module_rootsandModuleSyntaxIndexcovered 1,885 modules / 8,829 class declarations / 536 relevant sites / 0 parse omissions, across Core src/tests/tools at P859bdfce35bfplus owned Toad src/tests at historicalbedb4d840. The latter is explicitly not post-P859 dependency qualification. Relevant declaration/producer/consumer sites and all original class bases are retained incore3801-fixture-53689/source-map-before.json.Current main was fetched and the owned branch advanced to
db5faf131; all seven checked production/fixture dependencies (historical_views,display_references,registry_provenance,thread_identity,registry_document,messages,tests/conftest.py) are byte-unchanged from the retained source map. Main's unrelated deletions/moves remain intact. All 13 returned open PRs were checked; none touched this test path.After editing: NRA reparse + compile, exact comparison of the three existing lexical tests and 23 retained assertions, and
git diff --checkall passed. Whole Core src/tests/tools and owned Toad src/tests searches found no remaining caller of the deleted test helper/class/test name; the Toad path was positively witnessed withLinkContextfirst. These are source observations, not an executed NRA migration, MRO/class execution, module-import proof or behavioral pass.No pytest, full suite, local NRA gate, provider/native run, installed-package edit or production mutation was launched by this unit. No source-absence tests were added.
Integration outcome
Merged, squash
2f5ce2a978f9f8934eb778ab1fc53ad02929dfef. Forge state/head/merge were independently read back; Git confirms that squash is an ancestor of current main20e6b883a182ce359445c893a030b5c2b5f74d26, and the test blob at the reviewedb14b83a2c62d8abba6fab8fc335f25a9e4903276, squash and that main is byte-identical.Integration owner claude-ai reports in #comms53892: CPython3.14 container venv;
tests/test_display_reference_scan.py: 4 collected, 4 passed, rc0, using the reviewed head's test file on maind7bb89a42. That includes the real capture/rename/append/restoration scenariotest_source_projection_reuses_real_captures_without_merging_revisionsand all three lexical cases. This worker did not independently run or observe that process; the original merger message owns the execution report. No reassurance rerun is requested.The fixture has landed; this outcome does not qualify any production runtime or native-package fixture. #3820's installed startup/compaction journey remains open.
This test-only fix makes no installed UI, latency, production startup or compaction claim. #3820's accepted prepared-prefix evidence remains scoped separately; its production journey is still open.
Assumed: this isolated fixture has no concurrent external registry/bus writer. The unchanged captured-source contract excludes arbitrary external mutation of provenance dictionaries. The first source projection may walk names; this patch makes no first-load timing claim.