Skip to content

feat(data): add a project-first mapping workspace - #1514

Open
mariusvniekerk wants to merge 52 commits into
mainfrom
t3code/redesign-data-mappings
Open

feat(data): add a project-first mapping workspace#1514
mariusvniekerk wants to merge 52 commits into
mainfrom
t3code/redesign-data-mappings

Conversation

@mariusvniekerk

@mariusvniekerk mariusvniekerk commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

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_WORKSPACE is unset. The prior workflow handled one
folder 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, the
Sessions-list editor, and assignment persistence in
internal/db/session_project_assignments.go.

@roborev-ci

roborev-ci Bot commented Aug 25, 2026

Copy link
Copy Markdown

roborev: Combined Review (c8afe8c)

The PR has three medium-severity correctness issues involving target consistency, project-scoped session filtering, and explicit-assignment precedence across storage backends.

Medium

  • frontend/src/lib/components/data/ProjectBatchReclassificationEditor.svelte:213 — Sequential saves rebuild requests from the live targetProject. Because the typeahead remains editable during saving, later corrections can target a different project while refresh and success feedback still reference the original. Capture the normalized target and all request drafts before the first await, and disable or ignore edits while applying.

  • frontend/src/lib/components/data/ProjectSessionPreviewPane.svelte:58 — Sessions are filtered by the inventory row’s sanitized display label instead of its opaque project key. Absolute-path and URL-like projects can produce an empty label and therefore an unfiltered query; includeChildren may also include unrelated descendants. Add an exact project-key-scoped endpoint using the same key/label validation as folder candidates, returning only sessions represented by the selected inventory row.

  • internal/db/session_project_assignments.go:67 — Explicitly assigned sessions are excluded from mapping application but still contribute to folder-candidate and governed-session evaluation. This can turn an assigned temporary directory into reusable mapping evidence and produce incorrect inventory/rule counts. PostgreSQL and DuckDB also lack assignment provenance, preventing consistent precedence across backends. Exclude explicit assignments from candidate and governance inputs, and synchronize assignment provenance across all storage backends.


Reviewers: 2 done | Synthesis: codex, 11s | Total: 12m37s

@roborev-ci

roborev-ci Bot commented Aug 25, 2026

Copy link
Copy Markdown

roborev: Combined Review (7cd4ab5)

Changes requested: three medium-severity issues could cause read-only query failures, stale batch confirmations, and inaccessible UI controls.

Medium

  • internal/db/db.go:1569session_project_assignments is missing from readOnlyRequiredTables. Pre-change archives can pass OpenReadOnly, but subsequent session queries fail with no such table. Require this table in read-only schema compatibility checks and test opening an archive without it.

  • frontend/src/lib/components/data/ProjectBatchReclassificationEditor.svelte:213 — Batch save fetches a new preview and immediately applies its token for each correction, silently accepting impact changes since the user reviewed the original preview. Earlier writes in the batch can also alter later impacts. Apply the originally reviewed tokens and stop on conflicts, or add an atomic batch endpoint that validates all reviewed impacts together.

  • frontend/src/lib/components/data/DataPage.svelte:254 — Both the page and its host use overflow: hidden, while the rules view lacks an outer scrolling container. Forms and actions may become inaccessible on shorter viewports, including in the default feature-disabled build. Restore vertical scrolling for rules mode or wrap it in a min-height: 0; overflow-y: auto container.


Reviewers: 2 done | Synthesis: codex, 10s | Total: 14m7s

@roborev-ci

roborev-ci Bot commented Aug 25, 2026

Copy link
Copy Markdown

roborev: Combined Review (875c941)

The PR has three medium-severity issues involving read-only schema compatibility and non-atomic bulk reclassification behavior.

Medium

  • internal/db/sessions.go:73 — Session reads unconditionally query session_project_assignments, but the table is missing from readOnlyRequiredTables. Older archives can pass OpenReadOnly checks and then fail session reads with “no such table”.

    • Fix: Add session_project_assignments to the read-only schema requirements and test opening a pre-migration archive.
  • frontend/src/lib/components/data/ProjectBatchReclassificationEditor.svelte:213 — Bulk apply discards reviewed previews, obtains fresh tokens before each sequential request, and silently accepts changed impact. A later failure can leave an unintended partial rule set.

    • Fix: Add a transactional bulk endpoint that validates all reviewed preview state and commits every correction atomically.
  • frontend/src/lib/components/data/ProjectBatchReclassificationEditor.svelte:225 — If inventory refresh fails after mappings are committed, applied permanently disables saving and the UI offers no refresh-retry action, despite instructing the user to retry the refresh.

    • Fix: Add a retry-refresh path equivalent to the single-correction editor and invoke onComplete after a successful retry.

Reviewers: 2 done | Synthesis: codex, 10s | Total: 12m53s

@roborev-ci

This comment has been minimized.

@mariusvniekerk mariusvniekerk self-assigned this Aug 25, 2026
@mariusvniekerk
mariusvniekerk marked this pull request as ready for review August 25, 2026 21:47
@roborev-ci

roborev-ci Bot commented Aug 25, 2026

Copy link
Copy Markdown

roborev: Combined Review (9f77e41)

Verdict: Three medium-severity issues require attention; no concrete security vulnerabilities were identified.

Medium

  • frontend/src/lib/components/data/ProjectSessionPreviewPane.svelte:59-66, called from ProjectWorkspace.svelte:111-115
    Inventory rows aggregate multiple raw labels under one project key, but the session preview queries only the representative projectLabel. Sessions belonging to other labels in the same row may be omitted, causing inaccurate counts and incomplete session-level corrections. Query all labels sharing the project key or add a key-aware preview endpoint.

  • frontend/src/lib/components/data/ProjectBatchReclassificationEditor.svelte:73-81,315-355
    Bulk correction ignores existing_mapping_id and distinct_projects, allowing risky mapping replacements or broad changes without the required impact-review step. The “projects affected” count also uses rows.length instead of the actual aggregated impact. Aggregate preview risk and impact data, require explicit review for risky batches, and display the accurate count.


Reviewers: 2 done | Synthesis: codex, 8s | Total: 12m56s

@roborev-ci

roborev-ci Bot commented Aug 25, 2026

Copy link
Copy Markdown

roborev: Combined Review (d224bce)

Verdict: Six medium-severity issues require attention; no security vulnerabilities were identified.

Medium

  • Orphaned session assignments: internal/db/schema.sql:776-809
    Hard-deleting sessions can leave orphaned assignments that may be restored unexpectedly if the session ID is re-imported. Add delete cleanup and remove existing orphans during migration.

  • Mutable batch target: frontend/src/lib/components/data/ProjectBatchReclassificationEditor.svelte:127-135,206-224
    Editing targetProject during sequential saves can send candidates to different projects than the captured refresh target. Snapshot request data before awaiting and disable editing while applying.

  • Missing batch impact review: frontend/src/lib/components/data/ProjectBatchReclassificationEditor.svelte:73-81,206-224
    Batch reclassification bypasses the impact confirmation required by the single-item editor. Require explicit confirmation based on all previews.

  • Incomplete single-item review gate: frontend/src/lib/components/data/ProjectReclassificationEditor.svelte:78-80
    The review gate does not detect corrections spanning multiple folder paths. Include distinct affected paths in the preview and require review when multiple paths are involved.

  • Partial batch application: frontend/src/lib/components/data/ProjectBatchReclassificationEditor.svelte:213-224
    Candidates are committed individually, so later failures can leave the batch partially applied. Use a transactional backend batch operation or clearly support partial completion and recovery.

  • No refresh retry: frontend/src/lib/components/data/ProjectBatchReclassificationEditor.svelte:225-230
    If onRefresh returns false, the batch is marked applied without a retry path, leaving potentially stale UI state. Preserve the saved target and expose a refresh-only retry action.


Reviewers: 2 done | Synthesis: codex, 15s | Total: 15m37s

@mariusvniekerk
mariusvniekerk force-pushed the t3code/redesign-data-mappings branch from d224bce to 8726012 Compare August 27, 2026 12:38
@roborev-ci

roborev-ci Bot commented Aug 27, 2026

Copy link
Copy Markdown

roborev: Combined Review (8726012)

Verdict: Two medium-severity issues require attention; no security vulnerabilities were identified.

Medium

  • frontend/src/lib/components/data/ProjectSessionPreviewPane.svelte:59-66 — The preview filters by the display label, which may be empty for absolute-path or URL-like project identities. This omits the backend project predicate and can display arbitrary recent sessions. Pass and query by the project key instead.

  • internal/db/worktree_candidates.go:143-150 — Candidate discovery includes sessions with manual project assignments, allowing their worktree evidence to become reusable folder mappings. Exclude assigned sessions across SQLite, PostgreSQL, and DuckDB candidate queries, while preserving intentionally permitted sibling evidence.


Reviewers: 2 done | Synthesis: codex, 6s | Total: 12m6s

@mariusvniekerk
mariusvniekerk force-pushed the t3code/redesign-data-mappings branch from 8726012 to a107cf8 Compare August 27, 2026 15:33
@roborev-ci

roborev-ci Bot commented Aug 27, 2026

Copy link
Copy Markdown

roborev: Combined Review (a107cf8)

Verdict: High-risk project identity filtering issue, plus three medium-severity compatibility and workflow issues; no security boundary violations found.

High

  • frontend/src/lib/components/data/ProjectSessionPreviewPane.svelte:59-65 — Sessions are filtered by the display projectLabel instead of the opaque project_key. Empty or duplicate labels may expose unrelated sessions and allow incorrect project assignments. Pass and filter by the exact project key throughout the preview and assignment flow.

Medium

  • internal/db/sessions.go:72-75OpenReadOnly does not verify that older archives contain the newly required session_project_assignments table, allowing them to open and later fail with “no such table.” Add the table to compatibility checks or reject incompatible archive versions explicitly.

  • frontend/src/lib/components/data/ProjectReclassificationEditor.svelte:71-76, 434-436 — Saving is disabled when the preview has zero matched sessions, preventing valid future mappings from being created or changed. Allow zero-match saves when effective policy changes, while continuing to block true no-ops.

  • frontend/src/lib/components/data/ProjectReclassificationEditor.svelte:77-80 — The review gate does not account for mappings spanning multiple folder paths, and the preview omits the documented affected-path and preceding-30-day impact details. Calculate and display these impacts, and require review for multi-path changes.

Review 2 found no newly reachable security boundary violations.


Reviewers: 2 done | Synthesis: codex, 8s | Total: 13m42s

@roborev-ci

roborev-ci Bot commented Aug 27, 2026

Copy link
Copy Markdown

roborev: Combined Review (2013211)

Verdict: Four medium-severity issues require attention; no security vulnerabilities were identified.

Medium

  • frontend/src/lib/components/data/ProjectSessionPreviewPane.svelte:60 — The preview filters by one representative project label, omitting sessions using other aliases grouped under the same project key. Pass the complete project identity or alias set and align backend grouping semantics.

  • frontend/src/lib/components/data/ProjectBatchReclassificationEditor.svelte:206-239, 333-355 — If the batch mutation succeeds but inventory refresh fails, Save is disabled without a refresh-only retry action. Add a retry that does not reapply committed mappings.

  • frontend/src/lib/components/data/ProjectBatchReclassificationEditor.svelte:318-323 — “Projects affected” uses rows.length rather than the number of distinct affected projects. Compute and display the authoritative distinct-project count.

  • frontend/src/lib/components/data/ProjectBatchReclassificationEditor.svelte:73-80, 346-356 — Batch corrections can apply without the explicit impact review and confirmation required for risky mapping changes. Derive batch-wide impact from previews and require confirmation when appropriate.


Reviewers: 2 done | Synthesis: codex, 9s | Total: 17m31s

@mariusvniekerk
mariusvniekerk force-pushed the t3code/redesign-data-mappings branch from 2013211 to e2994b1 Compare August 27, 2026 18:33
@roborev-ci

roborev-ci Bot commented Aug 27, 2026

Copy link
Copy Markdown

roborev: Combined Review (e2994b1)

Verdict: Five medium-severity issues remain, primarily involving archive compatibility and insufficient correction review/recovery safeguards.

Medium

  • internal/db/sessions.go:72-75, internal/db/db.go:1569-1609 — Read-only archives created before session_project_assignments may fail with “no such table” errors when session queries reference the table. Add it to the required-table compatibility check or support legacy archives.

  • frontend/src/lib/components/data/ProjectReclassificationEditor.svelte:78-80,405-430 — Changes affecting multiple folder paths within one project can bypass review, and the UI omits changed-folder and preceding-30-day impact details. Include distinct paths and time-window counts in the preview and require review for multi-path changes.

  • frontend/src/lib/components/data/ProjectBatchReclassificationEditor.svelte:73-81,206-230 — Bulk corrections apply candidates immediately without the required review/confirmation gate. Add combined impact review and explicit confirmation before execution.

  • frontend/src/lib/components/data/ProjectReclassificationEditor.svelte:71-77 — Valid future-only rules matching zero sessions cannot be saved because canApply requires matched_sessions > 0. Permit zero-match saves when effective policy changes while disabling unchanged submissions.

  • frontend/src/lib/components/data/DataPage.svelte:124-132 — Successful corrections provide no immediate Undo action or durable correction history. Persist correction versions/deltas and expose a stale-protected Undo action.


Reviewers: 2 done | Synthesis: codex, 8s | Total: 15m49s

@mariusvniekerk
mariusvniekerk force-pushed the t3code/redesign-data-mappings branch from e2994b1 to dd90920 Compare August 28, 2026 16:56
@roborev-ci

roborev-ci Bot commented Aug 28, 2026

Copy link
Copy Markdown

roborev: Combined Review (dd90920)

Verdict: Medium-severity issues remain in feature gating, review coverage, preview filtering, and bulk-save consistency.

Medium

  • frontend/src/lib/feature-flags.ts:5-7, frontend/src/lib/components/data/DataPage.svelte:163-177 — The feature flag defaults to disabled, and standard/release builds do not set it, forcing the Data page into rules-only mode and hiding existing project inventory. Preserve legacy inventory when disabled or set the flag in every production build path.

  • frontend/src/lib/components/data/ProjectReclassificationEditor.svelte:78-80 — Impact review counts distinct current projects but ignores distinct changed folder paths, so broad prefixes can modify multiple folders without review. Include distinct changed paths in the preview and require review when the count exceeds one.

  • frontend/src/lib/components/data/ProjectReclassificationEditor.svelte:71-76 — Corrections with zero current matches cannot be saved, preventing valid future-only rules. Allow saving when the rule changes effective policy and explain its future-only effect.

  • frontend/src/lib/components/data/ProjectSessionPreviewPane.svelte:59-66 — Session previews filter by display/project label instead of opaque project_key, potentially omitting sessions from the selected row or showing sessions from another row with the same label. Use a project-key-aware filter or endpoint.

  • frontend/src/lib/components/data/ProjectBatchReclassificationEditor.svelte:213-230 — Bulk corrections are applied in separate requests and transactions, so a later failure leaves earlier mappings committed despite one bulk-save action. Use a combined transactional endpoint or track and retry unapplied entries.

  • frontend/src/lib/components/data/ProjectBatchReclassificationEditor.svelte:213-216, :300-312 — The asynchronous save loop reads mutable targetProject, allowing edits during saving to produce inconsistent mappings. Capture targets before saving or disable editing while the operation runs.


Reviewers: 2 done | Synthesis: codex, 10s | Total: 15m13s

@mariusvniekerk
mariusvniekerk force-pushed the t3code/redesign-data-mappings branch from dd90920 to 4a488fa Compare August 29, 2026 18:43
@roborev-ci

roborev-ci Bot commented Aug 29, 2026

Copy link
Copy Markdown

roborev: Combined Review (4a488fa)

Verdict: Four medium-severity issues remain; no security vulnerabilities were identified.

Medium

  • frontend/src/lib/components/data/ProjectSessionPreviewPane.svelte:59-66 — Sessions are filtered by display label instead of opaque project_key, which can show incorrect or no sessions. Pass/query project_key or resolve underlying project identities.

  • internal/db/schema.sql:782-787 — Hard-deleting sessions leaves orphaned session_project_assignments, which may accumulate or be reapplied on session ID reuse. Delete assignments in purge paths or add reliable cascading.

  • frontend/src/lib/components/data/ProjectBatchReclassificationEditor.svelte:73-81 — Batch corrections can bypass required impact-review confirmation. Add aggregate impact review and explicit confirmation before saving.

  • frontend/src/lib/components/data/ProjectBatchReclassificationEditor.svelte:225-234 — A failed post-mutation refresh leaves saving disabled with only a warning. Add a refresh-only retry action while preserving the applied state.


Reviewers: 2 done | Synthesis: codex, 8s | Total: 12m41s

@mariusvniekerk
mariusvniekerk force-pushed the t3code/redesign-data-mappings branch from 4a488fa to dd0467f Compare August 30, 2026 18:00
@roborev-ci

roborev-ci Bot commented Aug 30, 2026

Copy link
Copy Markdown

roborev: Combined Review (dd0467f)

Verdict: Changes require fixes for one high-severity and two medium-severity issues.

High

  • frontend/src/lib/components/data/ProjectWorkspace.svelte:110-115; frontend/src/lib/components/data/ProjectSessionPreviewPane.svelte:53-66
    Session preview filters by the inventory presentation label instead of project identity. Absolute-path and URL projects have empty labels, causing no project filter and exposing unrelated recent sessions for assignment. Use an opaque project key or exact raw project identity.

Medium

  • internal/db/db.go:1591-1631; internal/db/sessions.go:72-75
    Read-only opens skip migrations and do not verify session_project_assignments, so older archives open successfully but later fail with “no such table.” Add the table to compatibility checks or provide a legacy-query fallback.

  • internal/db/worktree_candidates.go:138-166,242-258 and equivalent DuckDB/PostgreSQL implementations
    Assigned sessions are included as worktree candidate evidence, with assignment state discarded during loading. Session-only project overrides can therefore be reused as folder-mapping evidence, violating assignment precedence. Exclude assigned sessions from candidate contributors while preserving required sibling evidence.


Reviewers: 2 done | Synthesis: codex, 8s | Total: 18m30s

@mariusvniekerk
mariusvniekerk marked this pull request as draft September 2, 2026 14:47
@roborev-ci

roborev-ci Bot commented Sep 2, 2026

Copy link
Copy Markdown

roborev: Combined Review (dc99098)

Verdict: One medium-severity issue requires attention; no high or critical findings were identified.

Medium

  • internal/db/sessions.go:648-668, 797-818; frontend/src/lib/stores/sessions.svelte.ts:1630-1654 — Sidebar index rows omit project_assigned, causing manually assigned sessions to appear automatic after reload and hiding the “Use automatic” action. Include the field in both sidebar queries/scans and propagate it through the TypeScript row conversion.

Reviewers: 2 done | Synthesis: codex, 6s | Total: 13m19s

@mariusvniekerk
mariusvniekerk force-pushed the t3code/redesign-data-mappings branch from dc99098 to 0e93138 Compare September 2, 2026 16:24
@roborev-ci

roborev-ci Bot commented Sep 2, 2026

Copy link
Copy Markdown

roborev: Combined Review (0e93138)

Verdict: One medium-severity issue found; otherwise no qualifying findings.

Medium

  • frontend/src/lib/components/data/ProjectBatchReclassificationEditor.svelte:73-80 — Bulk save ignores existing_mapping_id and distinct_projects, allowing existing rules or broad multi-project changes to be applied without required impact review. Add batch review state and require explicit confirmation before applying previews that need review.

Reviewers: 2 done | Synthesis: codex, 6s | Total: 22m49s

@roborev-ci

roborev-ci Bot commented Sep 2, 2026

Copy link
Copy Markdown

roborev: Combined Review (abdbee2)

Verdict: Changes are generally sound, but three medium-severity issues should be addressed before merging.

Medium

  • internal/parser/project.go:356-360, internal/db/db.go:453-456 — Increment dataVersion and add a resync/backfill migration; otherwise existing version-96 sessions retain stale project classification.

  • frontend/src/lib/components/sidebar/SessionItem.svelte:595-630 — Add project_assigned to sidebar index query contracts and propagate it through sidebarIndexRowToSession; index-only sessions currently appear automatic and cannot expose “Use automatic.”

  • frontend/src/lib/components/data/ProjectBatchReclassificationEditor.svelte:333-355 — Add a retry-refresh action for cases where the batch mutation succeeds but inventory refresh fails.


Reviewers: 2 done | Synthesis: codex, 7s | Total: 18m19s

@roborev-ci

roborev-ci Bot commented Sep 2, 2026

Copy link
Copy Markdown

roborev: Combined Review (7df5129)

Verdict: Three medium-severity issues require attention.

Medium

  • internal/db/session_project_assignments.go:74-82 — Reassigning a session overwrites original_project with the previous manual assignment, so clearing the override after multiple reassignments may restore the wrong project. Preserve original_project during conflict updates.

  • internal/db/worktree_candidates.go:138-150 — Candidate selection includes manually assigned sessions, allowing one-off corrections to become reusable folder-mapping evidence. Exclude manually assigned sessions from candidate grouping.

  • frontend/src/lib/components/data/ProjectBatchReclassificationEditor.svelte:220-230,333-355 — If the inventory refresh fails after rules are applied, the editor remains in an applied state without a retry action. Add a refresh-only retry action.


Reviewers: 2 done | Synthesis: codex, 10s | Total: 16m56s

@mariusvniekerk
mariusvniekerk force-pushed the t3code/redesign-data-mappings branch from 7df5129 to 0913cef Compare September 3, 2026 16:13
@roborev-ci

roborev-ci Bot commented Sep 3, 2026

Copy link
Copy Markdown

roborev: Combined Review (0913cef)

Verdict: Medium-severity issues remain in archive versioning and batch correction reliability.

Medium

  • internal/db/db.go:453-456 — The new Claude worktree parser behavior reuses dataVersion 96, so existing version-96 archives will not be reparsed. Increment it to 97 and update the corresponding test.

  • frontend/src/lib/components/data/ProjectBatchReclassificationEditor.svelte:206-230 — Batch corrections are committed sequentially, allowing partial application if a later request fails. Add an atomic bulk operation or explicit recovery/reconciliation.

  • frontend/src/lib/components/data/ProjectBatchReclassificationEditor.svelte:206-221draft(entry) reads the live target during awaited iterations, so changing the target mid-apply can send inconsistent corrections while the final refresh uses the original target. Snapshot request data before awaiting or disable target controls during application.

  • frontend/src/lib/components/data/ProjectBatchReclassificationEditor.svelte:225-230,333-356 — If the post-commit inventory refresh fails, the UI provides no retry action and can display stale data. Add a refresh-only retry action.


Reviewers: 2 done | Synthesis: codex, 8s | Total: 22m56s

@mariusvniekerk
mariusvniekerk force-pushed the t3code/redesign-data-mappings branch from 0913cef to d889f4e Compare September 4, 2026 00:48
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.
@mariusvniekerk
mariusvniekerk force-pushed the t3code/redesign-data-mappings branch from 24d6e24 to 94dfd55 Compare September 12, 2026 19:51
@mariusvniekerk
mariusvniekerk marked this pull request as ready for review September 12, 2026 19:54
@roborev-ci

roborev-ci Bot commented Sep 12, 2026

Copy link
Copy Markdown

roborev: Combined Review (94dfd55)

Verdict: Changes require fixes for 4 findings.

High

  • frontend/src/lib/components/data/ProjectBatchReclassificationEditor.svelte:204-219; frontend/src/lib/components/data/ProjectWorkspace.svelte:41-83: Batch corrections remain editable and dismissible while saving, and applyAll() reads targetProject on each loop iteration, allowing different rules to be saved to different targets while refreshing the original target. Disable correction controls and workspace dismissal during mutation and refresh, and snapshot the complete batch request set and target before the first await.

    Reported by: codex

Medium

  • frontend/src/lib/components/data/ProjectReclassificationEditor.svelte:72-78: A valid preview with zero matched sessions cannot be saved, preventing creation of rules intended to classify future sessions. Allow saving when the rule changes even if matched_sessions is zero, and explain the future-session effect.

    Reported by: codex

  • frontend/src/lib/components/data/ProjectReclassificationEditor.svelte:79-81; internal/db/worktree_reclassification.go:42-50: Impact review is gated only by existing_mapping_id or distinct_projects, so a prefix affecting multiple distinct working-directory paths can bypass review; the preview UI and API do not expose affected path counts or 30-day path impact. Compute affected normalized paths for sessions whose effective project changes, expose all-time and 30-day counts, and require inline review when more than one path changes.

    Reported by: codex

  • frontend/src/lib/components/data/ProjectBatchReclassificationEditor.svelte:223-237,331-355: After a batch mutation commits, an inventory refresh failure leaves applied=true with only a warning and no retry-refresh action, preventing required refresh-only recovery. Persist the applied target and render a retry-refresh action whenever post-commit refresh fails, without allowing another save.

    Reported by: codex


Reviewers: 2 done | Synthesis: codex, 13s | Total: 20m47s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant