Skip to content

feat(diagnostics): resolve revision-scoped text selectors - #254

Draft
seonghobae wants to merge 28 commits into
feat/writing-diagnostics-contractfrom
feat/writing-diagnostics-projection
Draft

feat(diagnostics): resolve revision-scoped text selectors#254
seonghobae wants to merge 28 commits into
feat/writing-diagnostics-contractfrom
feat/writing-diagnostics-projection

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Scope

Stacked implementation lane for Task 2 of PR #248's writing-diagnostics plan. This Draft targets feat/writing-diagnostics-contract so Task 1 and the corrected v1 architecture remain explicit parent dependencies.

Test-first evidence

The inverse resolver followed an observable RED → GREEN sequence:

  1. src/writingDiagnosticProjection.test.ts was committed before the production module;
  2. workflow run 31556595959 failed because writingDiagnosticProjection.ts did not exist;
  3. the first implementation exposed a real parity defect in run 31556897070: a block leaf was emitted as after\uFFFC rather than ProseMirror's after\n\uFFFC;
  4. block-separator handling was moved before text/leaf emission and the functional suite passed;
  5. strict invalid-fixture typing was corrected without weakening runtime validation;
  6. hostile-input, cross-block, repeated-text, malformed-position, grapheme-runtime, and exact-reflection tests were added;
  7. public-export tests were committed before exports and failed on the missing root/subpath surface;
  8. root and React-free text-position-selector exports, declaration inputs, and packed-package ESM/CommonJS/strict-TypeScript consumers were added;
  9. focused coverage and complete package acceptance passed on predecessor implementation head 9c1e9127ba3c40bf1c6fd336e238848e6c07fb2c;
  10. after ADR 0028 corrected the complete-stack lifecycle and semantic-accessibility contract, this branch inherited the exact decision/errata and was non-destructively reconciled with Task 1 exact head 322c838d23de9ba574bcc549ad1e72cd2dafe2fe.

Included behavior

  • one shared grapheme-boundary classifier for forward selector creation and inverse resolution;
  • exact textBetween(0, size, '\n', '\uFFFC') projection parity;
  • Unicode-code-point offsets with exact ProseMirror structural positions;
  • compact linear scalar-or-null structural-boundary mapping;
  • stable redacted failures for unsupported projection, invalid selector, grapheme split, unavailable segmenter, and ambiguous structural boundary;
  • forward/inverse round trips across English, Korean, emoji, combining marks, bidirectional text, repeated text, and cross-block selections;
  • lists, tables, hard breaks, inline atoms, block atoms, empty blocks, and document boundaries;
  • exact own enumerable data-property validation and hostile reflection rejection;
  • no nearest-text search, substring repair, keyword inference, semantic fallback, network/model/provider/persistence access, or document mutation;
  • identical root and React-free selector-subpath runtime/type exports; and
  • packed ESM, CommonJS, and strict TypeScript consumer verification.

Corrected architecture inheritance

ADR 0028 and the v1 implementation-plan errata are now present on this exact branch. They require every local/remote docChanged transaction to invalidate a complete diagnostic generation and prohibit semantic behavior or ARIA derivation from opaque host strings. The projection resolver remains deterministic structural infrastructure and does not itself preserve a diagnostic across document changes.

Exact current-head evidence

  • exact base: feat/writing-diagnostics-contract@322c838d23de9ba574bcc549ad1e72cd2dafe2fe;
  • exact head: 1e16e7926f458ec706542fc1f5d8993480e570df;
  • ancestry compare: ahead 28, behind 0, merge base exactly the current Task 1 head;
  • focused Writing Diagnostics Projection TDD run 31590812070: success on this exact head;
  • predecessor-head checks, status and reviews do not transfer;
  • no canonical repository CI/Security/Semgrep run is claimed for this merge head yet.

Remaining gates

The PR remains Draft despite the focused current-head success.

seonghobae and others added 25 commits August 12, 2026 11:16
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c46aafcd-0391-4e31-a9c2-553e09b080ed

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant