- Executed test-audit-agent prompt
- Ran static analysis and flakiness check
- Identified and reported consistent failures in load-test.mjs and smoke-test.mjs
- Updated KNOWN_ISSUES.md
- Created run artifacts (Context, Todo, Decisions, Test Logs)
- Completed lock cycle
Co-authored-by: PR0M3TH3AN <[email protected]>
- 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]>
- Implemented throttling in `performSave` to limit disk writes to max 1 per second.
- Refactored `updateMemoryUsage` to use non-blocking (fire-and-forget) save calls, eliminating latency for memory reads.
- Added atomic write strategy using unique temporary files and `fs.rename` to prevent data corruption.
- Verified with benchmarks: `getRelevantMemories` latency reduced from ~100ms to ~30ms for 10k items.
Co-authored-by: PR0M3TH3AN <[email protected]>
Moved unit tests for `withTimeout` from `test/utils.test.mjs` to `test/utils-async.test.mjs`.
This prevents potential interference from `MockTimers` enabled in `test/utils.test.mjs` which could affect `setTimeout` behavior in async tests.
Increased timeout margins in `withTimeout` tests for better reliability in CI.
Co-authored-by: PR0M3TH3AN <[email protected]>
- Extracted command logic from `src/lib.mjs` `main` function into `COMMAND_HANDLERS` dispatch map.
- Simplified `main` function to perform argument parsing and dispatching.
- Added `test/main-dispatch.test.mjs` to verify dispatch logic and error handling.
- Ensured no regressions in CLI behavior.
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]>
- Extracted `PUBLISH_ERROR_CODES`, `PUBLISH_FAILURE_CATEGORIES`, and `classifyPublishError` to `src/lock-error-classifier.mjs`.
- Moved `secureRandom` to `src/lock-utils.mjs`.
- Updated `src/lock-publisher.mjs` and `src/lock-ops.mjs` to import shared utilities from `src/lock-utils.mjs`.
- Reduced `src/lock-publisher.mjs` size significantly (approx. 100 lines) and verified `src/lock-ops.mjs` remains small.
- Verified that tests pass and file sizes are reduced.
Co-authored-by: PR0M3TH3AN <[email protected]>
- Precompute vector norms during `upsertVector` in `InMemoryEmbedderAdapter`.
- Compute query vector norm once per query.
- Update `cosineSimilarity` to accept precomputed norms, avoiding redundant calculations.
- Optimize `cosineSimilarity` loop to iterate only up to `Math.min(left.length, right.length)` and remove redundant casts.
- Achieved ~27% improvement in query time (57ms vs 78ms for 50 queries against 2000 vectors).
Co-authored-by: PR0M3TH3AN <[email protected]>
Moved the duplicate `withTimeout` function from `src/lock-ops.mjs`, `src/lock-publisher.mjs`, `src/lock-utils.mjs`, and `src/relay-health.mjs` to a single definition in `src/utils.mjs`.
Updated all references to import from `src/utils.mjs`. `src/lock-utils.mjs` re-exports `withTimeout` for backward compatibility.
Added unit tests for `withTimeout` in `test/utils.test.mjs`.
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]>
Updates `validateProposal` to accept either a proposal ID or a proposal object.
Updates `applyProposal` to pass the already-fetched proposal object to `validateProposal`,
eliminating a redundant file system read. This improves efficiency and code health.
Tests were verified to ensure no regression.
Co-authored-by: PR0M3TH3AN <[email protected]>
Marks pending items in `src/todo/TODO_2026-02-19T22-29-56Z.md` as completed since they were flagged as N/A by the agent. This ensures the todo list accurately reflects the run status.
Co-authored-by: PR0M3TH3AN <[email protected]>