Skip to content

Goal: post-v0.1.0 follow-ups — per-repo HTTP scoping, sync opt-in, hardening #1

Description

@Sorcecoder

Follow-ups from the v0.1.0 extraction reviews (final whole-branch review + fix-wave re-review, 2026-07-03). Spec: backant-kairos docs/superpowers/specs/2026-07-03-standalone-memory-mcp-design.md (incl. Amendment). Execution history: backant-kairos .superpowers/sdd/progress.md.

1. Roots-based per-session scoping for HTTP /mcp (the big one)

Today the daemon's HTTP /mcp serves a single global partition (repo="", legacy .index.db) because HTTP MCP sessions carry no cwd. Claude Code was moved to stdio registration (correctly repo-scoped); other-agent HTTP clients still get the global store.
Done when: on session initialize the daemon reads the client's declared roots, opens/caches the matching ns-*.db + repo key per session (fallback: global partition when no roots), covered by tests with two concurrent sessions on different fake roots seeing isolated memories; README/claude-md-section drop the global-partition caveat.

2. BACKANT_MEMORY_SYNC remote sync opt-in (spec D5, deferred)

provision.ts/credentials reader are already in-tree; nothing reads BACKANT_MEMORY_SYNC.
Done when: BACKANT_MEMORY_SYNC=1 + backant credentials → buildMemoryContext runs without forceLocal (embedded replica sync); default stays fully local; README env table updated; test covers the flag gate.

3. Hardening batch (small, one PR)

  • /digest context cache: Map<string, Promise<MemoryDb>> to close the concurrent-first-request fd leak (src/daemon/http.ts)
  • Constant-time bearer compare (crypto.timingSafeEqual, src/daemon/http.ts)
  • registerHook idempotency: structural check instead of JSON.stringify().includes() (src/install/hook-registration.ts)
  • Supervisor tests: non-ok-status + JSON-parse branches of siblingIsHealthy; assert log strings (tests/daemon/supervisor.test.ts)
  • XML-escape & in renderPlist interpolations (src/daemon/launchd.ts)
  • /digest catch: one-line stderr log instead of fully silent (src/daemon/http.ts)
  • Fix wrong "cosine ... 0 (parallel vectors)" comments (should be 1) in tests/daemon/http.test.ts + tests/hooks/session-start-recall.test.ts
  • install success message says "MCP at http://…" though Claude registration is stdio (src/cli.ts)
    Done when: each lands with a covering test where behavior changes; suite green.

4. Prove the release pipeline on the next version

0.1.0 was published locally (registry rejected trust pre-create for a new package). Trusted publisher is now bound (repo backant-io/backant-memory, workflow publish.yml, env release).
Done when: npm version patch && git push --follow-tags && gh release create produces an Actions run that publishes with provenance; badge visible on npmjs.

Constraint

Schema remains FROZEN (SHA-256 pin 33fc94f3d5f6… tested in both repos) until backant-kairos consumes this package — see the paired kairos goal issue.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions