Skip to content

test(runtime): add a readiness census that pins every tui-idle verdict - #24336

Merged
Jinwoo-H merged 7 commits into
mainfrom
jinwoo/readiness-census
Oct 1, 2026
Merged

Jinwoo-H merged 7 commits into
mainfrom
jinwoo/readiness-census

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 222 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​6423 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​6423
Prod 6 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​842 $\color{#cf222e}{\Huge{\mathbf{−}}}$​3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​839

ELI5

Orca decides whether an agent's terminal is ready for input, busy, or waiting on the user. That decision is spread over many rules with special cases per agent. We plan to replace all of it with one rule engine (Linear STA-9098), and the replacement must not change any decision. This PR adds the safety net: a test that writes down every decision Orca makes today, for every recorded agent screen and a grid of made-up situations for every agent, and fails if any of them changes.

What Changed

Test-only. Nothing users see changes.

  • Recorded screens. Every captured agent terminal recording is replayed into a real runtime pane, one chunk at a time, at the grid size it was recorded at. That is 80 runtime recordings, OpenCode's 2 plus 3 non-agent controls (less, nano, vim), and Grok's 2 traces. For each chunk the test records what callers of terminal wait --for tui-idle would see:
    • the ready/working/blocked verdict at the moment the chunk lands;
    • the verdict 1 ms before the 3 s quiet window ends, and the verdict once it has ended;
    • what a wait started then returns, and whether it returned at once (@start) or on its first poll (@poll);
    • the same verdict and wait on a pane with no output clock (a restored or adopted pane).
      Each recording is replayed twice: once with the agent known, once as an agent-unknown pane. Each chunk is read only after the runtime has finished handling it, as a caller would. The verdict is read through the same runtime method every tui-idle waiter settles on, not by re-assembling the rule functions, so the rule rewrite can replace those freely.
  • Made-up situations. Each of the 43 agents is run through combinations of window title, the agent's own status messages (fresh or stale), what the screen holds, whether the agent or a shell is in the foreground, a workspace-trust dialog painted before or after the ready screen (blocked detection goes by which comes last), and whether the pane has an output clock. That is 1,735 cases, each read with and without an output clock (3,470 entries).
  • Baselines. These are committed JSON files under src/main/runtime/__fixtures__/readiness-census/, one per replayed pane (transcript--<recording>@agent.json / @unknown.json) or agent. Frames are run-length encoded, for example:
    "clocked": [
      "0-24: now=pending:closed edge=pending:closed quiet=pending:closed wait=pending",
      "25-28: now=pending:closed edge=pending:closed quiet=ready-strong wait=ready@start",
      "29-33: now=working edge=working quiet=ready-strong wait=ready@start",
    
    When a verdict changes, the failure names the recording, the pane and the frame range, and shows what it was before and what it is now. To regenerate: UPDATE_READINESS_CENSUS=1 pnpm test src/main/runtime/readiness-census. Recordings are found by scanning the fixture folders; a recording whose name matches no known agent fails until it is given one in readiness-census-transcript-catalog.ts, and one with no baseline fails until it is recorded.
  • The only change to existing code is in a test harness: splitTranscriptIntoChunks in agent-transcript-replay-test-harness.ts is now exported and has a clearer name. That lets the census send the harness's own chunks into a runtime pane instead of reimplementing the split.

Why

The refactor's whole promise is "no behaviour change". Today's behaviour depends on the order in which rules are checked. For example, an explicit idle title outranks the agent's own "working" status, and a Codex header only counts once the screen has gone quiet. A recorded per-frame baseline is the only practical way to show that a rewrite kept every one of those orderings.

Alternatives considered:

  • Extend the existing per-agent transcript suites. They only check the final frame with real-time waits. Checking every frame that way would take minutes.
  • Snapshot the evaluator with fake inputs only. That would skip the real title tracker, the screen-trust checks and the poll, which is exactly where lane-order behaviour lives.

The census instead drives the real OrcaRuntimeService, with a faked clock and a faked poll interval.

Checks that the census catches real changes. Each mutation was applied, then reverted:

  • Moving the working-title lane above the quiet-ready-screen lane in evaluateTuiIdle: 27 tests failed.
  • Removing the Cursor approval-prompt rule: 2 failed (cursor-agent-approval-prompt, frame 10, blocked becomes ready).
  • Changing the quiet window from 3000 ms to 2500 ms: 85 failed.
  • Dropping the poll's immediate first check for weak-ready evidence: 25 failed (wait=ready@start becomes ready@poll).

Linked Issue

Refs STA-9098

Visual Proof

N/A: test-only change, with no UI or behaviour change.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

On macOS:

  • pnpm test src/main/runtime/readiness-census passed 3 times in a row (218 tests, about 21 s wall time).
  • The replays are spread over six test files, balanced by frame count; the longest replay (one pane of a ~9,000-frame recording) takes about 15 s.
  • Reading after a full event-loop turn is stable: adding a further real 5 ms wait per chunk changed no baseline.
  • The existing transcript suites that use the harnesses (17 files) all pass.
  • pnpm tc:node, oxlint, the anti-slop lint and pnpm run check:code-quality:changed pass.

process.platform is pinned to darwin, so the verdicts do not depend on the CI host.

Not covered:

  • Waits on runtime-owned pty: handles. Every census pane is a leaf handle.
  • A clockless pane is simulated by clearing the output clock on a pane that has the full tail and screen. It is not a true restore that is seeded from a daemon snapshot.

AI Disclosure

Review

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Cross-platform: test-only, and the platform is pinned. SSH, mobile and wire compatibility: no change.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

Replays every recorded agent PTY transcript frame by frame through a real
runtime pane (agent-known and agent-unknown, clocked and clockless) and a
synthetic evidence matrix for all 43 TuiAgents, and compares each verdict
and tui-idle wait outcome to committed run-length-encoded baselines.

Refs STA-9098
A census that read TUI_IDLE_QUIESCENCE_MS would move with it; fixed 2999/3000 ms
reads and a fixed 2000 ms poll step make a changed window show as changed verdicts.

Refs STA-9098
@greptile-apps

greptile-apps Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Low risk] Test fixtures for runtime readiness verdicts.

The PR appears safe to merge, with the previously noted limitation in coverage of recorded quiet periods.

Findings

  1. P2 Recorded timing is lost ▶

Summary

The PR adds committed readiness baselines for recorded terminal screens and synthetic agent states, then compares them with verdicts from runtime panes.

  • Replays each recording with a known and an unknown agent, checking clocked and clockless verdicts and wait timing.
  • Adds a synthetic matrix covering titles, status, foreground process, screen state, and dialog order.

Reviews (3) · Last reviewed commit: "test(runtime): read the census baseline ..."

vi.setSystemTime(at)
let painted: Promise<void> = Promise.resolve()
runtime.onPtyData(TRANSCRIPT_PANE_PTY_ID, chunk, at, chunk.length, false, (completion) => {
painted = completion

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Recorded timing is lost The catalog retains chunk lengths but drops their timestamps, and this replay spaces every chunk 50 ms apart. The timed Codex sleep recording has a gap of more than three seconds between chunks, so the next now verdict is measured as if only 50 ms had passed. This limits the baseline's ability to catch readiness changes across real quiet periods. Use the recorded offsets when available.

@coderabbitai

coderabbitai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

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

🧰 Additional context used
📚 Code guidelines (1)
AGENTS.md — auto-discovered

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: 6ede5f7f-5131-4d24-bd72-22a3ae6ce980

📥 Commits

Reviewing files that changed from the base of the PR and between fa82161 and 50038b0.

📒 Files selected for processing (227)
  • src/main/runtime/__fixtures__/readiness-census/synthetic--aider.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--amp.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--ante.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--antigravity.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--aug.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--autohand.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--claude-agent-teams.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--claude.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--cline.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--codebuddy.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--codebuff.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--codex.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--command-code.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--continue.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--copilot.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--crush.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--cursor.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--devin.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--droid.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--dsh.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--freebuff.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--gemini.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--goose.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--grok.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--hermes.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--kilo.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--kimi.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--kiro.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--mimo-code.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--mistral-vibe.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--muse.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--omp.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--openclaude.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--openclaw.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--opencode.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--opencode2.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--pi.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--prime-agent.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--qoder.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--qwen-code.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--rovo.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--trae.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--zcode.json
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/transcript--codex-0157-config-override-embedded-warning@agent.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--codex-0157-config-override-embedded-warning@unknown.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--codex-0157-effort-override-embedded-warning@agent.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--codex-0157-effort-override-embedded-warning@unknown.json
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/readiness-census-baseline.ts
  • src/main/runtime/readiness-census-pane-probe.ts
  • src/main/runtime/readiness-census-synthetic-matrix.ts
  • src/main/runtime/readiness-census-synthetic.test.ts
  • src/main/runtime/readiness-census-transcript-catalog.ts
  • src/main/runtime/readiness-census-transcript-suite.ts
  • src/main/runtime/readiness-census-transcripts-1.test.ts
  • src/main/runtime/readiness-census-transcripts-2.test.ts
  • src/main/runtime/readiness-census-transcripts-3.test.ts
  • src/main/runtime/readiness-census-transcripts-4.test.ts
  • src/main/runtime/readiness-census-transcripts-5.test.ts
  • src/main/runtime/readiness-census-transcripts-6.test.ts
  • src/main/runtime/readiness-census.test.ts

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


📝 Walkthrough

Walkthrough

Adds a readiness-census harness that records clocked and clockless readiness and wait results. It adds synthetic cases for configured agents, transcript replay across agent and unknown panes, baseline comparison utilities, and stored expected observations. The replay tests run in six shards, and the fixtures record results across title, status, screen, foreground, and transcript states.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 50038

This change adds test coverage and recorded baselines for terminal-readiness decisions and does not alter production behavior. No blocking risk was found; it is ready to merge after normal CI.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 46.15% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 39 functions across 27 files. (214 skippe… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: adding a runtime readiness census that records tui-idle verdicts.
Description check ✅ Passed The description is comprehensive and covers the required sections, including scope, rationale, testing, visual proof, platform impact, and checklist items. The issue is referenced as Refs STA-9098 i…
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.
Full details: Docstring Coverage

Explanation

Docstring coverage is 46.15% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 39 functions across 27 files. (214 skipped: 214 unsupported.)

  • 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

Autopilot is currently an internal CodeRabbit preview.


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.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: a0ffd304-4863-4290-a450-ac14ac17e089

📥 Commits

Reviewing files that changed from the base of the PR and between ddd4927 and d1003b1.

📒 Files selected for processing (151)
  • src/main/runtime/__fixtures__/readiness-census/synthetic--aider.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--amp.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--ante.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--antigravity.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--aug.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--autohand.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--claude-agent-teams.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--claude.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--cline.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--codebuddy.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--codebuff.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--codex.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--command-code.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--continue.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--copilot.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--crush.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--cursor.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--devin.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--droid.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--dsh.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--freebuff.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--gemini.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--goose.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--grok.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--hermes.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--kilo.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--kimi.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--kiro.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--mimo-code.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--mistral-vibe.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--muse.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--omp.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--openclaude.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--openclaw.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--opencode.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--opencode2.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--pi.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--prime-agent.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--qoder.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--qwen-code.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--rovo.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--trae.json
  • src/main/runtime/__fixtures__/readiness-census/synthetic--zcode.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--antigravity-1-2-14-busy-streaming.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--antigravity-1-2-14-busy-thinking.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--antigravity-1-2-14-command-palette.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--antigravity-1-2-14-draft.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--antigravity-1-2-14-model-picker.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--antigravity-1-2-14-picker-dismissed.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--antigravity-1-2-14-ready-80x24.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--antigravity-1-2-14-ready-accept-edits.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--antigravity-1-2-14-ready-plan.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--antigravity-1-2-14-ready.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--antigravity-1-2-14-trust-dialog.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--antigravity-1-2-14-turn-ended.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--antigravity-busy-mid-turn.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--antigravity-busy-turn-ended.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--antigravity-dialog-command-palette.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--antigravity-dialog-dismissed.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--antigravity-dialog-model-picker.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--antigravity-dialog-trust-workspace.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--antigravity-ready-account-info-hidden.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--antigravity-ready-api-key-gemini-model.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--claude-dialog-trust-workspace-answered.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--claude-dialog-trust-workspace-narrow.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--claude-dialog-trust-workspace.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--cline-3-0-65-win32-startup.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--cline-3-0-66-busy-streaming.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--cline-3-0-66-draft.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--cline-3-0-66-permission.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--cline-3-0-66-promo.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--cline-3-0-66-ready-80x24.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--cline-3-0-66-ready-plan.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--cline-3-0-66-ready.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--cline-3-0-66-slash-menu.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--cline-3-0-66-turn-ended.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--codex-0-150-1-turn.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--codex-0-155-1-timed-turn.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--codex-0-157-1-timed-sleep-turn.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--codex-0-157-1-update-dialog.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--codex-0-158-0-approval.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--codex-0-158-0-timed-turn.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--codex-0-158-0-trustprompt.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--codex-0157-config-override-embedded-warning.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--codex-0157-effort-override-embedded-warning.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--codex-0157-fresh-home-daemon-install.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--codex-0157-hooks-review-dialog.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--codex-0157-model-retired-dialog.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--codex-0157-no-daemon-effort-override.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--codex-0157-plain-ready.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--codex-0157-update-available-dialog.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--codex-0158-fresh-home-greeting.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--codex-0158-hooks-review-dialog.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--codex-0158-model-announcement-dialog.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--codex-0158-model-retired-dialog.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--codex-0158-update-available-dialog.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--cursor-agent-approval-prompt.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--cursor-agent-idle-after-approval.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--cursor-agent-long-tool-call.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--daemon--less.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--daemon--nano.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--daemon--opencode-run.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--daemon--opencode.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--daemon--vim.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--dsh-tui-ready-no-key.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--freebuff-lifecycle.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--freebuff-login.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--freebuff-ready.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--freebuff-trust.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--grok--inline-startup.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--grok--startup.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--hermes-tui-ready.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--muse-empty-folder-ready.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--omp-native-title-win32.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--prime-agent-0-9-5-ready.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--prime-agent-0-9-5-turn.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--prime-agent-0-9-8-busy-streaming.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--prime-agent-0-9-8-draft.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--prime-agent-0-9-8-ready-80x24.json
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/[email protected]
  • src/main/runtime/__fixtures__/readiness-census/transcript--prime-agent-0-9-8-ready.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--prime-agent-0-9-8-slash-menu.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--prime-agent-0-9-8-tool-turn.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--prime-agent-0-9-8-trace-question.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--prime-agent-0-9-8-turn-ended.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--qoder-no-account.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--qoder-ready.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--qoder-trust-dialog.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--zcode-composer-ready.json
  • src/main/runtime/__fixtures__/readiness-census/transcript--zcode-missing-tui.json
  • src/main/runtime/agent-transcript-replay-test-harness.ts
  • src/main/runtime/readiness-census-antigravity.test.ts
  • src/main/runtime/readiness-census-baseline.ts
  • src/main/runtime/readiness-census-claude-cursor-qoder.test.ts
  • src/main/runtime/readiness-census-cline.test.ts
  • src/main/runtime/readiness-census-codex.test.ts
  • src/main/runtime/readiness-census-long-startups.test.ts
  • src/main/runtime/readiness-census-others.test.ts
  • src/main/runtime/readiness-census-pane-probe.ts
  • src/main/runtime/readiness-census-prime-agent-question-agent.test.ts
  • src/main/runtime/readiness-census-prime-agent-question-unknown.test.ts
  • src/main/runtime/readiness-census-prime-agent.test.ts
  • src/main/runtime/readiness-census-synthetic-a-to-k.test.ts
  • src/main/runtime/readiness-census-synthetic-l-to-z.test.ts
  • src/main/runtime/readiness-census-synthetic-matrix.ts
  • src/main/runtime/readiness-census-synthetic-suite.ts
  • src/main/runtime/readiness-census-transcript-catalog.ts
  • src/main/runtime/readiness-census-transcript-replay.ts
  • src/main/runtime/readiness-census-transcript-suite.ts
  • src/main/runtime/readiness-census.test.ts

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

}
let at = BASE_TIME_MS
vi.setSystemTime(at)
const { runtime, handle } = await createTranscriptPane(options)

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.

🚀 Performance & Scalability | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

#!/bin/bash
# Check whether the worktree-change invalidator registry is global and has an unregister path.
rg -nP -C4 '\bregisterWorktreeChangeInvalidator\s*\(' --type=ts
rg -nP -C3 '\bregisterDetectedWorktreeScanInvalidation\s*\(' --type=ts
# Look for a dispose or shutdown API on the runtime classes.
rg -nP -C2 '^\s*(public\s+)?(dispose|shutdown|destroy|close)\s*\(' src/main/runtime --type=ts

Repository: stablyai/orca

Length of output: 11944


Dispose each synthetic pane after the clockless read.

runSyntheticCase creates a new OrcaRuntimeService and transcript pane for every case. The runtime registers an instance callback in the module-global worktreeChangeInvalidators set and does not retain the unregister function. The pane and runtime therefore remain reachable after the case completes. Add cleanup in a finally block if the returned handle provides a teardown method. Otherwise, add an unregister or disposal path before running this matrix at scale.

@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

Test-only safety net for the STA-9098 readiness-rule rewrite. I read the full diff, replayed the relevant runtime code paths, and ran the census locally.

  • readiness-census-pane-probe.ts — evaluatePaneVerdict reproduces the leaf verdict exactly as runtime-terminal-wait.ts does (buildTerminalWaitText + leafTuiIdleEvidence), while probePaneWait drives the real waitForTerminal, so both the synchronous verdict and the wait outcome are pinned. asClocklessPane mutates the live leaf/pty clocks in place and restores them in finally, which is the only way the wait re-reads them.
  • readiness-census-baseline.ts — RLE encode/decode and describeCensusDiff are exact (no loose assertions); a missing or malformed baseline fails, and UPDATE_READINESS_CENSUS=1 is the only write path.
  • Synthetic matrix — 43 agents crossed over title × first-party status, then screen trust × foreground under the open-lane titles, each read clocked and clockless. The \x1b]9999;{state,agentType} OSC is accepted by the runtime (baselines show status-driven verdicts), so the status lanes are genuinely exercised.
  • Transcript catalog/replay — literal FIXTURE_NAMES, per-recording grid from .meta.json, and recorded chunk boundaries from .timing.json for the timed codex fixtures; each recording replayed agent-known and agent-unknown.
  • readiness-census.test.ts — coverage invariants (every recording replayed exactly once, no orphan baselines) plus encoding unit tests.
  • agent-transcript-replay-test-harness.ts — splitIntoChunks exported as splitTranscriptIntoChunks; the only change to existing code.

Verification: pnpm test src/main/runtime/readiness-census passes locally on Linux (136 tests, ~79 s), a second run of both synthetic suites passes (43 tests), and the working tree stays clean. The Linux run reproduced the committed macOS baselines, confirming the darwin pin and the fake-timer scoping hold. Combined with the mutation evidence in the PR description, the baselines are a real regression guard rather than a tautology.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

…sible waits

- Read each verdict through the runtime's own settle seam (evaluateTuiIdleForLeaf) instead
  of re-wiring evaluateTuiIdle/leafTuiIdleEvidence/buildTerminalWaitText, so the census is
  coupled to one runtime method, not to the module STA-9098 rewrites.
- Let the runtime finish each chunk (one macrotask turn) before reading. The old read raced
  work chained on the paint, so 14 frames pinned a microtask-ordering artefact.
- Record when a wait settles (@start vs @poll), not just its outcome.
- Exit each pane's PTY after reading it so its emulator is freed.
- Replace the hand-grouped families, literal fixture list and per-pane split flag with a
  directory-scanned catalog, one baseline per replayed pane, and size-balanced shards.
- Run the synthetic matrix in one file; it takes about 2 s.
…e in the census matrix

Blocked detection is position-ordered (design doc 11.5): the later of a blocker and a ready
anchor wins. The matrix now paints a workspace-trust dialog after, and before, each agent's
ready screen under every title, so a rule engine that loses that ordering fails per agent.
The anti-slop lint rejects Reflect.get on parsed input.

@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

Incremental review of the delta since the prior pullfrog review (d1003b1d10): the census harness refactor, the sharding, and the dialog-order matrix additions. The pinned baselines and the mutation evidence are unchanged.

  • Verdict read through the runtime seam — readiness-census-pane-probe.ts no longer hand-assembles buildTerminalWaitText + leafTuiIdleEvidence; readVerdict calls evaluateTuiIdleForLeaf, the same protected method RuntimeTerminalWait.evaluateLeaf uses (orca-runtime-resolve-exit-waiters.ts:124), so the census tracks the waiter's ranking rather than mirroring it.
  • Shared pane-driving helpers — feedPane (fake time, onPtyData completion, one macrotask turn), closePane, and observePane (now/edge/quiet + wait + clockless) replace the per-suite copies, and probeWait now distinguishes @start from @poll.
  • Environment pinned once — useCensusEnvironment owns the darwin platform pin and the Date/setInterval fake-timer scope for both transcript and synthetic suites.
  • Matrix gains dialog ordering — dialog-last / ready-last screen variants cross the trust dialog against every title, with CENSUS_AGENTS relocated here.
  • Catalog scans instead of listing — FIXTURE_NAMES is replaced by a directory scan with prefix/short-name recorders; coverage now keys on per-pane subjects (@agent / @unknown) sharded across six workers by frame count.
  • Consolidated suites — nine family files plus readiness-census-transcript-replay.ts collapse into six transcripts-N.test.ts shards and one synthetic file.

Verification: pnpm test src/main/runtime/readiness-census passes on Linux (8 files, 218 tests, ~62 s), reproducing the committed baselines, which confirms the refactored verdict read and the new sharding are behavior-preserving.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

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