Skip to content

[CI] Reduce repeated terminal scans and unused Qoder test imports - #25425

Merged
nwparker merged 1 commit into
mainfrom
nwparker/ci-cursor-and-runtime-imports-20261005
Oct 5, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/ci-cursor-and-runtime-imports-20261005

Conversation

@nwparker

@nwparker nwparker commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

CI does less repeated work while checking the same terminal and Qoder behavior.

What Changed

Terminal composer detection now reads each full row once to collect its text and first visible glyph's style. It keeps a separate cursor-suffix scan and reads the current grid on every call. Six regression cases cover blank rows, optional reusable cells, dimmed glyphs, first-glyph styles and empty cells.

The worktree hook helper now calls its local function confirmHook. This prevents the localization audit from mistaking internal setup and vmRecipe selectors for dialog text; confirmation, trust and cancellation behavior stay the same. The audit and its exclusions are unchanged.

Two direct Qoder Runtime tests use the existing guard for unused default RPC methods, avoiding the full method graph. Their bodies are unchanged; the three real RPC catalogs still run without that guard.

Why

Repeated cell reads and unrelated test imports keep CI runners busy. A single row pass avoids maintaining a potentially stale terminal cache. Reusing the existing throwing RPC fixture prevents accidental method use from becoming silently untested.

Linked Issue

Internal CI efficiency follow-up; no separate issue.

Visual Proof

N/A — terminal output and interactions stay the same; this changes the reader's work and test imports.

Testing

  • Manually checked the source changes and measured them locally.
  • Automated regression cases added; actual production fault controls retained the intended failures.

Two hosted three-pair comparisons used fixed source, separate empty caches and unchanged test cases. The cursor workload saved a median paired 5.819 seconds / 8.7%, with all 294 timed outcomes passing (run). The five-file Qoder/catalog workload saved 1.113 seconds / 6.4%, with all 510 timed outcomes passing (run). These are focused process gains; full-shard, PR percentile and queue savings are unmeasured.

Cursor qualification compared complete outputs on 98 recordings and logical per-frame outputs across 192 Runtime census cases. The raw timer-driven polling trace differed and is excluded from equality claims. Nine scanner faults fail their intended assertions. Qoder recipe, command and registration faults also retain their intended failures; generated IDs and shifted stack lines differ in raw failure messages.

Local macOS verification passed node/web typechecks, the changed-file quality gate, 89 IME/composer cases and the final combined 98-case cursor/Qoder/catalog slice. Hosted comparisons ran on Linux ARM, Node 24.21.0 and pnpm 12.8.1. The localization gate, all four existing worktree-hook cases, web typechecking and changed-file quality checks also passed after the identifier rename. Normal PR CI passed on c4a287766ff7: all five full-unit shards, relay integration, both package checks and Verify (run). Companion mobile, headless and native workflows also passed.

Review

Independently reviewed the cursor behavior, Qoder fault results, frozen comparison inputs, raw case ledgers, paired arithmetic, source restoration and terminal GitHub run/job outcomes. Measurement details are in docs/reference/ci-runner-efficiency.md.

Agent skill upstream boundary

  • Not applicable; no upstream skill-installer code or assets copied.

Notes

The shared reader remains independent of platform, local/daemon/SSH/WSL transport and buffer ownership. It retains no grid state, changes no wire fields and adds no process lifecycle work. The import guards change test setup only. Real desktop timing, raw polling-count equality and an increase in concurrency allowance are unmeasured.

Checklist

  • Small and focused.
  • Explained the behavior, mechanism and choice of approach.
  • Visual proof marked N/A with a reason.
  • Reviewed correctness and performance.
  • Considered platform, SSH and path behavior.
  • Full lint, typecheck, test and build coverage supplied by normal PR CI.

@coderabbitai

coderabbitai Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7048326e-2765-4912-ade7-cc5586ce1775
📥 Commits

Reviewing files that changed from the base of the PR and between 813b13471ce269040c912503f7c0affcbda77247 and c4a2877.

📒 Files selected for processing (1)
  • src/renderer/src/lib/worktree-creation-hook-preparation.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.


📝 Walkthrough

Walkthrough

The terminal row scan now collects undimmed text and first-visible-glyph style information in one pass. New tests cover blank rows, dim glyphs, style selection, unwritten cells, and cell-read bounds. Two Runtime test files import the unused-default-RPC-methods fixture, and the efficiency report documents the scan and import guard. The hook-confirmation helper and its two call sites now use the name confirmHook.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to c4a28

The changes have focused coverage for terminal row behavior and the Runtime import guards, while the helper rename is behavior-preserving. No actionable merge-blocking risk is evident; merge after required CI passes.

Architecture Summary

Architecture risk: 🔵 Low · up to c4a28

The change affects 2 systems.

Changed systems: src, docs

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — src (service) was modified; 5 changed files map to changed impact.
  • observed — docs (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in docs/reference/ci-runner-efficiency.md: Adds the fused terminal cursor row-scan report: text and first-visible-glyph style are collected together, with the cursor suffix still scanned separately and existing glyph, wrapping, and empty-cell behavior retained. It documents focused performance and logical-output evidence; raw timer-driven polling traces are excluded from equivalence claims.
  • observed — Modified behavior in docs/reference/ci-runner-efficiency.md: Adds the Qoder test import-guard report. Direct Runtime tests load the guard before their fixture to reject unexpected default-RPC registry access; the three real catalogs remain unmocked. It records focused timing and fault-control results and notes that generated launch IDs and shifted stack lines differ in raw failure messages.
  • observed — Modified behavior in src/main/daemon/terminal-cursor-line-context.test.ts: Adds a blank-terminal test for both reusable-cell modes. It checks empty-row context and style defaults, bounds cell reads by cols * (rows + 1), and verifies that reusable-cell allocation and targets match the selected mode.
  • observed — Modified behavior in src/main/daemon/terminal-cursor-line-context.test.ts: Adds a test asserting that a dimmed, bold prompt glyph retains its bold style while its text is excluded, and that a dimmed colored footer contributes custom-foreground metadata.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 7 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes both main changes: reducing repeated terminal scans and adding unused-Qoder-RPC guards to tests.
Description check ✅ Passed The description covers the required sections with clear change details, rationale, testing evidence, review notes, and checklist responses. It identifies the linked-issue item as an internal follow-up…
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nwparker
nwparker force-pushed the nwparker/ci-cursor-and-runtime-imports-20261005 branch from b0974c4 to 1788a33 Compare October 5, 2026 07:23

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • Fused the per-row terminal scans. readTerminalCursorLineContext now collects undimmed text and the first visible glyph's style in one cell pass via a new readUndimmedTextAndFirstVisibleStyle, replacing the separate undimmedText / firstVisibleCellIsBold / firstVisibleCellHasCustomForeground loops. undimmedText remains only for the cursor suffix (afterCursor).
  • Added six cursor-reader regressions. New cases pin the blank-row cell-read bound (<= cols × (rows + 1) = 72 vs the old 132), reusable-cell reuse vs allocation, dimmed first-glyph styling with text excluded, first-visible-glyph selection skipping blank/later-styled cells, and unwritten cells rendering as spaces.
  • Reused the unused-default-RPC guard in two Qoder tests. Both files now import ./rpc/unused-default-rpc-methods.test-fixture first; test bodies are unchanged.
  • Made localization tests catalog-aware. The discard-copy test keeps an exact English copy assertion, then checks the five non-English locales against the live catalog value with an English fallback. The supported-agents fallback test switches to a synthetic empty locale bundle.
  • Documented the CI benchmarks in docs/reference/ci-runner-efficiency.md.

I verified the refactor's behavior equivalence against the removed loops: dim cells are still excluded from text but still eligible for the first-visible style, width-0 cells are still skipped, and empty cells still contribute a space. All five affected test files pass (47 tests) and check:code-quality:changed reports 0 new findings across the 6 changed files.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@nwparker
nwparker force-pushed the nwparker/ci-cursor-and-runtime-imports-20261005 branch from 1788a33 to 813b134 Compare October 5, 2026 08:58
Name the local hook confirmation function to avoid misclassifying internal selectors as dialog text.
@nwparker
nwparker force-pushed the nwparker/ci-cursor-and-runtime-imports-20261005 branch from 813b134 to c4a2877 Compare October 5, 2026 09:53
@nwparker
nwparker merged commit 1569e06 into main Oct 5, 2026
44 checks passed
@nwparker nwparker changed the title Reduce repeated terminal scans and unused Qoder test imports [CI] Reduce repeated terminal scans and unused Qoder test imports Oct 9, 2026
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.

1 participant