Skip to content

test: remove low-value schema, compact, and language tests - #36075

Merged
OrcaWin merged 1 commit into
mainfrom
test-audit-779-schema-registration-compact-and-language-cases
Oct 29, 2026
Merged

OrcaWin merged 1 commit into
mainfrom
test-audit-779-schema-registration-compact-and-language-cases

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 7 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2 $\color{#cf222e}{\Huge{\mathbf{−}}}$​634 $\color{#cf222e}{\Huge{\mathbf{−}}}$​632
Prod 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​8 $\color{#cf222e}{\Huge{\mathbf{−}}}$​11 $\color{#cf222e}{\Huge{\mathbf{−}}}$​3

Remove 55 low-value test case declarations (136 expanded cases) across schema, compact-status, and language detection suites. This deletes the bind-first source census and Solidity package-source regex suites, removes copied schema/mapping inventories and private cache bookkeeping checks, and retains 31 declarations (104 expanded cases) covering parser boundaries, observable compact completion/ownership, language precedence, path matching, and shebang handling.

Remove the two deleted suites from timing metadata and update reliability-gate descriptions to match the retained assertions. The removed private compact-cache assertions and package-ID drift check intentionally lose their narrow coverage; retained tests are not claimed to replace those checks. No executable production code changes.

Validation: static parsing, formatting/lint, retained callback/table/setup identity, metadata inverse/parsed comparison, and runtime routing checks passed. Hosted CI will validate the five retained test roots before merge; no local runtime tests were run.

@OrcaWin
OrcaWin marked this pull request as ready for review October 29, 2026 20:34
@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge; the earlier request for a small positive metadata-fallback test remains non-blocking.

Findings

  1. P2 Metadata lookup loses positive coverage ▶

Summary

Removes schema, compact-status, and language tests, including two complete suites.

  • Compact-status tests focus on observable completion and ownership.
  • RPC schema tests keep focused checks and drop field inventories.
  • Language tests keep boundary checks and drop broad mapping inventories.
  • Terminal registration no longer has a source-wide census test.

No new actionable issues were found.

Reviews (3) · Last reviewed commit: "test: remove redundant schema,registrati..." · Reviewed by Greptile

import { detectLanguage } from './editor-language-detect'
import { detectMonacoFilenameLanguage } from './monaco-filename-language'
import associations from './monaco-language-associations.json'

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 Metadata lookup loses positive coverage

Removing all positive metadata cases leaves this suite unable to catch a broken metadata lookup. Its remaining positive cases use the explicit maps in detectLanguage; its metadata-only cases all expect plaintext. Keep one metadata-only extension case, such as main.bicep, and one filename case, such as Guardfile. These check that the fallback works without restoring the full inventory.

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!

@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1e7cd96d-5afc-48d5-b56f-9948e378cb5a
Commits

Reviewing files that changed from the base of the PR and between d76c69d and 3661d22.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
Walkthrough

The pull request updates compact-status reliability-gate descriptions and removes selected tests from compact-status, RPC schema, registration-census, and editor-language test suites. It also removes the timing records for the registration-census and Solidity language-ID tests. The changes affect test coverage and configuration; the summaries report no changes to exported or public entities.

Priority: Low

Merge Risk: Low · previous review 39a28

The change reduces regression detection in several bounded paths. It is mergeable with follow-up, but the focused assertions should be restored to limit future regressions.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Description check Warning The description covers the change scope, counts, retained coverage, metadata and reliability-gate updates, and validation performed. It does not follow the required template. It lacks the ELI5, Visual… Add the template sections that are missing or empty: ELI5, a What Changed section written from the user-facing before and after, a Why section that explains why deletion beats the alternatives, and a Linked Issue section with a real issue r…
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title "test: remove low-value schema, compact, and language tests" matches the main change. The PR deletes 55 test declarations across schema, compact-status, and language-detection suites, and th…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
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: Title check

Explanation

The title "test: remove low-value schema, compact, and language tests" matches the main change. The PR deletes 55 test declarations across schema, compact-status, and language-detection suites, and the title names those three areas. It uses the conventional commit prefix and stays short. It does not mention the timing metadata or reliability-gate description edits, which are minor supporting changes.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 2 files. (1 skipped: 1 unsupported.)

Full details: Description check

Explanation

The description covers the change scope, counts, retained coverage, metadata and reliability-gate updates, and validation performed. It does not follow the required template. It lacks the ELI5, Visual Proof, and Linked Issue sections, and the Checklist and Testing sections are not filled in. The Linked Issue section is required for outside contributors. The AI Disclosure section is not filled in. The agent skill upstream boundary item is not checked. The description still states that no local runtime tests were run, which the Testing section should also cover.

Resolution

Add the template sections that are missing or empty: ELI5, a What Changed section written from the user-facing before and after, a Why section that explains why deletion beats the alternatives, and a Linked Issue section with a real issue reference (or a note that the author is a maintainer). Mark "Visual Proof" as N/A with a reason, since this change has no UI or behavior change. Complete the Testing checkboxes and list the platforms tested. Fill in the Review, Agent skill upstream boundary, and Checklist sections. Confirm that the AI Disclosure section is correct for this author.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

❤️ Share

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

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

Nitpick comments: 6
src/main/claude/compact-status-registration.test.ts: 1

159-173: Trivial · Functional Correctness · Quick win

Assert that automatic completion does not consume the compact prompt.

The test checks the returned event and visible status, but not claudeConsumedCompactPromptIdByPaneKey. A regression could therefore return null while recording the prompt ID. A later manual PostCompact with that ID would be suppressed by the manual deduplication and ownership path.

Suggested fix
    expect(state.lastStatusByPaneKey.get(PANE_KEY)?.payload.state).toBe('working')
+   expect(state.claudeConsumedCompactPromptIdByPaneKey.get(PANE_KEY)).toBeUndefined()
src/main/agent-hooks/manual-compact-status-cleanup.test.ts: 1

27-50: Trivial · Functional Correctness · Quick win

Seed an accepted manual compact before cleanup in the retained cleanup test.

The retires authority with %s cleanup test never accepts a manual PostCompact. It ingests only UserPromptSubmit and PreCompact, then runs cleanup. The consumed-compact map therefore stays empty for this pane key before cleanup. The assertions check only the visible status snapshot, which is empty whether or not a consumed record was revoked. A regression in clearPaneCacheState, movePaneCacheState, or clearAllListenerCaches would still pass this test.

The later behavior that this gap can hide: the relay suppresses a duplicate manual PostCompact by its consumed prompt ID. If cleanup leaves a stale consumed entry, a later duplicate for that prompt ID on the same pane key can stay suppressed. The row then does not reach done.

Add the missing setup and assertion. Accept a manual PostCompact before cleanup. After cleanup, re-create a working row for the same pane. Deliver the duplicate PostCompact and assert that the row reaches done. This makes the test fail when the consumed record survives cleanup.

src/main/runtime/rpc/methods/session-tabs-schemas.test.ts: 2

1-24: Trivial · Data Integrity & Integration · Quick win

Restore the invalid ActivateTab.navigation assertion.

ActivateTab.navigation accepts only caller, host, clients, or all. The dispatcher validates it before session.tabs.activate forwards it to resolveRuntimeNavigationTarget. No retained test rejects an unsupported target. Restore this assertion to detect a schema regression that could forward an invalid navigation target.

Suggested fix
 import { describe, expect, it } from 'vitest'
-import { UpdatePaneLayout } from '../../../../shared/rpc-contract/session-tabs-schemas-params'
+import {
+  ActivateTab,
+  UpdatePaneLayout
+} from '../../../../shared/rpc-contract/session-tabs-schemas-params'
 
 const WT = 'id:wt'
 
+describe('ActivateTab.navigation', () => {
+  it('rejects unknown fanout', () => {
+    expect(
+      ActivateTab.safeParse({ worktree: WT, tabId: 'tab', navigation: 'others' }).success
+    ).toBe(false)
+  })
+})
+
 describe('UpdatePaneLayout.root (untrusted remote pane-layout tree)', () => {

1-24: Trivial · Data Integrity & Integration · Quick win

Restore focused close-schema assertions.

The removed tests cover distinct validation branches for CloseTab and CloseLifecycleTab. The dispatcher validates these schemas before it invokes a handler. If the CloseTab guard regresses, an unknown truthy reason bypasses the missing-intent refusal and reaches closeMobileSessionTab as a user close. If the lifecycle guard regresses, invalid reason or missing incarnation evidence can skip the runtime’s stale-publication and stale-terminal checks.

Suggested fix
 import { describe, expect, it } from 'vitest'
-import { UpdatePaneLayout } from '../../../../shared/rpc-contract/session-tabs-schemas-params'
+import {
+  CloseLifecycleTab,
+  CloseTab,
+  UpdatePaneLayout
+} from '../../../../shared/rpc-contract/session-tabs-schemas-params'
 
 const WT = 'id:wt'
 
+describe('close-session-tab schemas', () => {
+  it('accepts replay and rejects unknown legacy close reasons', () => {
+    expect(CloseTab.parse({ worktree: WT, tabId: 'tab-1', reason: 'replay' }).reason).toBe('replay')
+    expect(
+      CloseTab.safeParse({ worktree: WT, tabId: 'tab-1', reason: 'transport-glitch' }).success
+    ).toBe(false)
+  })
+
+  it('requires lifecycle evidence and lifecycle reasons', () => {
+    expect(
+      CloseLifecycleTab.safeParse({
+        worktree: WT,
+        tabId: 'tab-1',
+        reason: 'pty-exit',
+        terminal: 'term-1'
+      }).success
+    ).toBe(false)
+    expect(
+      CloseLifecycleTab.safeParse({
+        worktree: WT,
+        tabId: 'tab-1',
+        reason: 'pty-exit',
+        publicationEpoch: 'epoch-1'
+      }).success
+    ).toBe(false)
+    expect(
+      CloseLifecycleTab.safeParse({
+        worktree: WT,
+        tabId: 'tab-1',
+        reason: 'user',
+        publicationEpoch: 'epoch-1',
+        terminal: 'term-1'
+      }).success
+    ).toBe(false)
+  })
+
 describe('UpdatePaneLayout.root (untrusted remote pane-layout tree)', () => {
src/main/runtime/terminal/lifecycle/bind-first-registration.test.ts: 1

69-84: Trivial · Maintainability & Code Quality · Quick win

Keep the static registration census.

The retained test exercises only createFromPhone(runtime). It does not enumerate production runtime-registration callers or check binding-marker order. A new registerPersistedPtySpawn or runtime-object .registerPty site can therefore bypass the retained test without detection. Restore the deleted census, or an equivalent source-level check, alongside the runtime test.

src/shared/editor-language/monaco-filename-language.test.ts: 1

16-36: Trivial · Functional Correctness · Quick win

Retain a positive Ruby association case.

The retained near-miss cases can still pass if the Ruby associations are removed or stop resolving. Add one positive case, such as file.rake, to cover the Monaco association path used by detectLanguage.

Suggested fix
     ['file.tsx', 'typescript'],
+    ['file.rake', 'ruby'],
     ['file.jsonl', 'jsonl'],

Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 70944bc9-0a15-4d79-89f3-7bc496df86d4
Commits

Reviewing files that changed from the base of the PR and between e8e0803 and 39a28de.

Files selected for processing: 9
  • config/reliability-gates.jsonc
  • config/scripts/ci-shard-timings.json
  • src/main/claude/compact-status-registration.test.ts
  • src/main/runtime/rpc/methods/session-tabs-schemas.test.ts
  • src/main/runtime/rpc/methods/worktree-schemas.test.ts
  • src/main/runtime/terminal/lifecycle/bind-first-registration-census.test.ts
  • src/renderer/src/lib/solidity-language-id-registration.test.ts
  • src/shared/editor-language/editor-language-detect.test.ts
  • src/shared/editor-language/monaco-filename-language.test.ts
Files with no reviewable changes: 6
  • src/main/runtime/terminal/lifecycle/bind-first-registration-census.test.ts
  • src/renderer/src/lib/solidity-language-id-registration.test.ts
  • src/shared/editor-language/monaco-filename-language.test.ts
  • src/main/claude/compact-status-registration.test.ts
  • config/scripts/ci-shard-timings.json
  • src/shared/editor-language/editor-language-detect.test.ts

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

@OrcaWin
OrcaWin force-pushed the test-audit-779-schema-registration-compact-and-language-cases branch from 39a28de to d76c69d Compare October 29, 2026 21:01
@OrcaWin
OrcaWin force-pushed the test-audit-779-schema-registration-compact-and-language-cases branch from d76c69d to 3661d22 Compare October 29, 2026 21:17
@OrcaWin
OrcaWin merged commit f9a21bc into main Oct 29, 2026
69 of 71 checks passed
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