Ship the community 2.19.16 build with HA, mail and the watchdog (CP-41) #16

Merged
pit merged 8 commits from hermes/cp41-community-ha-mail-watchdog into main 2026-11-05 15:38:47 +00:00
Owner

Summary

CP-41, the repository half of CP-44. The pin moves to the community build and 143 runs the configuration CP-27, CP-19 and CP-30 decided, shipped through this repository's own deploy.

 semaphore/service/roles/semaphore/
 ├── defaults/main.yml          # community asset + digest, mail, watchdog, limits
 ├── tasks/main.yml             # asset guard, installed-binary guard, watchdog import
 ├── tasks/secrets.yml          # refuses an env missing the SMTP pair or the token
 ├── tasks/watchdog.yml         # script, token, mail settings, unit, timer
 └── templates/
+    ├── config.json.j2         # ha, no redis, sqlite, limits, web_host, mail
+    ├── semaphore-watchdog.sh.j2
+    ├── semaphore-watchdog.env.j2
+    ├── semaphore-watchdog.service.j2
+    └── semaphore-watchdog.timer.j2
 semaphore/service/tests/ha/    # CP-30's harness, as one Target
 semaphore/service/tests/rehearsal.yml

make upgrade-check runs the restart-mid-job test on the pinned artifact in scratch containers: the server is stopped 10 s into a 60 s runner job, once for a failing job and once for a plain one.

Evidence

  • Before: the role installed semaphore_2.19.16_linux_amd64.deb (the Pro build, 56c4ac99…85b8), which exits at start with ha.enabled and no Redis. No mail block, no watchdog, no limits.
    After: make check green — env pin and map (12 names), env tests, plan tests, formatting; new env-test cases refuse each of SEMAPHORE_SMTP_USERNAME, SEMAPHORE_SMTP_PASSWORD, SEMAPHORE_WATCHDOG_TOKEN by name, and assert the rendered config's HA, limits, web root, sender and SMTP settings. The sweep has its own case: the role's rendered watchdog run against a stand-in API, in three shapes — nothing stale (exit 0), a project whose task list does not answer (exit 1) and one stale row beside a fresh one (the stale one force-stopped, red because the report cannot mail).
  • make upgrade-check on the pin (community asset, digest 6866a09c…672, no RedisTaskStateStore): the failing job ended error with 60/60 lines and exactly one mail, the plain job ended success with 60/60 and none, zero task not found in pool, and the runner never reported a terminated task.
  • The role in --check --diff against a fresh unprivileged container: ok=22 changed=9 failed=0 skipped=12.
  • The watchdog against a mock API: force-stopped only the 40-minute running row, left the 5-minute row, the success row and the start-less row alone, and exited 1 when the report could not be mailed.

Merge Danger

Door: two-way — a revert pull request returns 143 to the previous commit's config; the package itself is a version pin, and the predeploy snapshot is taken before it changes.

Blast Radius: 143 only (the Semaphore server). The merge is the deploy.

The HA switch is the Operator's decision, and this merge is where it is
taken.
ha.enabled on the community binary runs no pro code — the note
reads the source and measures it, and everything it runs is MIT — but the
vendor's docs label HA "Enterprise" and its terms require a subscription for
it. research/cp30-ha-flag.md leaves the call to the Operator; it belongs
here beside the store paths, because this merge is what turns the switch on.

Tasks run in the server's own process until CP-42. The config ships
use_remote_runner: false, because a config that hands tasks to a runner
nothing has registered errors every task the moment the deploy writes it.
CP-42 is the runner, and it flips the switch beside the registration token it
needs. There is nothing to seed for that before this merge.

Do not merge before CP-44's two store paths are seeded — secret/services/semaphore/smtp with SEMAPHORE_SMTP_USERNAME and SEMAPHORE_SMTP_PASSWORD, and secret/services/semaphore/watchdog-token with SEMAPHORE_WATCHDOG_TOKEN. The role refuses a run whose environment lacks either name, by name, which is the intended check that the order was kept.

## Summary CP-41, the repository half of CP-44. The pin moves to the community build and 143 runs the configuration CP-27, CP-19 and CP-30 decided, shipped through this repository's own deploy. ```diff semaphore/service/roles/semaphore/ ├── defaults/main.yml # community asset + digest, mail, watchdog, limits ├── tasks/main.yml # asset guard, installed-binary guard, watchdog import ├── tasks/secrets.yml # refuses an env missing the SMTP pair or the token ├── tasks/watchdog.yml # script, token, mail settings, unit, timer └── templates/ + ├── config.json.j2 # ha, no redis, sqlite, limits, web_host, mail + ├── semaphore-watchdog.sh.j2 + ├── semaphore-watchdog.env.j2 + ├── semaphore-watchdog.service.j2 + └── semaphore-watchdog.timer.j2 semaphore/service/tests/ha/ # CP-30's harness, as one Target semaphore/service/tests/rehearsal.yml ``` `make upgrade-check` runs the restart-mid-job test on the pinned artifact in scratch containers: the server is stopped 10 s into a 60 s runner job, once for a failing job and once for a plain one. ## Evidence - **Before:** the role installed `semaphore_2.19.16_linux_amd64.deb` (the Pro build, `56c4ac99…85b8`), which exits at start with `ha.enabled` and no Redis. No mail block, no watchdog, no limits. **After:** `make check` green — env pin and map (12 names), env tests, plan tests, formatting; new env-test cases refuse each of `SEMAPHORE_SMTP_USERNAME`, `SEMAPHORE_SMTP_PASSWORD`, `SEMAPHORE_WATCHDOG_TOKEN` by name, and assert the rendered config's HA, limits, web root, sender and SMTP settings. The sweep has its own case: the role's rendered watchdog run against a stand-in API, in three shapes — nothing stale (exit 0), a project whose task list does not answer (exit 1) and one stale row beside a fresh one (the stale one force-stopped, red because the report cannot mail). - `make upgrade-check` on the pin (community asset, digest `6866a09c…672`, no `RedisTaskStateStore`): the failing job ended `error` with 60/60 lines and exactly one mail, the plain job ended `success` with 60/60 and none, zero `task not found in pool`, and the runner never reported a terminated task. - The role in `--check --diff` against a fresh unprivileged container: `ok=22 changed=9 failed=0 skipped=12`. - The watchdog against a mock API: force-stopped only the 40-minute `running` row, left the 5-minute row, the `success` row and the start-less row alone, and exited 1 when the report could not be mailed. ## Merge Danger **Door:** two-way — a revert pull request returns 143 to the previous commit's config; the package itself is a version pin, and the predeploy snapshot is taken before it changes. **Blast Radius:** 143 only (the Semaphore server). The merge is the deploy. **The HA switch is the Operator's decision, and this merge is where it is taken.** `ha.enabled` on the **community** binary runs no pro code — the note reads the source and measures it, and everything it runs is MIT — but the vendor's docs label HA "Enterprise" and its terms require a subscription for it. `research/cp30-ha-flag.md` leaves the call to the Operator; it belongs here beside the store paths, because this merge is what turns the switch on. **Tasks run in the server's own process until CP-42.** The config ships `use_remote_runner: false`, because a config that hands tasks to a runner nothing has registered errors every task the moment the deploy writes it. CP-42 is the runner, and it flips the switch beside the registration token it needs. There is nothing to seed for that before this merge. **Do not merge before CP-44's two store paths are seeded** — `secret/services/semaphore/smtp` with `SEMAPHORE_SMTP_USERNAME` and `SEMAPHORE_SMTP_PASSWORD`, and `secret/services/semaphore/watchdog-token` with `SEMAPHORE_WATCHDOG_TOKEN`. The role refuses a run whose environment lacks either name, by name, which is the intended check that the order was kept.
Ship the community 2.19.16 build with HA, mail and the watchdog (CP-41)
Some checks failed
plan / guest-plan-check (pull_request_target) Failing after 49s
pr-checks / check (pull_request) Successful in 20s
fa2ffb5560
The repository half of CP-44: the pin moves to the community asset, 143 runs
the configuration CP-27, CP-19 and CP-30 decided, and the deploy carries it.

- defaults: `semaphore_community_2.19.16_linux_amd64.deb`, sha256 6866a09c…672.
- the role guards the artifact three ways before anything is installed: the
  name carries `community`, `get_url` checks the pinned digest, and the
  installed binary carries no `RedisTaskStateStore` (the Pro build's paid
  Redis task-state store).
- config.json.j2: `ha.enabled` with no Redis and sqlite, `use_remote_runner`,
  the 30-minute task limit, the per-template limit, `web_host`
  http://10.12.0.143:3000, and SMTP2GO on 587 (STARTTLS) as
  noreply+semaphore@thepit.space with alerting on.
- the watchdog: `semaphore-watchdog.{service,timer}` on 143, every 15 minutes,
  force-stopping every `running` row older than 30 minutes and mailing one
  list. The token is a 0600 root file, the mail settings another.
- env.map and .env.example gain `secret/services/semaphore/smtp` →
  SEMAPHORE_SMTP_{USERNAME,PASSWORD} and
  `secret/services/semaphore/watchdog-token` → SEMAPHORE_WATCHDOG_TOKEN; the
  role's first assertions refuse a run missing either, by name, and env-test
  covers each name.
- `make upgrade-check`: CP-30's restart-mid-job harness, on the pinned
  artifact, asserting the artifact, the rendered config, 60/60 log lines and
  one mail across a SIGTERM restart, and zero `task not found in pool`.
- docs/deploy.md gains the mail, the watchdog and the upgrade rule;
  docs/environment.md the three names; research/cp30-ha-flag.md is the
  measurement the config rests on.
Member

Review started (round 1/5) on fa2ffb5560 — reading the diff now.

**Review started** (round 1/5) on fa2ffb55605d01ebaa39d3e62f83066b568e0b97 — reading the diff now.
bot-minos requested changes 2026-11-05 14:10:50 +00:00
Dismissed
bot-minos left a comment
repo: olympus/infra-cockpit | pr: 16 | head: fa2ffb55605d01ebaa39d3e62f83066b568e0b97 | round: 1/5 | verdict: block

Recommendation: fix

Spec source: the PR body. It names CP-41 but links no ticket, and this session has no Vikunja access, so the contract reviewed here is the one the body states: the pin moves to the community build; 143 gets HA without Redis, the failure mail and the watchdog; make check green; make upgrade-check green; the role clean in --check --diff; the watchdog verified against a mock API.

Standards source: AGENTS.md, docs/deploy.md, docs/environment.md. No formatter or linter covers the new .j2 shell and unit files (fmt-check is tofu fmt only), so the smell baseline below is judgement, not a tool result.


Spec

BLOCKER — use_remote_runner: true ships with no runner anywhere; every task fails

semaphore/service/roles/semaphore/templates/config.json.j2:15

I downloaded the pinned artifact (sha256 6866a09c…5672 — matches defaults/main.yml), migrated a fresh sqlite database with it, started the server on the config this template renders (HA on, sqlite, no Redis, use_remote_runner: true), and created a project, template and task over the API with no runner registered:

Task probe added to queue
Started task #1 of template 'probe'
Failed to run task: no runners available

{"id":1,"status":"error","runner_id":null,"start":null}

The row reached error in under 5 s. The runner is CP-42 and it does not exist yet in any form: defaults/main.yml:75-78 says its token comes "with the runner (CP-42)", docs/deploy.md:183-184 still says "once the runner exists", and this repository has no CP-42 pull request at all (PRs 1-16 listed; none is the runner). The body's Merge Danger names only CP-44's two store paths as preconditions — and since "the merge is the deploy", merging before a runner is registered turns every task on 143 from running to error.

Smallest clear: add CP-42's runner (registered, active, default) to the "Do not merge before" list — or keep use_remote_runner off in the shipped config until it lands.

BLOCKER — a sweep that read no project's tasks exits 0

semaphore/service/roles/semaphore/templates/semaphore-watchdog.sh.j2:79

if [ "$stopped" -eq 0 ] && [ -z "$report" ]; then
  exit 0
fi

This ignores $fails, which line 48 sets when a project's task list does not answer. I rendered the template through the role (the real artifact, not a copy) and ran it against an API whose /api/project/1/tasks answers 500:

curl: (22) The requested URL returned error: 500
watchdog: project 1's task list did not answer; its tasks were not swept.
exit=0

That contradicts docs/deploy.md:126-127 ("a sweep that could not read the API … is a failed unit"), the unit's own comment (semaphore-watchdog.service.j2:11-12) and the script header (:14-15, "Exits 0 when the sweep completed, 1 when it did not"). The one state the watchdog exists to surface — it could not see the tasks — is the one it reports as success, and nothing on the Guest would show it. No test covers the sweep's exit status; the mock-API check in the body is not in the repository.

Smallest clear: [ "$fails" -eq 0 ] || exit 1 before the early return.

ADVISORY — the harness's "the server started" assertion cannot fail

semaphore/service/tests/ha/server.sh:12-13, consumed at semaphore/service/tests/ha/run.sh:96

for _ in $(seq 1 120); do curl -fsS "$B/api/ping" >/dev/null 2>&1 && break; sleep 0.5; done
echo "server up: $(curl -sS "$B/api/ping")"

If the server never answers in 60 s the loop ends, the failing curl sits inside a command substitution in an echo argument, and the function still exits 0 — so run.sh prints ok "the server started on the role's rendered config…". Later steps do fail, so the check is not vacuous, but the assertion the body cites as evidence for "the pin starts with HA and sqlite" does not assert. Re-pinging after the loop and returning non-zero would make it real.

ADVISORY — the licence question the change's own note raises is absent from Merge Danger

research/cp30-ha-flag.md:265-273

Reading: on the pin, HA with Redis runs Enterprise code … the vendor's terms say that needs a valid
subscription. … The Operator should decide whether flipping that switch on the community binary
counts as "enabling paid features".

The shipped config flips ha.enabled on (config.json.j2:12-14); the binary's own UI bundle says "ha_only_enterprise": "High availability are only available in Enterprise edition." The note defers the call to the Operator in three separate places; the PR body — the only place the merge decision is written down — does not mention it, while it does spell out the CP-44 secret precondition. Since the Operator decides this merge, the question belongs beside that precondition.


Standards

ADVISORY — the SMTP password goes on a command line, in the change that argues against it

semaphore/service/roles/semaphore/templates/semaphore-watchdog.sh.j2:100

      --user "$SMTP_USER:$SMTP_PASS" \

The same changeset writes the API token to a 0600 file and explains why (tasks/watchdog.yml:30-32: "cat in the script is what keeps it out of a process listing, which a -H argument on a command line would not"), then passes the SMTP password as curl argv, which is world-readable in /proc/<pid>/cmdline for the life of the call (up to --max-time 30). The guest has one service account today, so the exposure is small, but it is the exact hazard the neighbouring comment claims to have avoided. --netrc-file or -K keeps it off argv.

ADVISORY — the note cites a harness and raw results that are not in the tree

research/cp30-ha-flag.md:6-8, research/cp30-ha-flag.md:350

The harness is research/cp30-harness/, built from CP-26's (research/cp26-harness/). Raw outputs are in research/cp30-harness/results/.

research/ contains this note and nothing else, on this branch and on main — no cp30-harness/, no cp26-harness/, no results/. The note is cited as evidence by defaults/main.yml:1-13 and docs/deploy.md:129-151, so a reader following it finds a description of files that do not exist. Either land the harness or say where it lives.


Verified

Claim How Result
make check green mise exec -- make env-check, env-test, plan-test, fmt-check on this head green — every case passed, env.map: 12 names
Pin is the community asset downloaded the release asset, sha256sum 6866a09c…5672, matches defaults/main.yml:34
No RedisTaskStateStore grep -c on the extracted /usr/bin/semaphore 0
Server starts: HA on, sqlite, no Redis ran the pinned binary on the rendered config pong on /api/ping, no Redis dial, no fatal
Rendered config is valid and complete templated config.json.j2 through the role, jq -e valid JSON; ha.enabled, use_remote_runner, both limits, web_host, all eight email_* keys present
Guards refuse a missing name case_role_refuses_a_missing_mail_name each of the three names refused by name, no config written
Watchdog force-stops only the stale row rendered script against a token-checking mock API (40-min running, 5-min running, success) stopped the 40-min row only; others untouched
Watchdog exits 1 when the mail fails same, with an unreachable SMTP host the report did not mail through …, exit 1
Units parse systemd-analyze calendar '*:0/15', bash -n on the rendered sweep *-*-* *:00/15:00; script syntax clean
Files read in full all 30 files of the diff, plus AGENTS.md, docs/deploy.md, docs/environment.md, docs/agents/issue-tracker.md accounted for

Could not verify

  • make upgrade-check — no docker on this host. The restart-mid-job behaviour (60/60 lines, one mail, task not found in pool) is the author's measurement, not mine.
  • The --check --diff rehearsal (ok=22 changed=9 failed=0 skipped=12) — same reason; rehearsal.sh needs docker and ssh.
  • SMTP2GO delivery — no credentials. I verified the config keys and that a mail failure exits 1; I did not send through mail.smtp2go.com:587.
  • The task link in the sweep's mail (project/$pid/templates/$tpl?t=$tid, :66) — I could not confirm the UI route from anything in this repo, so I am not raising it either way.

Files passed

.env.example, Makefile, docs/deploy.md, docs/environment.md, env.map, scripts/tests/run.sh, semaphore/service/ansible.cfg, group_vars/semaphore/vars.yml, roles/semaphore/defaults/main.yml, tasks/main.yml, tasks/secrets.yml, tasks/watchdog.yml, templates/config.json.j2, templates/semaphore-watchdog.env.j2, templates/semaphore-watchdog.service.j2, templates/semaphore-watchdog.timer.j2, tests/rehearsal.yml, and tests/ha/{Dockerfile.rehearsal,Dockerfile.runner,api.sh,bootstrap.sh,env.sh,m1_server_restart.sh,rehearsal.sh,run.sh,runner.sh,setupsh} — read; nothing beyond the findings above. research/cp30-ha-flag.md is named above.


Summary. Spec axis: 4 findings — 2 BLOCKER, 2 ADVISORY; worst: use_remote_runner: true with no runner, which errors every task on 143 at the merge. Standards axis: 2 findings — 0 BLOCKER, 2 ADVISORY; worst: the SMTP password on the curl command line. Total 2 BLOCKER, 4 ADVISORY. The recommendation turns on the two blockers; the advisories are advice and travel with them.

``` repo: olympus/infra-cockpit | pr: 16 | head: fa2ffb55605d01ebaa39d3e62f83066b568e0b97 | round: 1/5 | verdict: block ``` **Recommendation: fix** Spec source: the PR body. It names CP-41 but links no ticket, and this session has no Vikunja access, so the contract reviewed here is the one the body states: the pin moves to the community build; 143 gets HA without Redis, the failure mail and the watchdog; `make check` green; `make upgrade-check` green; the role clean in `--check --diff`; the watchdog verified against a mock API. Standards source: `AGENTS.md`, `docs/deploy.md`, `docs/environment.md`. No formatter or linter covers the new `.j2` shell and unit files (`fmt-check` is `tofu fmt` only), so the smell baseline below is judgement, not a tool result. --- ## Spec ### BLOCKER — `use_remote_runner: true` ships with no runner anywhere; every task fails `semaphore/service/roles/semaphore/templates/config.json.j2:15` I downloaded the pinned artifact (`sha256 6866a09c…5672` — matches `defaults/main.yml`), migrated a fresh sqlite database with it, started the server on the config this template renders (HA on, sqlite, no Redis, `use_remote_runner: true`), and created a project, template and task over the API with **no runner registered**: ``` Task probe added to queue Started task #1 of template 'probe' Failed to run task: no runners available {"id":1,"status":"error","runner_id":null,"start":null} ``` The row reached `error` in under 5 s. The runner is CP-42 and it does not exist yet in any form: `defaults/main.yml:75-78` says its token comes "with the runner (CP-42)", `docs/deploy.md:183-184` still says "once the runner exists", and this repository has no CP-42 pull request at all (PRs 1-16 listed; none is the runner). The body's Merge Danger names only CP-44's two store paths as preconditions — and since "the merge is the deploy", merging before a runner is registered turns every task on 143 from running to `error`. **Smallest clear:** add CP-42's runner (registered, active, default) to the "Do not merge before" list — or keep `use_remote_runner` off in the shipped config until it lands. ### BLOCKER — a sweep that read no project's tasks exits 0 `semaphore/service/roles/semaphore/templates/semaphore-watchdog.sh.j2:79` ``` if [ "$stopped" -eq 0 ] && [ -z "$report" ]; then exit 0 fi ``` This ignores `$fails`, which line 48 sets when a project's task list does not answer. I rendered the template through the role (the real artifact, not a copy) and ran it against an API whose `/api/project/1/tasks` answers 500: ``` curl: (22) The requested URL returned error: 500 watchdog: project 1's task list did not answer; its tasks were not swept. exit=0 ``` That contradicts `docs/deploy.md:126-127` ("a sweep that could not read the API … is a failed unit"), the unit's own comment (`semaphore-watchdog.service.j2:11-12`) and the script header (`:14-15`, "Exits 0 when the sweep completed, 1 when it did not"). The one state the watchdog exists to surface — it could not see the tasks — is the one it reports as success, and nothing on the Guest would show it. No test covers the sweep's exit status; the mock-API check in the body is not in the repository. **Smallest clear:** `[ "$fails" -eq 0 ] || exit 1` before the early return. ### ADVISORY — the harness's "the server started" assertion cannot fail `semaphore/service/tests/ha/server.sh:12-13`, consumed at `semaphore/service/tests/ha/run.sh:96` ``` for _ in $(seq 1 120); do curl -fsS "$B/api/ping" >/dev/null 2>&1 && break; sleep 0.5; done echo "server up: $(curl -sS "$B/api/ping")" ``` If the server never answers in 60 s the loop ends, the failing `curl` sits inside a command substitution in an `echo` argument, and the function still exits 0 — so `run.sh` prints `ok "the server started on the role's rendered config…"`. Later steps do fail, so the check is not vacuous, but the assertion the body cites as evidence for "the pin starts with HA and sqlite" does not assert. Re-pinging after the loop and returning non-zero would make it real. ### ADVISORY — the licence question the change's own note raises is absent from Merge Danger `research/cp30-ha-flag.md:265-273` ``` Reading: on the pin, HA with Redis runs Enterprise code … the vendor's terms say that needs a valid subscription. … The Operator should decide whether flipping that switch on the community binary counts as "enabling paid features". ``` The shipped config flips `ha.enabled` on (`config.json.j2:12-14`); the binary's own UI bundle says `"ha_only_enterprise": "High availability are only available in Enterprise edition."` The note defers the call to the Operator in three separate places; the PR body — the only place the merge decision is written down — does not mention it, while it does spell out the CP-44 secret precondition. Since the Operator decides this merge, the question belongs beside that precondition. --- ## Standards ### ADVISORY — the SMTP password goes on a command line, in the change that argues against it `semaphore/service/roles/semaphore/templates/semaphore-watchdog.sh.j2:100` ``` --user "$SMTP_USER:$SMTP_PASS" \ ``` The same changeset writes the API token to a 0600 file and explains why (`tasks/watchdog.yml:30-32`: "`cat` in the script is what keeps it out of a process listing, which a `-H` argument on a command line would not"), then passes the SMTP password as curl `argv`, which is world-readable in `/proc/<pid>/cmdline` for the life of the call (up to `--max-time 30`). The guest has one service account today, so the exposure is small, but it is the exact hazard the neighbouring comment claims to have avoided. `--netrc-file` or `-K` keeps it off `argv`. ### ADVISORY — the note cites a harness and raw results that are not in the tree `research/cp30-ha-flag.md:6-8`, `research/cp30-ha-flag.md:350` > The harness is `research/cp30-harness/`, built from CP-26's (`research/cp26-harness/`). Raw outputs are in `research/cp30-harness/results/`. `research/` contains this note and nothing else, on this branch and on `main` — no `cp30-harness/`, no `cp26-harness/`, no `results/`. The note is cited as evidence by `defaults/main.yml:1-13` and `docs/deploy.md:129-151`, so a reader following it finds a description of files that do not exist. Either land the harness or say where it lives. --- ## Verified | Claim | How | Result | |---|---|---| | `make check` green | `mise exec -- make env-check`, `env-test`, `plan-test`, `fmt-check` on this head | green — every case passed, `env.map: 12 names` | | Pin is the community asset | downloaded the release asset, `sha256sum` | `6866a09c…5672`, matches `defaults/main.yml:34` | | No `RedisTaskStateStore` | `grep -c` on the extracted `/usr/bin/semaphore` | 0 | | Server starts: HA on, sqlite, no Redis | ran the pinned binary on the rendered config | `pong` on `/api/ping`, no Redis dial, no fatal | | Rendered config is valid and complete | templated `config.json.j2` through the role, `jq -e` | valid JSON; `ha.enabled`, `use_remote_runner`, both limits, `web_host`, all eight `email_*` keys present | | Guards refuse a missing name | `case_role_refuses_a_missing_mail_name` | each of the three names refused by name, no config written | | Watchdog force-stops only the stale row | rendered script against a token-checking mock API (40-min running, 5-min running, success) | stopped the 40-min row only; others untouched | | Watchdog exits 1 when the mail fails | same, with an unreachable SMTP host | `the report did not mail through …`, exit 1 | | Units parse | `systemd-analyze calendar '*:0/15'`, `bash -n` on the rendered sweep | `*-*-* *:00/15:00`; script syntax clean | | Files read in full | all 30 files of the diff, plus `AGENTS.md`, `docs/deploy.md`, `docs/environment.md`, `docs/agents/issue-tracker.md` | accounted for | ## Could not verify - **`make upgrade-check`** — no `docker` on this host. The restart-mid-job behaviour (60/60 lines, one mail, `task not found in pool`) is the author's measurement, not mine. - **The `--check --diff` rehearsal** (`ok=22 changed=9 failed=0 skipped=12`) — same reason; `rehearsal.sh` needs docker and ssh. - **SMTP2GO delivery** — no credentials. I verified the config keys and that a mail failure exits 1; I did not send through `mail.smtp2go.com:587`. - **The task link in the sweep's mail** (`project/$pid/templates/$tpl?t=$tid`, `:66`) — I could not confirm the UI route from anything in this repo, so I am not raising it either way. ## Files passed `.env.example`, `Makefile`, `docs/deploy.md`, `docs/environment.md`, `env.map`, `scripts/tests/run.sh`, `semaphore/service/ansible.cfg`, `group_vars/semaphore/vars.yml`, `roles/semaphore/defaults/main.yml`, `tasks/main.yml`, `tasks/secrets.yml`, `tasks/watchdog.yml`, `templates/config.json.j2`, `templates/semaphore-watchdog.env.j2`, `templates/semaphore-watchdog.service.j2`, `templates/semaphore-watchdog.timer.j2`, `tests/rehearsal.yml`, and `tests/ha/{Dockerfile.rehearsal,Dockerfile.runner,api.sh,bootstrap.sh,env.sh,m1_server_restart.sh,rehearsal.sh,run.sh,runner.sh,setupsh}` — read; nothing beyond the findings above. `research/cp30-ha-flag.md` is named above. --- **Summary.** Spec axis: 4 findings — 2 BLOCKER, 2 ADVISORY; worst: `use_remote_runner: true` with no runner, which errors every task on 143 at the merge. Standards axis: 2 findings — 0 BLOCKER, 2 ADVISORY; worst: the SMTP password on the curl command line. Total 2 BLOCKER, 4 ADVISORY. The recommendation turns on the two blockers; the advisories are advice and travel with them.
Member

Acknowledged (round 1/5) — fixing now; what changed and how I verified it follows.

**Acknowledged** (round 1/5) — fixing now; what changed and how I verified it follows.
The early return at the tail of the sweep read only `$stopped` and `$report`,
so a run in which every project's task list answered 500 — or one of them did —
ended 0 and the timer's unit stayed green. That is the state the watchdog exists
to surface, and `docs/deploy.md` calls it a failed unit.

`$fails` is now the other half of "the sweep completed": the quiet exit needs it
at 0. A sweep that stopped something still falls through to the mail, so a
partial sweep keeps mailing its list and still ends red.

The case is the role's own rendered template run against a stand-in API
(`scripts/tests/watchdog-api.py`), three shapes: nothing stale (0), a project
that does not answer (1), and one stale row beside a fresh one (the stale one
force-stopped, and red because the report cannot mail). Before the fix the
second shape read `want [1], got [0]`.
`config.json.j2` shipped `"use_remote_runner": true`, and nothing on 143 is a
runner: CP-42 is the runner, it does not exist, and the role ships no
registration token, so no runner can even register. `TaskPool.go` picks
`RemoteJob` when that switch is on and `LocalExecutor` when it is not
(`:540`, `:1014` at v2.19.16), so merging this wrote a config in which every
task ends `error` — and the merge is the deploy.

The switch is now the role's own variable and ships off, which is the value
today's config already takes (no key, zero value). CP-42 flips it beside the
registration token it needs. `make upgrade-check` passes it on in its own
scratch render, because the restart-mid-job measurement it repeats is a
runner's.

The env case renders the config twice: the shipped value is false, and the same
template with `-e semaphore_use_remote_runner=true` writes true, so a constant
coming back to the template fails the second assertion. The first read
`missing ["use_remote_runner": false]` before the change.
The wait loop breaks on the first answer and only runs out otherwise, and the
line after it echoed a second `curl` inside a command substitution: when the
server never came up, that failing curl sat in an `echo` argument, the function
returned 0, and `run.sh` printed "ok the server started on the role's rendered
config". The rest of the check does fail later, but the assertion the PR body
cites as evidence for "the pin starts with HA and sqlite" asserted nothing.

The answer is now asked for once more, and a refusal is a red `start` that
quotes curl's own line and the container's last log lines.

Probed with a stub `docker` on PATH and the loop cut to 3 iterations, scratch
only: the reviewed copy exits 0 saying `server up: `; this copy exits 1 saying
`did not answer within 60 s: curl: (7) Failed to connect`; and with a listener
answering /api/ping it exits 0 with `server up: {"status":"pong"}`. The live
`make upgrade-check` still needs docker, which this host has not.
The sweep writes the API token to a 0600 file and says why — `cat` in the script
keeps it out of a process listing — and then passed the SMTP password as
`--user` on the curl command line, world-readable in /proc/<pid>/cmdline for the
life of the call.

curl now reads the whole request from a 0600 file of its own (`--config`): url,
ssl-reqd, user, mail-from, mail-rcpt and upload-file. Values are double-quoted
with a backslash and a quote escaped, because a request file that breaks on a
password is a report that never mails.

The watchdog case now renders a password carrying a space and a double quote,
puts a `curl` on PATH that appends its argv and hands the call to the real one,
and asserts both halves: the mail call carries `--config`, and the credential
appears in no argv. Against the reviewed tail those two read
`missing [--config]` and `found [test smtp "password"]`.
The note opened by citing `research/cp30-harness/` and its `results/`, and
closed with a list of scripts and output directories. None of it is in this
repository, on this branch or on main, while `defaults/main.yml` and
`docs/deploy.md` both send a reader here as evidence. A reader following the
citation found a description of files that do not exist.

The note now says the harness was a scratch directory that was not committed,
points at `semaphore/service/tests/ha/` — the same measurement made runnable,
which `make upgrade-check` runs — and marks the quoted outputs as not in this
repository.
test: the sweep's case names python3 in the suite's tool guard (CP-41)
All checks were successful
plan / guest-plan-check (pull_request_target) Successful in 54s
pr-checks / check (pull_request) Successful in 28s
d330d79c8b
The stand-in API the watchdog case runs is python3, and `plan-test` already
needs it through `scripts/plan-check.py`; a machine without it would otherwise
report "the stand-in API did not start" three times instead of the one line the
guard prints. Its own path is quoted for the same reason `$TMP` is.
Member

Round 1 fix — head d330d79 on hermes/cp41-community-ha-mail-watchdog: six commits on top of the reviewed fa2ffb5, all new, no force-push, nothing rebased.

Finding Where Commit
BLOCKER — use_remote_runner: true ships with no runner config.json.j2, defaults/main.yml, tests/ha/setup.sh, scripts/tests/run.sh, docs/deploy.md 3ab727a
BLOCKER — a sweep that read no project's tasks exits 0 templates/semaphore-watchdog.sh.j2, scripts/tests/run.sh, scripts/tests/watchdog-api.py 981366f
ADVISORY — the harness's "the server started" cannot fail semaphore/service/tests/ha/server.sh 76c28b0
ADVISORY — the licence question missing from Merge Danger this pull request's body body edited in place; no file, no commit
ADVISORY — the SMTP password on curl's command line templates/semaphore-watchdog.sh.j2, scripts/tests/run.sh b20467a
ADVISORY — the note cites a harness not in the tree research/cp30-ha-flag.md fac75d0

What each change does

use_remote_runner. I took the second of the two clears you offered: the switch is off in the shipped config, rather than named as a merge precondition. A body-only precondition leaves the deploy green and every task error if the order slips; the switch as the role's own variable is checked by the suite, and CP-42's change is that line plus the token it already names. TaskPool.go picks RemoteJob when the switch is on and LocalExecutor when it is off (:540, :1014 at v2.19.16), and today's config carries no key — the zero value is false — so merging changes nothing about how 143 runs tasks. make upgrade-check passes -e semaphore_use_remote_runner=true beside the registration token it already sets, because the restart-mid-job measurement is a runner's. The env case now renders the config twice, so a constant coming back to the template fails.

The sweep's exit status. $fails is the other half of "the sweep completed": the quiet exit needs it at 0 (981366f). A sweep that stopped something still falls through and mails its list, so a partial sweep keeps its report and still ends red. The case renders the role's own template and runs it against a stand-in API (scripts/tests/watchdog-api.py, port 0, its own scratch dir) in three shapes: nothing stale (0), a project whose task list answers 500 (1), and one stale row beside a fresh one (the stale one force-stopped, red because the report cannot mail). Against the reviewed template the second shape read FAIL a sweep that could not read a project exits 1 (want [1], got [0]).

The harness's start assertion. The wait loop breaks on the first answer and only runs out otherwise, so the answer is asked for once more and a refusal is a red start that quotes curl's line and the container's last 20 log lines (76c28b0). Probed with a stub docker on PATH and the loop cut to 3 iterations: the reviewed copy exits 0 printing server up: ; this one exits 1 printing server: http://127.0.0.1:18190/api/ping did not answer within 60 s: curl: (7) Failed to connect…; and with a listener answering /api/ping, exits 0 printing server up: {"status":"pong"}.

The mail credential. curl reads the whole request from a 0600 file of its own — url, ssl-reqd, user, mail-from, mail-rcpt, upload-file — with values double-quoted and \ and " escaped (b20467a). The case now renders a password carrying a space and a double quote, puts a curl on PATH that appends its argv and hands the call to the real binary, and asserts both halves: the mail call carries --config, and the credential appears in no argv. Against the reviewed tail those read FAIL curl is handed the request as a file (missing [--config]) and FAIL the mail credential never reaches a command line (found [test smtp "password"]).

The licence question. It is now a Merge Danger paragraph beside the CP-44 precondition: the community binary runs no pro code, the vendor's docs label HA "Enterprise" and its terms want a subscription, and the note leaves the call to the Operator. That was a live body, not a file, so it is one in-place edit, read back byte-identical (2875 → 3972 characters). I also added the sweep's evidence sentence to the body's make check bullet.

The CP-30 note. It now says the harness was a scratch directory that was not committed, points at semaphore/service/tests/ha/ as the same measurement made runnable (make upgrade-check), and marks the quoted outputs as not in this repository (fac75d0).

Two things beyond the six findings, both small and named so they are not a surprise: docs/deploy.md's "Upgrading Semaphore" paragraph carried one prose line at 84 characters against the page's 82 — I rewrapped that line while editing the page — and d330d79 adds python3 to the test suite's tool guard, because the new case needs it and the suite's own rule is to fail once, by name, instead of three times obscurely.

Verification

$ git archive d330d79 | tar -x -C <fresh dir>; mise trust .
$ env -u PROXMOX_VE_API_TOKEN -u AWS_ACCESS_KEY_ID -u AWS_SECRET_ACCESS_KEY \
    mise exec -- make check
rc=0

109 ok lines, 0 FAIL, tofu fmt -recursive -check -diff silent. Run on an export of the pushed tree, not the worktree.

CI on d330d79, read from GET /commits/d330d79…/statuses:

Context State Description
pr-checks / check (pull_request) success Successful in 28s
plan / guest-plan-check (pull_request_target) success Successful in 54s

What I could not verify

make upgrade-check was not run — no docker on this host. So the -e semaphore_use_remote_runner=true line in tests/ha/setup.sh and server.sh's new refusal are exercised only with a stub docker and a stub listener, not against the pinned artifact. The restart-mid-job numbers in the body remain the author's measurement, and a reviewer with docker should run mise exec -- make upgrade-check before this merges.

No SMTP round-trip. The mail path is asserted up to curl's argv and its refusal message (did not mail through), never to a delivered message; no credentials here.

Left alone

None of the six. I disagree with nothing in the review: both blockers reproduce exactly as you described them, and your two "smallest clear" suggestions were both right.

**Round 1 fix** — head `d330d79` on `hermes/cp41-community-ha-mail-watchdog`: six commits on top of the reviewed `fa2ffb5`, all new, no force-push, nothing rebased. | Finding | Where | Commit | | --- | --- | --- | | BLOCKER — `use_remote_runner: true` ships with no runner | `config.json.j2`, `defaults/main.yml`, `tests/ha/setup.sh`, `scripts/tests/run.sh`, `docs/deploy.md` | `3ab727a` | | BLOCKER — a sweep that read no project's tasks exits 0 | `templates/semaphore-watchdog.sh.j2`, `scripts/tests/run.sh`, `scripts/tests/watchdog-api.py` | `981366f` | | ADVISORY — the harness's "the server started" cannot fail | `semaphore/service/tests/ha/server.sh` | `76c28b0` | | ADVISORY — the licence question missing from Merge Danger | this pull request's body | body edited in place; no file, no commit | | ADVISORY — the SMTP password on curl's command line | `templates/semaphore-watchdog.sh.j2`, `scripts/tests/run.sh` | `b20467a` | | ADVISORY — the note cites a harness not in the tree | `research/cp30-ha-flag.md` | `fac75d0` | ## What each change does **`use_remote_runner`.** I took the second of the two clears you offered: the switch is off in the shipped config, rather than named as a merge precondition. A body-only precondition leaves the deploy green and every task `error` if the order slips; the switch as the role's own variable is checked by the suite, and CP-42's change is that line plus the token it already names. `TaskPool.go` picks `RemoteJob` when the switch is on and `LocalExecutor` when it is off (`:540`, `:1014` at `v2.19.16`), and today's config carries no key — the zero value is `false` — so merging changes nothing about how 143 runs tasks. `make upgrade-check` passes `-e semaphore_use_remote_runner=true` beside the registration token it already sets, because the restart-mid-job measurement is a runner's. The env case now renders the config twice, so a constant coming back to the template fails. **The sweep's exit status.** `$fails` is the other half of "the sweep completed": the quiet exit needs it at 0 (`981366f`). A sweep that stopped something still falls through and mails its list, so a partial sweep keeps its report and still ends red. The case renders the role's own template and runs it against a stand-in API (`scripts/tests/watchdog-api.py`, port 0, its own scratch dir) in three shapes: nothing stale (0), a project whose task list answers 500 (1), and one stale row beside a fresh one (the stale one force-stopped, red because the report cannot mail). Against the reviewed template the second shape read `FAIL a sweep that could not read a project exits 1 (want [1], got [0])`. **The harness's start assertion.** The wait loop breaks on the first answer and only runs out otherwise, so the answer is asked for once more and a refusal is a red `start` that quotes curl's line and the container's last 20 log lines (`76c28b0`). Probed with a stub `docker` on `PATH` and the loop cut to 3 iterations: the reviewed copy exits 0 printing `server up: `; this one exits 1 printing `server: http://127.0.0.1:18190/api/ping did not answer within 60 s: curl: (7) Failed to connect…`; and with a listener answering `/api/ping`, exits 0 printing `server up: {"status":"pong"}`. **The mail credential.** curl reads the whole request from a 0600 file of its own — url, ssl-reqd, user, mail-from, mail-rcpt, upload-file — with values double-quoted and `\` and `"` escaped (`b20467a`). The case now renders a password carrying a space and a double quote, puts a `curl` on `PATH` that appends its argv and hands the call to the real binary, and asserts both halves: the mail call carries `--config`, and the credential appears in no argv. Against the reviewed tail those read `FAIL curl is handed the request as a file (missing [--config])` and `FAIL the mail credential never reaches a command line (found [test smtp "password"])`. **The licence question.** It is now a Merge Danger paragraph beside the CP-44 precondition: the community binary runs no pro code, the vendor's docs label HA "Enterprise" and its terms want a subscription, and the note leaves the call to the Operator. That was a live body, not a file, so it is one in-place edit, read back byte-identical (2875 → 3972 characters). I also added the sweep's evidence sentence to the body's `make check` bullet. **The CP-30 note.** It now says the harness was a scratch directory that was not committed, points at `semaphore/service/tests/ha/` as the same measurement made runnable (`make upgrade-check`), and marks the quoted outputs as not in this repository (`fac75d0`). Two things beyond the six findings, both small and named so they are not a surprise: `docs/deploy.md`'s "Upgrading Semaphore" paragraph carried one prose line at 84 characters against the page's 82 — I rewrapped that line while editing the page — and `d330d79` adds `python3` to the test suite's tool guard, because the new case needs it and the suite's own rule is to fail once, by name, instead of three times obscurely. ## Verification ``` $ git archive d330d79 | tar -x -C <fresh dir>; mise trust . $ env -u PROXMOX_VE_API_TOKEN -u AWS_ACCESS_KEY_ID -u AWS_SECRET_ACCESS_KEY \ mise exec -- make check rc=0 ``` 109 `ok` lines, 0 `FAIL`, `tofu fmt -recursive -check -diff` silent. Run on an export of the pushed tree, not the worktree. CI on `d330d79`, read from `GET /commits/d330d79…/statuses`: | Context | State | Description | | --- | --- | --- | | `pr-checks / check (pull_request)` | `success` | Successful in 28s | | `plan / guest-plan-check (pull_request_target)` | `success` | Successful in 54s | ## What I could not verify **`make upgrade-check` was not run — no docker on this host.** So the `-e semaphore_use_remote_runner=true` line in `tests/ha/setup.sh` and `server.sh`'s new refusal are exercised only with a stub `docker` and a stub listener, not against the pinned artifact. The restart-mid-job numbers in the body remain the author's measurement, and a reviewer with docker should run `mise exec -- make upgrade-check` before this merges. **No SMTP round-trip.** The mail path is asserted up to curl's argv and its refusal message (`did not mail through`), never to a delivered message; no credentials here. ## Left alone None of the six. I disagree with nothing in the review: both blockers reproduce exactly as you described them, and your two "smallest clear" suggestions were both right.
Member

Review started (round 2/5) on d330d79c8b — reading the diff now.

**Review started** (round 2/5) on d330d79c8b7eb3912ebe498b0b04ea3dd44f6d5e — reading the diff now.
bot-minos approved these changes 2026-11-05 14:33:31 +00:00
Dismissed
bot-minos left a comment
repo: olympus/infra-cockpit | pr: 16 | head: d330d79c8b7eb3912ebe498b0b04ea3dd44f6d5e | round: 2/5 | verdict: merge

Recommendation: merge

Spec source: the PR body. It names CP-41 but links no ticket, and this session has no Vikunja access, so the contract reviewed is the one the body states — pin moves to the community build; 143 gets HA without Redis, the failure mail and the watchdog; make check green; make upgrade-check green; the role clean in --check --diff; the watchdog verified against a mock API. Standards source: AGENTS.md, docs/deploy.md, docs/environment.md. Nothing in the toolchain covers the new .j2 shell, so the smell baseline is judgement; I raise nothing from it.

This round reviewed the ten files that changed since fa2ffb5 and re-verified the two blockers by hand rather than by reading the fix.


Round 1 blockers — both cleared

Finding Fix Where How I verified it
BLOCKER — use_remote_runner: true ships with no runner 3ab727a roles/semaphore/defaults/main.yml:82, templates/config.json.j2:15 Rendered the role's config, ran the pinned binary on it, and created a project, repository, bash template and task over the API: task 1 ended success in 1.0 s with runner_id: null. No no runners available.
BLOCKER — a sweep that read no project's tasks exits 0 981366f templates/semaphore-watchdog.sh.j2:85 Removing that line from a copy of the tree reds the suite: FAIL a sweep that could not read a project exits 1 (want [1], got [0]). With it, the case is green.

The round-1 advisories are also addressed, and I checked each rather than taking the commit message:

  • server.sh:17-22 — the start assertion can fail now. Stub docker, nothing listening on 18190: server: http://127.0.0.1:18190/api/ping did not answer within 60 s: curl: (7) Failed to connect…, exit 1. Round 1's copy printed server up: and exited 0.
  • Merge Danger — the licence paragraph is in the body, beside the CP-44 precondition.
  • b20467a — argv carries only --config <path>. I ran the rendered sweep against a STARTTLS sink: with SMTP_PASS='test smtp "password"' the sink received user='probe-smtp-user', pass='test smtp "password"', one stale row force-stopped, the 5-minute row untouched, exit 0.
  • fac75d0 — the note says the harness was scratch and points at tests/ha/; research/ holds only the note.

Spec

ADVISORY — the quoting the case feeds a password through is never observed

scripts/tests/run.sh:145, :321, :385-387

The case exists, in its own words, because "a value that breaks the quoting is the value a mail credential actually has" — yet the only thing asserted about the mail is that --config is on argv and the credential is not. The stale case's SMTP_PORT='1' means every mail attempt fails at connect, so a request file curl could not parse is indistinguishable from a refused connection: both end did not mail through, exit 1, which is what the case wants.

Evidence: in a copy of the tree I replaced curl_quote's escaping with a bare printf '"%s"' "$1" — no \ or " escaping at all — and all eleven watchdog assertions stayed green. The shipped escaping is right: my STARTTLS probe shows the password arriving byte for byte. This is a hole in the test, not in the code, and it does not hold the merge.

Smallest clear: assert the file curl is handed rather than only the argv — read $cfg's user = line in the case, or point SMTP_PORT at a local sink that records the credential.


Standards

No findings. The delta follows AGENTS.md (secrets from the environment, no plaintext, no vault), the pages' prose width, and the suite's own conventions; the new comment blocks carry the reasoning the rest of the repository's comments do. bash -n is clean on all nine harness scripts.


Verified

Claim How Result
make check green on this head mise exec -- make check on a clean export of d330d79 rc 0, 109 ok, 0 FAIL, tofu fmt -check silent
The switch is the variable, not a constant case_role_reads_env renders twice green; flipping the default to true reds it
Pin is the community asset downloaded the release asset, sha256sum 6866a09c…5672, matches defaults/main.yml:13
Server starts: HA on, sqlite, no Redis, tasks in-process ran the pinned binary on the role-rendered config, created a task over the API pong; task success, runner_id: null
Watchdog: three shapes suite case against scripts/tests/watchdog-api.py quiet 0, unreadable 1, stale stops only the stale row
Watchdog mails the right thing rendered sweep + STARTTLS sink + stale-mode API one mail, one row stopped, credential intact, credential off argv
--config really is what curl reads argv log from a stub curl + the sink's view argv: --config /tmp/tmp.…; sink: the password with its space and quote
CI on d330d79 GET /commits/d330d79…/statuses pr-checks / check success, plan / guest-plan-check success

Could not verify

  • make upgrade-check — no docker on this host. The restart-mid-job numbers in the body, the -e semaphore_use_remote_runner=true path inside setup.sh:91, and server.sh's refusal against a real container are the author's measurement plus my stub-docker probe, not a run on the artifact. A reviewer with docker should run it before the merge.
  • SMTP2GO delivery — no credentials. I proved the mail path up to a local STARTTLS sink, not through mail.smtp2go.com:587.
  • The --check --diff rehearsal (ok=22 changed=9 failed=0 skipped=12) — rehearsal.sh needs docker and ssh.

Files

docs/deploy.md, research/cp30-ha-flag.md, scripts/tests/run.sh, scripts/tests/watchdog-api.py, roles/semaphore/defaults/main.yml, roles/semaphore/templates/config.json.j2, roles/semaphore/templates/semaphore-watchdog.sh.j2, semaphore/service/tests/env-vars.yml, tests/ha/server.sh, tests/ha/setup.sh — the ten that changed since round 1, read in full. The other twenty-two files of the diff are unchanged since the round-1 review that passed them.


Summary. Spec axis: 1 finding — 0 BLOCKER, 1 ADVISORY; worst: the mail-quoting test never observes the file curl reads. Standards axis: 0 findings. Total 0 BLOCKER, 1 ADVISORY — under the volume rule, so the recommendation is merge and the advisory travels as advice, not as a condition.

``` repo: olympus/infra-cockpit | pr: 16 | head: d330d79c8b7eb3912ebe498b0b04ea3dd44f6d5e | round: 2/5 | verdict: merge ``` **Recommendation: merge** Spec source: the PR body. It names CP-41 but links no ticket, and this session has no Vikunja access, so the contract reviewed is the one the body states — pin moves to the community build; 143 gets HA without Redis, the failure mail and the watchdog; `make check` green; `make upgrade-check` green; the role clean in `--check --diff`; the watchdog verified against a mock API. Standards source: `AGENTS.md`, `docs/deploy.md`, `docs/environment.md`. Nothing in the toolchain covers the new `.j2` shell, so the smell baseline is judgement; I raise nothing from it. This round reviewed the ten files that changed since `fa2ffb5` and re-verified the two blockers by hand rather than by reading the fix. --- ## Round 1 blockers — both cleared | Finding | Fix | Where | How I verified it | |---|---|---|---| | BLOCKER — `use_remote_runner: true` ships with no runner | `3ab727a` | `roles/semaphore/defaults/main.yml:82`, `templates/config.json.j2:15` | Rendered the role's config, ran the pinned binary on it, and created a project, repository, bash template and task over the API: task 1 ended `success` in 1.0 s with `runner_id: null`. No `no runners available`. | | BLOCKER — a sweep that read no project's tasks exits 0 | `981366f` | `templates/semaphore-watchdog.sh.j2:85` | Removing that line from a copy of the tree reds the suite: `FAIL a sweep that could not read a project exits 1 (want [1], got [0])`. With it, the case is green. | The round-1 advisories are also addressed, and I checked each rather than taking the commit message: - `server.sh:17-22` — the start assertion can fail now. Stub `docker`, nothing listening on 18190: `server: http://127.0.0.1:18190/api/ping did not answer within 60 s: curl: (7) Failed to connect…`, exit 1. Round 1's copy printed `server up:` and exited 0. - Merge Danger — the licence paragraph is in the body, beside the CP-44 precondition. - `b20467a` — argv carries only `--config <path>`. I ran the rendered sweep against a STARTTLS sink: with `SMTP_PASS='test smtp "password"'` the sink received `user='probe-smtp-user'`, `pass='test smtp "password"'`, one stale row force-stopped, the 5-minute row untouched, exit 0. - `fac75d0` — the note says the harness was scratch and points at `tests/ha/`; `research/` holds only the note. --- ## Spec ### ADVISORY — the quoting the case feeds a password through is never observed `scripts/tests/run.sh:145`, `:321`, `:385-387` The case exists, in its own words, because "a value that breaks the quoting is the value a mail credential actually has" — yet the only thing asserted about the mail is that `--config` is on argv and the credential is not. The stale case's `SMTP_PORT='1'` means every mail attempt fails at connect, so a request file curl could not parse is indistinguishable from a refused connection: both end `did not mail through`, exit 1, which is what the case wants. Evidence: in a copy of the tree I replaced `curl_quote`'s escaping with a bare `printf '"%s"' "$1"` — no `\` or `"` escaping at all — and all eleven watchdog assertions stayed green. The shipped escaping is right: my STARTTLS probe shows the password arriving byte for byte. This is a hole in the test, not in the code, and it does not hold the merge. **Smallest clear:** assert the file curl is handed rather than only the argv — read `$cfg`'s `user =` line in the case, or point `SMTP_PORT` at a local sink that records the credential. --- ## Standards No findings. The delta follows `AGENTS.md` (secrets from the environment, no plaintext, no vault), the pages' prose width, and the suite's own conventions; the new comment blocks carry the reasoning the rest of the repository's comments do. `bash -n` is clean on all nine harness scripts. --- ## Verified | Claim | How | Result | |---|---|---| | `make check` green on this head | `mise exec -- make check` on a clean export of `d330d79` | rc 0, 109 `ok`, 0 `FAIL`, `tofu fmt -check` silent | | The switch is the variable, not a constant | `case_role_reads_env` renders twice | green; flipping the default to `true` reds it | | Pin is the community asset | downloaded the release asset, `sha256sum` | `6866a09c…5672`, matches `defaults/main.yml:13` | | Server starts: HA on, sqlite, no Redis, tasks in-process | ran the pinned binary on the role-rendered config, created a task over the API | `pong`; task `success`, `runner_id: null` | | Watchdog: three shapes | suite case against `scripts/tests/watchdog-api.py` | quiet 0, unreadable 1, stale stops only the stale row | | Watchdog mails the right thing | rendered sweep + STARTTLS sink + stale-mode API | one mail, one row stopped, credential intact, credential off argv | | `--config` really is what curl reads | argv log from a stub curl + the sink's view | argv: `--config /tmp/tmp.…`; sink: the password with its space and quote | | CI on `d330d79` | `GET /commits/d330d79…/statuses` | `pr-checks / check` success, `plan / guest-plan-check` success | ## Could not verify - **`make upgrade-check`** — no `docker` on this host. The restart-mid-job numbers in the body, the `-e semaphore_use_remote_runner=true` path inside `setup.sh:91`, and `server.sh`'s refusal against a real container are the author's measurement plus my stub-docker probe, not a run on the artifact. A reviewer with docker should run it before the merge. - **SMTP2GO delivery** — no credentials. I proved the mail path up to a local STARTTLS sink, not through `mail.smtp2go.com:587`. - **The `--check --diff` rehearsal** (`ok=22 changed=9 failed=0 skipped=12`) — `rehearsal.sh` needs docker and ssh. ## Files `docs/deploy.md`, `research/cp30-ha-flag.md`, `scripts/tests/run.sh`, `scripts/tests/watchdog-api.py`, `roles/semaphore/defaults/main.yml`, `roles/semaphore/templates/config.json.j2`, `roles/semaphore/templates/semaphore-watchdog.sh.j2`, `semaphore/service/tests/env-vars.yml`, `tests/ha/server.sh`, `tests/ha/setup.sh` — the ten that changed since round 1, read in full. The other twenty-two files of the diff are unchanged since the round-1 review that passed them. --- **Summary.** Spec axis: 1 finding — 0 BLOCKER, 1 ADVISORY; worst: the mail-quoting test never observes the file curl reads. Standards axis: 0 findings. Total 0 BLOCKER, 1 ADVISORY — under the volume rule, so the recommendation is merge and the advisory travels as advice, not as a condition.
test: the upgrade check polls for the mail it waits for (CP-41)
All checks were successful
plan / guest-plan-check (pull_request_target) Successful in 26s
pr-checks / check (pull_request) Successful in 28s
1a0cc40fb0
The mail is sent while the row finalizes and Mailpit is read over HTTP, so a
single read a second after the status can see no mail yet and red the gate.
Fifteen one-second reads, and the delta it asserts on is the one it reported.
pit dismissed bot-minos's review 2026-11-05 15:27:13 +00:00
Reason:

New commits pushed, approval review dismissed automatically according to repository settings

Member

Review started (round 1/5) on 1a0cc40fb0 — reading the diff now.

**Review started** (round 1/5) on 1a0cc40fb0ade3b2ff44018ba275111b81028162 — reading the diff now.
bot-minos approved these changes 2026-11-05 15:36:35 +00:00
bot-minos left a comment

repo: olympus/infra-cockpit · pr: #16 · head: 1a0cc40 · round: 3/5 · verdict: merge

Recommendation: merge

Round number. The dispatch said round 1/5; the thread already carries two reviews of mine (fa2ffb5 REQUEST_CHANGES, d330d79 APPROVED, both dismissed by later pushes), so this is round 3 and the header says so.

Spec source: the PR body — it names CP-41 and links no ticket; Vikunja is not reachable from this session, so the body's own claims are the contract (community pin, HA without Redis, mail, watchdog, make check green, make upgrade-check green). Standards source: AGENTS.md §Toolchain (make check is the credential-free gate; a PR runs it), docs/deploy.md, the org ADRs at olympus/workshop main (0001–0012) — none bears on a test-harness poll. Nothing in the toolchain covers .sh under tests/ha/, so the smell baseline is judgement.

Fixed point. git merge-base --is-ancestor d330d79 1a0cc40 → true: the author stacked, nothing was rewritten. The round's delta is git diff d330d79 1a0cc40 — one commit, 1a0cc40, one file: semaphore/service/tests/ha/run.sh (+12 −3). main is still 337a5ff, the PR's merge-base, so the head is current. Both round-1 blockers were cleared and re-proved at d330d79; the files that fixed them (config.json.j2, semaphore-watchdog.sh.j2, defaults/main.yml, scripts/tests/run.sh) are byte-identical in this delta, and make check below runs their cases again on this head.


Spec

ADVISORY — the new poll waits for a mail that is late, never for one that is extra

semaphore/service/tests/ha/run.sh:139-146

local delta=0
for _ in $(seq 1 15); do
  mails_after=$(mails)
  delta=$(( ${mails_after:-$mails_before} - mails_before ))
  [ "$delta" -ge "$mail" ] && break
  sleep 1
done
if [ "$delta" = "$mail" ]; then

The loop leaves the moment delta >= mail. For the failing job (mail=1) that is the right exit: the wait is spent only when the mail is missing. But the same line makes the plain job (mail=0, run.sh:168) exit on the first read, and lets a second mail that lands after the first read go unseen — so "the job sent 0 mail(s)" and "exactly one" are still one instantaneous read each. The comment above the loop says delivery can trail the row's status; that same trail would hide a mail the plain job should not send. This is not a regression (the old code read once), and the body's "none" is the author's measurement, so it does not hold the merge.

Evidence, run_case extracted from each revision and driven with a stub mails (baseline 0, then a scripted count):

Scenario d330d79 1a0cc40
want 1, mail present at once ok ok
want 1, mail lands 4 s late FAIL (0, wanted 1) ok — the fix works
want 1, mail never comes FAIL FAIL after 15–16 s (not vacuous)
want 1, mail API silent FAIL FAIL after 15 s
want 1, two mails at once FAIL (2) FAIL (2)
want 0, none ok ok
want 0, a mail lands 3 s later ok ok — still blind
want 1, a second mail lands 4 s later ok ok — still blind

Smallest clear (optional): when mail=0, or after the want is met, hold the window (read once more after a short settle) before asserting equality.


Standards

No findings. The hunk keeps the file's conventions (ok/fail helpers, local declared in run_case, set -uo pipefail-safe ${mails_after:-…} default), the comment carries its reasoning like its neighbours, and bash -n is clean on the revision.


Named, not charged

  • Carried from round 2, unchanged: the mail-quoting case never observes the file curl reads (scripts/tests/run.sh:145, :321, :385-387; round-2 ADVISORY). This delta does not touch it; it stays advice, is not re-counted here, and does not hold the merge.
  • The commit message's premise is unverified. It says a single read "a second after the status" can miss the mail. m1_server_restart.sh:28 ends with sleep 5 after the row reaches its terminal state, and run_case reads only after that script returns, so the read already lands several seconds after the status. I cannot reproduce the flake without docker; the poll is harmless either way, and nothing here rests on it.

Verified

Claim How Result
Head is the dispatched SHA git ls-remote origin refs/pull/16/head before posting 1a0cc40fb0ade3b2ff44018ba275111b81028162
Stacked, one-file delta merge-base --is-ancestor d330d79 1a0cc40; git diff --stat d330d79 1a0cc40 true; tests/ha/run.sh only
make check green on this head mise exec -- make check in a clean worktree, credentials unset rc 0, 109 ok, 0 FAIL, git status clean
The poll fixes the late-mail case and still fails when no mail comes run_case from both revisions, stubbed mails, 8 scenarios (table above) red at d330d79, green at 1a0cc40 for the late mail; red at both for missing, silent API and duplicate
run.sh parses bash -n on both revisions ok
CI on the head GET /commits/1a0cc40…/statuses pr-checks / check success (28 s); plan / guest-plan-check success (26 s)
Org ADRs listed olympus/workshop docs/adr at main (0001–0012) none bears on the delta

Could not verify

  • make upgrade-check — no docker on this host. The restart-mid-job numbers in the body, and this commit's effect on the real Mailpit sink, are the author's measurement plus my stubbed drive of the loop.
  • SMTP2GO delivery and the --check --diff rehearsal — no credentials, no docker; unchanged since round 2.

Files

semaphore/service/tests/ha/run.sh — the one file in the delta, read in full at the head. The other 31 files of the PR are unchanged since the round-2 review that passed them.


Summary. Spec axis: 1 finding — 0 BLOCKER, 1 ADVISORY; worst: the poll cannot see a mail that arrives late when none is wanted. Standards axis: 0 findings. Total 0 BLOCKER, 1 ADVISORY — under the volume rule, so the recommendation is merge and the advisory travels as advice, not as a condition.

<!-- minos review-loop: repo=olympus/infra-cockpit pr=16 head=1a0cc40fb0ade3b2ff44018ba275111b81028162 round=3/5 axes=standards,spec --> repo: olympus/infra-cockpit · pr: #16 · head: 1a0cc40 · round: 3/5 · verdict: merge Recommendation: merge **Round number.** The dispatch said round 1/5; the thread already carries two reviews of mine (`fa2ffb5` REQUEST_CHANGES, `d330d79` APPROVED, both dismissed by later pushes), so this is round 3 and the header says so. **Spec source:** the PR body — it names CP-41 and links no ticket; Vikunja is not reachable from this session, so the body's own claims are the contract (community pin, HA without Redis, mail, watchdog, `make check` green, `make upgrade-check` green). **Standards source:** `AGENTS.md` §Toolchain (`make check` is the credential-free gate; a PR runs it), `docs/deploy.md`, the org ADRs at `olympus/workshop` `main` (`0001`–`0012`) — none bears on a test-harness poll. Nothing in the toolchain covers `.sh` under `tests/ha/`, so the smell baseline is judgement. **Fixed point.** `git merge-base --is-ancestor d330d79 1a0cc40` → true: the author stacked, nothing was rewritten. The round's delta is `git diff d330d79 1a0cc40` — one commit, `1a0cc40`, one file: `semaphore/service/tests/ha/run.sh` (+12 −3). `main` is still `337a5ff`, the PR's merge-base, so the head is current. Both round-1 blockers were cleared and re-proved at `d330d79`; the files that fixed them (`config.json.j2`, `semaphore-watchdog.sh.j2`, `defaults/main.yml`, `scripts/tests/run.sh`) are byte-identical in this delta, and `make check` below runs their cases again on this head. --- ## Spec ### ADVISORY — the new poll waits for a mail that is *late*, never for one that is *extra* `semaphore/service/tests/ha/run.sh:139-146` ``` local delta=0 for _ in $(seq 1 15); do mails_after=$(mails) delta=$(( ${mails_after:-$mails_before} - mails_before )) [ "$delta" -ge "$mail" ] && break sleep 1 done if [ "$delta" = "$mail" ]; then ``` The loop leaves the moment `delta >= mail`. For the failing job (`mail=1`) that is the right exit: the wait is spent only when the mail is missing. But the same line makes the plain job (`mail=0`, `run.sh:168`) exit on the first read, and lets a second mail that lands after the first read go unseen — so "the job sent 0 mail(s)" and "exactly one" are still one instantaneous read each. The comment above the loop says delivery can trail the row's status; that same trail would hide a mail the plain job should not send. This is not a regression (the old code read once), and the body's "none" is the author's measurement, so it does not hold the merge. Evidence, `run_case` extracted from each revision and driven with a stub `mails` (baseline 0, then a scripted count): | Scenario | `d330d79` | `1a0cc40` | | --- | --- | --- | | want 1, mail present at once | ok | ok | | want 1, mail lands 4 s late | **FAIL** (0, wanted 1) | **ok** — the fix works | | want 1, mail never comes | FAIL | FAIL after 15–16 s (not vacuous) | | want 1, mail API silent | FAIL | FAIL after 15 s | | want 1, two mails at once | FAIL (2) | FAIL (2) | | want 0, none | ok | ok | | want 0, a mail lands 3 s later | ok | ok — still blind | | want 1, a second mail lands 4 s later | ok | ok — still blind | **Smallest clear (optional):** when `mail=0`, or after the want is met, hold the window (read once more after a short settle) before asserting equality. --- ## Standards No findings. The hunk keeps the file's conventions (`ok`/`fail` helpers, `local` declared in `run_case`, `set -uo pipefail`-safe `${mails_after:-…}` default), the comment carries its reasoning like its neighbours, and `bash -n` is clean on the revision. --- ## Named, not charged - **Carried from round 2, unchanged:** the mail-quoting case never observes the file curl reads (`scripts/tests/run.sh:145`, `:321`, `:385-387`; round-2 ADVISORY). This delta does not touch it; it stays advice, is not re-counted here, and does not hold the merge. - **The commit message's premise is unverified.** It says a single read "a second after the status" can miss the mail. `m1_server_restart.sh:28` ends with `sleep 5` after the row reaches its terminal state, and `run_case` reads only after that script returns, so the read already lands several seconds after the status. I cannot reproduce the flake without docker; the poll is harmless either way, and nothing here rests on it. ## Verified | Claim | How | Result | | --- | --- | --- | | Head is the dispatched SHA | `git ls-remote origin refs/pull/16/head` before posting | `1a0cc40fb0ade3b2ff44018ba275111b81028162` | | Stacked, one-file delta | `merge-base --is-ancestor d330d79 1a0cc40`; `git diff --stat d330d79 1a0cc40` | true; `tests/ha/run.sh` only | | `make check` green on this head | `mise exec -- make check` in a clean worktree, credentials unset | rc 0, 109 `ok`, 0 `FAIL`, `git status` clean | | The poll fixes the late-mail case and still fails when no mail comes | `run_case` from both revisions, stubbed `mails`, 8 scenarios (table above) | red at `d330d79`, green at `1a0cc40` for the late mail; red at both for missing, silent API and duplicate | | `run.sh` parses | `bash -n` on both revisions | ok | | CI on the head | `GET /commits/1a0cc40…/statuses` | `pr-checks / check` success (28 s); `plan / guest-plan-check` success (26 s) | | Org ADRs | listed `olympus/workshop` `docs/adr` at `main` (0001–0012) | none bears on the delta | ## Could not verify - **`make upgrade-check`** — no docker on this host. The restart-mid-job numbers in the body, and this commit's effect on the real Mailpit sink, are the author's measurement plus my stubbed drive of the loop. - **SMTP2GO delivery** and the **`--check --diff` rehearsal** — no credentials, no docker; unchanged since round 2. ## Files `semaphore/service/tests/ha/run.sh` — the one file in the delta, read in full at the head. The other 31 files of the PR are unchanged since the round-2 review that passed them. --- **Summary.** Spec axis: 1 finding — 0 BLOCKER, 1 ADVISORY; worst: the poll cannot see a mail that arrives late when none is wanted. Standards axis: 0 findings. Total 0 BLOCKER, 1 ADVISORY — under the volume rule, so the recommendation is merge and the advisory travels as advice, not as a condition.
pit merged commit 4dd55eff24 into main 2026-11-05 15:38:47 +00:00
pit deleted branch hermes/cp41-community-ha-mail-watchdog 2026-11-05 15:38:48 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
olympus/infra-cockpit!16
No description provided.