Skip to content

Test that the board rail counts the list the board draws - #2087

Merged
Birfy merged 1 commit into
ThinkFlowLab:mainfrom
HugoXK:dev/1-kanban-scope-counts
Nov 2, 2026
Merged

Birfy merged 1 commit into
ThinkFlowLab:mainfrom
HugoXK:dev/1-kanban-scope-counts

Conversation

@HugoXK

@HugoXK HugoXK commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #2086

Written-by: Dev-1
Owner: Dev-1
Reviewer: Birfy
Claim-Id: d666ef54f2b14bc7bff2e774871e5fc9
Branch: dev/1-kanban-scope-counts
Base: fca35af
Tip SHA: d799eb7

What happens today

#2069 fixed the rail so a room board counts the room's list and a Bot board counts its own, at core/src/client/kanban.js:422:

for (const task of [...(scope?.kind === 'group' ? groupTasks : own), ...(archive ?? []).slice(0, ARCHIVE_SHOWN)]) {

Nothing in core/test/kanban.test.js pins that branch. The existing room fixture boardWith(...) fills own with the same cards it puts into groupTasks, so both arms of the ternary produce the same numbers and a single-arm change stays green. Measured on live main fca35af6 with only the source changed:

// kanban.js:422, made constant:
for (const task of [...(own), ...(archive ?? []).slice(0, ARCHIVE_SHOWN)]) {

→ core/test/kanban.test.js 21 tests / 21 pass / 0 fail, exit 0, three runs identical. The #2069 fix can be undone with a fully green file.

The change

One case and its fixture, in two mirrored files (core/test/kanban.test.js and patches/ds-bot/files/test/kanban.test.js, the generated mirror), +96 / −0. No source file is touched.

  • boardWithLists(scope, own, groupActive, archive = []) seeds the two lists apart, which the existing boardWith cannot do in a room scope.
  • P-364: the rail counts the list the board draws, never the one the other scope left behind has one arm per direction. A room board whose own still holds the Bot board's read (one card for Writer) while the room's list holds Writer's three and Chief's one must read 0/3 for Writer and 0/1 for Chief, who appears only in the room's list. A Bot board whose room list still holds four cards while own holds two must read 0/2, not 0/4.

Red first (on base fca35af6)

Only the new case added, source untouched:

  • as-is → 22 tests / 22 pass / 0 fail, exit 0, three runs identical.
  • kanban.js:422 made constant own → 22 / 21 / 1, three runs identical, exit 1. The red is not ok 15 - P-364: the rail counts the list the board draws, never the one the other scope left behind: '0/1' !== '0/3' — "the room board counts the room's three, not the stale single card".
  • kanban.js:422 made constant groupTasks → 22 / 18 / 4, three runs identical, exit 1. The red is test 15's Bot arm plus the three existing Bot-board cases: #2045: a page that is not full still reads as the whole history, unchanged (11), #2045: the rail hedge follows the Bot's drawn done rows, not its total (13) and #2069: a room board reached from a Bot board counts each active card once in the rail (17).

Both directions are therefore bitten, and neither mutation can hide behind the other's arm.

Verified

TZ=UTC ARCH_DOCS_BASE=fca35af6f29a10214f239b78a2087b82845ba4ce npm run verify, on the committed tree → exit 0: core 2558/2558, social 541, tree 127, timeline 135, workflow 336, .github/scripts 575, interop 37, live-e2e 24. Lint: core 73 warnings / 0 errors, the other four packages 36 / 9 / 2 / 16 warnings and 0 errors, interop 1 warning / 0 errors, live-e2e 0 / 0. arch-docs: OK (2 changed file(s)) — the two files this branch changes and no others.

Also green on the same tree: node scripts/ds-bot-patches.mjs check (10 patches apply cleanly in order; core/ equals ds-bot/ + patches/ds-bot/) and node core/scripts/build-client.mjs --check.

Which tree the checks ran on

Local commit a22f6542a6c8fc7b695e7d562af59237ae183b04, tree 8fc6072d0045f370a1c2d80b9f707591cf8d9145, single parent fca35af6f29a10214f239b78a2087b82845ba4ce.

Verify and arch-docs ran on that checkout. The pushed head d799eb757785aa31cadb6eebd41bc672ec70f5a4 was rebuilt from the same 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 in scope

  • core/src/client/kanban.js is unchanged. The ternary has been correct since #2069; this PR only adds the case that reds when it is changed, as the issue scoped it.
  • No changelog fragment and no subsystem doc: nothing user-visible changes.

Not run

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

Checkpoint

{
  "pr": 2087,
  "claim": "Dev-1",
  "issue": 2086,
  "summary": "The rail counts a room board from groupTasks and a Bot board from own (#2069), but no test could tell the two lists apart: the existing room fixture seeds both with the same cards, so a constant own stayed 21 of 21 green. A new case seeds them apart and asserts 0/3 for a Writer with three room cards, not the stale 0/1, and 0/2 on the Bot board, not the leftover 0/4. Each mutation reds it (always own 22/21/1, always groupTasks 22/18/4) and the unmutated file is 22/22, with no source file touched.",
  "files": [
    "core/test/kanban.test.js",
    "patches/ds-bot/files/test/kanban.test.js"
  ],
  "checks": {
    "ran": "npm run verify (ARCH_DOCS_BASE=fca35af6, core 2558, .github/scripts 575) exit 0; core/test/kanban.test.js 22/22 x3; mutants always own 22/21/1 x3, always groupTasks 22/18/4 x3",
    "result": "green",
    "at": "d799eb757785aa31cadb6eebd41bc672ec70f5a4"
  },
  "next": "none — ready for review"
}

`counts` reads `groupTasks` on a room board and `own` on a Bot board, but every
case that reached a room seeded `own` with the same cards, so a change to either
side of that branch stayed green: counts hard-wired to `own` kept 21/21.

Seed the two lists apart — a stale Bot board read beside a room's list, and a
room list still in state on a Bot board — and assert the rail's number from the
list the board actually draws.
@HugoXK

HugoXK commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

d799eb7

@Birfy — review request for this tip, once.

Test-only change (core/test/kanban.test.js + its patches/ds-bot mirror, +96/−0, no source file touched): it adds the case that bites when core/src/client/kanban.js:422 counts the wrong board list. On live main fca35af6 the case is absent and a constant own leaves the file 21/21 green — the #2069 fix can be undone with a full-green file. With the case: 22/22; mutant always-own 22/21/1; mutant always-groupTasks 22/18/4 (three identical runs each). npm run verify exit 0 (core 2558, .github/scripts 575), ds-bot-patches check and build-client --check green.

CI is complete here: 14/14 check runs success at this sha (enqueue-guard, merge-gate, judge, package, four plugins, agent-audience, reviewed tip, ubuntu-latest · Node 24), mergeable: true, maintainer_can_modify: true. No verdict at this tip yet. One ping, no follow-up from me.

@HugoXK

HugoXK commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

Self-test: PASS at d799eb7
Written-by: FlyBot Test
as of my read: 1 comment, newest 6566436079

Advisory only — not a review, no Verdict:; the repository reviewer's verdict is the authority. Test-only change: core/test/kanban.test.js + patches/ds-bot/files/test/kanban.test.js, 2 files +96/−0, source untouched (git diff --stat base→tip shows exactly those two files, 96 insertions).

Ran (all at d799eb75…, tree 8fc6072d…, single parent fca35af6f29a10214f239b78a2087b82845ba4ce = live main):

  • tip, TZ=UTC node --import ./test/harness-resolve.mjs --test test/kanban.test.js ×3 → 22 / 22 / 0 each run.
  • kanban.js:422 made constant own → 22 / 21 / 1 ×3, red not ok 15 - P-364: the rail counts the list the board draws… with the room board counts the room's three, not the stale single card / '0/1' !== '0/3'. Same line is :422 on base and tip, since the source file is byte-identical between them.
  • kanban.js:422 made constant groupTasks → 22 / 18 / 4 ×3, red #11 (#2045 history unchanged), #13 (#2045 rail hedge), #15 (new case, Bot arm), #17 (#2069 room reached from a Bot board).
  • the gap itself, reproduced: base's own 21-test file (test/kanban.test.js from fca35af6, source mutated, new case removed) + constant own → 21 / 21 / 0 ×3; the same file + constant groupTasks → 21 / 18 / 3 (that direction was already caught before this PR).
  • extra arm: the pre-#2069 double count [...own, ...groupTasks] → 22 / 18 / 4 with the new file and 21 / 18 / 3 without it, i.e. already red before — so the real gap this PR closes is the own direction, as the body says.
  • TZ=UTC ARCH_DOCS_BASE=<local base commit> npm run verify → exit 0: core 2558/2558, social 541, tree 127, timeline 135, workflow 336, .github/scripts 575, interop 37, live-e2e 24; core lint 73 warnings / 0 errors, plugins 36 / 9 / 2 / 16 / 0 errors, interop 1 warning / 0 errors, live-e2e 0 / 0; arch-docs: OK (2 changed file(s)); changelog: 3 fragment(s); mojibake: ok — 0 occurrences of U+FFFD in 1358 text file(s); checkpointReasons(body,{pr:2087,files}) → [].
  • mirrors: node scripts/ds-bot-patches.mjs check → ok 10 patches apply cleanly in order, ok core/ equals ds-bot/ + patches/ds-bot/; node core/scripts/build-client.mjs --check exit 0; a real ds-bot-patches generate rewrote the mirror and cmp shows it byte-identical to core/test/kanban.test.js, with no tracked file changed afterwards.

Why the old file could not see it: the room fixture seeds own from the room's own list (botRead = scope?.kind === 'group' ? groupActive : own, core/test/kanban.test.js:331 at base), so both arms of the ternary produce the same counts there. The new boardWithLists seeds the two lists apart and asserts both directions (0/3 over a stale 0/1 in a room, 0/2 over a leftover 0/4 on a Bot board), which is what makes each single-arm mutation red above. The new case is appended after the existing 0/1 P-364 case; base's 21 tests are untouched (pure append, no deletions).

Not verified: real browser DOM/screenshot and clipboard; smoke and bench (nothing under core/index.js or core/src/host/ changed); packaged Desktop; Windows; the CI package job (pack / typecheck / actionlint); enqueue-guard (covered by tests-ok on this sha, not re-runnable locally).

@Birfy
Birfy added this pull request to the merge queue Nov 2, 2026
Merged via the queue into ThinkFlowLab:main with commit 6f1c016 Nov 2, 2026
14 checks passed
@Birfy
Birfy deleted the dev/1-kanban-scope-counts branch November 2, 2026 01:29
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 rail: the P-364 counts branch (room list vs own) has no test that bites

2 participants