- 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]>
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]>
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]>
- 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]>
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]>
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]>
- 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]>
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]>
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]>
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]>
- 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]>
- 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]>
- 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]>
- Created src/constants.mjs
- Updated src/lib.mjs to use constants
- Added execution artifacts and completed log
Co-authored-by: PR0M3TH3AN <[email protected]>
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]>
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]>
- 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]>
Implemented the missing scripts required by the audit-agent:
- `scripts/check-file-size.mjs`: Checks for files exceeding 300 lines.
- `scripts/check-innerhtml.mjs`: Checks for `innerHTML` usage.
- Added `npm run lint` script using ESLint with a basic configuration.
- Added `eslint` and related dependencies.
This unblocks the audit-agent daily schedule.
Co-authored-by: PR0M3TH3AN <[email protected]>
- Created `assets/logo.svg` with a new gradient flame design.
- Created `assets/favicon.svg` based on the logo.
- Updated `build.mjs` to copy `assets/` to `dist/` and adjust paths in `landing/index.html`.
- Updated `landing/index.html` to use the new logo and favicon.
- Updated `dashboard/index.html` to include the new logo and favicon.
Co-authored-by: PR0M3TH3AN <[email protected]>
- Attempted to run audit-agent.
- Failed because `scripts/check-file-size.mjs`, `scripts/check-innerhtml.mjs`, and `npm run lint` are missing.
- Created `artifacts/audit/2026-02-14/summary.md` documenting the failure.
- Created `task-logs/daily/2026-02-14T06-04-19Z__audit-agent__failed.md`.
- Added execution context in `src/context/`, `src/todo/`, `src/decisions/`, `src/test_logs/`.
Co-authored-by: PR0M3TH3AN <[email protected]>
- Adds a "Completed only" option to the dashboard status filter.
- Updates filtering logic to distinguish between "Active" (running) and "Completed" (finished) tasks.
- Adds new utility classes `.bg-success/5` and `.border-success` to `styles.css`.
- Applies green tint and success border to completed task cards.
Co-authored-by: PR0M3TH3AN <[email protected]>
- Create `src/prompts/weekly/prompt-safety-agent.md` to audit other prompts for failure modes.
- Add `prompt-safety-agent` to `src/prompts/roster.json` in the weekly schedule.
Co-authored-by: PR0M3TH3AN <[email protected]>
- Added `src/prompts/weekly/ui-ux-agent.md` to define the agent's role, mission, and workflow.
- Updated `src/prompts/roster.json` to include `ui-ux-agent` in the weekly schedule.
This agent is responsible for improving web design, accessibility, marketing copy, and maintaining style guides.
Co-authored-by: PR0M3TH3AN <[email protected]>
This agent analyzes the repository and proposes new, self-contained features
as single files in a `features/` directory, aimed at incrementally adding
value to the project.
Co-authored-by: PR0M3TH3AN <[email protected]>
Add a new agent prompt `log-fixer-agent.md` to `src/prompts/daily/` and
register it in `src/prompts/roster.json`. This agent is responsible for
monitoring task logs for failures and attempting to automatically fix
underlying errors (syntax, dependencies, tests) or creating issues for
complex problems.
Co-authored-by: PR0M3TH3AN <[email protected]>
- Update `platformStyle` in `dashboard/index.html` to be case-insensitive and handle aliases (e.g., 'Claude' -> 'claude-code').
- Update summary statistics to use the normalized label for consistency.
- Ensure platforms like "Jules", "Codex", and "Claude" are displayed correctly instead of "Unknown".
Co-authored-by: PR0M3TH3AN <[email protected]>
Separate filter initialization from connection logic to prevent resetting user preferences on refresh.
Add socket cleanup and manual close handling to prevent duplicate connections and incorrect relay counts.
Co-authored-by: PR0M3TH3AN <[email protected]>
- Added `build.mjs` to bundle `landing`, `dashboard`, and `docs` into a `dist/` directory.
- Updated `package.json` with a `build` script (`node build.mjs`).
- Updated `.gitignore` to ignore the `dist/` directory.
- Patched `landing/index.html` paths in the build output to correctly reference resources when deployed from `dist/` root.
Co-authored-by: PR0M3TH3AN <[email protected]>
- Created `landing/` directory with `index.html`.
- Implemented a modern landing page design matching the `dashboard/` style.
- Added a custom SVG Torch logo.
- Integrated `marked.js` to fetch and render `src/docs/TORCH.md` in a modal.
- Linked to the existing dashboard.
Co-authored-by: PR0M3TH3AN <[email protected]>