Repository navigation
Add persistent session project assignments and tags - #265
Merged
Merged
Conversation
Users can move a session to a project and add free-form tags. Both live in state/session-metadata.sqlite, apart from the rebuildable analytics cache, so reindex, rebuild, and analytics backfills keep them. Rows are keyed by machine, provider, and session ID. Project resolution now happens in one place in analytics: the session's own assignment, then its parent's, then the derived repository grouping. Sub-agent and forked sessions inherit their parent's project and tags unless they have their own. The analytics cache records parent_session_id (schema 8 backfills it). New commands: memex session set-project, clear-project, tag add/rm/ls, and inspect, with --machine routed over RPC to the machine that indexes the session. --tag filters sessions, projects, search, and MCP; the TUI accepts #tag in the project filter; the web UI gets a tag picker and shows tags. Closes #263 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0112tRxuWBggF3Q77E2YbDaN
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.
Requested by Nico · project thread
Closes #263
Users can now move a session into a project and add free-form tags. Both work in session and project listings, search, MCP, the TUI, and the web UI, and both survive reindex and rebuild.
memex session set-project SESSION_ID ProjectA memex session clear-project SESSION_ID memex session tag add SESSION_ID tooling memex session tag rm SESSION_ID tooling memex session tag ls memex session inspect SESSION_ID memex sessions --tag tooling # also: projects --tag, search --tagStorage and resolution
state/session-metadata.sqlite(newsrc/session_meta.rs), apart from the rebuildableanalytics.sqlite.reset_reindex_artifacts, analytics backfills, and the schema bump don't touch the new file. Transcripts and provider metadata are never written.(machine, source, session_id), not by transcript path.project_sql()inanalytics.rs, which replacesCOALESCE(NULLIF(repo_project,''),'Unfiled'). The order is: the session's own assignment, then its parent's assignment, then the derivedrepo_project, thenUnfiled. Flat grouping uses the same order, falling back toproject.parent_session_idis now recorded in the analyticssessionstable.SCHEMA_VERSIONgoes from 7 to 8 so one backfill fills it in.Design defaults (maintainer decisions from the issue)
parent_session_id.--source. Legacycodex-sessionandcodex-historylabels map tocodex.#stripped, and can't contain commas. Repeating--tagmeans every tag must match.inspectandsessionsoutput showassigned_projectandtagsnext to the unchangedrepo_project,cwd, andgit_root.--machine IDsends writes and inspects to that machine through a newSessionAssignmentRPC. Themachinecolumn is alwayslocalfor now. It's in the key so assignments can't collide if stores are ever merged.#tagin the project filter applies a tag filter, and the project lists include#tagentries. Web UI: there's a tag picker next to the project picker, a Tag field in the filter panel,/api/tags, and#tagshown on result rows.Not covered
PR #237's chat organization is a macOS-app-local
organization.jsonfor pins and sections, so it's not reused here and nothing depends on it.Testing
tests/session_assignments_cli.rsfollows the issue's acceptance examples end to end, including a simulated rebuild, inheritance, an explicit child override, and ambiguity and missing-session errors. There are also analytics unit tests (override, inheritance, survival acrossrebuild_from_records, read-only open without a store), a search scope test (tags and assigned projects in flat search), and a Playwright test for the web tag filter.cargo fmt --checkandcargo clippy --all-targets -- -D warningsare clean.web/distwas rebuilt (I checked that the build is byte-reproducible on main first).cargo testin the sandbox: every failure is a blocked Hugging Face model download (the lib suite has 162 failures, the same count as on main, plus 3 embedding tests indaemon_cli). Everything else passes.Generated by Claude Code