Repository navigation
Conversation
A method may list callers that narrow its domain's, and be marked writes. Both reach the Go router and the TypeScript tables (METHOD_CALLERS, WRITES), and the reference shows them. agent joins the caller kinds; a method an agent may call names its vault in a required int vaultId, which the generated handler checks against the connection's scope (ADR-0026, plan 0006 Phase 2). Co-Authored-By: Claude Opus 5.5 <[email protected]>
- schema: callers and writes marks as specs/lodge-app.md lists them; rpc.ping, rpc.hello's caller and identity, hub.setURL and hub.status's url, log.hub and sync.relocate. - api: CallerAgent, Identity and Scope. Router.Dispatch refuses a method marked writes under a read scope, and a scoped call that names another vault answers notFound, as for no vault. - rpcserver: ServeConn takes the connection's identity; rpc.hello reports it. The engine records a session's writes as editor, "<node> (web)", and an agent's as agent, its token's name, whatever the params say. - hub: the recorded URL (migration 0004), log.hub, and POST /sync/hub's relocation proof, an HMAC keyed with the token's hash. - syncer: a device follows log.hub at each connection, and sync.relocate keeps a new URL only when the hub there proves itself. - tests: every method as each caller kind, every note method under another vault and a read scope, every writing method's attribution, and relocation against a relay, a wrong hub, a URL that differs and a forged proof. Co-Authored-By: Claude Opus 5.5 <[email protected]>
MockOptions.caller makes the mock refuse what notesd refuses a browser inside lodge (METHOD_CALLERS), report the session's login and node from rpc.hello, answer rpc.ping, and name a session's writes "<node> (web)", for the web app's tests (plan 0006 Phase 2). Co-Authored-By: Claude Opus 5.5 <[email protected]>
sync-protocol.md gains POST /sync/hub, log.hub, sync.relocate, hub.setURL and hub.status's url, and the rule that a device follows log.hub at each connection; lodge-app.md says what hub.setURL accepts and POST /sync/hub's 400 and 413; plan 0006 records the overnight build. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Task card T-0084, implemented by the executor model and verified by taskrun.
The loop can be syncing again by the time the test reads sync.status after its quiet point. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 19, 2026
From the security review of the overnight build: a device moved to the URL its hub recorded and sent its token there on the next connection, so a mistyped notesctl hub url, or a hub database someone changed, could collect every device's token. follow now checks the host at that URL with the relocation proof first, as sync.relocate does (shared as proven), and stays otherwise. Also: hub URLs keep their host in lower case, so URLs SameURL calls the same are equal strings; POST /sync/hub logs at debug; lodge-app.md says what the endpoint reveals and what the proof's key allows. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ired one From the master's security review (N5): the endpoint answered 404 for a device ID that does not exist, so any peer reaching /device/ could count the paired devices. An unknown or revoked device now gets the same 200 answer, with a proof under an HMAC of its ID with a random key of the hub's, which no token makes; the device's own check refuses it. Requests are logged at debug. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
M4 plan 0006 Phase 2: the contracts, the agent's scope, attribution by connection, and relocation. Needs nothing from lodge. Built overnight at your request, for review. The first of three stacked PRs (Phase 3 and Phase 5 follow on top).
#44 is merged, so this PR's base is
main.What changes
tools/rpcgen):callers, which must narrow its domain's.writes.METHOD_CALLERS,WRITES,CallerKind) andrpc-api.md.agentjoins the caller kinds. A method an agent may call must name its vault in a required intvaultId, and the generated handler checks it against the connection's scope.noteadmitslocal, session, agent, with 10 methods markedwrites.vaultandhubadmitsession.vault.add,vault.remove,hub.serve,hub.approveandhub.setURLstaylocal.rpc.ping, andrpc.hello'scaller,login,displayNameandnode.hub.setURLandhub.status.url,log.hub, andsync.relocate.api):Identity,ScopeandParseScope.Router.DispatchanswersmethodNotFoundto a method markedwritesunder a read scope.notFound, in the same words as for a vault that doesn't exist.engine): a session's writes areeditor/<Lodge-Node-Name> (web), and an agent's areagent/ its token's name, whatever the params say.localconnections keep the params.rpcserver.ServeConntakes the connection'sapi.Identity, andrpc.helloreports it.0004_hub_url.sql).log.hubanswers{hub, url?}. A device asks at each connection and moves its row to a URL that differs, with the same token and sync state. An M2 hub answersmethodNotFound, and the device stays.POST /sync/hubanswers{hub, url, proof}: an HMAC-SHA256 keyed with the token's SHA-256, overfrostnotes relocate\n+ hub ID +\n+ url +\n+ nonce.sync.relocatekeeps the new URL only when the hub ID, the recorded URL and the proof all check out. The token is never sent.session(MockOptions.caller), for the web app's tests.sync-protocol.mdandlodge-app.mdchanged to match the code, and plan 0006's status line.Tests
rpcserver: every method sent as each caller kind getsmethodNotFoundexactly where the spec's table says, with the answer for a method that doesn't exist.engine, scope:notemethod on another vault, under read and write scopes;writesunder a read scope;engine, attribution: everynotemethod that records a version, as session, agent and local (moves through the links they rewrite).hub:setURLandlog.hub;SameURL.syncer:log.hubto the new URL and syncs there;sync.relocaterefuses a relay that forwards the nonce, the same hub at a URL it doesn't record, another hub ID, a forged proof, a hub with no URL and an unpaired hub, then accepts the real one and syncs.rpcgen: narrowing, repeats, an agent method without a vault, and the generated output.api:ParseScopeat and past its edges.Gates:
make checkandmake ui-check(87 files, 730 tests) pass locally.The card
notesctl hub url URLandnotesctl hub relocate URL NEW-URL.hub statusnow shows the recorded URL. Codex ran the card throughmake taskand it passed verification on the first attempt. I checked the given test against a reference first, then deleted the reference, and reviewed the diff.Not in this PR
notesd --lodgeand the socket are Phase 3 (the next stacked PR).Security review (overnight, an independent agent)
These were fixed on this branch after the review:
log.hubwas followed without a proof. A device moved to whatever URL its hub recorded and sent its token there on its next connection. A typo innotesctl hub url, or a hub database someone changed, could therefore collect every device's token.follownow checks the host at the new URL with the relocation proof first, through the sameprovenchecksync.relocateuses, and stays otherwise.TestADeviceFollowsOnlyAProvenURL. lodge-app.md and sync-protocol.md now say so.SameURLcalls the same are equal strings.POST /sync/hublogs at Debug.Accepted as design and written into lodge-app.md:
The master session's security review
POST /sync/hubno longer reveals which devices exist. An unknown or revoked device gets the same 200 answer as a paired one, with a proof under an HMAC of its ID and a random key of the hub's, which no token makes. Requests log at debug.🤖 Generated with Claude Code