feat(console): form editor for argus.yml (Configure screen)#264
Merged
eFAILution merged 1 commit intoJun 13, 2026
Merged
Conversation
Phase 2 of the Console roadmap. The home menu's Configure entry now opens a form editor (ConfigScreen) instead of shelling out to $EDITOR: scanner on/off toggles and the bounded choice settings (severity_threshold, execution backend/pull_policy, view cve_source/open_location) are listed with their current value and a one-line description; enter cycles a value, s validates + writes, esc discards. Edits go through config_editor.py — a UI-free, textual-free module so it's covered in CI without the [terminal] extra. Write-back is comment-preserving: set_value walks the file indentation-aware to the matched key: value line and rewrites only its value, keeping key, indentation, and any trailing inline comment. This resolves the roadmap's open YAML write-back decision in favour of targeted line edits over a ruamel.yaml round-trip — no new dependency, at the cost of only editing settings already present in the file. Before saving, the result is re-validated against argus.core.schema.validate_config and refused on any error-level issue. When no argus.yml exists, Configure nudges toward Initialize and falls back to $EDITOR/$VISUAL so a file can still be created by hand.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
5e12dc4
into
feat/tui-explorer-and-scan-runner
19 of 21 checks passed
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.
Description
Phase 2 of the Console roadmap: a form editor for
argus.yml. The home menu's Configure entry now opens an in-appConfigScreeninstead of shelling out to$EDITOR. This PR targets the Console integration branch (feat/tui-explorer-and-scan-runner, PR #261), notmain— it merges in once green so the full Console can be reviewed as one solution.Changes Made
Details
ConfigScreen(argus/viewers/terminal/console.py): lists editable settings as anOptionListwith current value + a one-line description.entercycles a value,svalidates + writes,escdiscards. When noargus.ymlexists it nudges toward Initialize and falls back to$EDITOR/$VISUAL.config_editor.py(new,argus/viewers/terminal/): UI-free, textual-free edit core so it's covered in CI without the[terminal]extra.editable_rows→ scannerenabledtoggles + bounded choice settings (severity_threshold, executionbackend/pull_policy, viewcve_source/open_location).set_value→ comment-preserving targeted line rewrite: walks the file indentation-aware to the matchedkey: valueline and rewrites only its value, keeping key, indentation, and any trailing inline comment.validate→ re-parses and runsargus.core.schema.validate_config, refusing save on anyerror-level issue.ruamel.yamlround-trip — no new dependency, at the cost of only editing settings already present in the file.$EDITORpath is preserved as the fallback for the no-config and free-text cases.Testing
Test Results
test_config_editor.py(new): 22 tests covering editable-row parsing, comment-/indentation-preserving edits, toggle/enum cycling, and validation.test_console.py(updated): Configure now routes through_open_config— covers both the "opens ConfigScreen whenargus.ymlpresent" and "falls back to$EDITORwhen absent" paths, plusConfigScreenconstruction.viewers/browserfailures are the known pre-existing fastapi-0.136.1 template diffs (green in CI), unrelated to this change.Security Considerations
Security Details
Edits are bounded to a fixed set of toggle/enum scalars and validated against the config schema before write. No code execution; the
$EDITORfallback is unchanged from prior behaviour.AI Context Updates (.ai/)
.ai/architecture.yamlupdated (Configure form editor +config_editor.pynoted underviewers/terminal/).ai/workflows.yamlupdated.ai/decisions.yamlupdated.ai/errors.yamlupdatedChecklist
docs/console.mdConfigure section,docs/developer/CONSOLE-ROADMAP.mdPhase 2 → shipped)Related Issues
Part of the Console epic (
docs/developer/CONSOLE-ROADMAP.md, Phase 2).Screenshots/Logs (if applicable)
Console form editor is keyboard-driven (↑↓ move · enter change · s save · esc cancel). Home-screen + settings screenshots are in PR #261 / #262.