Commit Graph
5 Commits
Author SHA1 Message Date
google-labs-jules[bot]andPR0M3TH3AN 8489aaf529 style: reformat files with black to fix CI
CI checks were failing because three files were out of formatting compliance with black.
Reformatted the following files to pass the `black --check .` step:
- `scripts/ai_tui_agent_test.py`
- `torch/scripts/test-audit/run_python_static_analysis.py`
- `torch/scripts/test-audit/run_python_flaky_check.py`

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-27 20:44:37 +00:00
google-labs-jules[bot]andPR0M3TH3AN 17dfd0ec2c fix(tests): resolve termios / pty import error on Windows
The `ai_tui_agent_test.py` script imports `pty`, which relies on `termios`. Both of these are Unix-only modules and cause a `ModuleNotFoundError` when the test suite is collected or executed on Windows.

This fix:
1. Adds `pytest.importorskip("pty")` to `src/tests/test_ai_tui_agent_harness.py` to skip the tests gracefully on Windows.
2. Updates `scripts/ai_tui_agent_test.py` to catch the `ImportError` and exit gracefully with an error message, preventing it from crashing unconditionally if imported or run directly on Windows.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-27 20:33:20 +00:00
thePR0M3TH3AN 882cd060fa Fix Python 3.10 compatibility for UTC timezone usage 2026-02-25 21:26:32 -05:00
thePR0M3TH3AN 03958106e1 Add agent mode, hardened TUI harness, coverage gates, and cross-platform installer smoke CI
This commit delivers four related improvements focused on reliability and automation while preserving existing human/TUI workflows.

1) Agent-first CLI mode (additive)
- Added new `seedpass agent` command group (`src/seedpass/cli/agent.py`) and wired it into CLI root.
- Implemented non-interactive profile bootstrap: `seedpass agent init` with `--seed|--seed-file|--generate-seed` and password env injection (`--password-env`).
- Added policy management commands: `agent policy-show` and `agent policy-set` with allow/deny kind controls.
- Added JSON-based secret retrieval: `seedpass -f <fingerprint> agent get <query> --ttl <sec>` with lease metadata and policy enforcement.
- Kept regular human mode fully available; no behavioral changes to interactive TUI entrypoint.

2) TUI agent harness deepening and stabilization
- Refactored harness into scenario profiles: `core`, `extended`, `stress` with `--scenario` selection.
- Added deterministic seeded stress campaigns: `--stress-cycles`, `--stress-seed`.
- Added scenario-specific required coverage keys and report metadata.
- Added post-condition assertions in extended scenario (archive/restore consistency, lock/unlock retrieval recovery).
- Hardened prompt matching for output variants and fail-fast behavior on non-zero SeedPass exit codes.
- Added harness unit tests for helper logic and control flow.

3) Critical module coverage gate tooling
- Added `scripts/check_critical_coverage.py` to enforce per-module thresholds from coverage JSON and report uncovered functions.
- Added override controls (`--threshold`, `--no-default-thresholds`) and optional JSON result output.
- Integrated coverage JSON generation into CI helper script and optional gate execution via `CRITICAL_COVERAGE_GATE=1`.
- Tuned default thresholds using full-suite baseline and increased strictness:
  - `src/main.py >= 50%`
  - `src/seedpass/core/manager.py >= 60%`
  - `src/seedpass/core/encryption.py >= 80%`
  - `src/seedpass/core/migrations.py >= 90%`
- Added tests for coverage gate parser/analysis logic and targeted manager worker path tests.

4) Installer validation framework for beta/main
- Added cross-platform installer smoke scripts:
  - `scripts/installer_smoke_unix.sh`
  - `scripts/installer_smoke_windows.ps1`
- Added GitHub Actions workflow `.github/workflows/installer-smoke.yml` with:
  - reduced PR matrix
  - full scheduled/manual matrix across OS/branch/mode
  - per-job log capture and artifact uploads for failure triage
- Added installer testing documentation and linked from README.

Additional housekeeping
- Added `.venv/` to `.gitignore`.
- Updated docs for new harness scenarios, seeded stress mode, post-condition metadata, coverage gate usage, and installer testing workflow.
2026-02-23 15:47:59 -05:00
thePR0M3TH3AN dd7290e83b Add robust AI TUI harness, docs roadmap, and lock/unlock fix 2026-02-23 14:35:40 -05:00