Commit Graph
304 Commits
Author SHA1 Message Date
thePR0M3TH3AN 3ba727ec37 Merge pull request #64 from PR0M3TH3AN/refactor/verify-hardcoded-relays-6138275059730299152
🧹 Verify and test relay configuration logic
2026-02-14 09:30:31 -05:00
thePR0M3TH3AN 2b3ab0b25b Merge pull request #72 from PR0M3TH3AN/perf-dashboard-async-io-14696213848673958258
⚡ Optimize dashboard static file serving with async I/O
2026-02-14 09:29:41 -05:00
thePR0M3TH3AN a8f5560f66 Merge pull request #63 from PR0M3TH3AN/refactor/remove-async-ops-8265010904332540873
🧹 Refactor cmdInit and cmdUpdate to be synchronous
2026-02-14 09:29:17 -05:00
thePR0M3TH3AN 4c15736b99 Merge pull request #75 from PR0M3TH3AN/perf/torch-timeout-fix-10089523949735471707
perf(torch): fix 15s delay in lock queries by clearing timeout
2026-02-14 09:28:57 -05:00
thePR0M3TH3AN 832c0c5273 Merge pull request #68 from PR0M3TH3AN/agents/daily/decompose-lib-16890511323530322542
Decompose src/lib.mjs
2026-02-14 09:28:30 -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 af9b7e8f42 perf(torch): fix 15s delay in lock queries by clearing timeout
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-14 14:25:09 +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 0448ed2932 Optimize dashboard static file serving with async I/O
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-14 14:18:59 +00:00
google-labs-jules[bot]andPR0M3TH3AN cd7b19ead7 Optimize dashboard static file serving with async I/O
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-14 14:16:52 +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 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 6fdc092441 refactor: make exclusions in check scripts configurable
Refactor `scripts/check-file-size.mjs` and `scripts/check-innerhtml.mjs` to use `node:util.parseArgs` for parsing command-line arguments. This allows users to configure directory and file exclusions via `--exclude-dir`, `--exclude-file`, and `--no-defaults`, instead of relying on hardcoded lists.

This change improves versatility while maintaining backward compatibility by keeping the original hardcoded lists as defaults. It also adds support for `--max-lines` in `check-file-size.mjs` and `--help` in both scripts.

Verification:
- Manually verified that both scripts respect the new flags and defaults.
- Confirmed that `--report` mode still works as expected.
- Confirmed that unknown flags (like `--update`) are safely ignored (due to `strict: false`).

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-14 14:16:23 +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 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 758d3c3c56 Refactor ensureDir to remove redundant existence check
- Remove explicit `fs.existsSync` check in `ensureDir`.
- Rely on `fs.mkdirSync(dir, { recursive: true })` idempotency.
- Verified with existing tests in `test/ops.test.mjs`.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-14 14:13:58 +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 eee6dfa09f Refactor cmdInit and cmdUpdate to be synchronous
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-14 14:12:20 +00:00
thePR0M3TH3AN 695adb6dc9 Merge pull request #59 from PR0M3TH3AN/add-prompt-maintenance-agent-1170306418559251314
Add prompt-maintenance-agent and clean up obsolete agents
2026-02-14 08:57:33 -05: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
thePR0M3TH3AN 23ad1adafb Merge pull request #57 from PR0M3TH3AN/agents/weekly/perf-deepdive-agent-11478179249338404241
perf: parallelize daily/weekly lock queries in list command
2026-02-14 08:51:08 -05:00
google-labs-jules[bot]andPR0M3TH3AN c63a4d6ea9 feat: add prompt-maintenance-agent and remove obsolete agents
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-14 13:25:56 +00: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 0969642ccc Merge pull request #56 from PR0M3TH3AN/torch-config-tests-10463068599140780508
🧪 Add unit tests for src/torch-config.mjs
2026-02-14 08:11:56 -05: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
thePR0M3TH3AN e25d6dead2 Merge pull request #55 from PR0M3TH3AN/agents/daily/content-audit-agent-9033644365328554051
docs: daily content audit (no content found)
2026-02-14 08:10:45 -05:00
thePR0M3TH3AN 0ed73a505b Merge pull request #54 from PR0M3TH3AN/agents/weekly/interop-agent-fail-6399779466283884134
docs(log): interop-agent failure
2026-02-14 08:06:41 -05:00
google-labs-jules[bot]andPR0M3TH3AN 1d81e9f629 docs: daily content audit (no content found)
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-14 13:05:57 +00:00
google-labs-jules[bot]andPR0M3TH3AN b9be5e3f69 docs(log): interop-agent failure
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-14 13:05:17 +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
thePR0M3TH3AN ebc06a750a Update README.md 2026-02-14 02:40:24 -05:00
thePR0M3TH3AN 15fa2ca48c Merge pull request #52 from PR0M3TH3AN/vibecoded-ack-warning-4053325878855849352
Add acknowledgement warning to install copy button
2026-02-14 02:39:58 -05:00
google-labs-jules[bot]andPR0M3TH3AN ac7ba2a895 feat: add required acknowledgement warning to install copy button
- Adds a modal to `landing/index.html` warning users about the "freshly vibecoded" nature of the project.
- Intercepts the "Install via NPM" copy button to require acknowledgement before copying.
- Styles the modal with a danger theme consistent with the warning.
- Verified with Playwright.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-14 07:39:31 +00:00
thePR0M3TH3AN d4c8cbc09e Merge pull request #51 from PR0M3TH3AN/agents/daily/const-refactor-agent-12982252024698456252
[scheduler] Execute const-refactor-agent: extract constants
2026-02-14 02:35:17 -05: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
thePR0M3TH3AN 14002a7bf9 Merge pull request #50 from PR0M3TH3AN/feat/user-space-config-9557152361478859216
feat: add init and update commands for user-space configuration
2026-02-14 02:23:47 -05: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
thePR0M3TH3AN 7381c6a159 Merge pull request #49 from PR0M3TH3AN/landing-install-cta-1544657332540691520
Add npm install CTA to landing page
2026-02-14 02:16:54 -05:00
google-labs-jules[bot]andPR0M3TH3AN c7e48e6b69 feat(landing): add npm install command section
Adds a stylized 'Install via NPM' code block with a copy button to the landing page, positioned between the hero and features sections.

- Updates landing/index.html with new HTML structure and CSS styles.
- Refactors copyToClipboard function to preserve button innerHTML (icon support).

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-14 07:14:46 +00:00
thePR0M3TH3AN cff3fc17aa Merge pull request #48 from PR0M3TH3AN/fix-package-files-assets-9242804250688267257
Include assets/ in npm package for dashboard
2026-02-14 01:54:48 -05:00
google-labs-jules[bot]andPR0M3TH3AN 126ca22dfc fix(package): include assets/ directory in npm package
The dashboard requires `assets/` (favicon.svg, logo.svg) to be present.
Previously, `package.json`'s `files` array excluded `assets/`, causing missing images in the installed package.
This commit adds `assets/` to the whitelist.

Tested by packing and installing in a clean environment.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-14 06:53:50 +00:00
thePR0M3TH3AN 05d266f423 Merge pull request #47 from PR0M3TH3AN/refactor/package-lock-cli-5466133525514174614
Refactor torch-lock into an installable NPM library and CLI
2026-02-14 01:42:23 -05: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
thePR0M3TH3AN f7c56fe6f9 Merge pull request #46 from PR0M3TH3AN/chore/update-agent-prompts-policy-read-9423933926600717575
Standardize agent prompts to read policy files
2026-02-14 01:32:44 -05:00