Skip to content

Remove dead code and consolidate duplicated offer-builder dispatch#13

Merged
hoffmang9 merged 2 commits into
mainfrom
simplification/dead-code-and-duplication
Feb 23, 2026
Merged

Remove dead code and consolidate duplicated offer-builder dispatch#13
hoffmang9 merged 2 commits into
mainfrom
simplification/dead-code-and-duplication

Conversation

@hoffmang9

@hoffmang9 hoffmang9 commented Feb 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • Dead if dry_run branch in _build_and_post_offer (manager.py): both branches returned the identical expression; collapsed to one line.
  • Duplicated subprocess-vs-direct offer-builder logic consolidated into offer_builder_sdk.build_offer_text(): manager.py and daemon/main.py each maintained a full copy of the GREENFLOOR_OFFER_BUILDER_CMD subprocess path (~40 and ~65 lines). Single canonical implementation now lives in offer_builder_sdk; both callers are thin wrappers. import shlex and import subprocess removed from both.
  • greenfloor/config/editor.py deleted (128 lines + 96-line test): supported config-history-list/config-history-revert commands 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

  • All 146 tests pass (pytest)
  • ruff check, ruff format --check, pyright clean
  • Full pre-commit suite passes

Made with Cursor

hoffmang9 and others added 2 commits February 23, 2026 12:01
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>
@hoffmang9 hoffmang9 merged commit 9d78006 into main Feb 23, 2026
3 checks passed
@hoffmang9 hoffmang9 deleted the simplification/dead-code-and-duplication branch February 23, 2026 20:13
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