Files
fusion/packages/core
gsxdsm 107a1e790a fix(core): the review lane was resolved for two stall signals and literal for the other two (#3053)
## Claim

Largest **unclaimed** census cluster. `self-healing.ts` (56) is the
capacity worker's file and `scheduler.ts` (12) is blocked (below), so I
took **@fusion/core** — 16 bare guards across 12 files, untouched by any
open PR.

## Census before / after

```
before:  COLUMN guards (the backlog):   126
after:   COLUMN guards (the backlog):   126
```

**Unchanged, and that is the honest result — not a failed conversion.**
The repo's sanctioned device is an optional *resolved* parameter whose
default stays the legacy literal (the exemplar is
`restart-recovery-coordinator.ts`, watched by the unwired-lane-parameter
guard). The literal survives as the default arm, so the counter cannot
see the conversion.

**This matters for the fleet phase.** The census is not a progress meter
for this pattern. A worker driving the number down has only two ways to
move it, and both are wrong:

1. **Delete the fallback** (make the parameter required) — prior review
explicitly argued against this; `cli-active-count-lanes.test.ts`
deliberately covers the no-argument path.
2. **"Convert" with `resolveTaskWorkflowIrSync`** — that reader returns
`undefined` unconditionally under PostgreSQL, the shipped backend. It
drops the count while behaving *exactly* like the literal. That is the
inert-conversion class, and `merge-queue-ops-2.ts:53` already carries a
flag note saying so.

I measured the split across all 126: **18 are fallback arms of
already-converted seams; 108 are bare guards.** The headline number
conflates them.

## What changed

`reads.ts` states the invariant in its own words —

> RESOLVED BEFORE THE FIRST SIGNAL, because two adjacent signals must
not disagree.

— and then called two of the four stall signals with the literal:

| signal | before |
|---|---|
| `getInReviewStallReason` | resolved (`reviewColumns`) |
| `getInReviewStalledSignal` | resolved (`reviewColumns`) |
| `detectStalledReview` | **literal `"in-review"`** |
| `hasFreshAgentLogActivitySinceTaskUpdate` | **literal `"in-review"`**
|

On a renamed board `stalledReview` returned `undefined` for every card,
and the fresh-activity gate answered `false` — so `executingTaskIds`
stayed empty and the board showed Stalled / Merge stalled *while a
merger was visibly streaming*, the precise regression that function's
own FNXC note says it was restored to prevent.

Both now take an optional resolved `reviewColumns`. All four hydration
passes pass the set **they already had in scope one line away**; two
needed only a hoist, one reused the per-row map, one was resolving the
same set inline twice.

## Mutation evidence

| Mutant | Result |
|---|---|
| baseline | 11 passed |
| revert the detector guard to the literal | **2 failed** |
| make the parameter a widening (`reviewColumns ? true`) | **2 failed**
|

The second matters: it proves the new parameter is a real gate and not a
change that merely makes every card eligible. Both arms are asserted,
since the literal default is load-bearing for every caller outside
`reads.ts`.

## Flagged — do not guess

- **`scheduler.ts` (12 guards).** All 12 sit inside *synchronous*
listeners (`task:moved`'s sync prologue; `task:updated` is sync
outright). The only sync resolver available,
`resolveTaskParkedColumnsSync`, is already used at lines 929/1130/1157
and is **inert under PostgreSQL** — my own live-PG E2E proves it always
returns the default board. "Converting" these with it would drop the
census by 12 and change nothing. The existing note at 908–926 names the
real unblock: carry resolved lanes on the event payload so no listener
resolves at all. Left alone.
- **`restart-recovery-coordinator.ts` (4)** — already the
optional-parameter device with all three production callers passing
resolved answers. Not backlog.
- **`reads.ts:358`, `audit-ops.ts:208`, `task-id-integrity.ts:444`** —
`"archived"` here is the *cold-storage tier*, not the board column.
Trait resolution would be wrong.

## Verification

`test:gate` exit 0 · full `@fusion/core` unit suite **4880 passed** ·
typecheck exit 0 · `pnpm lint` clean · lifecycle-column census exit 0 ·
FNXC date ratchet exit 0 · lane-wiring census exit 0.

**One unrelated failure to report, not appeased:**
`src/__tests__/postgres/pg-test-harness-template-concurrency.pg.test.ts`
fails under the full suite and **passes in isolation on both my tree and
the untouched baseline** — a pre-existing full-suite concurrency flake
in the PG harness. Not mine, not in the merge gate. I did not quarantine
it: it is another worker's harness, and AGENTS.md warns that
quarantining a concurrency test can mask a real product race. Flagging
for its owner.
2026-07-31 02:39:33 -07:00
..
2026-07-26 18:11:47 -07:00