Skip to content

P3: explicit export file: names are a cross-repo shared namespace — decision record from the #156 review residual #161

Closed as not planned

Description

@WhollyMindless

Origin

The #156 approval review (residual note) identified one cross-repo seam that the export-scoping work deliberately left open, and asked for the decision to live on record rather than in a commit-message footnote. This issue is that record. No defect claim; nothing here is red.

The seam

Since #156, implicit export destinations are collision-proof: stamp() + a randomUUID suffix, opened O_EXCL (only for implicit names), so two repositories exporting in the same second get separate artifacts.

Explicit file: destinations remain a shared namespace. exports/backup.jsonl is one path for every repository that shares the store: a session in repo B exports there, a session in repo A exports the same name, and the file now holds B's scoped rows under a name A chose — and A's later export→import round-trip re-imports B's rows. writeExport(path, text, exclusive=false) replaces, silently.

The decision as merged: keep replace-on-explicit-name

Rationale, from the review and the #156 thread:

  1. Replace is the documented backup workflow — a repeated file: "backup.jsonl" returning the same path and rewriting it is what README §"Export and move between machines" promises.
  2. It adds no new capability class: memory_export/memory_import accept arbitrary paths outside the memory root #24 confines paths to the store, not to per-repo subtrees, and repo A can already read B's day files directly with the host's read tool. A named destination is not a confidentiality boundary in this threat model.
  3. Silent-ness is bounded: rows only move into the file that the calling session's own reader could already see — the leak direction is A choosing to overwrite with, or import, content A is permitted to read anyway... except that a B-written file later read by A carries B's prose. That is the honest residual, and it is why this issue exists.

If revisited (options, not commitments)

  • Surface the overwrite: an explicit-name export that replaces an existing file says Overwrote existing export at <path> in its output — one line, keeps ergonomics, kills the silentness.
  • Per-repo subdir for relative explicit names (exports/<repo-key>/backup.jsonl): true separation, but breaks the round-trip ergonomics and the README's copy-block paths.
  • README sentence under §"Export and move between machines": explicit names are shared across repositories in one store (works regardless of which code option is taken later).

Related micro-follow-up (same review, non-blocking)

The F2 pinned contract test asserts the drop for the legacy unstamped global row; the maintainer probed the explicit repo:"global" twin (identical behavior — same isVisibleTo branch) and noted a second row in that test would make the pair explicit for the next reader. Two-line addition whenever that file is next touched; not worth an approval-resetting push on its own.

Closes nothing; see #156 for the code this records.

Activity

  1. WhollyMindless commented on Oct 28, 2026

    @WhollyMindless
    ContributorAuthor

    Duplicate of #159. The useful follow-up options and explicit-global test note are preserved in #159 (comment), together with corrections to the overwrite sequence and PR merge status. Please use #159 as the single decision record.

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