Commit Graph
100 Commits
Author SHA1 Message Date
jaredandClaude Opus 5.5 8698e1a4b0 Test: stub os.freemem in the availableMemory fallback test (it flaked)
CI / Scan (secrets, workflows, shell) (pull_request) Successful in 1m54s
CI / Deploy worker (pull_request) Skipped
CI / Lint (eslint) (pull_request) Successful in 32s
CI / UI screenshots (before/after) (pull_request) Successful in 10s
CI / UI (playwright) (pull_request) Successful in 2m15s
CI / Deploy (pull_request) Skipped
CI / Test (jest) (pull_request) Successful in 33s
CI / Integration (api) (pull_request) Successful in 2m30s
CI / Notify (pull_request) Skipped
CI / Security (npm audit) (pull_request) Successful in 12s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 12:18:49 -05:00
jaredandClaude Opus 5.5 cb2c7a10fd Docs: correct setup, workflow and scheduler reference, env vars, schema (#28)
CI / Scan (secrets, workflows, shell) (pull_request) Successful in 1m49s
CI / Deploy worker (pull_request) Skipped
CI / Lint (eslint) (pull_request) Successful in 25s
CI / UI screenshots (before/after) (pull_request) Successful in 17s
CI / UI (playwright) (pull_request) Successful in 1m52s
CI / Deploy (pull_request) Skipped
CI / Test (jest) (pull_request) Failing after 23s
CI / Integration (api) (pull_request) Successful in 2m24s
CI / Notify (pull_request) Skipped
CI / Security (npm audit) (pull_request) Successful in 10s
- Server setup: npm ci, .env from .env.example, /healthz check; no
  SECRET_KEY (nothing reads it).
- Worker setup was wrong (worker.js lives in worker/, and the deps come
  from the root manifests): copy worker.js plus package.json and
  package-lock.json, npm ci --omit=dev, .env from worker/.env.example;
  updates then come through the worker deploy hook.
- Workflows: replaces "Future Feature" with a reference for every step
  type and field, the condition language, params, goto/end, dry run,
  abort, webhooks and the time limit, with a worked example. New
  Scheduler section.
- Environment variables: complete tables for server and worker,
  including GANDALF_API_KEY, EXECUTION_MAX_MINUTES, HOST, rate limits.
- Database schema: the real tables and columns, scheduled_commands
  included.
- Troubleshooting: stuck executions now fail on their own; how to clear.
- Removed the stale "Recent Updates" and "Future Enhancements" lists.
- .env.example and worker/.env.example; package.json license is MIT, like
  LICENSE.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 12:11:45 -05:00
jaredandClaude Opus 5.5 789e5651c8 Worker memory: report available memory, not free memory (#30)
CI / Scan (secrets, workflows, shell) (pull_request) Successful in 1m54s
CI / Deploy worker (pull_request) Skipped
CI / Lint (eslint) (pull_request) Successful in 21s
CI / UI (playwright) (pull_request) Successful in 2m15s
CI / Deploy (pull_request) Skipped
CI / UI screenshots (before/after) (pull_request) Successful in 2m29s
CI / Test (jest) (pull_request) Successful in 19s
CI / Integration (api) (pull_request) Successful in 2m36s
CI / Notify (pull_request) Skipped
CI / Security (npm audit) (pull_request) Successful in 11s
os.freemem() leaves out the page cache, so a healthy Linux box looks full:
the production worker (CT 153, 512 MB) has 4 MB free but 449 MB
available, and showed as 99% used instead of about 12%.

- worker: heartbeat metadata adds availableMem from MemAvailable in
  /proc/meminfo (falls back to os.freemem()); freeMem stays for old
  servers.
- Workers tab and dashboard compute used memory from availableMem when
  present, from freeMem for workers that predate it.
- Unit tests for the meminfo parsing and the fallback.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 11:55:25 -05:00
jaredandClaude Opus 5.5 39d28fb9e7 Executions: show runs waiting on a prompt; Automated tab filters on the server (#3, #4)
CI / Lint (eslint) (pull_request) Successful in 29s
CI / Scan (secrets, workflows, shell) (pull_request) Successful in 1m48s
CI / Deploy worker (pull_request) Skipped
CI / UI (playwright) (pull_request) Successful in 2m6s
CI / Deploy (pull_request) Skipped
CI / UI screenshots (before/after) (pull_request) Successful in 2m28s
CI / Test (jest) (pull_request) Successful in 24s
CI / Integration (api) (pull_request) Successful in 2m32s
CI / Notify (pull_request) Skipped
CI / Security (npm audit) (pull_request) Successful in 12s
- #3: the list response includes waiting_for_input for each execution
  (a running execution blocked on a prompt). The row shows it as
  'waiting' (the design system's purple status) and the Waiting status
  filter, which could never match, now finds it.
- #4: new only_internal=true filter (Gandalf and scheduler runs), used by
  the Automated tab, so it pages and counts on the server like the Manual
  tab; the client-side filter over one shared page is gone.
- Tests: integration for waiting_for_input and both server filters; UI
  for the waiting status and the filter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 11:38:22 -05:00
jaredandClaude Opus 5.5 6ffe230c34 Rate limits per user, and coalesce live-event reloads (#10)
CI / Scan (secrets, workflows, shell) (pull_request) Successful in 1m42s
CI / Deploy worker (pull_request) Skipped
CI / Lint (eslint) (pull_request) Successful in 23s
CI / UI (playwright) (pull_request) Successful in 2m35s
CI / Deploy (pull_request) Skipped
CI / UI screenshots (before/after) (pull_request) Successful in 2m13s
CI / Test (jest) (pull_request) Successful in 23s
CI / Integration (api) (pull_request) Successful in 4m23s
CI / Notify (pull_request) Skipped
CI / Security (npm audit) (pull_request) Successful in 1m17s
Production refused 1,052 of the UI's requests with 429 in one day: every
user arrives through the reverse proxy, so the per-IP limiter put the
whole team in one bucket, and each open page reloaded its whole list on
every live event (about two per Gandalf command).

- lib/ratelimit.js keys both limiters: a trusted SSO identity gets
  user:<name>, a request with the valid Gandalf key gets 'gandalf' (an
  invalid key falls back to the IP, so nobody can drain Gandalf's bucket),
  everything else the IP. The API default goes from 300 to 1000 per
  15 min per bucket.
- Pulse.util.throttle: live-event reloads on Executions, Dashboard and
  Workers run at most once per 2 s (at once when idle, then once at the end
  of the window). User actions still reload immediately.
- Unit tests for the keys. No visual change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 11:26:06 -05:00
jaredandClaude Opus 5.5 61991841aa CI: mariadb.sh avoids the unreachable Azure apt mirror and retries apt
CI / Lint (eslint) (pull_request) Successful in 29s
CI / Scan (secrets, workflows, shell) (pull_request) Successful in 3m7s
CI / Deploy worker (pull_request) Skipped
CI / UI screenshots (before/after) (pull_request) Successful in 11s
CI / UI (playwright) (pull_request) Successful in 2m2s
CI / Deploy (pull_request) Skipped
CI / Test (jest) (pull_request) Successful in 27s
CI / Integration (api) (pull_request) Successful in 4m4s
CI / Notify (pull_request) Skipped
CI / Security (npm audit) (pull_request) Successful in 24s
The Playwright image's apt sources point at azure.archive.ubuntu.com, which
timed out from the runner after it moved nodes; the UI job failed at Start
MariaDB twice. Switch to archive.ubuntu.com and retry apt up to 3 times.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 02:10:22 -05:00
jaredandClaude Opus 5.5 f140b380fb CI: build branches through their pull request only; pushes build main
CI / Scan (secrets, workflows, shell) (pull_request) Successful in 2m18s
CI / Deploy worker (pull_request) Skipped
CI / Lint (eslint) (pull_request) Successful in 17s
CI / UI (playwright) (pull_request) Failing after 1m32s
CI / UI screenshots (before/after) (pull_request) Successful in 8s
CI / Deploy (pull_request) Skipped
CI / Test (jest) (pull_request) Successful in 24s
CI / Integration (api) (pull_request) Successful in 3m59s
CI / Notify (pull_request) Skipped
CI / Security (npm audit) (pull_request) Successful in 51s
Every PR branch ran the whole pipeline twice (push and pull_request),
doubling the runner queue. Required checks move to the (pull_request)
contexts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 01:58:33 -05:00
jaredandClaude Opus 5.5 6d289a3bce Tests: fix two CI flakes seen on main
CI / Lint (eslint) (pull_request) Successful in 27s
CI / Scan (secrets, workflows, shell) (pull_request) Successful in 3m50s
CI / Deploy worker (pull_request) Skipped
CI / Test (jest) (push) Successful in 1m15s
CI / Security (npm audit) (push) Successful in 27s
CI / Deploy (push) Skipped
CI / Deploy worker (push) Skipped
CI / UI screenshots (before/after) (pull_request) Successful in 10s
CI / UI (playwright) (pull_request) Successful in 2m39s
CI / Deploy (pull_request) Skipped
CI / UI (playwright) (push) Successful in 2m38s
CI / Notify (push) Skipped
CI / Test (jest) (pull_request) Successful in 1m4s
CI / Integration (api) (pull_request) Successful in 4m18s
CI / Notify (pull_request) Skipped
CI / Lint (eslint) (push) Successful in 1m20s
CI / Integration (api) (push) Successful in 3m42s
CI / Scan (secrets, workflows, shell) (push) Successful in 3m11s
CI / Security (npm audit) (pull_request) Successful in 39s
CI / UI screenshots (before/after) (push) Skipped
- calculateNextRun interval: bounded by the clock before and after the
  call (its first use loads cron-parser, which took 30 s once on a loaded
  runner and broke the fixed 1 s tolerance).
- Integration helper: retry a GET once when a pooled keep-alive connection
  is reset (ECONNRESET as the server closes it); writes are never retried.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 00:57:53 -05:00
jaredandClaude Opus 5.5 b5af336338 Register a prompt's pending answer before announcing it
CI / Scan (secrets, workflows, shell) (pull_request) Successful in 3m35s
CI / Test (jest) (push) Successful in 1m41s
CI / Deploy worker (pull_request) Skipped
CI / Security (npm audit) (push) Successful in 52s
CI / Deploy (push) Skipped
CI / Deploy worker (push) Skipped
CI / Lint (eslint) (pull_request) Successful in 51s
CI / UI (playwright) (pull_request) Failing after 11m39s
CI / Deploy (pull_request) Skipped
CI / UI screenshots (before/after) (pull_request) Successful in 35s
CI / UI (playwright) (push) Successful in 2m18s
CI / Notify (push) Skipped
CI / Integration (api) (pull_request) Successful in 3m51s
CI / Scan (secrets, workflows, shell) (push) Successful in 2m57s
CI / Test (jest) (pull_request) Successful in 48s
CI / Notify (pull_request) Skipped
CI / Integration (api) (push) Successful in 3m6s
CI / UI screenshots (before/after) (push) Skipped
CI / Security (npm audit) (pull_request) Successful in 51s
CI / Lint (eslint) (push) Successful in 40s
An answer arriving between the 'prompt' log entry and the registration got
'No pending prompt' (404); CI hit it under load on main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 00:36:22 -05:00
jared 986791ae20 Merge remote-tracking branch 'origin/main' into backend-bugs
CI / Test (jest) (push) Successful in 39s
CI / Security (npm audit) (push) Successful in 21s
CI / Deploy (push) Canceled after 0s
CI / Deploy worker (push) Canceled after 0s
CI / Scan (secrets, workflows, shell) (pull_request) Canceled after 0s
CI / Deploy worker (pull_request) Canceled after 0s
CI / UI (playwright) (push) Canceled after 0s
CI / Lint (eslint) (pull_request) Canceled after 0s
CI / Notify (push) Canceled after 0s
CI / UI (playwright) (pull_request) Canceled after 0s
CI / UI screenshots (before/after) (pull_request) Canceled after 0s
CI / Deploy (pull_request) Canceled after 0s
CI / Lint (eslint) (push) Successful in 35s
CI / Integration (api) (push) Canceled after 3m54s
CI / Scan (secrets, workflows, shell) (push) Canceled after 3m18s
CI / Test (jest) (pull_request) Canceled after 0s
CI / Integration (api) (pull_request) Canceled after 0s
CI / Notify (pull_request) Canceled after 0s
CI / UI screenshots (before/after) (push) Skipped
CI / Security (npm audit) (pull_request) Canceled after 0s
2026-11-23 00:27:00 -05:00
jaredandClaude Opus 5.5 397f4dd778 Worker: keepalive, reconnect backoff, no crash loop at startup (#1, #29)
- #1: the worker pings the server every 30 s over the WebSocket; if the
  previous ping got no pong, the connection is dead (server restart or
  network drop without a close) and is terminated so it reconnects. The
  ws server answers pings itself, so the server needs no change.
- #29: reconnects back off from 1 s doubling to 60 s with up to 20%
  jitter, reset on a successful connection; a failed first heartbeat is
  logged and retried instead of exiting into a systemd crash loop.
- stop() no longer schedules a reconnect.
- Tests: backoff bounds, missed pong terminates, pong keeps, startup with
  an unreachable server (unit and end to end). The #6 test now waits for
  the worker to show offline before sending one command.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 00:08:35 -05:00
jaredandClaude Opus 5.5 d517cae7e6 Fix orphaned quick commands, prompt timeouts and worker delete (#6, #21, #34)
- #6: a quick command to a disconnected worker is refused before an
  execution is recorded, instead of leaving one stuck in 'running'.
- #21: an unanswered prompt fails the execution (prompt_timeout) instead
  of continuing as if someone had chosen; prompt and wait steps never
  wait past the execution's deadline, and a wait cut short by it fails
  with execution_timeout. PULSE_PROMPT_TIMEOUT_MS (minimum 1 s, default
  60 min) lets the test stack use 8 s.
- #34: deleting a connected worker is a 409 explaining it would
  re-register on its next heartbeat; offline workers delete as before.

Tests for each (integration 45/45).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 00:04:06 -05:00
jaredandClaude Opus 5.5 073114c92e Abort kills the command on the worker (#8 follow-up)
- worker: commands run with spawn in their own process group (same
  timeout, 10 MB output limit and result fields as exec). A new
  cancel_command message (by command_id, or every command of an
  execution) sends SIGTERM to the group, then SIGKILL after 5 s; the
  result reports cancelled: true. Old workers ignore the message.
- server: the abort route sends cancel_command to the worker running each
  of the execution's commands.
- Tests: the whole process tree dies on cancel (a background child too),
  execution-wide cancel leaves other executions alone, and end to end an
  aborted quick command's process is gone from the worker. Liveness
  checks treat zombies as dead (an orphan waits to be reaped).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:59:50 -05:00
jaredandClaude Opus 5.5 dc732a1ec5 Fix abort, missing goto, offline schedules and the cron 500 (#8, #20, #9)
CI / Test (jest) (push) Successful in 32s
CI / Security (npm audit) (push) Successful in 15s
CI / Scan (secrets, workflows, shell) (pull_request) Successful in 7m1s
CI / Deploy worker (pull_request) Skipped
CI / Deploy (push) Skipped
CI / Deploy worker (push) Skipped
CI / Lint (eslint) (pull_request) Successful in 1m12s
CI / UI screenshots (before/after) (pull_request) Successful in 28s
CI / UI (playwright) (pull_request) Successful in 4m41s
CI / Deploy (pull_request) Skipped
CI / UI (playwright) (push) Successful in 3m41s
CI / Notify (push) Skipped
CI / Integration (api) (push) Successful in 4m4s
CI / Scan (secrets, workflows, shell) (push) Successful in 3m26s
CI / Test (jest) (pull_request) Successful in 1m11s
CI / Integration (api) (pull_request) Successful in 7m41s
CI / Notify (pull_request) Skipped
CI / UI screenshots (before/after) (push) Skipped
CI / Lint (eslint) (push) Successful in 24s
CI / Security (npm audit) (pull_request) Successful in 23s
The four known-bug tests from #59 now pass as normal tests.

- #8 abort: each workflow execution gets an AbortController. The abort
  route fires it; the engine checks it before every step and stops; wait
  steps, retry delays and waits for a worker's result end as soon as it
  fires. New test: aborting during a 20 s command stops the workflow
  within seconds and runs no further step.
- #20 goto to a missing step: the execution now fails (it reported
  completed). Workflows are also checked on save: a goto, route or prompt
  route to a step id that doesn't exist is a 400 ('end' is always valid).
  A workflow saved before the check still fails at runtime (tested by
  writing one directly).
- #9 schedules whose worker is offline: instead of skipping silently, the
  scheduler records a failed run ('Worker offline: the scheduled command
  was not sent'), visible in Executions.
- An invalid cron expression (or any bad schedule) is a 400 with the
  parser's message instead of a 500.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:54:32 -05:00
jaredandClaude Opus 5.5 2793053108 CI: install python3-venv with the other scanners (zizmor runs before semgrep)
CI / Test (jest) (push) Successful in 40s
CI / Security (npm audit) (push) Successful in 12s
CI / Lint (eslint) (pull_request) Successful in 40s
CI / Deploy (push) Skipped
CI / Deploy worker (push) Skipped
CI / Scan (secrets, workflows, shell) (pull_request) Successful in 4m1s
CI / Deploy worker (pull_request) Skipped
CI / Scan (secrets, workflows, shell) (push) Successful in 1m46s
CI / UI (playwright) (push) Successful in 2m58s
CI / Notify (push) Skipped
CI / UI (playwright) (pull_request) Successful in 2m52s
CI / UI screenshots (before/after) (pull_request) Successful in 3m19s
CI / Deploy (pull_request) Skipped
CI / Lint (eslint) (push) Successful in 41s
CI / Integration (api) (push) Successful in 1m59s
CI / Test (jest) (pull_request) Successful in 36s
CI / Integration (api) (pull_request) Successful in 2m56s
CI / Notify (pull_request) Skipped
CI / UI screenshots (before/after) (push) Skipped
CI / Security (npm audit) (pull_request) Successful in 11s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:54:14 -05:00
jaredandClaude Opus 5.5 235d9240c0 CI: eslint-plugin-security and zizmor; harden the workflow
CI / Test (jest) (push) Successful in 22s
CI / Security (npm audit) (push) Successful in 14s
CI / Lint (eslint) (pull_request) Successful in 17s
CI / Deploy (push) Skipped
CI / Deploy worker (push) Skipped
CI / Scan (secrets, workflows, shell) (pull_request) Failing after 14s
CI / Deploy worker (pull_request) Skipped
CI / Scan (secrets, workflows, shell) (push) Failing after 18s
CI / UI (playwright) (push) Successful in 3m0s
CI / Notify (push) Skipped
CI / UI (playwright) (pull_request) Successful in 2m16s
CI / Deploy (pull_request) Skipped
CI / UI screenshots (before/after) (pull_request) Successful in 2m18s
CI / Lint (eslint) (push) Successful in 23s
CI / Integration (api) (push) Successful in 2m43s
CI / Test (jest) (pull_request) Successful in 18s
CI / Integration (api) (pull_request) Successful in 2m24s
CI / Notify (pull_request) Skipped
CI / UI screenshots (before/after) (push) Skipped
CI / Security (npm audit) (pull_request) Successful in 13s
- eslint-plugin-security 4.2.1 (recommended-legacy) with
  detect-object-injection off (it flags every obj[key]) and file/regex
  rules off for CI scripts and tests. The remaining hits were false
  positives with a one-line reason each (fixed page names, the worker's
  own directory, a null check), plus one real tidy-up: the condition
  tokenizer's number regex is now two flat patterns with no backtracking,
  and malformed numbers like 1.2.3 are refused.
- zizmor 1.32.0 in the Scan job. Its findings are fixed:
  persist-credentials: false on every checkout (no job pushes), container
  images pinned by digest (tag kept in the reference), and the deploy tag
  step takes github.* values through env instead of template expansion.
  Left as is: secrets-outside-env (auditor persona; Gitea has no
  deployment environments).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:45:35 -05:00
jaredandClaude Opus 5.5 c890d5c078 Workers tab: show the commit each worker runs (#40)
CI / Test (jest) (push) Successful in 17s
CI / Security (npm audit) (push) Successful in 18s
CI / Deploy (push) Skipped
CI / Deploy worker (push) Skipped
CI / Scan (secrets, workflows, shell) (pull_request) Successful in 1m33s
CI / Deploy worker (pull_request) Skipped
CI / Lint (eslint) (pull_request) Successful in 22s
CI / UI (playwright) (push) Successful in 2m14s
CI / Notify (push) Skipped
CI / UI (playwright) (pull_request) Successful in 2m28s
CI / Deploy (pull_request) Skipped
CI / UI screenshots (before/after) (pull_request) Successful in 2m43s
CI / Scan (secrets, workflows, shell) (push) Successful in 2m1s
CI / Integration (api) (push) Successful in 2m34s
CI / Test (jest) (pull_request) Successful in 22s
CI / Integration (api) (pull_request) Successful in 2m23s
CI / Notify (pull_request) Skipped
CI / UI screenshots (before/after) (push) Skipped
CI / Lint (eslint) (push) Successful in 16s
CI / Security (npm audit) (pull_request) Successful in 18s
A Version row on each worker card: the short sha linked to the commit in
Gitea, or 'unknown' for a worker that doesn't report one. Updated live
with the rest of the card. Playwright checks all three test workers show
the checkout's HEAD.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:23:56 -05:00
jaredandClaude Opus 5.5 bf7e91cc57 CI: Pulse's own semgrep rules, with tests
CI / Test (jest) (push) Successful in 26s
CI / Security (npm audit) (push) Successful in 18s
CI / Scan (secrets, workflows, shell) (pull_request) Successful in 1m37s
CI / Deploy (push) Skipped
CI / Deploy worker (push) Skipped
CI / Deploy worker (pull_request) Skipped
CI / Lint (eslint) (pull_request) Successful in 42s
CI / UI (playwright) (push) Successful in 2m30s
CI / UI screenshots (before/after) (pull_request) Successful in 6s
CI / Notify (push) Skipped
CI / UI (playwright) (pull_request) Successful in 1m59s
CI / Deploy (pull_request) Skipped
CI / Scan (secrets, workflows, shell) (push) Successful in 2m13s
CI / Integration (api) (push) Successful in 2m24s
CI / Test (jest) (pull_request) Successful in 23s
CI / Integration (api) (pull_request) Successful in 1m54s
CI / Notify (pull_request) Skipped
CI / UI screenshots (before/after) (push) Skipped
CI / Security (npm audit) (pull_request) Successful in 8s
CI / Lint (eslint) (push) Successful in 18s
.semgrep/pulse.yml, run in the Scan job next to the registry packs:
- pulse-no-vm: no require('vm'), eval or new Function outside tests (the
  workflow-condition bug from #62 can't come back).
- pulse-no-shell-in-server: server.js and lib/ may not use exec/execSync
  or spawn with a shell; running commands is the worker's job.
- pulse-innerhtml-unescaped: member values (w.name, r.host) inserted into
  innerHTML in public/assets must go through esc()/Pulse.esc(); method
  names, comparisons, Set.has() and the fmt formatters are not values.

The rules' test cases (.semgrep/pulse.js) run first with semgrep --test,
so a rule that stops matching fails CI. Pulse has no findings today.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:02:00 -05:00
jaredandClaude Opus 5.5 db1f71aa4c CI: timeout-minutes on every job
CI / Test (jest) (push) Successful in 52s
CI / Security (npm audit) (push) Successful in 18s
CI / Deploy (push) Skipped
CI / Deploy worker (push) Skipped
CI / Scan (secrets, workflows, shell) (pull_request) Successful in 1m53s
CI / Deploy worker (pull_request) Skipped
CI / Lint (eslint) (pull_request) Successful in 22s
CI / UI (playwright) (push) Successful in 2m29s
CI / Notify (push) Skipped
CI / UI screenshots (before/after) (pull_request) Successful in 11s
CI / UI (playwright) (pull_request) Successful in 1m56s
CI / Deploy (pull_request) Skipped
CI / Scan (secrets, workflows, shell) (push) Successful in 2m12s
CI / Integration (api) (push) Successful in 2m31s
CI / Test (jest) (pull_request) Successful in 26s
CI / Integration (api) (pull_request) Successful in 2m41s
CI / Notify (pull_request) Skipped
CI / UI screenshots (before/after) (push) Skipped
CI / Lint (eslint) (push) Successful in 56s
CI / Security (npm audit) (pull_request) Successful in 14s
A Test (jest) job sat in npm ci for over 20 minutes; with no timeout a
hung step holds main's queue until the runner's own limit (hours).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 22:45:58 -05:00
jaredandClaude Opus 5.5 040ad028c0 Safer workflow conditions; Pulse is admin-only
CI / Test (jest) (push) Successful in 25s
CI / Security (npm audit) (push) Successful in 21s
CI / Lint (eslint) (pull_request) Successful in 24s
CI / Deploy (push) Skipped
CI / Deploy worker (push) Skipped
CI / Scan (secrets, workflows, shell) (pull_request) Successful in 2m46s
CI / Deploy worker (pull_request) Skipped
CI / Scan (secrets, workflows, shell) (push) Successful in 2m0s
CI / UI (playwright) (push) Successful in 2m6s
CI / Notify (push) Skipped
CI / UI screenshots (before/after) (pull_request) Successful in 27s
CI / UI (playwright) (pull_request) Successful in 3m5s
CI / Deploy (pull_request) Skipped
CI / Lint (eslint) (push) Successful in 25s
CI / Integration (api) (push) Successful in 2m23s
CI / Test (jest) (pull_request) Successful in 32s
CI / Integration (api) (pull_request) Successful in 2m13s
CI / Notify (pull_request) Skipped
CI / UI screenshots (before/after) (push) Skipped
CI / Security (npm audit) (pull_request) Successful in 39s
- Workflow conditions (step.condition and route `if`) are now parsed and
  interpreted by lib/condition.js instead of being run with Node's vm
  module. The language covers what workflows use: state/params lookups,
  parseInt/parseFloat/Number/String/Boolean, a few string methods, the
  usual operators with JavaScript semantics. Conditions can only read the
  workflow's own data. Every condition in the production workflows gives
  the same result as before (differential test, 150 random states each).
- Creating and updating a workflow rejects conditions that don't parse
  (400 with the step and the error).
- Creating a workflow requires admin, like editing already did.
- Only the admin group may use Pulse (pages, API and live WebSocket);
  employees get 403. Gandalf and workers use API keys and are unaffected.
- The live-update UI test finds its execution's row by id instead of
  counting rows (the list is capped at 50).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 22:05:42 -05:00
jaredandClaude Opus 5.5 a34867af92 Integration tests for the workflow engine and the scheduler
CI / Test (jest) (push) Successful in 18s
CI / Security (npm audit) (push) Successful in 9s
CI / Deploy (push) Skipped
CI / Deploy worker (push) Skipped
CI / Scan (secrets, workflows, shell) (pull_request) Successful in 1m24s
CI / Deploy worker (pull_request) Skipped
CI / Lint (eslint) (pull_request) Successful in 16s
CI / UI (playwright) (push) Successful in 1m39s
CI / Notify (push) Skipped
CI / UI screenshots (before/after) (pull_request) Successful in 6s
CI / UI (playwright) (pull_request) Successful in 2m21s
CI / Deploy (pull_request) Skipped
CI / Scan (secrets, workflows, shell) (push) Successful in 2m2s
CI / Integration (api) (push) Successful in 2m31s
CI / Test (jest) (pull_request) Successful in 15s
CI / Integration (api) (pull_request) Successful in 1m51s
CI / Notify (pull_request) Skipped
CI / UI screenshots (before/after) (push) Skipped
CI / Lint (eslint) (push) Successful in 17s
CI / Security (npm audit) (pull_request) Successful in 7s
- workflows.int.js (11): all-worker execute, failure stops the workflow,
  parse to route, false conditions skip, prompts (invalid option refused,
  routes on the answer), params (required, substituted, unsafe refused),
  dry run, endless goto detection, abort stays failed.
- scheduler.int.js (5): a due schedule runs on its worker and advances
  next_run; disabled schedules don't run; admin-only and input checks.
- Known bugs as test.failing (each verified to fail on its assertion):
  abort doesn't stop the engine (#8), goto to a missing step completes
  (#20), an offline worker's schedule leaves no trace (#9), and an invalid
  cron expression returns 500 instead of 400.
- PULSE_SCHEDULER_TICK_MS (default 60 s, minimum 1 s) so the test stack
  ticks the scheduler every second.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 21:50:58 -05:00
jaredandClaude Opus 5.5 783d6db160 README: document the runner IP allowlist on the deploy hooks
CI / Test (jest) (push) Successful in 19s
CI / Security (npm audit) (push) Successful in 15s
CI / Deploy (push) Skipped
CI / Deploy worker (push) Skipped
CI / Scan (secrets, workflows, shell) (pull_request) Successful in 2m7s
CI / Deploy worker (pull_request) Skipped
CI / Lint (eslint) (pull_request) Successful in 21s
CI / UI (playwright) (push) Successful in 1m47s
CI / Notify (push) Skipped
CI / UI screenshots (before/after) (pull_request) Successful in 9s
CI / UI (playwright) (pull_request) Successful in 1m44s
CI / Deploy (pull_request) Skipped
CI / Lint (eslint) (push) Successful in 22s
CI / Integration (api) (push) Successful in 1m30s
CI / Scan (secrets, workflows, shell) (push) Successful in 1m39s
CI / Test (jest) (pull_request) Successful in 14s
CI / Integration (api) (pull_request) Successful in 1m59s
CI / Notify (pull_request) Skipped
CI / UI screenshots (before/after) (push) Skipped
CI / Security (npm audit) (pull_request) Successful in 7s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 21:02:53 -05:00
jaredandClaude Opus 5.5 9980663f83 CI: retry npm audit on registry errors only
CI / Scan (secrets, workflows, shell) (pull_request) Successful in 1m48s
CI / Test (jest) (push) Successful in 16s
CI / Security (npm audit) (push) Successful in 8s
CI / Deploy worker (pull_request) Skipped
CI / Deploy (push) Skipped
CI / Deploy worker (push) Skipped
CI / Lint (eslint) (pull_request) Successful in 21s
CI / UI screenshots (before/after) (pull_request) Successful in 6s
CI / UI (playwright) (pull_request) Successful in 2m5s
CI / Deploy (pull_request) Skipped
CI / UI (playwright) (push) Successful in 1m43s
CI / Notify (push) Skipped
CI / Test (jest) (pull_request) Successful in 17s
CI / Integration (api) (pull_request) Successful in 1m23s
CI / Lint (eslint) (push) Successful in 19s
CI / Notify (pull_request) Skipped
CI / Integration (api) (push) Successful in 1m23s
CI / Scan (secrets, workflows, shell) (push) Successful in 1m53s
CI / UI screenshots (before/after) (push) Skipped
CI / Security (npm audit) (pull_request) Successful in 7s
The registry's audit endpoint returned a spurious 400 ('Invalid package
tree') on an unchanged lockfile; the same commit passed minutes later.
Real advisories still fail at once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 20:27:48 -05:00
jaredandClaude Opus 5.5 41480bf30a Deploy worker: trigger on worker/ or the lockfile, not package.json scripts
CI / Test (jest) (push) Successful in 16s
CI / Security (npm audit) (push) Failing after 36s
CI / Lint (eslint) (pull_request) Successful in 17s
CI / Deploy (push) Skipped
CI / Deploy worker (push) Skipped
CI / Scan (secrets, workflows, shell) (pull_request) Successful in 1m13s
CI / Deploy worker (pull_request) Canceled after 0s
CI / UI (playwright) (push) Successful in 1m46s
CI / Notify (push) Skipped
CI / UI (playwright) (pull_request) Successful in 1m34s
CI / UI screenshots (before/after) (pull_request) Successful in 5s
CI / Deploy (pull_request) Canceled after 0s
CI / Lint (eslint) (push) Successful in 15s
CI / Integration (api) (push) Successful in 1m48s
CI / Scan (secrets, workflows, shell) (push) Successful in 1m46s
CI / Test (jest) (pull_request) Successful in 15s
CI / Integration (api) (pull_request) Canceled after 7m16s
CI / Notify (pull_request) Canceled after 0s
CI / UI screenshots (before/after) (push) Skipped
CI / Security (npm audit) (pull_request) Successful in 8s
A lint script change in package.json restarted the worker for nothing.
Every dependency change also changes package-lock.json, so that is enough.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 20:17:15 -05:00
jaredandClaude Opus 5.5 74eb525413 CI phase 5: stricter eslint, design system integrity check, PR screenshots
CI / Security (npm audit) (push) Successful in 42s
CI / Test (jest) (push) Successful in 45s
CI / Deploy (push) Skipped
CI / Deploy worker (push) Skipped
CI / Scan (secrets, workflows, shell) (pull_request) Successful in 2m1s
CI / Deploy worker (pull_request) Skipped
CI / Lint (eslint) (pull_request) Successful in 14s
CI / UI (playwright) (push) Successful in 2m20s
CI / Notify (push) Skipped
CI / UI screenshots (before/after) (pull_request) Successful in 13s
CI / UI (playwright) (pull_request) Successful in 1m52s
CI / Deploy (pull_request) Skipped
CI / Integration (api) (push) Successful in 2m21s
CI / Scan (secrets, workflows, shell) (push) Successful in 2m35s
CI / Lint (eslint) (push) Successful in 20s
CI / Test (jest) (pull_request) Successful in 24s
CI / Integration (api) (pull_request) Successful in 1m45s
CI / Notify (pull_request) Skipped
CI / UI screenshots (before/after) (push) Skipped
CI / Security (npm audit) (pull_request) Successful in 25s
- eslint: errors for ==, unused or shadowed variables, eval and friends,
  prefer-const, curly, throw literals, useless catch/escape, constant
  conditions (loops allowed), unused expressions (short-circuit allowed);
  --max-warnings 0. Fixed the few violations (two unused requires in
  server.js, a shadowed mock argument in a test).
- Scan job: scripts/ci/check-web-template.sh fails if public/web_template
  differs from upstream at the commit in its VERSION (change it upstream,
  then scripts/sync-web-template.sh).
- New job UI screenshots (before/after), PRs only, when public/, views/
  or the render/nav code changed: runs the base branch and the PR side by
  side with the same seeded data and uploads one before/after image per
  page, desktop and phone (scripts/ci/screenshots.js). Not required.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 20:04:02 -05:00
jaredandClaude Opus 5.5 16a127a6fd UI test: build the dash pattern from char codes so the file passes the dash check
CI / Test (jest) (push) Successful in 27s
CI / Security (npm audit) (push) Successful in 11s
CI / Lint (eslint) (pull_request) Successful in 16s
CI / Deploy (push) Skipped
CI / Deploy worker (push) Skipped
CI / Scan (secrets, workflows, shell) (pull_request) Successful in 1m41s
CI / Deploy worker (pull_request) Skipped
CI / Scan (secrets, workflows, shell) (push) Successful in 1m30s
CI / UI (playwright) (push) Successful in 1m57s
CI / Notify (push) Skipped
CI / UI (playwright) (pull_request) Successful in 1m42s
CI / Deploy (pull_request) Skipped
CI / Lint (eslint) (push) Successful in 28s
CI / Integration (api) (push) Successful in 1m13s
CI / Test (jest) (pull_request) Successful in 21s
CI / Integration (api) (pull_request) Successful in 1m14s
CI / Notify (pull_request) Skipped
CI / Security (npm audit) (pull_request) Successful in 8s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 19:33:28 -05:00
jaredandClaude Opus 5.5 599a62f010 Resync the vendored design system (dash-free upstream) and check it too
CI / Test (jest) (push) Successful in 24s
CI / Security (npm audit) (push) Successful in 7s
CI / Lint (eslint) (pull_request) Failing after 18s
CI / Deploy (push) Skipped
CI / Deploy worker (push) Skipped
CI / Scan (secrets, workflows, shell) (pull_request) Successful in 2m19s
CI / Deploy worker (pull_request) Skipped
CI / UI (playwright) (push) Successful in 2m9s
CI / Notify (push) Skipped
CI / UI (playwright) (pull_request) Successful in 1m34s
CI / Deploy (pull_request) Skipped
CI / Lint (eslint) (push) Failing after 44s
CI / Integration (api) (push) Successful in 1m13s
CI / Scan (secrets, workflows, shell) (push) Successful in 2m21s
CI / Test (jest) (pull_request) Successful in 18s
CI / Integration (api) (pull_request) Successful in 2m23s
CI / Notify (pull_request) Skipped
CI / Security (npm audit) (pull_request) Successful in 29s
public/web_template is now web_template 8286bb2, which removed every em
and en dash (web_template#3, approved with screenshots). Pulse's copy was
byte-identical to the previous upstream bbec859, so the only changes are
upstream's: hyphens in comments, '-' for empty values in lt.fmt, and
'ALL SYSTEMS NOMINAL: PULSE' / offline banner and toast rewording.

- The CI dash check no longer excludes public/web_template.
- UI tests: no page renders an em or en dash; the boot screen reads
  'ALL SYSTEMS NOMINAL: PULSE'.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 19:23:12 -05:00
jaredandClaude Opus 5.5 ea939d4430 Worker deploys from CI, with version reporting (#40)
CI / Test (jest) (push) Successful in 18s
CI / Security (npm audit) (push) Successful in 12s
CI / Deploy (push) Skipped
CI / Deploy worker (push) Skipped
CI / Scan (secrets, workflows, shell) (pull_request) Successful in 2m20s
CI / Deploy worker (pull_request) Skipped
CI / Lint (eslint) (pull_request) Successful in 19s
CI / UI (playwright) (push) Successful in 1m43s
CI / Notify (push) Skipped
CI / UI (playwright) (pull_request) Successful in 1m37s
CI / Deploy (pull_request) Skipped
CI / Integration (api) (push) Successful in 1m14s
CI / Scan (secrets, workflows, shell) (push) Successful in 1m29s
CI / Test (jest) (pull_request) Successful in 13s
CI / Integration (api) (pull_request) Successful in 1m51s
CI / Notify (pull_request) Skipped
CI / Lint (eslint) (push) Successful in 14s
CI / Security (npm audit) (pull_request) Successful in 7s
- The worker reports its commit (VERSION file, or git rev-parse in a
  checkout) in worker_connect and heartbeat metadata. The server keeps it
  per live socket and /healthz lists worker_versions.
- deploy/pulse_worker_deploy.sh <sha> <ts>, for the webhook on a worker
  host: replay and age checks, commit must be on main, installs worker.js
  and the npm manifests from exactly that commit, writes VERSION, npm ci,
  restarts, waits until /healthz lists the sha, else restores the
  previous files. Sandbox tests cover deploy, replay, stale and malformed
  input, off-main commits, no-op redeploys and rollback.
- New CI job Deploy worker after Deploy: only when worker/ or the npm
  manifests changed since the commit the workers report, so unrelated
  merges don't restart the worker; then waits for the worker to reconnect
  on the new commit.
- README: Worker deploys (install, hook definition, adding a worker host).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 16:51:24 -05:00
jaredandClaude Opus 5.5 d96b2ad4cf CI: semgrep in the scan job
CI / Test (jest) (push) Successful in 17s
CI / Security (npm audit) (push) Successful in 9s
CI / Scan (secrets, workflows, shell) (pull_request) Successful in 2m27s
CI / Deploy (push) Skipped
CI / Lint (eslint) (pull_request) Successful in 16s
CI / UI (playwright) (push) Successful in 3m4s
CI / UI (playwright) (pull_request) Successful in 1m54s
CI / Deploy (pull_request) Skipped
CI / Notify (push) Skipped
CI / Integration (api) (push) Successful in 2m49s
CI / Test (jest) (pull_request) Successful in 15s
CI / Integration (api) (pull_request) Successful in 1m59s
CI / Notify (pull_request) Skipped
CI / Scan (secrets, workflows, shell) (push) Successful in 1m28s
CI / Lint (eslint) (push) Successful in 17s
CI / Security (npm audit) (pull_request) Successful in 9s
JavaScript, Node.js, Express, secrets and security-audit rule packs, with
--error so findings fail the check. Dry run on main: no findings from the
first four packs; security-audit flagged one false positive (the demo seed
script's urlopen of a fixed loopback URL), suppressed on that line with the
reason. Part of #45 phase 4.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 16:43:10 -05:00
jaredandClaude Opus 5.5 67a9e1c009 Integration tests: wait for a worker's WebSocket, not just its heartbeat
CI / Security (npm audit) (push) Successful in 21s
CI / Test (jest) (push) Successful in 23s
CI / Lint (eslint) (pull_request) Successful in 44s
CI / Scan (secrets, workflows, shell) (pull_request) Successful in 11s
CI / Deploy (push) Skipped
CI / UI (playwright) (push) Successful in 3m9s
CI / Notify (push) Skipped
CI / UI (playwright) (pull_request) Successful in 1m45s
CI / Deploy (pull_request) Skipped
CI / Scan (secrets, workflows, shell) (push) Successful in 14s
CI / Integration (api) (push) Successful in 1m58s
CI / Test (jest) (pull_request) Successful in 42s
CI / Integration (api) (pull_request) Successful in 1m44s
CI / Lint (eslint) (push) Successful in 13s
CI / Notify (pull_request) Skipped
CI / Security (npm audit) (pull_request) Successful in 30s
Under load a new worker's first heartbeat marked it online before its
WebSocket had connected, so a test's first command was refused, and the
cleanup in finally then threw its own error and hid the real one.
startWorker now waits until the server accepts a probe command for the
worker, and cleanup never throws (offline status has its own test).
Reproduced 1 in 6 under UI-test load before; 0 in 10 after.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 15:54:38 -05:00
jaredandClaude Opus 5.5 394665e88a CI: build the SBOM from the lockfile (the audit job has no node_modules)
CI / Test (jest) (push) Successful in 18s
CI / Security (npm audit) (push) Successful in 12s
CI / Lint (eslint) (pull_request) Successful in 31s
CI / Deploy (push) Skipped
CI / Scan (secrets, workflows, shell) (pull_request) Successful in 14s
CI / UI (playwright) (push) Successful in 2m17s
CI / Notify (push) Skipped
CI / UI (playwright) (pull_request) Successful in 1m39s
CI / Deploy (pull_request) Skipped
CI / Lint (eslint) (push) Successful in 17s
CI / Scan (secrets, workflows, shell) (push) Successful in 12s
CI / Integration (api) (push) Failing after 1m25s
CI / Test (jest) (pull_request) Successful in 17s
CI / Integration (api) (pull_request) Successful in 1m19s
CI / Notify (pull_request) Skipped
CI / Security (npm audit) (pull_request) Successful in 18s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 15:34:55 -05:00
jaredandClaude Opus 5.5 38a6d1158d Worker unit tests, coverage floors, and an SBOM per main build
CI / Test (jest) (push) Successful in 18s
CI / Security (npm audit) (push) Failing after 12s
CI / Lint (eslint) (pull_request) Successful in 24s
CI / Deploy (push) Skipped
CI / Scan (secrets, workflows, shell) (pull_request) Successful in 15s
CI / UI (playwright) (push) Successful in 3m11s
CI / Notify (push) Skipped
CI / UI (playwright) (pull_request) Successful in 1m31s
CI / Deploy (pull_request) Skipped
CI / Lint (eslint) (push) Successful in 17s
CI / Scan (secrets, workflows, shell) (push) Successful in 18s
CI / Integration (api) (push) Successful in 2m58s
CI / Test (jest) (pull_request) Successful in 15s
CI / Integration (api) (pull_request) Successful in 1m18s
CI / Notify (pull_request) Skipped
CI / Security (npm audit) (pull_request) Failing after 12s
- worker/worker.js exports PulseWorker and starts only when run directly
  (no behaviour change for the service; CT 153 needs no redeploy).
- tests/worker.test.js: success, exit code and stderr, timeout kill,
  capacity rejection, slot release after failure, ping/pong, no sends
  while disconnected.
- jest coverage floors (ratchet at today's levels): lib/ 90% lines and
  statements, 80% branches and functions; worker/ 40%.
- The audit job writes a CycloneDX SBOM of production dependencies and
  keeps it 90 days for each main build.

Part of #45 phases 3 and 4.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 15:28:23 -05:00
jaredandClaude Opus 5.5 1f75a4a63a CI: scan job for secrets (gitleaks), workflows (actionlint) and shell (shellcheck)
CI / Test (jest) (push) Successful in 16s
CI / Security (npm audit) (push) Successful in 10s
CI / Lint (eslint) (pull_request) Successful in 13s
CI / Deploy (push) Skipped
CI / Scan (secrets, workflows, shell) (pull_request) Successful in 18s
CI / Scan (secrets, workflows, shell) (push) Successful in 13s
CI / UI (playwright) (push) Successful in 1m43s
CI / Notify (push) Skipped
CI / UI (playwright) (pull_request) Successful in 1m48s
CI / Deploy (pull_request) Skipped
CI / Lint (eslint) (push) Successful in 17s
CI / Integration (api) (push) Successful in 1m28s
CI / Test (jest) (pull_request) Successful in 19s
CI / Integration (api) (pull_request) Successful in 1m30s
CI / Notify (pull_request) Skipped
CI / Security (npm audit) (pull_request) Successful in 8s
All three pass on main today: gitleaks found no leaks in 88 commits, and
actionlint's one warning (an unused loop variable in the deploy health
check) is fixed here. Tool downloads are pinned to a version and verified
by SHA-256. Deploy now also waits for the scan. Part of #45 phase 4.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 14:28:48 -05:00
jaredandClaude Opus 5.5 def926d41e Integration tests for the Gandalf contract, auth and reliability; fix worker offline status
CI / Security (npm audit) (push) Successful in 26s
CI / Test (jest) (push) Successful in 13s
CI / Deploy (push) Skipped
CI / UI (playwright) (push) Successful in 2m31s
CI / Notify (push) Skipped
CI / UI (playwright) (pull_request) Successful in 2m16s
CI / Lint (eslint) (pull_request) Successful in 15s
CI / Deploy (pull_request) Skipped
CI / Integration (api) (push) Successful in 1m31s
CI / Test (jest) (pull_request) Successful in 50s
CI / Integration (api) (pull_request) Successful in 1m58s
CI / Notify (pull_request) Skipped
CI / Lint (eslint) (push) Successful in 46s
CI / Security (npm audit) (pull_request) Successful in 15s
New CI job `Integration (api)` (#45 phase 3) runs the real server and three
workers on Node 20 against MariaDB and tests them as a black box over HTTP
and WebSocket (20 tests, about 12 s):

- Gandalf contract: submit and poll, stdout from command_result, failures
  with exit code and stderr, 401 for wrong or missing key, 400 for missing
  fields or an unknown worker, 404 for an unknown execution
- Auth: SSO identity, 401/403, heartbeat key, /healthz exposes only status;
  WebSocket upgrade refused without credentials, with a wrong key or a wrong
  group; live events reach a signed-in browser; a browser socket cannot
  forge a command result
- Reliability: a worker killed mid-command fails the execution at once; a
  worker at capacity answers with a failure; an aborted execution stays
  failed when the late result arrives; a disconnected worker shows offline

The last test found a bug from #42: the close handler deleted the worker's
runtime-id entry before checking whether the socket was still live under its
database id, and the two ids are normally the same key. So a disconnected
worker was never marked offline and showed 'online' until the stale
heartbeat sweep. Gandalf was unaffected (it checks live sockets).

MariaDB setup for CI moves to scripts/ci/mariadb.sh, shared by both jobs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 14:14:28 -05:00
jaredandClaude Opus 5.5 8b93c88f0f CI: run MariaDB inside the UI job; take Node from job images, not setup-node
CI / Test (jest) (push) Successful in 23s
CI / Security (npm audit) (push) Successful in 14s
CI / Deploy (push) Skipped
CI / Lint (eslint) (pull_request) Successful in 24s
CI / UI (playwright) (push) Successful in 1m38s
CI / Notify (push) Skipped
CI / UI (playwright) (pull_request) Successful in 1m33s
CI / Deploy (pull_request) Skipped
CI / Lint (eslint) (push) Successful in 27s
CI / Test (jest) (pull_request) Successful in 14s
CI / Notify (pull_request) Skipped
CI / Security (npm audit) (pull_request) Successful in 8s
The runner uses Docker's default bridge network, so the mariadb service
hostname never resolved. It also shares one tool cache volume between
concurrent jobs: parallel setup-node runs overwrote each other's Node
(the earlier <nil> failure and today's missing npm package.json).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 13:42:43 -05:00
jaredandClaude Opus 5.5 5bca0cd87b CI: Playwright UI tests against a real server, workers and MariaDB
CI / Test (jest) (push) Failing after 57s
CI / Security (npm audit) (push) Successful in 10s
CI / Lint (eslint) (pull_request) Successful in 28s
CI / Deploy (push) Skipped
CI / UI (playwright) (push) Failing after 2m25s
CI / Notify (push) Skipped
CI / UI (playwright) (pull_request) Failing after 1m21s
CI / Deploy (pull_request) Skipped
CI / Lint (eslint) (push) Successful in 59s
CI / Test (jest) (pull_request) Successful in 17s
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
jaredandClaude Opus 5.5 e3d09020cc Declare the supported Node version (>=20) in package.json
CI / Test (jest) (push) Successful in 28s
CI / Security (npm audit) (push) Successful in 15s
CI / Deploy (push) Skipped
CI / Lint (eslint) (pull_request) Successful in 13s
CI / Notify (push) Skipped
CI / Deploy (pull_request) Skipped
CI / Test (jest) (pull_request) Successful in 21s
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
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 / Lint (eslint) (pull_request) Successful in 14s
CI / Deploy (pull_request) Skipped
CI / Test (jest) (pull_request) Failing after 12s
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
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 / Security (npm audit) (push) Successful in 10s
CI / Deploy (push) Skipped
CI / Notify (push) Skipped
CI / Lint (eslint) (pull_request) Successful in 21s
CI / Deploy (pull_request) Skipped
CI / Lint (eslint) (push) Successful in 21s
CI / Test (jest) (pull_request) Successful in 21s
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
jaredandClaude Opus 5.5 027dce7fd5 Remove em and en dashes from UI text
Lint / Notify on failure (push) Skipped
Security / JS Security (npm audit) (pull_request) Failing after 38s
Test / JS Tests (jest) (push) Successful in 31s
Lint / JS (eslint) (push) Successful in 26s
Lint / Deploy (pull_request) Skipped
Security / JS Security (npm audit) (push) Failing after 23s
Lint / Deploy (push) Skipped
Lint / JS (eslint) (pull_request) Successful in 42s
Test / JS Tests (jest) (pull_request) Successful in 28s
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 dc47e335aa Fix security job: clear npm audit advisories (jest 30, audit fix); tidy demo scripts
Lint / Notify on failure (push) Skipped
Test / JS Tests (jest) (push) Successful in 19s
Lint / JS (eslint) (push) Successful in 26s
Security / JS Security (npm audit) (push) Successful in 15s
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).
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 / Notify on failure (push) Skipped
Test / JS Tests (jest) (push) Successful in 9s
Lint / JS (eslint) (push) Successful in 18s
Security / JS Security (npm audit) (push) Failing after 9s
Lint / Deploy (push) Successful in 6s
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 / Notify on failure (push) Skipped
Test / JS Tests (jest) (push) Successful in 9s
Lint / JS (eslint) (push) Successful in 12s
Security / JS Security (npm audit) (push) Failing after 12s
Lint / Deploy (push) Successful in 4s
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 / Notify on failure (push) Skipped
Test / JS Tests (jest) (push) Successful in 12s
Lint / JS (eslint) (push) Successful in 10s
Security / JS Security (npm audit) (push) Successful in 11s
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
2026-09-08 22:41:26 -04:00
jaredandClaude Fable 5.1 2173b5ab8f fix: handle mysql2 >=3.23 returning JSON columns pre-parsed
Security / JS Security (npm audit) (pull_request) Successful in 10s
Lint / Notify on failure (push) Skipped
Test / JS Tests (jest) (push) Successful in 11s
Lint / Deploy (pull_request) Skipped
Lint / JS (eslint) (push) Successful in 11s
Lint / JS (eslint) (pull_request) Successful in 11s
Test / JS Tests (jest) (pull_request) Successful in 10s
Lint / Deploy (push) Skipped
Security / JS Security (npm audit) (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 / Notify on failure (push) Skipped
Test / JS Tests (jest) (push) Successful in 19s
Lint / JS (eslint) (push) Successful in 11s
Security / JS Security (npm audit) (push) Successful in 16s
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
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 / Notify on failure (push) Skipped
Test / JS Tests (jest) (push) Successful in 10s
Security / JS Security (npm audit) (pull_request) Successful in 10s
Lint / JS (eslint) (push) Successful in 10s
Lint / Deploy (pull_request) Skipped
Lint / Deploy (push) Skipped
Lint / JS (eslint) (pull_request) Successful in 10s
Security / JS Security (npm audit) (push) 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
Security / JS Security (npm audit) (pull_request) Failing after 10s
Lint / Notify on failure (push) Skipped
Test / JS Tests (jest) (push) Successful in 10s
Lint / Deploy (pull_request) Skipped
Lint / JS (eslint) (push) Successful in 11s
Lint / JS (eslint) (pull_request) Successful in 10s
Test / JS Tests (jest) (pull_request) Successful in 14s
Lint / Deploy (push) Skipped
Security / JS Security (npm audit) (push) Failing after 11s
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 / Notify on failure (push) Has been skipped
Lint / JS (eslint) (push) Successful in 11s
Test / JS Tests (jest) (push) Successful in 10s
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>
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
Test / JS Tests (jest) (push) Successful in 13s
Security / JS Security (npm audit) (push) Successful in 14s
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
Test / JS Tests (jest) (push) Successful in 10s
Security / JS Security (npm audit) (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
Test / JS Tests (jest) (push) Successful in 13s
Security / JS Security (npm audit) (push) Failing after 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
jaredandClaude Sonnet 4.6 2d6a0f1054 Add rate limiting, cron scheduling, webhooks, dry-run, execution filtering, and UX improvements
- Rate limiting: 300 req/15min general, 20 req/min on POST /api/executions
- Cron schedule type support using cron-parser for full cron expressions
- Webhook notifications: POST to workflow webhook_url on execution complete/failed
- Dry-run mode: simulate workflow execution without running any commands
- Global execution timeout via EXECUTION_MAX_MINUTES env var (default 60min)
- Execution filtering: status, workflow_id, started_by, after, before, search
- Event-driven command result delivery (replaces 500ms DB polling)
- Atomic log appends via JSON_ARRAY_APPEND (no read-modify-write race)
- Separate browserClients/workerClients sets (workers no longer receive broadcasts)
- Stale execution cleanup on startup (mark running→failed after crash)
- Scheduler overlap prevention (skip if same workflow already running)
- Frontend: webhook_url field in create/edit workflow modals
- Frontend: dry-run checkbox in workflow param modal
- Frontend: ESC closes modals, ws.onerror handler added
- Frontend: selectedExecutions changed from Array to Set (O(1) ops)
- Frontend: XSS fixes via escapeHtml() on all user-controlled innerHTML
- Frontend: param modal keydown listener deduplication fix
- Remove unused npm packages (bcryptjs, body-parser, cors, js-yaml, jsonwebtoken)
- Add express-rate-limit and cron-parser dependencies

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 23:06:09 -04:00
jaredandClaude Sonnet 4.6 58c172e131 Security hardening, bug fixes, and performance improvements
Security fixes:
- Replace new Function() condition eval with vm.runInNewContext() (RCE fix)
- Add admin checks to DELETE executions, all scheduled-commands endpoints
- Remove api_key from GET /api/workers response (was exposed to all employees)
- Separate browserClients/workerClients sets; broadcast() now sends to browsers only
- Add worker WebSocket auth: reject if api_key provided but invalid
- Fix XSS: escapeHtml() on step_name, duration, worker_id, user info, execution_id

Bug fixes:
- Replace DB-polling waitForCommandResult with event-driven _commandResolvers Map
- Replace non-atomic addExecutionLog with JSON_ARRAY_APPEND (fixes concurrent write race)
- Add stale execution recovery on startup: running→failed with log entry
- Fix calculateNextRun returning null for unknown types (now throws)
- Fix scheduler overlap: skip if previous execution still running
- Fix JSON double-parse on worker_ids column
- Fix switchTab() bare event.target reference
- Fix selectedExecutions Array→Set (O(1) lookups, fixes performance regression)
- Fix param modal event listener leak (delegated handler, removes before re-adding)
- Add ws.onerror handler (was silently swallowing WebSocket errors)
- Move misplaced routes to before server.listen()

Performance/cleanup:
- DB connection pool 10→50
- EXECUTION_RETENTION_DAYS default 1→30 (matches docs)
- Remove unused packages: bcryptjs, body-parser, cors, js-yaml, jsonwebtoken
- Remove generateUUID() wrapper, use crypto.randomUUID() directly
- Remove dead example workflow constants
- Add ESC key handler to close modals
- Fix clearCompletedExecutions limit 1000→9999
- Add security notice to README.md

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 22:53:25 -04:00
jaredandClaude Sonnet 4.6 0fee118d1d Suppress toast notifications for automated executions
Automated executions (started_by gandalf: or scheduler:) no longer
trigger success/failure toast alerts for connected browser users.
Server now includes is_automated flag in command_result broadcasts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 16:26:18 -05:00
jaredandClaude Sonnet 4.6 937bddbe2f Fix waitForCommandResult: match by position, not command_id
Worker does not echo command_id back in command_result message.
Previously this caused all workflow steps to time out after 120s.
Now: find the command_sent entry for the commandId, then take the
next command_result after it — safe since steps run sequentially.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 11:21:30 -05:00
jaredandClaude Sonnet 4.6 bf9b14bc96 Add interactive workflow system with prompt steps, workflow editor
- executeWorkflowSteps: rewritten with step-id/goto branching support
- executePromptStep: async pause via _executionPrompts Map, 60min timeout
- POST /api/executions/:id/respond: resolves pending prompt from browser
- PUT /api/workflows/🆔 admin-only workflow editing, broadcasts workflow_updated
- GET /api/workflows/🆔 fetch single workflow for edit modal
- GET /api/executions/🆔 now includes waiting_for_input + prompt fields
- index.html: prompt/prompt_response/step_skipped log entry rendering
- index.html: execution_prompt WebSocket handler refreshes open modal
- index.html: workflow_updated WebSocket handler reloads workflow list
- index.html: Edit button + modal for in-browser workflow editing
- index.html: respondToPrompt keeps modal open, refreshes execution view
- Interactive Link Troubleshooter v2 workflow: 45-step wizard with
  copper/fiber branches, clean/swap/reseat actions, re-test loops,
  CRC error path, performance diagnostics, SUCCESS/ESCALATE terminals

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 16:55:02 -05:00
jaredandClaude Sonnet 4.6 033237482d feat: workflow param substitution + link troubleshooter support
Adds {{param_name}} template substitution to the workflow execution engine
so workflows can accept user-supplied inputs at run time.

server.js:
- applyParams() helper — substitutes {{name}} in command strings with
  validated values (alphanumeric + safe punctuation only); unsafe values
  throw and fail the execution cleanly
- executeCommandStep() / executeWorkflowSteps() — accept params={} and
  apply substitution before dispatching commands to workers
- POST /api/executions — accepts params:{} from client; validates required
  params against definition.params[]; logs params in initial execution log

index.html:
- loadWorkflows() caches definition in _workflowRegistry keyed by id;
  shows "[N params]" badge on parameterised workflows
- executeWorkflow() checks for definition.params; if present, shows
  param input modal instead of plain confirm()
- showParamModal() — builds labelled input form from param definitions,
  marks required fields, focuses first input, Enter submits
- submitParamForm() — validates required fields, calls startExecution()
- startExecution() — POSTs {workflow_id, params} and switches to executions tab
- Param input modal — terminal-aesthetic overlay, no external dependencies

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 16:20:05 -05:00
jaredandClaude Sonnet 4.6 6d945a1913 feat: Gandalf M2M API, manual/automated execution sub-tabs, cleanup tuning
- server.js: add authenticateGandalf middleware (X-Gandalf-API-Key header)
  and two internal endpoints used by Gandalf link diagnostics:
    POST /api/internal/command  — submit SSH command to a worker, returns execution_id
    GET  /api/internal/executions/:id — poll execution status/logs
  Also tag automated executions as started_by 'gandalf:*' / 'scheduler:*';
  add hide_internal query param to GET /api/executions; change cleanup
  from daily/30d to hourly/1d to keep execution history lean
- index.html: add Manual / Automated sub-tabs on Execution History tab so
  Gandalf diagnostic runs don't clutter the manual run view; persists
  selected tab to localStorage; dashboard recent-run strip filters to
  manual runs only; sub-tabs show live counts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 16:04:22 -05:00
jared e7707d7edb Add abort execution feature for stuck/running processes 2026-01-08 22:11:59 -05:00
jared ea7a2d82e6 Fix execution details endpoint - remove reference to deleted activeExecutions 2026-01-08 22:06:25 -05:00
jared 8224f3b6a4 Add missing helper functions for workflow execution (addExecutionLog, updateExecutionStatus) 2026-01-08 22:03:00 -05:00
jaredandClaude Sonnet 4.5 9b31b7619f Add WebSocket error handling with stack traces
Wrapped ws.onmessage in try-catch to capture full stack trace
when errors occur during message handling. This will help identify
where the 'Cannot read properties of undefined' error is coming from.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-07 23:33:07 -05:00
jaredandClaude Sonnet 4.5 06eb2d2593 Add detailed logging to workflow creation endpoint
This will help diagnose the 'Cannot read properties of undefined' error
by logging each step of the workflow creation process.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-07 23:30:50 -05:00
jaredandClaude Sonnet 4.5 aaeb59a8e2 Improve error handling in workflow creation and data loading
- Separated JSON validation from API call error handling
- Changed refreshData() to async with individual try-catch blocks
- Better error messages: "Invalid JSON" vs "Error creating workflow"
- Console.error logging for each data loading function
- Changed success alert to terminal notification
- This will help identify which specific function is failing

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-07 23:27:54 -05:00
jaredandClaude Sonnet 4.5 b85bd58c4b Fix: Remove duplicate old workflow execution code
Removed old/obsolete workflow execution system that was conflicting
with the new executeWorkflowSteps() engine:

Removed:
- activeExecutions Map (old tracking system)
- executeWorkflow() - old workflow executor
- executeNextStep() - old step processor
- executeCommandStep() - old command executor (duplicate)
- handleUserInput() - unimplemented prompt handler
- Duplicate app.post('/api/executions') endpoint
- app.post('/api/executions/:id/respond') endpoint

This was causing "Cannot read properties of undefined (reading 'target')"
error because the old code was being called instead of the new engine.

The new executeWorkflowSteps() engine is now the only workflow system.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-07 23:24:42 -05:00
jaredandClaude Sonnet 4.5 018752813a Implement Complete Workflow Execution Engine
Added full workflow execution engine that actually runs workflow steps:

Server-Side (server.js):
- executeWorkflowSteps() - Main workflow orchestration function
- executeCommandStep() - Executes commands on target workers
- waitForCommandResult() - Polls for command completion
- Support for step types: execute, wait, prompt (prompt skipped for now)
- Sequential step execution with failure handling
- Worker targeting: "all" or specific worker IDs/names
- Automatic status updates (running -> completed/failed)
- Real-time WebSocket broadcasts for step progress
- Command result tracking with command_id for workflows
- Only updates status for non-workflow quick commands

Client-Side (index.html):
- Enhanced formatLogEntry() with workflow-specific log types
- step_started - Shows step number and name with amber color
- step_completed - Shows completion with green checkmark
- waiting - Displays wait duration
- no_workers - Error when no workers available
- worker_offline - Warning for offline workers
- workflow_error - Critical workflow errors
- Better visual feedback for workflow progress

Workflow Definition Format:
{
  "steps": [
    {
      "name": "Step Name",
      "type": "execute",
      "targets": ["all"] or ["worker-name"],
      "command": "your command here"
    },
    {
      "type": "wait",
      "duration": 5
    }
  ]
}

Features:
- Executes steps sequentially
- Stops on first failure
- Supports multiple workers per step
- Real-time progress updates
- Comprehensive logging
- Terminal-themed workflow logs

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-07 23:19:12 -05:00
jaredandClaude Sonnet 4.5 4511fac486 Phase 10: Command Scheduler
Added comprehensive command scheduling system:

Backend:
- New scheduled_commands database table
- Scheduler processor runs every minute
- Support for three schedule types: interval, hourly, daily
- calculateNextRun() function for intelligent scheduling
- API endpoints: GET, POST, PUT (toggle), DELETE
- Executions automatically created and tracked
- Enable/disable schedules without deleting

Frontend:
- New Scheduler tab in navigation
- Create Schedule modal with worker selection
- Dynamic schedule input based on type
- Schedule list showing status, next/last run times
- Enable/Disable toggle for each schedule
- Delete schedule functionality
- Terminal-themed scheduler UI
- Integration with existing worker and execution systems

Schedule Types:
- Interval: Every X minutes (e.g., 30 for every 30 min)
- Hourly: Every X hours (e.g., 2 for every 2 hours)
- Daily: At specific time (e.g., 03:00 for 3 AM daily)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-07 23:13:27 -05:00
jaredandClaude Sonnet 4.5 4e17fdbf8c Phase 9: Execution Diff View
Added powerful execution comparison and diff view:

- Compare Mode toggle button in executions tab
- Multi-select up to 5 executions for comparison
- Visual selection indicators with checkmarks
- Comparison modal with summary table (status, duration, timestamps)
- Side-by-side output view for all selected executions
- Line-by-line diff analysis for 2-execution comparisons
- Highlights identical vs. different lines
- Shows identical/different line counts
- Color-coded diff (green for exec 1, amber for exec 2)
- Perfect for comparing same command across workers
- Terminal-themed comparison UI

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-07 23:08:55 -05:00
jaredandClaude Sonnet 4.5 5c41afed85 Phase 8: Execution Search & Filtering
Added comprehensive search and filtering for execution history:

- Search bar to filter by command text, execution ID, or workflow name
- Status filter dropdown (All, Running, Completed, Failed, Waiting)
- Real-time client-side filtering as user types
- Filter statistics showing X of Y executions
- Clear Filters button to reset all filters
- Extracts command text from logs for quick command searches
- Maintains all executions in memory for instant filtering
- Terminal-themed filter UI matching existing aesthetic

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-07 23:06:43 -05:00
jaredandClaude Sonnet 4.5 4baecc54d3 Phase 7: Multi-Worker Command Execution
Added ability to execute commands on multiple workers simultaneously:

- Added execution mode selector (Single/Multiple Workers)
- Multi-worker mode with checkbox list for worker selection
- Helper buttons: Select All, Online Only, Clear All
- Sequential execution across selected workers
- Results summary showing success/fail count per worker
- Updated command history to track multi-worker executions
- Terminal beep feedback based on overall success/failure
- Maintained backward compatibility with single worker mode

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-07 23:03:45 -05:00
jaredandClaude Sonnet 4.5 661c83a578 Fix clearCompletedExecutions for new pagination API format
Changes:
- Handle new pagination response format (data.executions vs data)
- Request up to 1000 executions to ensure all are checked
- Track successful deletions count
- Use terminal notification instead of alert
- Better error handling for individual delete failures

Fixes regression from Phase 5 pagination changes.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-07 22:55:13 -05:00
jaredandClaude Sonnet 4.5 c6e3e5704e Phase 6: Terminal aesthetic refinements and notifications
Changes:
- Added blinking terminal cursor animation
- Smooth hover effects for execution/worker/workflow items
- Hover animation: background highlight + border expand + slide
- Loading pulse animation for loading states
- Slide-in animation for log entries
- Terminal beep sound using Web Audio API (different tones for success/error)
- Real-time terminal notifications for command completion
- Toast-style notifications with green glow effects
- Auto-dismiss after 3 seconds with fade-out
- Visual and audio feedback for user actions

Sound features:
- 800Hz tone for success (higher pitch)
- 200Hz tone for errors (lower pitch)
- 440Hz tone for info (standard A note)
- 100ms duration, exponential fade-out
- Graceful fallback if Web Audio API not supported

Notification features:
- Fixed position top-right
- Terminal-themed styling with glow
- Color-coded: green for success, red for errors
- Icons: ✓ success, ✗ error, ℹ info
- Smooth animations (slide-in, fade-out)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-07 22:52:51 -05:00
jaredandClaude Sonnet 4.5 9f972182b2 Phase 5: Auto-cleanup and pagination for executions
Changes:
Server-side:
- Added automatic cleanup of old executions (runs daily)
- Configurable retention period via EXECUTION_RETENTION_DAYS env var (default: 30 days)
- Cleanup runs on server startup and every 24 hours
- Only cleans completed/failed executions, keeps running ones
- Added pagination support to /api/executions endpoint
- Returns total count, limit, offset, and hasMore flag

Client-side:
- Implemented "Load More" button for execution pagination
- Loads 50 executions at a time
- Appends additional executions when "Load More" clicked
- Shows total execution count info
- Backward compatible with old API format

Benefits:
- Automatic database maintenance
- Prevents execution table from growing indefinitely
- Better performance with large execution histories
- User can browse all executions via pagination
- Configurable retention policy per deployment

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-07 22:50:39 -05:00
jaredandClaude Sonnet 4.5 fff50f19da Phase 4: Execution detail enhancements with re-run and download
Changes:
- Added "Re-run Command" button to execution details modal
- Added "Download Logs" button to export execution data as JSON
- Re-run automatically switches to Quick Command tab and pre-fills form
- Download includes all execution metadata and logs
- Buttons only show for applicable execution types
- Terminal-themed button styling

Features:
- Re-run: Quickly repeat a previous command on same worker
- Download: Export execution logs for auditing/debugging
- JSON format includes: execution_id, status, timestamps, logs
- Filename includes execution ID and date for easy organization

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-07 22:49:20 -05:00
jaredandClaude Sonnet 4.5 8152a827e6 Phase 3: Quick command enhancements with templates and history
Changes:
- Added command templates modal with 12 common system commands
- Added command history tracking (stored in localStorage)
- History saves last 50 commands with timestamp and worker name
- Template categories: system info, disk/memory, network, Docker, logs
- Click templates to auto-fill command field
- Click history items to reuse previous commands
- Terminal-themed modals with green/amber styling
- History persists across browser sessions

Templates included:
- System: uname, uptime, CPU info, processes
- Resources: df -h, free -h, memory usage
- Network: ip addr, active connections
- Docker: container list
- Logs: syslog tail, who is logged in, last logins

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-07 22:45:40 -05:00
jaredandClaude Sonnet 4.5 bc3524e163 Phase 2: Enhanced worker status display with metadata
Changes:
- Show worker system metrics in dashboard and worker list
- Display CPU cores, memory usage, load average, uptime
- Added formatBytes() to display memory in human-readable format
- Added formatUptime() to show uptime as days/hours/minutes
- Added getTimeAgo() to show relative last-seen time
- Improved worker list with detailed metadata panel
- Show active tasks vs max concurrent tasks
- Terminal-themed styling for metadata display
- Amber labels for metadata fields

Benefits:
- See worker health at a glance
- Monitor resource usage (CPU, RAM, load)
- Track worker activity (active tasks)
- Better operational visibility

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-07 22:43:13 -05:00
jaredandClaude Sonnet 4.5 f8ec651e73 Phase 1: Improve log display formatting
Changes:
- Added formatLogEntry() function to parse and format log entries
- Replaced raw JSON display with readable formatted logs
- Added specific formatting for command_sent and command_result logs
- Show timestamp, status, duration, stdout/stderr in organized layout
- Color-coded success (green) and failure (red) states
- Added scrollable output sections with max-height
- Syntax highlighting for command code blocks
- Terminal-themed styling with green/amber colors

Benefits:
- Much easier to read execution logs
- Clear visual distinction between sent/result logs
- Professional terminal aesthetic maintained
- Better UX for debugging command execution

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-07 22:41:29 -05:00
jaredandClaude Sonnet 4.5 7656f4a151 Add execution cleanup functionality
Changes:
- Added DELETE /api/executions/:id endpoint
- Added "Clear Completed" button to Executions tab
- Deletes all completed and failed executions
- Broadcasts execution_deleted event to update all clients
- Shows count of deleted executions

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-07 22:36:51 -05:00