Repository navigation
fix(mcp): preserve native provider identity custody - #111
Conversation
Pre-merge checks:
|
There was a problem hiding this comment.
APPROVE on exact head 7961ba3 (base main e598c30, #110).
Custody contract checked against the diff and the provider services:
isBindingOwnedIdentity(src/messaging/binding-identities.ts) covers every marker each provider actually registers: Capycreated_by: capy-binding/capy_binding_id(src/capy/bindings.ts), Factorycreated_by: factory-binding/factory_binding_id(src/factory/service.ts), Ampcreated_by: amp-binding/amp_binding_id(src/amp/service.ts). Key presence orcreated_byvalue alone is enough, so a partial marker set still fences.ownsRemotein src/mcp/relay-participants.ts is the only generic adoption gate (participant()andregisterParticipant()), so retired or disconnected Factory/Amp identities are no longer recoverable through genericjoin_relay; the provider resolvers keep their own binding checks and are untouched.- Consent availability in src/app.ts reports the same identities as taken, so OAuth consent cannot adopt them either. OAuth
assertActorand the pin are untouched; no flag, no pin change, no migration (0046 stays free). - Tests: the marker matrix now runs for all three providers;
test/factory-mcp.test.tsreproduces the failed-cleanup recovery for both retired and live custody and asserts no token rotation, no participant row, live binding still resolvable, and ordinaryfactory-supportjoin unaffected; the admission test asserts 9 provider markers.
Non-blocking observation: a generic participant row adopted from a provider remote before this fix will now fail participant() with identity changed and must re-join under a non-provider name. That is the correct outcome, noting it for anyone reading support logs.
Local checks on 7961ba3 (layered-heavy, one worker, serial, 4 GiB guard): typecheck exit 0; capy-mcp-identity 6/6; factory-mcp 8/8; amp 14/14; mcp-oauth-admission run by name pattern for the renamed admission test 1/1 (the whole file is guard-killed at test 18 on main too). test/mcp.test.ts was killed by the memory guard after test 18, so that local run is incomplete, not a failure; the file is not part of this PR. Exact-head CI 'Typecheck and test' run 42995768793 on 7961ba3: success.
Review-only: I do not merge.
🤖 Generated with Claude Code
|
Review5856661239 is addressed. A generic participant previously adopted from a provider identity now fails closed with CodeRabbit's visible title/description checks are inconclusive with no code finding/location; the check is skipped. Required exact-head CI42995768793 is SUCCESS, approval is on7961ba3 and there are0 unresolved threads. Author validation includes121 focused checks, clean typecheck/build and4 named failures when only Factory/Amp classification is reverted. The reviewer's memory-guard-terminated runs are explicitly incomplete; they are not represented as full-suite proof. Runtime/E2E remain tracked in#99. |
A native provider binding must keep custody of its Relay identity after disconnect while remote cleanup is pending. Previously, generic
join_relaycould treat a same-owner Factory remote as an interrupted generic join, recover its token and insert a participant row even though the Factory binding was retired and its own resolver refused it.Extend the Capy isolation from #110 to Factory and Amp at both generic participant ownership and OAuth name availability. The shared metadata check reserves each provider's binding marker and creator marker, including malformed own-property binding IDs. Ordinary
capy-/factory-/amp-names remain available; explicit provider paths retain their identities. No permission, migration, runtime flag or deployment change.Validation:
aw-heavy -- node --import tsx --test --test-concurrency=1 test/capy-mcp-identity.test.ts test/factory-mcp.test.ts test/mcp-oauth-admission.test.ts test/amp.test.ts: 74 pass.aw-heavy -- npm run typecheckandaw-heavy -- npm run build: clean.aw-heavy -- node --import tsx --test --test-concurrency=1 test/mcp.test.ts test/mcp-desktop-link.test.ts: 47 pass (121 combined focused checks). Current-head required CI and independent review remain the merge gates.This is an adjacent custody fix in the native-provider parity work tracked by #99. It does not complete provider delivery, background history or real-account E2E.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.