Commit Graph

13 Commits

Author SHA1 Message Date
gsxdsm
1f5c44ac71 FN-8826: restore WIP lifecycle badges
Restore visible lifecycle badges for empty-status tasks in WIP lanes.

- Derive fallback badge labels from resolved workflow WIP traits and lane names
- Render the fallback consistently on board cards and desktop/mobile list rows
- Cover empty, custom-lane, populated, and paused status precedence

Files changed:
 .changeset/fn-8826-dashboard-wip-badge.md          |  7 +++
 packages/dashboard/app/components/ListView.tsx     | 37 +++++++++++--
 packages/dashboard/app/components/TaskCard.tsx     | 19 +++++--
 .../app/components/__tests__/ListView.test.tsx     | 61 ++++++++++++++++++++++
 .../app/components/__tests__/TaskCard.test.tsx     | 38 +++++++++++++-
 .../dashboard/app/utils/taskStatusBadgeLabel.ts    | 24 +++++++++
 6 files changed, 177 insertions(+), 9 deletions(-)

Fusion-Task-Id: FN-8826

Fusion-Task-Lineage: fd9c857a-a25f-44d0-ae66-502bc1bd860e

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-07 20:33:42 -07:00
gsxdsm
fa3df0f6bd FN-8798: synchronize planning status across task views
Keep board, list, and task detail planning indicators consistent with fresh lifecycle state.

- preserve authoritative task snapshots across SSE and detail refreshes
- render transient replan planning only for fresh, unpaused planner activity
- pass global pause state to every task-detail host and cover status convergence

Files changed:
 packages/dashboard/app/App.tsx                     |   2 +
 packages/dashboard/app/components/AppModals.tsx    |   3 +
 packages/dashboard/app/components/ListView.tsx     |  11 +-
 packages/dashboard/app/components/TaskCard.tsx     |   7 +-
 .../dashboard/app/components/TaskDetailModal.tsx   |  27 ++-
 .../app/components/__tests__/AppModals.test.tsx    | 201 +++++++++++++++++++--
 .../app/components/__tests__/ListView.test.tsx     |  31 ++++
 .../app/components/__tests__/TaskCard.test.tsx     |  17 ++
 .../app/components/dashboard/MainContent.tsx       |   1 +
 .../__tests__/useTasks-hydration-freshness.test.ts |  58 +++++-
 .../dashboard/app/hooks/__tests__/useTasks.test.ts |  29 ++-
 packages/dashboard/app/hooks/useTasks.ts           |  51 +++++-
 .../utils/__tests__/taskStatusBadgeLabel.test.ts   |  22 ++-
 .../dashboard/app/utils/taskStatusBadgeLabel.ts    |  36 ++++
 14 files changed, 453 insertions(+), 43 deletions(-)

Fusion-Task-Id: FN-8798

Fusion-Task-Lineage: 7defae4e-fb39-4d2c-943a-ef6c1a164bfc

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-04 21:57:00 -07:00
gsxdsm
cb57093d03 refactor: domain folder layout (types, API, core, engine) (#2398)
## Summary

Wave 17 organizes Fusion into **domain folders** (stacks on #2397).

### Layout
- **core/types/** — board, task, agents, settings, merge, workflow,
mesh, …
- **core/src/** — agents, ai, async-stores, workflows, tasks, config,
db, …
- **dashboard/app/api/** — client, tasks, agents, git, missions,
planning, …
- **engine/src/** — agents, auth, execution, merge, missions, overseer,
worktree, …

Root keepers retained for large entrypoints (`store.ts`, `executor.ts`,
`merger.ts`, …).

Public barrels (`@fusion/core`, `@fusion/engine`, `app/api.ts` → legacy)
stay stable.

## Test plan
- [x] `@fusion/core` typecheck
- [x] `@fusion/engine` typecheck (pre-existing playwright-core noise
only)
- [ ] CI merge gate

**Stack:** #2394 → #2397 → **this PR**
2026-08-03 00:20:53 -07:00
gsxdsm
7e4e892fce fix(dashboard): one queued badge family — map raw 'queued', fold queued-to-plan into the status badge
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-31 20:33:34 -07:00
gsxdsm
500f40e65b fix: descriptive waiting badges (Queued to revise / Queued behind FN-X) + dependency-free blocked exits replan calmly
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-31 17:37:38 -07:00
gsxdsm
dc50425e98 docs: correct 104 future-dated FNXC timestamps across 61 files (#2680)
## What

The FNXC convention exists so a reader can place a note against the
change that motivated it. A stamp dated *after* the edit landed defeats
exactly that.

This is program-wide drift, not one author's slip — I contributed to it
in my own commits this week, which is how I noticed it.

## Measured, on this tree

**104 stamps across 61 files** dated later than the day they were
written, from one day ahead to **2026-10-19 (81 days)**:

| count | date | count | date | count | date |
|---|---|---|---|---|---|
| 50 | 2026-07-31 | 6 | 2026-08-05 | 3 | 2026-08-13 |
| 17 | 2026-08-01 | 1 | 2026-08-07 | 1 | 2026-08-19 |
| 7 | 2026-08-02 | 1 | 2026-08-12 | 2 | 2026-08-26 |
| 11 | 2026-08-03 | | | 3 | 2026-10-19 |

An earlier number I circulated was ~70. That came from a narrower
pathspec and was wrong; **104** is the measurement.

## How

Each stamp is rewritten to the date of the commit that introduced **that
line**, via per-line `git blame` — deliberately *not* stamped uniformly
with today's date. A uniform stamp swaps a wrong date for a different
wrong date and flattens the ordering that makes these comments
navigable; blame preserves it. Times of day are untouched, and a blame
date in the future is clamped rather than trusted.

## Why the verification is listed

A docs sweep across 61 files is precisely where a stray edit hides, so
the safety claims are mechanical rather than asserted:

- every changed line begins with a comment marker — **no code touched**;
- **no test asserts an FNXC date later than today**, so no `toContain`
assertion on embedded source text can be silently invalidated (several
such assertions do exist);
- CSS files, which carry several of those assertions, are outside the
pathspec.

## Verified

lint clean · merge gate green (487 + 158 + 10 + 71) · `census --strict`
exit 0 · tsc clean for core, engine, and dashboard
(`tsconfig.app.json`).

**No behavior change.** Comment text only.

## Not done here

A guard preventing recurrence. A check that rejects an FNXC stamp dated
after the commit would stop this returning, but it needs a decision
about where it runs (lint rule vs. gate) and it is a behavior change to
CI — it does not belong riding inside the sweep it would police.
2026-07-30 02:38:58 -07:00
gsxdsm
99c9f14ee0 feat: run Plan Review in the planning lane with a Plan Review badge (#2462)
## What

Plan Review, planning, and the replan loop move from the implementation
column into the **planning lane** (`todo`), so a task under
specification never holds a WIP slot. The card crosses into
`in-progress` exactly once, at `parse`, released by the scheduler.

Operators also finally see a **Plan Review** badge while the gate runs —
it was previously invisible on the default workflow.

## The part that made it possible

Moving the node is ten lines. It was attempted three times and reverted
each time, because a graph run with no durable continuation replayed
from `start` and dragged an in-progress card *backward* out of the WIP
column, firing `abort-on-exit` and stranding it in a pre-WIP column with
no releaser.

So this PR adds the graph **entry contract** —
`resolveColumnResumeNode`:

| Card is in | Resumes at |
|---|---|
| `triage` | `start` |
| `todo` | `plan` |
| `in-progress` | `parse` — never re-plans, never moves backward |
| `in-review` | first review node — gates are not skipped |

`ir.columns` is ordered and that order is the lifecycle order; rework
and failure edges are excluded so the entry point is always the main
path. The proof it's the right fix: **`executor-task-done-invariant`
passes unmodified** after failing every previous attempt.

## Also in here

- **Release gate narrowed twice.** `isUnplannedForExecution` applies its
pre-release plan-review gate only when the node's column equals the
card's column *and* the group is enabled for the task. The enablement
check fixes a real deadlock — a task with Plan Review toggled off was
held forever waiting for evidence nothing would ever write.
- **Badge cleanup.** Gate badge reads "Plan Review" instead of the
ambiguous "Reviewing" and no longer hides behind a lane restriction; the
status badge stops duplicating it; `planning` renders as "Planning"
instead of the raw engine token.
- **Coding (Ideas)** renames its planner column to "Planning" (id `todo`
unchanged) and loses its private planning-node re-home — the graph it
clones is already plan-in-place.
- **New sweep** `reconcileUndeclaredTaskColumns` re-homes a row whose
column its workflow no longer declares. Written for a follow-up, kept
because it makes any column edit survivable.

## Test changes

Scheduler and release fixtures now model a card whose Plan Review passed
— the state every real card is in when the capacity sweep sees it. A
held unreviewed card is the gate working, and that path stays owned by
`pre-release-plan-review.test.ts`.

New `workflow-graph-entry-contract.test.ts` covers the invariant at
every lifecycle position, plus the gap-column and remediation-node
cases.

## Verification

Gate 299 + 70 + 10, dashboard badge suites 672, engine
workflow/entry/executor suites 147, core 122. Lint and typecheck clean.
Full engine suite sits at the pre-existing baseline (notifier /
plugin-runner / notification-service, untouched by this).

## Follow-up

Removing the Todo column entirely is a separate ~207-site
lifecycle-vocabulary refactor — planned in
`docs/plans/2026-07-26-001-refactor-workflow-owned-lifecycle-plan.md`
(companion docs PR).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Plan Review now runs in the Planning lane before implementation
begins.
* Cards resume from their current workflow column without replaying
earlier steps.
* Added automatic recovery for cards stranded in outdated workflow
columns.
* **Improvements**
  * Renamed the Coding (Ideas) planner column to “Planning.”
* Refined Plan Review gating to respect enabled settings and the card’s
current column.
* Updated planning and Plan Review badges for clearer, consistent labels
across cards and lists.
* **Bug Fixes**
* Improved workflow transitions and release behavior around planning,
review, and execution.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-26 23:42:46 -07:00
gsxdsm
395f1364d6 FN-8493: show revising status badges
Rename the needs-replan badge to Revising across dashboard task views.

- Map needs-replan status badges to the Revising translation.
- Update English resources and generated resource types.
- Cover board cards and desktop/mobile list rows with regression tests.
- Add a patch changeset for the operator-facing copy fix.

Files changed:
 .changeset/fn-8493-revising-status-badge.md        |  7 ++++++
 .../app/components/__tests__/ListView.test.tsx     | 25 ++++++++++++++++++++++
 .../app/components/__tests__/TaskCard.test.tsx     | 13 +++++++++++
 .../utils/__tests__/taskStatusBadgeLabel.test.ts   |  6 ++++--
 .../dashboard/app/utils/taskStatusBadgeLabel.ts    |  8 +++----
 packages/i18n/locales/en/app.json                  |  4 ++--
 packages/i18n/src/resources.d.ts                   |  4 ++--
 7 files changed, 57 insertions(+), 10 deletions(-)

Fusion-Task-Id: FN-8493

Fusion-Task-Lineage: 569d271b-48f9-42f4-83f8-4e9f86fdab68

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-22 09:32:02 -07:00
gsxdsm
69bd64d950 FN-8475: show planning status badges in Todo
Restore truthful planning status badges for Coding Ideas tasks across Todo views.

- Replace column-based planning badge suppression with real-status detection
- Render planning badges in board cards and desktop/mobile list rows
- Add regression coverage and a patch changeset

Files changed:
 .changeset/fn-8475-planning-status-badge.md        |  7 ++++
 packages/dashboard/app/components/ListView.tsx     | 11 +++---
 packages/dashboard/app/components/TaskCard.tsx     |  7 ++--
 .../app/components/__tests__/ListView.test.tsx     | 40 ++++++++++++++--------
 .../app/components/__tests__/TaskCard.test.tsx     | 10 +++---
 .../utils/__tests__/taskStatusBadgeLabel.test.ts   | 33 +++++++++---------
 .../dashboard/app/utils/taskStatusBadgeLabel.ts    | 16 ++++-----
 7 files changed, 70 insertions(+), 54 deletions(-)

Fusion-Task-Id: FN-8475

Fusion-Task-Lineage: 98bff84e-bee7-4e3c-b7b2-e0a24709576b

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-22 00:15:54 -07:00
gsxdsm
b2a7425c76 refactor(cutover 3/3): dashboard + changesets — IR-driven lifecycle cutover (#2335)
Completes the IR-driven lifecycle cutover: **the workflow IR becomes the
single source of truth for task lifecycle.** Node column assignments
move cards at runtime, every lifecycle predicate re-keys on column
traits instead of literal column ids, and the graph exclusively owns
review gates.

Plan (the spec for this work):
[`docs/plans/2026-07-18-001-refactor-ir-driven-lifecycle-cutover-plan.md`](docs/plans/2026-07-18-001-refactor-ir-driven-lifecycle-cutover-plan.md)

## What changed

**IR as runtime authority (R1, R2).** Graph traversal crossing a node
column boundary moves the card through the store's trait-hook `moveTask`
path, attributed `workflowMoveSource: "workflow-graph"` and emitting
`task:column-transition`. This replaces the executor's hardcoded
`moveTask(id, "in-review")` merge boundary and its handoff-invariant
allowlist. Scheduler, hold/release, self-healing, merger and
finalization now key on column traits
(`intake`/`hold`/`wip`/`merge-blocker`/`human-review`/`merge`/`complete`/`archived`/`timing`/`abort-on-exit`/`reset-on-entry`/`stall-detection`),
with rebound targets resolved per KTD-10.

**Single ownership of review gates (R4, R5).** Triage's out-of-graph
Plan Review gate is deleted; the graph is the sole author. `pending`
step results are CAS-claimed leases with owner and staleness floor
(KTD-4), so a crash/restart re-entry can no longer dispatch a second
reviewer and silently discard the losing verdict.

**Graph ownership is unconditional (R9).** The legacy execute fallback
is gone: `maybeExecuteWorkflowGraph` is now `executeWorkflowGraph`
returning `void`, `graphCompletion` is a required parameter, and a store
that cannot resolve a workflow fails closed rather than silently running
nothing. Also deleted, with a tombstone ratchet: `fn_review_step` and
its RETHINK/session-rewind machinery, `workflow-cutover.ts`,
`workflow-authoritative-driver.ts`, `workflow-parity-observer.ts`, and
the `graphCompletionInterceptors` map.

**`reviewLevel` becomes a creation-time preset (R6)** writing
`enabledWorkflowSteps`, with zero runtime reads.

**Upgrade path (R10).** Migration 0026 adds the durable per-node-entry
IR pin (KTD-3) and the one-time adoption stamp (KTD-8);
`planLegacyAdoption` is the single shared decision run by both the
startup sweep and the store-open reconcile, so pre-cutover rows are
adopted instead of freezing. A stale-binary guard refuses to open a
database migrated by a newer binary.

**Operator surfaces (R2, R11).** Four places still closed the column
set: the dashboard coerced every ingested task's column through the
legacy six-id enum (a card in a custom `Merging` column rendered in
**Triage**), `POST /tasks/:id/move` answered 400 for any
workflow-defined column, retry/reset/re-engage/unassign/spec-revise used
hardcoded move targets, and GitHub issue open/closed mapping
literal-compared `done`/`archived`. All now resolve from the task's
workflow by trait, each with a legacy fallback so `builtin:coding` is
byte-identical.

## Evidence

`builtin:coding` keeps its column ids and observable behavior
byte-compatible (R8, KTD-7), pinned by a characterization oracle. A new
**6-column benchmark acceptance suite** drives a user-authored workflow
— `Ideas → Todo → In-progress → In-review → Merging → Done` — asserting
the ordered transition trail, single-mover at the hold→wip seam (KTD-2),
column-role purity (R12), bounded review cycles from workflow config,
and park-in-place on failure (R3). The same fixture is proven
**editor-buildable** through the real save-validation path, plus
negative cases.

Verified locally on this branch, post-rebase:

- `pnpm test:gate` — green (engine-core 294/294, pg-gate 126/126,
ci-workflow 63/63)
- characterization oracle 59/59, tombstones 5/5, 6-column benchmark
11/11
- `tsc --noEmit` clean for `@fusion/core`, `@fusion/engine`,
`@fusion/dashboard` (both `tsconfig.json` and `tsconfig.app.json`)

## Known reds

- **`executor-task-done-invariant` → "moves a cleanly completed task to
in-review via the merge-node boundary"** — red on this branch. A
real-Postgres test whose graph re-entry rebounds the card to
`in-progress` after `execute()` returns. Not in the merge gate, so it
does not gate CI. Honest status: I could **not** verify it green on
pristine `main` — running main's tests in this worktree reuses built
artifacts and produced obviously polluted results, so I am not claiming
"pre-existing". It needs its own look.
- **`html2canvas` / FN-8309 — fixed here by deleting dead code.**
`packages/dashboard/app/utils/capture-screenshot.ts` imported
`html2canvas`, which is not a dependency of `@fusion/dashboard` and is
**not in `pnpm-lock.yaml` at all**, so it had never compiled in CI. The
file had **zero importers**. Main never caught it because PR Checks runs
only on pull requests (main's last PR Checks run was in June) while
main's own pushes run just the non-blocking Full Suite — so the required
**Typecheck** check was failing on *every* PR against main, including
this one. Inherited from `88b0db0f4` (FN-8309). **To restore when the
feature lands its dependency properly:** `git checkout 88b0db0f4 --
packages/dashboard/app/utils/capture-screenshot.ts` and add
`html2canvas` to `packages/dashboard/package.json` in the same change.
- **pg-gate rotating contention** — historically a different file set
each run with zero assertion failures. It passed 126/126 on the final
run here.

Two entries that were on the provisional ledger turned out **not** to be
pre-existing and are fixed in this PR: the
`workflow-graph-optional-step-fix` replan-cap pair were stale assertions
against U3's own contract change (cap-exhausted now *parks*
awaiting-approval and reports handled, rather than silently leaving the
task in place), and `executor-column-agent-seams` /
`executor-fast-mode-workflows` are green.

## Deferred follow-ups

- **Graph does not suspend at the ready-for-release seam.** A parked
`onNodeEntry` returns `void` and the node executes anyway, so within one
walk the card can run In-progress work while still displayed in Todo.
The benchmark models the scheduler explicitly for this reason and says
so at the seam. Making the graph actually suspend is U4-scope follow-up.
- **`needs-replan` reader migration.** Post-U3 the durable write happens
at the graph's own `plan-replan` seam, so the workflow *is* the writer
and the 14 readers form one coherent graph-owned loop — it is the
graph's durable replan signal wearing a legacy name, not un-migrated
legacy. The adoption census guard requiring that literal in
`executor.ts` is correct and stays. Migrating those readers to a
purpose-built run-state signal is a post-cutover naming change with its
own risk budget.
- **U9b seam-node refinement.** The merge substates
(`merging`/`merging-pr`/`merging-fix`) are adopted as `resume-graph`
rather than mapped to an exact re-entry node; naming a precise node
would require resolving the task's IR, which the adoption module
deliberately cannot do.

🤖 Generated with [Claude Code](https://claude.com/claude-code)


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Workflows now drive task lifecycle columns, transitions, capacity
limits, review gates, and completion behavior—including custom
workflows.
* Tasks created with review levels automatically receive the
corresponding workflow review steps.
* Legacy in-progress tasks are automatically recovered during upgrades.
  * Dashboard status badges now show the active workflow step name.
* Added safeguards for workflow changes, review ownership, database
compatibility, and workflow validation.

* **Bug Fixes**
  * Fixed custom-column rendering and task movement.
* Improved merge-boundary handling and completion for workflows without
merge steps.
* Prevented cards from stalling, moving backward, or exceeding pooled
WIP capacity.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-19 12:09:12 -07:00
gsxdsm
7f175b036b FN-8195: label replan task status
Display the needs-replan task state with a clear localized operator-facing label.

- Map needs-replan status badges to Replan centrally.
- Add English i18n resources and generated resource typings.
- Cover the status-label mapping and add a patch changeset.

Files changed:
 .changeset/fn-8195-replan-badge.md                                | 7 +++++++
 .../dashboard/app/utils/__tests__/taskStatusBadgeLabel.test.ts    | 4 ++++
 packages/dashboard/app/utils/taskStatusBadgeLabel.ts              | 8 ++++++++
 packages/i18n/locales/en/app.json                                 | 2 ++
 packages/i18n/src/resources.d.ts                                  | 2 ++
 5 files changed, 23 insertions(+)

Fusion-Task-Id: FN-8195

Fusion-Task-Lineage: 7ad115b8-6405-426e-9201-bfa1258fff5e

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-17 01:07:52 -07:00
gsxdsm
30aaab209c FN-8170: suppress stale planning status badges
Hide stale planning badges from Todo and In Progress task surfaces.

- Centralize the planning badge suppression predicate.
- Apply it to board cards and desktop/mobile list views.
- Cover suppressed and preserved status badge behavior.

Files changed:
 packages/dashboard/app/components/ListView.tsx     | 11 +++--
 packages/dashboard/app/components/TaskCard.tsx     | 16 +++++--
 .../app/components/__tests__/ListView.test.tsx     | 53 ++++++++++++++++++++++
 .../app/components/__tests__/TaskCard.test.tsx     | 40 ++++++++++++++++
 .../utils/__tests__/taskStatusBadgeLabel.test.ts   | 21 ++++++++-
 .../dashboard/app/utils/taskStatusBadgeLabel.ts    | 14 ++++++
 6 files changed, 147 insertions(+), 8 deletions(-)

Fusion-Task-Id: FN-8170

Fusion-Task-Lineage: e2a00154-8537-4eb3-aadb-45b42f13f15b

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-16 20:45:40 -07:00
gsxdsm
e172b13612 fix(dashboard): never show raw landing/reviewing on task status badges
Share one badge label mapper for board and list so AI-merge pipeline
statuses always display as Merging… instead of engine strings.
2026-07-15 10:39:57 -07:00