Memex Admin

Desktop: IPC Contract Sync

Repository: mem-labs/mem

activeUpdated Feb 19, 2026, 9:36 PM

Policy ID js7f06xjjrbmhyy0vfsbzrd3md81etz4

Desktop IPC bridge changes must keep contract surfaces in sync.

Rationale:
- IPC contract drift between main, preload, and renderer typings causes runtime breakage and unsafe calls.

Scope:
- PR review policy for contract surfaces under:
  - `domains/typescript/mem-client-desktop/src/entry.ts`
  - `domains/typescript/mem-client-desktop/preload/entry.ts`
  - `domains/typescript/mem-client-desktop/preload/types.ts`
  - `domains/typescript/mem-client-desktop/config/typings/global.d.ts`

Trigger:
- A PR adds/renames/removes IPC channels or exposed `electronAPI` methods in scope.

Approval checks:
1) Channel/method additions or renames are reflected across all relevant contract surfaces in the same PR.
2) New exposed `electronAPI` methods in preload map to explicit main-process handlers/events (no orphaned API methods).
3) If both preload contract types and global window typings are used, their method names/signatures remain synchronized.
4) Contract changes include desktop test updates that exercise at least one changed channel/method behavior.

Evidence:
- Diff shows synchronized channel/method updates across scope files and test assertions for changed contract behavior.

Exception path:
- Allow deviation only when all are true:
1) PR description includes `Policy Exception: desktop-ipc-contract-sync`.
2) PR explains why partial sync is temporarily required.
3) PR includes tracked follow-up owner/date to complete contract alignment.

Decision:
- Return NOT APPROVED when trigger is met and contract surfaces drift without a valid exception.