refactor: consolidate commit ingest, subscribe auth, and bind-twin fixtures - #1274
Draft
joepio wants to merge 7 commits into
Draft
refactor: consolidate commit ingest, subscribe auth, and bind-twin fixtures#1274joepio wants to merge 7 commits into
joepio wants to merge 7 commits into
Conversation
Map duplicated logic across Rust, TypeScript, and Flutter, and classify what should stay dual-maintained versus what should merge. Links existing plans instead of restating them. Co-authored-by: joepmeindertsma <joepmeindertsma@gmail.com>
A cleanup is only allowed to land if characterization tests pin the old paths first, then scripts/consolidation-measure.py shows production lines in scope went down. Policy-splits (same shape, different CommitOpts) are called out so they cannot hide a behavior change. Co-authored-by: joepmeindertsma <joepmeindertsma@gmail.com>
Flutter catch-up applies a signed commit without re-checking ACL. Hub and peer ingest still reject the same unauthorized signer. Characterization for folding ws_apply::apply_commit_json into ingest_commit_json. Co-authored-by: joepmeindertsma <joepmeindertsma@gmail.com>
Fold Flutter WS apply_commit_json into ingest_commit_json via CommitIngestOpts::replica() (signature on, rights/timestamp off). Hub and peer keep enforcing rights. Named presets replace repeated struct literals. Subscribe, SubscribeDrive, and SubscribeQuery share authorize_read so the three check_read copies cannot drift. Measure: 2333 → 2257 production non-blank in scope; largest file engine.rs 1084 → 918. Co-authored-by: joepmeindertsma <joepmeindertsma@gmail.com>
Mark the two landed items in the audit and add an UNRELEASED changelog entry so the remaining work list stays accurate. Co-authored-by: joepmeindertsma <joepmeindertsma@gmail.com>
Rust, TypeScript, and Dart now load testdata/search-query.json and testdata/server-url.json instead of each suite inventing the same expected bytes. The File-picker repro looks up the escaped isA key instead of shipping a third escape implementation. CI mounts the whole testdata directory so new fixtures do not need a one-off file mount. Empty server-URL input is left unbound: TS returns https://, Dart returns empty. Co-authored-by: joepmeindertsma <joepmeindertsma@gmail.com>
flutter/AGENTS.md still said Loro was missing; Phase A already landed. scripts/consolidation-measure.py --kind bind-twins allows a flat production line count so a shared fixture is not rejected as a no-op. Co-authored-by: joepmeindertsma <joepmeindertsma@gmail.com>
joepio
force-pushed
the
cursor/consolidate-ingest-subscribe-auth-88f8
branch
from
August 18, 2026 15:49
abe4f0a to
4a8f8aa
Compare
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.
Related Issues
Follows the duplication audit in #1273. This branch includes that planning work plus the first consolidations that pass the contract.
Checklist
Consolidation 1 — commit ingest + subscribe auth
check_read)Db; authorize a WS subscribe.lib/src/sync/engine.rs,lib/src/sync/ingest.rs,lib/src/sync/ws_apply.rs,lib/src/sync/mod.rs,server/src/commit_monitor.rs,server/src/handlers/commit.rstest(sync): pin replica WS commit ingest skipping write rights)scripts/consolidation-measure.py --baselineexits 0: yesengine.rs1084engine.rs918CommitIngestOpts::replica()still skips write-rights and timestamp. WASMapplyCommitis not folded in (signature off — a fourth policy).Remaining path:
ingest_commit_jsonwithCommitIngestOpts::{hub,peer,replica}. Subscribe handlers callauthorize_read.Consolidation 2 — bind-twins (search + server URL)
normalizeServerUrlproducing the same bytes.lib/src/client/search.rs,browser/lib/src/search.ts,browser/data-browser/src/helpers/serverUrl.ts,flutter/lib/atomic/server_url.darttestdata/search-query.json,testdata/server-url.jsonscripts/consolidation-measure.py --kind bind-twins --baselineexits 0: yes (365 → 365, no third copy)file_search_repro.rs(looks up the fixture)https://, Dart returns''. Not "fixed" here.Also
flutter/AGENTS.mdno longer claims Loro is missing (Phase A landed).--kind bind-twinsso a flat line count is not a failed gate.testdata/directory (JS, Rust, Flutter).