Repository navigation
A Document containing only a list has no paragraph-scope Target - #75
Merged
Merged
Conversation
A Document written only as a list had no paragraph-scope Target, so every local Pass refused to run. `canonicalParagraphs` now finds the Paragraphs inside list items, at any depth, from the same traversal that renders them, and `passContext` resolves its Target from that list. The interval covers the Paragraph's prose in the one canonical string, never the list marker, so Containment is unaffected. Closes #55. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FjB3Gu8vhg5enkAneTdqga
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 was referenced Sep 26, 2026
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.
Closes #55.
What changed
src/core/canonicalText.ts— newcanonicalParagraphs(tree): every Paragraph with prose, in document order, including Paragraphs inside list items at any depth. The list renderer records where each list item's Paragraph lands (line and marker/indent width) during the same traversal that renders it, so there is still one renderer and one coordinate system. Each entry carries the top-level block index that holds it, and its interval covers the prose only, never the-/1.marker or indent.src/core/passContext.ts—passContextresolves its Target fromcanonicalParagraphsrather than filtering top-levelparagraphblocks.nearestParagraphIndexis unchanged in logic; its doc comment now says how list Paragraphs resolve.Acceptance
passContexton a bullet-list-only Document returns the first item's Paragraph, with its neighbour as context).canonical.slice(interval)equals the Target text for top-level, list-item and nested-list Paragraphs, including escaped prose and trimmed trailing spaces).passContext/critique/modelRunstests pass as before.Worth reviewing
The cursor reports only a top-level block index (
$from.index(0)), so every Paragraph inside a list shares the list's index, and a cursor anywhere in a list resolves to the list's first Paragraph (the existing earlier-on-a-tie rule). Resolving to the item under the cursor would mean the Editor reporting a finer cursor position, which goes beyond this Core-only ticket. If that's wanted, it should be its own ticket.pnpm test(1002 passed),pnpm typecheck,pnpm run gatesandpnpm buildall pass. No prompt, schema, migration or UI change.🤖 Generated with Claude Code
Generated by Claude Code