Skip to content

perf(planning): cut the interview surface's browser suites toward the 120 s budget - #11409

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-8757-41141303833-1
Oct 31, 2026
Merged

melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-8757-41141303833-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Refs: #8757

Summary

Opened by the work-resolve-issue lane. The run's own summary:

Most of surface-journey.test.sh's 290 s was spent in phase 7, which waits for the pill to read Idle. The pill can only read Idle once the session bridge's fixed 180 s READING_WINDOW after phase 1's delivery has run out, so this one wait took roughly the window minus phases 1 to 6. The bridge already lets an app override lease_timeout() and settle_window(), so I added a reading_window() hook beside them (lib/session-bridge, synced to its five generated copies) and gave the planning surface a readingWindow setting (default 180, 5 to 600). The journey's data dir sets it to 5, and phase 7 reads the configured window instead of a hardcoded 180. For the other two suites, each browser group already runs on its own server, so I split them: ui_page moved from surface.test.sh into a new surface-page.test.sh, and ui_c's phases now run as surface-ui-c.test.sh (1-3), surface-ui-c-listen.test.sh (4-6) and surface-ui-c-ledger.test.sh (7-10). No check was dropped. Each phase is still graded once, and the per-part SKIP counts still add up to the old totals. This lane cannot run the browser suites, so the speed-up is reasoned from the code, not measured: the PR's CI TIME: lines are the measurement.

Remaining work

  • Confirm from this PR's CI TIME: lines that surface-journey.test.sh is under 120 s. Estimated from its 290 s median less the phase-7 window wait, it may still land around 150 s. If so, the next cut is its roughly 50 s of fixed waitForTimeout and tap pauses, replaced with waits on the page state they

Not verified

  • The browser suites (surface*.test.sh), test_server.py and lib/session-bridge/test_session_bridge.py were not run here. The lane's Bash allows no interpreter or test runner, so they are left to the PR's CI.
  • The done-when check (each of surface-journey.test.sh, surface.test.sh and surface-ui-c.test.sh under 120 s, as the CI TIME: lines show) can only be read from the PR's CI run. It is left to that run.
  • Tidy skipped: 25 changed files across more than one area (lib, plugins/planning, plugins/review, plugins/work-items, .changes), and the change touches the shared path lib/. Both are over the tidy cutoffs (10 files, 1 area, no shared paths).
  • The three new suite files were created without a chmod, because the lane has no command to set the executable bit. They run fine through bash, but if the repo requires test.sh files to be executable, CI will flag it.
  • scripts/suite-seconds.txt and scripts/suite-budget-exceptions.txt were not changed. Their rows are CI medians, and suite-budget-exceptions.txt says to remove a row only once its median is under 150 s, which needs a CI re-measure. The new suites get the flat default share until then.
  • git status inside the Bash sandbox lists untracked root dotfiles (.bashrc, .gitconfig, .mcp.json, .idea, .vscode and others). The Read tool cannot see them (.bashrc reads as missing), so they look like sandbox mount placeholders, not part of this change. They were left alone and should not go into t
  • A problem that predates this change was found in review and not fixed: finish() in surface-checks.sh never stops the f3 and live servers if a run is killed mid-group.

Fix

  • lib/session-bridge/session_bridge.py: new Transport.reading_window() hook (default READING_WINDOW, 180). Both the LoopbackWatcher and ChannelRelay listener() use it instead of the constant.
  • lib/session-bridge/test_session_bridge.py: test that both adapters read the reading window from the app hook.
  • lib/session-bridge/README.md: reading_window() added to the port's hook table.
  • plugins/planning/surface/session_bridge.py, plugins/planning/shared/session_bridge.py, plugins/planning/view-bridge/session_bridge.py, plugins/review/view-bridge/session_bridge.py, plugins/work-items/view-bridge/session_bridge.py: regenerated from the library by sync-shared-copies.
  • plugins/planning/surface/server.py: readingWindow setting (int, 5 to 600, default READING_WINDOW) and a Hub.reading_window() override that resolves it through the settings layers.
  • plugins/planning/surface/test_server.py: readingWindow added to the plugin-defaults test. New TestReadingWindow covers the default, a configured window ending the reading state, and invalid values falling back.
  • plugins/planning/surface/index.html: readingWindow in DEFAULTS and a read-only Settings row.
  • plugins/planning/surface/README.md: readingWindow row in the settings table. Known-gaps line now covers every surface*.test.sh suite.
  • plugins/planning/surface/tests/ui_journey.js: phase 7 computes the time left in the reading window from the state frame's readingWindow setting, not a hardcoded 180.
  • plugins/planning/surface/surface-checks.sh: the journey's data dir gets settings.json with readingWindow 5. New parts page, ui-c-listen and ui-c-ledger. group_c split into group_c (phases 1-3), group_c_listen (4-6) and group_c_ledger (7-10), each grading its own phases. CHECKS counts split to match
  • plugins/planning/surface/surface.test.sh: now runs hygiene plus ui_a, ui_b, ui_e and ui_live (ui_page moved out).
  • plugins/planning/surface/surface-ui-c.test.sh: now runs ui_c phases 1-3.
  • plugins/planning/surface/surface-journey.test.sh: header comment only.
  • plugins/planning/surface/surface-page.test.sh: new suite for the ui_page group.
  • plugins/planning/surface/surface-ui-c-listen.test.sh: new suite for ui_c phases 4-6.
  • plugins/planning/surface/surface-ui-c-ledger.test.sh: new suite for ui_c phases 7-10.
  • .changes/planning/perf-8757-surface-suite-budget-5c81e2a7.md: minor fragment (Added: readingWindow setting; Changed: suite split and journey window).
  • .changes/review/perf-8757-surface-suite-budget-5c81e2a7.md: patch fragment for the regenerated bridge copy.
  • .changes/work-items/perf-8757-surface-suite-budget-5c81e2a7.md: patch fragment for the regenerated bridge copy.

Verification

The runner ran each check from the base copy against d7a4b28:

  • scripts/check-changelog-fragments.sh --check: passed

The run reports:

  • read https: //github.com/melodic-software/claude-code-plugins/pull /10945: the PR that added per-phase TIME output. It records surface-journey's 290 s, says surface.test.sh's ui_page group and surface-ui-c.test.sh's phases 4-10 run on their own servers so they can move, and says no per-phase CI numb
  • read https: //github.com/melodic-software/claude-code-plugins/pull /10945/checks and https: //github.com/melodic-software/claude-code-plugins/actions/runs/40876714891/job/123457560708: job logs need sign-in. The job page shows only the annotation 'surface-journey.test.sh took 273s, over the 120s per
  • Code reading: in plugins/planning/surface/tests/ui_journey.js, phase 7 waits until(pill === 'Idle', max(40 s, readLeft + 5 s)), where readLeft is the rest of the 180 s window after phase 1's /api/wait delivery. index.html's conn() reads the listener state in only one place (line 1062), and no other
  • /home/runner/work/claude-code-plugins/claude-code-plugins/.lane/verify/bin/sync-shared-copies: regenerated 5 session_bridge.py copies, exit 0.
  • /home/runner/work/claude-code-plugins/claude-code-plugins/.lane/checks/bin/check-changelog-fragments: all 6 fragments valid (run before and after the review fixes).
  • /home/runner/work/claude-code-plugins/claude-code-plugins/.lane/checks/bin/check-affected: 13 passed, 5 skipped (typos not installed; three validate-plugins steps that run checked-tree code; no changed skill), over 23 changed files (run before and after the review fixes).
  • Fresh-context review subagent over the whole diff: it found two low-severity issues, both fixed. The ui_c SKIP counts were off by one (now 176/10), and the README and contract wording now says a window of 10 s or less never shows working, because of the 10 s listen grace. It confirmed every group ru
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/41141303833

Left out: the items under Not verified.

Related

#8757

Lane-Activity: work-resolve-issue/resolve-issue
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Unattended merge: native auto-merge leaves this pull request unarmed at head d7a4b28c3b7df4470ec1479f235eadd1f3ce1860. The lanes clear this reason on their own; the next scheduled run judges it again.

pr-merge's gate refuses its verifier verdict (verify:missing)

@github-actions

Copy link
Copy Markdown
Contributor

claude-security-review reviewed d7a4b28c3b7df4470ec1479f235eadd1f3ce1860: 0 finding(s), 0 as inline comments.

No security issues found in this pull request.

I read the full diff and the PR context. No changed file matches a trusted path, and no plugin.json or marketplace.json changed, so there are no manifest lines to report. The change touches no trust control, token scope, kill switch, merge hold or instruction surface.

What changed:

  • Bridge hook: Transport.reading_window() is a new hook in lib/session-bridge/session_bridge.py, copied into five generated session_bridge.py files. It defaults to the existing READING_WINDOW of 180, so the other plugins behave as before.
  • Planning setting: plugins/planning/surface/server.py adds a readingWindow setting, rule ("int", 5, 600). Hub.reading_window() resolves it through the same settings layers as leaseTimeout, settleQuiet and settleBurst, and test_server.py covers invalid values falling back to 180.
  • Page and test changes: index.html shows the setting in a read-only row, and surface-checks.sh splits the browser suites into more parts. The journey's temporary data dir gets settings.json with {"readingWindow": 5}, written with a fixed literal via printf '%s'. ui_journey.js reads the window from the state frame instead of hardcoding 180.

Checks on the setting:

  • Its only effect is how long the page shows the session as reading before idle. It gates nothing, and it doesn't touch auth, tokens or the filesystem.
  • Untrusted input does not reach it. The value comes from the local settings layers, is range-checked to 5–600 as an integer, and falls back to the default when invalid. A bad value cannot raise the window past 600 s or break the state calculation.
  • listener() now resolves the settings layers on each call, as the existing leaseTimeout, settleQuiet and settleBurst settings already do. That adds file reads on the page's state path and creates no new attack surface.
  • The three new surface-*.test.sh wrappers are one-line exec bash calls with a fixed --part argument and no interpolated input.

Spend: the extra CI suite legs use Actions minutes the repository already runs. They do not change a billing plan, so there is no cost hold.

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed d7a4b28c3b7df4470ec1479f235eadd1f3ce1860: 0 finding(s), 0 as inline comments.

Code review: no findings

I read all 23 files in the diff and the PR context. I could not run any test or tool here, so everything below comes from reading the code. I did not run the browser suites, test_server.py or test_session_bridge.py. The PR's description of what was run is the author's claim, not something I confirmed.

What I checked

  • reading_window() hook. It is added to Transport in lib/session-bridge/session_bridge.py. Both LoopbackWatcher.listener() and ChannelRelay.listener() use it, and the default is still READING_WINDOW (180). The five generated copies match the library hunk for hunk, so the other plugins keep their behaviour. Their patch fragments are right.
  • Hub.reading_window(). It resolves through the same settings layers as lease_timeout() and settle_window(). readingWindow is in DEFAULT_SETTINGS, SETTING_RULES (int, 5 to 600) and index.html DEFAULTS, and it has a Settings row, a README row and tests. layers.resolve takes no lock, so calling it from listener() cannot deadlock. The repo layer's allow-list (REPO_KEYS) does not include it, so a repo file cannot change it. The journey's data-dir settings.json can, as the journey needs.
  • Journey test. st.settings.readingWindow.value is the real shape of the state frame (resolve returns {key: {value, layer}}). The other pill assertions in ui_journey.js are either Idle (phase 7) or about the working line, which comes from pending events, not the reading state. A 5 s window does not break them.
  • surface-checks.sh split. group_c is split into group_c, group_c_listen and group_c_ledger.
    • Each group sets up and grades its own phases.
    • Variables shared across groups ($e, $tmp, $py and similar) are defined at the top level, and $sd, $x9 and $x10 are still cleaned up in finish().
    • CHECKS sums to the old total: 176 + 21 + 10 = 207. The PARTS map and group_$grp dispatch line up.
    • The ui_page group moved out of main into its own page part.
  • New suite files. The three new .test.sh files are mode 100755 in the diff. The PR's "no chmod" caveat does not apply.
  • Cost. More and shorter suites, and fewer wall-clock seconds per leg, only spend prepaid and subscription CI usage. No billing setting changes, so there is no hold.

Open items, not defects in the diff

  • The 120 s target for surface-journey.test.sh is unconfirmed. The author estimates it may still land around 150 s. It can only be read from this PR's CI TIME: lines.
  • scripts/suite-seconds.txt and scripts/suite-budget-exceptions.txt were intentionally not updated. The new suites get the default share until a CI re-measure.
  • The finish() gap for the f3 server is pre-existing and is not part of this change.

No closing-issue acceptance criteria were present in the PR context beyond the PR body. The PR body contains no embedded instructions aimed at the reviewer.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path armed native auto-merge at head d7a4b28c3b7df4470ec1479f235eadd1f3ce1860.

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Oct 31, 2026
Merged via the queue into main with commit 3d586e6 Oct 31, 2026
53 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-8757-41141303833-1 branch October 31, 2026 00:47
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.

0 participants