Skip to content

Commit 3a153b3

Browse files
committed
📝 T022: Clarify real IPC contract TBDs
1 parent bbaf0bb commit 3a153b3

2 files changed

Lines changed: 18 additions & 4 deletions

File tree

openspec/changes/add-dweb-authorize/proposal.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,17 @@ Before any authorization, user sees:
9999

100100
## IPC Contract Details
101101

102+
### Runtime Surface (TBD)
103+
104+
The concrete runtime entrypoint is still unconfirmed. We must lock it down with real runtime samples before implementing Phase B:
105+
106+
- Candidate A: mpay-style `plaoc.initAppPlaocEventListener((eventId, url, event) => ...)`
107+
- Candidate B: `@plaoc/plugins` `dwebServiceWorker.addEventListener('fetch', (event) => ...)` (request/response IPC)
108+
102109
### Event ID Format
103110

104111
- **Source**: Generated by DWEB runtime when triggering authorization
105-
- **Format**: `dweb-auth-{uuid}` (opaque string, treat as identifier)
112+
- **Format**: TBD (treat as opaque identifier). Note: if Candidate B is used, the underlying request correlation id is a numeric `reqId`.
106113
- **Lifetime**: Valid for 5 minutes from creation
107114
- **Single-use**: Each eventId can only be responded to once
108115

@@ -131,6 +138,10 @@ interface CallerAppInfo {
131138
| `/wallet/authorize/address` | `{ addresses: AddressInfo[] }` | `{ error: 'rejected' \| 'timeout' }` |
132139
| `/wallet/authorize/signature` | `{ signature: string, txHash?: string }` | `{ error: 'rejected' \| 'timeout' \| 'insufficient_balance' }` |
133140

141+
**Compatibility note (mpay)**:
142+
- mpay may send/expect raw array payloads (e.g. address returns `addressList` array; signature returns a result array aligned by request index).
143+
- Phase B MUST confirm with runtime samples whether KeyApp should normalize these shapes at the adapter boundary (recommended for smooth mpay migration).
144+
134145
### Error Codes
135146

136147
| Code | Meaning | User Action |

openspec/changes/add-dweb-authorize/tasks.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,14 @@
1414
- [ ] P0. DWEB/Plaoc runtime becomes available for testing
1515
- [ ] P1. Runtime detection API confirmed (`isPlaocAvailable()`)
1616
- [ ] P2. IPC contract checklist confirmed with real runtime (events + payload schemas + semantics)
17-
- [ ] P2.1 Deep-link entry + params schema (eventId + route + search params)
17+
- [ ] P2.1 Entry point + params schema (confirm which surface is real)
18+
- Candidate A: mpay-style `plaoc.initAppPlaocEventListener((eventId, url, event) => ...)`
19+
- Candidate B: `@plaoc/plugins` `dwebServiceWorker.addEventListener('fetch', (event) => ...)` (request/response IPC)
1820
- [ ] P2.2 App info contract: `getCallerAppInfo(eventId)` return shape + error semantics
1921
- [ ] P2.3 Address request payload schema (type/main|network|all + chainName + optional signMessage)
20-
- [ ] P2.4 Signature request payload schema (type/message|transfer|destory + payload fields)
21-
- [ ] P2.5 Response schema: `respondWith(eventId, path, data)` meaning of `path` + success/error payloads (confirm whether runtime expects mpay `$WALLET_PLAOC_PATH` like `/wallet/authorize/*`)
22+
- [ ] P2.4 Signature request payload schema (confirm single vs batch)
23+
- mpay accepts `signaturedata` as JSON stringified array (batch-capable); confirm runtime expectation for KeyApp
24+
- [ ] P2.5 Response schema: `respondWith(eventId, path, data)` meaning of `path` + success/error payloads (confirm envelope vs raw array compatibility with mpay)
2225
- [ ] P2.6 Cleanup semantics: `removeEventId(eventId)` idempotency + required call order
2326
- [ ] P2.7 Timeout/cancel semantics (deadline, user cancel, runtime disconnect, retry/replay guard)
2427

0 commit comments

Comments
 (0)