Commit Graph
2218 Commits
Author SHA1 Message Date
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
google-labs-jules[bot]andPR0M3TH3AN e59cc1af2e Fix timing attack vulnerability in token verification
Replaced insecure string comparison with `secrets.compare_digest` in `_check_token` to prevent timing attacks.
Added a test case for missing token to ensure robust error handling.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 17:44:02 +00:00
google-labs-jules[bot]andPR0M3TH3AN 1f43f9f731 Add tests for modify_entry invalid fields validation
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 17:43:42 +00:00
google-labs-jules[bot]andPR0M3TH3AN 154fb8d9cd ⚡ Optimize Nostr snapshot retrieval with concurrent fetching
Refactored `_fetch_chunks_with_retry` in `src/nostr/client.py` to fetch snapshot chunks concurrently using `asyncio.gather`.
Introduced a `asyncio.Semaphore(10)` to limit concurrency and prevent overwhelming relays.
Extracted single chunk fetch logic into `_fetch_single_chunk` helper method.
Added `sys.path` fix to `src/tests/test_nostr_snapshot.py` to enable running tests.

Performance improvement: ~10x speedup for 10 chunks (1.0s -> 0.1s in local reproduction).

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 17:43:30 +00:00
google-labs-jules[bot]andPR0M3TH3AN 267ac5c3ca Refactor src/utils/file_lock.py to reduce duplication
Extracts common logic for path preparation and lock acquisition into a private helper function `_get_portalocker_lock`. This simplifies `exclusive_lock` and `shared_lock` implementations.

Also updates the docstring for `exclusive_lock` to correctly describe the file mode as "binary read/write mode" (r+b) instead of "binary append mode".

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 17:43:29 +00:00
google-labs-jules[bot]andPR0M3TH3AN fe6334523c Remove unused EventHandler class and its tests
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 17:43:16 +00:00
google-labs-jules[bot]andPR0M3TH3AN 379d4ee98d Refactor BIP85: Remove redundant elif block
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 17:40:47 +00:00
thePR0M3TH3AN c1cbab8c70 Merge pull request #871 from PR0M3TH3AN/perf/optimize-totp-loop-8292868580025877023
⚡ Optimize TOTP derivation in GUI loop
2026-02-16 12:38:04 -05:00
google-labs-jules[bot]andPR0M3TH3AN afa35a1782 Optimize TOTP derivation in GUI loop by caching secrets
- Add `get_totp_secret` to `EntryManager` and `EntryService` to allow retrieving the secret (derived or imported) without calculating the code.
- Update `TotpViewerWindow` in GUI to cache TOTP secrets locally. This prevents expensive PBKDF2/BIP39 derivation on every UI refresh (every second).
- Clean up unused imports and f-strings in `entry_management.py`.

Benchmarks show a ~9x speedup for 10 frames (50 entries) and >100x speedup for steady state.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 17:37:03 +00:00
thePR0M3TH3AN 46f753a11a Merge pull request #870 from PR0M3TH3AN/fix-key-derivation-salt-12798847451274058286
🔒 Fix Weak Key Derivation by Adding Salt
2026-02-16 12:24:12 -05:00
thePR0M3TH3AN 8adc1e7220 Merge pull request #869 from PR0M3TH3AN/improve-inmemory-secret-error-handling-18204251655789169400
Improve InMemorySecret wiped state error handling and testing
2026-02-16 12:23:12 -05:00
google-labs-jules[bot]andPR0M3TH3AN 75fe5bc382 Fix weak key derivation by adding salt to parent seed encryption
Introduced a random salt to key derivation for parent seed encryption to prevent rainbow table attacks. The salt is now stored in the `parent_seed.enc` file header (V3 format).

*   Modified `src/utils/key_derivation.py` to accept optional `salt` argument.
*   Modified `src/seedpass/core/encryption.py` to read/write salt in `parent_seed.enc` using V3 format (V3:salt:nonce:ciphertext).
*   Modified `src/seedpass/core/manager.py` to generate salt for new seeds and read salt for existing ones.
*   Added auto-upgrade logic for legacy (no salt) seeds upon access.
*   Updated tests to verify salt usage and backward compatibility.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 17:22:54 +00:00
google-labs-jules[bot]andPR0M3TH3AN d729466513 test(utils): Add test and error handling for wiped InMemorySecret
- Updated `InMemorySecret.get_bytes()` in `src/utils/memory_protection.py` to raise a `RuntimeError` if the secret has been wiped, replacing the previous `AttributeError`.
- Added `test_access_after_wipe_raises_error` to `src/tests/test_memory_protection.py` to verify this behavior.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 17:21:45 +00:00
thePR0M3TH3AN 21c25a0b63 Merge pull request #868 from PR0M3TH3AN/security-fix-path-traversal-17059275168502501133
🔒 Security Fix: Arbitrary File Read via Path Traversal in import_vault
2026-02-16 12:21:21 -05:00
thePR0M3TH3AN a442229629 Merge pull request #867 from PR0M3TH3AN/fix-path-traversal-backup-parent-seed-11848666276588647800
Fix arbitrary file write via path traversal in backup_parent_seed
2026-02-16 12:20:37 -05:00
google-labs-jules[bot]andPR0M3TH3AN 9c6b6d221c Fix Arbitrary File Read via Path Traversal in import_vault endpoint
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 17:20:28 +00:00
thePR0M3TH3AN 2a376ec91f update 2026-02-16 12:19:26 -05:00
google-labs-jules[bot]andPR0M3TH3AN 91f39007f0 Fix arbitrary file write via path traversal in backup_parent_seed
The `backup_parent_seed` API endpoint was vulnerable to arbitrary file write via path traversal.
The `path` parameter was used directly to create a `Path` object, which was then passed to `_pm.handle_backup_reveal_parent_seed`.
This allowed an attacker to specify an arbitrary path (e.g., `../../evil_file`), which would be used by `encrypt_and_save_file` to write the encrypted seed to that location.

This commit fixes the vulnerability by validating that the `path` parameter is a valid filename (i.e., does not contain path separators or parent directory references) before processing it. This ensures that the backup file is always created within the intended fingerprint directory.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 17:17:44 +00:00
google-labs-jules[bot]andPR0M3TH3AN e03385c569 Investigated TORCH system availability and provided answers.
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 17:04:00 +00:00
thePR0M3TH3AN 335de7abe3 Merge pull request #865 from PR0M3TH3AN/fix-sensitive-token-leak-stdout-13051886765392610577
🔒 Fix sensitive API token exposure in stdout
2026-02-16 11:48:09 -05:00
google-labs-jules[bot]andPR0M3TH3AN 99baf16b1b 🔒 Fix sensitive API token exposure in stdout
Removed the `print` statement in `src/seedpass/api.py` that leaked the
API token to stdout.

Enhanced the API server and CLI to support secure token management:
- Added `SEEDPASS_API_TOKEN` environment variable support in both
  `api.py` and `cli.py`.
- Added a `--token` option to the `api start` CLI command.
- Redirected the auto-generated token output to stderr instead of stdout.
- Updated `api stop` to respect the `SEEDPASS_API_TOKEN` environment
  variable.

These changes prevent the API token from being easily logged in insecure
environments where stdout is captured.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 16:47:51 +00:00
thePR0M3TH3AN d594d689d1 Merge pull request #864 from PR0M3TH3AN/remove-dead-code-imghdr-stub-1860538532359934490
🧹 [code health] Remove dead code from src/utils/imghdr_stub.py
2026-02-16 11:42:20 -05:00
google-labs-jules[bot]andPR0M3TH3AN cc42e7d6f0 chore: remove dead code from src/utils/imghdr_stub.py
Removed the `test()` and `testall()` functions and the `if __name__ == "__main__":` block which were used for manual testing and are not needed by the codebase.
This improves maintainability and readability by focusing the module on its core functionality.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 16:42:01 +00:00
thePR0M3TH3AN 8436311fa3 Merge pull request #863 from PR0M3TH3AN/agents/weekly/changelog-agent-2026-02-16-10358382466638125890
docs(ai): weekly changelog draft
2026-02-16 08:22:18 -05:00
thePR0M3TH3AN 61e7a9b045 Merge pull request #862 from PR0M3TH3AN/agents/daily/style-agent-16187229397196533781
style-agent: daily run
2026-02-16 08:21:39 -05:00
google-labs-jules[bot]andPR0M3TH3AN 9a2a8fd77d docs(ai): weekly changelog draft
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 12:56:27 +00:00