- Scanned codebase for `setInterval`, `Promise.all`, and other async patterns.
- Generated `reports/performance/hits-2026-02-20.json`.
- Identified potential unbounded concurrency in `src/services/memory`.
- Created daily performance report.
- Updated run artifacts and memory.
Co-authored-by: PR0M3TH3AN <[email protected]>
The unequal-length branch of timingSafeCompare called
crypto.timingSafeEqual(paddedA, paddedB) but did not capture the return
value, unconditionally returning false and leaving the timing-safe
comparison as dead code.
Adds a regression test covering shorter, longer, and exact-match
credential lengths to lock in the correct behaviour.
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Adds a cadence-aware time-window check that runs after the Nostr relay lock
check to exclude agents that already ran within the current window (24h daily,
7d weekly). This closes the cross-midnight edge case where the relay's
date-scoped d-tag rolls over but the agent ran minutes ago.
Changes:
- scheduler-utils.mjs: export log-parsing helpers (parseDateValue,
parseTimestampFromFilename, parseAgentFromFilename, isStrictSchedulerLogFilename,
parseFrontmatterCreatedAt, parseFrontmatterAgent, parseFrontmatterValue) plus
CADENCE_WINDOW_MS constant and buildRecentlyRunExclusionSet(). Helpers are
exported so they can be unit-tested independently. Adds 'node:path' import.
- run-scheduler-cycle.mjs: import the moved helpers from utils (removes ~45 lines
of duplicate definitions), call buildRecentlyRunExclusionSet after excludedSet
is built from relay data, merge results, log newly-excluded agents. Adds cycle
saturation detection: when all roster agents are covered by the time-window
guard, exit 0 with a clear "Cycle complete" message instead of a failure.
- test/scheduler-time-window.test.mjs: 30 new scenario-first unit tests covering
SCN-TWG-01..11 (in-window exclusion, out-of-window pass-through, cross-midnight,
frontmatter precedence, weekly threshold, empty dir, missing dir, deferred
log passthrough, mixed rosters, anti-cheat for non-log files).
All 30 new tests pass. Existing scheduler-ratchet tests (7) still pass.
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
- run-selected-prompt.mjs: set SCHEDULER_MEMORY_FILE env var before spawning each agent so
store.mjs has a well-known path to read from (memory-updates/<ts>__<agent>.md)
- retrieve.mjs: format memories.md using m.summary + date/tags in readable markdown sections
instead of raw m.content blobs; agents can now scan injected context at a glance
- store.mjs: remove semantically-empty fallback placeholder events that polluted the store
and degraded retrieval quality; also fix default cadence 'weekly' -> 'daily' to match retrieve
- scheduler-flow.md: replace vague "write insights" instruction with a concrete three-section
template (Key findings / Patterns / Warnings) and clarify that $SCHEDULER_MEMORY_FILE is
set by the scheduler automatically
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Updated the regex used to parse `META_PROMPTS.md` in `landing/index.html` to be more robust against variations in newline and language identifier formatting. Added error handling to display "Prompt format mismatch" instead of leaving the element in a "Loading..." state if parsing fails. This ensures users can access the scheduler prompts even if minor formatting differences occur.
Co-authored-by: PR0M3TH3AN <[email protected]>
Added features/diagnostic.mjs to help users verify their local TORCH environment.
Includes checks for Node.js version, dependencies, configuration, and connectivity.
Co-authored-by: PR0M3TH3AN <[email protected]>
- Updated `.hero h1` with a multi-stop animated gradient background.
- Added `@keyframes textShine` for the text gradient animation.
- Enhanced the background SVG with a `heroGlow` radial gradient and a large animated circle to provide a subtle ambient glow behind the hero section.
Co-authored-by: PR0M3TH3AN <[email protected]>
- Added `scheduler:daily` and `scheduler:weekly` usage examples to README.md and TORCH.md.
- Added `lock:complete` and `lock:check:daily` usage examples to README.md and TORCH.md.
- Updated TODO list to reflect completion of documentation alignment.
- Verified script presence and syntax.
Co-authored-by: PR0M3TH3AN <[email protected]>
- Implemented LexicalIndex class in src/services/memory/retriever.js.
- Added WeakMap caching for indices based on memory array references.
- Improved memory array stability in src/services/memory/index.js using a storeVersion counter.
- Achieved ~2x speedup for 10k memories and ~9x speedup for 100k memories in benchmarks.
- Maintains compatibility with existing textMatchSimilarity scoring.
Co-authored-by: PR0M3TH3AN <[email protected]>
Extracted duplicated target path resolution and allowlist validation logic
into a shared `resolveAndValidateTarget` helper function in
`src/services/governance/index.js`.
Updated `createProposal`, `validateProposal`, `applyProposal`, and
`rollbackPrompt` to use the new helper, ensuring consistent validation
and path handling across the service.
Added `test/governance-health.test.mjs` to verify validation logic.
Co-authored-by: PR0M3TH3AN <[email protected]>
- Added `test/errors.test.mjs` with comprehensive tests for the `ExitError` class.
- Updated `src/errors.mjs` to set `this.name = 'ExitError'` in the constructor for better error reporting.
- Verified that all new tests pass and no regressions were introduced to the existing test suite.
Co-authored-by: PR0M3TH3AN <[email protected]>
Replaced `execSync` with `execFileSync` in `src/services/governance/index.js` to avoid shell interpretation of variable-derived inputs (such as agent IDs and file targets). This mitigates command injection risks in `createProposal`, `applyProposal`, and `rollbackPrompt`.
- Used `execFileSync` for all git operations.
- Updated logic to correctly handle `git diff` exit code 1.
- Removed unused `execSync` import.
Co-authored-by: PR0M3TH3AN <[email protected]>
- Updates `cmdInit` to output the Nostr hashtag, namespace, and a direct dashboard URL upon completion.
- Refactors `createDashboardLinkFile` to return the generated URL for console output.
- Ensures the initialization process provides clear next steps for both human users and agents.
Co-authored-by: PR0M3TH3AN <[email protected]>
- README.md: add "Prompt Governance & Versioning CLI" and "State Backup
CLI" sections under Usage with full command examples and link to
docs/prompt-versioning.md
- TORCH.md: add "Prompt Versioning & State Backup" section with
proposal→apply→rollback cycle, backup command reference, and link to
docs/prompt-versioning.md
https://claude.ai/code/session_01Ndq2D72Kp77BYo4owD63uY
- Added `npm run scheduler:daily` to docs
- Added `npm run scheduler:weekly` to docs
- Added `npm run lock:complete` to docs
- Generated task log and artifacts for docs-alignment-agent run
Co-authored-by: PR0M3TH3AN <[email protected]>
.torch/ is created at runtime by torch-lock backup and proposal apply.
It holds prompt version archives and state snapshots — operational data
that should not be tracked in source control.
https://claude.ai/code/session_01Ndq2D72Kp77BYo4owD63uY