Commit Graph

8399 Commits

Author SHA1 Message Date
Fusion Worker
1afdbbbb47 feat(engine): add structured error types and general-purpose retry with exponential backoff
Add domain-specific error classes (engine-errors.ts) replacing generic
catch blocks with typed, classifiable errors:
- EngineError base with code/retryable/details fields
- TransientError hierarchy: NetworkError, ServiceUnavailableError, TimeoutError
- PermanentError hierarchy: ConfigurationError, ValidationError
- RateLimitError (triggers global pause, not local retry)
- classifyThrownError() bridge from legacy string-based detection

Add general-purpose retry with exponential backoff (retry-with-backoff.ts):
- withRetry() wraps async ops with configurable retries for transient errors
- Exponential backoff: delay = min(baseMs * 2^attempt, maxMs)
- Three jitter strategies: full (default), equal, none
- Per-attempt timeout support via timeoutMs option
- AbortSignal integration for task pause/cancel/shutdown
- Custom isRetryable check for domain-specific retry logic
- withRetryResult() variant returning retry metadata
- Never retries rate-limit errors (delegates to global pause)

53 new tests covering error hierarchy, backoff math, cancellable sleep,
retry on transient errors, non-retryable fail-fast, rate-limit bypass,
abort cancellation, per-attempt timeout, custom predicates.
2026-06-07 00:15:48 +07:00
gsxdsm
ba16805ce6 Merge pull request #1466 from Runfusion/gsxdsm/issue-1454-manage-projet-bug
fix: empty folder selection reverts in DirectoryPicker + add create-folder button
2026-06-06 09:24:31 -07:00
gsxdsm
d92ad82e0c fix: disable Create button when currentPath is empty 2026-06-06 07:01:48 -07:00
gsxdsm
163332c6cc fix: localize create-folder validation error and add missing i18n keys
- Add dirPicker.createFolderError to all locale files (en, es, fr, ko, zh-CN, zh-TW)
- Use t() for the folder name validation error in DirectoryPicker
- Add missing dirPicker keys: cancel, createFolder, createFolderAria,
  createFolderConfirm, createFolderTitle, newFolderPlaceholder
2026-06-06 06:59:25 -07:00
gsxdsm
a87c7d72cd fix: remove invalid eslint-disable comment for non-existent react-hooks rule 2026-06-06 06:52:43 -07:00
gsxdsm
ee5f5e84ac Address PR review feedback (#1466)
- routes.ts: use isAbsolute() before resolve() for proper path validation
- routes.ts: wrap mkdir() in try/catch to map EEXIST/ENOENT/ENOTDIR to 4xx
- DirectoryPicker.tsx: use !browser.currentPath guard to prevent re-fetch loop
- DirectoryPicker.tsx: disable Create button during in-flight requests
- DirectoryPicker.tsx: add fetchEntries to useEffect dependency array
- DirectoryPicker.tsx: client-side validation for folder names
- Add changeset for the new create-folder feature
2026-06-06 06:31:44 -07:00
gsxdsm
020a1cf7b9 docs: compound knowledge for DirectoryPicker empty-folder revert bug 2026-06-06 01:42:57 -07:00
gsxdsm
d8e325b17e fix: empty folder selection reverts in DirectoryPicker + add create-folder button
Fix bug where navigating into an empty folder in the DirectoryPicker
would automatically revert to the previous folder. The useEffect that
auto-fetches on open was using the stale 'value' prop instead of
'browser.currentPath' after navigation.

Also adds a 'New folder' button to the DirectoryPicker toolbar so users
can create folders directly when setting up a project.

- DirectoryPicker.tsx: fix useEffect to use browser.currentPath || value
- DirectoryPicker.tsx: add create folder UI state and handlers
- DirectoryPicker.css: styles for create folder input and actions
- routes.ts: add POST /api/create-directory endpoint
- legacy.ts: add createDirectory API client
- DirectoryPicker.test.tsx: add tests for empty folder nav and create folder
2026-06-06 01:32:06 -07:00
gsxdsm
f49ab4946a Merge pull request #1463 from Runfusion/gsxdsm/issue-1455-initialize-git-repository
fix(FN-1455): initialize git during project registration
2026-06-06 01:08:31 -07:00
gsxdsm
62f60364f2 Merge pull request #1465 from Runfusion/gsxdsm/node-editor-fix
fix(node-editor): auto-layout on load + viewport to top-left
2026-06-06 01:07:50 -07:00
gsxdsm
8543e139a3 Merge pull request #1464 from Runfusion/gsxdsm/compound-debug
fix(dashboard): add missing vite alias for compound-engineering plugin
2026-06-06 01:06:17 -07:00
gsxdsm
2992a7e19a fix(FN-1455): surface automatic git initialization
Fusion-Task-Id: FN-1455
2026-06-06 01:01:24 -07:00
gsxdsm
c2da5883e7 fix(FN-1455): document project git registration invariant
Fusion-Task-Id: FN-1455
2026-06-06 00:59:01 -07:00
gsxdsm
c02cbde2bf docs(solutions): document bundled plugin Vite alias failure mode 2026-06-06 00:56:55 -07:00
gsxdsm
d521661862 fix(node-editor): auto-layout on load + viewport to top-left
Run auto-layout automatically when a workflow is loaded so nodes are
tidily positioned instead of scattered at persisted positions. Position
the viewport at (0,0) with zoom 1 so the laid-out nodes are visible in
the top-left corner.

- workflow-auto-layout.ts: change ORIGIN_X/Y from 40 to 0
- WorkflowNodeEditor.tsx: apply autoLayout on load, setViewport to top-left
- WorkflowNodeEditor.test.tsx: update test to verify layout runs on load
2026-06-06 00:56:12 -07:00
gsxdsm
e941cb61cb fix(dashboard): add missing vite alias for compound-engineering plugin 2026-06-06 00:46:20 -07:00
gsxdsm
e1d6e4ecdc Merge pull request #1461 from Runfusion/gsxdsm/fixprflow
feat: Unified PR entity as first-class workflow nodes with review-response loop
2026-06-06 00:38:32 -07:00
gsxdsm
db971a91ea fix(FN-1455): initialize git during project registration
Fusion-Task-Id: FN-1455
2026-06-06 00:38:28 -07:00
gsxdsm
854b6a30c9 fix(lint): empty-interface PrSourceDescriptor → type alias, drop unused eslint-disable directives
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-06 00:15:28 -07:00
gsxdsm
841ff9d838 Address PR review feedback (#1461)
- pr-nodes: forward post-increment entity to deps.respond (responseRounds off-by-one); branch-group entity fallback now keys on task.branchContext.groupId, not task.id
- core: hoist shared autoMergeGateReason into @fusion/core pr-entity.ts; CLI + dashboard import the single definition (R13)
- cli: fn pr create also writes the unified PR entity (ensure → open), keeping legacy prInfo; resolveBranchHeadOid uses argv-safe execFileAsync (injection fix)
- changeset: fn-pr-commands bumped minor → major (breaking CLI removal per AGENTS.md)
- tests: bin.test.ts daemon fixture off reserved port 4040; lazy-loaded-views title 19 → 20 views

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-06 00:09:53 -07:00
gsxdsm
1922b5efc2 merge: main (workflow editor 109 / cli_sessions 110-111 / workflow_settings 112) — renumber PR-entity migration to 113, union core exports, TaskCard prNode + cliSessionState badges, executor PrNodeDeps + CliAgentRuntime options 2026-06-05 23:06:46 -07:00
gsxdsm
f1e9ab5587 fix(review): apply autofix feedback
Security hardening + cleanups from code review: parseAgentVerdicts now
ignores out-of-batch thread ids and fails safe (disagree) on conflicting
duplicate verdicts for one thread; drop the unused store param from
makePrResponseAgentRunner; correct the rework-bound doc (to-node, not
from-node) and the migration idempotency comment (PK is the re-run guard).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 22:49:39 -07:00
gsxdsm
3f313567dd feat(pr): built-in PR workflow template, end-to-end (U9)
Ships BUILTIN_PR_WORKFLOW_IR (builtin:pr-workflow) wiring the lifecycle
end to end: start -> pr-create -> await-review hold -> (changes-requested)
pr-respond -[rework]-> await-review -> (approved) auto-merge gate ->
pr-merge -> end, with conflict/failed holds and manual force-merge/close
edges. Completes U6's validator side: validateV2 permits a top-level
kind:rework edge whose loop-head opts in via config.reworkRegion (non-
rework cycles still rejected). Additive (default builtin:coding untouched);
behind workflowGraphExecutor. Legacy PrCommentHandler/PrMonitor retirement
deferred (they remain the flag-off path's PR handling) — recorded in the
plan. Fast e2e test; 41 core IR/builtin tests green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 22:42:36 -07:00
gsxdsm
34c8ac9cd7 feat(pr): fn pr CLI commands, retire fn task pr-create (U8)
Adds the fn pr noun — create/show/list/respond/approve/retry/merge/close/
automerge — routing to the same store/engine/release paths as the U7
dashboard routes (surface-parity pinned by a consistency test). Retires
fn task pr-create (dispatch removed; deprecated re-export kept for
importers). Changeset: @runfusion/fusion minor. 22 command tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 22:28:50 -07:00
gsxdsm
8a6a67a305 feat(pr): dashboard PR view, routes, node-state UI + user controls (U7)
Adds /api/pull-requests routes (list, detail, merge/approve/retry/close/
automerge — all re-fetch authoritative state before acting), a
PullRequestView rendering every entity state distinctly (creating/failed/
unverified/responding/await-review/conflict) with the action bar, live
auto-merge gate reason, and conflict CTA; TaskCard PR node-state badge +
link; and the R16 column-move-backward guard. User actions route through
the existing releaseHeldTaskByEvent primitives. Maps the new PR node kinds
in the workflow editor's kind resolver. 13 route tests + lazy-view guard
green; component test runs in CI.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 22:18:34 -07:00
gsxdsm
96f801c019 feat(pr): top-level bounded rework + auto-merge gate + legacy-bypass pin (U6)
Generalizes the foreach-only bounded-rework mechanism to the top-level
graph walk so the PR review loop (await-review -> pr-respond -> rework
back) is a legal bounded cycle: a kind:rework back-edge to a stacked node
returns a ReworkSignal the loop-head re-runs up to maxReworkCycles, then
routes outcome:rework-exhausted. Non-rework cycles still throw 'Cycle
detected' (safety preserved); foreach rework unchanged (shared core
constants). Adds createAutoMergeGateHandler (live entity re-fetch +
isPrEntityAutoMergeReady -> auto-on/auto-off). Pins R14: graph-executed
PR tasks merge through pr-merge, never the legacy queue. 122 graph tests
green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 20:32:24 -07:00
gsxdsm
885e1d95bf Merge pull request #1457 from Runfusion/chore/remove-temp-coderabbit-config
chore: remove temporary CodeRabbit scope config
2026-06-05 20:21:19 -07:00
gsxdsm
5404496a45 Merge pull request #1445 from Runfusion/gsxdsm/cleanupsettings
feat: workflow settings, hard-move migration, Settings UI redesign
2026-06-05 20:21:00 -07:00
gsxdsm
31d4b5335b feat(pr): security-hardened review-response run — pr-respond body (U5)
Implements the fix-or-disagree agent loop behind pr-respond: batched
one-run-per-cycle over actionable threads (filtering resolved/outdated/
self/bot), with prompt-injection delimiting of untrusted comment bodies,
viewer-authenticated anti-spoof markers, a pre-push secret scan, fast-
forward-only push (no force-push path) with non-ff abort+re-batch, reply+
resolve, commit-last thread-state persistence with marker+SHA crash
recovery (R15), and an iteration cap on responseRounds (R8). GitHub/git/
agent ops injected; engine stays dashboard-import-free. Adds GraphQL
getPrReviewThreadsDetailed + getViewerLogin to the client. 23 tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 20:20:25 -07:00
gsxdsm
c13f9a123b feat(pr): node-agnostic PR reconcile + hold-release firing (U4)
Adds PrReconciler — a per-repo, self-owned polling loop (started from the
runtime layer in project-engine.ts, NOT the scheduler) that ETag-probes
GitHub, deep-fetches on change, persists mirror state, clears unverified
on first reconcile, and fires releaseHeldTaskByEvent(github:pr-<event>)
for transitions (changes-requested/approved/conflict/conflict-cleared/
merged/closed). Drops terminal entities; persists an audit event on error.
GitHub ops injected via PrReconcileGithubOps at the 3 CLI sites; engine
never imports the dashboard client. scheduler.ts stays PR-free (R20),
pinned by a regression test. 8 tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 20:05:29 -07:00
gsxdsm
4e16145aab feat(pr): pr-create/pr-respond/pr-merge node kinds + handlers (U3)
Adds the three first-class PR workflow node kinds and their handlers via
createPrNodeHandlers(deps), registered in createDefaultNodeHandlers
(fail-closed pr-nodes-unwired when absent). GitHub ops are injected as
callbacks (PrNodeGithubOps) at all three CLI sites (daemon/serve/dashboard)
so the engine never imports the dashboard client (FN-3049). pr-create
routes open/failed as outcomes; pr-merge passes expectedHeadOid and never
writes 'merged' (reconcile corroborates); pr-respond delegates to an
injected respond callback (U5 fills the body). 10 tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 19:55:31 -07:00
gsxdsm
b871046ad2 feat(pr): GitHub primitives — thread reply/resolve, ETag probe, expectedHeadOid merge (U2)
Adds the net-new GitHub primitives the PR nodes need: replyToReviewThread
and resolveReviewThread (GraphQL mutations, dual gh/API), an ETag-conditional
probePrChanged (304 is rate-limit-free, gates the reconcile deep-fetch), and
expectedHeadOid on mergePr (--match-head-commit / REST sha) raising a typed
PrStaleHeadError on a head-moved race so pr-merge can re-evaluate.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 19:37:59 -07:00
gsxdsm
4ecf3e86fa feat(pr): PR entity foundation — schema v109, store CRUD, predicates (U1)
Adds the unified PR entity: pull_requests + pull_request_thread_state
tables (schema v109, re-runnable migration with three partial unique
indexes and a compat helper), PrEntity/PrThreadState types, store CRUD
(create-or-reuse, update, per-thread outcome upsert), and core-owned
predicates (isPrBacked merge-target-scoped, unverified hard gate,
auto-merge readiness). Migrates legacy branch_groups PR fields into
unverified entities (R19). Fixes the misleading 'transactional migration'
docstring.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 17:26:07 -07:00
gsxdsm
4d61374ee7 docs(pr): brainstorm + plan for unified PR entity as workflow nodes
Adds the requirements brainstorm and implementation plan for replacing
fusion's split PR machinery with a first-class PR entity whose lifecycle
is expressed as workflow-graph nodes (pr-create, pr-respond, pr-merge),
plus CONCEPTS.md entries for the PR entity and review-response loop.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 17:20:44 -07:00
gsxdsm
72e320aab4 Address PR review feedback (#1445)
- applyRemoteSettings now applies the stripped global payload (moved keys can't resurrect)
- resolver error path keeps effective workflowId so builtin fallback survives identity failure
- updateWorkflowSettingValues read-merge-upsert wrapped in transactionImmediate (lost-update race)
- MergeSection directMergeCommitStrategy UI fallback aligned to schema default (always-squash)
- save-split section-routing test asserts the positive case
- setting-values routes 404 on unknown workflow ids (+ tests)
2026-06-05 16:46:04 -07:00
gsxdsm
1f68348441 merge: main (CLI agent interface #1446) — renumber workflow_settings migration to 112 behind main's cli_sessions(110)/adapter(111), full-workspace literal sweep, i18n union 2026-06-05 16:18:39 -07:00
gsxdsm
ab7b4e1b87 chore: remove temporary CodeRabbit scope config
The .coderabbit.yaml added to PR #1446 was a temporary review-scoping
config (excludes tests/docs/locales to fit CodeRabbit's file cap). It was
meant to be dropped before merge but leaked onto main when #1446 merged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 15:48:27 -07:00
gsxdsm
0fdf60aaf1 Merge pull request #1446 from Runfusion/gsxdsm/cli-agent-interface
feat: cli-agent executor — interactive CLI coding agents in tasks and chat
2026-06-05 15:41:14 -07:00
gsxdsm
995765bcc5 Merge remote-tracking branch 'origin/gsxdsm/cli-agent-interface' into gsxdsm/cli-agent-interface 2026-06-05 15:31:13 -07:00
gsxdsm
693ed6290a Merge remote-tracking branch 'origin/main' into gsxdsm/cli-agent-interface
# Conflicts:
#	CONCEPTS.md
#	packages/core/src/__tests__/db-migrate.test.ts
#	packages/core/src/__tests__/db.test.ts
#	packages/core/src/__tests__/goals-schema.test.ts
#	packages/core/src/__tests__/insight-store.test.ts
#	packages/core/src/__tests__/merge-request-record.test.ts
#	packages/core/src/__tests__/mission-store.test.ts
#	packages/core/src/__tests__/run-audit.test.ts
#	packages/core/src/__tests__/store-merge-queue.test.ts
#	packages/core/src/__tests__/task-documents.test.ts
#	packages/core/src/db.ts
#	packages/dashboard/src/__tests__/agent-onboarding.test.ts
#	packages/dashboard/src/__tests__/ai-refine.test.ts
#	packages/dashboard/src/__tests__/chat-attachment-routes.test.ts
#	packages/dashboard/src/__tests__/experiment-routes.finalize.test.ts
#	packages/dashboard/src/__tests__/milestone-slice-interview.test.ts
#	packages/dashboard/src/__tests__/mission-interview.test.ts
#	packages/dashboard/src/__tests__/pr-metadata-generator.test.ts
#	packages/dashboard/src/__tests__/project-pause-resume-routes.test.ts
#	packages/dashboard/src/__tests__/routes-approval-sandbox-provisioning.test.ts
#	packages/dashboard/src/__tests__/routes-approval-secrets.test.ts
#	packages/dashboard/src/__tests__/routes-approval.test.ts
#	packages/dashboard/src/__tests__/routes-worktrunk.test.ts
#	packages/dashboard/src/__tests__/session-error-recovery.test.ts
#	packages/dashboard/src/__tests__/session-persistence-roundtrip.test.ts
#	packages/dashboard/src/__tests__/session-reconnect.test.ts
#	packages/dashboard/src/__tests__/session-resume-history.test.ts
#	packages/dashboard/src/__tests__/setup-routes.test.ts
#	packages/dashboard/src/__tests__/subtask-breakdown.test.ts
#	packages/dashboard/src/routes/__tests__/agent-avatar-routes.test.ts
#	packages/dashboard/src/routes/__tests__/custom-providers.test.ts
#	packages/dashboard/src/routes/__tests__/docker-node-routes.test.ts
#	packages/i18n/locales/en/app.json
#	plugins/fusion-plugin-roadmap/src/store/__tests__/roadmap-store.test.ts
2026-06-05 15:30:59 -07:00
gsxdsm
6d16c07197 merge: main (editor consolidation #1433, fast-tests, learnings) — renumber workflow_settings migration to 110, settings panel joins the sidebar disclosures, full-workspace literal sweep 2026-06-05 15:23:15 -07:00
gsxdsm
7d69691bbf Merge pull request #1433 from Runfusion/gsxdsm/improve-node-editor
feat: workflow editor upgrade and consolidation — primary surface, templates, import/export, AI design
2026-06-05 15:06:32 -07:00
gsxdsm
5dde079a2a Merge branch 'main' into gsxdsm/cli-agent-interface 2026-06-05 14:52:46 -07:00
gsxdsm
47e4919a78 Merge pull request #1453 from Runfusion/gsxdsm/fast-tests
refactor(ci): thin trusted merge gate with flaky-test deletion ratchet
2026-06-05 14:52:12 -07:00
gsxdsm
d508f6afc5 Merge pull request #1456 from Runfusion/docs/column-agent-compound-learnings
docs(solutions): column-agent execution-principal blast-radius learning
2026-06-05 14:51:47 -07:00
gsxdsm
11fb9f1325 merge main: per-column agent assignment (binding validation, policy-escalation handshake, override notes) into workflow editor consolidation
Resolved 4 conflicts preserving both feature sets:
- WorkflowNodeEditor.tsx: kept card-node/edge/dialog/dirty-guard/auto-layout/
  onboarding/template/AI-edit features; wired main's columnAgentsEnabled flag
  gate, override-column agent registry load, and policy-escalation save retry
  (finishSave helper wraps both update payloads).
- WorkflowNodeEditor.test.tsx: kept U2/U4/AI-design describes plus main's U6
  column-agent describe; merged api mock + import lists.
- register-workflow-routes.ts: merged import sets (design DI seam + column-agent
  validators).
- agent-tools.ts: strip-approval-flags and column-agent binding assertion now
  both run in create/update tools.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 14:43:02 -07:00
gsxdsm
b7fa21c25e merge: main (column-agent assignment #1432) into workflow-settings — union executor/agent-tools/routes imports, both tool-description texts, both route helpers 2026-06-05 14:41:43 -07:00
gsxdsm
60f1b7fa39 Merge remote-tracking branch 'origin/main' into gsxdsm/cli-agent-interface
# Conflicts:
#	packages/dashboard/app/components/__tests__/ListView.test.tsx
2026-06-05 14:36:42 -07:00
gsxdsm
66d829abed docs(solutions): schema-version literal sweep must include plugin workspaces 2026-06-05 14:32:04 -07:00
gsxdsm
baac9a12f0 docs(solutions): capture thin-trusted-merge-gate pattern; refine Testing vocabulary in CONCEPTS.md 2026-06-05 14:29:07 -07:00