Skip to content

[compass] Remove dead code: the unused default on the CLI's validating Connect overload - #93

Merged
skulitom merged 1 commit into
mainfrom
compass/dead-code-2026-10-30
Oct 30, 2026
Merged

skulitom merged 1 commit into
mainfrom
compass/dead-code-2026-10-30

Conversation

@skulitom

@skulitom skulitom commented Oct 30, 2026 •

Copy link
Copy Markdown
Owner

One line: the = null default on the CLI's validating Connect(string op, JsonObject? arguments) overload (src/Anode/Cli/AgentCommands.cs:37, added by #82 for B-053) is never used.

What was removed, and why it is dead

  • The default arguments = null. All 15 callers pass the request's payload as the second argument:
    • AndroidCommands.cs:89, :120
    • Cli.cs:205, :521, :544, :568, :595, :607, :617, :625, :644, :660, :713
    • DevelopmentCommands.cs:62
    • DisplayCommands.cs:27
  • The compiler proves it. As a control, I changed one caller to Connect("input.scroll"), and the build failed with CS1503: overload resolution falls to Connect(bool autoStart). So no call can rely on the default, and no existing call binds differently. The control was then reverted.
  • Nothing else can depend on it. The method is private static inside the exe.
  • It also helps the summary hold. With the default gone, every caller hands over the payload it then sends. That is what the summary promises ("using the envelope RequestAsync sends").

How the rest of #79..main was scanned (82131b1..b661f63: 12 commits, 13 source files)

  • tools/anode-scan.sh, steps 1–10 (82 s). Each step's planted control fired.
    • Roslyn analyzers: 0 findings.
    • InspectCode: the only new findings are four empty catch blocks in ScreenSettle.cs. They are deliberate (capture failures must never fail a sent scroll), and a style matter rather than dead code.
    • Check-only members: ConnectForCheck's setter, which is a test hook.
    • String dispatch, unreferenced files, PowerShell AST and CLI options: nothing new.
  • Read by hand: the whole production diff.
    • The other Connect(autoStart: false) callers send status or viewer ops that need no lease, or validate their own envelope first (audio).
    • ScreenSettle.Around's timeoutMs default is used by a check.
    • All the new ScreenRecorder stand-in members are read.
    • All three package references and both embedded resources are used.
  • Kept: Around's first if (Cancel.IsCancellationRequested) branch.
    • Its two assignments are never read, because ThrowIfCancellationRequested() always throws on that path.
    • The branch itself still skips the frame grabs, though, and rewriting it would only restyle B-055's recently reviewed code.

Tests

Check main b661f63 branch
scripts\build.ps1 -QuickTest -OutputDirectory artifacts\pkg-build (release build plus selftest --quick) pass, 120/120 pass, 120/120
Documentation check (42 documents, 41 tools) consistent consistent
Control: one caller without arguments — build fails (CS1503), as expected

Risk

  • None expected. Call sites already pass explicit arguments, so their compiled calls are unchanged. Only the private method's parameter metadata loses its default value.
  • The 0.11.4 candidate is pinned to 1ad6eae (LEDGER C-072), so it doesn't move.

Second review

  • Codex: bin/codex-review.sh stopped after 6 s at the Codex usage limit ("try again at Nov 4th, 2026 9:30 AM"). The transcript is logs/codex/2026-10-30-0312-2026-10-30-dead-code-anode.out.txt in Compass.
  • Fresh Claude reviewer (read-only, 48 s): no credible problems.
    • It found the same 15 callers, all passing two arguments. No call is split across lines or sits under #if.
    • Nothing refers to the method by nameof, method group or reflection, and the project has no source generators.
    • ConnectForCheck hooks Connect(bool), not this overload, and overload resolution can't shift.
    • The method is private in the only project, with no InternalsVisibleTo.
    • The doc summary stays accurate.

Merged by compass-dead-code in this run once its tests and second review pass (RULES.md, Pull requests).

🤖 Generated with Claude Code

…g Connect overload

Every one of its 15 callers passes the request's arguments, so the `= null` default
was never used. Without it, a caller must hand over the payload it sends, which is
what the method's summary promises ("using the envelope RequestAsync sends").

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-30T03:13:19.260824Z
We couldn’t complete this review. Comment @codex review to try again.
108550a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@skulitom
skulitom merged commit 0bae98b into main Oct 30, 2026
2 checks passed
@skulitom
skulitom deleted the compass/dead-code-2026-10-30 branch October 30, 2026 03:16
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