Remove click UI from core (#117)#166
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
Conversation
Move $EDITOR/click.edit interaction and rules-engine preview/confirmation prompts out of rose-py into rose-cli: - releases/collages/playlists: replace the editor functions with serialize_*/upsert_* core functions; the CLI owns click.edit and cancellation. Release resume-file behavior is preserved in the core upsert. - rules engine: execute_metadata_* build a MetadataMutationPlan and delegate presentation/confirmation to preview/confirm callbacks supplied by the CLI. - rule_parser: RuleSyntaxError keeps a plain str() message and adds a click-styled str_click property (click is imported only for styling). - update exports, tests, and the CLI top-level error handler.
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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
Fixes #117. Moves all
clickUI out of the corerose-pylibrary into therose-clifrontend, so the core no longer drives$EDITORor terminal prompts. Per the issue discussion,clickstays imported inrose-py— but only for styling (click.style) in the rule parser.Editor flows (releases / collages / playlists). Each
edit_*_in_editor/edit_releasefunction is split into a pureserialize_*(produce the text to edit) andupsert_*(apply the edited text). The CLI ownsclick.editand cancellation:Release edits keep the existing failed-edit resume-file semantics:
upsert_release_metadatastill writesfailed-release-edit.<id>.tomlon failure and deletes it on success, andserialize_release_metadata(..., resume_file=...)reads from it. The CLI skips the write when the TOML is unchanged (and not resuming), matching the old behavior.Rules engine.
execute_metadata_actionsno longer callsclick.echo/secho/confirm/prompt. It builds aMetadataMutationPlan(the computed-but-unwritten changes, with.describe(c)and.num_changes) and delegates presentation + confirmation to two callbacks:The colored diff and the "enter N to confirm" logic (formerly
enter_number_to_confirm_above_count) now live in the CLI's_preview_changes/_confirm_changes, threaded throughrun_actions_on_release,run_actions_on_track,execute_metadata_rule, andexecute_stored_metadata_rules.Rule parser.
RuleSyntaxErrorexposes both forms of its message:The CLI's top-level error handler (
__main__.py) printsstr_clickforRuleSyntaxErrorandstr(e)otherwise.Testing
mypy .,ruff format --check, andruff checkpass on the changed files.pytestpasses except the 4 pre-existing VFS mount tests that require FUSE (fuse: device not foundin this sandbox) — unrelated to this change.Link to Devin session: https://app.devin.ai/sessions/708f229d38bb44a085985640dbddb67c