Files
fusion/scripts/lib/lifecycle-column-census-baseline.json
gsxdsm 20878e9d5f census: count column: "<legacy>" query filters as a separate, separately-pinned instrument (backlog unchanged at 784) (#2650)
Pre-launch input for the 779-guard fleet. **The backlog number does not
move: 784 before, 784 after.** This adds a second number beside it.

## The problem it measures

A guard is not the only way a legacy column id decides behaviour:

```ts
const todo = await this.store.listTasks({ column: "todo", slim: true });
```

That is a **source query** — it selects the rows a sweep considers *at
all*. On a renamed or merged board it returns nothing, so a sweep whose
per-task predicate was correctly converted still does nothing, while
looking converted. `self-healing.ts:2849` names the pairing in prose,
and #2560 had to repair exactly that combination after a converted
predicate was left with a literal query.

The census walks comparison `BinaryExpression`s. A `PropertyAssignment`
is not one, so this class was invisible to the instrument **and to its
ratchet** — it could grow silently.

Measured: **83 query filters, 43 IR node definitions.**

I proved one live consequence earlier on #2648:
`recoverStuckMergeDeadlocks` cannot see a renamed board at all — the
renamed rows exist and none appear in its three-literal union
(`renamedInsideUnion=0`, on a live PG store).

## Why this matters *before* the fleet is briefed

The fleet rule is *"the baseline ratchet must shrink by exactly the
converted count."* In `self-healing.ts` — the largest batch at 111 —
both classes sit in the same functions, so today a worker either:

- converts only the comparisons → arithmetic is clean, and sweeps whose
source query still filters a dead literal stay blind; or
- converts the query too → the count does **not** move by the converted
amount, and a more-correct PR looks like a miscount.

The second punishes the better worker. With a second pinned number,
converting a query becomes visible work instead of an apparent error.

## Counted separately, deliberately

`totals.column` is a published shape — the baseline, the reporter, and
other workers' in-flight PRs read it, and the completion bar is defined
against it. Growing it would move a number the program is actively
driving to zero.

So the new counts live in `summary.properties` / `queryByFile`, under
their own baseline keys, with their own both-directions ratchet (same
rule as #2633's, including the stale-allowance half). `totals` keeps its
**exact** shape — two existing tests assert it with `toEqual`, and
breaking a contract others depend on mid-flight to add a number is not
worth it.

## Definitions are not queries

Workflow IR graph nodes carry `column:` to declare where a node lives —
`{ id: "review", kind: "...", column: "in-review" }`. That is the
lineage describing itself: not a lookup, not convertible, and ~43 of the
raw matches. They are told apart **structurally** (an `id`/`kind`
sibling in the same object literal), not by filename, so a definition
written anywhere classifies the same way.

## Baseline seeding, stated plainly

`--update-baseline` could not pin a **new** category: the regression
check runs before the write, and with no prior key every file reads as a
rise. I seeded the three new keys once, directly, leaving every guard
field byte-identical. The diff is purely additive — no removals.

## Finding, not caused by this change

**`--strict` is already red on clean main**:
`register-task-workflow-routes.ts` is **23** against a baseline of
**22**. Verified by stashing this branch and re-running on an unmodified
tree. Until that is reconciled the guard ratchet is passing nothing —
worth fixing before the fleet starts relying on it as the work order.

## Verification

- census suites **44 green**, 6 new cases: counted; kept out of the
backlog; definition-not-query; both instruments independent (a bug
routing comparisons into the query bucket would otherwise look clean on
both); `DELIBERATE-LITERAL` honoured; non-legacy id ignored
- `node scripts/lifecycle-column-census.mjs` → backlog still 784
- `pnpm lint` exit 0, `pnpm test:gate` exit 0 (695)

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 00:27:18 -07:00

197 lines
9.5 KiB
JSON

{
"generatedFrom": "node scripts/lifecycle-column-census.mjs --strict --update-baseline",
"totals": {
"column": 769,
"role": 5,
"status": 187,
"deliberate": 12
},
"byColumnId": {
"done": 201,
"in-progress": 146,
"in-review": 209,
"archived": 148,
"todo": 60,
"triage": 5
},
"byFile": {
"packages/engine/src/self-healing.ts": 110,
"packages/engine/src/executor.ts": 104,
"packages/dashboard/app/components/TaskCard.tsx": 42,
"packages/core/src/task-store/moves.ts": 39,
"packages/dashboard/app/components/TaskDetailModal.tsx": 30,
"packages/engine/src/scheduler.ts": 28,
"packages/dashboard/src/routes/register-task-workflow-routes.ts": 20,
"packages/core/src/store.ts": 12,
"packages/engine/src/project-engine.ts": 12,
"packages/dashboard/app/components/TaskContextMenu.tsx": 10,
"packages/engine/src/mission-execution-loop.ts": 10,
"packages/core/src/task-store/async-comments-attachments.ts": 9,
"packages/dashboard/src/github-tracking-comments.ts": 9,
"packages/dashboard/src/github-tracking-reconciler.ts": 9,
"packages/engine/src/notification/notification-service.ts": 9,
"packages/cli/src/commands/dashboard.ts": 8,
"packages/cli/src/commands/task.ts": 8,
"packages/core/src/default-workflow-hooks.ts": 7,
"packages/core/src/task-store/update-task-deps.ts": 7,
"packages/dashboard/app/components/Column.tsx": 7,
"packages/core/src/live-agent-count.ts": 6,
"packages/core/src/task-merge.ts": 6,
"packages/core/src/task-store/branch-group-ops.ts": 6,
"packages/core/src/task-store/task-artifacts-ops.ts": 6,
"packages/dashboard/app/components/ListView.tsx": 6,
"packages/dashboard/src/reliability-metrics.ts": 6,
"packages/engine/src/runtimes/in-process-runtime.ts": 6,
"packages/cli/src/extension.ts": 5,
"packages/core/src/task-store/merge-queue-ops-2.ts": 5,
"packages/dashboard/app/hooks/useTaskDiffStats.ts": 5,
"packages/engine/src/agent-tools.ts": 5,
"packages/engine/src/merger.ts": 5,
"packages/engine/src/restart-recovery-coordinator.ts": 5,
"packages/core/src/agent-store.ts": 4,
"packages/core/src/blocker-fanout.ts": 4,
"packages/core/src/task-age-staleness.ts": 4,
"packages/core/src/task-store/task-store-helpers.ts": 4,
"packages/dashboard/app/components/TaskReviewTab.tsx": 4,
"packages/dashboard/app/components/taskSorting.ts": 4,
"packages/dashboard/src/gitlab-tracking-comments.ts": 4,
"packages/dashboard/src/routes/register-git-github.ts": 4,
"packages/engine/src/agent-heartbeat.ts": 4,
"packages/engine/src/replan-target.ts": 4,
"packages/engine/src/triage.ts": 4,
"packages/engine/src/usage-limit-detector.ts": 4,
"packages/core/src/async-mission-store-queries.ts": 3,
"packages/core/src/async-mission-store.ts": 3,
"packages/core/src/task-priority.ts": 3,
"packages/core/src/task-store/async-merge-coordination.ts": 3,
"packages/core/src/task-store/task-update.ts": 3,
"packages/dashboard/app/components/DockTaskList.tsx": 3,
"packages/dashboard/app/components/TaskChangesTab.tsx": 3,
"packages/dashboard/app/components/TaskChatTab.tsx": 3,
"packages/dashboard/app/utils/taskActivity.ts": 3,
"packages/dashboard/app/utils/worktreeGrouping.ts": 3,
"packages/dashboard/src/chat.ts": 3,
"packages/dashboard/src/routes/register-chat-routes.ts": 3,
"packages/engine/src/gridlock-detector.ts": 3,
"packages/engine/src/planner-overseer.ts": 3,
"packages/engine/src/worktree-pool.ts": 3,
"packages/cli/src/commands/dashboard-tui/app.tsx": 2,
"packages/core/src/assigned-task-ranking.ts": 2,
"packages/core/src/duplicate-intake.ts": 2,
"packages/core/src/near-duplicate-canonical.ts": 2,
"packages/core/src/node-override-guard.ts": 2,
"packages/core/src/task-move-disposer.ts": 2,
"packages/core/src/task-store/archive-lifecycle-2.ts": 2,
"packages/core/src/task-store/audit-ops.ts": 2,
"packages/core/src/task-store/comments-ops.ts": 2,
"packages/core/src/task-store/project-store-ops.ts": 2,
"packages/core/src/task-store/reads.ts": 2,
"packages/core/src/task-store/symbol-locks.ts": 2,
"packages/core/src/task-store/task-id-integrity.ts": 2,
"packages/core/src/team-analytics.ts": 2,
"packages/core/src/workflow-analytics.ts": 2,
"packages/dashboard/app/components/Board.tsx": 2,
"packages/dashboard/app/components/command-center/MissionControlPanel.tsx": 2,
"packages/dashboard/app/components/DocumentsView.tsx": 2,
"packages/dashboard/app/components/effective-model-resolution.ts": 2,
"packages/dashboard/app/components/WorkflowResultsTab.tsx": 2,
"packages/dashboard/app/utils/prFeedback.ts": 2,
"packages/dashboard/app/utils/taskRevert.ts": 2,
"packages/dashboard/app/utils/taskTiming.ts": 2,
"packages/dashboard/src/github-tracking-state.ts": 2,
"packages/dashboard/src/routes/register-project-routes.ts": 2,
"packages/dashboard/src/routes/register-session-diff-routes.ts": 2,
"packages/dashboard/src/routes/register-system-maintenance-routes.ts": 2,
"packages/dashboard/src/server.ts": 2,
"packages/engine/src/agent-reflection.ts": 2,
"packages/engine/src/auto-merge-finalization.ts": 2,
"packages/engine/src/cli-agent/state-machine.ts": 2,
"packages/engine/src/merger-scope-auto-widen.ts": 2,
"plugins/fusion-plugin-even-cards/src/cards/board-cards.ts": 2,
"plugins/fusion-plugin-reports/src/store/report-store.ts": 2,
"packages/cli/src/commands/pr.ts": 1,
"packages/core/src/eval-automation.ts": 1,
"packages/core/src/eval-signal-collector.ts": 1,
"packages/core/src/in-review-stall.ts": 1,
"packages/core/src/mission-store.ts": 1,
"packages/core/src/plugin-store.ts": 1,
"packages/core/src/stalled-review-detector.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/merge-queue-ops.ts": 1,
"packages/core/src/task-timing.ts": 1,
"packages/dashboard/app/components/ChangesDiffModal.tsx": 1,
"packages/dashboard/app/components/command-center/liveSnapshotMetrics.ts": 1,
"packages/dashboard/app/components/DevServerView.tsx": 1,
"packages/dashboard/app/components/MergeDetails.tsx": 1,
"packages/dashboard/app/components/PrPanel.tsx": 1,
"packages/dashboard/app/components/ResearchTaskActionModal.tsx": 1,
"packages/dashboard/app/components/RoutingTab.tsx": 1,
"packages/dashboard/app/components/TaskPlannerChatTab.tsx": 1,
"packages/dashboard/app/hooks/useExecutorStats.ts": 1,
"packages/dashboard/app/hooks/useTasks.ts": 1,
"packages/dashboard/app/utils/columnRoles.ts": 1,
"packages/dashboard/app/utils/inReviewStallCopy.ts": 1,
"packages/dashboard/app/utils/quickAddStart.ts": 1,
"packages/dashboard/app/utils/stalePausedReviewCopy.ts": 1,
"packages/dashboard/app/utils/taskStuck.ts": 1,
"packages/dashboard/src/github-issue-comment.ts": 1,
"packages/dashboard/src/gitlab-issue-comment.ts": 1,
"packages/dashboard/src/gitlab-source-issue-reconciler.ts": 1,
"packages/dashboard/src/knowledge-index-refresh.ts": 1,
"packages/dashboard/src/planning-board-tools.ts": 1,
"packages/dashboard/src/research-routes.ts": 1,
"packages/dashboard/src/routes/register-agent-core-routes.ts": 1,
"packages/dashboard/src/task-planner-chat-context.ts": 1,
"packages/dashboard/src/task-planner-chat-metrics.ts": 1,
"packages/dashboard/src/test/mockCoreEngine.ts": 1,
"packages/engine/src/auto-recovery-handlers/branch-worktree.ts": 1,
"packages/engine/src/backlog-pressure-reporter.ts": 1,
"packages/engine/src/cli-agent/task-session.ts": 1,
"packages/engine/src/ephemeral-worker-manager.ts": 1,
"packages/engine/src/merger-integration-worktree.ts": 1,
"packages/engine/src/merger-orphan-rehome.ts": 1,
"packages/engine/src/plugin-runner.ts": 1,
"packages/engine/src/pr-comment-handler.ts": 1,
"plugins/fusion-plugin-even-realities-glasses/src/notifications/diff.ts": 1,
"plugins/fusion-plugin-reports/src/store/report-types.ts": 1
},
"properties": {
"query": 83,
"definition": 43
},
"queryByColumnId": {
"todo": 10,
"archived": 7,
"done": 10,
"in-progress": 19,
"in-review": 35,
"triage": 2
},
"queryByFile": {
"packages/engine/src/self-healing.ts": 48,
"packages/engine/src/project-engine.ts": 7,
"packages/engine/src/backlog-pressure-reporter.ts": 3,
"packages/core/src/task-store/async-persistence.ts": 2,
"packages/core/src/task-store/merge-queue-ops.ts": 2,
"packages/core/src/task-store/moves.ts": 2,
"packages/engine/src/executor.ts": 2,
"packages/engine/src/stale-task-reporter.ts": 2,
"packages/cli/src/extension.ts": 1,
"packages/core/src/async-mission-store.ts": 1,
"packages/core/src/eval-automation.ts": 1,
"packages/core/src/store.ts": 1,
"packages/core/src/task-store/archive-lifecycle-2.ts": 1,
"packages/core/src/task-store/async-archive-lineage.ts": 1,
"packages/core/src/task-store/async-self-healing.ts": 1,
"packages/core/src/task-store/task-artifacts-ops.ts": 1,
"packages/core/src/task-store/task-store-helpers.ts": 1,
"packages/dashboard/src/routes/register-gitlab.ts": 1,
"packages/engine/src/agent-tools.ts": 1,
"packages/engine/src/auto-merge-finalization.ts": 1,
"packages/engine/src/restart-recovery-coordinator.ts": 1,
"packages/engine/src/scheduler.ts": 1,
"packages/engine/src/workflow-node-handlers.ts": 1
}
}