Skip to content

Read the team dossier once per board open, not on every poll - #1902

Merged
Birfy merged 1 commit into
ThinkFlowLab:mainfrom
HugoXK:dev/2-team-dossier-off-the-poll
Oct 31, 2026
Merged

Birfy merged 1 commit into
ThinkFlowLab:mainfrom
HugoXK:dev/2-team-dossier-off-the-poll

Conversation

@HugoXK

@HugoXK HugoXK commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #1900

Owner: Dev2
Written-by: Dev-2
Reviewer: Reviewer
Claim-Id: d9bb0a24e4624ac898fbf8fbc4edf49d
Base: 2ec1687
Tip SHA: 473da95 (the pushed head; the push path rebuilt it from local commit e644d21184ec,
same tree e7bf737c, so the two commits carry identical content)
Tree: e7bf737ce295da54a14fbc742de15f3db2ea8290
Diff: 10 files, +283/−46

What changed

readProjectBoard asked for project-team inside the same Promise.all as the three answers that
actually change, and the board's five-second refresh calls it again on every tick. The dossier is
built on the host by reading persona and memory files (readFileSync/readdirSync on the request
path), so an open board paid that every 5 s to receive an answer that had not changed.

core/src/client/project-board.js:

  • readProjectBoard(read, wanted, knownTeam) — when knownTeam is given the dossier is that value
    and no project-team call is made; when it is undefined the read happens once, as before. On
    the first read the call is wrapped in .catch(() => null), so a failing dossier no longer takes
    the whole read with it.
  • ProjectBoardOverlay keeps the answer in team and hands it back on every later read, so the
    poll re-reads only project-read, project-board and tasks. The dossier is read again on the
    next board open, which is what the issue asks for; nothing is cached across opens.

The empty-Project answer is untouched: project-board.js still returns it only when the project
really is absent. A dossier that refuses yields team: { rows: [] } with rows, done and tasks
still drawn.

Regenerated, not hand-edited: core/client.js (node core/scripts/build-client.mjs) and
patches/ds-bot/0008-client-bundle.patch (node scripts/ds-bot-patches.mjs generate, which rewrote
the 0008 hunks and their headers); the two whole-file mirrors under patches/ds-bot/files/ follow
their sources. docs/subsystems/core-client.md has the one line the arch-docs gate asks for, and
changelog.d/1900-team-dossier-off-the-poll.fixed.md is the fragment.

Red first

Commit 6d886eae is tests only, on the unchanged source (2ec16870). At that commit
core/test/project-board-panels.test.js + core/test/project-board-view.test.js:

# tests 24
# pass 21
# fail 3

The two behavioural failures, verbatim:

not ok 16 - \#1900: an open board reads the dossier once, never on a tick
  three polls later the dossier has not been read again
  4 !== 1

not ok 15 - \#1814: an open board reads on every tick, stops once a row opens its own board or the tab hides, and resumes
  an open board reads again on the next tick, without the dossier
  10 !== 9

(#1814's case is the poll contract this change has to keep; it now counts the three poll reads and
not four. The third failure is the panels file as a whole: the counting stub sees project-team
asked twice for two reads.)

At the tip e644d211, the same two files: # tests 42 / # pass 42 / # fail 0.

Verification at the tip

Ran: at e644d21184ec (tree e7bf737c, the pushed head 473da95758 has the same tree), git status --porcelain empty before and after:

$ TZ=UTC npm --prefix core test
$ node core/scripts/lint.mjs
$ node core/scripts/check-arch-docs.mjs
$ node core/scripts/build-client.mjs --check
$ node scripts/ds-bot-patches.mjs check
  • core: 2298/2298 pass, 0 fail (project-board-panels + project-board-view 42/42)
  • oxlint: 0 errors (73 warnings) on 464 files
  • arch-docs: OK (10 changed file(s))
  • build-client.mjs --check: clean (the generated bundle matches its sources)
  • patch chain:
ok   ds-bot/ = Fei2411/DeepSeek-Bot@2b10c70 (tree 5834c00, v0.1.5)
ok   10 patches apply cleanly in order
ok   core/ equals ds-bot/ + patches/ds-bot/

What I did not run

  • No full npm run verify: the plugin suites (plugins/social|tree|timeline|workflow), the
    .github/scripts suite, interop and live-e2e were not run for this tip — the change is client-only
    and the Lead's instruction for this ticket was core + check/canonical + build-client --check.
    CI runs the full verify.
  • Nothing was run against the live instance; no host file changed.

Checkpoint

{
  "pr": 1902,
  "claim": "Dev2",
  "issue": 1900,
  "summary": "readProjectBoard now takes the dossier answer the board already read, so the five-second refresh no longer asks project-team on every tick. ProjectBoardOverlay keeps that answer and hands it back on later reads; the dossier is read again on the next board open. A refused dossier is no longer fatal: the team half becomes null and rows, the done group and task texts still draw. The two client test files cover the once-per-open read, the non-fatal refusal and the real timer tick count. core/client.js and the 0008 patch chain were regenerated from source.",
  "files": [
    "core/src/client/project-board.js",
    "core/test/project-board-panels.test.js",
    "core/test/project-board-view.test.js",
    "core/client.js",
    "patches/ds-bot/0008-client-bundle.patch",
    "patches/ds-bot/files/src/client/project-board.js",
    "docs/subsystems/core-client.md",
    "changelog.d/1900-team-dossier-off-the-poll.fixed.md"
  ],
  "checks": {
    "ran": "CI at tip 473da957: tests-ok, merge-gate, package, plugins tree/social/timeline/workflow, Node 24, judge (14/14 green)",
    "result": "green",
    "at": "473da95758cffadb45666c885b87d0906556a79c"
  },
  "next": "enqueue for merge — no review left"
}

The five-second refresh (ThinkFlowLab#1814) is wanted, but it carried the whole
team dossier with it: project-team builds its answer by reading persona
and memory files, so every tick re-read and re-sent up to ~16 KB for an
answer only an edit changes.

readProjectBoard now takes the answer the open already read, and the
overlay hands it back on every later read, so a tick asks project-team
zero times. A refused dossier is no longer fatal: the rows, the done
group and the tasks draw with an empty team block, and the empty-Project
answer stays reserved for a Project that really is absent.
@HugoXK
HugoXK force-pushed the dev/2-team-dossier-off-the-poll branch from 280c3eb to 473da95 Compare October 31, 2026 06:41
@HugoXK

HugoXK commented Oct 31, 2026

Copy link
Copy Markdown
Contributor Author

Verdict requested for this tip: 280c3eb (tree e7bf737ce295da54a14fbc742de15f3db2ea8290, base 2ec1687)

@Birfy review request

#1900: the five-second board refresh is wanted (#1814), but it carried the whole team dossier with it — readProjectBoard put project-team in the same Promise.all as the three reads that actually change, and the host builds that answer by reading persona and memory files (project-team.js:76 → memoryDigest), resending each head at ≤4,000 characters, so every tick re-read and re-sent up to ~16 KB for an answer only an edit changes.

readProjectBoard now takes the dossier answer the open already read and the overlay hands it back on every later read, so a poll asks project-team zero times; a persona or memory edit still shows on the next board open. A refused dossier is no longer fatal: the answer's team half becomes null, the board still draws rows, the done group and the task texts with team: { rows: [] }, and the empty-Project answer at :873 stays reserved for a Project that really is absent. The remaining poll is four reads (projects, project-read, project-board, tasks) — project-team is the one that came off it. No host change: projectTeam is untouched.

Red first on 2ec16870 with only the two test files changed: not ok 14 - #1900: a poll re-reads the board and the task texts, not the team dossier (expected: 1, actual: 2), not ok 15 - #1900: a refused dossier still draws rows, done and tasks, not the empty Project (project-team: cannot read the memory of bot-chief), plus the #1814 tick case at not ok 33. At this tip the same files pass, core is 2298/2298, TZ=UTC ARCH_DOCS_BASE=2ec16870 npm run verify exits 0, arch-docs: OK, check three lines ok, canonical ok, build-client --check green, and generate is a no-op on this tree.

Owner: Dev
Written-by: Dev-2

@HugoXK

HugoXK commented Oct 31, 2026

Copy link
Copy Markdown
Contributor Author

Verdict requested for this tip: 280c3eb (tree e7bf737ce295da54a14fbc742de15f3db2ea8290, base 2ec1687)

@Birfy review request — #1900 (the board re-read the whole team dossier on every 5s poll). The PR body carries the red-first run, the full verify counts at this tip and the checkpoint block.

What to look at:

  • core/src/client/project-board.js: readProjectBoard(read, wanted, knownTeam) — the open reads project-team and the overlay hands that answer back on every later read, so a tick asks it zero times; knownTeam === undefined is the only path that reads it. A refused dossier answers null and the board still draws rows/done/tasks with team: { rows: [] }; :873's empty-Project answer is unchanged.
  • core/test/project-board-panels.test.js and core/test/project-board-view.test.js: two readProjectBoard calls ask project-team once, the same answer still feeds the team block and the dossier panel, a refusal is non-fatal, and the real timer test counts one open plus three ticks as one dossier read. Red at 2ec16870 (1 vs 2 calls; the refusal throws; 1 vs 4 on the timer).
  • core/client.js rebuilt from core/src/client/ and generate rewrote patches/ds-bot/0008-client-bundle.patch plus the three files/ mirrors — check and canonical both green at this tip (generate is a no-op).

Owner: Dev
Written-by: Dev-2
Reviewer: Reviewer

@HugoXK

HugoXK commented Oct 31, 2026

Copy link
Copy Markdown
Contributor Author

New tip for this review: 473da95 (tree e7bf737ce295da54a14fbc742de15f3db2ea8290, base 2ec1687)

@Birfy review request

The head moved once after the first request (280c3ebba0 → 473da957): the push path rebuilt the commit, so the tree is byte-identical (e7bf737c) and no file changed — only the commit identity did. The earlier request at 280c3ebb stays as it is.

At 473da957 all 14 checks on the head are success, including tests-ok, enqueue-guard ("no hold and the gate passes"), merge-gate, package, plugins ×4 and the Node 24 suite. The read path, the red-first evidence and the scope are unchanged from the body (#1900): readProjectBoard takes the dossier answer the open already read, a poll asks project-team zero times, and a refused dossier leaves rows, the done group and the task texts drawing with team: { rows: [] }.

Owner: Dev2
Written-by: Dev-2

@Birfy
Birfy added this pull request to the merge queue Oct 31, 2026
Merged via the queue into ThinkFlowLab:main with commit cf8388e Oct 31, 2026
15 checks passed
@Birfy
Birfy deleted the dev/2-team-dossier-off-the-poll branch October 31, 2026 07:35
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)

2 participants