Repository navigation
Re-anchor every linked book in the host - #507
Draft
imnasnainaec wants to merge 10 commits into
Draft
imnasnainaec wants to merge 10 commits into
imnasnainaec wants to merge 10 commits into
Conversation
3j re-anchors each linked book as the read delivers it, so the read now hands its tokenized text to onBookRead listeners, ahead of the edit report for a reread. onTextRead and getTextBookIds name the books holding text once every book has read, for staling links into the rest. Part of #449. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The host's pass runs the WebView's own pass over a draft and puts each link it rewrote, with the draft's record when it moved a split. Parity tests check the result against the WebView pass on its drift and missing-book cases, from the whole draft and from one book's analysis. Part of #449. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
EditHistory records each pass a session runs while a step predates it, and after an undo or redo re-anchors what it restored to the latest text of each book passed over since that step was captured, as the WebView's history does. The undo or redo returns its changes merged with the re-anchor's. A pass is no step, and a pass no held step predates is forgotten. Part of #449. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each case of reanchor-analysis.test.ts and reanchor-draft.test.ts now also checks that the host's change set brings the draft to what the WebView's pass gave, and that the pass over the book's analysis alone makes the same changes. Five fixtures that gave two links one id now give each its own, as the host's records need. Part of #449. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
perf:bench now re-anchors every book of each tier both ways, the host's from the book's analysis alone, and reports books changed by each and books where they disagree, ignoring the time each pass stamps. On every tier they agree. The tiers' cross-verse phrases stale on first arrival: 1 book changes on small and medium, 67 on large-loadable, 72 on large. Part of #449. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The history now asks for the re-anchor of what a step would restore before applying anything, and applies the step merged with it in one apply, so a failure applies nothing and leaves the step where it was, and the inverse a redo replays covers the re-anchor's changes too. Part of #449. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
While the whole-text read has yet to reach the open book, its edit was reported at once, so a pass could not run before the view's refetch. The edit now waits for the book's new text, hands it to onBookRead's listeners, then is reported; the view's refetch waited on that tokenizing already. Part of #449. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
startTextRead reads the text afresh, ending any read under way, so a session opened after an earlier read still hears of every book; it doesn't wait on the book list, leaving a failure for the status to report. stopTextRead ends the read and leaves the view's books kept. getTextBookIds goes, since a fresh read reports to onTextRead. Part of #449. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Opening a session starts its whole-text read and closing it ends it. Each book the read delivers, and each edited book, re-anchors in the session's turn through the repository's lookups, as no undo step but recorded for undo and redo; books the text lacks stale once the read is done. onAnalysisChanged for an edit waits for the session's turn, so a refetch sees re-anchored links. A read-only session isn't re-anchored. Closes #449. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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 |
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.
Part of #426; closes #449.
Summary
The host re-anchors every book the session's draft links into, in the session's turn, as the whole-text read delivers each book and again when a book's text changes.
getScope,findLinksInBooks,getSegmentAnalyses), runs the WebView's ownreanchorDraftToBookover it, and applies the links it rewrote, with the scope's record when it moved a split.EditHistoryrecords each pass while a step predates it, and an undo or redo re-anchors what it restores to the latest text of each book passed over since, asrecordBookPassdoes on main.onBookRead, then is reported, so its pass runs before the refetch.Evidence
Parity with the WebView passes. Every case of
reanchor-analysis.test.ts(88) andreanchor-draft.test.ts(7) now also checks that the host's change set brings the draft to the WebView pass's result, and that the pass over the book's links alone, as the host reads them, makes the same changes. Five fixtures that gave two links one id now give each its own, as the host's records need.The Data layer: capture a performance baseline before the database migration #407 tiers.
perf:benchre-anchors every book of each tier both ways, ignoring the time each pass stamps:One run each, on a development machine. The changed books hold the tiers' cross-verse phrases, which the pass stales on both paths.
Undo and redo. An edit, then a Scripture edit and its pass, then an undo restores the earlier link on the word's new ref; a redo restores the later one there too.
A mid-session Scripture edit. BookService hands the edited book to
onBookReadbefore reporting the edit, the pass runs in the session's turn, andonAnalysisChangedwaits for that turn.npm run test:coveragepasses at 100%;npm run lintandtscare clean.Decisions with a strong alternative
getTextReadStatusreports it. Each session gets a fresh read, so one opened after an earlier read still hears of every book.onAnalysisChangedafter a pass on a book's first arrival. Until 3k the event only names a Scripture edit; 3k's touched ranges can cover passes.getScopeis copied from [3d] Add token commands with parity tests #443 rather than stacking on it. Whichever lands second takes the other's version.presentBookIdslists books present.Follow-up
onAnalysisChangedshould name a pass's touched ranges, as a command's.reanchorDraftToBook, which the host's pass calls.Merge Danger
Door: two-way
No released build opens a session, so no pass runs. Released builds see one change: since they never start the whole-text read, each edit to the open book is reported once the book's new text is tokenized instead of at once.
Blast Radius: BookService's edit reporting
🤖 Generated with Claude Code
This change is