Skip to content

feat: per-project storage layer#65

Merged
nonogv merged 1 commit into
mainfrom
feat/storage-project-scoped
Jun 6, 2026
Merged

feat: per-project storage layer#65
nonogv merged 1 commit into
mainfrom
feat/storage-project-scoped

Conversation

@nonogv

@nonogv nonogv commented Jun 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • Extends Storage with per-project paths for history, instructions, memories, and snapshots under projects/<slug>/, plus global context under global/.
  • Adds project management (loadCurrentProject, saveCurrentProject, clearCurrentProject), scoped instructions/memories I/O, loadPromptContext, and loadProjectSnapshot / saveProjectSnapshot.
  • One-time constructor migration copies legacy root history.json to projects/default/history.json when the per-project file does not yet exist.
  • Exports ProjectInfo, ProjectSnapshot, and projectNameToSlug.

What was NOT touched

  • src/server.ts — WebSocket handlers and history wiring (PR 3)
  • src/agent/chat.tsPromptContext export and buildSystemPrompt injection (PR 2); loadPromptContext uses a local matching interface until that PR lands
  • ui/ — Context tab and project UI (PR 4)

Tradeoffs

  • loadPromptContext defines a local PromptContext interface matching the shared contract rather than importing from chat.ts, so this PR stays storage-only and builds without PR 2. PR 2 can export the canonical type and this file can switch to import type.
  • Project-scoped instructions/memories fall back to slug "default" when no current project is set (same as history).
  • Legacy root history.json is copied, not deleted, so rollback remains possible.

Test plan

  • npm test -- src/storage.test.ts — 34 tests pass (existing + new project/history/migration/context/snapshot coverage)
  • npm run build — TypeScript and production bundle succeed
  • After PR 2/3 merge: verify loadPromptContext import from chat.ts and server wiring

Made with Cursor

Co-authored-by: Cursor <cursoragent@cursor.com>
@nonogv nonogv merged commit 03ca7a4 into main Jun 6, 2026
1 check passed
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