Skip to content

refactor: share platform boundary contracts#33

Merged
wolfiesch merged 2 commits into
mainfrom
codex/shared-platform-headless
Jul 18, 2026
Merged

refactor: share platform boundary contracts#33
wolfiesch merged 2 commits into
mainfrom
codex/shared-platform-headless

Conversation

@wolfiesch

Copy link
Copy Markdown
Collaborator

Summary

  • move pairing-link parsing and queueing out of Electron into the shared protocol package
  • centralize desktop and Android updater contracts, including strict Capacitor payload validation
  • add fixture-driven headless coverage for valid and hostile platform-boundary inputs

Verification

  • mise exec node@24.17.0 -- pnpm check
  • TMPDIR=/private/tmp mise exec node@24.17.0 -- pnpm test (1,248 passed)
  • mise exec node@24.17.0 -- pnpm build

Copilot AI review requested due to automatic review settings July 18, 2026 05:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors “platform boundary” contracts into @t4-code/protocol, moving pairing deep-link parsing/queueing and desktop/Android updater payload decoding into shared, strict decoders, and adds fixture-driven headless tests to harden these untrusted inputs.

Changes:

  • Introduces shared pairing-link parsing + validation (parsePairDeepLink, decodePairLinkEvent) and a bounded pending-pair queue in packages/protocol.
  • Centralizes strict updater payload decoders for Desktop IPC and Android (Capacitor) bridge values in packages/protocol/src/app-update.ts.
  • Adds fixture-driven protocol tests and updates desktop/web call sites to use the shared contracts; removes now-duplicated desktop deep-link implementation and tests.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/protocol/test/platform-boundaries.test.ts Adds headless tests for pairing link parsing, queued event validation, and strict updater decoding.
packages/protocol/test/fixtures/platform-boundaries.ts Adds valid/invalid fixtures for pairing links and Android updater payloads.
packages/protocol/src/pair-link.ts New shared pairing link decoder/parser and bounded queue implementation.
packages/protocol/src/index.ts Re-exports new shared protocol modules.
packages/protocol/src/desktop-ipc.ts Uses and re-exports shared desktop update + pair-link decoders/types.
packages/protocol/src/app-update.ts New shared strict decoders for desktop update IPC state and Android updater bridge payload.
packages/protocol/package.json Exposes new subpath exports (./app-update, ./pair-link).
apps/web/src/platform/native-mobile.ts Switches native update state type to the shared AndroidUpdateState.
apps/web/src/features/updates/update-store.ts Uses shared decodeAndroidUpdateState instead of local validation/cleaning.
apps/desktop/test/security.test.ts Removes deep-link-specific assertions (moved to protocol tests).
apps/desktop/test/desktop-lifecycle.test.ts Removes deep-link parsing/queue tests (moved to protocol tests).
apps/desktop/src/lifecycle.ts Uses shared protocol deep-link parsing and queueing instead of desktop-local module.
apps/desktop/src/deep-link.ts Deletes desktop-local deep-link parsing/queue implementation now owned by protocol.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/protocol/src/app-update.ts
Comment thread packages/protocol/src/app-update.ts
Comment thread packages/protocol/src/pair-link.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0e37cb2587

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/protocol/src/app-update.ts
@wolfiesch

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 331b785f28

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@wolfiesch
wolfiesch merged commit f48ced9 into main Jul 18, 2026
4 checks passed
@wolfiesch
wolfiesch deleted the codex/shared-platform-headless branch July 18, 2026 05:59
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.

2 participants