Commit Graph
37 Commits
Author SHA1 Message Date
thePR0M3TH3AN f22bcfb713 Add bounded retry logic for lock publish quorum 2026-02-14 19:08:53 -05:00
thePR0M3TH3AN 84d3e7eded Harden lock backend config validation and fallback behavior 2026-02-14 18:48:21 -05:00
thePR0M3TH3AN ecb26dfa99 Improve scheduler lock observability and reliability reporting 2026-02-14 18:42:52 -05:00
thePR0M3TH3AN bc51e2f2e8 Add scheduler relay health preflight gate 2026-02-14 18:36:01 -05:00
thePR0M3TH3AN 9c069f75a6 Add scheduler lock retries for backend failures 2026-02-14 18:29:55 -05:00
thePR0M3TH3AN c38dfe1258 Enrich scheduler lock backend failure logging 2026-02-14 18:23:52 -05:00
google-labs-jules[bot]andPR0M3TH3AN 0f3fd3209f feat: random namespace generation in init
This commit updates the `npx torch-lock init` command to automatically generate a `torch-config.json` file if it doesn't already exist. The generated configuration includes a randomized `nostrLock.namespace` (e.g., `torch-a1b2c3d4`) to ensure unique discovery topics for each installation, preventing message collisions across different repositories.

- Modified `src/ops.mjs` to import `crypto` and implement the config generation logic in `cmdInit`.
- Added a test case in `test/ops.test.mjs` to verify the random namespace generation.
- Uses `torch-config.example.json` as a template.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-14 23:19:25 +00:00
thePR0M3TH3AN 909a7f9541 Strengthen run-artifact verification metadata and issue linkage 2026-02-14 18:05:54 -05:00
thePR0M3TH3AN 26b65f273f Add scheduler handoff runner for selected prompts 2026-02-14 17:38:20 -05:00
thePR0M3TH3AN 5e74287a57 Align scheduler flow docs with runtime behavior 2026-02-14 17:28:31 -05:00
thePR0M3TH3AN c74f81c915 Enforce scheduler memory evidence for daily and weekly 2026-02-14 17:19:22 -05:00
thePR0M3TH3AN d1586228be Add memory rollout feature flags and docs 2026-02-14 15:23:51 -05:00
thePR0M3TH3AN 7cef8242a1 Add memory admin CLI hooks and safe telemetry events 2026-02-14 15:15:15 -05:00
thePR0M3TH3AN 5e609fabe8 feat(memory): inject retrieval context into final prompt rendering 2026-02-14 15:09:34 -05:00
thePR0M3TH3AN 3ddd05017a feat(memory): add distributed-safe maintenance scheduler jobs 2026-02-14 15:05:59 -05:00
thePR0M3TH3AN 106154263c Implement memory pruning lifecycle planning and actions 2026-02-14 15:02:49 -05:00
thePR0M3TH3AN 0236958f63 Implement vector-aware memory retrieval and prompt formatter 2026-02-14 14:59:05 -05:00
thePR0M3TH3AN b8d4d2ac82 Add pluggable memory embedder adapter and vector metadata 2026-02-14 14:55:07 -05:00
thePR0M3TH3AN 3665aa0f4f Add memory prompt templates and robust JSON summarization 2026-02-14 14:51:50 -05:00
thePR0M3TH3AN 8e1ff73cbb Implement batched memory ingestion pipeline with dedupe 2026-02-14 14:48:19 -05:00
thePR0M3TH3AN 3c24b29799 Add scoped runtime memory cache with LRU and metrics 2026-02-14 14:44:07 -05:00
thePR0M3TH3AN 5f9b1a270a Add durable memory schema validation in ingest pipeline 2026-02-14 14:37:28 -05:00
thePR0M3TH3AN cfe7e9ec8e Merge pull request #84 from PR0M3TH3AN/torch-lock-completion-6824629536982484145
feat: add torch-lock complete command for persistent history
2026-02-14 13:52:44 -05:00
google-labs-jules[bot]andPR0M3TH3AN 7a8bab4b1b I have implemented 'torch-lock complete' for persistent task history. This involved adding cmdComplete to src/lib.mjs to handle permanent completion events, updating cmdLock to prevent locking completed tasks, modifying cmdList to show 'done' status, exposing the command in the CLI, and adding the necessary unit tests.
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-14 18:46:04 +00:00
google-labs-jules[bot]andPR0M3TH3AN 433b81d2d3 feat: implement scheduler ratcheting by excluding completed tasks
- 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]>
2026-02-14 18:29:20 +00:00
thePR0M3TH3AN 716b28fddc Merge branch 'main' into unit-tests-lib-mjs-1840636568505209047 2026-02-14 12:10:58 -05:00
thePR0M3TH3AN ef2af6f28e Merge pull request #70 from PR0M3TH3AN/testing/parse-lock-event-6215348514963372273
🧪 Add unit tests for parseLockEvent
2026-02-14 09:32:35 -05:00
thePR0M3TH3AN 8cecca45c1 Merge pull request #66 from PR0M3TH3AN/jules/test-loadTorchConfig-1622753030930324974
🧪 Add unit tests for loadTorchConfig with dependency injection
2026-02-14 09:31:29 -05:00
google-labs-jules[bot]andPR0M3TH3AN 9eda853e7e feat: add unit tests for src/lib.mjs via dependency injection
Refactor src/lib.mjs to support dependency injection for cmdCheck, cmdLock, and cmdList.
This allows unit testing without heavy mocking frameworks or side effects.
Add test/lib.test.mjs covering:
- cmdCheck: happy path, paused/excluded agents, unknown agents.
- cmdLock: success, roster check, existing lock check, race check (lost), dry run.
- cmdList: listing locks, empty state.

Coverage for src/lib.mjs is now significantly improved.
Verification: Ran `npm test` and verified all tests pass.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-14 14:23:03 +00:00
google-labs-jules[bot]andPR0M3TH3AN f931b44732 test: add unit tests for parseLockEvent
Adds comprehensive unit tests for `parseLockEvent` in `src/lock-ops.mjs` (exported via `src/lib.mjs`).
Tests cover:
- Valid event parsing
- Missing d-tag
- Missing expiration tag
- Malformed JSON content
- Non-object JSON content
- Partial JSON content

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-14 14:16:27 +00:00
google-labs-jules[bot]andPR0M3TH3AN 3a48c76a6c Add unit tests for loadTorchConfig with dependency injection
Refactored `loadTorchConfig` to support dependency injection for `fs`, enabling true unit tests without disk I/O. Added comprehensive unit tests in `test/torch-config-unit.test.mjs`.

- Refactored `loadTorchConfig` to accept optional `fileSystem` argument.
- Created `test/torch-config-unit.test.mjs` with mocked fs tests.
- Verified existing tests pass.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-14 14:15:08 +00:00
google-labs-jules[bot]andPR0M3TH3AN 56694d14d2 Verify hardcoded relays are moved and add regression tests
- Verified that `src/lib.mjs` no longer contains hardcoded relay URLs.
- Confirmed `DEFAULT_RELAYS` are defined in `src/constants.mjs` and used in `src/torch-config.mjs`.
- Added regression tests in `test/torch-config.test.mjs` to ensure `getRelays()` correctly falls back to `DEFAULT_RELAYS` and prioritizes environment variables.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-14 14:13:43 +00:00
google-labs-jules[bot]andPR0M3TH3AN 647724bd5b 🧪 Add unit tests for src/torch-config.mjs and refactor for testability
- Extract parseTorchConfig for better isolation in tests.
- Add _resetTorchConfigCache for deterministic unit testing.
- Implement comprehensive tests in test/torch-config.test.mjs covering:
  - Path resolution with env var support.
  - Normalization of cadence and status.
  - Roster parsing and filtering.
  - Error handling for malformed config files.
  - Caching behavior.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-14 13:11:46 +00:00
google-labs-jules[bot]andPR0M3TH3AN b0381b8c39 feat: add init and update commands for user-space configuration
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-14 07:21:05 +00:00
google-labs-jules[bot]andPR0M3TH3AN 35092b3d5a Refactor torch-lock into an installable NPM library and CLI
- Rename `src/nostr-lock.mjs` to `src/lib.mjs` and export core functions.
- Create `bin/torch-lock.mjs` as the CLI entry point.
- Implement `dashboard` command in `src/lib.mjs` to serve the dashboard using Node.js.
- Update `package.json` to configure `bin`, `main`, and `files` for NPM packaging.
- Create `torch-config.example.json` as a template for consumers.
- Update tests and README.md to reflect the new structure.
- Exclude task-specific artifacts (logs, context) from the package while retaining prompts and docs.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-14 06:41:49 +00:00
google-labs-jules[bot]andPR0M3TH3AN 27c30f769a feat: add scheduler pause configuration
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-14 06:01:25 +00:00
google-labs-jules[bot]andPR0M3TH3AN 44919f2ca3 chore(scheduler): run daily test-audit-agent
- Added test script and initial smoke tests
- Generated daily audit report
- Updated scheduler log

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-14 04:59:15 +00:00