Skip to content

#1900: read the team dossier once per board open, not on every poll - #1905

Closed
Birfy wants to merge 6 commits into
mainfrom
dev/1900-dossier-off-poll
Closed

Birfy wants to merge 6 commits into
mainfrom
dev/1900-dossier-off-poll

Conversation

@Birfy

@Birfy Birfy commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator

Written-by: Dev
Fixes #1900
Owner: Chief
Reviewer: Reviewer
Tip SHA: 02b0771
Base: 2ec1687
Docs: docs/subsystems/core-client.md updated — the dossier paragraph now says the project-team answer is taken once when the board opens and a failing dossier leaves the board drawn, and the four-reads paragraph says the other three reads are the ones that repeat.

What changed

Before: every five-second refresh of an open Project board re-read the whole team dossier — project-team in the same Promise.all as project-read, project-board and tasks. Host side that is projectTeam calling rt.memoryDigest(id) per row (readFileSync + readdirSync + persona + memory head), roughly 16 KB every 5 s, about 192 KB a minute per open board, for an answer that only changes when someone edits a persona or a memory file.

After: readProjectBoard(read, wanted, cached) takes the previous answer back as cached.team and skips the project-team call when it has one. The board's refresh effect holds the dossier answer in its own closure, so the open read takes it once and every poll after that draws that same answer — #1864's one-read property is what the team block still uses. The effect re-runs per #project entry, so re-opening the board reads the dossier again: a persona or memory edit lands on the next open, which the issue allows.

The #1814 tick test counted five reads a tick, dossier included; it now says four, and the panels test proves the second readProjectBoard call (with cached.team) asks project-team zero times more.

A failing dossier is now non-fatal. It used to reject the whole Promise.all, and the first paint turned that into "No Project yet — create one." A dossier that throws now yields team: { rows: [] } while rows, done, tasks, queues, decisions and meetings still draw; :873's early return stays reserved for a project that really is absent from the listing.

Verification at the tip

Tip SHA: 02b0771
Ran:

  • node --test core/test/project-board-panels.test.js — 19 pass / 0 fail.
  • node --test core/test/project-board*.test.js — 72 pass / 0 fail (the The Project board reads once when it opens, so a lease that expires while it is open never shows stalled and its counts freeze #1814 tick-count test was updated: a tick is now the four channels that change). Red first, same file against the base source blob: 17 pass / 2 fail (both new core-client: the board re-reads the whole team dossier on every 5s poll (about 192 KB per minute per open board) #1900 cases).
  • 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 — the committed core/client.js is the build of this source.
  • node .github/scripts/changelog.mjs check — 7 fragments well formed.
    Not run (and why):
  • TZ=UTC npm run verify fully: this box has no git (so ds-bot-patches canonical and check-arch-docs cannot run — check-arch-docs reports "cannot diff against HEAD"; in the core suite only check-arch-docs.test.js fails for that reason). The box is also missing the native pieces other suites need: npm --prefix core test walked 9 unrelated files to SIGABRT or a missing-module error (bot-messages, connector-access, connector-apps, connector-bots, connectors, delivery-write-failure, diagnostics, dsh-update, eval) and then stalled; no project-board file failed before it stalled. CI is where verify gets its full run.

Docs

The arch-docs gate owns core/src/client/project-board.js and core/client.js under core-client, so this PR updates docs/subsystems/core-client.md rather than claiming Docs-not-needed: the dossier paragraph now describes the once-per-open read and the non-fatal branch, and the "four host reads" paragraph names the three that still repeat. The same line is in the tip commit message.

Regenerated by build

npm --prefix core run build rewrote core/client.js (the bundle carries the new readProjectBoard), so patches/ds-bot/0008-client-bundle.patch had to be rewritten too. generate needs git and this box has none, so a throwaway workflow on this branch ran node scripts/ds-bot-patches.mjs generate on CI and committed what git writes (that run's own canonical step was green); the workflow was then removed in ce4b277, so it is not part of the diff. The series is therefore generate's output, not a hand edit: check and build-client --check both pass on it here, and canonical should agree because the file is what generate wrote.

Checkpoint

{
  "pr": 1905,
  "claim": "Chief",
  "issue": 1900,
  "summary": "readProjectBoard takes the previous dossier answer back as cached.team and skips the project-team call, so an open board reads the team dossier once when it opens and the five-second refresh draws that answer instead of re-reading ~16 KB per tick. A dossier read that throws is non-fatal: rows, done, tasks, queues and metrics still draw and only team gives up as rows: []. The empty-project answer stays reserved for a project absent from the listing. Re-opening the board or the pane reads the dossier again, so persona and memory edits still land.",
  "files": [
    "core/test/project-board-view.test.js",
    "docs/subsystems/core-client.md",
    "core/src/client/project-board.js",
    "core/test/project-board-panels.test.js",
    "core/client.js",
    "patches/ds-bot/0008-client-bundle.patch",
    "patches/ds-bot/files/src/client/project-board.js",
    "patches/ds-bot/files/test/project-board-panels.test.js",
    "changelog.d/1900-team-dossier-off-poll.changed.md"
  ],
  "checks": { "ran": "node --test core/test/project-board-panels.test.js (19 pass); ds-bot-patches check; build-client --check; changelog check", "result": "green", "at": "02b0771083cbc327e6b2ee4fe6bdd09ff064deea" },
  "next": "Review the read path and the non-fatal branch; confirm canonical where git exists (regenerate 0008 if it disagrees)."
}

readProjectBoard takes the previous dossier answer back as `cached.team` and
skips the `project-team` call when it has one, so the five-second refresh
(#1814/#1824) draws the answer the open read took instead of re-reading the
whole team dossier (host `projectTeam` calls `memoryDigest` per row: ~16 KB
every 5 s, ~192 KB/minute per open board).

A dossier read that throws is now non-fatal: rows, done, tasks and queues still
draw and only `team` gives up as `{ rows: [] }`. The empty-project answer stays
reserved for a Project that really is absent.

Red first in core/test/project-board-panels.test.js: with the base source the
two new cases fail (17 pass / 2 fail), with this tip they pass (19 / 0).
@Birfy Birfy added the agent-pr Pull request opened by an agent label Oct 31, 2026
@Birfy Birfy self-assigned this Oct 31, 2026
@Birfy

Birfy commented Oct 31, 2026

Copy link
Copy Markdown
Collaborator Author

Written-by: Dev

One thing a reviewer should read before the gates: the 0008-client-bundle.patch section for client.js was rewritten by hand on this box. node scripts/ds-bot-patches.mjs generate needs git and there is no git binary here (generate says so itself, #978's note). I wrote the stored form (old-side hunk hints, 80-column function hint, no index lines) and check confirms the series still reproduces core/: ok 10 patches apply cleanly in order, ok core/ equals ds-bot/ + patches/ds-bot/.

What check cannot prove is canonical (also git-only): my GNU-diff hunk split may not match the order generate writes. If the canonical gate is red on this tip, run node scripts/ds-bot-patches.mjs generate where git exists and amend the tip — the source diff, the tests and the changelog do not change.

Birfy and others added 5 commits October 31, 2026 15:05
docs/subsystems/core-client.md owns core/src/client/project-board.js, and the
arch-docs gate asks for it: the dossier paragraph now says the project-team
answer is taken once when the board opens (readProjectBoard's cached.team),
that the five-second poll draws it, and that a failing dossier leaves the board
drawn with team { rows: [] }. The four-reads paragraph says the other three
reads still repeat.

Docs-not-needed: not claimed — the subsystem doc is updated instead.
This box has no git, so patches/ds-bot/0008-client-bundle.patch was written by
hand and check passes, but canonical (git-only) cannot be satisfied from here.
This throwaway workflow runs node scripts/ds-bot-patches.mjs generate and
commits its output to this branch; it is removed in the next commit.

Docs-not-needed: the subsystem doc is updated in the parent commit.
patches/ds-bot/0008-client-bundle.patch is now what `node scripts/ds-bot-patches.mjs
generate` writes (that is what the removed workflow ran, with git, and its
canonical step was green). The workflow was a one-shot to get git into the
loop; it is not part of the change.

Docs: docs/subsystems/core-client.md is updated in this branch.
The #1814 test pinned the poll at five reads a tick, the dossier included. With
the dossier read once at open, a tick is the four channels that change; the test
now says so at the three places it counts.

Docs: docs/subsystems/core-client.md carries the change from the parent commits.
@Birfy

Birfy commented Oct 31, 2026

Copy link
Copy Markdown
Collaborator Author

Written-by: Chief

Superseded — this is the same slice as #1902 (dev/2-team-dossier-off-the-poll), which landed first: merged 2026-10-31T07:35:29Z as cf8388ebe7d951324756001bff8e4cf8aaa30695, and it closed #1900 at 07:35:31Z.

Nothing here is lost: both branches read the team dossier once per board open instead of on every poll. Closing this one so one issue does not carry two implementations; the branch can be deleted by its owner.

@Birfy Birfy closed this Oct 31, 2026
@github-actions github-actions Bot removed the agent-pr Pull request opened by an agent label Oct 31, 2026
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.

core-client: the board re-reads the whole team dossier on every 5s poll (about 192 KB per minute per open board)

1 participant