#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>
- 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>
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>
Replace every em dash and en dash outside user-visible UI text with a
colon, comma, hyphen or "to". The UI strings and the vendored
web_template are handled separately.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- 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>
- 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>
- 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>