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]>
The development gateway's blob handler becomes internal/blobhttp, with the limits lodge's content route needs: one range per request (416 otherwise), a range cut to MaxRange, a whole answer up to MaxWhole (413 past it), and ?download=1's Content-Disposition. Co-Authored-By: Claude Opus 5.5 <[email protected]>
internal/lodgeapp builds the kit's server for notes (plan 0006 Phase 3, docs/specs/lodge-app.md): /health with notesd's version and RPC major, /api as caller session named by lodge's headers, /content/blobs/ with its headers and limits, and the hub's sync routes under /device/, where lodge's peer headers only name a pending pairing's node. lodge/kit is pinned to 38f7be7. -hub now refuses an address that is not loopback. Tests run over a real socket with kittest: lodge's rules (the peer check, one caller per path, forged callers), a session that reads, writes as its node and gets events, the blob limits at and past 8 and 64 MiB, and a device that pairs, pulls and pushes through /device/. Co-Authored-By: Claude Opus 5.5 <[email protected]>
packaging/lodge/app.json is lodge-app.md's manifest; a socket unit gives lodge's group /run/lodge/apps/notes.sock, the service runs notesd -lodge as frostnotes with its data in /var/lib/frostnotes, and sysusers.d declares frostnotes in lodge-apps. M6 packages them. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 19, 2026
…first A system service has no Secret Service session, so frostnotes.service sets FROSTNOTES_SECRETS=file. Phase 7 stops and disables the M2 hub's unit before enabling frostnotes.service: both use /run/frostnotes. Found deploying the overnight build beside the trial hub. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…mits From the security review: http.ServeContent answers whole when If-Range does not match, so Range: bytes=0-0 with a stale If-Range fetched a blob of any size in one response, past lodge-app.md's 8 and 64 MiB. A blob never changes under its hash, so the handler drops If-Range. 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]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
From the master's security review (N6): any tailnet peer could fill the hub's 8 pending-pairing slots. Behind lodge a pairing now carries its node's ID (Lodge-Node-ID, through hub.Peer), and a node with two pairings waiting gets 429 for a third; the ID is a rate key, never an admission, and the global limit stays. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… a ticker Co-Authored-By: Claude Opus 5.5 <[email protected]>
From the master's security review (L5): under ts.net, a public suffix, every page on every tailnet node is same-site to lodge-content, so one could probe CONTENT/notes/blobs/<sha256>.<ext> with image loads and learn whether the vault holds a file it knows. Content paths are now /content/blobs/<mac>/<hash>.<ext>, the mac an HMAC-SHA256 of the hash under a 32-byte key notesd keeps in its data directory (content.key, 0600; the same across restarts, so URLs stay cacheable); a path without the right mac is 404. rpc.hello hands a session the key (contentKey) to make its URLs; the lodge socket never serves unkeyed paths. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…me tree as m4/phase2
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 3: notesd on lodge's app socket. Stacked on #45 (Phase 2), so its base is
m4/phase2. Built overnight at your request, for review.What changes
notesd -lodgeserves lodge's app socket as appnotes, throughgithub.com/frostyard/lodge/kitpinned at38f7be7(v0.0.0-20261019030549-38f7be71e665), which the master session relayed./run/lodge/apps/notes.sock, or the one systemd passes.LODGE_ROOTandLODGE_UIDmove it for development.Lodge-*headers and one caller kind per path.internal/lodgeapp(lodge-app.md) is the only package importing the kit:/healthanswers{ok, version, protocol: 1}./apiis JSON-RPC as callersession, with the identity from lodge's headers. Writes are"<Lodge-Node-Name> (web)", from Phase 2./content/blobs/<hash>.<ext>serves lodge-content./device/sync…reachesinternal/hub's handler unchanged; the device token still decides. Any other/device/path is 404./mcpis Phase 4, so it answers 404 for now.phone ([email protected]). The name is for display only (hub.WithPeer).internal/blobhttpis the dev gateway's blob handler, shared and given the spec's limits:?download=1.-hubnow refuses an address that isn't loopback. The user's hub keeps its M2 binary until Phase 7.packaging/:lodge/app.json, the spec's manifest, whoseversionis set at build;systemd/frostnotes-lodge.socket(SocketUser=frostnotes,SocketGroup=lodge, 0660);systemd/frostnotes.service(notesd -lodgeasfrostnotes, data in/var/lib/frostnotes, private socket/run/frostnotes/notesd.sock);sysusers.d/frostnotes.conf(inlodge-apps, neverlodge).AGENTS.mdandoverview.md.lodge-app.mdnow states the 416, how ranges are cut, and the pending-pairing name.Tests (over a real Unix socket, with kittest)
kittest.CheckRulesagainstpackaging/lodge/app.json: health without a caller, missing and forged callers, one kind per path,/api's upgrade, the manifest's routes, and another uid's connection closed.mcpis masked to false until Phase 4.e2e (web)(the params' author is ignored), getsnote.changed, is refusedvault.add, and pings. A second session without a display name works the same.?download=1, and 404s for malformed names;/device/notespairs (the pending pairing names the node), pulls, and pushes. Without a token it's 401 whatever node headers lodge sends.checkLoopbackfor-hub.Gates:
make checkis green locally, including a fix to a Phase 2 test that could race the loop's state. I also ran a manual smoke test ofnotesd -lodgeunderLODGE_ROOT:/health, a 0660 socket, 403 without a caller, and 401 on a device route without a token.make sync-simis running; I'll add its result here.Security review (overnight, an independent agent)
If-Rangebypassed the blob limits.http.ServeContentanswers whole whenIf-Rangedoesn't match, soRange: bytes=0-0with a staleIf-Rangefetched a blob of any size. The handler now dropsIf-Range: a blob never changes under its hash. There is a test.The master session's security review
ts.net, every tailnet page is same-site to lodge-content, so one could probe for a file it knows by its hash. Paths are now/content/blobs/<mac>/<hash>.<ext>.macis an HMAC-SHA256 of the hash under notesd's 32-byte content key (content.keyin the data directory, 0600). The key stays the same across restarts, so URLs stay cacheable.rpc.hellogives a session the key ascontentKey.Lodge-Node-ID) may have 2 pairings waiting, so one peer can't take all 8 slots. The node ID is a rate key, never an admission.lodge/kitis bumped to2017aec, whose MCP sessions sweep idle ones on a ticker.🤖 Generated with Claude Code