Commit Graph

2214 Commits

Author SHA1 Message Date
gsxdsm
b1d2a9ee43 fix(engine): tighten Layer 3 — pass safety constraint into AI prompt + harden Layer 2 restore
Self-review of the recovery cascade surfaced three issues; this commit
addresses all of them.

1. AI didn't actually receive the safety constraint under Layer 3.

The previous commit logged the safety preamble to the task log via
`store.logEntry`, but the merge agent doesn't read task log entries as
prompt context — so the AI was running blind. The "no silent
re-introduction of main's deletions" guarantee was therefore relying
*entirely* on the deterministic verification gate (test + build),
which is correct as a backstop but doesn't help the AI produce a
correct first attempt.

Fixed by threading `preMergeRebaseFallthrough` through
`MergeAttemptParams` → `executeMergeAttempt` → `runAiAgentForCommit` →
`MergePromptParams` → `buildMergePrompt`, where it now injects an
explicit "⚠️ Pre-merge rebase recovery exhausted" preamble at the top
of the user prompt with three concrete rules:
  - Prefer main's deletion when branch re-adds removed lines
  - Prefer main's version on ambiguous hunks
  - Call `fn_report_build_failure` rather than commit a regression
Also includes the original rebase failure message (truncated) so the
AI has diagnostic context.

The truncated-context retry path also forwards the preamble — it's the
safety constraint, not bulk context, so we keep it even when stripping
diff stat / commit log to fit the window.

2. Layer 2's branch-restore could fail with "uncommitted changes".

When a cherry-pick midway through Layer 2's replay fails, the worktree
is in a half-applied state with conflicts in the index. The previous
restore did `git checkout <branch>` (no -f) followed by
`git reset --hard <originalSha>`. The plain checkout would refuse with
"would overwrite local changes" if there were unmerged paths,
preventing the reset from running and leaving the branch at the
half-replayed tip.

Fixed by reordering: hard-reset to the captured original SHA first
(this clears index/working tree of any cherry-pick state), then
`git checkout -f <branch>` to ensure HEAD points at the named branch,
then a final hard-reset to the original SHA as belt-and-suspenders.
Worst case the worktree is at the original branch tip — never worse
than where Layer 2 started.

3. Pre-existing unrelated lint error blocking workspace lint.

`packages/dashboard/src/server.ts` had an unused `resolve` import from
`node:path` left behind by a recent refactor that extracted
`PACKAGE_VERSION` into its own file. The user explicitly asked to
clean it up so workspace lint passes. One-line drop.

Tests + checks:
- Engine: 2886 / 2886 pass (added safety preamble didn't break any
  existing prompt-content assertions)
- Core: 3120 / 3120 pass
- Workspace lint: clean
- Engine typecheck: clean

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 07:20:20 -07:00
Fusion
ba3d868c2d feat(FN-2944): merge fusion/fn-2944
- test(FN-2944): cover already checked out worktree conflict recovery
- fix(FN-2944): recognize git already checked out worktree conflict
- fix(engine): auto-recover from squash-merge orphan rebase failures

Fusion-Task-Id: FN-2944
2026-04-29 07:10:52 -07:00
Fusion
09cf8ccdb7 feat(FN-2948): merge fusion/fn-2948
- feat(FN-2948): complete Step 5 — apply review feedback and finalize delivery
- test(FN-2948): complete Step 3 — update insights section visibility coverage
- feat(FN-2948): complete Step 2 — enhance insight item readability
- feat(FN-2948): complete Step 1 — hide empty insight sections
- feat(FN-2939): merge fusion/fn-2939
- feat(FN-2946): merge fusion/fn-2946

Fusion-Task-Id: FN-2948
2026-04-29 02:42:57 -07:00
Fusion
af036992e7 feat(FN-2946): merge fusion/fn-2946
- test(FN-2946): complete Step 2 — add maxLength 40 truncation tests
- feat(FN-2946): complete Step 1 — reduce truncation length to 40
- feat(FN-2941): merge fusion/fn-2941
- feat(FN-2938): merge fusion/fn-2938

Fusion-Task-Id: FN-2946
2026-04-29 02:23:09 -07:00
Fusion
85623f45a2 feat(FN-2941): merge fusion/fn-2941
- feat(FN-2941): complete Step 6 — apply review feedback

Fusion-Task-Id: FN-2941
2026-04-29 02:10:51 -07:00
Fusion
854dc7d1e8 feat(FN-2929): merge fusion/fn-2929
- fix(FN-2929): complete Step 6 — add changeset and docs
- test(FN-2929): update loginProvider API test for origin payload
- test(FN-2929): complete Step 4 — cover oauth redirect rewrite and callback proxy
- fix(FN-2929): complete Step 3 — send browser origin in auth login request
- fix(FN-2929): complete Step 1-2 — rewrite OAuth redirect and add callback proxy
- feat(FN-2934): merge fusion/fn-2934

Fusion-Task-Id: FN-2929
2026-04-29 01:32:37 -07:00
Fusion
2bd552b52a feat(FN-2934): merge fusion/fn-2934
- test(FN-2934): complete Step 2 — cover paused triage actions visibility
- feat(FN-2934): complete Step 1 — show actions for paused triage tasks
- feat(FN-2930): merge fusion/fn-2930

Fusion-Task-Id: FN-2934
2026-04-29 01:11:05 -07:00
Fusion
3ca8bf124a feat(FN-2930): merge fusion/fn-2930
- test(FN-2930): complete Step 2 — add auth redirect rewrite coverage
- feat(FN-2930): complete Step 1 — rewrite OAuth redirect_uri host
- feat(FN-2928): merge fusion/fn-2928

Fusion-Task-Id: FN-2930
2026-04-29 00:45:58 -07:00
Fusion
1f807755aa feat(FN-2928): merge fusion/fn-2928
- test(FN-2928): complete Step 2 — assert hidden usage rows use display none
- fix(FN-2928): complete Step 1 — collapse hidden usage window layout
- feat(FN-2927): merge fusion/fn-2927

Fusion-Task-Id: FN-2928
2026-04-29 00:31:46 -07:00
Fusion
f69ef64b48 feat(FN-2927): merge fusion/fn-2927
- test(FN-2927): complete Step 3 — cover keyboardOpen mobile nav behavior
- feat(FN-2927): complete Step 2 — wire keyboard state into mobile nav
- feat(FN-2927): complete Step 1 — add keyboardOpen hide behavior
- feat(FN-2916): streamline Cloudflare quick tunnel settings UX
- feat(FN-2913): merge fusion/fn-2913

Fusion-Task-Id: FN-2927
2026-04-29 00:23:29 -07:00
Fusion
4ba05c52d8 feat(FN-2916): streamline Cloudflare quick tunnel settings UX
- Default Cloudflare remote access to Quick Tunnel mode in settings documentation
- Replace the Quick Tunnel checkbox with an Advanced (Named Tunnel) details disclosure in SettingsModal
- Auto-sync quick tunnel state from the details open/close state while preserving named tunnel field editing
- Update SettingsModal tests to cover the new advanced-toggle behavior and persisted quick tunnel payload

Fusion-Task-Id: FN-2916
2026-04-29 00:12:35 -07:00
Fusion
d212ee12b3 feat(FN-2913): merge fusion/fn-2913
- feat(FN-2913): complete Step 7 — align InlineCreateCard node picker UX

Fusion-Task-Id: FN-2913
2026-04-29 00:09:39 -07:00
gsxdsm
d2b983225f feat(FN-2911): merge fusion/fn-2911 2026-04-28 23:34:12 -07:00
Fusion
ebd3201153 feat(FN-2901): merge fusion/fn-2901
- fix(FN-2901): reset source issue collapse state on task change
- fix(FN-2901): use issue number in collapsed source issue summary
- feat(FN-2901): complete Step 5 — finalize source issue toggle UX
- test(FN-2901): complete Step 4 — verify collapsible source issue behavior
- feat(FN-2901): complete Step 3 — style collapsible source issue header
- feat(FN-2901): complete Step 2 — add collapsible source issue section
- feat(FN-2901): complete Step 1 — update lucide imports
- feat(FN-2729): merge fusion/fn-2729
- fix(engine): prevent auto-merge cooldown loop on unresolvable conflicts
- feat(FN-2911): improve chat attachment compose and preview UX

Fusion-Task-Id: FN-2901
2026-04-28 23:31:23 -07:00
Fusion
3263babe1b feat(FN-2729): merge fusion/fn-2729
- fix(FN-2729): silence ansi strip lint warning
- test(FN-2729): complete Step 10 — cover node health indicators
- feat(FN-2729): complete Step 9 — colorize CLI node status output
- feat(FN-2729): complete Step 8 — use NodeHealthDot in settings routing status
- test(FN-2729): align ListView node override option expectations
- feat(FN-2729): complete Step 7 — add bulk node status indicators
- fix(engine): prevent auto-merge cooldown loop on unresolvable conflicts
- feat(FN-2911): improve chat attachment compose and preview UX
- feat(FN-2921): merge fusion/fn-2921
- feat(FN-2909): merge fusion/fn-2909
- feat(FN-2914): merge fusion/fn-2914
- feat(FN-2902): merge fusion/fn-2902
- chore(release): v0.8.3
- Update changeset
- fix(tui): swap 3/4 panel hotkeys so they match the help text
- fix(tui): always show auth token and report accurate macOS memory usage

Fusion-Task-Id: FN-2729
2026-04-28 23:23:34 -07:00
Fusion
bdfb08f380 feat(FN-2911): improve chat attachment compose and preview UX
- Add attachment-first chat compose flow with paperclip picker, drag-and-drop, and paste support in ChatView input
- Render pending attachment preview chips with per-file remove actions and drag-over visual affordance
- Display sent message attachments with image/file presentation and accessible focus/interaction styling
- Update ChatView tests and icon mocks to cover attachment-only sends, file selection, and preview behavior

Fusion-Task-Id: FN-2911
2026-04-28 23:11:22 -07:00
Fusion
83ad6e45ab feat(FN-2921): merge fusion/fn-2921
- feat(FN-2921): complete Step 2 — apply filename-first truncation in change lists
- feat(FN-2921): complete Step 1 — prioritize filename-first path truncation

Fusion-Task-Id: FN-2921
2026-04-28 22:43:51 -07:00
Fusion
2e5413984f feat(FN-2914): merge fusion/fn-2914
- fix(FN-2914): remove divider line between close and shortcuts buttons in terminal
- feat(FN-2902): merge fusion/fn-2902
- chore(release): v0.8.3
- Update changeset
- fix(tui): swap 3/4 panel hotkeys so they match the help text
- fix(tui): always show auth token and report accurate macOS memory usage
- chore(release): v0.8.2
- feat(FN-2895): merge fusion/fn-2895

Fusion-Task-Id: FN-2914
2026-04-28 22:17:32 -07:00
Fusion
67226f47c2 feat(FN-2902): merge fusion/fn-2902
- feat(FN-2902): complete Step 6 — address review feedback
- test(FN-2902): stabilize bundle-output assertions for pi-claude-cli
- test(FN-2902): complete Step 4 — cover grouped tool-call rendering
- feat(FN-2902): complete Step 3 — add grouped tool-call styles
- feat(FN-2902): complete Step 2 — group multiple tool calls in QuickChatFAB
- feat(FN-2902): complete Step 1 — group multiple tool calls in ChatView
- chore(release): v0.8.3
- Update changeset
- fix(tui): swap 3/4 panel hotkeys so they match the help text
- fix(tui): always show auth token and report accurate macOS memory usage
- chore(release): v0.8.2
- feat(FN-2895): merge fusion/fn-2895
- fix(cli): validate agentId in fn_task_create/update and unblock bundle tests

Fusion-Task-Id: FN-2902
2026-04-28 22:14:07 -07:00
gsxdsm
d10f33210f chore(release): v0.8.3
Version bump via changesets.
2026-04-28 22:02:56 -07:00
gsxdsm
7a4970e2d6 chore(release): v0.8.2
Version bump via changesets.
2026-04-28 21:51:32 -07:00
Fusion
6bb919864b feat(FN-2895): merge fusion/fn-2895
- feat(FN-2895): complete Step 7 — documentation and delivery

Fusion-Task-Id: FN-2895
2026-04-28 21:50:27 -07:00
gsxdsm
afef995eb7 chore(release): v0.8.1
Version bump via changesets.
2026-04-28 21:15:15 -07:00
Fusion
9286205f4b feat(FN-2915): merge fusion/fn-2915
- feat(FN-2915): include github issue refs in commit workflows
- refactor(dashboard): simplify setup wizard manual step
- fix(engine): prevent phantom merges when verification fix runs without a commit

Fusion-Task-Id: FN-2915
2026-04-28 21:13:30 -07:00
gsxdsm
5bbb8bb2e9 refactor(dashboard): simplify setup wizard manual step
Lead with Project Name, then Project Directory. Move setup-mode toggle
(existing vs clone) and the repository URL field into Advanced Settings
so the default path is one question — pick a folder, name it, register —
without the welcome blurb and mode picker getting in the way.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 21:05:38 -07:00
Fusion
0684a18a6f feat(FN-2909): merge fusion/fn-2909 2026-04-28 20:07:54 -07:00
Fusion
88a148d7dd fix(FN-2906): refine chat render toggles and quick chat resume state
- Remove btn-icon styling from ChatView render toggle controls and apply dedicated borderless toggle styling
- Update ChatView and QuickChatFAB behavior so quick chat streaming state is preserved when resuming sessions
- Add regression tests for QuickChatFAB and useQuickChat to cover resume and streaming-state handling

Fusion-Task-Id: FN-2906
2026-04-28 19:56:05 -07:00
Fusion
b248ffc6e6 fix(FN-2904): preserve quick chat streaming state on resume
- Keep active streaming responses alive when resuming an existing quick chat session instead of resetting stream state
- Update useQuickChat session-resume logic to only restart waiting indicators when appropriate
- Adjust QuickChatFAB waiting indicator behavior so it reflects real in-flight assistant activity
- Add focused hook and component tests covering same-session resume and waiting-indicator regressions

Fusion-Task-Id: FN-2904
2026-04-28 19:43:29 -07:00
gsxdsm
946984a5d0 chore(release): v0.8.0
Version bump via changesets.
2026-04-28 19:24:57 -07:00
Fusion
4a819cf961 fix(FN-2711): keep dashboard timing stats live 2026-04-28 19:20:10 -07:00
gsxdsm
fc2b391c32 fix(FN-2662): clarify project default model setting 2026-04-28 18:29:39 -07:00
gsxdsm
3f061460b9 fix(FN-2662): honor project model overrides and stabilize tests 2026-04-28 18:21:17 -07:00
Fusion
64f662624b feat(FN-2893): add merge-description disclosures in settings
- Render merge strategy descriptions behind expandable disclosure sections in Settings modal
- Add dedicated disclosure styling and update task form expectations for the new copy structure
- Extend Settings modal tests to cover disclosure toggling and merge-description visibility
- Improve model onboarding API key action layout on mobile by stretching form width and aligning button placement
2026-04-28 16:24:22 -07:00
gsxdsm
6ec4e8ba72 fix(dashboard): remove Node Routing block re-added by botched merge
The FN-2869 merge resolution claimed to keep this block removed but
the diff actually re-added it, so it started showing up on the task
details "definition" tab again.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 16:21:49 -07:00
Fusion
c799f9ba44 feat(FN-2896): keep GitHub import modal open after successful import
- Keep the GitHub import modal open after successful issue or PR import instead of auto-closing
- Reset selected issue/PR after import so the Import action disables until a new selection is made
- On mobile, return from preview to list view after a successful import for faster repeated imports
- Expand GitHubImportModal tests to cover stay-open behavior, selection reset, mobile view reset, and stabilized auto-load button assertions
2026-04-28 16:20:24 -07:00
gsxdsm
a2ebfecd3d fix(dashboard): move onboarding default model picker above advanced settings
Surface the Default Model selector directly after the authenticated
provider list so users see it without scrolling past the disclosures.
Hydration of the previously-saved default on reopen was already in
place — this just relocates the existing block.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 16:04:29 -07:00
gsxdsm
ad45c0b1b4 feat(core,engine): split smart merge strategy into prefer-main / prefer-branch
The single "smart" strategy is now two flavors with the new default flipped
to prefer-main. Both share a pre-cascade `git fetch origin <currentBranch>`
+ best-effort fast-forward so a freshly-pushed sibling commit doesn't get
clobbered when the fallback resolves a conflict against a stale base.

- "smart-prefer-main" (new default): -X ours fallback. Protects just-merged
  sibling work from being regressed by a concurrent task branch.
- "smart-prefer-branch": -X theirs fallback. Equivalent to legacy "smart".

Legacy "smart" / "prefer-main" enum values are accepted and normalized via
`normalizeMergeConflictStrategy()` so existing settings.json files migrate
seamlessly. The fast-forward step gracefully degrades on fetch failure or
divergent local main (logs and continues).

Updates settings UI dropdown, test helpers, and adds 5 fetch+ff regression
tests + 7 normalize-helper tests. Lint cleanup of two empty catch blocks
in scripts/release.mjs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 15:44:38 -07:00
gsxdsm
181007b91d fix(FN-2837): correct infusion.ai → runfusion.ai in update notices
Inadvertent infusion.ai links slipped into the dashboard update-available
banner and settings modal (plus matching tests and changeset). Point them
at the actual marketing domain, runfusion.ai.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 15:20:49 -07:00
Fusion
69a5cd4ab8 feat(FN-2869): merge fusion/fn-2869 (auto-resolved)
- docs(FN-2869): complete Step 3 — update notification architecture docs
- docs(FN-2869): complete Step 2 — document notification providers settings
- chore(FN-2869): add changeset for pluggable notification providers
2026-04-28 15:20:49 -07:00
gsxdsm
59aaea800b feat(FN-2869): merge fusion/fn-2869
- docs(FN-2869): pluggable notification providers reference + architecture
- chore: changeset for pluggable notification providers
- ui(merge): clarify mergeConflictStrategy option labels — both "smart" and "prefer-main" run the full smart cascade; differ only in the final fallback (-X theirs vs -X ours)
- TaskDetailModal: keep Node Routing summary block removed

Conflicts in executor.ts, core/index.ts, and RoutingTab.* resolved by
keeping HEAD — fn-2869 branched from a stale main and was dragging in
older versions of files that have since been updated by sibling tasks
(including the FN-2887 rebase fix on executor.ts itself).
2026-04-28 15:14:18 -07:00
gsxdsm
caa9a6161b feat(FN-2890): merge fusion/fn-2890 2026-04-28 15:14:18 -07:00
Fusion
560225a0a4 feat(FN-2880): refactor notification provider cards in settings
- Replace notifications UI with reusable provider cards for ntfy and webhook settings
- Add event option metadata rendering and provider-specific test notification actions
- Align notification card gutters with existing settings layout and mobile behavior
- Expand SettingsModal and mobile tests to cover provider card visibility and interactions
2026-04-28 15:14:18 -07:00
Fusion
5e6dbbb6f3 fix(dashboard): hand off cleanly from setup wizard to model onboarding
On a fresh install useAuthOnboarding's effect ran at mount before the
setup wizard's 500ms auto-open timer fired. The one-shot ref locked,
and the resolved fetch could either stack model onboarding on top of
the wizard or never re-trigger after the wizard closed.

- Gate the trigger on projectId being set so the wizard owns the
  bootstrap phase; the auth check only fires once a project exists.
- Re-check setupWizardOpen via a ref when the auth fetch resolves to
  avoid stacking onboarding on top of a wizard opened mid-fetch.
- Release the one-shot in that suppressed branch so the effect retries
  when the wizard closes.

Adds two regression tests: fresh-install handoff and mid-fetch wizard
suppression.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 15:14:18 -07:00
gsxdsm
5e5020b78f fix(dashboard): hand off cleanly from setup wizard to model onboarding
On a fresh install useAuthOnboarding's effect ran at mount before the
setup wizard's 500ms auto-open timer fired. The one-shot ref locked,
and the resolved fetch could either stack model onboarding on top of
the wizard or never re-trigger after the wizard closed.

- Gate the trigger on projectId being set so the wizard owns the
  bootstrap phase; the auth check only fires once a project exists.
- Re-check setupWizardOpen via a ref when the auth fetch resolves to
  avoid stacking onboarding on top of a wizard opened mid-fetch.
- Release the one-shot in that suppressed branch so the effect retries
  when the wizard closes.

Adds two regression tests: fresh-install handoff and mid-fetch wizard
suppression.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 14:30:38 -07:00
gsxdsm
cef4c30841 fix(dashboard): make SetupWizard scrollable on short viewports
Modal could clip its footer on older laptops / browsers without
dvh support: the height calc fell back to invalid, max-height was
dropped, and the parent overlay had no overflow rule. Added a vh
fallback before the dvh line and made .setup-wizard-overlay
scrollable as a safety net.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 14:25:56 -07:00
Fusion
fdeba4cf89 feat(FN-2727): add node routing controls to CLI and dashboard
- Add CLI support for task node routing with create --node, task set-node, and task clear-node commands
- Extend settings command validation/output for defaultNodeId and unavailableNodePolicy and document new keys
- Surface task routing details in CLI task show plus dashboard Routing tab status/binding reason indicators
- Enhance Settings modal node routing UX with selected-node health status and add/refresh tests and changeset
2026-04-28 14:25:56 -07:00
Fusion
437d5a51c1 fix(FN-2870): resolve dashboard merge artifacts
- Add list view node status indicator styles for bulk edit controls
- Remove duplicated memory dream trigger test blocks introduced during conflict resolution
- Keep dashboard test suite deterministic by retaining a single canonical memory dream trigger describe
2026-04-28 14:25:56 -07:00
gsxdsm
7a630b54bb feat(FN-2879): merge fusion/fn-2879 2026-04-28 14:25:56 -07:00
Fusion
0e40243791 feat(FN-2888): unify task move button interactions
- Replace split move control with a single move button that supports primary action plus arrow-zone menu toggling
- Add keyboard support for move options via ArrowDown to open and Escape to close and refocus the trigger
- Update task detail styling for the unified move button and arrow affordance states
- Refresh TaskDetailModal and TaskForm tests to cover the new move control behavior and preset selection query
2026-04-28 14:25:56 -07:00
Fusion
35694005ef feat(FN-2726): add bulk node override support in dashboard workflows
- Extend batch task update APIs and route handlers to accept nodeId overrides alongside model settings
- Update ListView bulk edit UX to load nodes and apply node overrides through batch updates
- Add node routing visibility improvements in task detail/settings UI and align related labels/styles
- Expand dashboard/API test coverage for node override batch updates and bulk edit behavior
2026-04-28 14:25:56 -07:00