docs: document all persistent filesystem paths in Storage section#101
docs: document all persistent filesystem paths in Storage section#101HaleTom wants to merge 9 commits into
Conversation
Add embedding model cache path, log file path, and sandbox/ephemeral environment guidance to the Storage section of README.md. Previously only the SQLite database path was documented. Users in sandboxed or CI environments had no way to know which directories must persist between resets. Closes cortexkit#100
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates the README to better document where Magic Context persists state and related artifacts on disk, including guidance for sandboxed/ephemeral environments.
Changes:
- Replaced the single-path code block with a table listing multiple persisted/diagnostic paths
- Added guidance about persistence requirements in sandboxed/ephemeral environments and how paths derive from
$XDG_DATA_HOME
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
No issues found across 1 file
Tip: cubic could auto-approve low-risk PRs like this, if it thinks it's safe to merge. Learn more
Re-trigger cubic
Change "override with $XDG_DATA_HOME" to "override by setting $XDG_DATA_HOME" to avoid ambiguity.
- DB path: legacy `.../opencode/storage/plugin/magic-context/` → `.../cortexkit/magic-context/`
- Model cache: same legacy fix
- Log path: bare `/tmp/magic-context.log` → `/tmp/{harness}/magic-context/magic-context.log`
- Sandbox note: only DB + model cache derive from $XDG_DATA_HOME
- DB path: legacy `.../opencode/storage/plugin/magic-context/` → `.../cortexkit/magic-context/`
- Model cache: same legacy fix
- Log path: bare `/tmp/magic-context.log` → `/tmp/{harness}/magic-context/magic-context.log`
- Sandbox note: only DB + model cache derive from $XDG_DATA_HOME
`os.tmpdir()` is not guaranteed to be `/tmp` (e.g. Windows uses
`%TEMP%`, macOS may use `/var/folders/...`). Document the path using
`{os.tmpdir()}` placeholder instead of hard-coded `/tmp`.
Co-authored-by: copilot-pull-request-reviewer[bot] <175728472+copilot-pull-request-reviewer[bot]@users.noreply.github.com>
Thread 5: DB/model cache paths now show `$XDG_DATA_HOME/cortexkit/...` with the default expansion in parentheses, matching the sandbox note. Thread 6: log row now includes `%TEMP%` for Windows alongside `/tmp`.
Thread 7: "default:" → "resolves to ... when unset" to avoid
misleading readers on non-XDG platforms.
Thread 8: add "auto-detected from the host app at startup" to
explain how {harness} is determined.
Thread 9: log row now shows %TEMP%/$env:TEMP on Windows. Thread 10: sandbox note shows %USERPROFILE%\.local\share on Windows, syncs phrasing to matches table.
| | What | Path | | ||
| |------|------| | ||
| | SQLite database (tags, compartments, memories, dream queue, all state) | `$XDG_DATA_HOME/cortexkit/magic-context/context.db` (resolves to `~/.local/share/cortexkit/magic-context/context.db` when unset) | | ||
| | Embedding model cache (downloaded ONNX model, ~90 MB) | `$XDG_DATA_HOME/cortexkit/magic-context/models/` (resolves to `~/.local/share/cortexkit/magic-context/models/` when unset) | | ||
| | Log file (diagnostic, non-essential) | `{tmpdir}/{harness}/magic-context/magic-context.log` — `{tmpdir}` is the OS temp directory (`/tmp` on Linux/macOS, `%TEMP%`/`$env:TEMP` on Windows); `{harness}` is auto-detected from the host app at startup: `opencode` (OpenCode) or `pi` (Pi) | |
| |------|------| | ||
| | SQLite database (tags, compartments, memories, dream queue, all state) | `$XDG_DATA_HOME/cortexkit/magic-context/context.db` (resolves to `~/.local/share/cortexkit/magic-context/context.db` when unset) | | ||
| | Embedding model cache (downloaded ONNX model, ~90 MB) | `$XDG_DATA_HOME/cortexkit/magic-context/models/` (resolves to `~/.local/share/cortexkit/magic-context/models/` when unset) | | ||
| | Log file (diagnostic, non-essential) | `{tmpdir}/{harness}/magic-context/magic-context.log` — `{tmpdir}` is the OS temp directory (`/tmp` on Linux/macOS, `%TEMP%`/`$env:TEMP` on Windows); `{harness}` is auto-detected from the host app at startup: `opencode` (OpenCode) or `pi` (Pi) | |
#100) PR #101 patched the pre-rework README; this adds the missing persistent paths (embedding model cache ~/.local/share/cortexkit/magic-context/models, the temp log) plus Docker/CI/sandbox guidance (persist the storage dir; disable local embeddings to skip the ~90MB model download) to the current README. Co-authored-by: Alfonso [Magic Context] <288211368+alfonso-magic-context@users.noreply.github.com>
|
Thanks Tom — this was the right call, and the README Storage section now documents exactly what you proposed: the SQLite DB, the ~90 MB local embedding model cache, the diagnostic log path, and a dedicated 'Sandboxed / ephemeral environments' paragraph with persistent-volume guidance. It landed via a separate docs pass. Closing as superseded — appreciate you surfacing the gap for sandboxed/Codespaces users. |
cortexkit#100) PR cortexkit#101 patched the pre-rework README; this adds the missing persistent paths (embedding model cache ~/.local/share/cortexkit/magic-context/models, the temp log) plus Docker/CI/sandbox guidance (persist the storage dir; disable local embeddings to skip the ~90MB model download) to the current README. Co-authored-by: Alfonso [Magic Context] <288211368+alfonso-magic-context@users.noreply.github.com>
What
Expand the README.md Storage section with two previously undocumented paths and sandbox guidance:
~/.local/share/opencode/storage/plugin/magic-context/models/) — the ~90MB ONNX model downloaded on first use/tmp/magic-context.log) — diagnostic, non-essential$XDG_DATA_HOMEoverride noteWhy
The SQLite DB path was the only documented file. Users in sandboxed environments (Codespaces, Docker, CI runners) had no way to know which directories to persist, risking data loss and repeated model downloads on every reset.
Changes
| What | Path |table covering all three pathsCloses #100
Need help on this PR? Tag
@codesmithwith what you need. Autofix is disabled.Summary by cubic
Documented all persistent storage paths in the Storage section to prevent data loss and repeated model downloads. Paths now match current sources, use
$XDG_DATA_HOMEwith “resolves to … when unset,” add Windows fallbacks (%USERPROFILE%\.local\share;%TEMP%/$env:TEMP), and clarify{harness}auto-detection.~/.local/share/cortexkit/magic-context/context.dband~/.local/share/cortexkit/magic-context/models/in sandboxed/ephemeral environments.$XDG_DATA_HOME(resolves to~/.local/sharewhen unset;%USERPROFILE%\.local\shareon Windows). Set$XDG_DATA_HOMEto a persistent mount to move them.{os.tmpdir()}/{harness}/magic-context/magic-context.log(OS temp:/tmpon Linux/macOS;%TEMP%/$env:TEMPon Windows).{harness}is auto-detected (opencodeorpi).Written for commit f5e8f0b. Summary will update on new commits. Review in cubic