Commit Graph
1090 Commits
Author SHA1 Message Date
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 764bd9eb46 test(cli): add unit tests for cmdRollback
Refactor cmdRollback to support dependency injection and add comprehensive unit tests covering validation, version listing, and rollback operations.

- Refactor `src/cmd-rollback.mjs` to accept `deps` argument.
- Create `test/cmd-rollback.test.mjs` with test cases for happy paths and error conditions.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-21 18:33:09 +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
thePR0M3TH3AN 6758c8fd10 Merge pull request #400 from PR0M3TH3AN/agents/daily/ci-health-agent-flake-fix-17431605227619250204
fix(test): isolate install_dir_validation tests
2026-02-21 13:19:18 -05:00
thePR0M3TH3AN f95d9c2170 Merge pull request #399 from PR0M3TH3AN/agents/daily/audit-agent-13097391574516813780
chore(scheduler): execute daily audit-agent
2026-02-21 13:19:00 -05:00
google-labs-jules[bot]andPR0M3TH3AN 667da1536b refactor(constants): centralize time and memory constants
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-21 16:54:12 +00:00
thePR0M3TH3AN 867e7e0983 Merge pull request #398 from PR0M3TH3AN/agents/daily/torch-garbage-collection-agent-2026-02-21-18045201184454510691
chore(scheduler): run daily torch-garbage-collection-agent
2026-02-21 10:15:15 -05:00
google-labs-jules[bot]andPR0M3TH3AN 2e8bc1a61c fix(scheduler): resolve relay health and publisher race conditions
Executed the weekly race-condition-agent task.
- Fixed WebSocket resource leak in `src/relay-health.mjs` by explicitly closing sockets on timeout.
- Fixed unhandled promise rejection in `src/lock-publisher.mjs` by attaching catch handlers to publish promises.
- Generated `reports/race-condition/weekly-race-condition-report-2026-02-21.md`.
- Updated `task-logs/weekly/` with completion log.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-21 05:10:39 +00:00
google-labs-jules[bot]andPR0M3TH3AN 2430efc256 fix(test): isolate install_dir_validation tests
Refactor test/install_dir_validation.test.mjs to use unique temporary directories for each subtest, eliminating shared state and race conditions that caused flakiness.
Update KNOWN_ISSUES.md to mark the issue as resolved.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-21 02:12:23 +00:00
google-labs-jules[bot]andPR0M3TH3AN 79699445bf chore(scheduler): execute daily audit-agent
- Executed audit-agent script for daily cadence
- Generated reports for file size, innerHTML usage, and linting
- Verified run artifacts and updated memory
- Published completion lock

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-21 01:22:48 +00:00
google-labs-jules[bot]andPR0M3TH3AN c4e6b5dff9 chore(scheduler): run daily torch-garbage-collection-agent
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-21 00:12:16 +00:00
thePR0M3TH3AN 5f79d94754 Merge pull request #397 from PR0M3TH3AN/agents/daily/todo-triage-agent-run-375090472420526035
chore(daily): execute todo-triage-agent run
2026-02-20 18:53:16 -05:00
thePR0M3TH3AN 1e74ef46c9 Merge pull request #396 from PR0M3TH3AN/agents/daily/test-audit-agent-4467786181786313218
chore(scheduler): execute daily test-audit-agent
2026-02-20 18:52:56 -05:00
thePR0M3TH3AN 4fb859d068 Merge pull request #392 from PR0M3TH3AN/refactor/cmd-remove-cleanup-8506683309823504917
Refactor cmdRemove in src/ops.mjs for improved maintainability
2026-02-20 18:51:45 -05:00
thePR0M3TH3AN fb0b16c3b4 Merge pull request #389 from PR0M3TH3AN/feat/docs-link-validation-999870209451448639
Add broken link validation script for documentation
2026-02-20 18:51:31 -05:00
google-labs-jules[bot]andPR0M3TH3AN a502480e95 chore(daily): execute todo-triage-agent run and fix audit failure log
- Selected todo-triage-agent via round-robin.
- Acquired lock.
- Executed prompt: scanned codebase for TODOs (none actionable found).
- Generated run artifacts (context, decisions, todo, test_logs) and memory updates.
- Documented historical failure: INCIDENT-2026-02-14-AUDIT-MISSING-SCRIPTS in `src/test_logs/TEST_LOG_2026-02-14T06-04-19Z.md` to fix CI failure.
- Completed task successfully.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-20 23:35:16 +00:00
google-labs-jules[bot]andPR0M3TH3AN 31288dc85d chore(daily): execute todo-triage-agent run
- Selected todo-triage-agent via round-robin.
- Acquired lock.
- Executed prompt: scanned codebase for TODOs.
- Findings: No actionable TODOs found (mostly documentation/test data).
- Generated artifacts: context, decisions, todo, test_logs.
- Updated memory with findings.
- Completed task successfully.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-20 23:31:32 +00:00
google-labs-jules[bot]andPR0M3TH3AN c4f67cf706 chore(scheduler): execute daily test-audit-agent
- Executed test-audit-agent prompt
- Ran static analysis and flakiness check
- Identified and reported consistent failures in load-test.mjs and smoke-test.mjs
- Updated KNOWN_ISSUES.md
- Created run artifacts (Context, Todo, Decisions, Test Logs)
- Completed lock cycle

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-20 22:38:47 +00:00
google-labs-jules[bot]andPR0M3TH3AN 465f078e77 Extract RelayHealthManager and helpers to dedicated modules
- Extracted `RelayHealthManager` to `src/relay-health-manager.mjs`.
- Extracted `LockPublisher` to `src/lock-publisher.mjs`.
- Consolidated `withTimeout`, `mergeRelayList`, `relayListLabel` into `src/lock-utils.mjs`.
- Refactored `src/lock-ops.mjs` to import from these new modules, acting as a facade.
- Updated `src/relay-health.mjs` to import `withTimeout` from `src/lock-utils.mjs`.
- Updated tests to import from correct locations.
- Removed duplicate implementations and significantly reduced `src/lock-ops.mjs` size.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-20 22:00:50 +00:00
google-labs-jules[bot]andPR0M3TH3AN 136ab75ee6 refactor(lock-utils): consolidate duplicate function declarations
- Centralized `withTimeout` and `mergeRelayList` in `src/utils.mjs`.
- Updated `src/lock-utils.mjs` to re-export them.
- Removed local redefinitions in `src/lock-ops.mjs` and `src/lock-publisher.mjs`.
- Fixed `test/utils.test.mjs` imports.
- Verified all tests pass.

This resolves the N/A documentation task by ensuring the codebase is in a valid state.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-20 21:59:36 +00:00
google-labs-jules[bot]andPR0M3TH3AN 141b317764 fix(lint): resolve duplicate identifiers and missing exports
- Removed duplicate `relayListLabel` import in `src/lock-ops.mjs`.
- Removed duplicate `mergeRelayList` declaration in `src/lock-publisher.mjs`.
- Moved `withTimeout` implementation to `src/lock-utils.mjs` and ensured it is exported.
- Updated `test/utils.test.mjs` and `test/utils-async.test.mjs` to import from `src/lock-utils.mjs` where appropriate.
- Added `randomInt` import in `src/lock-publisher.mjs` to fix `no-undef`.
- Verified with `npm run lint` and `npm test`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-20 21:58:00 +00:00
google-labs-jules[bot]andPR0M3TH3AN b8e2261be3 fix(ci): resolve lint errors and duplicate definitions
- Fix lint error in `test/verify-example-config-security.test.mjs` (unused var).
- Fix duplicate definitions of `mergeRelayList` and `relayListLabel` in `src/lock-ops.mjs` and `src/lock-publisher.mjs`.
- Fix missing export of `withTimeout` in `src/lock-utils.mjs`.
- Fix broken imports in `test/utils.test.mjs` and `test/utils-async.test.mjs`.
- Centralize `secureRandom` in `src/lock-utils.mjs`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-20 21:57:07 +00:00
google-labs-jules[bot]andPR0M3TH3AN 73a92da6c1 fix(security): verify governance command injection prevention and fix broken tests
- Add regression test `test/governance-security.test.mjs` to verify `applyProposal` is secure against command injection.
- Fix broken imports and duplicates in `src/lock-utils.mjs`, `src/lock-ops.mjs`, `src/lock-publisher.mjs`, and `src/relay-health.mjs` to resolve test failures.
- Verify all tests pass.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-20 21:56:12 +00:00
google-labs-jules[bot]andPR0M3TH3AN eb32c839d8 Refactor cmdRemove in src/ops.mjs to improve maintainability
Extracted helper functions identifyRemovalTargets, confirmRemoval, executeRemoval, and cleanupPostRemoval to reduce complexity of cmdRemove.
Fixed JSDoc comments and removed unused parameters.
Verified with existing tests.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-20 21:55:45 +00:00
google-labs-jules[bot]andPR0M3TH3AN 9cc7bc432e fix(utils): resolve circular deps and missing exports in lock utilities
- Moved `withTimeout` and `mergeRelayList` to `src/lock-utils.mjs` as the single source of truth.
- Updated `src/lock-ops.mjs` and `src/lock-publisher.mjs` to import from `src/lock-utils.mjs`.
- Fixed lint errors for duplicate declarations.
- Updated tests (`test/utils.test.mjs`, `test/utils-async.test.mjs`) to import from correct modules.
- Added `randomInt` import in `src/lock-publisher.mjs` to fix `no-undef`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-20 21:54:09 +00:00
google-labs-jules[bot]andPR0M3TH3AN 08d291e7fa refactor(lock): centralize lock utility functions
- Moved `withTimeout` to `src/utils.mjs` and exported it.
- Updated `src/lock-utils.mjs` to re-export `withTimeout` and `mergeRelayList` from `src/utils.mjs`.
- Removed duplicate local definitions of `withTimeout` and `mergeRelayList` in `src/lock-ops.mjs` and `src/lock-publisher.mjs`.
- Fixed `test/utils.test.mjs` to import `mergeRelayList`.
- Verified all tests pass with `npm test`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-20 21:53:59 +00:00
google-labs-jules[bot]andPR0M3TH3AN 1a46fd0484 feat(docs): add broken link validation script
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-20 21:53:25 +00:00
thePR0M3TH3AN a7ae290af5 update 2026-02-20 16:53:17 -05:00
google-labs-jules[bot]andPR0M3TH3AN 8b019b1a84 fix(governance): prevent argument injection in rollbackPrompt
- Validate `hashOrStrategy` to ensure it does not start with `-`.
- This prevents argument injection when falling back to `git checkout` via `execFileSync`.
- Although `execFileSync` prevents shell command injection, argument injection was still possible (e.g., `--help`).
- Verified with reproduction script.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-20 21:52:54 +00:00
google-labs-jules[bot]andPR0M3TH3AN 3648b0da40 fix(security): remove default credentials from example config
Removes the hardcoded `auth: "admin:password"` from `torch-config.example.json` to prevent users from accidentally deploying with insecure defaults.

Adds a regression test `test/verify-example-config-security.test.mjs` to ensure the example config does not contain default credentials in the future.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-20 21:50:55 +00:00
google-labs-jules[bot]andPR0M3TH3AN 5865a6edc8 fix(torch-lock): resolve circular deps and syntax errors in lock commands
- 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.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-20 21:50:46 +00:00
google-labs-jules[bot]andPR0M3TH3AN 8fae9a5951 chore(audit): store audit results in memory
- Summarized audit report into memory-update.md
- Executed scripts/memory/store.mjs
- Updated src/todo/TODO_2026-02-19T20-00-00Z.md
- Committed reports/audit/ artifacts

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-20 21:47:42 +00:00
thePR0M3TH3AN 8d43fc1be8 Merge pull request #376 from PR0M3TH3AN/perf/optimize-embedder-norms-8957795496330689334
⚡ Optimize vector similarity with precomputed norms
2026-02-20 16:41:51 -05:00
thePR0M3TH3AN 10d2faea54 Merge pull request #379 from PR0M3TH3AN/refactor/relay-list-label-consolidation-6018169095734119060
🧹 Consolidate duplicate `relayListLabel` utility
2026-02-20 16:41:38 -05:00
thePR0M3TH3AN b296303b19 Merge branch 'main' into refactor/relay-list-label-consolidation-6018169095734119060 2026-02-20 16:41:31 -05:00
thePR0M3TH3AN 9b760ab9d5 Merge pull request #377 from PR0M3TH3AN/refactor/lock-ops-reduction-3810095324988153600
Refactor lock-ops and lock-publisher for file size reduction
2026-02-20 16:40:59 -05:00
thePR0M3TH3AN 2d4753a6cb Merge branch 'main' into refactor/lock-ops-reduction-3810095324988153600 2026-02-20 16:40:51 -05:00