fix(queue): require a selected project before loading work#3743
fix(queue): require a selected project before loading work#3743CompleteDotTech wants to merge 36 commits into
Conversation
|
Pushed Why the queue-project seeding in Fix: the status route now reports the |
a9e3d03 to
9f55321
Compare
|
Pushed |
|
All four required checks are green at |
The new dismissal override (a stored dismissal must not mask a missing
Queue project) force-opened the Onboarding dialog over every surface in
CI: the daemon-less e2e run (COVEN_CAVE_E2E=1) never has a selected
project, so all 15 pre-existing specs — which follow the documented
contract of setting cave:onboarding:dismissed=1 and mocking /api/* —
timed out behind the aria-modal overlay ('subtree intercepts pointer
events', 25m job timeout).
Stub the project step ok in the harness, mirroring the existing
COVEN_CAVE_E2E short-circuits (playwright.config.ts, mobile-access-
provision.ts). Real runs keep the readiness probe; onboarding-wizard
and familiar-work-queue specs mock this route wholesale, so project-
readiness coverage is unchanged.
Verified locally: route + gate unit tests ok; calendar-month-grid (a
previously pointer-blocked legacy spec), all 13 onboarding-wizard and
all 14 familiar-work-queue tests pass.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
With the dismissed short-circuit gone every boot fetches /api/onboarding/status for real; its cold compile + probes race the lazy code-rail chunk on pixel-5 and the sheet renders empty past the 5s expect (the exact E2E failure on this PR's last run). Mock the route like familiar-work-queue.spec.ts already does — specs are self-contained per the harness contract. Verified: code-rail-sheet green across pixel-5/iphone-13/desktop with --repeat-each=2 (was: deterministic pixel-5 fail at this tip). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
d1828a4 to
df939a4
Compare
|
Ready for review, @BunsDev. Rebased onto current main and pushed exact head f564ec0. This resolves the packaged launch-PATH readiness gap, presents Git before the now-required Queue-project step, synchronizes Queue project changes across Cave windows, and adds accessible reload/focus handling. The first exact-head E2E run exposed a test-fixture ordering bug in the new two-window coverage; fixed in f564ec0. Full exact-head CI is green: Frontend, Playwright, Rust, CodeQL, cross-environment (Ubuntu/Windows), and sidecar runtime (Ubuntu/Windows). Local verification included pnpm build, typecheck, Queue readiness/API tests, and Queue Playwright 16/16. |
There was a problem hiding this comment.
Pull request overview
This PR makes Queue loads explicitly depend on a persisted, Queue-specific selected Git project, ensuring Queue never falls back to the app runtime cwd and that cross-window Queue selection stays consistent.
Changes:
- Add Queue project selection persistence + readiness probing (Git/Beads validation) and require it before reading/mutating Queue work.
- Update onboarding/startup gating to require Git + Queue project selection (with e2e-safe stubbing and new UI for picking the Queue project).
- Scope Beads/PR bridge calls (read + mutations) to an explicit
projectRoot, and add Generate to initialize Beads only in the selected repo.
Reviewed changes
Copilot reviewed 42 out of 42 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/onboarding-wizard.spec.ts | Adds onboarding status fixtures and coverage for Git-before-project Queue setup. |
| tests/mobile/code-rail-sheet.spec.ts | Mocks onboarding status probe now that startup always checks onboarding status. |
| tests/familiar-work-queue.spec.ts | Expands Queue e2e coverage for projectRoot scoping, switching, and Generate conflicts. |
| tests/chat-boot-landing.spec.ts | Ensures dismissed onboarding stays closed with seeded Queue project baseline. |
| src/lib/surface-warmup-registry.ts | Removes Queue warmup resource that previously made unscoped Queue reads. |
| src/lib/server/issue-worktree-provision.ts | Spawns git with caveToolSpawnEnv() to honor launch PATH for Queue tooling. |
| src/lib/server/beads-workspace.ts | Adds safe .beads workspace resolver that rejects symlinks / unsafe targets. |
| src/lib/server/beads-workspace.test.ts | Verifies .beads symlink rejection to avoid cross-project mutation. |
| src/lib/server/beads-cli.ts | Switches bd env construction to caveToolSpawnEnv() + required vars. |
| src/lib/server/backup-manifest.ts | Includes queue-project.json in Cave backup set. |
| src/lib/server/backup-manifest.test.ts | Ensures backups include Queue project selection state. |
| src/lib/queue-project-selection.ts | Adds local + BroadcastChannel propagation for Queue project selection changes. |
| src/lib/queue-project-readiness.ts | Implements selection persistence and readiness validation (Git/Beads) + caching. |
| src/lib/queue-project-readiness.test.ts | Exercises Queue readiness contract and key route invariants. |
| src/lib/onboarding-gate.ts | Treats missing Queue project as a structural onboarding requirement. |
| src/lib/onboarding-gate.test.ts | Adds test ensuring Queue project unavailability reopens onboarding. |
| src/lib/coven-bin.ts | Introduces caveToolSpawnEnv() preserving launch PATH precedence for Queue tools. |
| src/lib/coven-bin.test.ts | Verifies Queue tooling PATH precedence and required spawn-site usage. |
| src/components/workspace.tsx | Ensures dismissed onboarding doesn’t mask a required Queue project failure. |
| src/components/onboarding-overlay.tsx | Makes Git required; adds a Queue project picker step and selection publishing. |
| src/components/onboarding-model.ts | Adds project step to onboarding model. |
| src/components/onboarding-guided-steps.test.ts | Guards against out-of-order Queue-project selection UI state updates. |
| src/components/familiar-work-queue-view.tsx | Loads readiness first; scopes reads/mutations by projectRoot; adds Generate and focus/announce handling on project switch. |
| src/components/familiar-work-queue-view.test.ts | Updates assertions to match explicit readiness + projectRoot scoping behavior. |
| src/components/familiar-work-queue-sections.tsx | Scopes bead detail reads to projectRoot. |
| src/components/board-view.tsx | Stops invalidating removed Queue warm resource when board reloads/mutates. |
| src/components/asana-queue-strip.tsx | Scopes filing beads from Asana to the selected Queue projectRoot. |
| src/app/api/queue/readiness/route.ts | Adds loopback-only Queue readiness + selection + Generate (serialized per repo). |
| src/app/api/queue/readiness/route.test.ts | Verifies Generate identity binding, locking, idempotency, and partial-workspace handling. |
| src/app/api/onboarding/status/route.ts | Makes Git + Queue project required; uses cached Queue readiness; e2e harness bypass. |
| src/app/api/onboarding/status/route.test.ts | Updates contract checks for required Git + project step and cached readiness usage. |
| src/app/api/beads/route.ts | Requires projectRoot (no cwd fallback), uses safe workspace resolver, reuses readiness probe for ready mode. |
| src/app/api/beads/route.test.ts | Verifies all Beads reads/mutations and PR bridge stay scoped to selected repo root. |
| src/app/api/beads/prs/route.ts | Requires projectRoot and runs gh with caveToolSpawnEnv(). |
| src/app/api/api-contracts.test.ts | Registers /queue/readiness in API contracts with local-origin guard. |
| src-tauri/src/sidecar_archive_manifest.rs | Bumps sidecar archive max file count for new traced files. |
| scripts/sidecar-runtime-smoke.mjs | Updates runtime file-count budget assertions. |
| scripts/sidecar-runtime-closure.test.mjs | Updates file-count budget checks. |
| scripts/sidecar-runtime-closure.mjs | Updates documented runtime file-count budget rationale. |
| scripts/sidecar-bundle-deps.test.mjs | Updates expected budget references and Rust extractor constant match. |
| scripts/run-tests.mjs | Wires new tests into suites/alias loader lists. |
| playwright.config.ts | Seeds Queue project selection alongside projects for daemon-less e2e baseline. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
His fork branch for #3743 became unreachable, so the work re-lands through this internal branch; record the attribution it is due. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Superseded by #3765: this PR's head branch ( |
Summary
Validation
pnpm typecheckpnpm check:tests-wiredpnpm testreached 762 passing app test files before the unchangedchanges-summary-fetch.test.tsTTL assertion failed (1 !== 2after its 4.1s wait)Closes cave-dsbj