Skip to content

perf(link): publish local opt-out catalog status once - #9024

Merged
lidge-jun merged 3 commits into
lidge-jun:devfrom
luvs01:codex/local-optout-receipt-once
Nov 21, 2026
Merged

lidge-jun merged 3 commits into
lidge-jun:devfrom
luvs01:codex/local-optout-receipt-once

Conversation

@luvs01

@luvs01 luvs01 commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • When a Remote Link Child applies a local opt-out without a Home route document, record that the catalog is pending in the final publication. This removes an extra atomic receipt write, a lifecycle lock acquisition and a repeated Home-proof clear on that path.
  • Keep the materializer's write-ahead record and per-client outcome publication. The connected sync still publishes local outcomes before fetching models when a Home document is available.

Verification

  • Windows x64, Bun 1.4.4. The opt-out regression failed on the base with four writes and passed on this change with three. It exercises the normal sync entry point and also checks that the Home proof is absent and the opted-out file has been restored.
  • Six focused cases in tests/clients/route-intent-connected.test.ts passed with 25 assertions. They cover local-only opt-out, cached offline intent, deferred status, connection replacement during fetch, and connected sync applying and removing routes.
  • bun run typecheck checked 2,688 files. bun run structure:check, bun run privacy:scan, and git diff --check passed. Local testing covered the affected branches on a shared Windows host. The full repository suite was not run locally.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • The integration architecture contract describes the final local-only receipt.
  • The existing guarded publication and Home-proof cleanup are preserved. The change adds no credential fields or diagnostic logging.

Summary by CodeRabbit

  • Bug Fixes
    • Local-only opt-outs are now recorded with their pending status in the final receipt when the Home integration is unavailable.
  • Documentation
    • Clarified how local opt-outs and their pending status are recorded, and how publication affects Home proof.

@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the enhancement New feature or request label Nov 21, 2026
@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

Commits

Reviewing files that changed from the base of the PR and between ed7e364 and b0b8aa3.

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

No actionable comments were generated in the recent review.

Walkthrough

For local-only connected route intents, the receipt is now marked catalogPending before its single persistence call. The test checks the receipt write sequence and resulting state. The integration responsibility entry documents local-only opt-out receipt handling.

Changes: Local-only receipt handling

Layer / File(s) Summary
Persist local-only receipts once
src/integrations/route-intent-connected.ts, tests/clients/route-intent-connected.test.ts, structure/clients/integrations.md
The implementation marks a local-only receipt pending before persistence and returns through the condition that also handles the all-clients-disabled case. The test expects receipt writes with catalogPending values [false, false, true] and checks the final receipt, absent Home receipt, and empty client file. The responsibility entry documents the pending receipt and Home-proof clearing.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Refactor

Possibly related PRs

Merge Risk: Minimal · previous review ed7e3

This change removes a redundant receipt write when a local opt-out is applied without a Home route document. Behavior is otherwise preserved, and the regression test covers the new write sequence. No actionable merge risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "perf(link): publish local opt-out catalog status once" matches the main change. The PR stops an extra receipt write for local-only opt-outs by setting catalogPending before the single persi…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "perf(link): publish local opt-out catalog status once" matches the main change. The PR stops an extra receipt write for local-only opt-outs by setting catalogPending before the single persist, and the objectives describe the same aim of publishing the pending catalog status once. The title is short, specific, and uses a conventional commit prefix. It does not mention the Home-proof cleanup or the test changes, which is acceptable.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
Fix failing CI checks

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between e054f8e and ed7e364.

Files selected for processing: 1

  • structure/clients/integrations.md

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

@lidge-jun

Copy link
Copy Markdown
Owner

Maintainer integration into dev (per MAINTAINERS.md; maintainer integration, not an independent approval)

  • Exact head: e054f8ef0543c1c8e0e36250501db32e3e1fec20
  • Checks on this head: 17 passed, 12 skipped, none pending or failing (Ubuntu PR CI; Windows/macOS are covered by the next dev batch gate).
  • Review threads: none unresolved.
  • Review: gpt-6.1-terra, two rounds, final verdict PASS.
  • Regression: tests/clients/route-intent-connected.test.ts passes on this head (25 pass) and the new receipt-sequence assertion fails with the source change reverted.

@lidge-jun

Copy link
Copy Markdown
Owner

Maintainer integration into dev (per MAINTAINERS.md; maintainer integration, not an independent approval)

  • Exact head: b0b8aa37e0414e4743e0c54bf1d9229719d3913d
  • Checks on this head: 16 passed, 13 skipped, none pending or failing (Ubuntu PR CI; Windows/macOS are covered by the next dev batch gate).
  • Review threads: none unresolved.
  • Review: gpt-6.1-terra, two rounds, final verdict PASS.
  • Regression: tests/clients/route-intent-connected.test.ts passes (25 pass) and the new receipt-sequence assertion fails with the source change reverted.
  • This head merges current dev: the only conflict was the shared structure/clients/integrations.md row, also edited by fix(link): avoid writing an empty initial selection on disconnect #8989; both sentences are kept. On this tree: typecheck clean, structure:check passes, route-intent focused tests 36 pass / 0 fail.
  • Supersedes the earlier integration comment on ed7e364b0, which could not merge because of that conflict.

@lidge-jun
lidge-jun merged commit b2e84d9 into lidge-jun:dev Nov 21, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants