Repository navigation
feat: permission runtime, lodge adapter, MCP plugin and stdio MCP - #4
Merged
Merged
Conversation
Phase 2 of the roadmap (docs/plans/0001-roadmap.md), on frostyard/core ADR-0085. - authz/: a grant of items (a capability on a path for each selector), the path rules (NFC, no empty, . or .. segment, no trailing /, a grant covers its path and the paths below it), the union check, the caller and the app's transaction in the context. - cmd/protoc-gen-hearth-authz: 1 check per RPC, an Authorize<Rpc> hook for each RPC on an object id, and a wrapper that takes the handler with its hooks, so a handler without a hook does not build; the hook and the RPC run in 1 transaction of the app. - lodge/: the peer uid check of the lodge socket before any read, the Lodge-Principal and Lodge-Grant headers only there, and the local user on the private socket. - cmd/protoc-gen-hearth-mcp and mcpserver/: tools for the agent RPCs only, with snake_case names, the proto3 JSON schema, the hints of the effect and the denial text as a tool error; a stdio server that needs no token and acts as the local user (Go MCP SDK v1.8.0). - internal/e2e: the demo app, its generated code, its hooks and the tests of the refusal, the move at both ends and the stdio tools. ADR-0006 and ADR-0007 record the decisions; docs/specs/permissions.md and docs/specs/mcp-tools.md are the contracts.
…ap NullValue; canonical demo groups - authz: ParseGrant refuses a "sel" that is not a JSON object, so "sel": null no longer reads as the root path. - protoc-gen-hearth-mcp: refuses an agent RPC whose request or response has no JSON object form, and an example that does not fit the tool's input schema. - internal/protoschema: google.protobuf.NullValue maps to type null. - internal/e2e: the demo stores and compares groups in canonical form; its examples use absolute paths and JSON names. - docs: NewServer fixes 1 caller for every call; never share a local-user server with lodge callers. Each fix has a guard test and a record in .memory/corrections/.
…ixed MCP caller in AGENTS.md A Struct root now validates real Struct JSON. Rule 6 of the options spec still keeps Struct out of an agent RPC, and the MCP tools spec says so. AGENTS.md records that mcpserver.NewServer fixes 1 caller for every call.
An ordinary message named Empty, Struct or Timestamp in a file with no package keeps its own fields.
bketelsen
approved these changes
Nov 16, 2026
7 of 8 tasks
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
Phase 2 of the roadmap (frostyard/core ADR-0085): the permission runtime, the permission plugin, the lodge adapter, the MCP plugin and the stdio MCP server.
authz/: a grant of items (a capability, and a path for each selector), the path rules (NFC; no empty,.or..segment; no trailing/; a grant on/Chandoes not cover/Chani), the union check, an absent selector value as the root, the caller and the app's transaction in the context. The denial text ispermission denied: needs <cap> on <selector>=<path>.cmd/protoc-gen-hearth-authz: 1 check per RPC; anAuthorize<Rpc>hook for each RPC on an object id (a singular non-message field namedidor*_id); a wrapper that takes the handler together with its hooks, so a handler without its hook does not build (TestMissingHookFailsBuild). The hook and the RPC run in 1 transaction of the app.lodge/: the lodge socket closes a connection whose peer uid is not lodge's before it reads it;Lodge-PrincipalandLodge-Grant(base64url of the grant JSON) are read only on that socket; the private socket deletes everyLodge-*header and acts as the local user.cmd/protoc-gen-hearth-mcpandmcpserver/: tools forEXPOSE_AGENTRPCs only, snake_case names, the proto3 JSON schema (internal/protoschema), the hints of each effect, the denial as a tool error;ServeStdioneeds no token and acts as the local user (Go MCP SDK v1.8.0).internal/e2e: the demo app's generated code, its hooks on an in-memory store, and the tests (refusal text, hook refusal, a move checked at both ends, the stdio tools driven by the SDK client). The demo proto addsMoveNoteand exposesPublishNoteto agents: a compatible manifest change.AGENTS.mdand 2 new site guides.Risk tier
Risk tier: 3 — the PR touches L1 and L2 paths of
.github/risk-paths.json.Matched paths at the base, and why each change is safe:
authz/**(L1): new package. It fails closed: a context without a caller, the zero grant, an unknown capability and an invalid path all refuse. Tests cover each path rule.lodge/**(L1): new package. The peer uid check runs inAccept, before any byte is read; the handler refuses unless the connection carries the lodge listener's mark; the private socket never readsLodge-*. Tests: forged headers on the private socket, wrong peer uid, missing and bad headers, a handler without the mark.cmd/protoc-gen-hearth-authz/**(L1): new plugin; golden and failure tests; the demo's generated code is checked bymake gen-checkand exercised byinternal/e2e.internal/model/**(L1): addsOperation.ObjectIDs,BuildGoandParseGoParams.Buildand the manifest plugin's strict parameters are unchanged (tested); no manifest member changes.go.mod,go.sum(L1): addsgithub.com/modelcontextprotocol/go-sdkv1.8.0,golang.org/x/sys, andgolang.org/x/textas a direct dependency. The import boundary test passes.Makefile(L2):gen-checkalso comparesinternal/e2e/gen, in the same fail-closed form..github/risk-paths.json(L2): addscmd/protoc-gen-hearth-mcp/**(L2) andmcpserver/**(L1), and updates thewhyofauthz/**. Nothing is removed or lowered.Docs housekeeping
TEMPLATE.mddocs/README.mdVerification
make cigreen locally before the first push (verify gen-check race cross corrections-base).coverswithout the/boundary →TestCoverSiblingPrefixfailsAccept→TestWrongPeerUIDRefusedfails (it got a 403 response, not a closed stream)Lodge-Principal→TestForgedHeadersOnPrivateSocketfailsAuthorizeGetNotecall in the generated wrapper →TestDeniedGetNoteByHookfailsTestNFCfailsTestAnnotationsOutwardfailsCross-review
Reviewer
openai/gpt-6.1-sol; coderdeepseek/deepseek-flash(with edits byanthropic/claude-opus-5-5). Base38eaf52e60ad186f41836c8c3d9052cad0b860cf.56e7590(3 batches, all substantive paths; excluded as generated:demo.pb.go,go.sum, the demomanifest.json): Not ready, 6 blocking. Fixed in8a7acdc: the MCP guide's caller text,"sel": nullin a grant, non-object roots of a tool,NullValue, canonical groups in the demo list, invalid demo examples.8a7acdc: 2 blocking (theStructroot schema; the guard of the caller fix). Fixed in1e0c256(TestStructRoot,TestEmptyRoot, theAGENTS.mdinvariant "1 MCP server has 1 caller").1e0c256: 1 blocking (a message namedEmptywith no package was mapped as a well-known type). Fixed in8ea4fbf(TestUnqualifiedNamesAreOrdinary).8ea4fbf: Ready, Blocking: none.Each blocking fix has a guard test (or the
AGENTS.mdrule for the docs-only point) and 1 record in.memory/corrections/2026-11-15-pr-4-*.json(7 records). Each guard test fails with its fix reverted.