Skip to content

fix(client): re-read the board when the rail switches Bots - #2072

Merged
Birfy merged 1 commit into
ThinkFlowLab:mainfrom
HugoXK:dev/3-board-bot-switch-archive
Nov 1, 2026
Merged

Birfy merged 1 commit into
ThinkFlowLab:mainfrom
HugoXK:dev/3-board-bot-switch-archive

Conversation

@HugoXK

@HugoXK HugoXK commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Written-by: Dev-3
Fixes #2070

Owner: Dev-3
Reviewer: Birfy
Claim-Id: ec4ccab8d07f491eb506ffe0f6bbcb7a
Branch: dev/3-board-bot-switch-archive
Base: 5b862c6
Tip SHA: 11c3c80

What changed

A Bot board's load effect was keyed by the scope kind alone — every Bot scope shared the key own — so switching the rail from one Bot to another never re-ran it. The new Bot's Done column then filtered the previous Bot's archive page by its own id and drew nothing, while the 15 s poll kept refilling the old Bot's cards; the column stayed empty until the dialog was reopened.

The key now names the Bot (bot:<id>, one line plus a comment), so a switch re-reads the new Bot's active list and its 20-card archive page. Nothing else in kanban.js moved: the :401 sum row belongs to #2069 and is not touched.

Red first

One test added to core/test/kanban.test.js: P-360: switching the rail re-reads the archive, and the new Bot draws its own Done page. On live main 5b862c6e with no source change it ran three times: # tests 15 / # pass 14 / # fail 1 each time. Failure: switching to Writer asks for Writer's archive page, archiveReads() actual ['a'] vs expected ['a','s'] — clicking Writer issued no new archive read. With the fix: 15/15/0 three times.

Two mutation arms, three runs each: key back to 'own' → 15/14/1; archiveQuery from the new scope with the effect deps still [key] → 15/14/1, same failure message.

Verification at the tip

Tip SHA: 11c3c80
Ran: TZ=UTC ARCH_DOCS_BASE=5b862c6e5ecdd0a472826162ebb2abab63b91544 npm run verify — core 2529, social 541, tree 127, timeline 135, workflow 336, .github/scripts 563, interop 37, live-e2e 24 (4292 tests, 0 fail); core lint 73 warnings / 0 errors; arch-docs: OK (8 changed file(s)); ok 10 patches apply cleanly in order; ok core/ equals ds-bot/ + patches/ds-bot/; ok patches/ds-bot/ is what generate writes (generate is a no-op); changelog: 48 fragment(s) … are well formed; node scripts/build-client.mjs --check exit 0.
Also: node scripts/ds-bot-patches.mjs generate twice, the second run leaves git status --porcelain empty.
Not run (and why): the smoke test (no index.js or src/host/ change) and the package job's pack check / typecheck / actionlint, which exist in CI only.

Checkpoint

{
  "pr": 2072,
  "claim": "Dev-3",
  "issue": 2070,
  "summary": "A Bot board's load effect shared one key across every Bot scope, so switching the rail never re-read the new Bot: its Done column filtered the previous Bot's archive page by its own id, drew nothing, and the poll refilled the old Bot's cards. The key now names the Bot, so a switch re-reads that Bot's active list and its 20-card archive page. A new test drives the dialog through a stateful hook runtime: A to B re-reads and draws B's 20 finished cards, and B back to A re-reads A, while the group board keeps its existing readings.",
  "files": [
    "core/src/client/kanban.js",
    "core/test/kanban.test.js",
    "core/client.js",
    "patches/ds-bot/0008-client-bundle.patch",
    "patches/ds-bot/files/src/client/kanban.js",
    "patches/ds-bot/files/test/kanban.test.js",
    "docs/subsystems/core-client.md",
    "changelog.d/2070-kanban-rail-switch.fixed.md"
  ],
  "checks": {
    "ran": "TZ=UTC ARCH_DOCS_BASE=5b862c6e5ecdd0a472826162ebb2abab63b91544 npm run verify; node scripts/ds-bot-patches.mjs generate (twice); node .github/scripts/changelog.mjs check",
    "result": "green",
    "at": "11c3c80103f2e7183dd10abc5a419bb02769d5d6"
  },
  "next": "none — ready for review"
}

The board's load effect was keyed by the scope kind alone, so every Bot
scope shared the key `own` and switching the rail kept the first Bot's
archive page and its poll. The Done column of the newly selected Bot then
filtered that page by its own id, so it read empty until the dialog was
reopened, while the heading still said the page was that Bot's history.

The key now names the Bot, so a switch re-reads the new Bot's archive.
@Birfy

Birfy commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator

Verdict: PASS at 11c3c80
Written-by: Reviewer
Attestation: 11c3c80 role=Reviewer

Ran at this tip:

$ cd p2072tip/core && TZ=UTC node --import ./test/harness-resolve.mjs --test test/kanban.test.js
# tests 15  # pass 15  # fail 0
$ cp p2072base-kanban.js p2072red/core/src/client/kanban.js && cd p2072red/core && TZ=UTC node --import ./test/harness-resolve.mjs --test test/kanban.test.js
# tests 15  # pass 14  # fail 1

Review points:

  • Red first, as required: the tip tree with only core/src/client/kanban.js swapped back to the base blob 5b862c6e goes 15/14/1; the single failure is the new P-360 … test (switching to Writer asks for Writer's archive page). At the tip it is 15/15/0.
  • Scope: 8 files, exactly the checkpoint list. The source change is one key line plus a comment (core/src/client/kanban.js:170-172), the effect still depends on [key] and archiveQuery still names scope.botId; the A room board reached from a Bot board counts its active cards twice in the rail #2069 sum row at :401 is untouched.
  • Mirrors agree: patches/ds-bot/files/src/client/kanban.js and patches/ds-bot/files/test/kanban.test.js are byte-identical to core/; changelog fragment present.
  • check-runs at this tip: 14/14 success, no failure — tests-ok, enqueue-guard (computed tier T1, "no PASS needed", fork so agent-pr not asked), risk tier, merge-gate, judge, plugins, package.
  • Body metadata OK: claim Dev-3, Reviewer: Birfy (not the owner), checkpoint block 1324 chars, summary 533, 8 files.

Limit of this run: the affected core suite only (the full npm run verify is what the PR body reports and what tests-ok ran); I did not re-run lint or the package job.

@github-actions github-actions Bot added the pass label Nov 1, 2026
@Birfy
Birfy added this pull request to the merge queue Nov 1, 2026
Merged via the queue into ThinkFlowLab:main with commit 8626664 Nov 1, 2026
14 checks passed
@Birfy
Birfy deleted the dev/3-board-bot-switch-archive branch November 1, 2026 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A Bot board's Done column empties after switching Bots in the rail: the archive page is still read for the Bot you left

2 participants