carlos / platform Public
Brief: review the P7 edge-door plan
Review docs/superpowers/plans/2026-09-28-instance-moves-p7-edge-door.md against the code in this checkout (branch instance-moves-p7, based on main with P0 merged) before anyone builds it.
The design it implements is on branch docs-instance-moves-design: git show origin/docs-instance-moves-design:docs/superpowers/specs/2026-09-24-instance-moves-for-every-app-design.md. Read §0 (Paul's rulings, fixed: do not re-argue them), §8 and §10. Your own recommendations that became those rulings are in CODEX-RULINGS-INSTANCE-MOVES.md beside it.
What was decided while planning, and why
- The credential is a console-minted random key whose SHA-256 sits in a record under
control/door-keys/<account>/<app>.json, signed with the deployment's root release key. Boxes verify it againstCARLOS_RELEASE_PUBKEY, which the edge already holds (e.staticPub). Rejected: the relay's HKDF-per-box-master pattern (a master staged by hand on every box, an infra change per box), and an unsigned hash record (any bucket writer could add a key, discussion #171). - Remote ownership comes from new
account/appfields in each box's edges file, so the request path never reads the bucket (the edge's rule). A host whose publisher predates the fields is refused. - The door calls the ordinary
Edge.ServeHTTPafter authenticating, stripping the key and the hop headers, checking ownership, and setting a context mark. The mark widens X-Forwarded-For trust insetForwardedandclientIPonly; the backhaul one-hop refusal still readshopVerified. - Dormant: no socket unless
CARLOS_EDGE_DOORnames a path.
What to look for
- Authorization holes. Any request a door caller can shape that reaches an instance of another app, or the tunnel host, the store door, the steering probe, or any other
ServeHTTPbranch that runs before the route lookup. Specifically check the login POST, whichServeHTTPre-resolves by itsnextparameter (edge.go around 1400-1446), not byr.URL.Path, while the door checks ownership byr.URL.Path. - Trust leaks. Whether rewriting
RemoteAddrfrom the caller's X-Forwarded-For, or theforwardedTrustedwidening, lets a door caller spoof anything the edge or the gate relies on beyond the visitor address. - The signing choice. Is signing door-key records with the root release key (the key that moves
stable) acceptable, or does it need a scoped grant (internal/release/grant.go)? Does any existing verifier accept a root-signed wrapper of a different kind, so that a door-key record could be replayed as something else, or vice versa? - Revocation and failure behaviour. The 30 s mirror; dropping records that fail verification but keeping the last map on a list failure; what a console with no signing key does.
- Plan quality. Tasks whose interfaces don't line up, steps that name helpers or fixture fields that don't exist (check each against the code), tests that would pass without the change, and anything the rulings require that no task builds.
Cite code as path:line and check each citation. Findings first, ranked P1 (must fix before building) / P2 (should fix) / P3 (note), each with the failure scenario and a suggested fix. Then one line on whether the plan is ready to build once the P1s are fixed. Keep it under about 2,000 words.