Commit Graph
100 Commits
Author SHA1 Message Date
google-labs-jules[bot]andPR0M3TH3AN 326608ce7e chore: Enforce Clean Repo Standard and organize artifacts
- Added "Clean Repo Standard" to `AGENTS.md` and `CLAUDE.md`, explicitly forbidding root-level logs/artifacts.
- Moved clutter files (`test_output_full.txt`, `benchmark-after.txt`, `dashboard.log`, etc.) to `test_logs/`, `task-logs/`, and `reports/performance/`.
- Moved `INITIAL_BASELINE.md` and other baseline files to `reports/performance/`.
- Updated `src/prompts/daily/perf-agent.md` and `src/prompts/daily/const-refactor-agent.md` to reference the new location of `INITIAL_BASELINE.md`.
- Updated `.gitignore` to ignore logs and temporary artifacts in the new directories.
- Moved `DIAGNOSIS.md` to `reports/performance/`.
- Moved `perf/` data files to `reports/performance/`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-18 19:28:03 +00:00
google-labs-jules[bot]andPR0M3TH3AN 0d13b28f53 Add agent showcase section to landing page
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-18 19:08:49 +00:00
google-labs-jules[bot]andPR0M3TH3AN 31b18f5d5a chore: standardize agent report locations and fix script paths
- Created `reports/` directory with subdirectories for each category (audit, performance, security, etc.).
- Moved existing reports to the new `reports/` structure.
- Updated `AGENTS.md` to define the "Report Location Standard".
- Updated all agent prompts in `src/prompts/` to:
    - Output reports to the new locations.
    - Fix incorrect script paths (replaced `torch/scripts/` with `scripts/`).
- Updated `load-test-agent.md` to produce a Markdown summary report.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-18 19:05:42 +00:00
google-labs-jules[bot]andPR0M3TH3AN 5d698a8455 feat: establish scenario-first testing standards
- Created `AGENTS.md` and `CLAUDE.md` to define test integrity rules and behavior-based validation.
- Updated `TORCH.md` to include "Scenario-First Tests & Test Integrity" and the "Test Integrity & Scenario Spec Agent" role.
- Updated `src/prompts/daily/test-audit-agent.md` to adopt the new "Enforcer" role, prioritizing test fidelity over CI green state.
- Preserved existing scheduler contract headers in the agent prompt.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-18 18:35:38 +00:00
google-labs-jules[bot]andPR0M3TH3AN 8455c99dfc chore(ai): document src/lock-ops.mjs
- Added JSDoc to exported functions and classes in src/lock-ops.mjs
- Added inline comments to complex logic areas
- Created docs/lock-ops-overview.md
- Created task log for daily docs-code-investigator agent

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-18 18:19:28 +00:00
google-labs-jules[bot]andPR0M3TH3AN 7c41e040bd docs: align package config and documentation paths
- Update `package.json` to include `TORCH.md` and `scripts/memory/` in distribution.
- Update `README.md` to reference `TORCH.md` correctly.
- Update `src/ops.mjs` to robustly handle memory policy paths in `torch-config.json` generation.
- Update `.gitignore` to exclude `.scheduler-memory/`.
- Update `torch-config.example.json` to include memory policy with standard defaults.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-18 16:51:35 +00:00
google-labs-jules[bot]andPR0M3TH3AN 57f6675c64 Weekly fuzz-agent run: fixes and execution
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-18 15:22:04 +00: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 62afdbb774 perf: optimize roster check in cmd-list using Set
Refactored `src/cmd-list.mjs` to use a `Set` for roster lookups, reducing complexity from O(M*N) to O(M+N).
Added dependency injection to `cmdList` to enable unit testing.
Added `test/cmd-list.test.mjs` to verify functionality.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-18 03:31:13 +00:00
google-labs-jules[bot]andPR0M3TH3AN a31332457d test: add unit tests for roster loading logic
- Implemented dependency injection in `src/roster.mjs` to allow mocking `fs` and `loadTorchConfig`.
- Added `test/roster.test.mjs` with comprehensive test cases:
    - Fallback behavior when no files/config exist.
    - Priority of `torch/roster.json` (User Roster) over `roster.json` (CWD).
    - Internal module roster fallback.
    - Environment variable overrides.
    - Configuration overrides.
    - Error handling for malformed JSON or missing fields.
- Exported `_resetRosterCache`, `_setRosterDependencies`, and `_restoreRosterDependencies` for testing purposes.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-18 03:31:12 +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
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
google-labs-jules[bot]andPR0M3TH3AN da4d360af1 chore(scheduler): execute deps-security-agent
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 23:27:49 +00:00
google-labs-jules[bot]andPR0M3TH3AN 9e993800fa [scheduler] daily/decompose-agent: Decompose scripts/agent/run-scheduler-cycle.mjs
- Executed daily scheduler cycle.
- Selected `decompose-agent` (next in roster).
- Decomposed `scripts/agent/run-scheduler-cycle.mjs` (1127 lines) into `scripts/agent/scheduler-utils.mjs` (195 lines) and `scripts/agent/scheduler-lock.mjs` (173 lines).
- Resulting main file size: 788 lines (339 lines reduction).
- Fixed lint warnings.
- Updated `test/scheduler-preflight-lock.e2e.test.mjs`, `test/run-scheduler-cycle-memory-policy.test.mjs`, `test/scheduler-lock-failure-schema.contract.test.mjs` to copy new modules into test fixtures.
- Updated `test/scheduler-ratchet.test.mjs` to verify moved functions in `scheduler-lock.mjs`.
- Note: `scripts/check-file-size.mjs` was not updated as it lacks the baseline feature referenced in the prompt.
- Created artifacts: `src/context/CONTEXT_...`, `src/decisions/DECISIONS_...`, `src/test_logs/TEST_LOG_...`, `src/todo/TODO_...`.
- Created scheduler log: `task-logs/daily/2026-02-17T22-29-00Z__decompose-agent__completed.md`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 22:41:37 +00:00
google-labs-jules[bot]andPR0M3TH3AN ed56a72f69 Daily Agent: content-audit-agent run (missing content directory) + fix lock-ops
- Audited `/content` directory: Not found.
- Updated `KNOWN_ISSUES.md`.
- Fixed a bug in `src/lock-ops.mjs` where `deps` was undefined in `LockPublisher`.
- Created run artifacts and task logs.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 21:39:10 +00:00
google-labs-jules[bot]andPR0M3TH3AN 5e99e81f2d chore(scheduler): Execute ci-health-agent and fix critical bugs
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 19:58:43 +00:00
google-labs-jules[bot]andPR0M3TH3AN 2466c80af9 fix(dashboard): Allow access to src/constants.mjs and fix lock-ops
`frontend-console-debug-agent` run:
- Fixed a 403 Forbidden error in `src/dashboard.mjs` preventing `src/constants.mjs` from loading by adding it to the `allowedPaths` whitelist.
- Refactored `src/lock-ops.mjs` to fix a critical syntax error in `LockPublisher` class.
- Fixed a typo in `src/cmd-check.mjs` (`queryLocksFn` -> `queryLocks`).
- Added `@playwright/test` for frontend debugging.
- Added `scripts/agent/debug_frontend.mjs` for reproduction.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 19:52:10 +00:00
google-labs-jules[bot]andPR0M3TH3AN 03ccb232ee Refactor lock backend constants and fix scheduler syntax error
- Extracted hardcoded retry/health constants from `src/lock-ops.mjs` to `src/constants.mjs`.
- Refactored `src/lock-ops.mjs` to use `LockPublisher` class pattern and shared constants.
- Fixed `SyntaxError` in `src/lock-ops.mjs` (function inside function).
- Fixed `ReferenceError` in `src/cmd-check.mjs` (`queryLocksFn` -> `queryLocks`).
- Verified with unit tests (`test:unit:lock-backend`) and linting.
- Completed daily scheduler cycle for `const-refactor-agent`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 19:50:48 +00: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 68da87ac48 Refactor cmdInit in src/ops.mjs to improve modularity and maintainability
- Extracted logic into helper functions: `resolveConfiguration`, `ensureInstallDirectory`, `installAppAssets`, `installTorchAssets`, `configureTorch`, `injectHostScriptsIfNeeded`.
- Updated `cmdInit` to orchestrate these functions.
- Verified functionality with existing tests.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 19:01:15 +00:00
google-labs-jules[bot]andPR0M3TH3AN bd9641a536 Sanitize environment variables in run-scheduler-cycle.mjs
Prevent sensitive environment variables from leaking into child processes spawned by the scheduler. Introduce `getSafeEnv` whitelist and default `runCommand` to use it. Explicitly allow system, node, CI, and application-specific (NOSTR_, TORCH_, SCHEDULER_, AGENT_) variables. Removed `inheritProcessEnv: true` from user commands to enforce this security policy. Added `Path` support for Windows.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 18:59:10 +00:00
google-labs-jules[bot]andPR0M3TH3AN a940172998 feat(test): add tests for runPruneCycle
- Added `test/memory-run-prune-cycle.test.mjs` to test `runPruneCycle` logic.
- Covered active pruning, dry-run, off mode, telemetry/metrics, and scheduling.
- Utilized environment isolation (temp dir) to prevent side effects on `.scheduler-memory/memory-store.json`.
- Addressed testing gap for `runPruneCycle` in `src/services/memory/index.js`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 18:55:55 +00:00
google-labs-jules[bot]andPR0M3TH3AN 59fbe1f4b8 Refactor lock-ops to encapsulate global state in RelayHealthManager class
- Replaces module-level mutable state (`metricsByRelay`, `lastSnapshotAt`) with `RelayHealthManager` class.
- Moves state-dependent functions (`ensureRelayMetrics`, `rankRelaysByHealth`, etc.) to class methods.
- Updates `queryLocks` and `publishLock` to support dependency injection for `healthManager`.
- Maintains backward compatibility via `defaultHealthManager` singleton.
- Adds `test/relay-health-manager.test.mjs` to verify state isolation and functionality.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 18:55:11 +00:00
google-labs-jules[bot]andPR0M3TH3AN 568d37a45c Fix insecure random number generator in backoff logic
Replaced `Math.random` with a cryptographically secure random number generator using `node:crypto.randomInt` in `src/lock-ops.mjs` to prevent potential timing attacks or predictability in backoff delays.

Added `test/secure-random.test.mjs` to verify the secure random generator.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 18:54:42 +00:00
google-labs-jules[bot]andPR0M3TH3AN bcc501e52f Refactor cmdInit in src/ops.mjs to improve modularity
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 18:54:33 +00:00
google-labs-jules[bot]andPR0M3TH3AN 6be1809585 test: Add tests for triggerPruneDryRun
Added unit tests for triggerPruneDryRun in src/services/memory/index.js.
Tests cover database-backed pruning and in-memory fallback pruning using mocked repositories.
Also included validation of output structure.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 18:54:04 +00:00
google-labs-jules[bot]andPR0M3TH3AN 321d5848ac Refactor publishLock into LockPublisher class in src/lock-ops.mjs
- Extracted complex retry logic from `publishLock` into `LockPublisher` class.
- Decomposed `publishLock` into `executePublishCycle`, `attemptPhase`, `analyzeFailures`, `determineFailureCategory`, and logging helpers.
- Preserved existing functionality and behavior including telemetry, health management, and error handling.
- Verified with existing tests.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 18:54:02 +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
google-labs-jules[bot]andPR0M3TH3AN 694afb1462 feat: make getRelevantMemories testable and add tests
- Modified `getRelevantMemories` in `src/services/memory/index.js` to accept optional `ranker` and `cache` parameters for dependency injection.
- Added `test/memory-index.test.mjs` with comprehensive unit tests for `getRelevantMemories` using `node:test` mocks.
- Verified that existing behavior is preserved via default parameters.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 18:53:52 +00:00
google-labs-jules[bot]andPR0M3TH3AN 1926426b11 test: add missing error handling test for lock-utils
Add a unit test for `getCompletedAgents` in `src/lock-utils.mjs` to verify that:
1. It correctly identifies completed agents.
2. It handles `ENOENT` gracefully (silent).
3. It logs an error for non-`ENOENT` errors (e.g. permission denied).

The `getCompletedAgents` function already supported dependency injection via a `deps` object, which is utilized in this test to mock `fs.readdir` and other dependencies.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 18:53:34 +00:00
google-labs-jules[bot]andPR0M3TH3AN fde5dbc67d test: Add comprehensive tests for memoryStats function
Adds `test/memory-stats.test.mjs` to validats `memoryStats` behavior including:
- Empty and populated repository states
- Ingest throughput calculation with mocked time
- Deleted rate metrics
- Window parameter handling

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 18:53:07 +00:00
google-labs-jules[bot]andPR0M3TH3AN e8cad0b42d feat(test): add unit tests for ingestEvents in memory service
Added `test/memory-ingest.test.mjs` to cover `ingestEvents` functionality.
Tests cover:
- Happy path ingestion with mocked repository and telemetry.
- Feature flag handling (skipping ingestion when disabled).
- Cache invalidation after ingestion.
- Deduplication logic.
- Error propagation from repository.

This improves test coverage for the memory service and ensures reliability of the ingestion process.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 18:53:00 +00:00
google-labs-jules[bot]andPR0M3TH3AN 5f0aefe67e test: add comprehensive tests for renderPromptWithMemoryContext
Adds test cases for `renderPromptWithMemoryContext` in `src/services/memory/formatter.js`, covering:
- Agent context serialization (arrays, objects, primitives)
- Memory usage updates side effects
- Edge cases for empty/null memories
- Feature flag handling (global toggle and allowlist)
- Parameter passing (k, tokenBudget)

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 18:52:30 +00:00
google-labs-jules[bot]andPR0M3TH3AN 33bde42591 feat(test): add unit tests for memory ingestEvents
Added comprehensive unit tests for `ingestEvents` in `src/services/memory/index.js`.
Tests cover:
- Happy path ingestion with mocked repository and telemetry.
- Feature flag skipping behavior.
- Cache clearing side effects.
- Deduplication logic.
- Error handling.

This improves test coverage and reliability for the memory service.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 18:52:27 +00:00
google-labs-jules[bot]andPR0M3TH3AN 526b6a34c7 test: add unit tests for getCompletedAgents in src/lock-utils.mjs
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 18:50:12 +00:00
google-labs-jules[bot]andPR0M3TH3AN 5bfe5f7c74 test: add comprehensive tests for relay-health summarizeHistory
Added a new test file `test/relay-health.test.mjs` to cover the `summarizeHistory` function in `src/relay-health.mjs`.

Tests cover:
- Basic statistics calculation (success rate, sample count).
- Time window filtering.
- `allDownDurationMinutes` calculation (checking outside window).
- Edge cases: empty history, malformed data, never healthy, always healthy.

Verified that tests pass with `node --test test/relay-health.test.mjs`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 18:49:30 +00:00
google-labs-jules[bot]andPR0M3TH3AN 32ba0d2621 perf(scheduler): parallelize log file reading in getLatestFile
Optimizes the `getLatestFile` function in `scripts/agent/run-scheduler-cycle.mjs` by parallelizing the reading and parsing of log files using `Promise.all`. This replaces the sequential `for...of` loop which caused I/O bottlenecks when processing large numbers of log files.

Measured improvement: ~56% faster (530ms -> 207ms) for 1000 log files.

Also removed a tracked `test_output.log` file that shouldn't be in the repository.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 18:37:39 +00: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
google-labs-jules[bot]andPR0M3TH3AN e5b2394284 test: add coverage for circular agentContext in memory formatter
Add a test case to `test/memory-formatter.test.mjs` to ensure that `renderPromptWithMemoryContext` handles circular references in `agentContext` by falling back to `String(agentContext)` instead of throwing a `JSON.stringify` error.

This addresses a missing edge case in JSON serialization testing.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 18:33:44 +00: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 73c5f22932 test(memory): add test for circular agentContext in renderPromptWithMemoryContext
Adds a test case to `test/memory-formatter.test.mjs` to verify that `renderPromptWithMemoryContext` gracefully handles circular references in `agentContext` by falling back to string representation instead of throwing a JSON serialization error. This ensures the edge case at `src/services/memory/formatter.js:125` is covered.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 18:32:46 +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
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
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
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
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
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
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
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
google-labs-jules[bot]andPR0M3TH3AN 5ec6c37480 feat(scheduler): execute todo-triage-agent daily run
Executed the daily scheduler cycle for todo-triage-agent.
- Acquired lock.
- Retrieved memory.
- Scanned codebase for TODOs (found 0 actionable items).
- Generated artifacts: context, todo, decisions, test logs, todo_issues.
- Stored memory.
- Verified artifacts and linting.
- Published completion.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 16:47:24 +00: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 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
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
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
google-labs-jules[bot]andPR0M3TH3AN 96d882554e test: reproduce npm test timeout issue
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 04:12:47 +00:00
google-labs-jules[bot]andPR0M3TH3AN ac8001cd51 chore(scheduler): complete style-agent run
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 04:09:15 +00:00
google-labs-jules[bot]andPR0M3TH3AN 5f35dde296 Fix dashboard build failure and missing documentation
- Updated `build.mjs` to correctly source `TORCH.md` and `docs/` from the project root instead of the non-existent `src/docs/`.
- Ensured `TORCH.md` is copied to `dist/src/docs/TORCH.md` as expected by the dashboard's fetch logic.
- Added `test/build_verification.test.mjs` to prevent regressions by verifying the presence of critical build artifacts (`TORCH.md`, assets, dashboard).
- Verified dashboard functionality (logos, settings modal) using a temporary Playwright script.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 03:53:55 +00:00
google-labs-jules[bot]andPR0M3TH3AN 268248b4eb feat: add hosted dashboard configuration and distribution plan
Added a settings modal to the dashboard (index.html) to allow configuration of hashtag, namespace, and relays via URL query parameters and localStorage. This enables the dashboard to be hosted as a static site and used by any project.

Also added `docs/architecture/distribution-plan.md` outlining the strategy for NPM, Binary, and Hosted Dashboard distribution.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 03:26:33 +00:00
google-labs-jules[bot]andPR0M3TH3AN 6425f573fd Remove Mermaid diagram section from landing page
Removes the "Autonomous Improvement Cycle" section, including the HTML block, Mermaid.js script import, and associated CSS styles, to simplify the landing page.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 03:18:28 +00: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 6313c08125 Enable persistence for Torch agent memory system
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 03:00: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
google-labs-jules[bot]andPR0M3TH3AN 639fd6bccc chore(daily): execute protocol-research-agent
- Updated PROTOCOL_INVENTORY.md with NIP-40, NIP-78, and Kind 27235 details.
- Created protocol-report-2026-02-17.md.
- Verified system health with unit tests.
- Completed scheduler cycle (lock, memory, log).

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-17 01:09:57 +00: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 bccc2797a0 chore(daily): run onboarding-audit-agent
- Executed onboarding-audit-agent.
- Verified npm ci, build, lint.
- Recorded npm test timeout in incident report.
- Updated KNOWN_ISSUES.md.
- Created task completion log.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 21:23:58 +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 d02fa41079 fix(scheduler): relax prompt validation and correct default lint command
- Update `scripts/agent/run-scheduler-cycle.mjs` to allow prompt files to start with a blockquote (`>`) in addition to a markdown header (`#`), unblocking agents with shared contract headers.
- Fix default validation command from `['npm', 'run', 'lint']` to `['npm run lint']` to prevent `npm` usage errors.
- Include daily task logs demonstrating successful scheduler cycle execution (skipping failed locks and completing `load-test-agent`).

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-16 16:33:37 +00:00