Commit Graph
918 Commits
Author SHA1 Message Date
thePR0M3TH3AN 047a1fd2f8 Merge branch 'main' into fix-torch-lock-commands-3759471574036935483 2026-02-21 14:25:30 -05:00
google-labs-jules[bot]andPR0M3TH3AN c0c5ac5473 fix(torch-lock): re-apply fixes for circular deps and syntax errors
- Moved `withTimeout` implementation to `src/lock-utils.mjs` and exported it correctly.
- Removed duplicate local definitions of `withTimeout`, `mergeRelayList`, and `secureRandom` in `src/lock-ops.mjs` and `src/lock-publisher.mjs`.
- Fixed imports in `src/lock-ops.mjs`, `src/lock-publisher.mjs`, and `src/relay-health.mjs` to use `src/lock-utils.mjs` consistently.
- Updated `test/utils.test.mjs` and `test/utils-async.test.mjs` to fix broken imports and test definitions.
- Verified `npm run lock:complete` and `npm run scheduler:daily` execute correctly.
- Updated `src/todo/TODO_2026-02-20T03-00-00Z.md` to mark verification task as completed.
- Verified `src/relay-health.mjs` does not use `MINUTE_MS` locally, despite mysterious CI error. Confirmed imports are correct.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-21 19:23:48 +00:00
thePR0M3TH3AN 87facb415a Merge pull request #387 from PR0M3TH3AN/fix/security-remove-default-creds-12747623644908748667
🔒 Fix: Remove default credentials from example config
2026-02-21 14:17:57 -05:00
thePR0M3TH3AN 45a666a7ed Merge branch 'main' into fix/security-remove-default-creds-12747623644908748667 2026-02-21 14:17:49 -05:00
thePR0M3TH3AN fb672d380f Merge branch 'main' into fix-torch-lock-commands-3759471574036935483 2026-02-21 14:16:25 -05:00
thePR0M3TH3AN 7b375da1cb Merge pull request #385 from PR0M3TH3AN/chore/audit-memory-store-17064585358903407526
chore(audit): store audit results in memory
2026-02-21 14:15:47 -05:00
thePR0M3TH3AN 3f03cfd690 Merge branch 'main' into chore/audit-memory-store-17064585358903407526 2026-02-21 14:15:40 -05:00
thePR0M3TH3AN 933bbad941 Merge pull request #369 from PR0M3TH3AN/test-lock-utils-helpers-17746102477708828726
🧪 Add tests for lock-utils helpers
2026-02-21 14:15:21 -05:00
thePR0M3TH3AN cff50e54a4 Merge pull request #407 from PR0M3TH3AN/refactor-lock-ops-modules-18356835837586404683
Refactor lock-ops to use new modules
2026-02-21 14:13:48 -05:00
thePR0M3TH3AN bdda09c7b2 Merge pull request #406 from PR0M3TH3AN/test/upload-validation-15691315589845316357
Verify absence of upload endpoints via test
2026-02-21 14:13:22 -05:00
thePR0M3TH3AN 67ebd6a504 Merge branch 'main' into test/upload-validation-15691315589845316357 2026-02-21 14:13:15 -05:00
thePR0M3TH3AN fd634b0319 Merge pull request #404 from PR0M3TH3AN/fix-dashboard-auth-plaintext-8015911861283425351
🔒 Fix Plaintext Password Storage in Dashboard Auth
2026-02-21 14:13:02 -05:00
thePR0M3TH3AN 74c08c721a Merge pull request #415 from PR0M3TH3AN/security/dashboard-rate-limit-6123396415409218177
feat(dashboard): implement rate limiting for basic auth
2026-02-21 14:12:56 -05:00
thePR0M3TH3AN 243291ba93 Merge pull request #405 from PR0M3TH3AN/docs/remove-hallucinated-upload-audit-workflow-10015363657697346579
Remove hallucinated upload audit workflow from perf-agent
2026-02-21 14:12:50 -05:00
thePR0M3TH3AN 54e9e35e83 Merge pull request #418 from PR0M3TH3AN/refactor/memory-coalescing-worker-7175585698335360965
Refactor memory store save logic to use CoalescingWorker
2026-02-21 14:11:54 -05:00
thePR0M3TH3AN 77c8b88ae6 Merge pull request #416 from PR0M3TH3AN/perf-optimize-memory-cache-expiration-16783439769219340578
⚡ Optimize memory cache expiration strategy
2026-02-21 14:11:48 -05:00
thePR0M3TH3AN 873e649b2f Merge pull request #414 from PR0M3TH3AN/perf/async-roster-loading-4439301282033623986
⚡ Optimize Roster Loading to Async
2026-02-21 14:11:40 -05:00
thePR0M3TH3AN ac1a336356 Merge pull request #408 from PR0M3TH3AN/refactor-lock-publisher-10794332597523183742
🧹 Refactor LockPublisher.publish for clarity
2026-02-21 14:11:08 -05:00
thePR0M3TH3AN 003d6d77e1 Merge pull request #410 from PR0M3TH3AN/refactor/cmd-lock-cleanup-4510057441025896900
Refactor cmdLock to improve code health and modularity
2026-02-21 14:11:02 -05:00
thePR0M3TH3AN e242860fd6 Merge pull request #413 from PR0M3TH3AN/jules/test-cmd-backup-16743310224352411678
Add tests for cmdBackup
2026-02-21 14:09:25 -05:00
thePR0M3TH3AN 121b684e67 Merge pull request #417 from PR0M3TH3AN/refactor/memory-cache-invalidation-5975056545656617658
🧹 Granular memory cache invalidation
2026-02-21 14:09:14 -05:00
thePR0M3TH3AN 04f6a5db31 Merge pull request #419 from PR0M3TH3AN/add-cmd-proposal-tests-8161916931821665354
🧪 Add tests for cmdProposal
2026-02-21 14:09:01 -05:00
thePR0M3TH3AN 28eb75392f Merge pull request #420 from PR0M3TH3AN/agents/daily/content-audit-agent-2026-02-21-7949657867376003219
Content Audit: Update CLI Help Text
2026-02-21 14:08:49 -05:00
thePR0M3TH3AN 348584bcfd Merge pull request #411 from PR0M3TH3AN/fix/ajv-vulnerability-investigation-1402978429090949813
docs(todo): mark security investigations as complete
2026-02-21 14:08:25 -05:00
thePR0M3TH3AN 177b3490a6 Merge pull request #412 from PR0M3TH3AN/extract-lock-publisher-7118928735632343648
Extract LockPublisher and helpers to src/lock-publisher.mjs
2026-02-21 14:08:11 -05:00
thePR0M3TH3AN c7722e4c49 Merge pull request #403 from PR0M3TH3AN/fix/eslint-minimatch-vulnerability-7654847843713233456
chore: upgrade eslint to resolve minimatch and ajv vulnerabilities
2026-02-21 14:07:56 -05:00
google-labs-jules[bot]andPR0M3TH3AN 7f5d8fdc7f Content Audit: Update CLI Help Text
- Updated src/constants.mjs USAGE_TEXT to include missing commands (backup, proposal, rollback) documented in README.md.
- Validated docs links and implementation consistency.
- Added run artifacts and memory update.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-21 18:51:03 +00:00
google-labs-jules[bot]andPR0M3TH3AN e8702b4520 Remove unused import PUBLISH_ERROR_CODES from lock-publisher.mjs
- Removes `PUBLISH_ERROR_CODES` from `src/lock-publisher.mjs` imports as it was unused and caused a lint failure in CI.
- Verified with `npm run lint` and relevant tests.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-21 18:39:40 +00:00
google-labs-jules[bot]andPR0M3TH3AN 1cd03f3d90 test(cmd-backup): fix unused variable in test
- Remove unused `manifest` variable from destructuring in `test/cmd-backup.test.mjs` to resolve ESLint error.
- Verified fix with `npm run lint`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-21 18:38:54 +00:00
google-labs-jules[bot]andPR0M3TH3AN da8e816273 fix(test): replace non-standard assert.notMatch with assert.doesNotMatch
- Fixes CI failure in `test/install_dir_validation.test.mjs` where `assert.notMatch` was undefined.
- `assert.doesNotMatch` is the standard Node.js assertion method for negative regex matching.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-21 18:38:51 +00:00
google-labs-jules[bot]andPR0M3TH3AN 0f6bc97a30 fix(lock): remove unused _getTtl import in src/lib.mjs
- Removed unused `getTtl` import from `src/torch-config.mjs` in `src/lib.mjs` to fix CI lint failure.
- Verified with `npm run lint` and `npm test test/lib.test.mjs`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-21 18:38:50 +00:00
google-labs-jules[bot]andPR0M3TH3AN 940bc9ca66 test: add unit tests for cmdProposal
Refactor `src/cmd-proposal.mjs` to use dependency injection for testability.
Add `test/cmd-proposal.test.mjs` to verify all subcommands (`create`, `list`, `apply`, `reject`, `show`) and error handling.
Fix indentation in `src/cmd-proposal.mjs`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-21 18:36:35 +00:00
google-labs-jules[bot]andPR0M3TH3AN 840a79b885 Refactor memory store save logic to use CoalescingWorker
- Replaced manual promise management in `src/services/memory/index.js` with a `CoalescingWorker` class.
- Extracted `performSave` logic into `performSave` function used by the worker (worker function).
- Ensures concurrent calls to `saveMemoryStore` are coalesced into a single pending operation, maintaining data integrity and performance.
- Removed global state variables for promise management.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-21 18:36:04 +00:00
google-labs-jules[bot]andPR0M3TH3AN 60d213dec7 refactor(memory): implement granular cache invalidation for agents
Replaces aggressive `cache.clear()` with per-agent invalidation in `src/services/memory/index.js` to improve performance.
- Adds `prune(predicate)` to `createMemoryCache`.
- Updates `ingestEvents`, `runPruneCycle`, `pinMemory`, `unpinMemory`, and `markMemoryMerged` to invalidate only the affected agent's cache entries.
- Adds unit test for `prune` in `test/memory-cache.test.mjs`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-21 18:35:39 +00:00
google-labs-jules[bot]andPR0M3TH3AN 9b2fa81468 perf: Optimize memory cache expiration strategy
Replaces the unconditional global expiration scan in `setRuntimeEvent` with a scoped expiration check, significantly reducing overhead for cache writes. Global expiration is now only triggered when the cache reaches its capacity limit.

This change improves `setRuntimeEvent` performance by ~3.5x in benchmarks with 5000 active events.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-21 18:35:16 +00:00
google-labs-jules[bot]andPR0M3TH3AN f719f6bf97 feat(dashboard): implement rate limiting for basic auth
- Add rate limiting to prevent brute force attacks on dashboard authentication
- Block IPs for 5 minutes after 5 failed attempts
- Return 429 Too Many Requests when blocked
- Clean up state periodically to prevent memory leaks

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-21 18:35:13 +00:00
google-labs-jules[bot]andPR0M3TH3AN 96f1e628b5 perf: make roster loading async and non-blocking
- Convert `loadCanonicalRoster` to async using `fs.promises.readFile`
- Remove redundant `fs.existsSync` checks in favor of `ENOENT` handling
- Update `getRoster` to await the roster loading
- Update `test/roster.test.mjs` to mock async filesystem operations
- Verified performance: ~0.91ms/op (non-blocking) vs ~0.28ms/op (blocking)

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-21 18:34:44 +00:00
google-labs-jules[bot]andPR0M3TH3AN 7e08a432cc test(cmd-backup): add integration tests for backup functionality
- Refactor `cmdBackup` and `listBackups` in `src/cmd-backup.mjs` to accept `cwd` parameter for dependency injection.
- Add `test/cmd-backup.test.mjs` to test backup creation, missing files handling, output override, and listing functionality.
- Ensure tests run in isolated temporary directories using `fs.mkdtemp`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-21 18:34:32 +00:00
google-labs-jules[bot]andPR0M3TH3AN 481d77f33c Refactor lock publisher to use shared error classifier and utils
- Extracted `LockPublisher` and `publishLock` to `src/lock-publisher.mjs` (already existed, but cleaned up).
- Refactored `src/lock-publisher.mjs` to import error constants and classification logic from `src/lock-error-classifier.mjs` instead of duplicating them.
- Refactored `src/lock-publisher.mjs` and `src/lock-utils.mjs` to use `mergeRelayList` from `src/utils.mjs`.
- Consolidated and moved publisher tests from `test/lock-ops.test.mjs` and `test/lock-ops-publish-retry.test.mjs` to `test/lock-publisher.test.mjs`.
- Cleaned up `src/lock-utils.mjs` to remove duplicate `mergeRelayList`.
- Verified changes with tests.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-21 18:34:18 +00:00
google-labs-jules[bot]andPR0M3TH3AN 284a9fd92e docs(todo): mark security investigations as complete
Verified that ajv (6.14.0) and minimatch (10.2.2) are at secure versions in the repository.
Ran npm audit to confirm 0 vulnerabilities.
Marked investigation tasks as completed in src/todo/TODO_2026-02-20T01-13-24Z.md.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-21 18:34:11 +00:00
google-labs-jules[bot]andPR0M3TH3AN 002a1549ba refactor(lock): extract cmdLock to src/cmd-lock.mjs and decompose into helpers
- Extracted `cmdLock` from `src/lib.mjs` to `src/cmd-lock.mjs`.
- Decomposed complex logic into semantic helper functions (`validateRoster`, `performRaceCheck`, etc.).
- Maintained exact functionality and dependency injection pattern.
- Updated `src/lib.mjs` to re-export `cmdLock` for backward compatibility.
- Verified with unit and integration tests.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-21 18:33:44 +00:00
google-labs-jules[bot]andPR0M3TH3AN 99bf7fa452 fix(test): replace undefined assert.notMatch with assert.doesNotMatch
`assert.notMatch` is not a valid function in Node.js `node:assert` module. The correct function is `assert.doesNotMatch`. This caused `test/install_dir_validation.test.mjs` to fail.

This commit replaces the incorrect usage to fix the test failure.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-21 18:33:05 +00:00
google-labs-jules[bot]andPR0M3TH3AN ab500a84af refactor(lock-publisher): extract retry loop and initialization logic
Refactors `LockPublisher.publish` to reduce complexity and improve readability.
- Extracts initialization logic into `_initialize()`.
- Extracts the retry loop into `_executeRetryLoop()`.
- Adds `_shouldRetry()` helper for clarity.
- Preserves existing behavior and tests.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-21 18:32:33 +00:00
google-labs-jules[bot]andPR0M3TH3AN a6bc009719 Refactor src/lock-ops.mjs to use dedicated modules
This change confirms the decomposition of `src/lock-ops.mjs` into `src/relay-health-manager.mjs` and `src/lock-publisher.mjs`.

- `RelayHealthManager` is now imported from `src/relay-health-manager.mjs`.
- `LockPublisher` is now imported from `src/lock-publisher.mjs`.
- `src/lock-ops.mjs` acts as an entry point re-exporting these classes.
- Tests in `test/lock-ops.test.mjs` pass.
- The TODO file `src/todo/TODO_2026-02-20T02-28-25Z.md` is deleted as all tasks are completed.
- A comment was added to `src/lock-ops.mjs` to document the refactoring.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-21 18:31:48 +00:00
google-labs-jules[bot]andPR0M3TH3AN 38456780d9 test: add dashboard upload security verification
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-21 18:31:33 +00:00
google-labs-jules[bot]andPR0M3TH3AN 41a94b2716 docs(prompts): remove hallucinated upload audit workflow from perf-agent
The `perf-agent` prompt contained detailed instructions to audit `/content` upload documentation and features. Since no such features or documentation exist in the repository (as confirmed by `content-audit-agent`), these instructions were causing confusion and wasted effort.

This change removes:
- The "Docs audit" sub-workflow and its associated steps.
- References to `/content` and upload/contribution docs in the Mission, Focus, and Goals.
- The "docs: `/content` upload alignment" PR template.

This aligns the agent's instructions with the actual codebase capabilities.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-21 18:31:03 +00:00
google-labs-jules[bot]andPR0M3TH3AN 32ddd3fd7a fix(dashboard): secure dashboard authentication with scrypt hashing
- Implemented `verifyPassword` helper in `src/dashboard.mjs` to support hashed passwords.
- Added support for `scrypt:<salt>:<hash>` format for storing credentials.
- Maintained backward compatibility for plaintext passwords using `timingSafeCompare`.
- Updated `cmdDashboard` to use the new verification logic.
- Added comprehensive tests in `test/dashboard-auth.test.mjs` for hashed credential validation.

This change eliminates the need to store plaintext passwords in `torch-config.json` or environment variables, addressing a security vulnerability.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-21 18:31:02 +00:00
google-labs-jules[bot]andPR0M3TH3AN 0edebc9c6c chore: upgrade eslint to resolve minimatch and ajv vulnerabilities
Upgraded `eslint` to `^10.0.1` which updated `minimatch` to `10.2.2` (resolving ReDoS vulnerability).
Ran `npm audit fix` which updated `ajv` to `6.14.0` (resolving ReDoS vulnerability).
Verified with `npm test` and `npm run lint`.
Marked tasks as completed in `src/todo/TODO_2026-02-20T01-13-24Z.md`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-21 18:30:40 +00:00
thePR0M3TH3AN 79e261d7b2 Merge pull request #402 from PR0M3TH3AN/agents/daily/const-refactor-13160759941082166389
refactor(constants): centralize time and memory constants
2026-02-21 13:21:47 -05:00
thePR0M3TH3AN fbd42889a4 Merge pull request #401 from PR0M3TH3AN/agents/weekly/race-condition-2026-02-21-5109170834766607482
fix(scheduler): resolve relay health and publisher race conditions
2026-02-21 13:19:39 -05:00