refactor(agent): extract settings conflict planner from bootstrap#759
Open
jojosenthusiast wants to merge 1 commit into
Open
refactor(agent): extract settings conflict planner from bootstrap#759jojosenthusiast wants to merge 1 commit into
jojosenthusiast wants to merge 1 commit into
Conversation
Move the settings-conflict orchestration out of the runner bootstrap into a pure planner module so the log/analytics/fail-closed decisions are unit- testable in isolation. Behavior preserving: the executor performs the exact same logToFile + analytics.wizardCapture calls (and in the same order) the inline orchestration used to perform, plus the same showSettingsOverride fail-closed list. - src/lib/agent/settings-conflict-planner.ts: pure planner returning a list of log/analytics actions plus the auto-fix decision and final unfixable classification; no I/O, no analytics, no logging. - src/lib/agent/__tests__/settings-conflict-planner.test.ts: 9 tests covering the none/managed/user/project-local/writable branches plus the auto-fix success and failure outcomes. - src/lib/agent/runner/shared/bootstrap.ts: thin executor loop that runs the plan's actions and feeds the backupAndFixClaudeSettings boolean back into planAutoFixOutcome. Refs: PostHog#756
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.
Fixes #756
Summary
Verification
node_modules\.bin\vitest.cmd run src/lib/agent/__tests__/settings-conflict-planner.test.tsgit diff --check main...HEADRisk
Low. This is intended to be behavior-preserving refactoring with focused planner coverage.