Skip to content

feat(jsonlstore): support read-only access to existing stores - #2031

Merged
JAORMX merged 1 commit into
mainfrom
feat/2027-jsonl-read-only
Oct 1, 2026
Merged

JAORMX merged 1 commit into
mainfrom
feat/2027-jsonl-read-only

Conversation

@JAORMX

@JAORMX JAORMX commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add jsonlstore.OpenReader and a separate read-only Reader for discovery, snapshots and usage, prepared-catalog metadata pagination, lineage, and event replay/follow.
  • Reuse existing synchronization identities through read-only shared locks. Never initialize, repair, rebuild, or clean up the source; preserve the writable constructors and writer behavior.
  • Add denied-write subprocess proofs, bounded pagination and failure/cancellation coverage, and an integration test using the real Build/HTTP persistence-relay path.

Relates to #2027.

Scope and limitations

JSONL adapter only: no server endpoints, UI, Redis, dependencies, storage-format migration, or engine API changes. The operator explicitly waived the separate acceptance-plan spine in this conversation after it was recommended.

Metadata pagination requires a prepared, current catalog at the same canonical path. A concurrent save invalidates it until its writable owner refreshes it; readers report unavailability rather than rebuilding or returning an empty inventory. Reader metadata cursors are returned to Reader, not Store. Missing synchronization files fail explicitly. The owning guide documents source preparation and limitations; the adapter changelog classifies the public API addition as Added.

Documentation reader need: inspect an existing store without write access. Owner: user-docs/building/extension-points/session-store.md.

Verification

Candidate base: 6473fa34100cee15353c29c0cbd72c580d5c3069.

Passed:

  • task test (all modules)
  • go test -race ./adapters/jsonlstore -run '^TestOpenReader' -count=1
  • go test -race ./internal/app -run '^TestJSONLReaderPersistenceRelay$' -count=1
  • task docs
  • task site:build
  • go run ./cmd/mecademo (tool call, permission ask/approval, result)
  • Darwin/arm64 JSONL test cross-compilation
  • git diff --check

Why draft

  • task test:race fails in TestJSONLStoreLineageConformance: jsonlstore: lineage partition is incomplete. The identical full-suite failure was reproduced on pristine HEAD. This change does not alter the writer's lock-free lineage-read contract to hide it.
  • Full task lint timed out after 600 seconds during integration/microvm. Earlier module checks, including root and adapters, reported zero issues. Separate scoped JSONL lint reports three constructor G703 findings also reproduced on baseline.
  • Independent review is incomplete: five reviewer workers could not access the isolated worktree. Architecture and duplication reviewers completed the initial implementation review without findings; subsequent consistency/cancellation repairs received parent review and focused verification, not a complete independent panel rerun.

The OS-denied-write tests ran as the current unprivileged process and probe create, existing-file write/truncate, rename and unlink denial. The privileged subprocess drops DAC bypass capabilities with setpriv; that privileged branch was not separately exercised here. This is not a read-only-mount proof.

Local detailed logs and baseline evidence are retained in .scratch/issue-2027/results.md inside the worktree. Aggregate gates and independent review must be resolved before marking ready. Do not merge as-is.

@JAORMX
JAORMX marked this pull request as ready for review October 1, 2026 07:14
@JAORMX
JAORMX merged commit c2f5721 into main Oct 1, 2026
62 of 64 checks passed
@JAORMX
JAORMX deleted the feat/2027-jsonl-read-only branch October 1, 2026 07:33
@toolhive-release-app toolhive-release-app Bot mentioned this pull request Oct 1, 2026
2 tasks

This branch was successfully deployed

1 active deployment
Preview — 3c3e3b9d Deployed Oct 1, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant