Files
fusion/packages
gsxdsm fdd958efc9 fix(test): the archived-gate parity guard could not see an aliased table (red on main) (#2768)
`archived-column-gate-parity` is red on main after #2745 converted three
TypeScript sites. Fixing the stale inventory is the small half. **The
guard had a hole, and it is the interesting part.**

## The hole

The SQL scan required the predicate's receiver to be literally
`<x>.tasks`:

```ts
ne(schema.project.tasks.column, "archived")   // seen
const table = schema.project.tasks;
ne(table.column, "archived")                  // INVISIBLE
```

So `branch-group-ops.ts:58` was **never audited**. The inventory claimed
six files; seven exist.

A parity guard that cannot see one of the encodings reports agreement it
never checked — the exact failure mode this file was written to prevent,
occurring inside the file itself.

## And that site is not hypothetical

`#2745` converted `branch-group-ops`'s **TypeScript** half to the
resolved role. Its **SQL** half still compares the raw string. On a
board whose archived lane is renamed, the two disagree — one says a task
is archived, the other returns it as live. That is the split-brain
described in the guard's own failure message, and the guard could not
see it.

## The fix

Alias bindings (`const <id> = <...>.tasks`) are collected per file in a
first pass — first pass because the binding can appear *after* its uses
inside nested closures — and accepted as the receiver.
`branch-group-ops.ts` joins `AUDITED_SQL_SITES` as **newly visible, not
newly written**.

Also drops the three TypeScript entries #2745 converted
(`blocker-fanout`, `branch-group-ops`, `task-store-helpers`) — that is
the red itself.

## Measured, both directions

| mutation | result |
|---|---|
| alias set emptied (the old, alias-blind scan) | **1 failed** —
"Drizzle encoding changed" |
| product SQL half converted to a resolved lane | **1 failed** —
"Drizzle encoding changed" |
| as shipped | **2 passed** |

The first proves the scanner fix is load-bearing. The second proves the
newly-audited site is genuinely *counted*, not merely listed in an
inventory.

Two earlier mutation attempts produced no output and I discarded them
rather than reading them as passes — they had broken the file's syntax,
so nothing ran. A mutation that fails to compile proves nothing, and
looks identical to a clean run when output is filtered.

Gate **726**, core `tsc` clean, lint clean.

## Left for the owner of #2745

Whether `branch-group-ops.ts:58`'s SQL half should now be converted too.
The guard's own header explains why the SQL halves cannot simply be
converted (`ne(tasks.column, ...)` needs the resolved id as a value,
which the call sites do not all have), so this is a real design question
rather than a mechanical follow-up — and it is now *visible* and
*audited* instead of silently absent.
2026-07-30 08:48:21 -07:00
..
2026-07-26 18:11:47 -07:00