Repository navigation
test: delete the source-grep tests an earlier detector's regex missed - #23976
Conversation
A rebuilt detector found 195 source-grep candidates where the original found 111.
The gap was one over-specific regex: the first scanner required a literal `.ts`
path inside `readFileSync(...)`, so every test that built its path from variables
(`join(dirname, '..', 'foo.tsx')`) was invisible to it. Roughly 84 files of a
pattern an earlier wave reported as cleared had in fact survived.
Deleted whole, every case asserting on production source text:
- `app-startup-routing.test.ts` (27 cases) — exact import statements
(`"import('../components/UpdateCard').then"`), relative-path spelling, and
`indexOf` source ordering. A file move or a `lazy()` refactor breaks it.
- `pull-request-page-host-boundary.test.ts` (13) — `toContain` on whole argument
expressions concatenated across 20+ component files.
- `SmartWorkspaceNameField-source-boundaries.test.ts` (7) — placeholder copy, a
Tailwind class string, and `not.toContain` on an already-deleted symbol.
- `github-project-repo-list-load.test.ts` (9) — `indexOf` statement ordering
inside `loadTasks`.
- `github-enterprise-slug-routing-boundary.test.ts` (4) —
`toContain('host: githubProjectHost(parsed?.slug.host)')`.
- `web-viewport-shell.test.ts` (3) — a regex demanding exact CSS selector-list
ordering and whitespace.
- `agent-catalog-links.test.ts` (1) — restates two `homepageUrl` literals straight
out of `agent-catalog.ts` with nothing in between.
Trimmed, keeping only what nothing else can reach:
- `desktop-startup-ordering.test.ts` 549 -> 66 lines, retaining the three cases
named as `assertionRefs` by the `ssh-filesystem.stream-inactivity-lifecycle` and
`agent-browser.owner-boundary-cleanup` gates; 15 source-order greps went.
- `ResourceUsageStatusSegment.session-polling.test.ts` keeps its census that no
`setInterval` exists and `listSessions()` is called exactly once — an added poll
multiplies a global daemon scan and no behavioral test sees it. The
`indexOf('if (!open)')` ordering pair and four `not.toContain` lines went.
- `agent-skill-installed-command-callers.test.ts` 231 -> 86, keeping the
`readdirSync` census that discovers every `<AgentSkillSetupPanel` caller and
asserts set equality against the allowlist, so a new panel host cannot silently
show a default Update action.
Also in this wave, from the renderer lib/runtime sweep: 22 cases whose routing
signal the production path never reads — verified by mutation, stripping
`connectionId`, the WSL preference and the UNC path from four of them left all 29
tests passing — plus braille-spinner rows collapsed onto one regex range, copied
`WELL_KNOWN_LABELS` rows, and a whole `resolveAiVaultResumeStartupShell` describe
whose four darwin/linux fixtures all return before the login shell is read.
`config/reliability-gates.jsonc` drops the two `app-startup-routing.test.ts`
references; the manifest still validates for 140 gates.
There was a problem hiding this comment.
ℹ️ No critical issues — this is a well-scoped deletion wave. Two minor observations below.
Reviewed changes — verified the removal set against the reliability-gate manifest and the sibling test owners:
- 7 source-grep files deleted whole —
app-startup-routing,pull-request-page-host-boundary,github-enterprise-slug-routing-boundary,SmartWorkspaceNameField-source-boundaries,web-viewport-shell,agent-catalog-links, and the mobilegithub-project-repo-list-loadsuite. All asserted on production source text, import statements, or CSS regex. - Trimmed suites —
desktop-startup-ordering.test.ts(549→66),agent-skill-installed-command-callers.test.ts(231→86),ResourceUsageStatusSegment.session-polling.test.ts, plus the rendererlib/sweep (agent launch/paste/row/status, hibernation, ai-vault resume). Removed cases are covered by sibling owners I checked (draft-paste-ready-scanner,active-agent-note-send-explicit-target, the runtime-backed hibernation tests). - Registry —
config/reliability-gates.jsoncdrops the twoapp-startup-routing.test.tsreferences from thepty-snapshot-capabilitygate.
The desktop-startup-ordering.test.ts selection is correct: the three survivors match exactly the assertionRefs named by the ssh-filesystem.stream-inactivity-lifecycle and agent-browser.owner-boundary-cleanup gates.
ℹ️ Stale shard-timing weights outlive the deleted files
config/scripts/ci-shard-timings.json still carries entries for six of the seven deleted test files (app-startup-routing, github-enterprise-slug-routing-boundary, SmartWorkspaceNameField-source-boundaries, pull-request-page-host-boundary, agent-catalog-links, web-viewport-shell). The body's "zero remaining references repo-wide via single-path rg" is true of test references but not of this generated baseline.
Technical details
# Stale timing keys
## Affected sites
- `config/scripts/ci-shard-timings.json` — unit weights for the six deleted renderer test files.
## Required outcome
- None strictly required: `balanceFiles` in `ci-shard-assignment.mjs` only looks up weights for files that exist, and no validator cross-checks timing keys against the test tree, so the stale entries are inert and the next timings refresh overwrites them.
## Suggested approach (optional)
- Leave as-is; the note is only to correct the verification claim, in case a future check starts asserting timing keys against the file set.ℹ️ Nitpicks
agent-skill-installed-command-callers.test.ts:72— the retained test name still says it fails when "a production caller can show the default Update action withoutinstalledCommand", but the surviving body only asserts caller set-equality plus that the install-only caller omits the prop. An existing update-capable caller droppinginstalledCommand=no longer fails (the panel then falls back to the install command). Several callers have their own behavioral assertions, so residual risk is low; consider tightening the name or re-anchoring the assertion if the prop is still load-bearing.- The body's per-file removal accounting omits a few behavioral removals (
ResourceUsageStatusSegmentmemory-snapshot seed,agent-statustype-label/icon mappings,agent-row-primary-textnormalized cases). I spot-checked each and found sibling coverage, so this is a description gap rather than a coverage one — but the "what changed" list is harder to audit against than the source-grep inventory.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 📝 WalkthroughWalkthroughThe changes remove or narrow tests across application startup, renderer routing, mobile repository loading, agent workflows, settings, and AI Vault commands. The reliability gate also stops running the renderer startup-routing test. The supplied summaries report no production implementation changes. Priority: ➖ Normal Merge Risk: 🔵 Low · up to This test-only change reduces regression protection for startup routing and OpenCode title recognition. It is mergeable with owner awareness of these bounded coverage gaps; equivalent behavioral tests are recommended. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation 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 3 functions across 4 files. (1 skipped: 1 unsupported.)
✨ 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.
🧹 Nitpick comments (2)
config/reliability-gates.jsonc (1)
13157-13157: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winRetain equivalent renderer startup-routing coverage in the reliability gate.
The deleted test covered renderer startup-routing contracts that the retained gate tests do not cover. Keep
src/renderer/src/app-startup-routing.test.tsin the gate, or add equivalent behavioral checks before removing it.src/renderer/src/lib/agent-send-title-status.test.ts (1)
8-8: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winRestore regression coverage for supported OpenCode idle-title forms.
detectAgentSendTitleStatuschecks native OpenCode titles only on the idle path. Restore the accepted cases for prefixes, spinner glyphs, spaces, and tabs. Keep the incomplete-marker andOCTOPUScases as negative boundary coverage.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: ee5b01b1-1fe7-468c-8491-ca5bd54f9412
📒 Files selected for processing (29)
config/reliability-gates.jsoncmobile/src/tasks/github-project-repo-list-load.test.tssrc/main/startup/desktop-startup-ordering.test.tssrc/renderer/src/app-startup-routing.test.tssrc/renderer/src/components/github-enterprise-slug-routing-boundary.test.tssrc/renderer/src/components/new-workspace/SmartWorkspaceNameField-source-boundaries.test.tssrc/renderer/src/components/pull-request-page-host-boundary.test.tssrc/renderer/src/components/settings/agent-skill-installed-command-callers.test.tssrc/renderer/src/components/status-bar/ResourceUsageStatusSegment.session-polling.test.tssrc/renderer/src/lib/activate-ai-vault-structured-session.test.tssrc/renderer/src/lib/active-agent-note-send-focused-session.test.tssrc/renderer/src/lib/agent-catalog-links.test.tssrc/renderer/src/lib/agent-followup-delivery.test.tssrc/renderer/src/lib/agent-hibernation-coordinator.test.tssrc/renderer/src/lib/agent-hibernation-planner.test.tssrc/renderer/src/lib/agent-hibernation-visibility.test.tssrc/renderer/src/lib/agent-launch-caller-prompt-transport.test.tssrc/renderer/src/lib/agent-launch-prompt-delivery.test.tssrc/renderer/src/lib/agent-launch-route-input.test.tssrc/renderer/src/lib/agent-launch-routing.test.tssrc/renderer/src/lib/agent-paste-draft.test.tssrc/renderer/src/lib/agent-row-primary-text.test.tssrc/renderer/src/lib/agent-row-tool-preview.test.tssrc/renderer/src/lib/agent-send-title-status.test.tssrc/renderer/src/lib/agent-session-launch-plan.test.tssrc/renderer/src/lib/agent-status.test.tssrc/renderer/src/lib/ai-vault-resume-command.test.tssrc/renderer/src/lib/ai-vault-resume-shell.test.tssrc/renderer/src/web/web-viewport-shell.test.ts
💤 Files with no reviewable changes (24)
- src/renderer/src/lib/agent-catalog-links.test.ts
- src/renderer/src/lib/agent-hibernation-coordinator.test.ts
- src/renderer/src/lib/agent-hibernation-planner.test.ts
- src/renderer/src/components/new-workspace/SmartWorkspaceNameField-source-boundaries.test.ts
- src/renderer/src/components/pull-request-page-host-boundary.test.ts
- src/renderer/src/lib/agent-paste-draft.test.ts
- src/renderer/src/lib/agent-row-tool-preview.test.ts
- src/renderer/src/lib/activate-ai-vault-structured-session.test.ts
- src/renderer/src/lib/agent-launch-prompt-delivery.test.ts
- src/renderer/src/lib/agent-launch-route-input.test.ts
- src/renderer/src/components/github-enterprise-slug-routing-boundary.test.ts
- src/renderer/src/lib/agent-row-primary-text.test.ts
- src/renderer/src/lib/agent-session-launch-plan.test.ts
- src/renderer/src/lib/ai-vault-resume-command.test.ts
- mobile/src/tasks/github-project-repo-list-load.test.ts
- src/renderer/src/app-startup-routing.test.ts
- src/renderer/src/lib/agent-hibernation-visibility.test.ts
- src/renderer/src/lib/active-agent-note-send-focused-session.test.ts
- src/renderer/src/components/status-bar/ResourceUsageStatusSegment.session-polling.test.ts
- src/renderer/src/web/web-viewport-shell.test.ts
- src/renderer/src/lib/agent-launch-caller-prompt-transport.test.ts
- src/renderer/src/lib/agent-launch-routing.test.ts
- src/renderer/src/lib/agent-status.test.ts
- src/main/startup/desktop-startup-ordering.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.
| const INTERPRETER_WRAPPED_AGENTS = [ | ||
| { agent: 'aider', expectedProcess: TUI_AGENT_CONFIG.aider.expectedProcess }, | ||
| { agent: 'mistral-vibe', expectedProcess: TUI_AGENT_CONFIG['mistral-vibe'].expectedProcess } | ||
| { agent: 'aider', expectedProcess: TUI_AGENT_CONFIG.aider.expectedProcess } | ||
| ] as const |
There was a problem hiding this comment.
Vibe delivery coverage removed
mistral-vibe still uses prompt delivery after startup, and the delivery code explicitly supports it when Python appears as the foreground process. Removing it from this test matrix leaves only aider cases, so a Vibe-specific change that prevents delivery—or sends the prompt into a bare shell—would no longer fail this test. Please keep an equivalent behavioral case for Vibe.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| const updateCapableCallers: readonly string[] = [ | ||
| 'src/renderer/src/components/settings/OrchestrationPane.tsx', |
There was a problem hiding this comment.
Known update commands unchecked
The retained test checks which files host the panel, but no longer checks that known update-capable hosts pass an update command. Removing installedCommand from an existing host would leave that file list unchanged, while the panel would show its install command as “Update.” Please check the commands supplied by known hosts, preferably through component behavior.
Comments Outside DiffThese findings could not be posted inline.
|
…le-through-host-inventory Conflict: src/main/startup/desktop-startup-ordering.test.ts. Main (#23976) trimmed the file to three cases and deleted its source-order grep tests, including the one this PR had re-pointed at the PTY liveness probe's startup barrier. Took main's file, and moved that guard into the behavioural swap-window suite: runtime controller probePtyLiveness now has a test that it defers a restored daemon id until the provider swap lands (fails with the barrier await removed). No production code changed.

ELI5
This PR exists because I found a bug in my own tooling.
An earlier PR in this series deleted ~130 tests that read production source files and asserted on their text — checks that break when you rename a variable and pass when you break the feature. It reported the pattern as mostly cleared.
It wasn't. My scanner required a literal
.tsfilename inside thereadFileSync(...)call, so any test that built its path from variables was invisible to it. Rebuilding the scanner without that assumption finds 195 files instead of 111. About 84 files of a pattern I'd called cleared had been sitting there the whole time — including one with 27 cases asserting exactimport()statements.What Changed
−2,732 lines across 29 files. 7 files deleted, ~71 cases removed from files that were kept.
Deleted whole — every case asserts on production source text
app-startup-routing.test.ts"import('../components/UpdateCard').then"), relative-path spelling,indexOfsource orderingpull-request-page-host-boundary.test.tstoContainon whole argument expressions concatenated across 20+ component filesgithub-project-repo-list-load.test.tsindexOfstatement ordering insideloadTasksSmartWorkspaceNameField-source-boundaries.test.tsnot.toContainon an already-deleted symbolgithub-enterprise-slug-routing-boundary.test.tstoContain('host: githubProjectHost(parsed?.slug.host)')web-viewport-shell.test.tsagent-catalog-links.test.tshomepageUrlliterals restated fromagent-catalog.tswith nothing in betweenA file move or a
lazy()refactor breaks every one of these. No behavior change does.not.toContain('oldSymbolName')is the weakest of all — trivially defeated by a rename.Trimmed, keeping only what nothing else can reach
desktop-startup-ordering.test.ts: 549 → 66 lines. Retained exactly the three cases named asassertionRefsby thessh-filesystem.stream-inactivity-lifecycleandagent-browser.owner-boundary-cleanupgates — power-bridge dispose after quit commit, agent-browser cleanup joined to the barrier, serve signal handlers before readiness. The other 15 source-order greps went.ResourceUsageStatusSegment.session-polling.test.tskeeps its census that nosetIntervalexists andlistSessions()is called exactly once. An added poll multiplies a global daemon scan and no behavioral test sees it. TheindexOf('if (!open)')ordering pair and fournot.toContainlines went.agent-skill-installed-command-callers.test.ts: 231 → 86 lines. Keeps thereaddirSynccensus that discovers every<AgentSkillSetupPanelcaller and asserts set equality against the allowlist, so a new panel host cannot silently ship a default Update action.Five detector hits were left completely untouched as false positives: they read artifacts their own production code wrote into a tmpdir, not repo source (
claude/hook-service,codex/hook-service-user-hook-mirroring,pty/omp-shell-wrapper,relay/plugin-overlay,pi/titlebar-extension-service).remote-runtime-connect-bound.test.tswas also kept: its source-reading case is a census over a discoveredremote-runtime-*.tsset countingnew WebSocket(againstremoteRuntimeConnectOptions(, with its own vacuity guard — an unbounded new transport hangs forever (#18191) and nothing else catches it.Also in this wave — renderer lib/runtime sweep
22 cases whose routing signal the production path never reads, verified by mutation rather than argument: stripping
connectionId, the WSL runtime preference and the UNC folder path from four "uses POSIX command wrapping for …" cases left all 29 tests in the file passing. None could fail for the reason it named.Plus braille-spinner rows collapsed onto the one
BRAILLE_SPINNER_RErange they share; copiedWELL_KNOWN_LABELSrows; and the wholeresolveAiVaultResumeStartupShelldescribe, whose four darwin/linux fixtures all return'posix'at line 33 before the login shell is ever read — it varied a value the module does not import, and zero win32 coverage existed.Why
The honest framing: a detector is only as good as its narrowest assumption, and mine had one I never questioned. The measured trend I reported earlier ("source greps 111 → 25") was true of what the scanner could see and false about the repo. This PR closes that.
The rebuilt check now reports 195 candidates, of which 15 were high-count files in
src//mobile/; the remainder are overwhelminglyconfig/scriptstests reading real YAML and JSON, where the data file legitimately is the shipped contract.Linked Issue
N/A — test-suite hygiene, no pre-existing issue.
Visual Proof
N/A — no production code changes; the only non-test edit removes two registry references to a deleted test.
Testing
Verified locally on macOS after committing and rebasing onto current main:
pnpm run typecheck— clean, afterrm -f config/tsconfig.*.tsbuildinfo.cd mobile && npx tsc --noEmit— clean; ratchet OK at 893 test files.node config/scripts/check-reliability-gates.mjs— passes, 140 gates. I verified the registry edit myself: twoapp-startup-routing.test.tsreferences removed (one command string, onetestFilesentry). The manifest validating also confirms no orphanedassertionRefs, which is the failure this gate exists to catch.rg.pnpm run check:code-quality:changed— passes, 0 findings.Not run locally: e2e and the Windows/Linux/SSH jobs — left to CI.
Removal-only; no new tests.
Review
The
desktop-startup-ordering.test.tstrim is the item worth checking most: it went from 549 to 66 lines, and the three survivors were chosen because the gate manifest names them as evidence. If a gate you own depended on one of the 15 removed cases, the manifest check should have caught it — but a second pair of eyes on that selection is welcome.Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
resolveAiVaultResumeStartupShellcases were darwin/linux fixtures returning before any platform branch; they never exercised win32, which remains uncovered either way. Related:getClientLoginShellinclient-login-shell.tsnow has zero callers repo-wide and is reported separately rather than deleted — its docblock explains that fish does not share the sh grammar, so an unwired shell check is a product question, not audit cleanup.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)