- Add regression test `test/governance-security.test.mjs` to verify `applyProposal` is secure against command injection.
- Fix broken imports and duplicates in `src/lock-utils.mjs`, `src/lock-ops.mjs`, `src/lock-publisher.mjs`, and `src/relay-health.mjs` to resolve test failures.
- Verify all tests pass.
Co-authored-by: PR0M3TH3AN <[email protected]>
Consolidated the duplicate `relayListLabel` function from `src/lock-ops.mjs` and `src/lock-publisher.mjs` into `src/utils.mjs`.
- Moved `relayListLabel` to `src/utils.mjs`.
- Updated `src/lock-ops.mjs` and `src/lock-publisher.mjs` to import it.
- Updated `src/lock-utils.mjs` to re-export it from `src/utils.mjs` to maintain backward compatibility.
- Added unit tests in `test/utils.test.mjs`.
- Verified all tests pass.
Co-authored-by: PR0M3TH3AN <[email protected]>
- Moved `mergeRelayList` from `src/lock-ops.mjs` and `src/lock-publisher.mjs` to `src/utils.mjs`.
- Updated imports in `src/lock-ops.mjs` and `src/lock-publisher.mjs`.
- Added unit tests for `mergeRelayList` in `test/utils.test.mjs`.
- Restored `torch-config-test.json` which was deleted by the test suite.
Co-authored-by: PR0M3TH3AN <[email protected]>
- Update `src/utils.mjs` to detect `gemini` and `antigravity` platforms via environment variables.
- Update `dashboard/styles.css` with new color utilities for purple and pink themes.
- Update `dashboard/app.js` to map Goose, Gemini, and Antigravity platforms to distinct badge colors.
- Update `test/utils.test.mjs` to include unit tests for the new platform detection logic.
This ensures all active agent platforms are correctly identified and labeled in the TORCH dashboard.
Co-authored-by: PR0M3TH3AN <[email protected]>
- Updated `src/utils.mjs` to detect 'claude' platform via `CLAUDE_API_KEY`, `ANTHROPIC_API_KEY`, or `CLAUDE_SESSION_ID`.
- Updated `scripts/agent/scheduler-utils.mjs` `getSafeEnv` to preserve `JULES_`, `CODEX_`, `CLAUDE_`, `ANTHROPIC_`, and `GOOSE_` environment variables when spawning child processes.
- Updated `scripts/agent/run-scheduler-cycle.mjs` to use `detectPlatform()` as a fallback for `AGENT_PLATFORM` instead of hardcoding `'codex'`, ensuring the correct platform is used for lock creation.
- Added unit tests for `detectPlatform` in `test/utils.test.mjs`.
This resolves the issue where lock cards displayed "Unknown" or incorrect platforms.
Co-authored-by: PR0M3TH3AN <[email protected]>
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]>
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]>
- Update `torch-lock check` to scan `task-logs/<cadence>` for completed tasks.
- Add `--log-dir` and `--ignore-logs` flags to `check` command.
- Implement `getIsoWeekStr` utility for robust weekly cadence checking.
- Ensure completed agents are added to the `excluded` list, enabling the scheduler to skip them.
- Add comprehensive tests for log checking and date utilities.
Co-authored-by: PR0M3TH3AN <[email protected]>