Add cross-project task catalog / 添加跨项目任务目录 - #8219
Open
SivanCola wants to merge 16 commits into
Open
Conversation
Problem: Desktop startup and project-tree queries could synchronously migrate and decode legacy session JSONL, blocking navigation, creation, and shutdown. Root cause: Session discovery, metadata repair, controller admission, and plugin startup shared UI-critical paths and broad lifecycle locks. Fix: - add a disposable SQLite session catalog with incremental reconciliation, repair checkpoints, corruption recovery, and memory fallback - expose revisioned cursor pagination and migrate the desktop project tree to lazy loading - move controller construction outside lifecycle admission and isolate incompatible plugin startup - add session doctor and reindex commands while preserving authoritative JSONL and metadata - retain CGO-free builds with platform-specific fallbacks Verification: - go test ./... - cd desktop && go test ./... - go test -race ./internal/sessioncatalog ./internal/agent - cd desktop && go test -race . - go vet ./... in root and desktop - cd desktop/frontend && pnpm test:all && pnpm build - CGO_ENABLED=0 cross-builds for supported macOS, Windows, and Linux targets
Reason: The official base advanced by six plan-contract commits after the session catalog implementation began. Resolution: Merge the current official main-v2 without rewriting the reviewed feature commit. Verification: - go test ./... passed at the repository root after the merge - go test ./... passed in desktop after the merge - the feature commit retains focused race, frontend, vet, and cross-build evidence
Problem: The initial session catalog implementation exceeded incremental repository size and complexity budgets in several existing owner files, and Desktop CI reported stale helpers plus two modernization findings. Root cause: Catalog lifecycle, runtime projection, frontend topic presentation, mock bindings, plugin compatibility, and CLI wiring were colocated with already-large modules. Removing the eager project tree also left legacy runtime-tree helpers unused. Fix: - split catalog lifecycle from runtime projection and metadata mapping - extract frontend catalog contracts, mock bridge, topic presentation, and count formatting - isolate plugin compatibility, session projection, and CLI completion wiring - remove obsolete eager-tree helpers and address CI modernization findings - preserve behavior without changing repolint baselines Verification: - go run ./tools/repolint - golangci-lint v2.12.2: 0 issues - go test affected root packages - focused Desktop catalog and workspace regression tests - pnpm test:all - pnpm build
Bring the session catalog prerequisite onto the current upstream base before publishing the History, Usage, and Task follow-up branches. # Conflicts: # desktop/frontend/scripts/check-bundle-budget.mjs
Problem: Each disposable catalog would otherwise duplicate SQLite migration, integrity, quarantine, permission, and in-memory fallback behavior. Root cause: The original session catalog owned database lifecycle policy together with session-specific schema and reconciliation logic. Fix: Extract the reusable lifecycle into internal/projectiondb, migrate the session catalog to it, and add schema-v3 keyset session pagination for follow-up consumers. Verification: Covered by projectiondb lifecycle tests and session catalog migration, pagination, cursor, and compatibility tests.
Problem: Task Monitor could only scan the active project synchronously and could not page or safely route controls across projects. Root cause: Task snapshots and event logs had no disposable query projection, while control APIs implicitly depended on the active tab instead of a stable project identity. Fix: Add an observed authoritative FileStore, resumable snapshot and lazy event indexing, SHA-256 project-key routing, runtime overlays, paged Wails APIs, a cross-project Task Center, diagnostics, and bilingual documentation. Verification: Covered by lock-boundary notifications, corrupt snapshot/event isolation, event-tail pagination, lease reconciliation, stale cursor, project-key action routing, Wails arrays, and 100,000-task warm-page benchmark tests.
Problem: the isolated Task Catalog branch lacked shell completion metadata and only flushed its shared projection during desktop shutdown, allowing late reconcile goroutines to outlive the shutdown boundary. Root cause: the task implementation was originally layered on the integrated History branch, so domain-specific lifecycle and documentation details were lost when it was split into an independently reviewable branch. Fix: register task reindex completions, document the task cache and recovery commands, gate reconcile scheduling during close, wait for scheduled workers, close the shared catalog within the 250ms desktop drain, and account for the measured 1 KiB frontend bundle increase. Verification: focused Desktop tests, frontend production build and bundle budgets, repository lint, core package tests, and race tests for projectiondb, taskcatalog, taskmonitor, and control passed.
# Conflicts: # desktop/frontend/scripts/check-bundle-budget.mjs
# Conflicts: # desktop/frontend/scripts/check-bundle-budget.mjs
Problem: the latest main-v2 transcript-selection work intentionally enlarged existing frontend files after the Task branch had captured its repository lint baseline. Fix: regenerate the carry-forward baseline on the merged Task branch without adding new domain violations. Verification: repolint, focused Desktop tests, frontend production build, and task/control package tests pass.
# Conflicts: # tools/repolint/baseline.json
Problem: after Session Catalog adopted projectiondb, the old filesystem probes and migration entrypoint remained unused, while CI also flagged two modern Go style issues. Root cause: the common projection extraction preserved obsolete package-local helpers to minimize the first refactor diff. Fix: remove the dead remote-filesystem and migration helpers, use integer range in the benchmark, and iterate managed plugin path segments with strings.SplitSeq. Verification: sessioncatalog, pluginpkg, and projectiondb tests pass; golangci-lint reports zero issues.
Problem: the shutdown barrier used an intentionally empty mutex critical section, which staticcheck rejects. Fix: guard a reconcileDone flag with the same mutex used for scheduling so Close prevents late WaitGroup additions without an empty critical section. Verification: taskcatalog tests pass and golangci-lint reports zero issues.
7 tasks
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.
Summary
internal/projectiondblifecycle for disposable SQLite projections and move Session Catalog schema v3 pagination onto it.FileStore, version CAS, idempotency files, leases, symlink checks, and control decisions authoritative; SQLite is never aWriteStore.Task snapshots and event JSONL remain the sole authority. SQLite lives under the cache root and can be removed or rebuilt without affecting task control.
Issues
Depends on #8186 for the shared asynchronous Session Catalog foundation. This PR is the independently reviewable Task domain built on that foundation.
For a focused review after #8186, compare:
SivanCola/DeepSeek-Reasonix@feature/session-catalog...feature/task-catalog
Verification
go test ./...go test ./internal/projectiondb ./internal/sessioncatalog ./internal/taskcatalog ./internal/taskmonitor ./internal/control ./internal/cligo test -race ./internal/projectiondb ./internal/taskcatalog ./internal/taskmonitor ./internal/controlgo test . -run 'Task|Catalog|Control|Shutdown' -count=1indesktop/pnpm buildindesktop/frontend/(hooks lint, WAAPI contract, TypeScript, production build, and bundle budgets)go run ./tools/repolintDocumentation impact
Documentation-impact: updated - added English and Chinese Task Catalog architecture, authority/control boundaries, recovery, CLI, and cache-path documentation.
Cache impact
Cache-impact: none - task projection and UI pagination do not alter provider-visible prompt, tool, memory, or skill bytes.
Cache-guard:
GOCACHE=/tmp/reasonix-go-cache bash scripts/cache-guard.shpassed all agent and boot guards; authoritative FileStore/CAS/idempotency, projection-sink lock-boundary, runtime-overlay, and frontend binding tests also pass.System-prompt-review: SivanCola explicitly reviewed the inherited boot fixture and TaskStore wiring diff and confirmed that it changes task persistence only; system-prompt bytes, tool schemas/order, memory/skill rendering, and provider serialization remain unchanged.
Compatibility and failure behavior
[].