Commit Graph

7443 Commits

Author SHA1 Message Date
gsxdsm
41f25d5c52 feat(engine): effective column agent becomes the execution principal
U5: action-gating contexts, the heartbeat deferral gate, a two-pass
resumeTaskForAgent, and the reverse-direction agent.taskId guards (via a
new isAgentEffectivelyExecuting callback wired at the in-process runtime)
all consult the column-effective agent; the restart watcher re-resolves
column bindings per tick for bound graph sessions, hot-swapping on
agent-changed and falling back without restart on agent-deleted.
2026-06-05 00:19:13 -07:00
gsxdsm
8fb7de1f7d Merge U8: cli-agent resume coordinator and self-healing integration 2026-06-05 00:17:14 -07:00
gsxdsm
10acf17c6e feat(engine): cli-agent resume coordinator and self-healing integration (U8)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 00:16:14 -07:00
gsxdsm
8bac390e1b feat(engine): cli-agent one-shot sessions for validator, planning, and CE (U9)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 00:15:57 -07:00
gsxdsm
8c9702e909 refactor(dashboard): extract SettingsModal Account/Global/Runtimes sections into shared-primitive components with pure save-split helper 2026-06-05 00:15:15 -07:00
gsxdsm
91284f516d feat(dashboard): template picker on workflow creation 2026-06-05 00:06:06 -07:00
gsxdsm
4fa54075ad feat(engine): execute and step-execute sessions run as the column agent
U4: seams stamp the governing node id into run context; a per-seam
resolveSeamColumnAgent feeds the core resolver and threads the effective
agent through resolveExecutorSessionModel, runtime hints, persona, memory
tools, and StepSessionExecutor attribution. Characterization tests pin the
no-binding path byte-identical. Gating/deferral principal moves in U5.
2026-06-05 00:05:02 -07:00
gsxdsm
e70be3b799 fix(engine): dedupe session-manager exports after U7 merge 2026-06-05 00:04:06 -07:00
gsxdsm
7e94d62f6f Merge U7: cli-agent executor seam, task session lifecycle, hard-cancel integration 2026-06-05 00:02:41 -07:00
gsxdsm
c1c99a9de0 feat(engine): wire cli-agent executor seam and task session lifecycle (U7)
Add `cli-agent` as a task-execute executor kind. A workflow node with
`config.executor === "cli-agent"` drives an engine-owned CLI coding agent
through the execute step via the new cli-agent/task-session.ts orchestration:
spawn in the worktree, issue the hook token + write hook scripts, inject the
prompt after readiness, subscribe to the state machine, and resolve on a
positive completion signal (R20 gating). Config is snapshotted at launch; the
PTY is reaped (completed) at the in-review handoff.

Executor seam: runGraphCustomNode gains a cli-agent branch delegating to
runCliAgentNode; the hard-cancel/abort path (awaitAbortInFlightTaskWork +
abortAllInFlight) claims and SIGKILLs the CLI session as a first-class surface,
marking it killed (never resume-eligible). Re-entry kills any prior live
session and launches fresh; follow-up resumes the recorded native session id
when supported. A PTY-pool ceiling surfaces as a typed task value, not a stall.

Node-config typing extended minimally (WorkflowNodeExecutorKind /
WorkflowNodeExecutorConfig in @fusion/core).

Tests: cli-agent/__tests__/task-session.test.ts (12) and
__tests__/cli-agent-executor.test.ts (9) cover AE1/AE5, hard cancel, re-entry,
follow-up, config snapshot, ceiling, and the generic-tier confirm-advance path,
using scripted adapters + a mock PTY seam. Engine typecheck clean; full
src/cli-agent suite + new tests green (144 passing).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 00:01:12 -07:00
gsxdsm
fbc7c96221 Merge U5: Codex, Droid, and Pi cli-agent adapters (binaries probed; exec -r footgun guarded) 2026-06-05 00:00:49 -07:00
gsxdsm
07dcb1695e feat(engine): add Codex, Droid, and Pi cli-agent adapters (U5)
Codex (hybrid tier): native done via session-scoped notify config,
heuristic PTY waiting detection, codex resume <thread-id>, probed rollout
JSONL tailer. Droid (native tier): Claude-style hooks with a Notification
permission-vs-idle classifier, --resume / exec -s resume (never -r in exec
mode). Pi (native tier): session-JSONL telemetry + transcript tailing,
pi --session resume. Adds the session-jsonl transcript source.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 00:00:05 -07:00
gsxdsm
57631c749f feat(cli): TUI full-screen attach to cli-agent sessions (U14)
Suspend-and-handoff passthrough from the Ink TUI to a cli-agent PTY session:
mint an attach ticket, open the cli-session WebSocket, enter the alternate
screen + raw mode, stream WS scrollback/data frames to stdout, frame stdin
bytes into input messages, propagate resizes, and ACK consumed bytes for flow
control. Detach chord Ctrl-] restores the terminal and remounts Ink; a dropped
WS surfaces the error and restores the terminal cleanly.

Untrusted terminal output is neutralized through the same hardening filter the
dashboard WS bridge uses (re-exported from @fusion/dashboard) so OSC 52, non-
http(s) OSC 8 links, and device-status queries are stripped before reaching the
host TTY — the riskiest leg, since the host terminal honors more sequences than
xterm.js. CJK/double-width bytes pass through verbatim.

- packages/cli/src/commands/dashboard-tui/terminal-attach.ts (passthrough loop +
  injectable WS transport for tests)
- controller.openTerminalAttach() Ink integration (unmount/run/remount)
- adds `ws` runtime dep to packages/cli
- re-exports neutralizeTerminalOutput/flushTerminalOutput from @fusion/dashboard

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 23:56:10 -07:00
gsxdsm
776def02ea feat(dashboard): AI workflow design endpoint with validation, stripping, and rate limit 2026-06-04 23:55:05 -07:00
gsxdsm
75ebe23b4f feat(dashboard): column agent picker, override visibility, write-time validation
U6: WorkflowColumnPanel agent picker + defer/override toggle with specified
interaction states (flags-off hint, loading, fetch-error, stale-agent
warning, bound-column badge); WorkflowNodeEditor overridden-by-column-agent
note + stale-id treatment; assertColumnAgentsExist + confirmPolicyEscalation
gate (R13) on workflow save routes; flowToIr now preserves column agent
bindings through the editor round-trip.
2026-06-04 23:53:22 -07:00
gsxdsm
d88bfc4c75 feat(engine): custom workflow nodes run as their column's agent
U3: per-run IR resolution feeds the core column-agent resolver at the
runCustomNode seam; override supersedes node agent/model/persona wholesale,
defer fills bare nodes only; adoption and fallback are audited via logEntry;
raw-CLI nodes log a skip. Also fixes the customInstructions persona drift —
node-level executor:"agent" persona injection now uses the typed
soul/instructionsText fields (KTD-6).
2026-06-04 23:53:22 -07:00
gsxdsm
ef33d79e78 feat(core,dashboard): workflow-centric task creation with atomic workflowId materialization 2026-06-04 23:47:24 -07:00
gsxdsm
1b46780fca Merge U10: cli-agent session transport (WS attach, tickets, SSE state, output hardening)
# Conflicts:
#	packages/engine/src/index.ts
2026-06-04 23:46:23 -07:00
gsxdsm
17c9303f22 feat(dashboard): cli-agent session transport — WS attach, tickets, SSE state, output hardening (U10)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 23:44:39 -07:00
gsxdsm
cb9a3f1cc5 feat(settings): surface sweep for the hard-move — export v2 with workflowSettings, sync moved-key filtering, CLI redirect hints, consistency guard 2026-06-04 23:41:30 -07:00
gsxdsm
a08e144530 Merge U17: cli-agent hook ingestion route, per-session tokens, and hook scripts 2026-06-04 23:40:19 -07:00
gsxdsm
d8248b4c4f feat(dashboard): add cli-agent hook ingestion route and session hook scripts (U17)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 23:39:07 -07:00
gsxdsm
3eca224e83 Merge U6: generic heuristic-tier adapter with idle state surfacing 2026-06-04 23:36:21 -07:00
gsxdsm
e421774f6a feat(core): column agent IR schema, validation, and effective-agent resolver
U1+U2 of the column-agent plan: WorkflowColumnAgent on WorkflowIrColumn
(defer/override), template-subgraph column validation, v2-only-feature
registration, plugin-sdk type parity, and the shared core resolver with
instanceNodeId format ownership moved to core.
2026-06-04 23:35:32 -07:00
gsxdsm
f3b700aa5d feat(engine): add generic heuristic-tier cli-agent adapter (U6)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 23:34:33 -07:00
gsxdsm
ec4377e10a feat(engine): add Claude Code native-tier cli-agent adapter (U4)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 23:32:58 -07:00
gsxdsm
773ba76209 test(engine): self-skip real-PTY e2e when PTY I/O unavailable in environment 2026-06-04 23:24:54 -07:00
gsxdsm
4fe7dbe016 feat(core): one-time hard-move migration of workflow-policy settings to workflow setting values
30 moved keys (step execution, review/approval, per-phase model lanes) leave
DEFAULT_PROJECT_SETTINGS; marker-gated idempotent per-project migration writes
customized values to every in-use (workflowId, projectId); stale-writer guard;
tombstone allowlist derived from the builtin catalog.
2026-06-04 23:23:48 -07:00
gsxdsm
7b961d63f5 Merge pull request #1428 from Runfusion/gsxdsm/compound-plugin
Fix Settings plugin installs registering unloadable directory paths
2026-06-04 23:23:04 -07:00
gsxdsm
ed4c7ba006 feat(engine): add cli-agent telemetry hub and session state machine (U3)
Pure engine code (no HTTP) for the CLI agent executor:

- state-machine.ts: authoritative per-session state machine implementing the
  HTD diagram (starting→ready→busy⇄waitingOnInput→done; done→busy follow-up;
  dead-classification choice → killed/userExited/authFailed/resuming; resume cap
  of 2 with backoff → needsAttention). Positive completion is distinct from idle
  (idle never produces done); inactivity stall backstop re-armed by output/
  telemetry events (no fixed turn timeout); termination classification helper for
  all five paths; per-turn latches reset between turns. Persists every transition
  via CliSessionStore (the transient `resuming` machine state maps onto the U1
  `dead` store enum) and exposes a throttled `onStateChange` subscription for the
  later SSE bridge — no dashboard imports.

- telemetry-hub.ts: in-process ingestion contract (ingest(sessionId, event)) for
  the U17 route and log-tailing adapters. Mints high-entropy per-session hook
  tokens (issueToken/validateToken/invalidate); rebuilds the registry only from
  live sessions in CliSessionStore so stale tokens for non-live sessions never
  validate; a token validates only for its own session. Bounds everything
  ingested: per-event size caps, per-turn count caps (lifecycle events exempt),
  ANSI/control stripping before pattern matching, and secret redaction that
  survives chunk boundaries via a held-back carry window (redactSecrets from
  @fusion/core).

Tests: 35 new (state-machine.test.ts, telemetry-hub.test.ts) covering AE1/AE2,
stall backstop, all termination paths, resume caps, token registry, two-turn
latch reset, oversized capping, ANSI stripping, and cross-chunk redaction.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 23:18:48 -07:00
gsxdsm
407ce03bf2 feat(dashboard): workflow and template JSON import/export with trust-boundary stripping 2026-06-04 23:16:46 -07:00
gsxdsm
4fc1a9dd46 feat(engine): add CliAgentAdapter interface and CliSessionManager (U2)
Engine-owned PTY lifecycle for CLI agent sessions:
- adapter.ts: CliAgentAdapter interface (launch/env-allowlist builders,
  capability flags, readiness detection, injection formatter, resume builder,
  telemetry wiring) + CliAdapterRegistry with typed unknown/duplicate errors.
- session-manager.ts: CliSessionManager owning node-pty processes via the U16
  shared loader. Byte-bounded scrollback ring (default ~512KB), single
  serialized write queue shared by injections + user input (FIFO, deferral in
  quiet windows), latest-active-client resize, scoped-SIGKILL process registry
  on process exit (never port 4040), explicit async attach interface
  (scrollback + AsyncIterable<Uint8Array> + write/resize/detach),
  requestPause/requestResume watermark hooks, separate concurrency pool with
  typed CliConcurrencyLimitError at the ceiling.
- Security: bracketed paste only when ?2004h observed; unconditional control-char
  neutralization on the raw path; user keystrokes bypass neutralization.
- Persists lifecycle into the U1 CliSessionStore (create on spawn, update
  state/termination).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 23:04:13 -07:00
gsxdsm
66f1db122b Fix quality-backfill suites broken by fast-tests x workflow-columns merge race
Main went red when the fast-tests quality-backfill projects (PR #1385)
landed alongside the workflow-columns stream (PR #1424) — the new test
projects were written against pre-stream code:

- TaskFieldsSection.css toggle knob used background: #fff, violating the
  theme-token assertion in AgentListModal's styling-parity test; use
  var(--card) per the SkillsView toggle convention
- ListView.test.tsx api mock lacked fetchBoardWorkflows (TaskDetailModal
  now calls it on mount)
- chat.test.ts and routes-agent-import.test.ts @fusion/core mocks lacked
  registerTraitHookImpl (engine merge-trait registers hooks at import)
- auto-merge-toggle-blank.mobile and board-mobile-initial-render used
  vi.runAllTimers(), which never terminates now that sse-bus starts a
  keepalive setInterval; use vi.runOnlyPendingTimers()

Both quality-backfill projects now pass fully: 7151/7151 across 414
files.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 23:02:58 -07:00
gsxdsm
7bbb8b650a feat(dashboard): fragment insertion, seam-conflict, and graph-copy helpers 2026-06-04 23:02:50 -07:00
gsxdsm
9a4343be26 feat(engine): fn_workflow_settings agent tool + settings declaration parity, plugin-sdk types, engine-tools docs 2026-06-04 22:57:01 -07:00
gsxdsm
9089e18705 feat(dashboard): WorkflowSettingsPanel — definitions/values tabs, setting-value routes, flow-mapping round-trip 2026-06-04 22:57:01 -07:00
gsxdsm
8a5fa66def feat(engine,dashboard): expose workflow authoring tools to chat and planning agents 2026-06-04 22:54:49 -07:00
gsxdsm
202083dcff Merge U16: shared PTY native-asset loader in engine + redactSecrets in core 2026-06-04 22:54:01 -07:00
gsxdsm
ea18ef8d44 feat(engine): extract shared PTY native-asset loader and redactSecrets (U16)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 22:53:02 -07:00
gsxdsm
ad5205f186 feat(core): add cli_sessions table and CliSessionStore (U1)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 22:52:20 -07:00
gsxdsm
b1ebb22010 Merge current main (fast-tests quality-backfill projects) into plugin install fixes 2026-06-04 22:43:52 -07:00
gsxdsm
e8e54bf343 feat(engine): per-task effective workflow settings — resolver, two-tier entry merge, fallback alignment 2026-06-04 22:37:51 -07:00
gsxdsm
02e53b24b6 Merge pull request #1425 from tomdurrant/fix/opencode-go-api-key-env
Fix opencode-go model sync — pass API key to CLI and strip prefix from model IDs
2026-06-04 22:36:08 -07:00
gsxdsm
d8ff8db759 feat(core,dashboard): lazy idempotent legacy-step migration into workflow templates 2026-06-04 22:33:25 -07:00
gsxdsm
28e74f10d6 feat(core): workflow kind discriminator and steps-to-IR converter 2026-06-04 22:18:36 -07:00
gsxdsm
db4cdc6f5c feat(core): workflow setting values store — per-(workflow,project) table, validating write authority, drop-on-orphan resolution 2026-06-04 22:12:38 -07:00
gsxdsm
784021e95c Tighten plugin install route tests to full entry-resolution contract (#1428)
- Bundled fallback assertions for dependency-graph/reports now require
  the bundled.js entry-file suffix instead of just containing the id
- Add route-level fallback cases for dist/index.js and src/index.ts

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 22:12:36 -07:00
gsxdsm
7dde43a63b Address PR review feedback (#1428)
- Add heal block to createPluginRouter's enable handler so it matches
  routes.ts (directory-path registrations re-pointed at entry files)
- Test the 400 "no loadable entry file" install branch
- Add a real-fs drift-guard test asserting the CLI and @fusion/core
  copies of resolvePluginEntryPath resolve identically

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 22:10:20 -07:00
gsxdsm
5e52f6a3f6 feat(dashboard): shared schema-driven settings UI primitives 2026-06-04 22:00:04 -07:00
gsxdsm
04d5e66d24 feat(core): workflow IR typed settings declarations with built-in moved-key catalog 2026-06-04 22:00:04 -07:00