Skip to content

Two rows of core/test/readonly-window-reads.test.js were green on a tree that drew the read-only window's screen empty. This hardens both with a test that fails when the read path stops carrying what the row paints. - #2852

Merged
Birfy merged 1 commit into
ThinkFlowLab:mainfrom
HugoXK:dev/5-readonly-reads-assertions
Nov 11, 2026

Conversation

@HugoXK

@HugoXK HugoXK commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Two rows of core/test/readonly-window-reads.test.js were green on a tree that drew the read-only window's screen empty. This hardens both with a test that fails when the read path stops carrying what the row paints.

What was wrong

  • The tasks row only asked whether some card in the list had id === 'task-1'. A list of duplicates, or a card whose view had lost the fields the row paints (title, column, queueRole), still passed.
  • The project-board row checked the metrics through Object.values(metrics).every(value => value === null) — vacuously true on {}. An answer with no metric keys at all, i.e. a header of missing numbers, still passed.

What changed

Test-only; no source, no client and no patch logic change.

  • core/test/readonly-window-reads.test.js — the tasks row pins the list itself: Array.isArray, length === 1, and that card's own id, title, column (waiting), queueRole (Dev) and status (open). The project-board row pins the seven metric keys the header draws (prsOpenedToday, prsMergedToday, issuesOpenedToday, issuesClosedToday, prMergeMedianMs, issueCloseMedianMs, taskDoneMedianMs), then their null values, and keeps ok === false with reason: no-credentials.
  • patches/ds-bot/files/test/readonly-window-reads.test.js — the same bytes, written by node scripts/ds-bot-patches.mjs generate (core/test/ is a whole-file overlay entry); diff -q against the core copy is identical and ds-bot-patches check reports 10 patches apply cleanly and core/ equals ds-bot/ + patches/ds-bot/.

No changelog fragment: this is a test-only change with no user-visible behaviour.

Red first, then green

On the base tree, with each read path broken in turn and restored with git checkout afterwards: the task view dropping title (core/src/host/tasks.js) and emptyMetrics() answering {} (plugins/project/src/project-metrics.js).

  • Old assertions on the broken tree: # tests 3 / # pass 3 / # fail 0, twice.
  • New assertions on the same broken tree: red twice, naming both rows — tasks: answered a card with no title, project-board: answered metrics.metrics with no keys.
  • Read paths restored, new assertions: # tests 3 / # pass 3 / # fail 0, twice.

Verify

TZ=UTC npm run verify at this commit: core lint 88/0, plugin lint 0 errors, 10 patches apply cleanly, core 3086/3086, social 619 / tree 149 / timeline 172 / workflow 528 / project 147, .github + policy suite 675 tests / 674 pass / 1 fail — the one red is the known #749 machine item, which names only this host's .cache/wt-2547/** worktree and not any file of this change. generate/check/canonical no-op.

Fixes #2847
Owner: Dev-5
Reviewer: Birfy
Written-by: Dev-5
Bot: Dev-5
Claim-Id: c2c105030e81439c913e450dcb9015cb
Risk tier: T1
Base: ff9c5db

Checkpoint

{
  "pr": 2852,
  "claim": "Dev-5",
  "issue": 2847,
  "summary": "Two rows of core/test/readonly-window-reads.test.js were green on a tree that drew the read-only window empty. The tasks row now pins the list itself — one row, that card's id, title, column, queueRole and status — instead of asking whether some card had the id. The project-board row pins the seven metric keys the header draws, then their nulls, because Object.values(...).every(null) is vacuously true on {}. Both went red twice on a broken read path while the old assertions stayed green, and pass twice with the paths restored.",
  "files": [
    "core/test/readonly-window-reads.test.js",
    "patches/ds-bot/files/test/readonly-window-reads.test.js"
  ],
  "checks": {
    "ran": "TZ=UTC npm run verify; node --test test/readonly-window-reads.test.js; node scripts/ds-bot-patches.mjs check",
    "result": "green",
    "at": "b2fb8660a15ca70a3f912326c55438761453a1ff"
  },
  "next": "none — ready for review"
}

…metrics table (ThinkFlowLab#2847)

Two rows of core/test/readonly-window-reads.test.js passed on a tree that
drew the screen empty:

- `tasks` asked only whether some card in the list had id `task-1`, so a
  list of duplicates or a card whose view had lost the fields the row paints
  stayed green. It now pins the list itself: one row, plus that card's own
  id, title, column, queueRole and status.
- `project-board` checked the metrics through
  `Object.values(metrics).every(value => value === null)`, which is
  vacuously true on `{}`: an answer with no metric keys at all drew a header
  of missing numbers and passed. It now pins the seven keys the header draws,
  then their null values, and keeps `ok === false` / `reason: no-credentials`.

Red first, on the base tree, with each read path broken in turn (the task
view dropping `title`, `emptyMetrics()` answering `{}`): the old assertions
stayed green 3/3 twice; the new ones named both rows and failed twice; with
the read paths restored they pass 3/3 twice.

Test-only: no source, no client and no patch logic change. The overlay copy
`patches/ds-bot/files/test/readonly-window-reads.test.js` is `generate`d and
byte-identical to the core copy.

Fixes ThinkFlowLab#2847
@HugoXK

HugoXK commented Nov 11, 2026

Copy link
Copy Markdown
Contributor Author

@Birfy — T1 review request at tip b2fb8660a15ca70a3f912326c55438761453a1ff.

18 checks at this tip: 16 success + 2 skipped, 0 failure — tests-ok 09:49:06Z, enqueue-guard 09:46:59Z, merge-gate 09:47:03Z; mergeable_state: clean, maintainer_can_modify: true. T1, so no Verdict PASS is needed. Test-only diff (2 files), generated mirror written by generate.

Please enqueue this tip.

@Birfy
Birfy added this pull request to the merge queue Nov 11, 2026
Merged via the queue into ThinkFlowLab:main with commit d657b85 Nov 11, 2026
19 checks passed
@Birfy
Birfy deleted the dev/5-readonly-reads-assertions branch November 11, 2026 10:17
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.

test(host): two read-only window assertions stay green when the read itself is broken

2 participants