Commit Graph
29 Commits
Author SHA1 Message Date
google-labs-jules[bot]andPR0M3TH3AN 426b3221b5 chore(ai): document src/lib.mjs
- Added JSDoc to all exported functions in src/lib.mjs
- Added detailed flow comments for cmdLock and cmdComplete
- Created docs/lib-overview.md with high-level architectural documentation
- Created src/context/CONTEXT_2026-02-14T21-30-00Z.md
- Updated task-logs/daily/ with completion record

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-14 22:09:48 +00:00
thePR0M3TH3AN 7cef8242a1 Add memory admin CLI hooks and safe telemetry events 2026-02-14 15:15:15 -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
google-labs-jules[bot]andPR0M3TH3AN 6d072448e3 Fix torch-lock init command and update landing page instructions
- Fix multiple syntax errors in `src/lib.mjs` (redundant declarations, broken loops, missing imports).
- Fix syntax error in `src/dashboard.mjs` (invalid catch block).
- Remove redundant local function definitions in `src/lib.mjs` in favor of imports from `src/torch-config.mjs` and `src/utils.mjs`.
- Update `landing/index.html` installation command to include `npx torch-lock init` step.
- Verify `torch-lock init` works correctly.
- Ensure all tests pass and linting is clean for `src/lib.mjs`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-14 17:45:21 +00:00
thePR0M3TH3AN ec31a64736 Merge pull request #62 from PR0M3TH3AN/perf-async-dashboard-io-5891481615082085195
⚡ Replace Blocking Sync I/O in HTTP Request Handler
2026-02-14 12:12:16 -05:00
thePR0M3TH3AN d46aa0b449 Merge branch 'main' into refactor/valid-cadences-7741695179358615025 2026-02-14 12:12:02 -05:00
thePR0M3TH3AN e15ba3fe42 Merge pull request #71 from PR0M3TH3AN/refactor/constants-kind-app-data-17267465416565685977
Refactor magic number 30078 to KIND_APP_DATA constant
2026-02-14 12:11:50 -05:00
thePR0M3TH3AN 716b28fddc Merge branch 'main' into unit-tests-lib-mjs-1840636568505209047 2026-02-14 12:10:58 -05:00
thePR0M3TH3AN bcea60fbee Merge pull request #76 from PR0M3TH3AN/perf-optimize-lock-filtering-15960706450530800656
⚡ Optimize lock filtering with Set lookups
2026-02-14 12:10:36 -05:00
thePR0M3TH3AN cc1df8d304 Merge pull request #61 from PR0M3TH3AN/fix-empty-catch-blocks-17156965692183891029
🧹 improve observability by adding console.debug to empty catch blocks
2026-02-14 12:07:34 -05:00
thePR0M3TH3AN 279e39273b Merge branch 'main' into fix-dashboard-binding-9664858879592007216 2026-02-14 12:06:13 -05:00
google-labs-jules[bot]andPR0M3TH3AN 0a7f64d1dc Refactor lock filtering to use Set lookups instead of linear scans
Optimized `cmdCheck` and `cmdList` in `src/lib.mjs` by replacing O(N*M) linear scans with O(N) Set lookups.
- Introduced `rosterSet` and `excludedAgentsSet` to replace `Array.includes()` calls with `Set.has()`.
- Benchmark showed ~99% performance improvement (from ~280ms to ~2ms for 10k agents and 2k locks).
- Verified with existing tests and custom benchmark.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-14 14:26:25 +00: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 02e96d49be Refactor magic number 30078 to KIND_APP_DATA constant
- Added KIND_APP_DATA to src/constants.mjs
- Updated src/lib.mjs, src/lock-ops.mjs, and dashboard/index.html to use the constant
- Added missing src files to package.json files list
- Updated build.mjs to copy src/constants.mjs to dist/src/

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-14 14:16:44 +00:00
google-labs-jules[bot]andPR0M3TH3AN fdfbb39da6 Decompose src/lib.mjs
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-14 14:16:01 +00:00
google-labs-jules[bot]andPR0M3TH3AN c94ff84da8 Refactor src/lib.mjs to use VALID_CADENCES constant
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-14 14:15:55 +00:00
google-labs-jules[bot]andPR0M3TH3AN b044570f72 ⚡ optimize: replace blocking sync I/O in dashboard request handler
Converted the dashboard HTTP request handler to an async function and replaced synchronous `fs.existsSync` and `fs.statSync` calls with non-blocking `fs.promises.stat`. This improves server responsiveness and concurrency by ensuring the event loop is not blocked during file system checks.

Also added robust error handling to the asynchronous handler to prevent unhandled promise rejections and ensure consistent 500 responses on internal errors.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-14 13:56:15 +00:00
google-labs-jules[bot]andPR0M3TH3AN 983ad0627b 🧹 improve observability by adding console.debug to empty catch blocks
Replaced empty catch blocks in `loadCanonicalRoster` and `parseLockEvent`
with `console.debug` statements that log the error message. This
improves observability of failures while maintaining the graceful
fallback behavior.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-14 13:55:21 +00:00
google-labs-jules[bot]andPR0M3TH3AN c275b452be security: bind dashboard server to 127.0.0.1
Explicitly bind the dashboard server to the local loopback interface
to prevent external access. This addresses a vulnerability where
the server was binding to all network interfaces by default.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-14 13:52:27 +00:00
thePR0M3TH3AN e67d8441a4 Merge pull request #58 from PR0M3TH3AN/agents/daily/decompose-agent-v1-14520720754219938139
[decompose] Extract modules from src/lib.mjs
2026-02-14 08:51:26 -05:00
google-labs-jules[bot]andPR0M3TH3AN 581dc3484e [decompose] extract modules from src/lib.mjs
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-14 13:18:07 +00:00
google-labs-jules[bot]andPR0M3TH3AN 9716fe3812 perf: parallelize daily/weekly lock queries in list command
- Modified `src/lib.mjs` to execute `queryLocks` for all cadences in parallel.
- Added `scripts/perf-benchmark.mjs` for measuring CLI performance.
- Added `weekly-perf-report-2026-02-14.md` with baseline and verification data.
- Added `task-logs/weekly/2026-02-14T13-14-38Z__perf-deepdive-agent__completed.md`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-14 13:17:27 +00:00
thePR0M3TH3AN c731f2b09d Merge pull request #53 from PR0M3TH3AN/agents/weekly/fuzz-agent-1863848784432453944
fuzz-agent: fix parseLockEvent crash on null content
2026-02-14 07:51:03 -05:00
google-labs-jules[bot]andPR0M3TH3AN 36cd585fba fuzz-agent: fix parseLockEvent crash on null content
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-14 08:57:47 +00:00
google-labs-jules[bot]andPR0M3TH3AN d165c06640 feat: extract DEFAULT_DASHBOARD_PORT and RACE_CHECK_DELAY_MS to src/constants.mjs
- Created src/constants.mjs
- Updated src/lib.mjs to use constants
- Added execution artifacts and completed log

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-14 07:33:51 +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