Remove dead code and stale diagnostics#801
Merged
Merged
Conversation
FuJacob
force-pushed
the
agent/remove-dead-code
branch
from
July 18, 2026 03:19
97f3384 to
add17f8
Compare
FuJacob
marked this pull request as ready for review
July 18, 2026 03:22
Comment on lines
9
to
+11
| /// redesign surfaces attention per pane: a sidebar dot signals "look in here," and the affected | ||
| /// pane carries an inline callout next to the controls that fix the underlying problem. Keeping | ||
| /// the rule outside the view layer makes it unit-testable without AppKit and keeps the sidebar | ||
| /// view free of state-mapping logic. | ||
| /// Keeping the rule outside the view layer makes it unit-testable without AppKit and keeps the | ||
| /// sidebar view free of state-mapping logic. |
Contributor
There was a problem hiding this comment.
The doc comment has a dangling fragment after the partial removal. The sentence "a sidebar dot signals 'look in here,' and the affected" was left without its continuation ("pane carries an inline callout…"), producing unreadable prose.
Suggested change
| /// redesign surfaces attention per pane: a sidebar dot signals "look in here," and the affected | |
| /// pane carries an inline callout next to the controls that fix the underlying problem. Keeping | |
| /// the rule outside the view layer makes it unit-testable without AppKit and keeps the sidebar | |
| /// view free of state-mapping logic. | |
| /// Keeping the rule outside the view layer makes it unit-testable without AppKit and keeps the | |
| /// sidebar view free of state-mapping logic. | |
| /// redesign surfaces attention per pane: a sidebar dot signals "look in here." Keeping the rule | |
| /// outside the view layer makes it unit-testable without AppKit and keeps the sidebar view free | |
| /// of state-mapping logic. |
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!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Remove verified dead code, stale diagnostics, and obsolete tracked artifacts so the shipped app exposes only behavior that has an active caller.
Validation
Linked issues
None.
Risk / rollout notes
No user-facing feature behavior is intentionally changed. The two broadest removals are the unused
FocusInspectionSnapshotconstruction path and unused@Publishedsuggestion-debug mirrors; focus capability selection, overlay state, correlation IDs, and structured logging remain active and are covered by the full test suite.Greptile Summary
This PR removes verified dead code across 83 files: diagnostic
@Publishedmirrors fromSuggestionCoordinator, the unusedFocusInspectionSnapshotconstruction path, convenience wrappers that had no runtime callers, and narrowed model surfaces (emoji, runtime, settings, permissions). Test helpers previously duplicated in production are moved to the test target; structured logs and active state-machine behavior are fully preserved.SuggestionCoordinator: 12@Publisheddebug properties (latestSuggestionPreview,latestStageMessage,latestAcceptanceAction, etc.) removed;stateandoverlayStatedowngraded from@Publishedto plainvarsince no SwiftUI view subscribes to them.hasSuggestionArtifactsToClearnow checks the real session object instead of the removed diagnostic mirrors.FocusInspectionSnapshot,FocusCapabilityResolution.resolvedCandidate/bestDiagnosticCandidate/inspectedCandidateCount, and the top-levelFocusCapabilityResolver.resolve()entry point are removed;FocusSnapshotResolvernow tracks only the winning evaluation score for tie-breaking, not the full candidate tuple.LlamaGenerationOutput.text(),ActiveSuggestionSession.acceptedText,SuggestionTextNormalizer.normalize(), and other assertion-only conveniences are moved to the test module, keeping the production API surface minimal.Confidence Score: 5/5
Safe to merge. All removed code was diagnostic-only with no active runtime callers, verified by 1,668 passing tests.
Every removal is a diagnostic mirror, dead wrapper, or unused model field. The active state-machine paths (overlay visibility, session tracking, focus capability selection, structured logging) are all preserved and covered by the test suite. The one flagged item is a doc-comment fragment left by a partial line removal — no logic is affected.
SettingsAttentionEvaluator.swift has a minor broken doc-comment sentence that should be cleaned up before merge.
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD subgraph Before["Before: SuggestionCoordinator (12 @Published debug mirrors)"] B1["@Published state\n@Published overlayState\n@Published latestSuggestionPreview\n@Published latestAcceptanceAction\n@Published latestStageMessage\n@Published latestOverlayMessage\n@Published latestPromptPreview\n@Published latestRawModelOutput\n@Published latestLatencyMilliseconds\n... (+ 3 more)"] end subgraph After["After: SuggestionCoordinator (lean state)"] A1["var state ← plain var, no re-render\nvar overlayState ← plain var, no re-render\nvar latestGenerationNumber ← kept (active logic)\n@Published visualContextStatus ← kept (UI)\n@Published totalTabAcceptedWordCount ← kept (UI)"] end subgraph FocusBefore["Before: Focus resolution pipeline"] FB1["FocusCapabilityResolver.resolve()\n→ FocusCapabilityResolution\n .resolvedCandidate\n .bestDiagnosticCandidate\n .missingCapabilities\n .inspectedCandidateCount"] FB2["FocusSnapshotResolver\n→ FocusCandidateResolution\n .resolvedCandidate (AXFocusCandidate)\n .diagnosticCandidate (AXFocusCandidate)\n .resolution"] FB3["FocusSnapshot\n .inspection (FocusInspectionSnapshot)\n .capabilitySummary"] end subgraph FocusAfter["After: Focus resolution pipeline"] FA1["FocusCapabilityResolver.evaluate()\n→ FocusCapabilityResolution\n .unsupportedReason"] FA2["FocusSnapshotResolver\n→ FocusCandidateResolution\n .resolvedCandidate (AXFocusCandidate)\n .resolution"] FA3["FocusSnapshot\n (no inspection field)"] end Before --> After FocusBefore --> FocusAfter%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% flowchart TD subgraph Before["Before: SuggestionCoordinator (12 @Published debug mirrors)"] B1["@Published state\n@Published overlayState\n@Published latestSuggestionPreview\n@Published latestAcceptanceAction\n@Published latestStageMessage\n@Published latestOverlayMessage\n@Published latestPromptPreview\n@Published latestRawModelOutput\n@Published latestLatencyMilliseconds\n... (+ 3 more)"] end subgraph After["After: SuggestionCoordinator (lean state)"] A1["var state ← plain var, no re-render\nvar overlayState ← plain var, no re-render\nvar latestGenerationNumber ← kept (active logic)\n@Published visualContextStatus ← kept (UI)\n@Published totalTabAcceptedWordCount ← kept (UI)"] end subgraph FocusBefore["Before: Focus resolution pipeline"] FB1["FocusCapabilityResolver.resolve()\n→ FocusCapabilityResolution\n .resolvedCandidate\n .bestDiagnosticCandidate\n .missingCapabilities\n .inspectedCandidateCount"] FB2["FocusSnapshotResolver\n→ FocusCandidateResolution\n .resolvedCandidate (AXFocusCandidate)\n .diagnosticCandidate (AXFocusCandidate)\n .resolution"] FB3["FocusSnapshot\n .inspection (FocusInspectionSnapshot)\n .capabilitySummary"] end subgraph FocusAfter["After: Focus resolution pipeline"] FA1["FocusCapabilityResolver.evaluate()\n→ FocusCapabilityResolution\n .unsupportedReason"] FA2["FocusSnapshotResolver\n→ FocusCandidateResolution\n .resolvedCandidate (AXFocusCandidate)\n .resolution"] FA3["FocusSnapshot\n (no inspection field)"] end Before --> After FocusBefore --> FocusAfterReviews (1): Last reviewed commit: "Remove dead code and stale diagnostics" | Re-trigger Greptile