mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2026-10-27 07:52:03 +00:00
2.9 KiB
2.9 KiB
AI Agent TUI Testing
This document defines a repeatable, methodical TUI test workflow for AI agents.
Goal
Run SeedPass as a real interactive user and produce deterministic artifacts:
- Step-level pass/fail.
- Coverage checkpoints for major TUI features.
- Full transcript for debugging and regression comparison.
Runner
Use:
source .venv/bin/activate
python scripts/ai_tui_agent_test.py
The runner:
- creates an isolated temporary
HOME - launches
src/main.py --no-clipboard - executes an end-to-end scenario through onboarding and major menu flows
- writes artifacts to
artifacts/agent_tui_test/<timestamp>/
Agent Commands Today
Use these command tiers when agents are validating changes:
- Fast targeted checks (recommended during iteration):
source .venv/bin/activate
pytest -q src/tests/test_manager_add_password.py src/tests/test_archive_restore.py src/tests/test_stats_screen.py src/tests/test_bip85_init.py
python scripts/ai_tui_agent_test.py
- Full regression check (before merge):
source .venv/bin/activate
pytest -q
python scripts/ai_tui_agent_test.py
- Stability sweep for TUI prompt timing:
source .venv/bin/activate
python scripts/ai_tui_agent_test.py && python scripts/ai_tui_agent_test.py && python scripts/ai_tui_agent_test.py
Artifacts
Each run writes:
report.json: status, step results, coverage points, failure info.transcript.clean.txt: ANSI-stripped terminal output.transcript.raw.txt: raw terminal output with ANSI.
Current Coverage Points
The harness marks these checkpoints as true only when observed:
startup_onboardingmain_menuinvalid_input_resilienceadd_password_quickinvalid_length_validationadd_totpadd_all_entry_typesretrieve_entrysearch_entrieslist_entriesmodify_entryarchive_restoretotp_codes_viewsettings_toggles_lock_unlocksettings_statsgraceful_exit
CI/Agent Use Pattern
Recommended agent sequence:
python scripts/ai_tui_agent_test.py- Parse
report.json - Fail task if
status != "passed"or any checkpoint isfalse - If failed, inspect
transcript.clean.txtfor prompt-flow drift or regressions
Optional Flags
python scripts/ai_tui_agent_test.py --help
Useful options:
--timeout: per-prompt timeout--password: fixed password used during test--output-dir: custom artifact root--keep-home: preserve generated profile state for local debugging--verbose: print step progress
Extending Coverage
When adding new TUI flows:
- Add deterministic steps to
scripts/ai_tui_agent_test.py. - Add a new coverage checkpoint key.
- Assert on concrete prompt/output text, not timing.
- Keep inputs deterministic and avoid clipboard-dependent behavior.
Roadmap
Future testing milestones are tracked in docs/agent_testing_roadmap.md.