Skip to content

Pin every terminal status the board reads in the kanban suite - #2090

Merged
Birfy merged 1 commit into
ThinkFlowLab:mainfrom
HugoXK:dev/3-kanban-terminal-statuses
Nov 2, 2026
Merged

Birfy merged 1 commit into
ThinkFlowLab:mainfrom
HugoXK:dev/3-kanban-terminal-statuses

Conversation

@HugoXK

@HugoXK HugoXK commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #2088

Written-by: Dev-3
Owner: Dev-3
Reviewer: Birfy
Claim-Id: 43b662f1ccbe42cdaa7cecd4225ac2f8
Branch: dev/3-kanban-terminal-statuses
Base: fca35af
Tip SHA: fa76ec7

What happens today

finishedAt in core/src/client/kanban.js stamps a Done card from the first entry in task.actors whose status is in TERMINAL_STATUSES (accepted, cancelled, failed), and columnOf in core/src/shared/task-board.js maps those same three statuses to Done. The suite only ever exercised accepted: narrowing the set to ['accepted'] on live main left core/test/kanban.test.js at 21 tests / 21 pass / 0 fail, three runs identical. A cancelled or failed card could lose its finish time — or leave the Done column — with the file green.

The change

Two files, +98 / −0, the mirror byte-identical to the source test. No implementation change: the behaviour is correct today, this pins it.

  • core/test/kanban.test.js (+49): four characterization cases.
    • a cancelled card is terminal: it sits in Done and says when it was cancelled
    • a failed card is terminal: it sits in Done and says when it failed
    • a blocked or result-ready card is not terminal and stays In progress
    • a non-terminal actor entry does not end a Done card, even when it comes first
  • patches/ds-bot/files/test/kanban.test.js (+49): what generate writes.

No source, doc or changelog change: nothing user-visible changes.

Red first

On base fca35af6, sources unchanged except TERMINAL_STATUSES narrowed to ['accepted']:

Seven mutations, each applied alone on fca35af6 and reverted to 25/25 before the next:

mutation result case that bites
cancelled out of TERMINAL_STATUSES 25 / 24 / 1 #22 a cancelled card is terminal…
failed out of TERMINAL_STATUSES 25 / 24 / 1 #23 a failed card is terminal…
cancelled out of COLUMN_OF 25 / 24 / 1 #22 (a cancelled card is drawn in Done)
failed out of COLUMN_OF 25 / 24 / 1 #23 (a failed card is drawn in Done)
blocked added to TERMINAL_STATUSES 25 / 24 / 1 #25 a non-terminal actor entry does not end…
result-ready mapped to Done 25 / 24 / 1 #24 a blocked or result-ready card is not terminal…
claimed added to TERMINAL_STATUSES 25 / 24 / 1 #25 a non-terminal actor entry does not end…

Verified

TZ=UTC ARCH_DOCS_BASE=fca35af6f29a npm run verify → exit 0: core 2561, social 541, tree 127, timeline 135, workflow 336, .github/scripts 575, interop 37, live-e2e 24 (4336 tests, 0 fail); core lint 73 warnings / 0 errors; arch-docs: OK (2 changed file(s)); ok 10 patches apply cleanly in order; ok core/ equals ds-bot/ + patches/ds-bot/; build-client.mjs --check green. generate ran twice and the second run left git status --porcelain empty.

Which tree the checks ran on

One commit, single parent. Local commit 95a1c56e2b2c5d65610097b0c2efaac1d2bb019a, tree 6f1ce5cb955940a7a1898680f4cda9546f59b0fc, parent fca35af6f29a10214f239b78a2087b82845ba4ce. The pushed head fa76ec79a007a8f718810afe5498d552af276813 was rebuilt from that tree by the push path, so its sha differs while its tree does not; checks.at names the pushed tip, which is what CI reads.

Not run

The smoke test (nothing under core/index.js or core/src/host/ changed) and the packaged Desktop install path.

Checkpoint

{
  "pr": 2090,
  "claim": "Dev-3",
  "issue": 2088,
  "summary": "`finishedAt` stamps a Done card from the first terminal entry in `actors` and `columnOf` maps accepted, cancelled and failed to Done, but the suite only exercised `accepted`: narrowing the set to `['accepted']` left all 21 cases green. Four characterization cases now pin cancelled and failed as terminal (each stamping from its own entry), blocked and result-ready as not terminal (still In progress), and a non-terminal entry sorting earlier as not taking the stamp. Two of them fail when the set loses cancelled or failed, and seven single mutations each red exactly one case.",
  "files": [
    "core/test/kanban.test.js",
    "patches/ds-bot/files/test/kanban.test.js"
  ],
  "checks": {
    "ran": "TZ=UTC ARCH_DOCS_BASE=fca35af6f29a npm run verify (core 2561, 0 fail); node --test core/test/kanban.test.js 25/25 x3; 7 mutations each 25/24/1",
    "result": "green",
    "at": "fa76ec79a007a8f718810afe5498d552af276813"
  },
  "next": "none — ready for review"
}

`finishedAt` stamps a Done card from the first terminal entry in `actors`, and
`columnOf` maps all three terminal statuses to Done, but the suite only ever
exercised `accepted`. Narrowing the set to `['accepted']` left all 21 cases
green, so a `cancelled` or `failed` card could lose its stamp unnoticed.

Four cases pin each branch: `cancelled` and `failed` are terminal and stamp
from their own entry, `blocked` and `result-ready` stay In progress, and a
non-terminal entry sorting earlier does not take the stamp.
@HugoXK

HugoXK commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

Self-test: PASS at fa76ec7
Written-by: FlyBot Test
as of my read: 0 comments, newest none

Ran: tree rebuilt from the PR's tree (6f1ce5cb955940a7a1898680f4cda9546f59b0fc, single parent, base tree d8ae6d05a2792a7de358b60cf4188fa166e24977 = fca35af6f29a10214f239b78a2087b82845ba4ce), then TZ=UTC ARCH_DOCS_BASE=<local base sha> npm run verify at the repo root.
Ran: cd core && node --import ./test/harness-resolve.mjs --test test/kanban.test.js, three runs per arm, every mutation applied alone and reverted.
Ran: node scripts/ds-bot-patches.mjs generate twice, node scripts/ds-bot-patches.mjs check, node core/scripts/build-client.mjs --check.

Readings — every number in the body reproduced:

One claim is one status wider than the test. The comment at core/test/kanban.test.js:746-748 (tip) says adding open, claimed, working, blocked or result-ready to TERMINAL_STATUSES would be caught, but the fixture at :750-757 starts at claimed. Adding open to the set alone leaves the file at 25/25/0 x3, and the whole core suite at 2561/2561 with core/client.js rebuilt — nothing anywhere bites. open is a real first actor entry (core/src/host/tasks.js:697, :936, :1111, :1432 write actors: [{ status: 'open', at }]), so that mutation would stamp a Done card with its creation time. The hole is one fixture line wide: prepending { status: 'open', at: Date.now() - 330 * MINUTE } to that array turns the same mutation red at 25/24/1 (#25, '5 h' !== '2 h'). The COLUMN_OF direction has no such hole (open: 'done' reds 11 cases). Not blocking: either add that entry or drop open from the comment.

Interaction with #2087: the two touch different regions (that PR inserts at core/test/kanban.test.js:435, this one appends at :711); a three-way merge of both tips is clean and yields 26 tests with no conflict markers.

Not verified: real browser DOM/screenshot/clipboard, smoke/bench, packaged Desktop, Windows, the CI package job (pack/typecheck/actionlint), and enqueue-guard (not rerunnable on this box). Local commit 95a1c56e2b2c5d65610097b0c2efaac1d2bb019a is HTTP 422 on GitHub; the body already says the pushed head was rebuilt from the same tree, so that is consistent, not a contradiction.

@Birfy
Birfy added this pull request to the merge queue Nov 2, 2026
Merged via the queue into ThinkFlowLab:main with commit 7166f5a Nov 2, 2026
14 checks passed
@Birfy
Birfy deleted the dev/3-kanban-terminal-statuses branch November 2, 2026 01:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

kanban: the terminal-status set (cancelled/failed) has no test that bites

2 participants