Commit Graph
501 Commits
Author SHA1 Message Date
thePR0M3TH3AN 88bb2e8fff Merge branch 'main' into test/unpin-memory-coverage-10292270866664076558 2026-02-17 13:37:09 -05:00
thePR0M3TH3AN 3f93916372 Merge pull request #239 from PR0M3TH3AN/test-unpinMemory-improvement-14234727575040674588
🧪 Add unit tests for unpinMemory
2026-02-17 13:36:49 -05:00
thePR0M3TH3AN 2de7bdd5ce Merge pull request #237 from PR0M3TH3AN/perf/optimize-reliability-summary-12744973006292843555
⚡ Optimize lock reliability summary with Promise.all
2026-02-17 13:36:35 -05:00
thePR0M3TH3AN f815ab3f59 Merge pull request #238 from PR0M3TH3AN/test-improvement-relay-health-11069753813571179653
test(relay-health): add unit tests for summarizeHistory
2026-02-17 13:36:22 -05:00
thePR0M3TH3AN ce5ff389b9 Merge pull request #235 from PR0M3TH3AN/perf/scheduler-verify-memory-step-parallel-9310367124613202891
⚡ Parallelize artifact checks in scheduler verification
2026-02-17 13:36:07 -05:00
thePR0M3TH3AN ac80e8306f Merge pull request #233 from PR0M3TH3AN/refactor/torch-config-string-parsing-8819796160542468517
Refactor: Unify string list parsing in torch-config
2026-02-17 13:35:55 -05:00
thePR0M3TH3AN f118d10d0c Merge pull request #236 from PR0M3TH3AN/refactor/torch-config-helper-11721225630532365910
Refactor repetitive config retrieval in torch-config.mjs
2026-02-17 13:35:41 -05:00
google-labs-jules[bot]andPR0M3TH3AN 0851d875a4 test(memory): add unit tests for unpinMemory
Adds focused unit tests for `unpinMemory` in `test/memory-pinning.test.mjs` to ensure it correctly updates the repository and clears the cache. Covers both happy path and non-existent ID scenarios.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 18:33:44 +00:00
google-labs-jules[bot]andPR0M3TH3AN 58660f9390 test(relay-health): add unit tests for summarizeHistory
Added comprehensive unit tests for `summarizeHistory` in `src/relay-health.mjs`.
- Covers success rate calculation, window filtering, and all-down duration logic.
- Includes edge cases for empty history and malformed entries.
- Improves test coverage for relay health monitoring logic.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 18:33:39 +00:00
google-labs-jules[bot]andPR0M3TH3AN 18eedc7810 perf: parallelize log processing in summarize-lock-reliability.mjs
Replaces sequential file processing loop with Promise.all to improve performance.
Benchmark showed ~2.5x speedup (1638ms -> 658ms) on 2000 files.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 18:33:10 +00:00
google-labs-jules[bot]andPR0M3TH3AN 34cfc95b2d Refactor repetitive config retrieval in torch-config.mjs
Introduced a `resolveIntegerConfig` helper function to handle environment variable checking, parsing, validation, and configuration fallback for integer settings. Updated `getQueryTimeoutMs`, `getPublishTimeoutMs`, `getMinSuccessfulRelayPublishes`, and `getMinActiveRelayPool` to use this helper. This improves code maintainability and consistency.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 18:32:51 +00:00
google-labs-jules[bot]andPR0M3TH3AN 3d459ef905 perf(scheduler): parallelize artifact checks in verifyMemoryStep
Optimize the `verifyMemoryStep` function in `scripts/agent/run-scheduler-cycle.mjs` to check for artifact existence in parallel using `Promise.all` instead of a sequential loop.

Benchmarks indicate a ~10x performance improvement (from ~500ms to ~50ms) when checking for 10 artifacts where none or the last one exists, with no regression in the best-case scenario.

Verified with `test/run-scheduler-cycle-memory-policy.test.mjs`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 18:32:46 +00:00
google-labs-jules[bot]andPR0M3TH3AN 67a6b91d92 Refactor: Unify string list parsing in torch-config
- Introduced `parseStringList` helper to handle parsing of string arrays from config.
- Replaced `parseRelayList` and `parseRoster` with `parseStringList`.
- Replaced inline parsing of `relays` and `dashboard.relays` with `parseStringList`.
- Unified behavior: empty lists in config now consistently return `null` instead of `[]`.
- Added unit test verifying consistent `null` return for empty lists.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 18:32:40 +00:00
google-labs-jules[bot]andPR0M3TH3AN 969a7d41e7 test(memory): add unit tests for unpinMemory
Added unit tests to `test/memory-pinning.test.mjs` to cover the `unpinMemory` function.
Tests verify:
- Successful unpinning and cache clearing.
- Handling of non-existent IDs (returns null) and cache clearing.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 18:32:35 +00:00
thePR0M3TH3AN 264e2b5f61 Merge pull request #230 from PR0M3TH3AN/agents/daily/audit-agent-15878739526953996560
Daily Audit Agent Run (2026-02-17)
2026-02-17 13:18:21 -05:00
google-labs-jules[bot]andPR0M3TH3AN 2f72ac4b42 feat(audit): daily audit run for 2026-02-17
- Executed audit-agent tasks manually.
- Ran file size check, innerHTML check, and lint.
- Generated artifacts in artifacts/audit/2026-02-17/.
- Updated memory store.
- Verified artifacts.
- Completed lock.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 18:14:18 +00:00
thePR0M3TH3AN c549c0e8b0 Merge pull request #227 from PR0M3TH3AN/test-mark-memory-merged-6408631238217390232
test(memory): add tests for markMemoryMerged
2026-02-17 13:10:10 -05:00
thePR0M3TH3AN e61b4e3d4a Merge pull request #226 from PR0M3TH3AN/memory-telemetry-fix-8633028829140804238
🧹 Use util.debuglog for memory telemetry
2026-02-17 13:09:23 -05:00
thePR0M3TH3AN 8f51d74955 Merge pull request #229 from PR0M3TH3AN/fix/dashboard-config-security-7655777063695938949
🔒 Fix security vulnerability: Sanitize torch-config.json exposure
2026-02-17 13:09:02 -05:00
thePR0M3TH3AN 127ec4102e Merge pull request #228 from PR0M3TH3AN/fix-dashboard-file-access-vulnerability-3711172732020694981
🔒 Fix unrestricted file access in dashboard
2026-02-17 13:07:04 -05:00
thePR0M3TH3AN b240132f4a Merge pull request #225 from PR0M3TH3AN/test/pin-memory-coverage-16037314347180208505
test: add unit tests for pinMemory and fix dependency injection in getRelevantMemories
2026-02-17 13:06:38 -05:00
google-labs-jules[bot]andPR0M3TH3AN 88506ad6e4 fix(security): sanitize torch-config.json response in dashboard
The dashboard previously served the raw `torch-config.json` file, potentially exposing sensitive information like authentication credentials.
This commit modifies the `/torch-config.json` endpoint to:
1. Parse the configuration file.
2. Sanitize the output by removing the `dashboard.auth` field and any unknown fields (using `parseTorchConfig`).
3. Support `TORCH_CONFIG_PATH` environment variable for configuration file location, improving testability and consistency with other components.

Verified with new test `test/dashboard-config-security.test.mjs` and existing auth tests.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 17:36:56 +00:00
google-labs-jules[bot]andPR0M3TH3AN 171836d2ac fix: restrict dashboard file access to allowed directories
This patch addresses a security vulnerability where the dashboard server could serve any file from the package root.

Changes:
- Implemented an allowlist in `src/dashboard.mjs` to restrict file access to:
  - `dashboard/`
  - `assets/`
  - `src/docs/`
  - `torch-config.json`
- Added `test/dashboard-security.test.mjs` to verify the fix and prevent regressions.

The fix ensures that sensitive files like `package.json` or source code cannot be accessed via the dashboard server.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 17:35:32 +00:00
google-labs-jules[bot]andPR0M3TH3AN 78c31e828d test(memory): add tests for markMemoryMerged and enable dependency injection
- Update `markMemoryMerged` to accept `options.repository` for better testability.
- Add unit tests in `test/memory-admin.test.mjs` to verify:
  - Delegation to repository.
  - Cache clearing side effect.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 17:32:45 +00:00
google-labs-jules[bot]andPR0M3TH3AN 53aa68ac64 Refactor memory telemetry to use util.debuglog
Replaced `console.log` with `util.debuglog('torch-memory')` in `src/services/memory/index.js` to prevent stdout pollution. Telemetry and metrics are now logged to stderr only when `NODE_DEBUG=torch-memory` is set, improving library behavior and observability control.

Added regression test `test/memory-telemetry.test.mjs`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 17:31:52 +00:00
google-labs-jules[bot]andPR0M3TH3AN a3b181b3d8 test: add unit tests for pinMemory and fix dependency injection in getRelevantMemories
- Add `test/memory-pinning.test.mjs` to test `pinMemory` happy path and edge cases.
- Update `getRelevantMemories` in `src/services/memory/index.js` to use `repository.listMemories` when available, enabling isolated unit testing.
- Verified all memory tests pass.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 17:31:44 +00:00
thePR0M3TH3AN 4d11b2b710 Merge pull request #224 from PR0M3TH3AN/jules-fix-dashboard-auth-11280121515374886398-56017a2b
🔒 Add Authentication and Local Host Binding to Dashboard
2026-02-17 12:24:47 -05:00
google-labs-jules[bot]andPR0M3TH3AN 456bc2df18 feat(security): add authentication and host binding to dashboard
This commit addresses the missing authentication vulnerability in the
dashboard server.

Changes:
- Added Basic Authentication support via TORCH_DASHBOARD_AUTH env var
  or dashboard.auth config field.
- Defaulted dashboard host binding to 127.0.0.1 for better security.
- Added --host CLI argument to allow overriding the bind address.
- Used crypto.timingSafeEqual for secure credential comparison.
- Fixed a potential crash when parsing malformed Authorization headers.
- Added comprehensive unit tests for dashboard authentication.
- Updated documentation in README.md and torch-config.example.json.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 17:24:33 +00:00
thePR0M3TH3AN 0d1417666c Merge pull request #223 from PR0M3TH3AN/perf-find-last-optimization-8140799722290244091
⚡ optimize lock failure reason summarization with findLast
2026-02-17 12:24:18 -05:00
google-labs-jules[bot]andPR0M3TH3AN fa4c9ca175 perf: optimize lock failure reason summarization
Replace inefficient `[...events].reverse().find()` with `events.findLast()`.
This avoids a shallow copy of the array and an in-place reverse,
improving performance from O(N) space/time to O(1) space and O(N) time
(where N is the number of events searched).

In benchmarks with 100,000 events:
- Element near the end: 99.9% improvement (~0.8ms vs ~950ms)
- Element at the beginning: ~42% improvement (~145ms vs ~250ms)

Node.js v18.6.0+ is required for `findLast`, which is supported in the
current environment (v22.22.0).

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 17:11:16 +00:00
thePR0M3TH3AN 3ff9e25464 Merge pull request #222 from PR0M3TH3AN/test-memory-formatter-3246489614731328152
🧪 add unit tests for memory formatter
2026-02-17 12:11:03 -05:00
google-labs-jules[bot]andPR0M3TH3AN 20ba1567d8 test: add unit tests for memory formatter
- Added `test/memory-formatter.test.mjs` with comprehensive unit tests for:
  - `estimateTokenCount`
  - `formatMemoryBlock`
  - `formatMemoriesForPrompt`
  - `renderPromptWithMemoryContext`
- Verified all tests pass and no regressions in related tests.
- Addressed testing gap in `src/services/memory/formatter.js`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 17:10:52 +00:00
thePR0M3TH3AN fd441addb8 Merge pull request #221 from PR0M3TH3AN/refactor-ops-duplication-13791385305147113834
🧹 refactor duplicated copying logic in src/ops.mjs
2026-02-17 12:10:30 -05:00
google-labs-jules[bot]andPR0M3TH3AN a437ddd9f7 chore(ai): refactor duplicated copying logic in src/ops.mjs
- Extracted `syncAppDirectories` and `syncAppFiles` helper functions.
- Updated `cmdInit` and `cmdUpdate` to use the new helpers.
- Improved `cmdInit` to throw an Error instead of warning when the target directory is not empty and not forced.
- Fixed hanging tests in `test/ops.test.mjs` by providing `MOCK_CONFIG`.
- Updated tests to verify strict directory check in `cmdInit`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 17:09:39 +00:00
thePR0M3TH3AN 2fb545f5e7 Merge pull request #218 from PR0M3TH3AN/agents/weekly/feature-proposer-agent-2026-02-17-4294973300536847645
feat: implement log-summary utility as feature-proposer-agent
2026-02-17 12:09:27 -05:00
thePR0M3TH3AN e54cb45540 Merge branch 'main' into agents/weekly/feature-proposer-agent-2026-02-17-4294973300536847645 2026-02-17 12:09:20 -05:00
thePR0M3TH3AN 3d1ba0633a Merge pull request #219 from PR0M3TH3AN/daily-scheduler-run-14087225636286121848
Daily Scheduler Run: torch-garbage-collection-agent
2026-02-17 12:07:32 -05:00
google-labs-jules[bot]andPR0M3TH3AN ab1ef666d4 feat(scheduler): execute daily cycle for torch-garbage-collection-agent
- Selected torch-garbage-collection-agent (others excluded/locked)
- Executed garbage collection (no stale files found)
- Updated memory and artifacts
- Published completion lock event
- Created task log entry

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 16:43:59 +00:00
google-labs-jules[bot]andPR0M3TH3AN 2ed1ae85a9 feat: implement log-summary utility as feature-proposer-agent
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 16:41:10 +00:00
thePR0M3TH3AN 5196f264cb Merge pull request #217 from PR0M3TH3AN/fix-test-audit-agent-timeout-3786484628019216618
Fix test-audit-agent timeout by isolating unit tests for flakiness checks
2026-02-17 11:25:36 -05:00
google-labs-jules[bot]andPR0M3TH3AN f9a7c0eea6 chore(scheduler): optimize test-audit-agent flakiness check
- Updated `src/prompts/daily/test-audit-agent.md` to instruct the agent to run only unit tests during flakiness detection.
- Explicitly excluded composite scripts (e.g. `npm test` with lint/build) and slow integration/E2E tests from the repeated test loop.
- This prevents timeouts caused by running the full test suite (including network-dependent tests) multiple times.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 16:16:46 +00:00
thePR0M3TH3AN ce9751c3e4 Merge pull request #216 from PR0M3TH3AN/jules-memory-conflict-fix-1735324100334813480
Resolve memory-update.md merge conflicts with unique file generation
2026-02-17 10:20:20 -05:00
google-labs-jules[bot]andPR0M3TH3AN 2a39713189 feat(scheduler): generate unique memory update files per run to avoid merge conflicts
- Modified `scripts/agent/run-scheduler-cycle.mjs` to generate a unique `memory-updates/<timestamp>__<agent>.md` path and pass it via `SCHEDULER_MEMORY_FILE` env var.
- Updated `scripts/memory/store.mjs` to prioritize `SCHEDULER_MEMORY_FILE` for ingestion.
- Updated `src/prompts/scheduler-flow.md` to instruct agents to write to the unique memory file.
- Updated `src/prompts/daily/torch-garbage-collection-agent.md` to include `memory-updates/*.md` in the cleanup scope.
- Moved existing `memory-update.md` to `memory-updates/legacy-memory-update-<timestamp>.md` to clear the root.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 15:19:52 +00:00
thePR0M3TH3AN 5704eec127 Merge pull request #215 from PR0M3TH3AN/feat/offline-bundle-7151517603269259215
feat: Add Offline Bundle to Landing Page
2026-02-17 10:10:02 -05:00
google-labs-jules[bot]andPR0M3TH3AN 691b24d518 feat: Add Offline Bundle to Landing Page
- Modified build.mjs to run npm pack and move tarball to dist/
- Updated landing/index.html with download link and instructions
- Updated TORCH.md with Offline & Air-Gapped Installation guide

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 15:01:48 +00:00
thePR0M3TH3AN b8827be83c Merge pull request #213 from PR0M3TH3AN/ai/dead-code-20260217-8092661183000207269
Weekly dead-code-agent execution
2026-02-17 09:41:05 -05:00
google-labs-jules[bot]andPR0M3TH3AN 825d596a59 Weekly dead-code-agent execution: removed scripts/fix-duplication.mjs and src/services/memory/db-adapter.js
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 14:33:14 +00:00
thePR0M3TH3AN 199c34648b Merge pull request #199 from PR0M3TH3AN/agents/daily/log-fixer-agent-2026-02-16-13770463431702119028
fix(prompts): add missing H1 headers to resolve schema validation failures
2026-02-17 09:21:06 -05:00
thePR0M3TH3AN 494bb62b99 Merge branch 'main' into agents/daily/log-fixer-agent-2026-02-16-13770463431702119028 2026-02-17 09:20:57 -05:00
thePR0M3TH3AN 872f3862db Merge pull request #212 from PR0M3TH3AN/agents/weekly/changelog-agent-2026-02-17-11314629234598955243
Weekly Changelog Agent Run (2026-02-17)
2026-02-17 00:08:48 -05:00