Skip to content

feat: onboard frostmarks and build its standalone core on hearth - #3

Merged
bketelsen merged 3 commits into
mainfrom
irulan/t9-frostmarks-core
Nov 16, 2026
Merged

bketelsen merged 3 commits into
mainfrom
irulan/t9-frostmarks-core

Conversation

@frostyard-machines

@frostyard-machines frostyard-machines commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Onboards frostmarks to rows B1 to B19 of frostyard/core's repository baseline, and builds the standalone core of the bookmark manager on hearth v0.1.0 (core ADR-0085).

  • Contract: proto/frostyard/frostmarks/v1/marks.proto, the service frostyard.frostmarks.v1.Marks with 11 RPCs (CreateBookmark, GetBookmark, UpdateBookmark, MoveBookmark, DeleteBookmark, ListBookmarks, SearchBookmarks, CreateFolder, RenameFolder, DeleteFolder, ListFolders), the capabilities marks:read and marks:write on the selector folder, and 5 events (created, updated, deleted, moved_out, moved_in). gen/ holds the generated Connect server and client, permission checks, MCP tools, event publishers and gen/manifest.json. buf.yaml excepts SERVICE_SUFFIX, so the service keeps the name Marks.
  • Core: marks/: SQLite (modernc) with FTS5 search over title, URL, notes and tags; normalized http/https URLs, unique per folder (already_exists names the existing id); folders as paths with an existing parent, deleted only when empty; lower-case tags of 1 to 64 characters; the 4 Authorize* hooks read the stored folder in the call's transaction (marks/authorize.go); lists and search filter by the grant; every event goes to hearth's outbox in the change's transaction.
  • Programs: frostmarksd serves Connect on the private socket ($XDG_RUNTIME_DIR/frostmarks.sock, 0600) as the local user; marksctl has 1 command per RPC; marksctl mcp is a stdio MCP server whose tools call the daemon. No lodge is needed.
  • Gate: the template's Node gate is replaced by a Go gate (ADR-0005): make ci = verify gen-check race cross corrections-base manifest-check.

Risk tier

Risk tier: 3 — new repository content that touches workflows, governance, supply-chain pins and the permission code.

Matched L1/L2 paths of .github/risk-paths.json, and why each is safe:

  • .github/workflows/**, .github/risk-paths.json, policies/**, Makefile, internal/workflowcheck/**, internal/repocheck/**, internal/cmd/corrections-base/** (L2): the CI and gate, ported from frostyard/hearth. Actions are SHA-pinned, permissions: {}, persist-credentials: false; the job verify keeps its context name.
  • mise.toml, mise.lock, go.mod, go.sum, buf.yaml, buf.lock, buf.gen.yaml (L1): the same tool pins as hearth (golangci-lint 2.15.0, buf 1.75.0, protoc-gen-go 1.36.12, svu 3.4.1); protoc-gen-connect-go and hearth's plugins are tool lines of go.mod (go.sum checksums), and no remote BSR plugin runs.
  • proto/frostyard/frostmarks/v1/marks.proto, third_party/**, gen/** (L1/L2): the permission, effect and exposure of each RPC; third_party/ is hearth v0.1.0's options file, kept equal by internal/repocheck; gen/ is checked by make gen-check.
  • marks/authorize.go (L1), marks/** (L2): the hooks check the stored folder, never a request field; tests prove each hook with a grant on another folder.
  • internal/rpc/** (L1): the private socket strips Lodge-* headers and acts as the local user (hearth's lodge.PrivateHandler); it closes every connection whose peer uid is not the daemon's own before it reads a byte (hearth's lodge.Listener), and it removes an old socket only when the kernel refuses a dial. Tests send forged headers, connect as a refused uid, and inject each dial error.

Verification

  • make ci green locally before the first push; make corrections-base manifest-check BASE=origin/main passes (no manifest at the base).
  • Tests named for the acceptance lines: TestDuplicateURLInFolder, TestDeleteFolderNotEmpty, TestTagRules, TestSearchBookmarks, TestBookmarkMovedEvents, TestFolderRenameEvents, TestBookmarkDeletedEvent, TestAuthorizeHooks, TestListsFilterByGrant; internal/e2e TestBinaries builds both binaries, starts frostmarksd in a temporary directory, and calls each RPC by marksctl and by stdio MCP.
  • make site builds in strict mode.
  • Cross-review: see the review record comment; Ready at 4765f36, blocking none.

Onboard the repository to rows B1 to B19 of frostyard/core's repository
baseline with a Go gate (make ci), and build the standalone core of the
bookmark manager on hearth v0.1.0 (frostyard/core ADR-0085):

- proto/frostyard/frostmarks/v1/marks.proto: the service
  frostyard.frostmarks.v1.Marks, 11 RPCs with hearth's options, the
  capabilities marks:read and marks:write on the selector folder, and 5
  bookmark events; gen/ holds the generated Connect, permission, MCP,
  event and manifest code.
- marks/: the SQLite store with FTS5 search, the folder and bookmark
  rules, the permission hooks on the stored folder and the grant filters,
  and the events in the outbox of the change's transaction.
- internal/rpc/, cmd/frostmarksd, cmd/marksctl: the Connect server on the
  private socket as the local user, the daemon, the CLI with 1 command
  per RPC, and marksctl mcp, a stdio MCP server.
- docs, ADRs 0004 to 0006, the specs, the roadmap and the site.
@github-actions github-actions Bot added level:L1 Read every line risk:high Touches a path in .github/risk-paths.json labels Nov 16, 2026
- internal/rpc: the private socket serves only the daemon's own uid
  (hearth's lodge.Listener), and only ECONNREFUSED marks a socket stale.
- marks: a folder path refuses control characters and paths whose event
  topic passes hearth's limit; a rename checks every path it makes; the
  database URI is escaped.
- corrections-base: run is tested in temporary git repositories, and
  records compare by the raw bytes of each member, lone surrogates too.
- workflowcheck: guards for B15, B16 and the README surfaces.
- Tests use no TCP; the stale-socket test keeps its socket; the docs and
  the site match the code.

Each blocking point has its guard test and 1 record file in
.memory/corrections/.
- The grant docs write a plain folder path (/reading), which covers itself
  and every folder below it: hearth's authz has no wildcard. A test keeps
  wildcard folder paths out of the docs and the site.
- The marksctl guide creates each folder before it uses it.
- The README check places the optional How it works once, before Develop,
  and its missing-status fixture removes the line.

The blocking point has its guard test and 1 record file in
.memory/corrections/.
@frostyard-machines

Copy link
Copy Markdown
Contributor Author

Cross-review record

  • Reviewer: openai/gpt-6.1-sol. Coder: deepseek/deepseek-flash; the proto and gen/ by anthropic/claude-opus-5-5.
  • Base bb58f752e431c73e821c54cb6601b4440e12b3fb.
  • Initial review at a291305ad3bf5743e5db5e9ff8c0cd88a0acdc18, in 4 batches (permission and trust, core tests, gate and governance, docs). Not ready: blocking F1–F8, F10–F12; F9, F13 low.
    • F1 the socket served another uid in the window before chmod → lodge.Listener peer-uid check (TestListenPeerUID).
    • F2 any dial error removed a socket → only ECONNREFUSED (TestClearPathDialErrors).
    • F3 NUL in folder paths broke SQLite prefix checks → control characters refused (TestFolderControlCharacters).
    • F4 rename could store too-long child paths → every resulting path checked in the transaction (TestRenameFolderDescendantLimits).
    • F5 unescaped SQLite URI → escaped file URI (TestOpenEscapedPath).
    • F6 folders whose event topic passes hearth's limit → refused (TestFolderTopicLimit).
    • F7 the stale-socket test never left a stale socket → SetUnlinkOnClose(false).
    • F8 a unit test used TCP → Unix socket.
    • F10 corrections-base run untested → TestRun in temporary git repositories.
    • F11 B15, B16, B17/B9 claimed but not checked → guards in internal/workflowcheck.
    • F12 lone surrogates failed the base comparison → raw member bytes (TestRecordProblemsRawMembers).
  • Re-review 1 at a0fcd1fc8b8a45d7d1bcb87e302c609e93dcbfa9: F1–F13 fixed. New: F14 (blocking) a grant example used /reading/**, which hearth's authz takes literally → /reading and TestNoWildcardGrantPaths; F15, F16 low (guide order, README section placement) fixed too.
  • Re-review 2 at 4765f361e76de9e34430eba44c62fb90a7745234: Ready. Blocking: none.
  • Each blocking fix has a guard test that failed with the fix reverted, and a record in .memory/corrections/2026-11-16-pr-3-*.json.
  • Excluded from line review: gen/** (generated; its inputs reviewed), mise.lock, go.sum, site/requirements.txt, the site logo and stylesheet, and the deleted Node files.
  • Local: make ci BASE=origin/main and make site green at the head.

@bketelsen
bketelsen merged commit 16f726f into main Nov 16, 2026
7 checks passed
@frostyard-machines
frostyard-machines deleted the irulan/t9-frostmarks-core branch November 16, 2026 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

level:L1 Read every line ready-for-human Reviewed, CI green: ready for Brian to review and merge risk:high Touches a path in .github/risk-paths.json

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants