Commit Graph
212 Commits
Author SHA1 Message Date
thePR0M3TH3AN 3502d38431 Merge branch 'main' into jules-perf-async-config-1969443791138192182 2026-02-17 14:26:06 -05:00
google-labs-jules[bot]andPR0M3TH3AN 50b0cf5a07 perf: Refactor config loading to be non-blocking async
Replaces synchronous `fs.readFileSync` with `fs.promises.readFile` in `loadTorchConfig` to prevent event loop blocking.
Updates all dependent configuration getters and consumers to use async/await.
Includes benchmark proving non-blocking behavior.
Fixes dashboard tests to properly await server listening.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 19:02:46 +00:00
google-labs-jules[bot]andPR0M3TH3AN 99bd4ba2a3 test: add unit tests for cmdCheck
Refactor `cmdCheck` in `src/cmd-check.mjs` to support dependency injection for better testability.
Add `test/cmd-check.test.mjs` with comprehensive unit tests for `cmdCheck`, covering happy paths and edge cases.
Verify tests pass with `node --test test/cmd-check.test.mjs`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 18:53:55 +00:00
thePR0M3TH3AN 39b7783899 Merge pull request #241 from PR0M3TH3AN/refactor-usage-text-5134896285807665530
🧹 Refactor usage text to constants
2026-02-17 13:38:21 -05:00
thePR0M3TH3AN f0437a9647 Merge pull request #231 from PR0M3TH3AN/code-health/relay-health-comment-8690906014173608719
Sweep: Add comment to swallowed error in relay-health.mjs
2026-02-17 13:37:43 -05:00
google-labs-jules[bot]andPR0M3TH3AN 24f1853efc refactor(cli): move usage text to constants
Moved the large usage help text from `src/lib.mjs` to `src/constants.mjs` to improve readability and maintainability of the library file.

- Added `USAGE_TEXT` to `src/constants.mjs`.
- Updated `src/lib.mjs` to import and use `USAGE_TEXT`.
- Removed unused `DEFAULT_DASHBOARD_PORT` import from `src/lib.mjs`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 18:35:55 +00: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
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 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 ec769d39cb docs: explain swallowed JSON parse error in relay-health.mjs
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 18:32:22 +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
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 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 e54cb45540 Merge branch 'main' into agents/weekly/feature-proposer-agent-2026-02-17-4294973300536847645 2026-02-17 12:09:20 -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
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
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
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 494bb62b99 Merge branch 'main' into agents/daily/log-fixer-agent-2026-02-16-13770463431702119028 2026-02-17 09:20:57 -05:00
google-labs-jules[bot]andPR0M3TH3AN e35ee4a8c8 docs(ai): weekly changelog draft
- Generated weekly changelog draft in `releases/draft-2026-02-17.md`.
- Updated scheduler artifacts and memory.
- Completed weekly `changelog-agent` run.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 05:08:03 +00:00
thePR0M3TH3AN 158c1391c6 Merge pull request #206 from PR0M3TH3AN/consolidate-agent-docs-17477044144168368963
Consolidate AGENTS.md and CLAUDE.md into TORCH.md for embedded use
2026-02-16 22:13:51 -05:00
google-labs-jules[bot]andPR0M3TH3AN 8b5cec4890 Consolidate agent docs into TORCH.md and update installer
- Merged AGENTS.md, CLAUDE.md, and src/docs/TORCH.md into a single TORCH.md in the root.
- Updated src/ops.mjs to copy TORCH.md during init/update and correctly transform path references.
- Updated src/prompts/META_PROMPTS.md and src/prompts/scheduler-flow.md to reference TORCH.md.
- Deleted obsolete AGENTS.md, CLAUDE.md, and src/docs/TORCH.md.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 03:11:28 +00:00
google-labs-jules[bot]andPR0M3TH3AN 44884cc0c0 Make memory system usable by agents via file-based I/O
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 02:50:46 +00:00
google-labs-jules[bot]andPR0M3TH3AN 58c4f14d57 docs(prompts): sync roster.json and scheduler rosters
- Updated roster.json based on prompt directory scan.
- Regenerated daily and weekly scheduler markdown tables.
- Added run artifacts and task log.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 02:10:29 +00:00
thePR0M3TH3AN c035f6994d Merge pull request #201 from PR0M3TH3AN/agents/daily/perf-agent-2026-02-17-15937880158330257401
chore(scheduler): execute daily perf-agent cycle
2026-02-16 19:29:18 -05:00
google-labs-jules[bot]andPR0M3TH3AN 2df15cb585 chore(scheduler): execute daily perf-agent cycle
Executed the daily perf-agent cycle.
- Acquired lock for perf-agent.
- Executed memory retrieval.
- Generated context, todo, decisions, test_logs, and perf report artifacts.
- Executed memory storage.
- Verified artifacts.
- Completed lock and generated task log.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 00:09:26 +00:00
google-labs-jules[bot]andPR0M3TH3AN 19af4dcba5 perf: visibility-gate dashboard render loop
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 23:09:11 +00:00
google-labs-jules[bot]andPR0M3TH3AN eb1407a8c1 fix(prompts): add missing H1 headers to resolve schema validation failures
- Added H1 headers to 6 daily/weekly agent prompts.
- Verified with `npm run validate:scheduler`.
- Logged execution in `task-logs/daily/`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 22:09:50 +00:00
google-labs-jules[bot]andPR0M3TH3AN 37e556f29d fix(log-fixer): resolve daily agent failures
- Add H1 headers to `innerhtml-migration-agent.md`, `known-issues-agent.md`, and `deps-security-agent.md` to prevent schema validation failures.
- Verify `npm run lint` passes.
- Create scheduler completion log for `log-fixer-agent`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 19:10:07 +00:00
google-labs-jules[bot]andPR0M3TH3AN d23e6ff0b3 Refactor memory scripts and fix configuration for new installs
- Replaced fragile inline Node.js scripts in `torch-config.json` with dedicated modules: `scripts/memory/retrieve.mjs` and `scripts/memory/store.mjs`.
- Updated `src/ops.mjs` initialization logic to dynamically configure `scheduler.memoryPolicyByCadence` with correct paths based on the installation directory.
- Added default memory policy configuration to `torch-config.example.json` to guide users.
- Injected `torch:memory:list` and `torch:memory:inspect` convenience scripts into the host `package.json` during `init`.
- Removed legacy shell scripts (`run-memory-retrieval.sh`, `run-memory-store.sh`).
- Verified memory scripts function correctly and pass linting.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 17:19:55 +00:00
google-labs-jules[bot]andPR0M3TH3AN 5c3a2dbe6f Weekly Agent Run: weekly-synthesis-agent
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 16:30:42 +00:00
google-labs-jules[bot]andPR0M3TH3AN 487081f319 Improve torch init experience with interactive prompts and script injection
- Modified `init` to be interactive, asking for install directory, namespace, and relays.
- Added automatic injection of convenience scripts (`torch:check`, `torch:lock`, etc.) into the host `package.json`.
- Increased default network timeouts (30s query, 15s publish) to reduce failure rate.
- Added visual feedback (logs) during relay connection and querying.
- Refactored `src/ops.mjs` to support flexible installation paths.
- Updated `src/torch-config.mjs` to support config resolution from parent directories (e.g., when running via `npm run --prefix`).

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 02:44:48 +00:00
google-labs-jules[bot]andPR0M3TH3AN aff47a7ba6 docs(scheduler): daily run for docs-code-investigator
- Documented `src/lock-ops.mjs` in `docs/src-lock-ops-overview.md`.
- Created required scheduler artifacts (`src/context/`, `src/todo/`, etc.).
- Completed scheduler cycle and updated `task-logs/daily/`.
- Updated `package-lock.json` with dependencies.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 02:17:45 +00:00
google-labs-jules[bot]andPR0M3TH3AN 77df77a1a6 feat: execute daily docs-alignment-agent
- Scheduled docs-alignment-agent
- Retrieved and stored memories
- Verified artifacts: context, todo, decisions, test_logs
- Validated package.json vs README.md claims
- Completed lock and wrote log

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 01:23:00 +00:00
google-labs-jules[bot]andPR0M3TH3AN 6d2af25774 fix(init): ensure torch-config.json is created in project root
- Modified `src/ops.mjs` to create `torch-config.json` in `paths.root` instead of `paths.torchDir` during `cmdInit`.
- This aligns the initialization behavior with the documentation (`README.md`) and resolves a discrepancy found by `test/ops.test.mjs`.
- Verified with `npm test`.
- Included `docs-agent` run artifact `src/context/CONTEXT_2026-02-16T00-33-39Z.md`.
- Included `task-logs/daily/2026-02-16T00-35-14Z__docs-agent__completed.md`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 00:38:44 +00:00
google-labs-jules[bot]andPR0M3TH3AN 3f3f45b13f feat: ensure torch init installs full application package
- Modify `src/ops.mjs` to copy all critical application directories (`src`, `bin`, `dashboard`, `scripts`, etc.) and files (`package.json`, `build.mjs`) to the `torch/` directory during `init` and `update`.
- Update `src/ops.mjs` to generate `torch-config.json` inside the `torch/` directory (if missing) instead of only in the project root, supporting self-contained execution.
- Update `src/roster.mjs` to fallback to checking for `roster.json` in the current working directory, enabling `npm run` commands to work correctly when executed from within the `torch/` directory.
- This allows `torch/` to function as a standalone sub-package within a project, where users can `cd torch`, `npm install`, and `npm run build` as expected.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 00:00:28 +00:00
thePR0M3TH3AN 95b3edf90d Merge pull request #181 from PR0M3TH3AN/agents/daily/decompose-agent-2878969979307720459
[decompose] extract getCompletedAgents from src/lib.mjs
2026-02-15 18:28:21 -05:00