Commit Graph
619 Commits
Author SHA1 Message Date
thePR0M3TH3AN 0dfbf3f86f Merge branch 'main' into perf/async-memory-save-18240015948353785856 2026-02-18 09:48:42 -05:00
thePR0M3TH3AN 10ca8a34da Merge pull request #277 from PR0M3TH3AN/dashboard-security-headers-10540095592303062285
Add HTTP Security Headers to Dashboard
2026-02-18 09:47:54 -05:00
thePR0M3TH3AN 845333e980 Merge branch 'main' into dashboard-security-headers-10540095592303062285 2026-02-18 09:47:42 -05:00
thePR0M3TH3AN 30212a6213 Merge pull request #275 from PR0M3TH3AN/fix-install-dir-command-injection-4005485668731201594
🔒 Fix command injection via install directory name
2026-02-18 09:47:23 -05:00
thePR0M3TH3AN f9a05c25b5 Merge pull request #272 from PR0M3TH3AN/jules-tests-utils-9764403852439497661
Add tests for date/time helper functions in utils.mjs
2026-02-18 09:47:07 -05:00
thePR0M3TH3AN 76c1513cfd Merge branch 'main' into jules-tests-utils-9764403852439497661 2026-02-18 09:46:52 -05:00
thePR0M3TH3AN 0c4650e92a Merge pull request #271 from PR0M3TH3AN/jules-3313039613758629393-8f27954c
Enhance test coverage for relay alert thresholds
2026-02-18 09:46:23 -05:00
thePR0M3TH3AN a763b135a3 Merge pull request #270 from PR0M3TH3AN/chore/remove-dead-code-cmd-check-6250725036284174249
🧹 Remove dead code: src/cmd-check.mjs
2026-02-18 09:46:06 -05:00
thePR0M3TH3AN f5dee21b74 Merge branch 'main' into chore/remove-dead-code-cmd-check-6250725036284174249 2026-02-18 09:45:58 -05:00
thePR0M3TH3AN b62549bc33 Merge pull request #269 from PR0M3TH3AN/agents/daily/design-system-audit-agent-14566851065509091876
chore(scheduler): run daily design-system-audit-agent
2026-02-18 09:44:55 -05:00
thePR0M3TH3AN ccc4c33307 Merge branch 'main' into agents/daily/design-system-audit-agent-14566851065509091876 2026-02-18 09:44:48 -05:00
thePR0M3TH3AN e4e8c265fe Merge pull request #243 from PR0M3TH3AN/jules/testing-relay-health-12520607155456440581
test: add unit tests for relay-health summarizeHistory
2026-02-18 09:44:22 -05:00
thePR0M3TH3AN a231ea0784 Merge branch 'main' into jules/testing-relay-health-12520607155456440581 2026-02-18 09:44:14 -05:00
thePR0M3TH3AN 92cf4d5e53 Merge pull request #220 from PR0M3TH3AN/agents/daily/todo-triage-agent-3669620007397262659
feat(scheduler): execute todo-triage-agent daily run
2026-02-18 09:43:54 -05:00
thePR0M3TH3AN 30753d97be Merge branch 'main' into agents/daily/todo-triage-agent-3669620007397262659 2026-02-18 09:43:41 -05:00
thePR0M3TH3AN b6775cda28 Merge pull request #289 from PR0M3TH3AN/optimize-relay-ranking-1239301882622685923
⚡ Optimize relay ranking with caching
2026-02-17 22:45:08 -05:00
thePR0M3TH3AN ae45ddd20c Merge pull request #280 from PR0M3TH3AN/refactor/extract-lock-ops-error-constants-665695259531782224
🧹 Extract hardcoded error classification strings in lock-ops.mjs
2026-02-17 22:44:53 -05:00
thePR0M3TH3AN 34c20fadd8 Merge pull request #285 from PR0M3TH3AN/fix-dashboard-path-traversal-vulnerability-5749294800748882365
Fix path traversal vulnerability in dashboard.mjs
2026-02-17 22:43:20 -05:00
thePR0M3TH3AN ae85044021 Merge pull request #281 from PR0M3TH3AN/perf/optimize-pruner-lifecycle-3710831960416065931
⚡ Optimize createLifecyclePlan with Promise.all
2026-02-17 22:42:24 -05:00
thePR0M3TH3AN fabe54ca50 Merge pull request #286 from PR0M3TH3AN/perf-optimize-text-match-similarity-10778846404637796189
⚡ Optimize memory text similarity check
2026-02-17 22:42:05 -05:00
thePR0M3TH3AN 11c7510b95 Merge pull request #287 from PR0M3TH3AN/perf/optimize-pruner-lifecycle-15735036455677538666
⚡ Parallelize memory lifecycle actions in pruner
2026-02-17 22:41:48 -05:00
thePR0M3TH3AN 84e1da5825 Merge pull request #279 from PR0M3TH3AN/perf-pruner-optimization-6586476437632671797
⚡ Optimize memory pruner groupNearDuplicates
2026-02-17 22:41:07 -05:00
thePR0M3TH3AN 5cb3e32b8a Merge pull request #273 from PR0M3TH3AN/remove-dead-code-cmd-lock-18301432139913694771
🧹 Remove dead code src/cmd-lock.mjs
2026-02-17 22:40:51 -05:00
thePR0M3TH3AN 0d7f5a250c Merge pull request #278 from PR0M3TH3AN/fix-dashboard-config-exposure-6646545441224592886
fix(dashboard): prevent information disclosure via /torch-config.json
2026-02-17 22:40:08 -05:00
thePR0M3TH3AN ea127b9b2d Merge pull request #274 from PR0M3TH3AN/code-health-ensure-dir-13440231316649260412
Refactor: Centralize `ensureDir` utility
2026-02-17 22:39:11 -05:00
thePR0M3TH3AN 5007dbd9fe Merge pull request #276 from PR0M3TH3AN/test-roster-loading-logic-11897552742199720242
Add unit tests for roster loading logic
2026-02-17 22:38:18 -05:00
google-labs-jules[bot]andPR0M3TH3AN c123dd9a77 perf: make saveMemoryStore async and non-blocking
Optimizes `saveMemoryStore` in `src/services/memory/index.js` to use `fs.promises.writeFile` instead of synchronous `fs.writeFileSync`.
Implements a coalescing mechanism to handle concurrent save requests efficiently, preventing race conditions and reducing I/O operations by batching pending updates into a single write.
Reduces event loop blocking from ~420ms (sync) to ~3ms (async) for large write operations in benchmarks.
Updates all `memoryRepository` methods to await the async save operation.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-18 03:37:12 +00:00
google-labs-jules[bot]andPR0M3TH3AN a9f30f13f9 feat(perf): cache relay ranking in RelayHealthManager
- Implement caching for `rankRelays` to avoid redundant sorting and computations.
- Cache is invalidated on new outcomes or when quarantine status changes.
- Add `_metricsVersion` to track metrics updates.
- Benchmarks show ~3x performance improvement (0.06ms -> 0.02ms per call for 100 relays).
- Add unit tests for caching behavior and invalidation.
- Add `perf/benchmark-lock-ops.mjs`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-18 03:33:59 +00:00
google-labs-jules[bot]andPR0M3TH3AN 0f29e9126e perf: parallelize applyLifecycleActions for faster pruning
- Use Promise.all to execute memory lifecycle actions concurrently.
- Maintain intra-item dependency order (merged_into before action).
- Update tests to support non-deterministic execution order of independent items.
- Benchmark shows ~65x improvement for 100 items with 10ms latency.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-18 03:32:03 +00:00
google-labs-jules[bot]andPR0M3TH3AN 850be9c37d perf: Optimize textMatchSimilarity in memory retriever
Avoids redundant string concatenation and lowercasing in the inner loop of `buildSimilarityIndex`.
Pre-computes query terms and regexes once per query.
Uses RegExp.test for case-insensitive matching without allocation.
Benchmark shows ~2x speedup (99ms vs 191ms for 10k memories).

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-18 03:31:22 +00:00
google-labs-jules[bot]andPR0M3TH3AN 5fe9e8a1f9 Fix: Strengthen path traversal protection in dashboard.mjs
- Replaced brittle regex-based sanitization with `path.resolve` relative to `packageRoot`.
- Added `test/dashboard-path-traversal-fix.test.mjs` to verify robust protection against traversal attacks.
- Verified that legitimate access to allowed paths is maintained.
- Verified that access to restricted files (like package.json) is blocked.
- Updated path handling to correctly handle absolute paths and URL-encoded characters.

This change addresses a potential security vulnerability where the previous sanitization logic could be bypassed in certain environments or with specific edge cases. By using standard path resolution and explicitly checking against a canonical root, the implementation is more secure and maintainable.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-18 03:31:18 +00:00
google-labs-jules[bot]andPR0M3TH3AN cc932d31de refactor: extract hardcoded error classification strings in lock-ops.mjs
- Introduced `PUBLISH_ERROR_CODES` constant for publish error classification.
- Introduced `PUBLISH_FAILURE_CATEGORIES` constant for failure categorization.
- Replaced hardcoded strings in `classifyPublishError`, `isTransientPublishCategory`, `LockPublisher.publish`, and `determineFailureCategory` with these constants.
- Verified changes with existing tests.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-18 03:30:29 +00:00
google-labs-jules[bot]andPR0M3TH3AN 7305dd964d Optimize createLifecyclePlan with Promise.all
Replaced sequential `await condenseGroup` calls with `Promise.all` to run condensation tasks concurrently.
Added `scripts/benchmark-pruner.mjs` to measure performance improvement.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-18 03:30:28 +00:00
google-labs-jules[bot]andPR0M3TH3AN ace069cc19 perf(pruner): optimize groupNearDuplicates to O(N log N) from O(N^2)
Sorts memories by created_at and uses an early exit condition in the inner loop to avoid checking all pairs. This reduces complexity from O(N^2) to roughly O(N * k) where k is the number of items within the duplicate window.

Measured improvement for 30k items: ~2.1s -> ~0.25s (8x speedup).

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-18 03:30:11 +00:00
google-labs-jules[bot]andPR0M3TH3AN aad5e46b31 fix(dashboard): whitelist exposed torch-config.json fields
Restrict the /torch-config.json endpoint to only return fields required by the dashboard frontend (dashboard config excluding auth, and nostrLock namespace/relays). This prevents exposure of sensitive internal configuration such as rosters, scheduler settings, and full relay lists.

- Modify src/dashboard.mjs to sanitize config using an allowlist approach.
- Add test/dashboard-config-exposure.test.mjs to verify sensitive fields are stripped.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-18 03:29:23 +00:00
google-labs-jules[bot]andPR0M3TH3AN 75c9b669c0 feat(dashboard): add HTTP security headers
Adds standard HTTP security headers (CSP, X-Content-Type-Options, X-Frame-Options, Referrer-Policy) to all dashboard responses to mitigate XSS, clickjacking, and MIME sniffing attacks.

Includes verification tests in test/dashboard-security.test.mjs.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-18 03:29:21 +00:00
google-labs-jules[bot]andPR0M3TH3AN e12c415f28 feat(test): add unit tests for roster loading logic with dependency injection
- Refactor `src/roster.mjs` to support dependency injection for `fs` and `loadTorchConfig`.
- Add `test/roster.test.mjs` to test roster loading scenarios including file precedence, caching, fallback, and configuration overrides.
- Export `_resetRosterCache` in `src/roster.mjs` for testing purposes.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-18 03:29:09 +00:00
google-labs-jules[bot]andPR0M3TH3AN b1353cb79b fix: prevent command injection in init scripts by validating install dir
- Added `validateInstallDir` function to `src/ops.mjs` to enforce strict allowlist for directory names (alphanumeric, hyphens, underscores, slashes, periods).
- Integrated validation into `resolveConfiguration` to sanitize both interactive and mock inputs.
- Added comprehensive unit tests in `test/install_dir_validation.test.mjs`.

This fixes a vulnerability where malicious directory names could inject shell commands into `package.json` scripts during initialization.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-18 03:28:59 +00:00
google-labs-jules[bot]andPR0M3TH3AN ba5d86142c Refactor: Move ensureDir to src/utils.mjs
Moved the `ensureDir` utility function from `src/ops.mjs` to `src/utils.mjs` to promote code reuse and centralization.
Updated `src/ops.mjs` and `src/services/memory/index.js` to use the shared utility.
Added unit tests for `ensureDir` in `test/utils.test.mjs`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-18 03:28:09 +00:00
google-labs-jules[bot]andPR0M3TH3AN 74993c1d47 I've removed the dead code in src/cmd-lock.mjs. This file contained duplicated logic that is now handled in src/lib.mjs and is not imported by any other module in the codebase.
Verified by:
- Searching the codebase to confirm no imports.
- Running the tests to ensure no regressions.
- Running the build to ensure the process is unaffected.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-18 03:28:01 +00:00
google-labs-jules[bot]andPR0M3TH3AN e787247c6f test(utils): add unit tests for todayDateStr and nowUnix
Add comprehensive unit tests for `todayDateStr` and `nowUnix` in `src/utils.mjs`.
These tests use `node:test`'s mock timers to ensure deterministic execution, verifying
that the date formatting and timestamp generation behave as expected.

- `todayDateStr`: verified correct YYYY-MM-DD format
- `nowUnix`: verified correct integer timestamp generation

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-18 03:27:26 +00:00
google-labs-jules[bot]andPR0M3TH3AN b012ae19da test: enhance coverage for relay alert thresholds
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-18 03:27:21 +00:00
google-labs-jules[bot]andPR0M3TH3AN 9a9f93aa04 chore: remove dead code src/cmd-check.mjs
- Remove `src/cmd-check.mjs` as it is not used in the codebase and contains outdated logic.
- Remove `test/cmd-check.test.mjs` as it tests the deleted file.
- Verify that `cmdCheck` in `src/lib.mjs` is covered by `test/lib.test.mjs`.

This improves code health by removing unused and duplicate code.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-18 03:23:18 +00:00
google-labs-jules[bot]andPR0M3TH3AN 06ddd10f1a chore(scheduler): run daily design-system-audit-agent
- Executed design-system-audit-agent on daily cadence
- Generated design system audit report (memory-update.md)
- Created run artifacts in src/context, src/todo, src/decisions, src/test_logs
- Published lock completion and final task log

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-18 02:42:06 +00:00
thePR0M3TH3AN cea50da512 Merge pull request #268 from PR0M3TH3AN/agents/daily/docs-agent-2026-02-18-7952298957749290543
Daily Scheduler: docs-agent run
2026-02-17 21:32:10 -05:00
thePR0M3TH3AN 214fe54ca8 Merge pull request #267 from PR0M3TH3AN/agents/daily/design-system-audit-2026-02-18-1397951051448174521
Daily Agent: Design System Audit
2026-02-17 21:30:11 -05:00
google-labs-jules[bot]andPR0M3TH3AN f436beab9b docs(agent): audit and improve documentation (docs-agent)
- Created `CONTRIBUTING.md` with development instructions.
- Updated `README.md` to include a Development section.
- Added daily scheduler run artifacts.
- Completed scheduler cycle for `docs-agent`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-18 01:16:10 +00:00
google-labs-jules[bot]andPR0M3TH3AN c90508ba42 chore(ui): design system audit (autofixes)
- Ran design-system-audit-agent.
- Audited landing/index.html for inline styles and design system violations.
- Applied safe auto-fixes to landing/index.html (margins, colors, text alignment).
- Generated audit report in task-logs/daily/.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-18 00:24:07 +00:00
thePR0M3TH3AN f343af246f Merge pull request #266 from PR0M3TH3AN/agents/daily/deps-security-agent-2026-02-17-6568228938484904642
Daily Scheduler: deps-security-agent
2026-02-17 18:40:25 -05:00
thePR0M3TH3AN b122da6365 Merge pull request #265 from PR0M3TH3AN/agents/daily/2026-02-17T22-28-08-decompose-agent-17472629862250051313
[scheduler] daily/decompose-agent: Decompose scripts/agent/run-scheduler-cycle.mjs
2026-02-17 18:39:47 -05:00