Repository navigation
test(runtime): capture real Antigravity transcripts — the detector is inverted on live output - #19983
Conversation
…tigravity readiness Antigravity readiness has been written five times against a five-line screen typed from memory. There is no Antigravity transcript in this repository, so every attempt was a guess tested against another guess. This adds the recorder, the protocol and the fixture-driven suite so the sixth attempt can be written against evidence, and changes no detector logic. - config/scripts/capture-agent-pty-transcript.mjs records a live agent session through a real PTY, escapes and wrapping intact. Ctrl-] is consumed by the recorder and never forwarded, which is the only way to end a capture while a dialog still owns the screen. - config/scripts/pty-transcript-secret-scan.mjs finds account identifiers and credentials, redacts them with same-length placeholders so wrapping survives, and recognises its own placeholders so a scrubbed file verifies clean. - src/main/runtime/antigravity-readiness-transcripts.test.ts asserts a verdict per transcript and skips by name until the transcripts land, with a doc-coverage ratchet and a guard that a fixture contains escape bytes. The escape-byte guard exists because the three cursor-agent fixtures carry a comment claiming they were captured verbatim through Orca, yet contain zero ESC bytes and zero carriage returns. That comment is corrected here to say what those files are; the fixtures and the rules built on them are untouched.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (9)
💤 Files with no reviewable changes (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughThe change adds a PTY transcript recorder with timed input, secret scanning, redaction, and metadata output. It documents transcript capture and Antigravity readiness evidence requirements. It adds captured Antigravity fixtures and updates readiness tests to validate transcript-based verdicts, including known detector defects. A shared runtime harness now replays transcripts for readiness and terminal visibility tests. Repository instructions and an npm script support the workflow. Priority: ➖ Normal Merge Risk: 🟡 Moderate · up to The transcript workflow can expose credentials or lose captures, and its readiness evidence can still validate incomplete or misleading states. Resolve these issues before relying on the new captures for readiness changes. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 38.10% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 21 functions across 6 files. (6 skipped: 6 unsupported.) Full details: Description checkExplanation The description provides detailed scope, rationale, evidence, testing, and safety information, but it omits several required template sections, including the mandatory linked issue, visual proof or N/A, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist. Resolution Add all missing template sections. Include a real issue reference after “Fixes #”, provide visual proof or write “N/A” with a reason, complete AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist sections, and record the required validation results and platform coverage.
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 6fffc818-ac2b-4a37-91f8-44e4ae98d805
📒 Files selected for processing (11)
.gitignoreAGENTS.mdconfig/scripts/capture-agent-pty-transcript.mjsconfig/scripts/pty-transcript-secret-scan.mjsconfig/scripts/pty-transcript-secret-scan.test.mjsdocs/reference/agent-pty-transcript-capture.mddocs/reference/antigravity-readiness-evidence.mdpackage.jsonsrc/main/runtime/agent-transcript-pane-test-harness.tssrc/main/runtime/antigravity-readiness-transcripts.test.tssrc/main/runtime/terminal-interactive-wait-visibility.test.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.
| } | ||
|
|
||
| function writeMeta(outPath, details) { | ||
| const metaPath = outPath.replace(/\.txt$/, '.meta.json') |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Do not overwrite transcripts with metadata.
--out accepts paths without a .txt suffix. After the capture completes, writeMeta leaves such paths unchanged and writeFileSync replaces the transcript with metadata. Use a distinct sidecar path for every supported output filename.
Proposed fix
- const metaPath = outPath.replace(/\.txt$/, '.meta.json')
+ const metaPath = outPath.endsWith('.txt')
+ ? outPath.replace(/\.txt$/, '.meta.json')
+ : `${outPath}.meta.json`📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const metaPath = outPath.replace(/\.txt$/, '.meta.json') | |
| const metaPath = outPath.endsWith('.txt') | |
| ? outPath.replace(/\.txt$/, '.meta.json') | |
| : `${outPath}.meta.json` |
| command: details.command, | ||
| cols: details.cols, | ||
| rows: details.rows, | ||
| note: details.note, |
There was a problem hiding this comment.
🔒 Security & Privacy | 🛡️ Analyzed with Security Review | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Verify whether any repository-owned gate scans transcript metadata.
rg -n -C 4 \
'meta\.json|details\.command|details\.note|scanTranscriptForSecrets|redactTranscript' \
config/scripts package.json AGENTS.mdRepository: stablyai/orca
Length of output: 13304
🏁 Script executed:
sed -n '145,215p' config/scripts/capture-agent-pty-transcript.mjs
printf '\n--- repository guidance ---\n'
rg -n -C 4 'captured transcript|account identifier|scrub|credential|meta\.json' AGENTS.md config README.md package.json 2>/dev/null || trueRepository: stablyai/orca
Length of output: 50371
Sensitive Data Exposure
Reachability: Internal
Exploitability: Moderate
CWE: CWE-312 — Cleartext Storage of Sensitive Information
Scan metadata before writing the sidecar.
writeMeta stores command and note verbatim, while the scrub check scans only the transcript. Credential-bearing arguments or notes can therefore reach the committed .meta.json file. Scan the serialized metadata or sanitize these fields before writing the sidecar.
Source: Coding guidelines
| describe('Antigravity readiness, decided by captured transcripts', () => { | ||
| for (const transcript of TRANSCRIPTS) { | ||
| const path = fixturePath(transcript.name) | ||
| const captured = existsSync(path) |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
Require the metadata sidecar for every captured fixture.
If <name>.txt exists without <name>.meta.json, captured is true and the readiness tests can pass without the capture protocol’s platform, PTY size, CLI/account note, or exit code. Add a per-fixture assertion that the metadata sidecar exists whenever the transcript exists.
There was a problem hiding this comment.
Important
Two issues to address before merging: the refusal cases in the new Antigravity suite will fail spuriously on the very silent dialogs they exist to catch, and the security-critical scrub module is committed as a binary file (a literal NUL byte), so its code is invisible in this and every future diff.
Reviewed changes — this PR adds capture/scrub/test scaffolding so a future "attempt six" of the Antigravity readiness detector can be pinned to real PTY transcripts. No detector logic changed.
- Recorder —
config/scripts/capture-agent-pty-transcript.mjsdrives a real PTY via node-pty, mirrors the session to the operator, and appends raw bytes to a__fixtures__/<name>.txtfixture plus a.meta.jsonsidecar; Ctrl-] ends a capture without dismissing the dialog. - Secret scan/redaction —
config/scripts/pty-transcript-secret-scan.mjsand its.test.mjsimplement same-length redaction and shape-based scanning, and re-scan every committed__fixtures__/*.txtin CI. - Transcript suite —
src/main/runtime/antigravity-readiness-transcripts.test.tsis table-driven over eightantigravity-*.txtnames (skipping by name until they land), with a doc-coverage ratchet and two self-checks proving the harness reaches both verdicts. - Harness extraction —
src/main/runtime/agent-transcript-pane-test-harness.tsis pulled out of the cursor-agent suite and shared with the new one. - Docs —
agent-pty-transcript-capture.md(recorder + scrub protocol) andantigravity-readiness-evidence.md(captures A–D and per-attempt falsifiable questions), both allow-listed in.gitignoreand linked fromAGENTS.md.
⚠️ The secret-scan module is committed as a binary file
config/scripts/pty-transcript-secret-scan.mjs — the one file here that encodes the security boundary — contains literal 0x00 (NUL) and 0x1f control bytes, not the escaped \x00-\x1f text, inside the preview regex. Git therefore classifies the file as binary (git diff --numstat reports - -, and this PR's own diff renders it as "binary file or no changes"), so the scrub patterns and redaction logic are invisible to this and every future review.
Technical details
# Secret-scan module is binary; restore it to text
## Affected sites
- config/scripts/pty-transcript-secret-scan.mjs:117 — `return head.replace(/[<0x00>-<0x1f>]/g, '?')`
carries a literal NUL and 0x1f byte in the character class.
## Evidence
- `xxd` of line 117: `6570 6c61 6365 282f 5b00 2d1f 5d2f 672c` — i.e. `replace(/[` + `0x00` + `-` + `0x1f` + `]/g,`.
- `git diff --numstat --merge-base main -- config/scripts/pty-transcript-secret-scan.mjs` → `- -` (binary).
- `.gitattributes` marks `/config/scripts/**/*.mjs text eol=lf`, but the `text` attribute does not
override git's NUL-byte binary detection for diffs.
## Required outcome
- The regex is written as escaped ASCII text: `replace(/[\x00-\x1f]/g, '?')` (or `[\u0000-\u001f]`),
so the file diffs as text and the scrub logic is reviewable.
## Suggested approach
- Replace the two literal bytes on that line with the `\x00` / `\x1f` escapes. Verify with
`git diff --numstat` no longer showing `- -`, and confirm
`LC_ALL=C grep -nP '[\x00-\x08\x0b\x0c\x0e-\x1f]' config/scripts/pty-transcript-secret-scan.mjs`
returns nothing.ℹ️ The scrub gate never scans the committed sidecar
Both the capture-time scan (runCapture) and the CI ratchet (pty-transcript-secret-scan.test.mjs) read only the .txt transcript. The <name>.meta.json sidecar written alongside it carries the free-form --note and the full command, and is committed unscanned — the docs cover it only as a manual "check the sidecar too" step. Given the PR's own framing ("the scrub gate is the only thing standing between a live transcript and a committed account identifier"), an operator who puts an email or a --api-key in --note/args would commit it with no automated guard.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
…y prove
`agy` 1.1.25 turned out to be installed, so the transcripts this scaffold was
built for now exist. Six are recorded from live sessions and committed; the
rest are named as skipped, because reaching them would mean signing the
operator out or deleting their config.
The captures invert the story. On real output the shipped detector refuses a
genuinely ready screen and accepts a live `/model` picker:
- Antigravity paints a block-glyph logo down the left, so the model row never
starts a line. `startsWith('gemini', trimmedStart)` cannot match a real ready
screen, on any account or model. Stripping the logo flips the same screen to
ready, which means a decorative glyph decides readiness today.
- The `/model` picker prints `Gemini 3.x Flash` one per line, at line start, and
a bare `>` composer sits earlier in the tail. Both halves of the rule are
satisfied while a dialog owns the screen.
- For an API-key user the identity row reads `Gemini API key` — no `@`, no
domain — and `AGY_CLI_HIDE_ACCOUNT_INFO=1` removes the row entirely. The
account-row requirement of attempts 4 and 5 can never pass for those users.
- The banner is printed once and never reprinted after a dialog is dismissed, so
`headerIndex` cannot be the ordering anchor.
Four suite cases are pinned as KNOWN DEFECT: they assert what the detector does
so CI stays honest instead of permanently red, and flip to failing the moment
someone fixes it. No detector logic changed.
The recorder gains `--send "<ms>:<text>"` because a dialog capture has to be
driven and an unattended run has no TTY, and the scrub scanner gains a UUID rule
because agy prints a resumable conversation id on exit.
There was a problem hiding this comment.
ℹ️ No critical issues. The prior refusal-timeout concern is addressed cleanly, the six committed transcripts assert correctly against the current detector, and every touched suite passes (26/16 antigravity, 22/22 secret-scan, 27/27 cursor). One minor doc inconsistency noted inline.
Reviewed changes — since the prior review this PR added the real Antigravity captures and pivoted the suite from skip-by-name to asserting against them.
- Six live transcripts committed —
antigravity-*.txtfixtures (ready ×2, trust dialog, model picker, command palette, dismissed picker) with.meta.jsonsidecars, recorded fromagyTUI 1.2.0 on macOS. - Scripted capture input — a new
--send "<ms>:<text>"flag drives dialogs unattended viaparseSend, with\r \n \t \eescapes delivered through the same PTY a human's keystrokes would use. - KNOWN DEFECT inversion —
TranscriptCase.knownDefectpins the four cases where the shipped detector contradicts the transcript, so CI asserts current behavior and flips red when a future fix lands. - Verdict refactor —
readinessVerdictnow takes atimeoutMsand returns{ ready, blockedReason, outcome }, catching the wait timeout so a silent dialog resolves toready: falseinstead of rejecting. - UUID scanner — the secret scan now flags the resumable
agy --conversation=id, and the evidence doc is rewritten from a capture checklist to the measured results.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
|
|
||
| ## Agent Terminal Screens | ||
|
|
||
| A rule that reads what an agent CLI paints on a terminal — readiness, blocked prompts, idle — must be written against a captured transcript, not a remembered screen. Record one with [`docs/reference/agent-pty-transcript-capture.md`](./docs/reference/agent-pty-transcript-capture.md), which keeps escapes and wrapping intact and scrubs account identifiers before they reach git. Antigravity readiness has no transcript yet and five failed attempts without one; before touching it, read [`docs/reference/antigravity-readiness-evidence.md`](./docs/reference/antigravity-readiness-evidence.md). |
There was a problem hiding this comment.
This sentence is stale now that this PR commits six transcripts. It still asserts "Antigravity readiness has no transcript yet", but src/main/runtime/__fixtures__/antigravity-*.txt now exists — a future agent reading this will think it needs to capture from scratch. Update it to point at the committed fixtures.
There was a problem hiding this comment.
Actionable comments posted: 4
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 01866103-3740-4e50-b975-bc853647542e
📒 Files selected for processing (18)
config/scripts/capture-agent-pty-transcript.mjsconfig/scripts/pty-transcript-secret-scan.mjsconfig/scripts/pty-transcript-secret-scan.test.mjsdocs/reference/agent-pty-transcript-capture.mddocs/reference/antigravity-readiness-evidence.mdsrc/main/runtime/__fixtures__/antigravity-dialog-command-palette.meta.jsonsrc/main/runtime/__fixtures__/antigravity-dialog-command-palette.txtsrc/main/runtime/__fixtures__/antigravity-dialog-dismissed.meta.jsonsrc/main/runtime/__fixtures__/antigravity-dialog-dismissed.txtsrc/main/runtime/__fixtures__/antigravity-dialog-model-picker.meta.jsonsrc/main/runtime/__fixtures__/antigravity-dialog-model-picker.txtsrc/main/runtime/__fixtures__/antigravity-dialog-trust-workspace.meta.jsonsrc/main/runtime/__fixtures__/antigravity-dialog-trust-workspace.txtsrc/main/runtime/__fixtures__/antigravity-ready-account-info-hidden.meta.jsonsrc/main/runtime/__fixtures__/antigravity-ready-account-info-hidden.txtsrc/main/runtime/__fixtures__/antigravity-ready-api-key-gemini-model.meta.jsonsrc/main/runtime/__fixtures__/antigravity-ready-api-key-gemini-model.txtsrc/main/runtime/antigravity-readiness-transcripts.test.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.
| } | ||
| term.write(chunk.toString('binary')) | ||
| }) | ||
| // Why scripted input: a dialog capture has to be driven, and CI (or an agent) has no TTY to | ||
| // type into. The keystrokes ride the same PTY a human's would, so the capture is unchanged. | ||
| const sendTimers = options.sends.map((send) => setTimeout(() => term.write(send.text), send.atMs)) | ||
| const durationTimer = options.duration === null ? null : setTimeout(stop, options.duration * 1000) | ||
|
|
||
| const exitCode = await new Promise((resolveExit) => { | ||
| term.onExit(({ exitCode: code }) => resolveExit(code ?? 0)) | ||
| }) | ||
| for (const timer of sendTimers) { | ||
| clearTimeout(timer) | ||
| } | ||
| if (durationTimer !== null) { | ||
| clearTimeout(durationTimer) | ||
| } |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Require --out to end in .txt. parseArgs() accepts any --out value, and runCapture() writes the transcript before writeMeta() derives the sidecar with outPath.replace(/\.txt$/, '.meta.json'). With --out /tmp/capture, the path is unchanged, so writeFileSync() overwrites the transcript with metadata JSON. Reject non-.txt paths or derive a distinct sidecar path.
|
|
||
| ### 5. Dialogs are drawn two different ways, and the banner is never reprinted | ||
|
|
||
| The trust dialog and the sign-in splash take the **alternate screen** (`ESC[?1049h` … `ESC[?1049l`). |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🤖 get_repo_knowledge executed:
get_repo_knowledge stablyai/orca /tmp/coderabbit-repo-knowledge/stablyai-orca-89dc44e4/learnings
Length of output: 41659
🏁 Script executed:
#!/bin/bash
set -e
file="docs/reference/antigravity-readiness-evidence.md"
printf '%s\n' '--- targeted file excerpt ---'
sed -n '35,55p;105,120p' "$file"
printf '%s\n' '--- file references to sign-in, splash, transcript, and capture ---'
rg -n -C 2 -i 'sign[- ]in|splash|transcript|captur|observ|unobserv|alternate screen|1049' "$file"Repository: stablyai/orca
Length of output: 11841
Separate observed and unobserved sign-in behavior.
The fixture table marks antigravity-dialog-sign-in.txt as not captured, while the findings cite the sign-in splash as transcript evidence. Remove this claim or cite an independent source and label it as unobserved.
| present in every ready capture and absent from every dialog capture, because a dialog's `>` always | ||
| carries its selected row's label. This is a much narrower rule than any attempt used, and it is | ||
| the only one that survived contact with the transcripts. |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Do not treat a bare > as dialog-exclusive in the retained tail.
Lines 91-94 show that the live model picker retains a bare > from before the picker opened. Lines 76 and 93 show that this causes the false-ready result. Rewrite this rule to require the current bottom-row content or equivalent screen-state evidence; a bare retained-tail match is not sufficient.
| capture: 'C', | ||
| what: 'update banner owning the screen', | ||
| expectReady: false | ||
| } | ||
| ] |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
Require and validate the matching metadata sidecar for every captured transcript. The suite checks only whether <name>.txt exists and never reads <name>.meta.json, so deleting the sidecar can leave the readiness and raw-escape assertions active. This bypasses the documented provenance for the capture conditions, PTY size, command, platform, and CLI/account details.
Answers the busy-frame question a P1 review raised against attempt six, with two new captures from a live turn. At the frame level the review is right: a busy frame parks the caret with the same bytes as an idle one, `CR ESC[2A ESC[2C`, and the only differing row — `esc to cancel` versus `? for shortcuts` — is erased by that park. At the retained-tail level it does not reproduce. Each spinner tick is its own repaint with its own `CR ESC[2A`, two rows higher than the frame's, which splices the composer away: a live turn's tail ends on `⣟ Generating...`, with no bare caret to match. A constructed input that keeps the park and edits only the status text is not faithful, because a live turn has a spinner row repainting below the composer. The residual is the gap between a frame park and the next tick, where the tail does end on the bare caret. Quiescence-gated paths are safe there because ticks keep arriving; text-only paths are not, and for those the capture supports one clause: a braille glyph on the last visible line means working. That predicate already exists here for cursor-agent and should be reused, scoped to the last line — a first-run transcript prints `⠾ Signing in...` during startup. Also in this commit, from the same review: - pty-transcript-secret-scan.mjs held raw 0x00-0x1f bytes in a character class, so the one file gating real PTY data into history was binary to git and unreviewable in a diff. It now tests codepoints, which the formatter cannot fold back into control bytes. - Pin `src/main/runtime/__fixtures__/*.txt` as -text. A Windows checkout would otherwise normalise line endings and rewrite the CR bytes that make these files evidence. The recorder now stops appending at the stop moment rather than through shutdown: an agent repaints an idle frame on its way out, which was overwriting the mid-turn state the capture existed to record.
There was a problem hiding this comment.
ℹ️ No critical issues. The secret-scan binary-file fix is clean, the two mid-turn captures pin the right verdicts, and the
.gitattributesrule needs one scoping tweak (inline) so it stops swallowing the diffablecursor-agent-*.txtfixtures.
Reviewed changes — since the prior review this PR added two live mid-turn captures and made the scrub module reviewable again.
- Made the secret-scan module reviewable —
previewnow testscodePointAt(0) < 0x20instead of a literal control-byte character class, restoring the file to text so the scrub patterns diff normally (resolving the prior must-address finding). - Captured two busy-state transcripts —
antigravity-busy-mid-turn(spinner live) andantigravity-busy-turn-ended(composer returned after a backend error), each with a table case: one plain refusal, one KNOWN DEFECT pin. - Stopped recording before the kill — a
recordingflag keeps the shutdown repaint out of the transcript, so a mid-turn capture ends on the captured state rather than an idle frame. - Pinned fixture byte-ness —
.gitattributesmarks runtime fixture transcripts-textso real CR/CRLF bytes survive a Windows checkout. - Documented busy-vs-idle — evidence doc section 8 records that busy and idle frames park the caret identically and the braille-spinner clause is the only surviving discriminator.
ℹ️ Nitpicks
docs/reference/antigravity-readiness-evidence.md:127— the new section is## 8.(h2), but it follows### 6.(h3) and there is no section 7 (that finding moved to the cross-cutting table). Make it### 7.(or renumber) and keep the###level so it stays nested under "What the transcripts show".
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
| # Captured agent PTY transcripts. -text, not `text eol=lf` like the wrapper snapshots above: | ||
| # these carry real CR and CRLF bytes as the terminal emitted them, and line-ending | ||
| # normalisation on a Windows checkout would rewrite the evidence the fixture exists to be. | ||
| /src/main/runtime/__fixtures__/*.txt -text |
There was a problem hiding this comment.
The -text rule also matches cursor-agent-*.txt, which are laundered text fixtures (the visibility suite's header notes they carry "no escape bytes and no carriage returns") and are edited when the approval-prompt wording rules change. Marking them binary hides future edits from review — the same "binary file or no changes" problem this PR just fixed in the secret-scan module. Scope the rule to the captured transcripts (/src/main/runtime/__fixtures__/antigravity-*.txt -text) and pin the cursor-agent fixtures with text eol=lf instead.
…atchet pty-transcript-secret-scan.test.mjs asserts that the capture recorder routes an 'agy.cmd' shim through cmd.exe, so the shim literal it names is the assertion, not a spawn. Fits the existing assert-on-shim-files category.
There was a problem hiding this comment.
ℹ️ No new issues in this commit. The batch-shim ratchet allowlist entry is correct and self-policing.
Reviewed changes — since the prior review this PR added one commit that unblocks CI: the Windows batch-shim ratchet was failing on the new secret-scan test.
- Allowlisted the transcript scan test in the batch-shim ratchet —
config/scripts/pty-transcript-secret-scan.test.mjscarries a quoted'agy.cmd'literal in an assertion pinning thatresolveSpawnroutes a Windows shim throughcmd.exe, which the text ratchet flags as a spawn. Added under the existing "Write or assert on shim files rather than spawning one." category, where the companion "has no stale allowlist entry" test keeps the entry honest — it fails if the literal is ever removed.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

What
Orca's Antigravity readiness detector has been written five times, each version tuned against a five-line screen typed from memory into a
.spec.tsfixture. Three of the first four were found worse than the bug they replaced; the fifth (#19749) was reverted after it still returnedready=falsefor the personal/API-key user it existed to unwedge and flipped five silent startup dialogs toready=true.This PR builds the capture tooling, then uses it: six transcripts recorded from a live
agyon macOS are committed here, and they show the shipped detector is inverted on real output — it refuses a genuinely ready screen and accepts a live/modelpicker.No detector logic changed. The
src/main/runtime/terminal-wait-detection.tsdiff is empty. Attempt six is deliberately not written; the evidence and the assessment come first.What the real transcripts prove
Full evidence, with the fixture and line for each claim, is in
docs/reference/antigravity-readiness-evidence.md. The load-bearing findings:1. The model row never starts a line. Antigravity paints a block-glyph logo down the left, and the identity, model and path rows are painted on the same physical lines as the logo. What Orca derives is:
The detector requires
startsWith('gemini', trimmedStart)on a trimmed line. The trimmed line starts with▀. Measured three ways:isKnownReadyPromptPreviewfalsetrue/modelpickertrueA decorative glyph — suppressible with
AGY_CLI_HIDE_LOGO— is what decides readiness today. This is not a Gemini-vs-non-Gemini problem, which is what all five attempts assumed. EvenGemini 3.7 Flash (Low)fails.2. The dialog supplies the model line the ready screen cannot.
/modelprintsGemini 3.8 Flash,> Gemini 3.7 Flash (current),Gemini 3.1 Pro— one per line, at line start — and a bare>composer sits earlier in the tail. Both halves of the rule are satisfied while the picker owns the screen.3. There is no email account row, and the row is switchable off. For an API-key user the identity row reads literally
Gemini API key. Separately,AGY_CLI_HIDE_ACCOUNT_INFO=1(a supported env var in the binary) removes the row from a fully ready screen — captured as its own fixture. The account-row requirement of attempts 4 and 5 can never pass for those users.4. The banner is never reprinted. After dismissal the CLI prints
⎿ Exited /model commandand redraws the composer only, soheaderIndexnever advances and cannot be the ordering anchor.5. Dialogs are drawn two different ways. The trust dialog and sign-in splash take the alternate screen (
ESC[?1049h); the picker and palette are drawn in place. 6.>is the dialog selection marker too (> Yes, I trust this folder), so the "accept any line beginning with>" relaxation proposed in #15840/#15852 would make the trust dialog read as ready. 7.agysets no OSC title at all, so title-based readiness is unavailable for this agent.Version note:
agy --versionreports 1.1.25 while its own banner prints Antigravity CLI 1.2.0. Any version-keyed rule must read the banner and tolerate the two disagreeing. The 1.1.17 mode-banner claims in #15840/#15852 (sourced from a screenshot) could not be reproduced: on 1.2.0 the idle composer is a bare>.Confirm / refute, by attempt
Gemini>>headerIndexadvancesESC[?1049hAGY_CLI_HIDE_ACCOUNT_INFOCan attempt six be written?
Yes, but not as a variation on any of the five — every one refined a predicate over
\n-delimited lines, and that is the layer where the evidence says the information is not.The only marker that survived contact with the transcripts is a line whose entire trimmed content is
>: present in every ready capture, absent from every dialog capture (a dialog's>always carries its row label). The model-row requirement should be dropped (it matches dialogs, not ready screens), the account row must not be required, andheaderIndexcannot anchor ordering. The blocked-signal path already refuses the trust dialog correctly today, by wording.Still unknown before shipping: the sign-in, theme, privacy and update dialogs, and accept-edits/plan mode, where the composer may not be a bare
>. The durable fix is to ask the terminal emulator what the bottom row of the screen is, rather than infer it from a byte stream written with cursor addressing.The recorder
config/scripts/capture-agent-pty-transcript.mjs(alsopnpm capture:agent-transcript) allocates a real PTY, mirrors the session so an operator can drive it, and appends every byte tosrc/main/runtime/__fixtures__/<name>.txtwith escapes, CRs and wrapping intact, plus a.meta.jsonsidecar. Two details that matter operationally:Added while capturing:
--send "<ms>:<text>"(a dialog capture has to be driven, and an unattended run has no TTY — the keystrokes ride the same PTY a human's would), and a UUID rule in the scanner, becauseagyprints a resumable conversation id on exit. That id was found by the scanner and redacted before commit; all nine committed transcripts scan clean.What could not be captured, and why
Nothing was faked or approximated. Each of these needed a change to the operator's account or config, which was out of bounds:
"You are currently not signed in"; it authenticates fromGEMINI_API_KEY). Reaching it means signing someone inagy modelsoffers 11 models, all Gemini;settings.jsonpinsmodelProvider: geminimodelProvideris pinned. Reaching it means editing theirsettings.json/themecommand exists in 1.2.0; onboarding only, which means deleting their configEach remains a named, skipping case so it stays visible.
The scaffold
src/main/runtime/antigravity-readiness-transcripts.test.tsreplays raw bytes throughOrcaRuntimeService.onPtyData→waitForTerminal('tui-idle')— the same path as the reportedworker-start agent_readinesswedge — and takes the pane title from the transcript's own OSC bytes.19 passed | 16 skipped, skipping by name.16 passed | 10 skipped, of which 4 are pinned KNOWN DEFECT cases asserting what the detector does (must be ready; KNOWN DEFECT, refused: the model row never starts a line, the logo shares it). CI stays honest rather than permanently red, and fixing the detector flips those to failing — which is exactly when the expectations need re-reading. The correct answer stays inexpectReadyand in each test's name.One scaffold bug the real captures exposed and this PR fixes:
waitForTerminalrejects on timeout rather than resolving, so "never became ready" surfaced as an error instead of a verdict. The helper now maps rejection toready: false, which is what the orchestrator does.The ESC-byte guard, and why it exists
A guard against a mistake already made in this repo. The three
cursor-agent-*.txtfixtures carry the comment "Captured verbatim from cursor-agent … driven through Orca" yet contain zero ESC bytes and zero carriage returns — renderer- and clipboard-laundered text. They evidence wording and glyphs, which is all the rules built on them key on, and nothing about the caret, repaints, or the alternate screen. Had a real capture existed, finding 5 above (alt-screen) would have been visible years ago. This PR corrects that comment only; the fixtures and the rules on them are untouched, and that suite still passes 27/27.Testing
pnpm teston the three suites:61 passed | 4 expected fail | 10 skippedbefore the defect-pinning refactor;16 passed | 10 skippedfor the Antigravity suite as committed, cursor-agent27 passed, scanner22 passed.pnpm tc:node/tc:cli/tc:webclean, run sequentially.oxlintandoxfmt --checkclean on every touched file.pnpm run check:code-quality:changed— 0 new findings.config/scripts/pty-transcript-secret-scan.test.mjs.Operator-state safety
The ready-screen captures ran in a directory the CLI already trusted, so no trust answer was written to the operator's config. No login state was changed, no settings were edited, and no dialog was forced by mutating anything on disk. The one knob used,
AGY_CLI_HIDE_ACCOUNT_INFO=1, is an environment variable scoped to a single child process.CI fix: one entry added to the batch-shim ratchet allowlist
The first CI run failed one test —
config/scripts/windows-cmd-shim-spawn-boundary.test.mjs > has no unlisted script naming a Windows batch shim— withconfig/scripts/pty-transcript-secret-scan.test.mjsas the lone offender.That ratchet is a text match on any quoted
.cmd/.batliteral in a newconfig/scripts/ortests/tools/script. The literal it found is in an assertion, not a spawn:The test is pinning that the recorder routes a Windows shim through
cmd.exe— asserting the very behaviour the ratchet exists to enforce. A text ratchet cannot distinguish an assertion from a spawn; its own docblock names that as the ceiling of the approach. (The producer,capture-agent-pty-transcript.mjs, escapes the scan only because it matches with a regex rather than a quoted literal.)So the file is added to
WINDOWS_SHIM_SPAWN_ALLOWLISTunder the existing "Write or assert on shim files rather than spawning one." category, alongside the other.test.mjsentries.Why the allowlist rather than rewriting the literal: obfuscating it (
`agy.${'cmd'}`) would keep the list from growing but silently defeat the ratchet for every future reader. The docblock's "the list only shrinks" is the right default, and this is a deliberate exception with precedent — #18100 grew the same list forbuild-linux-local.mjs. The entry is also self-policing: the companionhas no stale allowlist entrytest fails if the literal is ever removed, so the line cannot rot into a silent exemption.Nothing else in the shard failed (
1 failed | 1054 passed), and theverifyjob was downstream of this one test.