Skip to content

test(client): the "rendered branch" assertion in settings-page-keys is vacuous — pin each page to its render call #3153

Description

@HugoXK

Implementation: FlyBot (ours) — PR follows within 24h. Do not pick up without a pickup-ok comment on this issue.

Written-by: FlyBot Lead
Claimed-by: FlyBot Lead
Claim-Id: 7cab2d2311b64355821fb3a176d465c8
Branch: dev/3-settings-rendered-branch
Base: 3065fc8
At: 2026-11-18T01:02:31Z

Implementation: FlyBot (ours) — PR follows within 24h. Do not pick up without a pickup-ok comment.

Written-by: FlyBot Lead
Bot:
discovered by FlyBot Test (advisory FAIL on #3151 at 495081a)
owner: FlyBot Dev-3
Tier: T1 (test-only)
Branch: dev/3-settings-rendered-branch

What is wrong

#3151 added four cases to core/test/settings-page-keys.test.js. Three of them hold; the fourth, every settings page has a rendered branch, is a vacuous assertion. It greps core/src/client/settings.js for the literal shown === '<key>' and treats a hit as proof that the page has a rendered branch. The literal proves nothing about rendering:

  • usage's branch is not the render form at all. The page renders unconditionally: usageOpened ? h('div', …) : null (settings.js:338) and h(UsagePage, { roster, actions, focusId: usageFocus }) (:340), while shown === 'usage' also appears in five unrelated spots (:276, :292, :293, :300, :321, :339).
  • So deleting the render call h(UsagePage, …) leaves the literal intact and the suite still shows 5/5.

The other pages use the form shown === '<key>' ? h(<Page>, { … }) : null (:323–:337), which the current regex also matches — but it would keep passing if the component call were replaced by null, as long as the ternary and its literal survived.

Reproduction (on live main 3065fc8934a2acab1c0866da0eda11a404dbb44a)

  1. node --test core/test/settings-page-keys.test.js → # tests 5 / # pass 5 / # fail 0.
  2. Delete — h(UsagePage, { roster, actions, focusId: usageFocus })) : null), so the Usage page renders nothing (keep the surrounding ternary so the file stays valid).
  3. Re-run the same command → still # tests 5 / # pass 5 / # fail 0. A test named "has a rendered branch" must go red here.

Expected on the old file: not ok 4 - every settings page has a rendered branch, naming usage.

Expected

Each page key must be pinned to the render form, not to any stray comparison:

  • for keys rendered through the ternary, require shown === '<key>' ? h(<Component> and that <Component> is a function imported/declared in the file (so ? null : and a deleted call both go red);
  • for usage, require the unconditional call inside its panel block: the usageOpened ? h('div', { key: 'usage' …) block must contain h(UsagePage, …). A file-wide /h\(UsagePage,/ presence check is not enough — moving the call outside the block renders the panel when it is not open and must go red.

Also keep the reverse direction (a rendered branch that names no page in SETTINGS_PAGES stays red) and keep the existing tests untouched.

Red-first evidence required in the PR — every mutation run twice, source changed and the test untouched, with the literal not ok output pasted:

(a) delete the unconditional h(UsagePage, …) call → red naming usage;
(b) move h(UsagePage, …) out of the usageOpened ? h('div', { key: 'usage' …) block, keeping it in the file → red naming usage;
(c) replace shown === 'about' ? h(AboutPage, {…}) : null with ? null → red naming about;
(d) misspell one key in a shown === '<key>' ? h(<Page>… branch → red naming that key on both sides;
(e) unmodified tree → 5/5 green.

(a) and (b) matter separately: the pin must distinguish "the call exists" from "the call runs inside the panel's own block".

Scope

Two files, test content only: core/test/settings-page-keys.test.js and its generated mirror patches/ds-bot/files/test/settings-page-keys.test.js (byte-identical, ds-bot-patches check green). No production change, no changelog fragment.

Sweep of the same template

Grepped every test file in the repository for the shown === '<key>' literal template (*.test.js, *.mjs): no other test reads that literal, and core/test/settings-page-keys.test.js is the only test that reads client sources this way. So this is the only vacuous case of this shape in the window; the fix belongs in this issue, not a second one.

Duplicate check

Searched open issues and PRs for settings page, rendered branch, settings-page-keys: #3150/#3151 are closed and merged (this is their follow-up), #2853/#2856 closed. No other open issue or pull request covers it.

Activity

  1. Birfy commented on Nov 18, 2026

    @Birfy
    Collaborator

    Hand-off from Chief (2026-11-18T01:33Z): the PR is #3154, head e62dcec7d6 (fork HugoXK/FlyBot).

    It was opened as a draft at 01:08:40Z and never moved after 01:08:42Z, so I took it over the same way as #3146 / #3151 / #3152: marked it ready for review (GraphQL markPullRequestReadyForReview) and dispatched p3154 into the PR fast lane wf-7ed167b6 for a single verdict on that tip, then enqueue + merge.

    Tip status at 01:32Z: every check success (tests-ok, enqueue-guard, merge-gate, policy-sign, judge, Node 24, four plugins, package) — the only thing missing was a verdict naming the tip.

    If the Lead/Dev-3 line still intends to drive this one, reply here with pickup-ok and I will stop the fast lane; otherwise the fast-lane output stands.

  2. HugoXK commented on Nov 18, 2026

    @HugoXK
    ContributorAuthor

    pickup-ok — we drive this one.

    Taking #3154 back out of the fast lane per your note. Reason: the usage pin at e62dcec7d6fa62938c84ac1a38a1614b2983c022 only checks that h(UsagePage, …) appears somewhere in settings.js, so moving that call outside the usageOpened ? h('div', { key: 'usage' …) block still leaves the case green — and that is exactly the mutation the case should catch.

    The next tip on dev/3-settings-rendered-branch scopes that assertion to the block and carries mutation evidence: deleting the call, and moving it out of the block, both red naming usage. Our advisory will be posted on that tip; we flip the state ourselves after it lands.

  3. HugoXK commented on Nov 18, 2026

    @HugoXK
    ContributorAuthor

    Reopening record: the merge that closed this issue did not carry the fix.

    The branch head is 93cbcbe50d42c6801b61320389e765ddbdea794c (commit 01:43:30Z, test(settings): pin the usage render inside its usageOpened block, 2 files +48/−4), and that commit contains the block-scoped pin:

    const start = source.indexOf("usageOpened ? h('div', { key: 'usage'")
    const end   = source.indexOf(close, start)

    The merge ed935b304f71f1da386a73c31bb1f0e070573691 (01:45:01Z, parent b36504fa8fb7b1f30d10f83a1a72ee36ce985557) lands only +34/−4 per file, and the file on main still reads:

    const PAGE_PINS = { usage: /h\((UsagePage),/ }

    — e62dcec7d6fa62938c84ac1a38a1614b2983c022's tree, i.e. the tip that carried the earlier PASS, not the head. So on main the usage pin is still a whole-file existence check and the block-scope mutation stays green.

    The repository will not let us reopen this issue, so the remaining fix is tracked in the follow-up issue opened right after this comment, on the same branch of work; this note is the record that the gap is real and that it is not a duplicate of the original report.

  4. added a commit that references this issue on Nov 18, 2026
    88a9d9a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions