fix(tests): the core half of #2783's bookkeeping — archived-gate inventory (#2817)

## The 6th red from #2783

#2814 cleared the 5 **engine** reds #2783 left on `main`. This is the
sixth, in **core** — I found it after #2814 was already open, and it
merged before I could fold this in.

```
archived-column-gate-parity > all three encodings of the archived gate stay in lockstep
                              with the audited inventory
AssertionError: TypeScript encoding changed.
```

## Same cause, same shape as #2786

#2783 converted three more sites off raw `column === "archived"`
comparisons and did not update the inventory in the same commit — which
the guard's own failure text explicitly asks for.

| file | before → after |
|---|---|
| `async-mission-store.ts` | 2 → 0 |
| `task-store/symbol-locks.ts` | 1 → 0 |
| `task-store/archive-lifecycle-2.ts` | 2 → 1 |

**Verified each is a real conversion, not a dropped gate.** All three
now seed a legacy lane set and extend it from the workflow:

```ts
const lanes = new Set<string>(["done", "archived"]);
…
for (const id of columnsWithFlag(ir, "archived")) lanes.add(id);
```

The literal still in `archive-lifecycle-2.ts:46` is `column: "archived"`
as a **move destination**, not a gate comparison — the same distinction
the planner-lane move targets get.

## Verified NOT a split-brain

That is the thing this file exists to catch — TypeScript moving to the
resolved role while the SQL sides keep comparing the raw string. The
**Drizzle and raw-sql inventories are unchanged and both pass**. Worth
stating explicitly because those assertions run *after* the TypeScript
one: a plain red tells you nothing about them, so they had to be re-run
green to know.

## One thing I nearly got wrong

My first edit was a whole-file string replace and it threw on an
assertion count. That turned out to be load-bearing: **these paths
appear in more than one inventory in this file** (`AUDITED_TS_SITES` and
the raw-sql inventory both list `async-mission-store.ts`). An unscoped
replace would have silently edited the raw-sql inventory too — making
the parity guard agree with itself and defeating the exact
cross-encoding check it exists for. The edit is now scoped to
`AUDITED_TS_SITES` by line range.

## Evidence

- Guard still bites: appending a real `task.column === "archived"` to an
audited file → **fails**.
- Core **4773 passed / 0 failed** · engine **10988 passed / 0 failed** ·
gate **732 green** · lint clean.

Test-only; `agent-store.ts` restored clean after the mutation.

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

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsxdsm
2026-07-30 12:49:27 -07:00
committed by GitHub
parent ba40942a10
commit d2f47acedd

View File

@@ -57,19 +57,17 @@ import { describe, expect, it } from "vitest";
const AUDITED_TS_SITES: Readonly<Record<string, number>> = {
"packages/core/src/agent-store.ts": 1,
"packages/core/src/async-mission-store-queries.ts": 2,
"packages/core/src/async-mission-store.ts": 2,
"packages/core/src/eval-signal-collector.ts": 1,
"packages/core/src/live-agent-count.ts": 1,
"packages/core/src/mission-store.ts": 1,
"packages/core/src/store.ts": 1,
"packages/core/src/task-merge.ts": 2,
"packages/core/src/task-store/archive-lifecycle-2.ts": 2,
"packages/core/src/task-store/archive-lifecycle-2.ts": 1,
"packages/core/src/task-store/async-comments-attachments.ts": 8,
"packages/core/src/task-store/audit-ops.ts": 1,
"packages/core/src/task-store/branch-and-pr-entities.ts": 1,
"packages/core/src/task-store/lifecycle-ops.ts": 1,
"packages/core/src/task-store/moves.ts": 1,
"packages/core/src/task-store/symbol-locks.ts": 1,
"packages/core/src/task-store/task-id-integrity.ts": 1,
"packages/core/src/task-store/update-task-deps.ts": 1,
};