Skip to content

chore: Remove unreferenced FirstPartyTools and Runtime PublicCandidates - #2007

Merged
hatayama merged 3 commits into
chore/public-candidate-triagefrom
chore/public-candidate-public-tools
Jul 25, 2026
Merged

hatayama merged 3 commits into
chore/public-candidate-triagefrom
chore/public-candidate-public-tools

Conversation

@hatayama

@hatayama hatayama commented Jul 25, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Remove unreferenced FirstPartyTools / Runtime PublicCandidate members after Skill / CLI / reflection keep-checks (issue Triage the 185 PublicCandidate findings from the dead-code scanner #1997 PR-5).
  • Shrink production PC from 47 → 33; FirstPartyTools+Runtime keepers left: 9. HC remains 0.
  • Runtime deletions are limited to overlay-only dead API (ClearScroll, HitGameObjectName + Update arity); no extension-facing keepers removed.

Decision table

DELETE

Symbol Why
ClearConsoleResponse(string) / parameterless ctor Outbound response; no production construction / JSON round-trip need
LogEntry() / GetLogsResponse() parameterless ctors Same
RunTestsResponse() parameterless ctor Same
GameObjectDetails.ErrorMessage Never read or assigned in production
InputRecorder.ForceStop() (static facade) Only instance path used; static unused
UiRaycastHelper.RaycastCanvasSpace No callers; private RaycastCanvasSpaceFromSources still used
ValidateNoDuplicateAsmdefNamesFromConsoleErrors (+ console regex) Dead alternate path; asset-scan validator remains
KeyboardKeyState.Clear (instance + static) Unused; ClearTrackedKeys remains
MouseInputState.IsButtonHeld (instance + static) Unused
WatchExpressionStepMonitor.Stop Never called; monitor lifetime ends with domain
Runtime SimulateMouseInputOverlayState.ClearScroll (instance + static) No callers; scroll still cleared via existing Clear / setter paths
Runtime SimulateMouseUiOverlayState.HitGameObjectName + Update(..., hitName, ...) Write-only overlay field; response still carries HitGameObjectName via tool DTO

Boy-scout after delete: removed unused using UnityEngine from asmdef validator; confirmed _scrollActiveUntil / _isStarted still have live readers; no sole-writer DI seams left behind.

KEEP

Symbol Why
FindGameObjectsSchema.IncludeInheritedProperties Skill + default-tools.json tool parameter
UnifiedTestCallback.{Run,Test}{Started,Finished} Unity Test Runner ICallbacks (reflection)
NUnitXmlResultExporter.Utf8StringWriter.Encoding Required TextWriter override
ReferenceEqualityComparer.Equals / GetHashCode HashSet comparer contract
GenericConsoleWindowUtility.GetConsoleLogCounts Used under #else (pre–Unity 6)

Verification

Test plan

  • CI dead-code + Unity compile jobs green
  • Spot-check Simulate Mouse UI overlay still draws after Update arity change
  • Confirm advisor LGTM on Runtime keep/delete split before merge to chore/public-candidate-triage

Review in cubic

Drop outbound-only members that production scan reports as unused so
PR-5 can shrink the FirstPartyTools/Runtime bucket without removing
Skill/CLI-backed fields or Unity reflection keepers.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Jul 25, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The change removes obsolete public APIs and response constructors, simplifies mouse UI overlay state and callers, deletes console-based duplicate assembly validation, and adds surgical-editing guidance.

Changes

API and overlay cleanup

Layer / File(s) Summary
Remove hit-object overlay state
Packages/src/Runtime/SimulateMouseUi/SimulateMouseUiOverlayState.cs, Packages/src/Runtime/SimulateMouseInput/SimulateMouseInputOverlayState.cs
Overlay updates no longer accept or expose hit game-object names, and scroll state no longer has a dedicated ClearScroll API.
Update mouse UI call sites
Assets/Tests/Editor/..., Packages/src/Editor/FirstPartyTools/Common/InputRecording/*, Packages/src/Editor/FirstPartyTools/SimulateMouseUi/*
Replay, click, test, and drag paths use the reduced overlay update signature; press call formatting changes preserve passed arguments.
Reduce editor tool APIs
Packages/src/Editor/FirstPartyTools/ClearConsole/*, Common/*, FindGameObjects/*, GetLogs/*, RunTests/*, SimulateKeyboard/*, SimulateMouseInput/*, Watch/*
Obsolete constructors, methods, and properties are removed; keyboard clearing exposes cleared keys through ClearTrackedKeys().
Remove console duplicate validation
Packages/src/Editor/FirstPartyTools/Compile/AssemblyDefinitionDuplicationValidationService.cs
Console-error duplicate assembly validation is deleted, leaving the remaining duplicate-name validation path.
Add editing guidance
AGENTS.md
Contributor guidance requires surgical edits and prohibits unrelated formatter or scripted rewrites.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related issues

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: removing unreferenced FirstPartyTools and Runtime public candidates.
Description check ✅ Passed The description is directly related to the changeset and matches the removals and verification described in the diff.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/public-candidate-public-tools

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.

Collapse-only rewrites made the hitGameObjectName removal unreviewable.
Restore base wrapping, drop only that argument, and document that agents
must not reformat unrelated C# when making surgical triage edits.

Co-authored-by: Cursor <cursoragent@cursor.com>
@hatayama

Copy link
Copy Markdown
Owner Author

Follow-up: formatting churn removed

Pushed e148e15c to address the review blocker.

  • Restored the 4 MouseUi / InputReplay files from chore/public-candidate-triage and re-applied only the SimulateMouseUiOverlayState.Update(...) hitGameObjectName argument deletion, keeping original wrapping.
  • Those 4 files vs base are now +10 / −14 (argument lines only).
  • Documented in AGENTS.md that agents must not reformat unrelated C# or collapse multi-line calls during surgical triage edits.
  • Workspace .vscode is gitignored, so format-on-save disable stays local; the agent rule is the in-repo guard against recurrence.

Keep PR-5 scoped to FirstPartyTools/Runtime deletions; the AGENTS.md
rule belongs in a separate docs PR for clear history and review.

Co-authored-by: Cursor <cursoragent@cursor.com>

@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

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@Packages/src/Editor/FirstPartyTools/SimulateMouseUi/MouseUiPressActionExecutor.cs`:
- Line 51: Restore the existing argument wrapping and layout for the
SimulateMouseUiOverlayState.Update calls at the affected locations in
MouseUiPressActionExecutor, without changing their arguments or behavior. Keep
the cleanup surgical and avoid unrelated formatting changes.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 061e9057-a8dd-4466-84a1-f32a426869f6

📥 Commits

Reviewing files that changed from the base of the PR and between 6e96580 and e148e15.

📒 Files selected for processing (5)
  • AGENTS.md
  • Packages/src/Editor/FirstPartyTools/Common/InputRecording/InputReplayUiController.cs
  • Packages/src/Editor/FirstPartyTools/SimulateMouseUi/MouseUiIncrementalDragExecutor.cs
  • Packages/src/Editor/FirstPartyTools/SimulateMouseUi/MouseUiOneShotDragExecutor.cs
  • Packages/src/Editor/FirstPartyTools/SimulateMouseUi/MouseUiPressActionExecutor.cs

SimulateMouseUiOverlayState.Update(
MouseAction.Click, inputPos, null,
targetName, Handles.GetMainGameViewSize());
Handles.GetMainGameViewSize());

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.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Restore the existing argument wrapping.

Line 51 and Line 133 only reformat SimulateMouseUiOverlayState.Update(...); the arguments and behavior are unchanged. Please preserve the prior layout so this surgical cleanup does not add unrelated formatting churn.

As per coding guidelines, “Do not reformat unrelated code; surgical edits must preserve existing wrapping and layout.”

Also applies to: 133-133

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@Packages/src/Editor/FirstPartyTools/SimulateMouseUi/MouseUiPressActionExecutor.cs`
at line 51, Restore the existing argument wrapping and layout for the
SimulateMouseUiOverlayState.Update calls at the affected locations in
MouseUiPressActionExecutor, without changing their arguments or behavior. Keep
the cleanup surgical and avoid unrelated formatting changes.

Source: Coding guidelines

@hatayama
hatayama merged commit 4dd176e into chore/public-candidate-triage Jul 25, 2026
2 checks passed
@hatayama
hatayama deleted the chore/public-candidate-public-tools branch July 25, 2026 18:29
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