feat(curation): route container-folder sessions to their topic - #24
Merged
Merged
Conversation
Sessions from container folders (home, code, emails, work, ...) mixed unrelated work into pages like `topics/emails`. - New `session_topics` table (SQLite 0004, PostgreSQL 0007) records the page a session belongs to, or NULL when it holds nothing durable. - `session_targets` resolves every session: a routed page first; sessions in container folders wait for routing; others go to the covering `topics/` page of their folder, else `topics/<folder>`. - The backlog and the curator's evidence pack group by that page, so two folders covered by one page yield one backlog item. - `curation.generic_workspaces` (env WIKIBRICKS_CURATION_GENERIC_WORKSPACES) lists the container folder names. Implemented by GLM 5.3 Flash; PostgreSQL tests rerun in review. Co-authored-by: Isaac <no-reply@databricks.com>
Before building the backlog, the nightly curator sends unrouted sessions from container folders (home, code, emails, ...) and the existing topic pages to the model in one call. Each session goes to an existing page, a new `topics/<slug>` named after the subject, or null for throwaway work; the answer is stored in `session_topics`, so each session is routed once. - Routes are validated: known session, candidate or well-formed new path, never a container-folder name. Invalid routes are retried next night. - Pages named after a container folder (an old `topics/emails`) are not offered as candidates. - A session routed after its page's last update counts as new evidence for that page, so its content reaches the page. - One retry; a routing failure is reported and never blocks curation. Acceptance with GLM 5.3 Flash on a copy of the live store: 6 of 6 sessions routed by content (e.g. a Slide Hub MCP session from the emails folder to `topics/slide-hub`, two interview scripts to `topics/interviewing`), 0 invalid, then 5 of 5 pages applied. Implemented by GLM 5.3 Flash; candidate filtering and the null rule tightened in review after the first real run discarded 4 of 6 sessions. Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Merged
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.
Problem
The user often starts work on unrelated topics from container folders: the home directory,
~/work/30-demos/code,~/work/50-communications/emails. The curation backlog grouped sessions by folder name, so the curator wrote pages liketopics/emailsthat mixed unrelated work, for example an interview script next to a deck rename. Two folders covered by one page also became two backlog items.Change
Storage. A new
session_topicstable (SQLite0004, PostgreSQL0007, forward-only and pinned in the immutability test) records a session's page, or NULL when it holds nothing worth keeping.Grouping by page.
session_targetsresolves every session in order:topics/page of the folder, elsetopics/<folder>.The backlog and the curator's evidence pack group by that page.
Config.
curation.generic_workspaces(envWIKIBRICKS_CURATION_GENERIC_WORKSPACES) lists the container folder names. The default iscode, emails, work, projects, repos, src, documents, desktop, downloads, tmp, and the home directory always counts.Routing. One model call per night, before the backlog: unrouted container-folder sessions (title and first user messages, 600 characters) plus the existing
topics/andprojects/pages.topics/<slug>named after the subject, or null, which is reserved for one-off questions, tool tests and small talk.topics/emails, are not candidates.Timing. A session routed after its page's last update counts as new evidence for that page.
Verification
main(fix(curation): record the real author of applied curation changes #23), including PostgreSQL, and Ruff is clean.uv.lockis unchanged.topics/slide-hub;topics/interviewing;topics/iceberg-to-delta-migration;topics/claude-model-availability;topics/l100-coding-agent-slides.GLM 5.3 Flash wrote the implementation in two steps. Review added the routed-time rule and candidate filtering, and tightened the null rule after the first real run.
This pull request and its description were written by Isaac.