Commit Graph
1893 Commits
Author SHA1 Message Date
thePR0M3TH3AN 37d0dffdc3 Merge branch 'beta' into main (safe conflict resolution) 2026-02-23 16:38:18 -05:00
thePR0M3TH3AN 3ea37865cb Add landing install copy UX and document remaining security/test TODOs 2026-02-23 16:33:57 -05:00
thePR0M3TH3AN 0789dfcb55 Harden agent policy and API import limits; fix docs links 2026-02-23 16:24:53 -05:00
thePR0M3TH3AN ae4fa2498b update 2026-02-23 15:48:38 -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
thePR0M3TH3AN 60d9df5489 Merge pull request #894 from PR0M3TH3AN/agents/daily/ci-health-agent-run-2026-02-19-15950167682274624288
Execute ci-health-agent daily run
2026-02-19 16:42:54 -05:00
google-labs-jules[bot]andPR0M3TH3AN a8d626a915 chore(scheduler): Execute ci-health-agent daily run
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-19 21:40:32 +00:00
thePR0M3TH3AN bfb802a4dd Merge pull request #893 from PR0M3TH3AN/setup-torch-13657129509493820037
Install and Setup TORCH
2026-02-19 15:53:53 -05:00
google-labs-jules[bot]andPR0M3TH3AN 73c998e36e Fix CI failure by formatting torch/scripts/find_dead_code.py
- Formatted `torch/scripts/find_dead_code.py` with `black` to pass CI style checks.
- Added `torch/scripts/` and `torch/src/` to `.gitignore` to prevent future untracked files from being accidentally committed, but kept necessary files tracked.
- Addressed user question about CI failures and improved TORCH packaging suggestions.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-19 20:50:31 +00:00
google-labs-jules[bot]andPR0M3TH3AN 8761455bd4 Install and setup TORCH in torch/ directory
- Added `torch-lock` dependency to `torch/package.json`
- Initialized TORCH structure using `cmdInit` (mocked interaction)
- Updated `torch/package.json` with TORCH CLI scripts (`lock:check`, `lock:lock`, etc.)
- Updated `torch/torch-config.json` with Nostr configuration
- Added `type: module` to `torch/package.json` to support ES modules
- Cleaned up extraneous directories (`test_logs`, `todo`, etc.) from initialization

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-19 20:16:19 +00:00
thePR0M3TH3AN 22cdb75b2b Merge pull request #891 from PR0M3TH3AN/agents/daily/bootstrap-torch-scheduler-9194672650426271720
Bootstrap Torch Scheduler and Daily Agent Workflow
2026-02-18 13:24:35 -05:00
google-labs-jules[bot]andPR0M3TH3AN 34ccc40531 Fix formatting and deprecation in scheduler
- Formatted `torch/scheduler.py` with `black` to pass CI linting.
- Replaced deprecated `datetime.datetime.utcnow()` with `datetime.datetime.now(datetime.timezone.utc)`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-18 17:05:35 +00:00
google-labs-jules[bot]andPR0M3TH3AN b2a267c50a Bootstrap torch environment and implement scheduler
- Created `torch/` directory structure.
- Created `torch/package.json` with locking and linting scripts.
- Created `torch/torch-config.json` with scheduler configuration.
- Created `torch/src/prompts/roster.json` and dummy prompts.
- Implemented `torch/scheduler.py` to handle daily agent execution flow:
    - Exclusion parsing
    - Round-robin selection
    - Locking with retry
    - Memory workflow (retrieve/store)
    - Validation (flake8)
    - Completion logging

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-18 17:01:38 +00:00
thePR0M3TH3AN 78cef9dfe7 removed torch 2026-02-18 10:41:45 -05:00
thePR0M3TH3AN 39d3b72e66 Merge pull request #889 from PR0M3TH3AN/opt-totp-cache-13978863474736758588
⚡ Optimize TOTP display loop by caching derived secrets
2026-02-18 10:23:09 -05:00
thePR0M3TH3AN 46d0690160 Merge pull request #866 from PR0M3TH3AN/torch-investigation-1170438085662974088
Answered questions about TORCH system
2026-02-18 10:20:36 -05:00
thePR0M3TH3AN a060b4fc61 Merge pull request #858 from PR0M3TH3AN/torch-install-test-9897678309148624992
feat: install TORCH and report findings
2026-02-18 10:20:20 -05:00
thePR0M3TH3AN 4640082dfe Merge branch 'beta' into torch-install-test-9897678309148624992 2026-02-18 09:54:44 -05:00
thePR0M3TH3AN 2d3bfe80ba Merge pull request #890 from PR0M3TH3AN/fix-code-quality-and-tests-6671300476435793261
Refactor test fixtures and fix linting issues
2026-02-18 09:26:58 -05:00
google-labs-jules[bot]andPR0M3TH3AN 49c4da7ff0 Fix CI formatting failure and linting issues
- Reformatted `src/tests/helpers.py`, `src/tests/test_generate_test_profile_sync.py`, `src/tests/test_manifest_id_privacy.py`, and `src/tests/test_restore_from_nostr_setup.py` using `black`.
- Refactored `src/tests/helpers.py` to fix dispersed imports and remove unused imports (`time`, `asyncio`), resolving `flake8` warnings.
- Split long lines in `src/tests/helpers.py` to improve readability and compliance with style guides.
- Verified formatting with `black --check .`.
- Verified all tests pass with `pytest`.
- Confirmed `flake8` errors related to line length in `helpers.py` are acceptable as CI does not enforce strict 79-char limit (using `black` defaults).

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-18 04:05:16 +00:00
thePR0M3TH3AN 83df3eda57 Merge pull request #888 from PR0M3TH3AN/torch/verify-lint-5929546890394122651
Verify torch/src/ with lint
2026-02-17 22:45:48 -05:00
google-labs-jules[bot]andPR0M3TH3AN 878c13ffe8 Verify torch/src/ with lint and fix Windows CI
- Restore missing source files in `torch/src/` from `torch-lock` dependency.
- Setup ESLint in `torch/`.
- Fix linting issues in `src/lock-ops.mjs`, `src/lock-utils.mjs`, `src/ops.mjs`, `src/services/memory/embedder.js`.
- Fix missing crypto import in `src/services/memory/schema.js`.
- Rename `torch/src/todo/TODO_2026-02-15T01:03:31Z.md` to `torch/src/todo/TODO_2026-02-15T01-03-31Z.md` to fix Windows CI failure.
- Mark 'Verify with lint' as completed in `src/todo/TODO_2026-02-14T13-30-00Z.md`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-18 03:44:26 +00:00
google-labs-jules[bot]andPR0M3TH3AN 1f92fe7901 Refactor test fixtures and fix linting issues
- Moved `client` and `dummy_nostr_client` fixtures to `src/tests/conftest.py` to fix F811 redefinition errors and improve test organization.
- Introduced `make_dummy_nostr_client` factory fixture to support tests requiring multiple client instances.
- Updated all affected tests to use the new fixture pattern.
- Removed deprecated `is_flag=True` from Typer boolean options in CLI modules.
- Fixed F541 (f-string without placeholders) in `entry_management.py`.
- Fixed F841 (unused variable) in `manager.py`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-18 03:39:55 +00:00
google-labs-jules[bot]andPR0M3TH3AN b0c3a97ce3 perf: Cache derived TOTP secrets in display loops
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-18 03:39:51 +00:00
google-labs-jules[bot]andPR0M3TH3AN 22bb29f16f Verify torch/src/ with lint
- Restore missing source files in `torch/src/` from `torch-lock` dependency.
- Setup ESLint in `torch/`.
- Fix linting issues in `src/lock-ops.mjs`, `src/lock-utils.mjs`, `src/ops.mjs`, `src/services/memory/embedder.js`.
- Mark 'Verify with lint' as completed in `src/todo/TODO_2026-02-14T13-30-00Z.md`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-18 03:33:32 +00:00
thePR0M3TH3AN 8cdf1c523d Merge pull request #885 from PR0M3TH3AN/agent/ci-health-run-2026-02-17-fix-env-17308312763076254157
feat(ci): Record daily health check results
2026-02-17 13:11:08 -05:00
google-labs-jules[bot]andPR0M3TH3AN 551d02bfef feat(ci): Record daily health check results
- Added task log `2026-02-17T17-37-50Z__ci-health-agent__failed.md` indicating flake8 failures.
- Updated `torch/package-lock.json` to resolve integrity check failure for `torch-lock` dependency.
- Note: `pytest` passed successfully.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 17:42:06 +00:00
thePR0M3TH3AN c00e093bac Merge pull request #884 from PR0M3TH3AN/agents/daily/ci-health-agent-run-16804626004467532014
Bootstrap TORCH environment and run daily scheduler
2026-02-17 12:07:15 -05:00
google-labs-jules[bot]andPR0M3TH3AN a9cfb2bbec chore: bootstrap daily agent scheduler and execute ci-health-agent
Bootstrapped the TORCH agent environment by creating necessary configuration files (`torch/src/prompts/roster.json`, `torch/torch-config.json`, `torch/package.json`, `torch/src/prompts/daily/ci-health-agent.md`).

Executed the daily scheduler flow:
- Selected `ci-health-agent`.
- Acquired lock.
- Executed repository checks (`flake8`, `pytest`).
- Checks failed (style violations and config issue).
- Wrote failure log `torch/task-logs/daily/..._failed.md`.
- Did not complete lock.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 16:45:07 +00:00
thePR0M3TH3AN 98d30efc1e Merge pull request #881 from PR0M3TH3AN/test-api-services-18361836480733235045
Add tests for core API service classes
2026-02-16 13:20:11 -05:00
thePR0M3TH3AN c0e389925e Merge pull request #880 from PR0M3TH3AN/fix/docs-search-xss-13126955051571553901
Fix XSS in docs search highlighting
2026-02-16 13:19:46 -05:00
thePR0M3TH3AN 82b81aa79b Merge pull request #882 from PR0M3TH3AN/fix/scan-codebase-linting-12332732608299564025
Fix formatting and logic errors found during codebase scan
2026-02-16 13:19:33 -05:00
thePR0M3TH3AN 8e0a42a2f9 Merge pull request #883 from PR0M3TH3AN/fix/event-handler-cleanup-17003112404371712903
Clean up repo-context.txt removing phantom EventHandler
2026-02-16 13:19:19 -05:00
google-labs-jules[bot]andPR0M3TH3AN 1c5cf3e087 Fix formatting in test_core_api_services.py
Applied `black` formatting to `src/tests/test_core_api_services.py` to resolve CI linting failure.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 18:12:26 +00:00
google-labs-jules[bot]andPR0M3TH3AN 37f8b5acc2 Rename TODO file to be Windows compatible
- Rename `torch/src/todo/TODO_2026-02-16T11:47:38Z.md` to `torch/src/todo/TODO_2026-02-16T11-47-38Z.md`
- Removes colons from the filename to fix "invalid path" errors on Windows CI runners

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 18:12:11 +00:00
google-labs-jules[bot]andPR0M3TH3AN 60b850b5bb Clean up repo-context.txt removing phantom EventHandler
The file src/nostr/event_handler.py does not exist in the codebase, and EventHandler is not used in src/nostr/client.py.
However, src/repo-context.txt incorrectly contained references to this file and usage.
This change updates src/repo-context.txt to remove the hallucinated/outdated code references, aligning the documentation with the actual codebase state.
Attempts to remove unused imports in src/nostr/client.py were reverted as tests rely on monkeypatching them.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 18:10:45 +00:00
google-labs-jules[bot]andPR0M3TH3AN 8e33f9c5e1 Fix formatting, linting, and logic errors from codebase scan
- Apply black formatting to 17 files.
- Fix F821 undefined name errors in:
  - src/main.py: Add missing `queue` import.
  - src/seedpass/core/encryption.py: Fix `JSONDecodeError` reference.
  - src/utils/__init__.py: Fix exception variable scope in fallback code.
  - src/utils/key_derivation.py: Add `TYPE_CHECKING` imports.
  - src/seedpass/core/config_manager.py: Add `TYPE_CHECKING` imports.
- Initialize torch environment and TODO file.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 18:09:48 +00:00
google-labs-jules[bot]andPR0M3TH3AN fe4344c21a Add comprehensive tests for core API service classes
Added `src/tests/test_core_api_services.py` to test public methods of
`VaultService`, `ProfileService`, `SyncService`, `EntryService`,
`ConfigService`, `UtilityService`, and `NostrService` in `src/seedpass/core/api.py`.

These tests ensure proper thread safety (locking) and delegation to
the underlying `PasswordManager` and its components.

Key improvements:
- Verified locking behavior for thread-safe operations.
- Validated delegation logic for all service methods.
- Covered edge cases like default vs. custom password generation policies.
- Mocked external dependencies (pubsub bus, manager components) to isolate service logic.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 18:09:03 +00:00
google-labs-jules[bot]andPR0M3TH3AN f38bbe57d2 Fix XSS vulnerability in docs search highlighting
- Implement `escapeHtml` function in `docs/assets/theme.js`
- Update `highlight` function to safely escape content before wrapping matches in `<mark>` tags
- Update `torch/src/todo/TODO_2026-02-16T11:47:38Z.md` to mark task as completed

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 18:06:19 +00:00
thePR0M3TH3AN 8094311219 Merge pull request #876 from PR0M3TH3AN/test-modify-entry-validation-4213307223161980339
🧪 Add validation tests for modify_entry
2026-02-16 12:49:31 -05:00
thePR0M3TH3AN b2a8fdefb0 Merge pull request #879 from PR0M3TH3AN/test-imghdr-stub-12332639906948512707
Add tests for imghdr_stub.py
2026-02-16 12:49:15 -05:00
thePR0M3TH3AN 10317aec03 Merge pull request #877 from PR0M3TH3AN/security-fix-token-timing-attack-14331876507002006471
🔒 Fix timing attack vulnerability in API token verification
2026-02-16 12:48:52 -05:00
thePR0M3TH3AN 48711a7320 Merge pull request #878 from PR0M3TH3AN/test-key-validation-coverage-8412470545867749142
🧪 Add error handling tests for key validation utils
2026-02-16 12:48:21 -05:00
thePR0M3TH3AN 9575ca1c7e Merge pull request #874 from PR0M3TH3AN/nostr-perf-concurrent-chunks-11272584633812719406
⚡ Concurrent Nostr snapshot chunk fetching
2026-02-16 12:47:58 -05:00
thePR0M3TH3AN 3b6325dc72 Merge pull request #872 from PR0M3TH3AN/code-health/remove-redundant-else-14874071705569730132
Refactor BIP85: Remove redundant elif block
2026-02-16 12:47:39 -05:00
thePR0M3TH3AN c6560305a9 Merge pull request #873 from PR0M3TH3AN/remove-unused-event-handler-5859192189539737629
Remove unused EventHandler class
2026-02-16 12:47:25 -05:00
google-labs-jules[bot]andPR0M3TH3AN 654f9c05a6 feat(test): add tests for imghdr_stub.py
Adds comprehensive tests for `src/utils/imghdr_stub.py` to ensure it correctly identifies image headers, covering all supported formats and edge cases. This is crucial as `imghdr` is removed in Python 3.13 and this stub is used by dependencies like `pgpy`.

- Added `src/tests/test_imghdr_stub.py` covering:
  - `what()` function with file paths, Path objects, file-like objects, and bytes.
  - All supported image formats (JPEG, PNG, GIF, TIFF, etc.).
  - Edge cases (empty file, short file, unknown type).
- Verified tests pass locally.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 17:47:23 +00:00
thePR0M3TH3AN 8b2534704f Merge pull request #875 from PR0M3TH3AN/refactor-file-lock-deduplication-16243706415213673778
Refactor file_lock.py to reduce code duplication
2026-02-16 12:47:00 -05:00
google-labs-jules[bot]andPR0M3TH3AN 3fd2470ccc Add error handling tests for key validation utils
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 17:45:53 +00:00