Commit Graph
1994 Commits
Author SHA1 Message Date
google-labs-jules[bot]andPR0M3TH3AN 9456e58d21 feat(scheduler): execute todo-triage-agent daily task
- Acquired lock for todo-triage-agent
- Retrieved memory context
- Scanned repository for TODOs
- Identified security-sensitive TODO in src/utils/memory_protection.py
- Created simulated issue artifact
- Stored execution memory
- Validated repository with tests
- Published completion to Nostr
- Wrote completion log

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-26 21:20:50 +00:00
thePR0M3TH3AN 4459dfea78 Fix display service input hooks and clean pytest warnings 2026-02-26 15:45:55 -05:00
thePR0M3TH3AN 44a5afa99b Merge pull request #928 from PR0M3TH3AN/refactor/gui-backend-constants-18119685441517758660
Refactor GUI backend configuration to constants
2026-02-26 14:37:14 -05:00
thePR0M3TH3AN 53dcbb72c6 Merge pull request #929 from PR0M3TH3AN/refactor-menu-handler-generic-8639963642107346
Refactor entry menus to use generic `MenuHandler.run_menu`
2026-02-26 14:37:03 -05:00
thePR0M3TH3AN ca1b371e85 Merge pull request #930 from PR0M3TH3AN/refactor/password-complexity-4748189869193669602
🧹 Refactor _enforce_complexity for better maintainability
2026-02-26 14:36:49 -05:00
thePR0M3TH3AN bacb6bb48b Merge pull request #931 from PR0M3TH3AN/refactor-modify-entry-complexity-13101960046929337041
🧹 Refactor modify_entry to reduce complexity
2026-02-26 14:36:38 -05:00
thePR0M3TH3AN fddb1e6d36 Merge pull request #927 from PR0M3TH3AN/fix-race-condition-backup-perms-14885258456096381192
Fix race condition in backup file permissions using atomic_write
2026-02-26 14:36:26 -05:00
thePR0M3TH3AN 9a8c68dc81 Merge pull request #926 from PR0M3TH3AN/refactor/handle-add-methods-duplication-16655045915046682728
Refactor handle_add_* methods in manager.py to remove duplication
2026-02-26 14:36:12 -05:00
thePR0M3TH3AN 1c4ccb0bcb Merge pull request #925 from PR0M3TH3AN/fix/pycryptodome-dependency-10448946637332491323
🔒 Fix missing pycryptodome dependency for PGP features
2026-02-26 14:35:56 -05:00
thePR0M3TH3AN b680e1dfa5 Merge pull request #924 from PR0M3TH3AN/test-fingerprint-edge-cases-17056355250998203024
🧪 Add edge case tests for generate_fingerprint
2026-02-26 14:35:44 -05:00
thePR0M3TH3AN c8879d0f3d Merge pull request #923 from PR0M3TH3AN/refactor/vault-load-index-9200132074012040692
Refactor Vault.load_index to improve readability
2026-02-26 14:35:31 -05:00
thePR0M3TH3AN df56456406 Merge pull request #922 from PR0M3TH3AN/agents/daily/style-agent-16178690583825486979
chore(style): apply black formatting
2026-02-26 14:35:17 -05:00
thePR0M3TH3AN 92753034af Merge branch 'beta' into agents/daily/style-agent-16178690583825486979 2026-02-26 14:35:09 -05:00
thePR0M3TH3AN 9408a64c1c Merge pull request #921 from PR0M3TH3AN/fix-backup-seed-overwrite-3580566875642074998
🔒 Fix Arbitrary File Overwrite in backup_parent_seed
2026-02-26 14:34:32 -05:00
thePR0M3TH3AN f7d679d448 Merge pull request #920 from PR0M3TH3AN/agents/daily/scheduler-update-agent-14403425269970827929
Daily Scheduler Run: scheduler-update-agent
2026-02-26 14:34:16 -05:00
thePR0M3TH3AN 11f61cec4c Merge pull request #919 from PR0M3TH3AN/code-health-display-service-3270220411041344632
🧹 Refactor display logic to DisplayService
2026-02-26 14:33:22 -05:00
thePR0M3TH3AN 7a74a3d77d Merge pull request #918 from PR0M3TH3AN/refactor-initialize-managers-2379820850270818796
Refactor initialize_managers in PasswordManager
2026-02-26 14:33:05 -05:00
thePR0M3TH3AN 499f2c0915 Merge pull request #917 from PR0M3TH3AN/perf-import-vault-blocking-7033826596991244331
⚡ Optimize import_vault endpoint to prevent blocking event loop
2026-02-26 14:32:50 -05:00
thePR0M3TH3AN 115eacb326 Merge pull request #916 from PR0M3TH3AN/jules-stats-manager-test-11560243951841616901
Add test for StatsManager.reset
2026-02-26 14:32:34 -05:00
thePR0M3TH3AN 0205a738e5 Merge pull request #915 from PR0M3TH3AN/atomic-write-cleanup-tests-2648208333040730996
test: verify atomic_write cleanup on failure
2026-02-26 14:32:14 -05:00
google-labs-jules[bot]andPR0M3TH3AN 96afc4afc2 Refactor modify_entry to reduce complexity by using helper methods
Refactored the `modify_entry` method in `src/seedpass/core/entry_management.py` to delegate entry modification logic to specialized private helper methods:
- `_modify_common_fields`: Handles fields common to all entries (label, notes, archived, etc.)
- `_modify_password_entry`: Handles password-specific fields and policy
- `_modify_totp_entry`: Handles TOTP-specific fields (period, digits)
- `_modify_key_value_entry`: Handles key-value specific fields
- `_modify_managed_account_entry`: Handles managed account specific fields

This change improves code readability and maintainability by breaking down a large, complex function into smaller, focused units. Verified with existing tests.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-26 19:31:32 +00:00
google-labs-jules[bot]andPR0M3TH3AN a1b459f98f Refactor entry menus to use generic MenuHandler.run_menu
Consolidated duplicated menu loop logic from `_entry_actions_menu`, `_entry_edit_menu`, and `_entry_qr_menu` in `src/seedpass/core/manager.py` into a reusable `run_menu` method in `src/seedpass/core/menu_handler.py`. This improves maintainability by centralizing the loop handling, input prompting, and header clearing logic.

*   Added `run_menu` to `MenuHandler`.
*   Refactored `_entry_actions_menu` to use `run_menu`.
*   Refactored `_entry_edit_menu` to use `run_menu`.
*   Refactored `_entry_qr_menu` (NOSTR section) to use `run_menu`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-26 19:26:55 +00:00
google-labs-jules[bot]andPR0M3TH3AN 9e08e5082b Refactor GUI backend config to constants.py
Extracts the hardcoded BeeWare GUI backend configuration (package names, versions, and SHA256 hashes) from `src/seedpass/cli/__init__.py` into a new `GUI_BACKEND_CONFIG` dictionary in `src/constants.py`. This improves maintainability by centralizing configuration and simplifying the CLI logic.

- Adds `GUI_BACKEND_CONFIG` to `src/constants.py`.
- Updates `src/seedpass/cli/__init__.py` to import and use `GUI_BACKEND_CONFIG`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-26 19:25:24 +00:00
google-labs-jules[bot]andPR0M3TH3AN bee0d6235a Fix: prevent race condition in backup file permissions
This change replaces insecure file writes followed by `os.chmod` with `utils.atomic_write.atomic_write` in `portable_backup.py` and `manager.py`. The `atomic_write` function uses `tempfile.mkstemp` to ensure files are created with restrictive permissions (0o600) from the start, eliminating the race condition where sensitive data could be briefly world-readable.

- Updated `export_backup` in `portable_backup.py` to use `atomic_write` for both the JSON backup and its encrypted counterpart.
- Updated `handle_export_totp_codes` in `manager.py` to use `atomic_write` for TOTP exports.
- Added `test_atomic_write_perms.py` to verify permissions behavior (though it relies on system-specific `mkstemp` behavior).
- Verified fix by running existing tests `test_portable_backup.py`, `test_export_totp_codes.py`, and `test_atomic_write.py`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-26 19:23:45 +00:00
google-labs-jules[bot]andPR0M3TH3AN 4ebc14e703 Refactor handle_add_* methods to remove duplication
- Introduced `_clear_header_add_entry`, `_mark_dirty`, `_sync_and_pause` helpers.
- Introduced `_entry_op_context` context manager for error handling.
- Applied these patterns to `handle_add_totp`, `handle_add_ssh_key`, `handle_add_seed`, `handle_add_pgp`, `handle_add_nostr_key`, `handle_add_key_value`, and `handle_add_managed_account`.
- Ensured `is_dirty` flag is set immediately after entry creation to prevent data loss if subsequent UI steps are cancelled.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-26 19:18:51 +00:00
google-labs-jules[bot]andPR0M3TH3AN 1dc98a3e96 fix(deps): add pycryptodome dependency for PGP RSA features
This change explicitly adds `pycryptodome` to `pyproject.toml` and `src/requirements.txt` to resolve a `ModuleNotFoundError` when generating PGP RSA keys. The `Crypto` namespace provided by `pycryptodome` is required by `src/seedpass/core/password_generation.py`.

Verified with `reproduce_issue.py` (which now passes) and `src/tests/test_pgp_entry.py`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-26 19:17:29 +00:00
google-labs-jules[bot]andPR0M3TH3AN 6a921b8f84 test: add comprehensive unit tests for generate_fingerprint
Add `src/tests/test_fingerprint.py` to cover:
- Happy path fingerprint generation.
- Custom fingerprint length.
- Input normalization (whitespace/case).
- Error handling via mocked exception in `hashlib.sha256`.
- Invalid input handling (NoneType).

This addresses the gap where the exception path in `src/utils/fingerprint.py` was unreachable with standard inputs.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-26 19:15:19 +00:00
google-labs-jules[bot]andPR0M3TH3AN e6ff619860 Refactor Vault.load_index into smaller private methods.
Split the `load_index` method in `src/seedpass/core/vault.py` into
`_handle_legacy_file_migration`, `_restore_legacy_backup`,
`_load_and_handle_decryption`, `_check_schema_version`, and
`_apply_schema_migrations`. This improves readability and maintainability
by separating the concerns of legacy file handling, decryption, and schema
migration.

Verified with existing tests in `src/tests/test_legacy_migration.py` and
`src/tests/test_migrations.py`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-26 19:11:50 +00:00
google-labs-jules[bot]andPR0M3TH3AN e40a245858 chore(style): apply black formatting
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-26 19:10:25 +00:00
google-labs-jules[bot]andPR0M3TH3AN 39f552d589 Fix: Prevent arbitrary file overwrite in backup_parent_seed
This change mitigates an arbitrary file overwrite vulnerability in the
`backup_parent_seed` API endpoint. Previously, the endpoint did not
check if the destination file already existed, allowing attackers or
accidental misuse to overwrite critical files if the path validation
passed.

The fix introduces a check using `resolved_path.exists()` after path
validation. If the file exists, the request is rejected with a
409 Conflict error.

A reproduction test case confirmed the vulnerability and verified the
fix. Regression tests on the API passed successfully.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-26 19:09:06 +00:00
google-labs-jules[bot]andPR0M3TH3AN 2a3a960d7a docs(prompts): sync scheduler rosters — 2026-02-26
Executed `scheduler-update-agent`.
- Verified daily and weekly prompt directories against `roster.json`.
- Confirmed no drift in `daily-scheduler.md` and `weekly-scheduler.md`.
- Published completion log.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-26 18:23:03 +00:00
google-labs-jules[bot]andPR0M3TH3AN a6856c1fec Refactor _enforce_complexity in password_generation.py
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-26 18:17:59 +00:00
google-labs-jules[bot]andPR0M3TH3AN 40f37b30bd Refactor display_sensitive_entry_info into DisplayService
Extracted the monolithic `display_sensitive_entry_info` method from `PasswordManager` into a new `DisplayService` class in `src/seedpass/core/display_service.py`. This improves maintainability and separation of concerns.

- Created `src/seedpass/core/display_service.py` with `DisplayService` class.
- Implemented specific display methods for each entry type (TOTP, SSH, SEED, PGP, Nostr, Key/Value, Managed Account, Password).
- Updated `src/seedpass/core/manager.py` to use `DisplayService`.
- Verified with existing tests `test_manager_retrieve_totp.py` and `test_manager_search_display.py`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-26 18:11:07 +00:00
google-labs-jules[bot]andPR0M3TH3AN 24fa2e8e1a Refactor initialize_managers in PasswordManager for better readability
Extracted logic from `initialize_managers` into helper methods:
- `_initialize_config_and_state`
- `_initialize_entry_manager`
- `_initialize_password_generator`
- `_initialize_nostr_client`
- `_handle_migration`

This improves code organization and maintainability without altering functionality. Verified with `test_vault_initialization.py`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-26 18:11:05 +00:00
google-labs-jules[bot]andPR0M3TH3AN cf9d473abe perf: offload blocking import_vault operations to thread
Refactors `import_vault` endpoint in `src/seedpass/api.py` to use `asyncio.to_thread` for blocking file I/O and synchronous `PasswordManager.handle_import_database` calls.
Replaces synchronous `pm.sync_vault()` with `await pm.sync_vault_async()` (with fallback) to prevent blocking the event loop or triggering `asyncio.run` errors.

This change ensures the API remains responsive during large vault imports.
Verified with a custom benchmark script showing concurrent requests are no longer blocked.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-26 17:48:27 +00:00
google-labs-jules[bot]andPR0M3TH3AN 407dfee1a5 Add unit test for StatsManager.reset method
This commit adds a new test file `src/tests/test_stats_manager.py` to verify the functionality of the `StatsManager.reset` method. The test ensures that the `reset` method correctly resets the internal `_displayed` flag, allowing stats to be displayed again after a reset.

Testing:
- Added `test_stats_manager_reset` which mocks the manager and verifies `display_stats` calls before and after reset.
- Verified the test passes in isolation.
- Skipped full integration tests due to environment limitations, but the change is isolated to a new test file and does not modify production code.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-26 17:46:25 +00:00
google-labs-jules[bot]andPR0M3TH3AN 566988bdf9 test: verify atomic_write cleanup on failure
Added two new test cases to `src/tests/test_atomic_write.py`:
- `test_atomic_write_cleanup_on_failure`: Verifies that the temporary file is deleted if the write operation fails.
- `test_atomic_write_preserves_existing_on_failure`: Verifies that an existing destination file is preserved if the write operation fails.

These tests ensure the robustness of the `atomic_write` utility function.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-26 17:45:29 +00:00
thePR0M3TH3AN ece0dda09f chore(backups): add torch backup snapshot 2026-02-26T13-45-30-661Z 2026-02-26 08:48:45 -05:00
thePR0M3TH3AN b5d8caa280 fix(torch): handle self-copy update paths and record bitvid context note 2026-02-26 08:47:54 -05:00
thePR0M3TH3AN 75632cb780 chore(torch): update TORCH and rotate memory update 2026-02-26 08:34:19 -05:00
thePR0M3TH3AN 73068dba73 Merge pull request #910 from PR0M3TH3AN/agents/daily/protocol-research-agent-1628573958005058735
protocol-research-agent: Create Protocol Inventory & Compliance Report
2026-02-26 08:11:04 -05:00
thePR0M3TH3AN df0ed4f1a9 Merge branch 'beta' into agents/daily/protocol-research-agent-1628573958005058735 2026-02-26 08:10:55 -05:00
thePR0M3TH3AN ae2b863e69 Merge pull request #908 from PR0M3TH3AN/agents/daily/onboarding-audit-agent-8897219026798356218
Scheduler run: onboarding-audit-agent (daily)
2026-02-26 08:10:21 -05:00
thePR0M3TH3AN 056f12eb43 Merge branch 'beta' into agents/daily/onboarding-audit-agent-8897219026798356218 2026-02-26 08:10:12 -05:00
thePR0M3TH3AN a610fc2621 Merge pull request #909 from PR0M3TH3AN/agents/daily/perf-agent-1052491488505199855
perf-agent: Initial baseline and setup
2026-02-26 08:09:36 -05:00
thePR0M3TH3AN 1b10686146 Merge branch 'beta' into agents/daily/perf-agent-1052491488505199855 2026-02-26 08:09:22 -05:00
google-labs-jules[bot]andPR0M3TH3AN f13afb8dec Fix infinite loop in profile management test with robust input mocking
- Update `src/tests/test_profile_management.py` to use a more robust `input` mock iterator.
- Mock returns fallback "y" responses after the initial choice ("3") to break any potential infinite loops in `confirm_action` if mocking fails or module reloading interferes.
- Addresses `OSError` and timeout on Windows CI caused by interactive prompt loops.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-26 09:34:18 +00:00
google-labs-jules[bot]andPR0M3TH3AN d2052904c5 Fix Windows CI failure in test_profile_management.py
Replace unsafe module reloading with explicit monkeypatching of constants.
This prevents potential OSError: [Errno 22] Invalid argument on Windows
during TemporaryDirectory cleanup or test execution when modules are reloaded
in a way that affects global state or file handles.

Also ensured `pm.fingerprint_manager` is initialized using the monkeypatched
`APP_DIR` from the manager module context to guarantee it operates within
the temporary directory context and aligns with the mocked constants.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-26 09:24:23 +00:00
google-labs-jules[bot]andPR0M3TH3AN d3264adddc Fix Windows CI failure in test_profile_management.py
Patched `masked_input` in `utils.password_prompt` to bypass `msvcrt.getwch()` usage during tests, preventing `OSError: [Errno 22] Invalid argument` in non-interactive CI environments.
Ensured the test logic relies on the mocked `builtins.input` as intended.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-26 09:23:25 +00:00
google-labs-jules[bot]andPR0M3TH3AN e20dfc55e9 Fix formatting and infinite loop in profile management test
- Run `black` on `src/tests/test_profile_management.py`.
- Mock `utils.password_prompt.confirm_action` to prevent infinite recursion during reload.
- Use an iterator for `input` mock to prevent infinite loops.
- Add docstring to test function.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-26 09:22:59 +00:00