Repository navigation
refactor(hearthtest): serve notelite with hearth's connectserver - #100
Merged
Merged
Conversation
hearth v0.2.0 generates the Connect route of notes-lite and adds connectserver, which admits a call on an app's lodge socket. The test app now serves the generated route through connectserver.Lodge, with its hold and error mapping in 1 unary interceptor. lodge sends Lodge-Caller: principal on every call to an app on hearth, so the adapter's caller check refuses nothing that lodge sends.
The adapter of connectserver admits Lodge-Caller: principal only. A call without it, or with another kind, is 403 with 1 line, and the app records no caller.
Contributor
Author
|
Cross-review record
|
bketelsen
approved these changes
Nov 17, 2026
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.
Summary
hearth v0.2.0 generates the Connect route of its example app notes-lite (
notesv1connect), and it addsconnectserver, which admits a call on an app's lodge socket (hearth docs/specs/connect.md). lodge's test appinternal/hearthtestwrote that route by hand: 4 unary handlers and its own mount oflodge.Handler.This PR:
github.com/frostyard/hearthfrom v0.1.0 to v0.2.0;notes.connect.goof hearth v0.2.0 intointernal/hearthtest/notelite/notesv1/notesv1connect/, with only its import of the v1 package changed to lodge's path (notelite/README.mdrecords the change and the new tag);connectserver.HandlerOptions, behindconnectserver.Lodgeat/connect/.The test hold and the app's error mapping (
not_foundfor a missing row,the app failed: …for other errors) move into 1 unary interceptor. Connect decodes the request body before a unary interceptor runs, so a held RPC still waits after the body is read, as before.App.Server,App.Close(immediate) and/healthdo not change; the app does not useconnectserver.Serve, because its stop waits up to 5 s for calls in flight, and the tests that hold a call needCloseto be immediate.LastPathstill records the path with its/connectprefix.Behavior
The test app now refuses a call whose
Lodge-Calleris notprincipal, as the app contract requires (docs/specs/app-contract.md). lodge sendsLodge-Caller: principalon every call to an app on hearth (internal/gateway/proxy.go,internal/mcpgw/call.go), so no lodge request changes its answer. No existing test needed a change;TestConnectRefusesOtherCallersis new.Risk tier
Risk tier: 1. The change is in a test app (
internal/hearthtest) and ingo.mod/go.sum; no path of.github/risk-paths.jsonmatches. lodge's production packages import no hearth code (internal/repocheck).Verification
make checkgreen (host)make cigreen before the push (verify, race, cross, client-check, ui-check, shell-check in the nsl machine)make vulncheck: needs the network; CI'svulncheckjob runs it for thisgo.modchangeTestConnectRefusesOtherCallersguards the caller check. In a scratch worktree at the PR head, withinternal/hearthtest/hearthtest.goatorigin/main(and the copiednotesv1connectremoved),go test -count=1 -run TestConnect ./internal/hearthtest/fails on its assertions: each kind (none,session,agent,device,content) answers 200 instead of 403, and the app records the last caller. The worktree is removed. The other behavior is covered by the existing tests ininternal/hearthtestandinternal/gateway, including the held calls and the recorded path.