Repository navigation
Keep page evidence and traversal work linear - #3659
Merged
Merged
Conversation
MessagePage.evidence_for rescanned every source page for each message (O(page^2) per history read); message_evidence indexes the source pages by view key once and pairs every message with its evidence page. HistoricalSources.integrated_page re-combined every page into a new MessagePage on each loop, and each historical part opened a full live page read only to learn whether live messages follow. The remaining budget and continuation now follow from the newest part, the pages are combined once, and one traversal asks the live bus once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
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.
|
debt-src at dbc42ad, every finding: |
trissim
enabled auto-merge
October 30, 2026 09:12
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
P993: 2 production files, +25/-16 against current main. Existing implementation commit
7fa5b861c7b3542dc7f8f77a7a06bfb32f21d168retained; main integrated by merge at45b06843c8c05046a64eefec5d57a2d5c4cb01c2, then refreshed again at published head5214de7953297f932f9b2ce8a87ab4cf9940f03a(remote equals HEAD; zero commits behind fetched main). No competing Core PR.This repairs three repeated-work paths in one history-page read. The paired Toad consumer is OpenHCSDev/toad#1360, published at
999edc483a9f034a546080cdc4e93c6dad2fc22d(+2/-2 in WireSource.read); it must land after this Core PR, with its agent-comms lock refreshed from merged main. Do not mistake this source checkpoint for installed acceptance.Evidence ownership: MessagePage
Before: WireSource asked
evidence_for(message)for every fragment, and each call walked the source pages and their messages again.After:
MessagePage.message_evidence()builds one invocation-local dictionary from the originalsource_pages(or the page itself), keyed by each row'sview_key. It returns messages inself.messagesorder, paired with the original evidence-page object only if that page's selection has evidence. No field, persistent index, cached_property, compatibility alias, or alternate evidence owner was added.Deleted: the four-line
evidence_formethod. The sole production consumer is ToadWireSource.read, which must consume the pairs directly.Traversal ownership: existing PageBounds and PageTraversal
Before: every part recombined all messages collected so far, then recomputed its remaining budget from that accumulated page.
After: the first page starts a deque,
bounds.after(first)establishes the remaining budget, andfollowing.after(part)advances it after each admitted part.following.fits(len(part.messages))checks that part against that remaining budget. The existing traversal appends at the correct chronological end.MessagePage.combineruns once after the loop, or not at all for a singleton. First/last edge flags, original source-page identities, revision consistency checks, and ordering remain with their existing owners.Live-existence lifetime: one integrated traversal
Before: every historical part performed another limit-one live page read just to answer whether newer live messages exist.
After: one local
functools.cachecallable is created byintegrated_page, passed to_source_page, and queried only when a historical page needs that answer. It performs at most one such limit-one live read per traversal. This does not cache history or replace the normal requested live page.Source evidence and limits
NRA's existing
parse_python_module_rootsandModuleSyntaxIndexinventoried both Core and Toad production roots: 917 parsed modules, 13 related modules, zero parser failures. Retained declaration, inheritance, decorator, import, write, decision, and named-consumer evidence:/home/ts/.cache/agent-scratch/producer-digest/p993-source-before.json. Dynamic bindings and runtime mutation are not resolved by this syntactic inventory.Reviewed: MessagePage.combine/select and SelectedDisplay.select; HistoryArchive.page/integrated_page/_source_page; PageBounds.after/fits; both traversal directions; Toad WireSource.read and its fragment/evidence consumers. Existing #3670/#3566 and #3607 historical_views changes are outside these edited methods; Toad #1319 changes the same fragment-constructor line and its extra page argument must survive integration.
Hosted run
41031189252, debt-src job123981126381, failed on the old pinned Toad'swire_history.py:326call toevidence_for. Paired Toad #1360 deletes that call. The same hosted output reports E501 warnings at the two changed Core methods and the order-prescribed None-shaped signature/loop; no other growing blocker was reported by that run. The pair needs integration-owner combined qualification before Core can land, then its Toad lock refresh. Core auto-merge is enabled; neither merge nor application acceptance is claimed.No author pytest, local ratchet, profiling, install, application imports, or provider probes were run. The first source-inventory command failed before execution because the NRA checkout had no venv; rerunning that source-only inventory with the existing Core interpreter succeeded. That is not a behavioral test result.
Integration owner still owes combined controls covering Core
tests/test_historical_views.py(both directions, source identity, sparse archived acknowledgements) and Toadtests/textual/test_wire_source.py, then the actual Toad channel journey with attached archived history: same message order, original read evidence, and has-newer edge while scrolling backward. No measured speedup or live acceptance is claimed.Assumed:
The page already knows where it came from. We can stop asking the entire archive for a character reference.