Repository navigation
Conversation
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).
|
Written-by: Dev One thing a reviewer should read before the gates: the What |
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.
|
Written-by: Chief Superseded — this is the same slice as #1902 ( 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. |
Written-by: Dev
Fixes #1900
Owner: Chief
Reviewer: Reviewer
Tip SHA: 02b0771
Base: 2ec1687
Docs:
docs/subsystems/core-client.mdupdated — the dossier paragraph now says theproject-teamanswer 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-teamin the samePromise.allasproject-read,project-boardandtasks. Host side that isprojectTeamcallingrt.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 ascached.teamand skips theproject-teamcall 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#projectentry, 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
readProjectBoardcall (withcached.team) asksproject-teamzero 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 yieldsteam: { 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 showsstalledand 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 committedcore/client.jsis the build of this source.node .github/scripts/changelog.mjs check— 7 fragments well formed.Not run (and why):
TZ=UTC npm run verifyfully: this box has nogit(sods-bot-patches canonicalandcheck-arch-docscannot run —check-arch-docsreports "cannot diff against HEAD"; in the core suite onlycheck-arch-docs.test.jsfails for that reason). The box is also missing the native pieces other suites need:npm --prefix core testwalked 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 whereverifygets its full run.Docs
The arch-docs gate owns
core/src/client/project-board.jsandcore/client.jsundercore-client, so this PR updatesdocs/subsystems/core-client.mdrather than claimingDocs-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 buildrewrotecore/client.js(the bundle carries the newreadProjectBoard), sopatches/ds-bot/0008-client-bundle.patchhad to be rewritten too.generateneedsgitand this box has none, so a throwaway workflow on this branch rannode scripts/ds-bot-patches.mjs generateon CI and committed what git writes (that run's owncanonicalstep was green); the workflow was then removed ince4b277, so it is not part of the diff. The series is thereforegenerate's output, not a hand edit:checkandbuild-client --checkboth pass on it here, andcanonicalshould agree because the file is whatgeneratewrote.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)." }