Commit Graph

4092 Commits

Author SHA1 Message Date
gsxdsm
9a541f09e8 test(dashboard): drop stale invokeTaskCreatedHook expectation from routes-planning
The planning routes no longer pass { invokeTaskCreatedHook: false } as
the second arg to store.createTask — they let the hook fire so
GitHub tracking and other post-creation listeners run. The
toHaveBeenCalledWith assertions still expected the legacy second arg
and failed across 12 test cases.

Strip the second argument from each toHaveBeenCalledWith spec. Fixes 8
failing tests in routes-planning.test.ts.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 18:42:05 -07:00
gsxdsm
dbbb9b1524 test(dashboard): align mission-e2e expectations with new store-arg signatures
createMissionInterviewSession, submitMissionInterviewResponse,
retryMissionInterviewSession, and submitTargetInterviewResponse now
take a TaskStore as an additional argument (after rootDir). The e2e
expectations still asserted on the pre-store positional shape and
failed. Insert expect.anything() in the store slot of each
toHaveBeenCalledWith assertion.

Fixes 10 failing tests in mission-e2e.test.ts (interview start/respond/
retry scoping suite + milestone interview respond regression).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 18:40:59 -07:00
gsxdsm
1c706769f3 test(dashboard): add deterministicGuardLocks to remaining @fusion/core mocks
8 more test files were failing to load because their vi.mock("@fusion/core")
factories didn't include the deterministicGuardLocks export that
register-task-workflow-routes pulls in at module-load time. Add the
empty Map to each mock's return object. Unblocks the suite-level
collection for these files (previously the entire file's tests counted
as 0/failed because the module never loaded).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 18:33:36 -07:00
gsxdsm
236bfeeabc fix(dashboard): plumb TaskStore through mission-interview rehydration
Mirror the planning.ts fix: capture store/rootDir on MissionInterviewSession
at creation, fall back to the captured values in
ensureMissionInterviewAgent when callers don't plumb them through. Then
update the session/mission test files so their createSession,
createMissionInterviewSession, and rehydrated submitResponse/retry calls
pass a real TaskStore where they were previously passing undefined.

Fixes 10 failing tests across mission-interview.test.ts,
milestone-slice-interview.test.ts, session-error-recovery.test.ts,
session-persistence-roundtrip.test.ts, session-resume-history.test.ts.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 18:26:18 -07:00
gsxdsm
329b74416d fix(dashboard): plumb TaskStore through submit/retry/rewind planning APIs
createSession captured a TaskStore but submitResponse/retrySession/
rewindSession had no way to receive one — so rehydrated sessions
(loaded from SQLite, no prior createSession call) failed with
"Planning session has no task store and cannot be resumed without
project context" when they needed to rebuild an agent.

- Add optional `store` to Session and capture it on createSession.
- Extend submitResponse, retrySession, rewindSession to accept and
  propagate a store argument; ensureSessionAgent falls back to the
  session-captured value when the caller doesn't plumb one.
- Update planning.test.ts rehydration paths to pass MOCK_TASK_STORE
  where they previously relied on the implicit error to test against.

Fixes 7 failing tests in planning.test.ts (rehydration + retry/rewind
flows). Same pattern applies to mission-interview.ts and the related
session-* test files but is deferred to a separate commit.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 18:21:35 -07:00
gsxdsm
44f662e8ce test(dashboard): pass store to createSession in session-reconnect test
createSession now requires a TaskStore (planning.ts:765); the reconnect
test had a TaskStore in scope but was still passing undefined as the
third arg. Hook it up. Fixes the 1 failing test in this file.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 18:11:58 -07:00
gsxdsm
8e2d0b6d20 test(dashboard): satisfy server.ts contract on sandbox-audit MockStore
routes-sandbox-audit.test.ts mocked @fusion/core without
deterministicGuardLocks (causing the workflow-routes import to throw)
and its MockStore lacked getDatabase, which createServer now calls
when wiring ChatStore. Add both. Fixes 3 failing tests.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 18:09:35 -07:00
gsxdsm
8809bc9ea5 revert(dashboard): keep MissionManager dual mobile/desktop title spans
The previous commit collapsed both header spans into a single isMobile-
conditional render, but that broke 3 desktop-header tests that
intentionally assert on both spans being present (the CSS handles
visibility). The real fix for the "Found multiple elements" failures
was the localStorage.clear() in beforeEach; the structural change was
unnecessary. Restore the original dual-render markup.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 18:04:08 -07:00
gsxdsm
acfc55b804 fix(dashboard): stop MissionManager rendering mobile+desktop title together
The header rendered both a "Missions" desktop span AND a mobile span
containing the selected mission title simultaneously, relying on CSS to
hide the inactive variant. jsdom doesn't apply media queries, so
testing-library's getByText found the mission title in both the body
cards and the otherwise-hidden mobile header — failing 49 tests with
"Found multiple elements with the text: <title>". Render only the
active variant based on isMobile.

Also clear localStorage in beforeEach so the SWR mission cache from
prior tests doesn't pre-hydrate into the next render and surface its
own fixtures as duplicates.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 18:03:12 -07:00
gsxdsm
f55b051163 test(dashboard): clear localStorage in MailboxModal beforeEach
The skeleton-loading test failed because earlier tests in the file
populated the SWR cache, so MailboxModal hydrated inbox from
localStorage and skipped the loading skeleton. Reset localStorage in
beforeEach so each test starts with a clean cache.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 17:57:10 -07:00
gsxdsm
24c15bc660 test(dashboard): extract .data from SWR cache envelope in cache tests
MissionManager.cache and MailboxModal.cache tests parsed the raw
localStorage entry as the payload, but writeCache wraps values in
{ savedAt, data }. Pull .data out before asserting on length or
nested fields. Fixes 3 failing tests.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 17:54:43 -07:00
gsxdsm
e47c5e4507 test(dashboard): extract .data from SWR cache envelope in hook tests
swrCache.writeCache wraps values in a { savedAt, data } envelope, but
useChatRooms/useEvals/useInsights/useResearch tests still parsed
localStorage entries as bare arrays. Pull the .data field out before
indexing so the cache assertions hit the actual payload. Fixes 6
failing tests across the four hook test files.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 17:53:59 -07:00
gsxdsm
38adeba79f test(dashboard): stub getSelfHealingManager on remote-access engine mock
server.ts createServer now invokes engine.getSelfHealingManager() to
wire the self-healing branch-rebind hook. The headless engine fake in
remote-access-headless.test.ts hadn't been updated. Add a vi.fn() stub
so the mock satisfies the engine surface contract.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 17:51:40 -07:00
gsxdsm
061d28a8a6 test(dashboard): fix insight-run-sweeper Database constructor usage
createDatabase(":memory:") fails the absolute-path guard added to the
Database constructor. Use a real tmp dir with inMemory: true, and call
db.init() to materialize project_insight_runs before InsightStore is
constructed. Fixes 5 failing tests.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 17:51:07 -07:00
gsxdsm
d9f105baf2 fix(dashboard): defend MissionManager.loadMissions against non-array fetch results
When fetchMissions returns a non-array (envelope shape, error path, or
mocked detail object) setMissions(data) leaks the bad shape into render,
where missions.filter() throws "is not a function" and crashes the
entire MissionManager test file. Coerce to [] before storing, matching
the existing defenses on the useState init and cache-hydration paths.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 17:48:23 -07:00
gsxdsm
2a8e6574de test(dashboard): add fetchProjects to settings test ../../api mocks
SettingsModalNodeRouting and settings-mobile both mock ../../api but
omit fetchProjects, which the SettingsModal now calls during mount.
Add a stub returning an empty list. Drops SettingsModalNodeRouting
failures from 14 → 0 and settings-mobile from 9 → 1 (residual failure
is unrelated and tracked separately).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 17:45:36 -07:00
gsxdsm
cfd20d319a test(dashboard): add deterministicGuardLocks to @fusion/core mocks
proxy-routes and routes-agent-skills tests mock @fusion/core but omit
the deterministicGuardLocks Map that register-task-workflow-routes
imports at module-load time. Add the export so the mock satisfies the
shape consumers expect. Fixes 24 failing tests across the two files.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 17:44:53 -07:00
Fusion (runfusion.ai)
d475c355e5 test(FN-5189): clean lint warning during verification
Fusion-Task-Id: FN-5189
Fusion-Task-Lineage: 4caa3f0a-af81-4c60-88e8-de229ed72e08
2026-05-19 17:19:03 -07:00
Fusion (runfusion.ai)
818db4a714 feat(FN-5189): complete Step 3 — migrate supervised spawns
Fusion-Task-Id: FN-5189
Fusion-Task-Lineage: 4caa3f0a-af81-4c60-88e8-de229ed72e08
2026-05-19 17:19:02 -07:00
Fusion (runfusion.ai)
87c266d497 test(FN-5160): complete Step 3 — add mobile layout contracts
Fusion-Task-Id: FN-5160
Fusion-Task-Lineage: 4817bb14-178e-4914-aa60-d0184fba653b
2026-05-19 15:53:11 -07:00
Fusion (runfusion.ai)
16c87c0722 feat(FN-5160): complete Step 2 — add modal body hooks
Fusion-Task-Id: FN-5160
Fusion-Task-Lineage: 4817bb14-178e-4914-aa60-d0184fba653b
2026-05-19 15:53:11 -07:00
Fusion (runfusion.ai)
0f29c0d1bb feat(FN-5160): complete Step 1 — polish SecretsView CSS
Fusion-Task-Id: FN-5160
Fusion-Task-Lineage: 4817bb14-178e-4914-aa60-d0184fba653b
2026-05-19 15:53:10 -07:00
Fusion (runfusion.ai)
587e9b416c feat(FN-5155): stabilize mobile keyboard viewport metrics
Stabilizes mobile keyboard viewport metrics in the `useMobileKeyboard` hook, with tests covering the hook and `ChatView` integration; a minor dashboard command adjustment is included.

Fusion-Task-Id: FN-5155
2026-05-19 13:38:31 -07:00
Fusion (runfusion.ai)
356411ef06 test(FN-5150): complete Step 2 — cover review-tab create PR path
Fusion-Task-Id: FN-5150
Fusion-Task-Lineage: 09bf24f1-5d23-4049-bd5e-7afbea0a59ae
2026-05-19 12:13:46 -07:00
Fusion (runfusion.ai)
7be22cc07e fix(FN-5150): complete Step 1 — mount PrCreateModal tab-agnostically
Fusion-Task-Id: FN-5150
Fusion-Task-Lineage: 09bf24f1-5d23-4049-bd5e-7afbea0a59ae
2026-05-19 12:13:46 -07:00
Fusion (runfusion.ai)
6431c972e8 test(FN-5152): complete Step 4 — add near-duplicate route regressions
Fusion-Task-Id: FN-5152
Fusion-Task-Lineage: 954570d8-82e1-4519-a739-c52ee790d2db
2026-05-19 11:30:54 -07:00
Fusion (runfusion.ai)
97035f2d87 feat(FN-5152): complete Step 3 — add dashboard near-duplicate gate
Fusion-Task-Id: FN-5152
Fusion-Task-Lineage: 954570d8-82e1-4519-a739-c52ee790d2db
2026-05-19 11:30:54 -07:00
Fusion (runfusion.ai)
d8309d2920 feat(FN-5152): complete Step 2 — add near-duplicate activity event type
Fusion-Task-Id: FN-5152
Fusion-Task-Lineage: 954570d8-82e1-4519-a739-c52ee790d2db
2026-05-19 11:30:54 -07:00
gsxdsm
71a2ea1954 feat(FN-5162): merge fusion/fn-5162 2026-05-19 11:14:49 -07:00
Fusion (runfusion.ai)
e0b82fda6b test(FN-5151): complete Step 5 — add autosize regression coverage
Fusion-Task-Id: FN-5151
Fusion-Task-Lineage: 17ebfc3f-6b6d-44a6-8243-7e8b8b140057
2026-05-19 10:39:56 -07:00
Fusion (runfusion.ai)
a34914ede6 feat(FN-5151): complete Step 4 — raise composer CSS caps
Fusion-Task-Id: FN-5151
Fusion-Task-Lineage: 17ebfc3f-6b6d-44a6-8243-7e8b8b140057
2026-05-19 10:39:56 -07:00
Fusion (runfusion.ai)
2ee6b6c145 feat(FN-5151): complete Step 3 — align AgentOnboardingModal caps
Fusion-Task-Id: FN-5151
Fusion-Task-Lineage: 17ebfc3f-6b6d-44a6-8243-7e8b8b140057
2026-05-19 10:39:56 -07:00
Fusion (runfusion.ai)
0b7195699b feat(FN-5151): complete Step 2 — align PlanningModeModal caps
Fusion-Task-Id: FN-5151
Fusion-Task-Lineage: 17ebfc3f-6b6d-44a6-8243-7e8b8b140057
2026-05-19 10:39:56 -07:00
Fusion (runfusion.ai)
07ed4ca8e5 feat(FN-5151): complete Step 1 — align MessageComposer cap
Fusion-Task-Id: FN-5151
Fusion-Task-Lineage: 17ebfc3f-6b6d-44a6-8243-7e8b8b140057
2026-05-19 10:39:55 -07:00
gsxdsm
abfbbcda1e feat(FN-5140): merge fusion/fn-5140 2026-05-19 10:29:42 -07:00
Fusion (runfusion.ai)
ba1604835b feat(FN-5144): add create PR metadata and preflight routes
- Add dashboard routes to generate PR title/body metadata for task branches
- Add PR preflight diagnostics for base branch resolution, remote branch checks, commit summaries, changed files, conflicts, and gh auth state
- Cover the new Create PR route contracts and metadata preflight behavior with dashboard tests
- Add a changeset for the published @runfusion/fusion package

Fusion-Task-Id: FN-5144
2026-05-19 10:25:37 -07:00
Fusion (runfusion.ai)
247437ef30 fix(FN-5154): satisfy strict null checks in attribution helper
Fusion-Task-Id: FN-5154
Fusion-Task-Lineage: 1ca8d162-343b-4d55-bcba-c34efa331ac4
2026-05-19 09:25:01 -07:00
Fusion (runfusion.ai)
d33cfaa7eb test(FN-5154): align legacy rebase-range expectation with attribution fallback
Fusion-Task-Id: FN-5154
2026-05-19 09:24:51 -07:00
Fusion (runfusion.ai)
817cbfb260 test(FN-5154): complete Step 4 — cover TaskCard restricted clamp
Fusion-Task-Id: FN-5154
Fusion-Task-Lineage: 1ca8d162-343b-4d55-bcba-c34efa331ac4
2026-05-19 09:24:51 -07:00
Fusion (runfusion.ai)
f1b9cb9af6 test(FN-5154): complete Step 3 — cover attribution-restricted done diffs
Fusion-Task-Id: FN-5154
Fusion-Task-Lineage: 1ca8d162-343b-4d55-bcba-c34efa331ac4
2026-05-19 09:24:51 -07:00
Fusion (runfusion.ai)
78e9227b82 fix(FN-5154): complete Step 2 — clamp done card diff count
Fusion-Task-Id: FN-5154
Fusion-Task-Lineage: 1ca8d162-343b-4d55-bcba-c34efa331ac4
2026-05-19 09:24:50 -07:00
Fusion (runfusion.ai)
fc21c69cbc test(FN-5154): align rebase-range fixtures with attribution semantics
Fusion-Task-Id: FN-5154
Fusion-Task-Lineage: 1ca8d162-343b-4d55-bcba-c34efa331ac4
2026-05-19 09:24:50 -07:00
Fusion (runfusion.ai)
d849539198 feat(FN-5154): complete Step 1 — restrict done rebase diff ranges
Fusion-Task-Id: FN-5154
Fusion-Task-Lineage: 1ca8d162-343b-4d55-bcba-c34efa331ac4
2026-05-19 09:24:49 -07:00
Fusion (runfusion.ai)
4e3a4731aa feat(FN-5154): complete Step 0 — add done-range attribution helper
Fusion-Task-Id: FN-5154
Fusion-Task-Lineage: 1ca8d162-343b-4d55-bcba-c34efa331ac4
2026-05-19 09:24:49 -07:00
Fusion (runfusion.ai)
20ce7829c7 feat(FN-5141): complete Step 4 — document soft-delete API semantics
Fusion-Task-Id: FN-5141
Fusion-Task-Lineage: 2f90daca-c147-4807-b780-09f8f54580ae
2026-05-19 08:38:25 -07:00
Fusion (runfusion.ai)
5996787cb1 test(FN-5148): extend stale guard coverage to all tracking handlers
Fusion-Task-Id: FN-5148
Fusion-Task-Lineage: af70f85f-ec90-4040-bbf3-9e1bce3a49b9
2026-05-19 08:20:23 -07:00
Fusion (runfusion.ai)
ab5158e680 test(FN-5148): complete Step 4 — add stale github tracking modal coverage
Fusion-Task-Id: FN-5148
Fusion-Task-Lineage: af70f85f-ec90-4040-bbf3-9e1bce3a49b9
2026-05-19 08:20:23 -07:00
Fusion (runfusion.ai)
e474e51d70 test(FN-5148): complete Step 3 — cover detail task id guard
Fusion-Task-Id: FN-5148
Fusion-Task-Lineage: af70f85f-ec90-4040-bbf3-9e1bce3a49b9
2026-05-19 08:20:23 -07:00
Fusion (runfusion.ai)
c4b378880c feat(FN-5148): complete Step 2 — guard stale github tracking updates
Fusion-Task-Id: FN-5148
Fusion-Task-Lineage: af70f85f-ec90-4040-bbf3-9e1bce3a49b9
2026-05-19 08:20:23 -07:00
Fusion (runfusion.ai)
7d94cc367b feat(FN-5148): complete Step 1 — guard updateDetailTask id drift
Fusion-Task-Id: FN-5148
Fusion-Task-Lineage: af70f85f-ec90-4040-bbf3-9e1bce3a49b9
2026-05-19 08:20:23 -07:00