-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Summary
When using tapes across multiple projects, there's no way to identify which repo/project a session belongs to or filter sessions by project. This RFC proposes adding project context to the data model and surfacing it in the deck UI.
Problem
The deck currently shows all sessions in a flat list with no project association. Users working across multiple codebases have no way to filter or distinguish which sessions belong to which project.
Current Architecture
- Sessions are reconstructed at query time from leaf nodes in the DAG — not first-class entities
- The
nodestable has no column for repo, project, or working directory - The proxy captures LLM request/response pairs but no client context
merkle.Bucketfields (Type, Role, Content, Model, Provider) are content-addressed — changes affect hashes
Proposed Approaches
Option A: Custom HTTP Header (X-Tapes-Project)
Clients send a header with each LLM request. The proxy extracts it and stores it as node metadata (outside the content hash).
Pros: backward-compatible, multiple projects in one DB, client-driven, doesn't break content addressing
Cons: requires client cooperation, each LLM client needs configuration
Option B: Per-Database Isolation
Leverage the existing dotdir package (local .tapes/ directories) so each project uses its own SQLite DB.
Pros: zero schema changes, natural isolation
Cons: no cross-project dashboard view, harder to compare across projects
Option C: Proxy-Side Detection
The proxy detects the git repo from its working directory or a config value.
Pros: no client changes needed
Cons: one proxy instance = one project, less flexible
Scope of Changes (Option A)
| Layer | File(s) | Change |
|---|---|---|
| Schema | pkg/storage/ent/schema/node.go |
Add optional project field |
| Proxy | proxy/proxy.go, proxy/worker/pool.go |
Extract header, propagate to storage |
| Query | pkg/deck/query.go, pkg/deck/types.go |
Add Project to SessionSummary and Filters |
| TUI | cmd/tapes/deck/tui.go |
Add --project flag, filter tab |
| Web UI | web/deck/index.html, web/deck/deck.js |
Add project dropdown and column |
| Web API | cmd/tapes/deck/web.go |
Parse project query param |
Open Questions
- Should this be a single approach or a hybrid (e.g., header + dotdir fallback)?
- How should existing sessions without project info be displayed? (e.g., "unknown" bucket)
- Should the project value be the git remote URL, repo name, or directory path?
- Should this also capture git branch context?
References
pkg/deck/types.go—SessionSummaryandFiltersstructspkg/merkle/bucket.go— content-addressed fieldspkg/dotdir/manager.go— local vs global.tapes/directory support