feat(data): add a project-first mapping workspace - #1514
Conversation
roborev: Combined Review (
|
roborev: Combined Review (
|
roborev: Combined Review (
|
This comment has been minimized.
This comment has been minimized.
roborev: Combined Review (
|
roborev: Combined Review (
|
d224bce to
8726012
Compare
roborev: Combined Review (
|
8726012 to
a107cf8
Compare
roborev: Combined Review (
|
roborev: Combined Review (
|
2013211 to
e2994b1
Compare
roborev: Combined Review (
|
e2994b1 to
dd90920
Compare
roborev: Combined Review (
|
dd90920 to
4a488fa
Compare
roborev: Combined Review (
|
4a488fa to
dd0467f
Compare
roborev: Combined Review (
|
roborev: Combined Review (
|
dc99098 to
0e93138
Compare
roborev: Combined Review (
|
roborev: Combined Review (
|
roborev: Combined Review (
|
7df5129 to
0913cef
Compare
roborev: Combined Review (
|
0913cef to
d889f4e
Compare
The project-first mapping workflow needs an opt-in comparison period without a second settings model or saved experiment state. Keep Project mapping rules as the default Data experience. A build flag enables the inventory and split inspector while retaining Rules as its secondary view.
Activity project links need the project workspace to provide a meaningful destination. Render plain labels when that workspace is disabled. Build the existing Data end-to-end scenarios with the workspace enabled so their test contract matches the interface they exercise.
The flagged workspace still rendered the legacy inventory and mapping editor, so it did not represent the selected project-first prototype. Keep the project inventory visible while users inspect folder suggestions and correct a mapping inline. Require an explicit review only when a preview is broad or replaces an existing rule, and omit actions the backend cannot support.
A local server started with --no-sync still owns a writable archive, but project correction routes treated its missing continuous sync engine as remote mode. Use the existing on-demand engine for correction writes while preserving the read-only store guard.
Project cleanup was limited to one project at a time, which made groups of related misclassified sessions impractical to fix. Let users Shift-click a visible project range, review every suggested folder together, and save those folders to one target project from a single bulk workspace. Keep full folder paths readable in both the single and bulk inspectors.
A Shift-click range could remain active after browser navigation selected a different project. The stale range made the workspace disagree with its URL. Clear local ranges at navigation boundaries and let the inventory use the full available width when no details are open. Update the browser workflow to use the project-first interface labels.
Project corrections only summarized aggregate impact, so users could not see the sessions a folder rule would reclassify. Stack the long path and project controls at full width. Show sampled sessions in a collapsed carousel and load only the active session's details when opened.
The project-first inspector lost correction controls while users scrolled a long inventory and made every rename a folder-at-a-time task. Keep the inventory and correction panes in place, add a whole-project mode, and show recent transcript content as soon as a project is selected. Compact, collapsible sections preserve room for that context. A reserved impact row prevents controls from jumping while archive counts load.
Project mapping reviews need enough transcript context to identify a project, including sessions that started in temporary or generated worktrees. Folder rules cannot safely express corrections that apply to only one session. Persist explicit session assignments so operators can correct those exceptions without changing other sessions or discarding folder evidence. Keep candidate folders scoped to the exact selected project so the review reflects the archive.
Session assignment provenance belongs to database state, not hashed artifact content. Treating it as manifest parity would rehash existing exports without restoring the assignment record during import. The browser workflow also rendered before Activity finished loading and used ambiguous text selectors after the inspector gained summary labels. Wait for the report and target the intended semantic sections so CI checks the workflow instead of request timing.
The mapping workflow was checking rendered results as soon as response headers arrived. Activity streams its report after those headers, and the Data page loads several JSON resources in sequence, so a busy CI server could still be working when the five-second locator checks expired. Wait for each resource that drives the next assertion. Keep the final UI and mutation checks unchanged so the test still proves the full correction flow.
The worktree parser cases used a real user path and a legacy project name even though the behavior depends only on directory layout. Reserved example values keep those cases portable and remove unrelated identity from the fixtures.
The project correction preview can run once for a path change and again for the selected project. Parallel CI load changes whether the first request is cancelled before it starts, so an exact request count made the browser test timing-dependent and left retries against mutated fixture state. Keep the completed-response wait and rendered impact checks as the observable preview contract.
Session change events can arrive while a committed correction reloads the project inventory. Under parallel browser load, the event refresh superseded the correction refresh before it could select the target project. Treat the correction reload as the refresh for its matching event so the workspace completes target selection before later events reload inventory.
Pull request checks call the reusable CI workflow pinned to main. Until this branch lands, that workflow builds the frontend without the new workspace flag and cannot exercise its mapping scenarios. Skip those scenarios when the build contract is absent. Once the workflow change lands, both writable and read-only e2e jobs set the contract and must run the full mapping suite.
Concurrent corrections and session events could replace or drop the inventory read that selects the corrected project. Queue correction reads and run one follow-up refresh after the queue drains so the workspace reaches the newest inventory. Local E2E builds already enable the mapping workspace. Pass the same contract to Playwright from the Make targets so mapping workflows run locally instead of being skipped.
Pull request checks use the reusable workflow from main, which builds the legacy Data page until this branch lands. Forcing the mapping test contract from Make caused those checks to run against UI that was not embedded in the server. Let the workflow opt into the mapping scenarios only when it also enables the frontend build flag. Use the button role in the read-only flow so the suggestion count cannot collide with the control label.
Project previews could mix unrelated sessions when different raw labels had the same safe display text. Manual session corrections were also difficult to find and could not return to automatic folder classification. Resolve previews from the opaque project identity and expose correction in the main Sessions list. Preserve the prior automatic project so an operator can remove an override without losing current folder-rule behavior. Upgrade existing prototype assignments in place so local review data remains usable.
The project mapping controls used spacing outside the shared scale and repeated the standard popover chrome. The design-system check rejects both patterns, which prevented the frontend test job from running. Use the pinned kit-ui token and popover class so the mapping UI follows the same contract as other transient controls.
Manual project corrections appeared automatic after the Sessions sidebar reloaded because its compact index omitted assignment provenance. Carry the explicit-assignment flag through each storage backend and sidebar hydration so operators can still restore automatic mapping after a refresh.
The Claude worktree backfill starts at data version 96, but later archive changes can raise the current version. Keep the test focused on that minimum boundary so unrelated version bumps do not break the suite.
Local E2E builds include the project mapping workspace, but the matching Playwright scenarios stayed disabled because the test contract was unset. Enable those scenarios by default for source builds. Keep prebuilt-server workflows opt-in because their embedded frontend may not contain the workspace.
The rebase brings in the Orval client migration from main. Update project previews and session assignments to its method names and argument shapes so corrections continue to reach the same endpoints. Regenerate the added endpoints and align their component tests with the new client contract.
Four models kept their old uppercase filenames in Git after the client regeneration. Their lowercase imports worked on macOS but failed on Linux, blocking frontend checks, end-to-end tests, and desktop builds. Record the case-only renames so clean checkouts match the generated imports.
The session insert now carries manual project assignment and the prompt evidence flag from main. Account for both in the parameter-count assertion while preserving the existing checks on argument ordering.
Both branches added Data endpoints. Keep the combined client in generator order so clean checkouts pass the generated-client consistency check.
24d6e24 to
94dfd55
Compare
roborev: Combined Review (
|
Adds an opt-in, project-first Data workspace for correcting project
classification. The existing project mapping rules view remains the default
when
VITE_PROJECT_MAPPING_WORKSPACEis unset. The prior workflow handled onefolder at a time and showed too little session evidence, which made ambiguous
or renamed projects difficult to correct.
With the workspace enabled, the project inventory remains scrollable beside a
stable correction pane. Shift-click selects project ranges for one bulk
correction. A single-project workspace supports folder and whole-project
corrections, while individual exceptions can be reassigned from either the
transcript carousel or the main Sessions list with a searchable project picker.
Manual overrides are labeled and can return to automatic classification.
Folder suggestions and session previews resolve the exact opaque project key,
so safe display labels cannot mix unrelated projects. Claude sessions launched
from repository-local generated worktrees classify to the owning repository.
Session overrides preserve the prior automatic project, survive resync and
orphan restoration, and take precedence over inferred classification until
cleared. Clearing an override reapplies the current folder rule. Existing
prototype assignments upgrade in place.
Writes remain owned by the Source Agents View; read-only mirrors keep their
inspection-only boundary. The main review surfaces are the project workspace
components, candidate selection in
internal/db/worktree_candidates.go, theSessions-list editor, and assignment persistence in
internal/db/session_project_assignments.go.