Remove dead code and consolidate duplicated offer-builder dispatch#13
Merged
Conversation
Three simplifications: 1. Dead `if dry_run` branch in `_build_and_post_offer` (manager.py): both branches returned the same expression; collapsed to one line. 2. Duplicated subprocess-vs-direct offer-builder logic: manager.py and daemon/main.py each had a full copy of the GREENFLOOR_OFFER_BUILDER_CMD subprocess path (~40 and ~65 lines respectively). Moved the single canonical implementation to `offer_builder_sdk.build_offer_text()`. `_build_offer_text_for_request` is now a one-line delegate; `_build_offer_for_action` is now a three-line try/except wrapper. Removed `import shlex` and `import subprocess` from both callers. 3. Deleted `greenfloor/config/editor.py` (128 lines) and its test (96 lines). The module supported config-history commands removed in the 2026-02-21 simplification pass; no production code imported it. Net: -312 lines, +83 lines across 6 files. All 146 tests pass. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
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
if dry_runbranch in_build_and_post_offer(manager.py): both branches returned the identical expression; collapsed to one line.offer_builder_sdk.build_offer_text():manager.pyanddaemon/main.pyeach maintained a full copy of theGREENFLOOR_OFFER_BUILDER_CMDsubprocess path (~40 and ~65 lines). Single canonical implementation now lives inoffer_builder_sdk; both callers are thin wrappers.import shlexandimport subprocessremoved from both.greenfloor/config/editor.pydeleted (128 lines + 96-line test): supportedconfig-history-list/config-history-revertcommands removed in the 2026-02-21 simplification pass. No production code imported it. Per AGENTS.md: "Do not build features ahead of the critical path."Net: -312 lines, +83 lines across 6 files.
Test plan
pytest)ruff check,ruff format --check,pyrightcleanMade with Cursor