chunk 3/13: .llmem storage centralization + migration#3
Closed
cogeor wants to merge 6 commits into
Closed
Conversation
…oot default)
Flip the two prefix owners + the one hardcoded derivation together so every
downstream path moves atomically: docs at .llmem/docs (ARCH_DIR -> DOCS_DIR),
graph artifacts at .llmem/graph (DEFAULT_CONFIG.artifactRoot + the VS Code
config default), webview deriving as .llmem/graph/webview. Fixes the
workspace-context drift trap (hardcoded asRelPath('.arch') -> asRelPath(DOCS_DIR))
and normalizes artifactRootRel to forward slashes for the web contract.
design-doc-keys/workspace-context/viewer-data fixtures move to the new prefixes
(keys unchanged, archRoot-relative); 4 now-stale rows dropped from the
.artifacts allowlist. generator step-3 + a one-time migration follow in VS-B2/B3.
Implements: 4-viewer-summaries/VS-B1
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
generator step 3 physically copied .arch into webview/arch/ (a third copy of the
docs) and the client kept a matching arch/${key} fetch fallback — both dead now
that docs are delivered via the design_docs.js bundle (static) and
ctx.archWatcher.readDoc/api/arch (serve). Remove the copy + convertAllMarkdown
call + its import, and the designDocService PHASE 2 fetch (PHASE 1 bundle lookup
stays). Also fold in the centralization fix VS-B1 surfaced: viewer-data's two
stray io.mkdirRecursive('.arch') calls now target ctx.archRootRel (.llmem/docs).
Implements: 4-viewer-summaries/VS-B2
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…init migrateDocs runs once per workspace-context init and handles four cases: no-legacy (no-op), legacy-only (atomic whole-dir fs.rename, EXDEV copy->verify->unlink fallback), new-only (no-op), and both-present conflict (policy b: leave both trees untouched, warn, never clobber an existing .llmem/docs file). Idempotent (guards on .llmem/docs non-existence), cheap on warm inits (single exists() short-circuit), and never touches the regenerable .artifacts/ cache. New four-case + .artifacts-safety test; arch guards allowlist the helper's direct fs.rename and its JSDoc literal. Implements: 4-viewer-summaries/VS-B3 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Decision 2026-06-02: .llmem/ is gitignored ENTIRELY (docs + graph + webview), matching today's local-only .arch. Replace the .arch/.artifacts entries in .gitignore, .eslintrc.json, and .vscodeignore with a single blanket .llmem/ (the migration removes .arch; .artifacts regenerates under .llmem/graph). Drop the three now-stale .artifacts allowlist rows. PH-05's ensureGitignored will write the same blanket line idempotently. design-doc-keys/workspace-context fixtures already moved in VS-B1. Implements: 4-viewer-summaries/VS-B4 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sibling to the .artifacts allowlist guard: arch-root-literals.test.ts scans src/ for the quoted .arch storage-root literal and fails on any occurrence outside an owner allowlist (workspace-marker detectors, the migrate-docs legacy source, IGNORED_FOLDERS) — new drift must use ctx.archRootRel/DOCS_DIR instead. Scoped to src/ + a quoted-literal regex that rejects .archRoot/archWatcher/.archive. STALE rows are flagged too. (One self-reference row added to the .artifacts allowlist for the new file's own scoping prose.) Implements: 4-viewer-summaries/VS-B5 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…rst scan The first scan/doc-gen silently created .llmem/ in the user's repo with no gitignore entry. ensureGitignored runs once per process at the artifact-root mkdir seam: in a git repo it appends a "# LLMem (generated)" block + a single blanket `.llmem/` line (append-only, never reorders the user's file), is a no-op when `.llmem`/`.llmem/` already exists (matching VS-B4's line idempotently), and in a non-git workspace logs a one-time notice without writing. Writes via the realpath-safe WorkspaceIO surface. Implements: 1-package-hardening/PH-05 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Owner
Author
|
Refolded: chunks 3-11 fail CI individually (npm-test hang + smoke-pack drift, both fixed only at chunk 11). Re-landing as one CI-green core PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Chunk 3/13. Centralize storage under .llmem (DOCS_DIR + artifactRoot default), one-time conflict-safe .arch -> .llmem/docs migration at init, blanket .llmem/ gitignore (collapse cache-vs-docs split), idempotent ensureGitignored on first scan, and an arch guardrail against new hardcoded .arch storage-root literals.
🤖 Generated with Claude Code