Commit Graph

7238 Commits

Author SHA1 Message Date
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
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
e5bab640f9 Merge pull request #1385 from Runfusion/gsxdsm/fast-tests
perf: speed up test suite across inner loop, full suite, and CI
2026-06-04 18:38:56 -07:00
gsxdsm
d05226f054 Merge pull request #1424 from Runfusion/gsxdsm/step-inversion
feat: step inversion — steps as workflow-modelable nodes (foreach/step-review/parse-steps/code, parallel execution, custom task fields)
2026-06-04 18:17:55 -07:00
gsxdsm
6f7f6860be fix: address PR review feedback (#1424)
- restore customFields on unarchive; reconcile all occupants on field-schema edits (store.ts)
- serialize per-field saves + controlled inputs in TaskFieldsSection (race fixes)
- fn_workflow_get includes layout; Array.isArray guards in validateCodeNodeSources
- per-instance graphStepActiveContext keying; rebase in instance worktree; clear run-once memo on RETHINK
- GET /api/step-parsers + registry-backed parser select (plugin parsers reachable from editor)
- translate new workflowNodes/workflowFields strings across all 5 non-en locales

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 16:16:50 -07:00
gsxdsm
86867c57b0 fix(ci): deflake seam-in-branch badge test — wait for graph hydration before Save, extend badge waitFor timeout
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 15:51:29 -07:00
gsxdsm
82f40a86b9 Merge branch 'main' into gsxdsm/compound-plugin 2026-06-04 15:34:31 -07:00
gsxdsm
0451172bfa fix(ci): theme-token conventions in field badges (white keyword, --text-muted) + roadmap plugin schema literal 107→108
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 14:43:54 -07:00
gsxdsm
021409d445 test(dashboard): regression tests for stepwise builtin editor render path (foreach group + template children + rework edges)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 14:34:53 -07:00
gsxdsm
3ebaa321f8 fix(review): apply code-review fixes — runId/foreachNodeId wiring, worktree-leak cleanup, rework re-execution, instance pruning, SIGKILL fallback, type dedup, board memo split, agent-native field-schema context + fn_workflow_get
17 findings from 12-reviewer code review applied:
- P1 runId trio (pin-probe/resume/markIntegrated used placeholder runId; 4-reviewer corroboration) + production-wiring tests
- P1 worktree/branch release on instance failure/exhaustion/abort
- P2 runGraphTaskStep no longer masks step-session failures; rejected memo cleared so rework re-executes
- P2 clearStaleInstanceStates wired at run start/end (mirrors branch pruning)
- P2 code-node timeout killSignal SIGKILL; dead template-recursion removed
- P1/P2 field-type re-declarations replaced with @fusion/core imports (stale comments removed)
- P2 Board memo split + TaskCard comparator stringify guard + modal prop-driven field defs
- HIGH agent-native: executor prompt injects custom-field schema/values; self-correcting rejection text; fn_workflow_get; fn_task_update bare-call guard; integration-conflict task log

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 14:01:55 -07:00
gsxdsm
94da14cd81 fix: lazy-load esbuild via createRequire (jsdom-safe engine import) + lint cleanup of dead helpers
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 13:19:55 -07:00
gsxdsm
7076dd4516 feat(sdk,dashboard,docs): U9 — save-time code validation route, SDK type exports, skill doc, step-inversion docs + changeset
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 13:15:50 -07:00
gsxdsm
60e9938f5a feat(core,engine): U7 — builtin stepwise coding workflow + trajectory parity & invariant suite; agent-tool surfaces for custom fields and IR authoring
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 13:15:49 -07:00
gsxdsm
af7c141976 feat(engine): U10 — parallel step execution: dependency scheduler, per-instance worktrees, ordered integration, conflict→rework (KTD-11)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 13:04:15 -07:00
gsxdsm
e87e745379 feat(dashboard): WorkflowFieldsPanel — field-definition authoring with live badge preview (U13 completion)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 12:44:43 -07:00
gsxdsm
14758f8edb feat(engine): U12e+U14 — parse-steps node handler, plugin parser adapter, code node runner (esbuild + child-process harness)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 12:44:43 -07:00
gsxdsm
4c3a226050 Fix Compound Engineering plugin install failing from Settings
Installing the Compound Engineering plugin from Settings → Built-in
Plugins failed with "Plugin manifest not found": the dashboard's
bundled-plugin fallback set (BUNDLED_PLUGIN_IDS in routes.ts) was
missing fusion-plugin-compound-engineering, so when the relative
./plugins/... path missed the server cwd, the bundled lookup was never
attempted. fusion-plugin-cli-printing-press had the same gap.

- Add both ids to the dashboard's BUNDLED_PLUGIN_IDS fallback set.
- Stage fusion-plugin-compound-engineering into dist/plugins via
  bundlePluginEntry in the CLI tsup config so packaged installs can
  resolve the bundled copy (every other bundled plugin already had a
  staging block).
- Add route tests that actually exercise the bundled fallback (the
  existing ones let cwd resolution succeed, so the fallback path was
  untested).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 12:31:08 -07:00
gsxdsm
5fa5740afc feat(dashboard,cli): U13 — schema-driven task fields UI (TaskFieldsSection, card badges, PATCH route, board-workflows fields payload, TUI chips)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 12:26:05 -07:00
gsxdsm
2cfa8a3282 feat(engine,core): U5+U6+U12core — step-review verdict handler, graph-source projection discipline, pluggable step-parser registry
- step-review node: reviewStep seam, verdict→outcome edges, UNAVAILABLE limiter, rethink reset-on-rework, split-branch advisory-only
- updateStep source:'graph': dependency-order done guard, audit-loud suppression, auto-reinit bypass; projection-first ordering
- runGraphTaskStep: per-step step-session physics pinned for graph-owned runs (closes U3 interim)
- step-parsers.ts registry (step-headings byte-identical move + json-steps), store delegates via registry

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 12:26:05 -07:00
gsxdsm
a5023e0284 feat(core): U11 — custom task fields validation authority, orphan-not-delete reconciliation, coerce gate
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 12:03:29 -07:00
gsxdsm
a782e5c04c feat(engine): U3 — foreach expansion, iterative instance sub-walk, bounded rework cycles, step-execute seam
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 12:03:29 -07:00
gsxdsm
ad5cd579be feat(dashboard): U8 — node editor authoring for foreach/step-review/parse-steps/code, rework edge inspector, template round-trip
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 11:50:45 -07:00
gsxdsm
0a3cc50f6f feat(core): U4-core — schema v108 (workflow_run_step_instances + tasks.customFields), instance CRUD trio, literal sweep
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 11:50:45 -07:00
gsxdsm
3d03505a62 feat(engine): U2 — runTaskStep/resetStepToBaseline substrate seams with blast-radius guard (RETHINK extraction)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 11:50:45 -07:00
gsxdsm
2a3c285bae feat(core): U1 — IR foreach/step-review/parse-steps/code kinds, rework edges, dependsOn parsing (FN step-inversion)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 11:33:33 -07:00
gsxdsm
0257bdf9d6 fix(ci): align tests/docs with issue-fix commits (recoveryRehome args, pi-ai mock Unknown/Record, new agent tools doc, hex-pattern comment reword)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 10:56:47 -07:00
gsxdsm
0b1c8fb56b fix(ci): widen Column to ColumnId in plugins + drop unused import after #1403 widening
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 08:40:10 -07:00
gsxdsm
afc72b6bb0 fix(core): widen Task.column to ColumnId across packages; v1-preserving IR persistence for rollback safety (#1403 #1405) 2026-06-04 08:00:33 -07:00
gsxdsm
cfc9bb5fd5 fix(core): shared workflow-IR resolver, prod branch persistence + pruning, latest-run JOIN, sweep reservation-leak fix (#1402 #1407 #1412 #1413) 2026-06-04 07:34:02 -07:00
gsxdsm
45ce189548 fix(core): transitionPending recovery sweep, flag-off evacuation, recoveryRehome on self-healing moves (#1401 #1409 #1411) 2026-06-04 07:14:41 -07:00
gsxdsm
010976cee2 test: promote/board-workflows routes, concurrent sweep, canDropTask, migration forward paths (#1404 #1414 #1415 #1416 #1417) 2026-06-04 07:12:46 -07:00
gsxdsm
c21485a65a feat(engine): agent-native workflow tools — promote, reconcile-aware select, CRUD, trait catalog (#1408) 2026-06-04 07:03:53 -07:00
gsxdsm
571768f03a fix(dashboard): workflow:updated SSE invalidation + inline capacity feedback clears on task changes (#1406, #1410) 2026-06-04 07:03:43 -07:00
gsxdsm
b446403ea6 fix(ci): bump remaining schema-version assertions to 107 2026-06-04 04:58:04 -07:00
gsxdsm
d9b5bb4b4e fix(ci): spread real @fusion/core into partial test mocks; deterministic editor save test 2026-06-04 04:32:46 -07:00
gsxdsm
65c915bb36 fix(ci): lane columns snap-align center per mobile scroll-snap convention 2026-06-04 03:52:45 -07:00
gsxdsm
e711e6e0fd fix(ci): schema-version literal, CLI core-mock spreads, plugin-sdk type-only exports, restore pruned i18n keys 2026-06-04 03:38:05 -07:00
gsxdsm
30e2fd7b09 fix(review): apply autofix feedback 2026-06-04 02:50:54 -07:00
gsxdsm
eee715218e chore: lint cleanup, ignore generated i18n typings, mark plan completed 2026-06-04 02:16:55 -07:00
gsxdsm
60605fafa9 feat(core): workflowColumns integrity pass, graduation report, server-side trait validation, plugin post-commit hooks, docs + changeset (U12) 2026-06-04 02:13:48 -07:00
gsxdsm
3aa8d2d28b feat(dashboard): flag-gated multi-lane board — lane per workflow, trait-keyed columns, typed drag rejections, hold promote (U9) 2026-06-04 01:49:51 -07:00
gsxdsm
e5a0a199ea feat(dashboard): node editor authors columns, traits, hold and split/join nodes with inline validation (U10) 2026-06-04 01:46:51 -07:00
gsxdsm
26718a31cc feat(engine): plugin-contributed traits — async-only hooks, pre-evaluated gates, live-dependent disable guard (U8) 2026-06-04 01:43:26 -07:00
gsxdsm
66cffe904d feat(cli): TUI trait-flag bucket mapping + read-only Other (custom) bucket — no card silently dropped (U11) 2026-06-04 01:33:04 -07:00
gsxdsm
6a15a13917 feat(engine): in-txn capacity enforcement + generalized hold/release sweep with reservation-first ordering (U6) 2026-06-04 01:22:56 -07:00