Skip to content

test(calm-pi): use Pi 1.0.1 getToolRenderers dependency key - #6516

Closed
Thoughts-One wants to merge 0 commit into
kunchenguid:mainfrom
Thoughts-One:fm/up-pi-renderer-key
Closed

Thoughts-One wants to merge 0 commit into
kunchenguid:mainfrom
Thoughts-One:fm/up-pi-renderer-key

Conversation

@Thoughts-One

@Thoughts-One Thoughts-One commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Intent

Approval words: "d4 proven api approved." Scope as relayed: D4 authorizes only the proven Pi API mismatch upstream fix, following CONTRIBUTING.md. The other 15 timing-cap tests remain outside scope.

Context (proven on the fork): tests/fm-calm-pi-extension.test.sh builds Pi's internal createToolHtmlRenderer by hand with the dependency key getToolDefinition. Pi 1.0.1 (published 2026-10-03, CI installs @earendil-works/pi-coding-agent unpinned) renamed it to getToolRenderers, so the test fails on 1.0.1 and passes on 1.0.0. With only the key renamed it passes 15/15 on 1.0.1 and the calm extension itself is unaffected. The fork fix is a two-line rename (Thoughts-One/firstmate PR 49).

What Changed

  • In tests/fm-calm-pi-extension.test.sh, the two hand-built createToolHtmlRenderer calls now pass the dependency key getToolRenderers instead of getToolDefinition. Pi 1.0.1 renamed this key.
  • The lookup function and the other arguments (theme, cwd) are unchanged. The change touches only the test file, not the calm extension.

Risk Assessment

✅ Low: The change is a two-line, test-only key rename that matches the authorized scope. The calm extension is unaffected, and the only open item is an unverified sibling test that may need the same rename.

Testing

I ran the real fm-calm Pi extension test (renderer, lifecycle and tmux TUI checks) against a freshly installed Pi 1.0.1. The pre-change test fails there after 7 ok lines with 'grep disappeared from /export calm.html HTML while calm mode was on'. With the fix, all 15 checks pass and the exit code is 0. The fixed test fails on the installed Pi 1.0.0 with the same error. Pi 1.0.0 reads only getToolDefinition, and 1.0.1 reads only getToolRenderers. The diff touches only the two renamed keys. The other timing-cap tests were left alone, as the recorded decision requires. The temporary Pi install is removed. The worktree is clean. Logs are in the evidence directory.

  • Live validation: ✅ go - 3 of 3 scenarios driven live against the product
Scenario Result Live Evidence
Run the calm Pi extension test on Pi 1.0.1 with the key renamed; all checks pass ✅ pass live after-pi-1.0.1.log: exit 0, 15 ok lines, no failures
Reproduce the original failure: run the pre-change test on Pi 1.0.1 ✅ pass live before-pi-1.0.1.log: exit 1 after 7 ok lines, 'grep disappeared from /export calm.html HTML while calm mode was on'
Adversarial: run the fixed test on the installed Pi 1.0.0 to see if the rename breaks the older version ✅ pass live after-pi-1.0.0.log: exit 1, same error as the pre-change test on 1.0.1. The test no longer works on 1.0.0. The change is still acceptable, because the stated intent is to track the latest Pi that CI i…
Evidence: Before fix on Pi 1.0.1 (fails after 7 ok)

Source: Before fix on Pi 1.0.1 (fails after 7 ok)

ok - Pi calm resolves its persistent home independently of Pi's launch directory
ok - Pi calm compatibility evidence never rejects a Pi version for being newer than 0.82.0, and still fails closed on a missing or malformed version
ok - a missing collapsed-thinking presentation API degrades only that Calm adapter with a clear skip reason, while the rest of Calm still registers
ok - missing Pi presentation class exports reach the independent adapter degradation path
ok - Calm hides queued Firstmate rows only on a session that can keep them, keeps hidden ones out of the editor on Escape, delivers them once in order, and leaves unsupported sessions and Calm off stock
ok - Calm registers none of its 7 built-in tool wrappers at load while config/calm is off, and all 7 synchronously at load while config/calm is on
ok - Calm's first same-session /calm activation claims every uncontested built-in, leaves a foreign bash tool fully intact and callable, warns prominently and logs the contested name, and only rows constructed before that activation - the documented bound - fail to retroactively collapse
not ok - Pi calm renderer and lifecycle contract failed: file:///tmp/fm-calm-pi-extension.SBUqIN/renderer/[eval1]:546
      throw new Error(`${name} disappeared from ${command} HTML while calm mode was on`);
            ^

Error: grep disappeared from /export calm.html HTML while calm mode was on
    at assertStockHtmlRendering (file:///tmp/fm-calm-pi-extension.SBUqIN/renderer/[eval1]:546:13)
    at file:///tmp/fm-calm-pi-extension.SBUqIN/renderer/[eval1]:553:7
    at process.processTicksAndRejections (node:internal/process/task_queues:104:5)

Node.js v24.18.0
Evidence: After fix on Pi 1.0.1 (15/15 ok)

Source: After fix on Pi 1.0.1 (15/15 ok)

ok - Pi calm resolves its persistent home independently of Pi's launch directory
ok - Pi calm compatibility evidence never rejects a Pi version for being newer than 0.82.0, and still fails closed on a missing or malformed version
ok - a missing collapsed-thinking presentation API degrades only that Calm adapter with a clear skip reason, while the rest of Calm still registers
ok - missing Pi presentation class exports reach the independent adapter degradation path
ok - Calm hides queued Firstmate rows only on a session that can keep them, keeps hidden ones out of the editor on Escape, delivers them once in order, and leaves unsupported sessions and Calm off stock
ok - Calm registers none of its 7 built-in tool wrappers at load while config/calm is off, and all 7 synchronously at load while config/calm is on
ok - Calm's first same-session /calm activation claims every uncontested built-in, leaves a foreign bash tool fully intact and callable, warns prominently and logs the contested name, and only rows constructed before that activation - the documented bound - fail to retroactively collapse
ok - Pi calm centralizes transcript visibility, preserves execution/export data, keeps Pi's stock working row visible while no run is active, and persists its choice across session starts
ok - Pi calm on collapses mid-turn assistant working notes to zero height while Calm off keeps them, leaves streaming, truncated-final, and genuine final replies untouched, never mutates the messages, ignores every /calm argument, and restores a legacy persisted max as ordinary Calm on
ok - Pi operational follow-up E2E processes exact user-role notifications once while Calm hides current and adjacent rows, Calm off and absent render them, and restart preserves semantics
ok - Pi 1.0.0 with Calm on hides and retains queued Firstmate input through Escape, delivers it once, and leaves Calm off stock
ok - Pi Calm native /skill:ahoy geometry keeps every collapsed thinking and tool block at zero height while preserving expansion, history, restart, and Calm-off rendering
ok - Pi Calm working ship keeps its centered two-row asymmetric Unicode boat inside a deterministic long-wave trough, paints all water standard blue and the whole boat standard yellow with balanced resets, keeps ANSI-stripped width exact, reverses cleanly at both edges and every width, clamps visible and hidden resizes, falls back deterministically when narrow, freezes and resumes across settle/start without hidden-time jumps or duplicate timers, resets only on a fresh session, and leaves Calm-off visibility untouched
ok - the rendered-export-DOM guard renders in one pass, retries a bounded number of Chrome start-up failures, and reports the Chrome binary, Chrome version, Pi version, exit status, and Chrome diagnostic when every attempt fails
ok - Pi calm native E2E replaces the stock working row with a moving, resize-clamped working ship that freezes and resumes across two working periods in one Pi session, clears on abort, keeps captain turns visible, hides exact operational user rows without changing persistence, restores stock rendering Calm-off, survives restart, and preserves export plus Ctrl+O behavior
Evidence: After fix on Pi 1.0.0 (fails after 7 ok; the rename is not backward compatible)

Source: After fix on Pi 1.0.0 (fails after 7 ok; the rename is not backward compatible)

ok - Pi calm resolves its persistent home independently of Pi's launch directory
ok - Pi calm compatibility evidence never rejects a Pi version for being newer than 0.82.0, and still fails closed on a missing or malformed version
ok - a missing collapsed-thinking presentation API degrades only that Calm adapter with a clear skip reason, while the rest of Calm still registers
ok - missing Pi presentation class exports reach the independent adapter degradation path
ok - Calm hides queued Firstmate rows only on a session that can keep them, keeps hidden ones out of the editor on Escape, delivers them once in order, and leaves unsupported sessions and Calm off stock
ok - Calm registers none of its 7 built-in tool wrappers at load while config/calm is off, and all 7 synchronously at load while config/calm is on
ok - Calm's first same-session /calm activation claims every uncontested built-in, leaves a foreign bash tool fully intact and callable, warns prominently and logs the contested name, and only rows constructed before that activation - the documented bound - fail to retroactively collapse
not ok - Pi calm renderer and lifecycle contract failed: file:///tmp/fm-calm-pi-extension.leLLQw/renderer/[eval1]:546
      throw new Error(`${name} disappeared from ${command} HTML while calm mode was on`);
            ^

Error: grep disappeared from /export calm.html HTML while calm mode was on
    at assertStockHtmlRendering (file:///tmp/fm-calm-pi-extension.leLLQw/renderer/[eval1]:546:13)
    at file:///tmp/fm-calm-pi-extension.leLLQw/renderer/[eval1]:553:7
    at process.processTicksAndRejections (node:internal/process/task_queues:104:5)

Node.js v24.18.0
- Outcome: ⚠️ 1 info across 1 run (2m11s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 1 warning
  • ⚠️ tests/fm-pi-branch-extension.test.sh:5369 - The same renamed dependency key getToolDefinition is still passed to Pi's createToolHtmlRenderer at tests/fm-pi-branch-extension.test.sh:5369 and :5370 (the stockHtml and actualHtml renderers). I could not confirm 1.0.1 behavior because the installed Pi is 1.0.0. If 1.0.1 only reads getToolRenderers, those calls throw a TypeError at renderCall and fail the same way. The intent authorizes only the proven calm-test mismatch and puts other tests out of scope, so this is left as a scope decision. The remedy is the same two-line rename in that file.
⚠️ **Test** - 1 info
  • ℹ️ tests/fm-calm-pi-extension.test.sh:1666 - The renamed key is not backward compatible. Pi 1.0.0 (the version installed on this machine) reads only getToolDefinition in export-html/tool-renderer.js, and Pi 1.0.1 reads only getToolRenderers. With the fix, tests/fm-calm-pi-extension.test.sh now fails on 1.0.0 (7 ok, then 'grep disappeared from /export calm.html HTML'). This follows the stated intent, because CI installs Pi unpinned and so gets the latest version. Anyone running the test against a 1.0.0 install must upgrade Pi.
  • Live validation: ✅ go - 3 of 3 scenarios driven live against the product
Scenario Result Live Evidence
Run the calm Pi extension test on Pi 1.0.1 with the key renamed; all checks pass ✅ pass live after-pi-1.0.1.log: exit 0, 15 ok lines, no failures
Reproduce the original failure: run the pre-change test on Pi 1.0.1 ✅ pass live before-pi-1.0.1.log: exit 1 after 7 ok lines, 'grep disappeared from /export calm.html HTML while calm mode was on'
Adversarial: run the fixed test on the installed Pi 1.0.0 to see if the rename breaks the older version ✅ pass live after-pi-1.0.0.log: exit 1, same error as the pre-change test on 1.0.1. The test no longer works on 1.0.0. The change is still acceptable, because the stated intent is to track the latest Pi that CI i…
  • Installed Pi 1.0.1 into a throwaway npm prefix under /tmp and ran FM_PI_PACKAGE_DIR=<that install> bash tests/fm-calm-pi-extension.test.sh on the target commit
  • Ran the pre-change test file from base commit 1f3e769 against the same Pi 1.0.1 install
  • Ran the fixed test file against the installed Pi 1.0.0
  • Compared the dependency key each Pi version's export-html/tool-renderer.js reads (getToolDefinition in 1.0.0, getToolRenderers in 1.0.1)
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.