Commit Graph
93 Commits
Author SHA1 Message Date
jaredandClaude Opus 5.5 5bca0cd87b CI: Playwright UI tests against a real server, workers and MariaDB
CI / Test (jest) (push) Failing after 57s
CI / Lint (eslint) (push) Successful in 59s
CI / Security (npm audit) (push) Successful in 10s
CI / Lint (eslint) (pull_request) Successful in 28s
CI / Test (jest) (pull_request) Successful in 17s
CI / UI (playwright) (push) Failing after 2m25s
CI / Deploy (push) Skipped
CI / Notify (push) Skipped
CI / UI (playwright) (pull_request) Failing after 1m21s
CI / Deploy (pull_request) Skipped
CI / Notify (pull_request) Skipped
CI / Security (npm audit) (pull_request) Successful in 12s
New required-to-be job `UI (playwright)` (#45 phase 5): the official
Playwright image with a MariaDB service container. scripts/ci/ui-stack.sh
starts the real server and three workers (WORKER_AUTH_ENFORCE=1), then
tests/ui/ runs 30 tests on desktop and a phone viewport:

- every page loads with no page errors, console errors or failed requests
  (enforced by a shared fixture for every test)
- quick commands run on a worker and their output and status show in
  Executions; multi-worker mode; failing commands show as failed
- workflows are created and run from the UI and complete on all workers
- Executions updates live over the authenticated browser WebSocket
- no SSO identity: 401 page and API; wrong group: 403
- every page fits a phone screen

External requests are blocked in tests so SSO headers never leave the
machine. Deploy now also waits for the UI job. The API and execution rate
limits can be raised with PULSE_API_RATE_MAX / PULSE_EXEC_RATE_MAX for
test stacks; production defaults are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 13:37:23 -05:00
jared f97dcc7b2a Merge pull request 'Declare the supported Node version in package.json' (#48) from node-engines into main
CI / Test (jest) (push) Successful in 20s
CI / Security (npm audit) (push) Successful in 8s
CI / Deploy (push) Successful in 14s
CI / Notify (push) Successful in 5s
CI / Lint (eslint) (push) Successful in 21s
deploy-2026.11.22-137
2026-11-22 02:30:36 -05:00
jaredandClaude Opus 5.5 e3d09020cc Declare the supported Node version (>=20) in package.json
CI / Test (jest) (push) Successful in 28s
CI / Lint (eslint) (pull_request) Successful in 13s
CI / Security (npm audit) (push) Successful in 15s
CI / Deploy (push) Skipped
CI / Notify (push) Skipped
CI / Test (jest) (pull_request) Successful in 21s
CI / Deploy (pull_request) Skipped
CI / Notify (pull_request) Skipped
CI / Lint (eslint) (push) Successful in 27s
CI / Security (npm audit) (pull_request) Successful in 20s
CI (setup-node), production (CT 122) and the worker (CT 153) all run Node 20.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 02:29:49 -05:00
jared be6eaad1e9 Merge pull request 'Deploys: exact sha, replay protection, health check and automatic rollback' (#47) from ci-phase2 into main
CI / Security (npm audit) (push) Successful in 19s
CI / Test (jest) (push) Successful in 24s
CI / Deploy (push) Successful in 14s
CI / Notify (push) Successful in 2s
CI / Lint (eslint) (push) Successful in 13s
deploy-2026.11.22-134
2026-11-22 02:27:11 -05:00
jaredandClaude Opus 5.5 cb12fec28c Deploys: exact sha, replay protection, health check and automatic rollback
CI / Test (jest) (push) Successful in 47s
CI / Security (npm audit) (push) Successful in 17s
CI / Deploy (push) Skipped
CI / Notify (push) Skipped
CI / Test (jest) (pull_request) Failing after 12s
CI / Lint (eslint) (pull_request) Successful in 14s
CI / Deploy (pull_request) Skipped
CI / Notify (pull_request) Skipped
CI / Lint (eslint) (push) Successful in 52s
CI / Security (npm audit) (pull_request) Successful in 11s
#45 phase 2.

- GET /healthz (unauthenticated): running git sha, version, database
  reachability, connected workers, uptime. 503 when the database is down.
- deploy/pulse_deploy.sh, versioned for the first time (it only existed
  as a hand-edited file on CT 122). It takes <sha> <ts> from the signed
  webhook payload and:
  - refuses requests older than 5 minutes, or not newer than the last
    accepted one (replays);
  - refuses commits that aren't on main;
  - checks out exactly that sha (before, it deployed whatever main was);
  - runs npm ci --omit=dev (before, npm install --production) and
    restarts;
  - waits for /healthz to report the sha with a working database, and
    otherwise rolls back to the previous commit.
- tests/deploy-script.test.js runs the script in a sandbox (temporary git
  origin, fake systemctl/npm/curl): exact-sha deploy with .env kept, replay,
  stale request, off-main commit, malformed input, and rollback of an
  unhealthy build.
- CI's deploy job now succeeds only once production reports the tested sha
  as healthy, before tagging. Before, it only checked that the server
  answered.
- README: CI/CD and deploy documentation, including installing the script
  and the hooks.json arguments.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 02:25:35 -05:00
jared b10ea154dd Merge pull request 'CI phase 1: one pipeline, deploy gated on lint, test and audit' (#46) from ci-phase1 into main
CI / Lint (eslint) (push) Successful in 19s
CI / Test (jest) (push) Successful in 19s
CI / Security (npm audit) (push) Successful in 9s
CI / Deploy (push) Successful in 34s
CI / Notify (push) Successful in 3s
deploy-2026.11.22-131
2026-11-22 02:20:35 -05:00
jaredandClaude Opus 5.5 6da2d15397 CI: fix dash check matching itself; npm audit fix for production advisories
CI / Test (jest) (push) Successful in 20s
CI / Lint (eslint) (push) Successful in 21s
CI / Security (npm audit) (push) Successful in 10s
CI / Deploy (push) Skipped
CI / Notify (push) Skipped
CI / Lint (eslint) (pull_request) Successful in 21s
CI / Test (jest) (pull_request) Successful in 21s
CI / Deploy (pull_request) Skipped
CI / Notify (pull_request) Skipped
CI / Security (npm audit) (pull_request) Successful in 7s
- The dash check's own pattern contained the literal entities it searches
  for. Use &[mn]dash; so the check doesn't flag itself.
- npm audit fix (lockfile only, no major bumps): proxy-addr 2.0.8
  (critical), body-parser 2.4.0 (high), follow-redirects 1.16.3 (high,
  used by the worker through axios), qs 6.17.1, ip-address. The remaining
  glob/minimatch advisories are moderate, dev-only (jest) and need a
  breaking upgrade, so they stay below the high threshold.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 02:04:26 -05:00
jaredandClaude Opus 5.5 fde2c49eca CI: one pipeline, deploy gated on lint, test and audit
CI / Test (jest) (push) Successful in 1m0s
CI / Security (npm audit) (push) Failing after 10s
CI / Deploy (push) Skipped
CI / Notify (push) Skipped
CI / Lint (eslint) (push) Failing after 56s
The deploy job lived in lint.yml and needed only eslint, while jest and
npm audit ran in separate workflows. A merge that failed its tests still
deployed to production. (#45 phase 1)

- Combine everything into .gitea/workflows/ci.yml with jobs lint, test,
  audit, deploy and notify. Deploy needs all three checks and runs only
  on push to main.
- Builds are reproducible: npm ci everywhere, eslint from the lockfile
  (new `npm run lint`), and setup-node pinned to Node 20 (production).
- Actions are pinned to full commit SHAs, with the version in a comment,
  following tinker_tickets.
- Workflow permissions default to contents: read; only deploy can write
  (for its tag). A deploy-production concurrency group queues deploys
  instead of running two at once. Superseded branch runs are cancelled.
- The deploy payload now carries the sha and a timestamp, so signatures
  differ per deploy (the server verifies them in phase 2). After the
  webhook, CI waits until Pulse is serving again before tagging.
- The Matrix alert now fires for any failed job on main, for the weekly
  audit, and for every successful deploy.
- New lint step: fail on em or en dashes in Pulse-owned files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 02:02:07 -05:00
jared c6f6b3f842 Merge pull request 'Remove em and en dashes from UI text' (#44) from no-dashes-ui into main
Lint / JS (eslint) (push) Successful in 16s
Lint / Notify on failure (push) Skipped
Security / JS Security (npm audit) (push) Failing after 17s
Lint / Deploy (push) Successful in 6s
Test / JS Tests (jest) (push) Successful in 9s
deploy-2026.11.22-125
2026-11-22 01:57:18 -05:00
jaredandClaude Opus 5.5 027dce7fd5 Remove em and en dashes from UI text
Security / JS Security (npm audit) (push) Failing after 23s
Lint / JS (eslint) (push) Successful in 26s
Lint / Notify on failure (push) Skipped
Lint / Deploy (push) Skipped
Security / JS Security (npm audit) (pull_request) Failing after 38s
Lint / JS (eslint) (pull_request) Successful in 42s
Lint / Deploy (pull_request) Skipped
Test / JS Tests (jest) (pull_request) Successful in 28s
Test / JS Tests (jest) (push) Successful in 31s
Lint / Notify on failure (pull_request) Skipped
Replace the remaining dashes users can see:
- error page titles and headings, and the browser tab title: "|" or ":";
- the footer: "PULSE | TDS v1.2";
- the 401 message and two toasts: sentence breaks or a comma;
- the quick-command history and success line: "|";
- empty table cells: "-";
- the compare hint: "2 to 5".

No layout or behaviour changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 01:55:26 -05:00
jared 574e7ecc4f Merge pull request 'Remove em and en dashes from comments, logs, docs and CI' (#43) from no-dashes-internal into main
Lint / JS (eslint) (push) Successful in 16s
Security / JS Security (npm audit) (push) Failing after 15s
Lint / Notify on failure (push) Skipped
Lint / Deploy (push) Successful in 9s
Test / JS Tests (jest) (push) Successful in 12s
deploy-2026.11.22-116
2026-11-22 01:51:00 -05:00
jaredandClaude Opus 5.5 66d5240be0 Remove em and en dashes from comments, logs, docs and CI
Security / JS Security (npm audit) (push) Failing after 15s
Lint / JS (eslint) (push) Successful in 16s
Lint / Notify on failure (push) Skipped
Lint / Deploy (push) Skipped
Lint / JS (eslint) (pull_request) Successful in 13s
Test / JS Tests (jest) (push) Successful in 15s
Lint / Deploy (pull_request) Skipped
Test / JS Tests (jest) (pull_request) Successful in 17s
Security / JS Security (npm audit) (pull_request) Failing after 20s
Lint / Notify on failure (pull_request) Skipped
Replace every em dash and en dash outside user-visible UI text with a
colon, comma, hyphen or "to". The UI strings and the vendored
web_template are handled separately.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 01:50:37 -05:00
jared 8e77c1af0a Merge pull request 'Fail stuck executions, keep worker error details, guard terminal status' (#42) from exec-reliability into main
Security / JS Security (npm audit) (push) Failing after 17s
Lint / JS (eslint) (push) Successful in 17s
Lint / Notify on failure (push) Skipped
Lint / Deploy (push) Successful in 4s
Test / JS Tests (jest) (push) Successful in 11s
deploy-2026.11.22-107
2026-11-22 01:17:44 -05:00
jaredandClaude Opus 5.5 071b4072c2 Fail stuck executions, keep worker error details, guard terminal status
Security / JS Security (npm audit) (push) Failing after 19s
Lint / JS (eslint) (push) Successful in 21s
Lint / Notify on failure (push) Skipped
Lint / Deploy (push) Skipped
Lint / JS (eslint) (pull_request) Successful in 13s
Test / JS Tests (jest) (push) Successful in 18s
Lint / Deploy (pull_request) Skipped
Security / JS Security (npm audit) (pull_request) Failing after 18s
Test / JS Tests (jest) (pull_request) Successful in 15s
Lint / Notify on failure (pull_request) Skipped
Quick, scheduled and Gandalf commands relied entirely on the worker sending
a command_result. If the worker was at capacity, disconnected or restarted,
the execution stayed 'running' forever (#7). Failed commands also lost the
worker's error message (#14).

- Direct commands now get a server-side timeout: the command timeout plus
  30 s. When it expires, the execution fails with a command_result entry
  carrying the error, which the UI already renders and Gandalf treats as
  'failed' and retries.
- When a worker socket closes, every command sent over it fails at once.
  Pending workflow step waits resolve as failures, so the engine moves on.
- Every 5 minutes, a backstop sweep fails 'running' executions past
  EXECUTION_MAX_MINUTES + 10 that nothing is tracking.
- updateExecutionStatus only changes a 'running' execution and reports
  whether it did. A late result, or the engine finishing after an abort,
  can no longer flip a failed execution to completed or fire a second
  webhook.
- Aborting a quick command clears its timeout.
- command_result keeps error, exit_code, signal and timed_out in the log,
  the broadcast and the workflow step result.
- The worker reports "at capacity" as a failed result instead of staying
  silent, and includes exit_code, signal and timed_out on failures.
- Fix: after a worker reconnected, the old socket closing removed the new
  socket's mapping and marked the worker offline, so commands got "Worker
  not connected" until the next heartbeat.

Closes #7
Closes #14

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 01:17:09 -05:00
jared 2e6467d388 Merge pull request 'Authenticate WebSocket connections and bind command results to their worker' (#41) from ws-auth into main
Security / JS Security (npm audit) (push) Failing after 15s
Lint / JS (eslint) (push) Successful in 17s
Lint / Notify on failure (push) Skipped
Test / JS Tests (jest) (push) Successful in 9s
Lint / Deploy (push) Successful in 7s
deploy-2026.11.22-98
2026-11-22 01:09:38 -05:00
jaredandClaude Opus 5.5 ac6c6c72c5 Authenticate WebSocket connections and bind command results to their worker
Security / JS Security (npm audit) (push) Failing after 16s
Lint / JS (eslint) (push) Successful in 18s
Lint / Notify on failure (push) Skipped
Lint / Deploy (push) Skipped
Test / JS Tests (jest) (push) Successful in 15s
Lint / JS (eslint) (pull_request) Successful in 13s
Lint / Deploy (pull_request) Skipped
Security / JS Security (npm audit) (pull_request) Failing after 17s
Test / JS Tests (jest) (pull_request) Successful in 15s
Lint / Notify on failure (pull_request) Skipped
Any client that could reach :8080 got a WebSocket connection. Every
connection started as a browser client and received every broadcast.
worker_connect accepted a missing api_key, so anyone could register under
an existing worker's name and receive its commands. command_result was
accepted from any connection, so execution logs could be forged.

- Classify each upgrade in verifyClient (lib/wsauth.js). A request is:
  - browser: a trusted-proxy Authelia identity in an allowed group;
  - worker: Authorization: Bearer <WORKER_API_KEY>;
  - pending: neither, allowed only while WORKER_AUTH_ENFORCE is off;
  - rejected (401): everything else, and always for a wrong key.
- Only browser connections receive broadcasts. A pending connection may
  send only worker_connect and is closed after 30 s if it doesn't identify.
- worker_connect requires the key. A keyless worker is allowed with a
  warning until WORKER_AUTH_ENFORCE=1, so existing workers keep working
  until they are updated.
- Record which worker each command was sent to. command_result is accepted
  only from that worker (matched by DB id, so a reconnect mid-command
  still works) and only once. pong no longer trusts a client-supplied id.
- Worker, heartbeat and Gandalf keys use a constant-time compare. Log an
  error at startup if WORKER_API_KEY is unset.
- The worker sends its key at the handshake and in worker_connect.

Closes #38

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 01:07:18 -05:00
jared b8a7b2c3b9 Merge pull request 'Only trust Authelia identity headers from TRUSTED_PROXIES' (#39) from trusted-proxy-auth into main
Security / JS Security (npm audit) (push) Failing after 29s
Lint / JS (eslint) (push) Successful in 32s
Lint / Notify on failure (push) Skipped
Lint / Deploy (push) Successful in 20s
Test / JS Tests (jest) (push) Successful in 26s
deploy-2026.11.22-89
2026-11-22 01:03:01 -05:00
jaredandClaude Opus 5.5 e302234187 Only trust Authelia identity headers from TRUSTED_PROXIES
Security / JS Security (npm audit) (push) Failing after 17s
Lint / JS (eslint) (push) Successful in 18s
Lint / Notify on failure (push) Skipped
Lint / Deploy (push) Skipped
Lint / JS (eslint) (pull_request) Successful in 18s
Test / JS Tests (jest) (push) Successful in 20s
Lint / Deploy (pull_request) Skipped
Security / JS Security (npm audit) (pull_request) Failing after 17s
Test / JS Tests (jest) (pull_request) Successful in 17s
Lint / Notify on failure (pull_request) Skipped
authenticateSSO and authenticatePage took the user and groups straight
from the Remote-* headers, and the server listens on every interface, so
any LAN host could connect directly, claim any user and group, and run
commands on the workers. It could also write whatever it claimed into the
users table.

Add TRUSTED_PROXIES (addresses or CIDR ranges) and ignore the identity
headers unless the TCP peer is on the list. The peer address is used
rather than a forwarding header, which a client could forge. It fails
closed: unset means no SSO login succeeds, with a startup warning.
Rejected attempts are logged with their source. Worker and Gandalf
API-key routes are unchanged.

Closes #37

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 01:00:44 -05:00
jared dc47e335aa Fix security job: clear npm audit advisories (jest 30, audit fix); tidy demo scripts
Lint / JS (eslint) (push) Successful in 26s
Lint / Notify on failure (push) Skipped
Security / JS Security (npm audit) (push) Successful in 15s
Test / JS Tests (jest) (push) Successful in 19s
Lint / Deploy (push) Successful in 3s
npm audit --audit-level=high now exits 0. The advisories were in dev-only dependencies (braces via jest 29).
deploy-2026.10.03-73
2026-10-03 16:59:16 -04:00
jared 3572d5ba35 README: add walkthrough GIF, architecture diagram and gallery; add demo seed and capture scripts
Lint / JS (eslint) (push) Successful in 18s
Lint / Notify on failure (push) Skipped
Security / JS Security (npm audit) (push) Failing after 9s
Test / JS Tests (jest) (push) Successful in 9s
Lint / Deploy (push) Successful in 6s
deploy-2026.10.03-70
2026-10-03 01:19:43 -04:00
jared d9f3986198 Declare axios dependency (required by worker/worker.js, was missing from package.json) 2026-10-03 01:19:43 -04:00
jared 68e7108831 Add MIT license
Lint / JS (eslint) (push) Successful in 12s
Lint / Notify on failure (push) Skipped
Security / JS Security (npm audit) (push) Failing after 12s
Test / JS Tests (jest) (push) Successful in 9s
Lint / Deploy (push) Successful in 4s
deploy-2026.10.03-67
2026-10-03 00:16:58 -04:00
jared 3edb2da174 Merge pull request 'fix: handle mysql2 >=3.23 returning JSON columns pre-parsed (Gandalf relay regression)' (#36) from hotfix/mysql2-json-columns into main
Lint / JS (eslint) (push) Successful in 10s
Lint / Notify on failure (push) Skipped
Security / JS Security (npm audit) (push) Successful in 11s
Test / JS Tests (jest) (push) Successful in 12s
Lint / Deploy (push) Successful in 3s
fix: handle mysql2 >=3.23 returning JSON columns pre-parsed (#36)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01HamVMDrA8RqhyxmUHgiqRp
deploy-2026.09.09-61
2026-09-08 22:41:26 -04:00
jaredandClaude Fable 5.1 2173b5ab8f fix: handle mysql2 >=3.23 returning JSON columns pre-parsed
Lint / JS (eslint) (pull_request) Successful in 11s
Lint / Deploy (pull_request) Skipped
Security / JS Security (npm audit) (pull_request) Successful in 10s
Test / JS Tests (jest) (pull_request) Successful in 10s
Lint / JS (eslint) (push) Successful in 11s
Lint / Notify on failure (push) Skipped
Lint / Deploy (push) Skipped
Security / JS Security (npm audit) (push) Successful in 11s
Test / JS Tests (jest) (push) Successful in 11s
Lint / Notify on failure (pull_request) Skipped
mysql2 3.24 (pulled in by the audit fix in #35) returns MariaDB JSON columns as
JS objects. GET /api/internal/executions/:id and GET /api/workflows/:id still
called JSON.parse on the value, threw, and silently returned [] / {}. This broke
Gandalf's relay checks (false 'PBS unreachable' ticket) and the workflow edit
modal. Guard both sites with the same typeof check already used by
GET /api/executions/:id.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HamVMDrA8RqhyxmUHgiqRp
2026-09-08 22:39:59 -04:00
jared e13bdd00d1 Merge pull request 'Redesign the Pulse UI onto the LotusGuild Terminal Design System' (#35) from feature/tds-redesign into main
Lint / JS (eslint) (push) Successful in 11s
Lint / Notify on failure (push) Skipped
Security / JS Security (npm audit) (push) Successful in 16s
Test / JS Tests (jest) (push) Successful in 19s
Lint / Deploy (push) Successful in 4s
Redesign the Pulse UI onto the LotusGuild Terminal Design System (#35)

Closes #2

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01HamVMDrA8RqhyxmUHgiqRp
deploy-2026.09.09-52
2026-09-08 22:23:24 -04:00
jaredandClaude Fable 5.1 1c3a2777c8 chore(deps): npm audit fix — ws 8.21.3, mysql2 3.24.4, qs 6.16.0 (0 vulnerabilities)
Lint / JS (eslint) (push) Successful in 10s
Lint / Notify on failure (push) Skipped
Lint / Deploy (push) Skipped
Lint / JS (eslint) (pull_request) Successful in 10s
Lint / Deploy (pull_request) Skipped
Security / JS Security (npm audit) (push) Successful in 10s
Test / JS Tests (jest) (push) Successful in 10s
Security / JS Security (npm audit) (pull_request) Successful in 10s
Test / JS Tests (jest) (pull_request) Successful in 11s
Lint / Notify on failure (pull_request) Skipped
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HamVMDrA8RqhyxmUHgiqRp
2026-09-08 22:21:47 -04:00
jaredandClaude Fable 5.1 eca5cb45b1 feat(ui): TDS migration stage 3 — integration fixes, legacy removal, docs
Lint / JS (eslint) (pull_request) Successful in 10s
Lint / Deploy (pull_request) Skipped
Security / JS Security (npm audit) (pull_request) Failing after 10s
Test / JS Tests (jest) (pull_request) Successful in 14s
Lint / JS (eslint) (push) Successful in 11s
Lint / Notify on failure (push) Skipped
Lint / Deploy (push) Skipped
Security / JS Security (npm audit) (push) Failing after 11s
Test / JS Tests (jest) (push) Successful in 10s
Lint / Notify on failure (pull_request) Skipped
- Fix design-system class names that do not exist in base.css (.lt-alert--error,
  .lt-form-hint); add shared .lt-modal-lg, .lt-field-error and .is-invalid rules
- Remove public/index.html and the public/base.js symlink
- package.json: start script, correct main
- README: vendored design system, Web UI section, new env vars, read-only dev mode

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HamVMDrA8RqhyxmUHgiqRp
2026-09-08 22:17:15 -04:00
jaredandClaude Fable 5.1 68d0a906a6 feat(ui): TDS migration stage 2 — six page views and page modules
- Dashboard, Workers, Workflows, Executions, Quick Command, Scheduler pages on the
  shared layout, all behaviour via Pulse delegated actions (no inline handlers)
- Executions: server-driven Manual/Automated views, compare mode, detail modal with all
  log types, ?open= deep link, cross-page re-run via sessionStorage
- Workflows: run modal (dry-run available for every workflow), create modal pre-filled
  with the example definition
- Fix EJS comment in page-header partial that broke rendering

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HamVMDrA8RqhyxmUHgiqRp
2026-09-08 21:57:33 -04:00
jaredandClaude Fable 5.1 cbb91a306d feat(ui): TDS migration stage 1 — EJS layout, CSP, vendored design system, shared runtime
- Vendor web_template base.css/base.js (v1.2 bbec859) under public/web_template with sync script
- Add views/layout.ejs (fixed upstream EJS comment delimiters, mobile drawer, cmd palette,
  keys help, WS status, theme toggle) and lib/render.js two-step renderer
- Add page routes for /, /workers, /workflows, /executions, /quick, /scheduler (stub views)
- helmet with strict nonce CSP (script-src-attr 'none'), /csp-report, report-only toggle
- lib/pageauth.js: shared users upsert + HTML 401/403 for page routes
- PULSE_DEV_READONLY guard disabling background writers for local testing
- public/assets/app.js shared runtime (Pulse namespace, delegated actions, WS singleton,
  themed confirm modal) and app.css
- eslint globals for browser files; ignore vendored assets

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HamVMDrA8RqhyxmUHgiqRp
2026-09-08 21:46:24 -04:00
jaredandClaude Sonnet 4.6 53b61249b0 ci: add notify-failure, deploy tagging, and jest coverage
Lint / JS (eslint) (push) Successful in 11s
Test / JS Tests (jest) (push) Successful in 10s
Lint / Notify on failure (push) Has been skipped
Lint / Deploy (push) Successful in 2s
Security / JS Security (npm audit) (push) Successful in 10s
- lint.yml: add notify-failure Matrix alert job; add Tag deployed commit
  step to deploy job with deploy-YYYY.MM.DD-N tagging via Gitea API
- package.json: add --coverage flag to jest test script

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
deploy-2026.04.14-16
2026-04-14 16:25:12 -04:00
jaredandClaude Sonnet 4.6 162ca5f7a7 Add CI badges and CI/CD section to README
Lint / JS (eslint) (push) Successful in 10s
Security / JS Security (npm audit) (push) Successful in 14s
Test / JS Tests (jest) (push) Successful in 13s
Lint / Deploy (push) Successful in 3s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 12:53:48 -04:00
jaredandClaude Sonnet 4.6 f4e44b67a9 Fix ESLint errors in test files and npm vulnerabilities
Lint / JS (eslint) (push) Successful in 11s
Security / JS Security (npm audit) (push) Successful in 10s
Test / JS Tests (jest) (push) Successful in 10s
Lint / Deploy (push) Successful in 3s
- Add tests/.eslintrc.json to declare jest globals (describe/test/expect)
- Fix no-useless-escape in lib/utils.js regex character class
- Run npm audit fix: updated path-to-regexp and qs (1 high, 1 moderate fixed)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 12:41:09 -04:00
jaredandClaude Sonnet 4.6 6e5f18ea58 Add jest test suite, extract pure utils module, fix cron-parser v5 API
Lint / JS (eslint) (push) Failing after 12s
Security / JS Security (npm audit) (push) Failing after 13s
Test / JS Tests (jest) (push) Successful in 13s
Lint / Deploy (push) Has been skipped
- Extract validateWebhookUrl, applyParams, evalCondition, calculateNextRun
  to lib/utils.js so they can be tested without DB connection
- Fix cron-parser v5 API: parseExpression → CronExpressionParser.parse
- Add 31 jest tests covering all four utility functions
- Add test.yml CI workflow running jest on every push/PR
- Add jest devDependency

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 12:24:30 -04:00
jaredandClaude Sonnet 4.6 0a677d69a8 Add npm audit security scanning workflow
Lint / JS (eslint) (push) Successful in 8s
Security / JS Security (npm audit) (push) Failing after 7s
Lint / Deploy (push) Successful in 2s
Scans npm dependencies weekly and on every push/PR for high+ severity issues.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 11:26:10 -04:00
jaredandClaude Sonnet 4.6 1110804662 Add deploy gating to CI pipeline
Lint / JS (eslint) (push) Successful in 9s
Lint / Deploy (push) Successful in 4s
- Add deploy job gated on js-lint passing
- Deploy triggers pulse-deploy webhook on main branch only

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 10:14:35 -04:00
jaredandClaude Sonnet 4.6 1b0ea8b648 ci: use --ext .js . instead of explicit file paths
Lint / JS (eslint) (push) Successful in 8s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 00:18:32 -04:00
jaredandClaude Sonnet 4.6 1d33e261dc ci: use explicit file paths in ESLint command instead of directory globs
Lint / JS (eslint) (push) Failing after 15s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 00:13:11 -04:00
jaredandClaude Sonnet 4.6 d523b6d02a ci: add ESLint lint workflow with per-directory configs
Lint / JS (eslint) (push) Failing after 8s
Node.js env for server.js/worker/, browser env for public/.
All errors downgraded to warnings (empty blocks, inner declarations,
loose equality, useless escape, constant condition) for practical CI.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-13 23:46:46 -04:00
jaredandClaude Sonnet 4.6 0990e5b807 Add parse/route step types, wider modal, automated link troubleshooter
- Add 'parse' step type: reads KEY=VALUE lines from last command output into execution state
- Add 'route' step type: evaluates JS conditions list, auto-jumps to first match with no user input
- Support condition field on parse steps (skip when conditional execute was also skipped)
- Widen execution detail modal to min(1100px, 96vw) to eliminate horizontal scrolling
- Show last command output in prompt boxes so user has context before clicking
- Add formatLogEntry support for parse_complete and route_taken log actions
- Apply applyParams() substitution to prompt messages ({{server_name}}, {{iface}}, etc.)
- Fix prompt button onclick using data-opt attribute to avoid JSON double-quote breakage

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 19:29:28 -04:00
jaredandClaude Sonnet 4.6 2290d52f8b Fix prompt buttons, add command output to prompt steps, add worker to repo
- Fix onclick buttons broken by JSON.stringify double-quotes inside HTML
  attributes — use data-opt attribute + this.dataset.opt instead
- Track last command stdout in execution state when command_result arrives
- executePromptStep: include last command output in log entry and broadcast
  so users can review results alongside the question in the same view
- GET /api/executions/🆔 propagate output field to pending prompt response
- Add .prompt-output CSS class for scrollable terminal-style output block
- Fix MariaDB CAST(? AS JSON) → JSON_EXTRACT(?, '$') (MariaDB 10.11 compat)
- Add worker/worker.js to repo (deployed on pulse-worker-01 / LXC 153)
  Fix: worker was not echoing command_id back in result — resolvers always
  got undefined, causing every workflow step to timeout and fail

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 19:06:02 -04:00
jaredandClaude Sonnet 4.6 3f6e04d1ab Apply LotusGuild design system convergence (aesthetic_diff.md)
- §5: Section headers now ╠═══ TITLE ═══╣ (was ═══ TITLE ═══)
- §8+§18: Replace inline-style showTerminalNotification() with lt.toast.*
  delegate wrapper; load base.js from /base.js
- §12: Fix --text-muted #008822→#00bb33 (WCAG AA contrast)

base.js symlinked from web_template into public/ so lt.* is available.
showTerminalNotification() is kept as a thin wrapper so all existing
call sites continue to work unchanged.

README: Remove completed pending items (toast, text-muted, position)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-14 21:40:36 -04:00
jaredandClaude Sonnet 4.6 18a6b642d1 Fix all-workers-offline silent success bug, noisy logging, UX polish
server.js:
- Fix bug: when all targeted workers disconnect before step runs, results[] was empty
  and results.every() returned true vacuously (silent false success). Now tracks sentCount
  and fails with 'no_workers' log if nothing was actually dispatched
- Remove per-message console.log on every WebSocket message (high noise)
- Only log a warning for failed commands (not every success)

index.html:
- loadSchedules() catch now shows error message in scheduleList (was silent)
- abortExecution() shows server's error message from JSON body instead of generic string
  (e.g. "Execution is not running" instead of "Failed to abort execution")

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 13:48:35 -04:00
jaredandClaude Sonnet 4.6 8ff3700601 Fix XSS, add per-step timeout/retry to workflow engine
index.html:
- Escape started_by in execution list, execution cards, and execution detail modal
- Escape schedule name in schedules list

server.js:
- Per-step timeout: step.timeout (seconds) overrides global COMMAND_TIMEOUT_MS (5s-600s range)
- Per-step retry: step.retries (max 5) with step.retryDelayMs (max 30s) re-sends command on failure
  with command_retry log entries showing attempt/max_retries progress

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-12 17:36:35 -04:00
jaredandClaude Sonnet 4.6 ba5ba6f899 Security and reliability fixes: XSS, race conditions, logging
- Fix XSS in workflow list: escape name/description/created_by with escapeHtml()
- Fix broadcast() race: snapshot browserClients Set before iterating
- Fix waitForCommandResult: use position-based matching (worker omits command_id in result)
- Fix scheduler duplicate-run race: atomic UPDATE with affectedRows check
- Suppress toast alerts for automated executions (gandalf:/scheduler: prefix)
- Add waiting_for_input + prompt fields to GET /executions/:id
- Add GET /api/workflows/:id endpoint
- Add interactive prompt UI: respondToPrompt(), WebSocket execution_prompt handler
- Add workflow editor modal (admin-only)
- Remove sensitive console.log calls (WS payload, command output)
- Show error messages in list containers on load failure
- evalCondition: log warning instead of silently swallowing errors
- Worker reconnect: clean up stale entries for same dbWorkerId
- Null-check execState before continuing workflow steps

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-12 17:30:32 -04:00
jaredandClaude Sonnet 4.6 a596c6075c Fix ESC handler, form reset, and scheduler next-run countdown
- Fix ESC key handler to use .modal.show class selector instead of style.display check
- Reset create workflow form fields when opening the create modal
- Show relative countdown (e.g. "in 5m") alongside next run timestamp in scheduler list

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-12 11:26:48 -04:00
jaredandClaude Sonnet 4.6 95f6554cc2 Frontend improvements: safety, UX, and WebSocket handling
- Guard all new Date().toLocaleString() calls with safeDate() to prevent 'Invalid Date'
- Guard escapeHtml() for null/undefined input
- Guard getTimeAgo() for null/NaN dates; add safeDate() and formatElapsed() helpers
- Show elapsed time for running executions in the execution list
- Add status-running CSS pulse animation class to running execution items
- Add explicit executions_bulk_deleted WebSocket handler
- clearCompletedExecutions() uses new bulk DELETE endpoint instead of N individual requests
- switchTab() persists active tab to localStorage; init restores it on load
- refreshData() updates lastRefreshed timestamp in header
- Add Ctrl+Enter shortcut for quick command form
- Wrap rerunCommand worker_id with escapeHtml() to prevent XSS

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-12 11:24:34 -04:00
jaredandClaude Sonnet 4.6 ba75a61bd2 Security hardening, bug fixes, and backend improvements
Security:
- validateWebhookUrl() rejects non-http/https and private/internal IPs
- Validate webhook URL on workflow create and update
- Replace error.message in all HTTP 500 responses with 'Internal server error'
- Add requireJSON middleware (HTTP 415 if Content-Type wrong) on POST/PUT routes
- Reject missing API keys in worker heartbeat (not just wrong ones)
- Validate prompt response against allowed options before accepting

Bugs fixed:
- goto infinite loop protection: stepVisits[] counter, fails at GOTO_MAX_VISITS (100)
- wait step: validate duration (no NaN/negative), cap at WAIT_STEP_MAX_MS (24h)
- _executionPrompts now stores {resolve, options} for option validation
- JSON.parse wrapped in try/catch: workflows/:id, executions/:id, internal/executions/:id, POST /api/executions, scheduler worker_ids
- pong handler uses ws.dbWorkerId (set on connect) not message.worker_id
- Worker disconnect now marks worker offline in DB and broadcasts update
- command validation (type + empty check) on POST /api/workers/:id/command
- workflow_id required check on POST /api/executions

Performance & reliability:
- markStaleWorkersOffline() runs every 60s, marks workers without recent heartbeat offline
- Named constants: PROMPT_TIMEOUT_MS, COMMAND_TIMEOUT_MS, QUICK_CMD_TIMEOUT_MS,
  WEBHOOK_TIMEOUT_MS, WAIT_STEP_MAX_MS, GOTO_MAX_VISITS, WORKER_STALE_MINUTES

New features:
- GET /api/health (auth required): version, uptime, worker counts
- DELETE /api/executions/completed: bulk delete finished executions (admin)
- schedule_value positive-integer validation for interval/hourly schedule types
- Request logging middleware: [HTTP] METHOD /path STATUS Xms

Code quality:
- All console.log on error paths changed to console.error
- Removed stray debug console.log in POST /api/workflows

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-12 10:59:07 -04:00
jaredandClaude Sonnet 4.6 658caa9f7e Fix bracket wrapping to new lines via inline-flex on buttons
The CSS ::before/::after pseudo-elements for [ ] brackets were rendering
on separate lines because button HTML had multiline whitespace (newlines +
indentation) inside the tag, causing:
  [
    Button Text
  ]

Fix: set button display to inline-flex with align-items:center so
pseudo-elements become flex children that stay on the same line
as button content regardless of internal whitespace. Also add
white-space:nowrap and flex-shrink:0 on pseudo-elements.

Also fix compareBtn.style.display to use inline-flex to avoid
reverting to block-level display that would re-introduce wrapping.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 23:27:00 -04:00
jaredandClaude Sonnet 4.6 af63fbb1de Fix remaining [[ ]] double-bracket bugs on Templates, History, and sub-tab buttons
- Remove manual [ ] from sub-tab buttons (Manual Runs, Automated)
- Add CSS to suppress button::before/after pseudo-elements on .tab
  buttons and border:none inline-styled buttons so they don't get
  double-bracketed
- Prevents [[ text ]] from appearing on Templates/History/sub-tabs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 23:23:58 -04:00
jaredandClaude Sonnet 4.6 d7b26c2b70 Fix [[ ]] visual bug and add missing log type handlers
Root cause: CSS button::before/after adds [ ] universally, but many
buttons had hardcoded [ text ] content, producing [[ text ]].

- Strip manual [ ] wrappers from all button text in HTML and JS
- Fix JS textContent assignments for compare mode buttons
- Fix dynamic button HTML strings in execution details panel
- Add formatLogEntry handlers for previously unhandled action types:
  dry_run_skipped, execution_timeout, goto_error, step_error,
  workflow_result, params, server_restart_recovery
- Unknown log actions now show action name instead of raw JSON
- Add cron schedule type display in schedules list

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 23:18:18 -04:00