Skip to content

ci: correct the scheduled-run notification claim - #1286

Closed
tend-agent wants to merge 2 commits into
mainfrom
ci/schedule-alarm-routing
Closed

tend-agent wants to merge 2 commits into
mainfrom
ci/schedule-alarm-routing

Conversation

@tend-agent

@tend-agent tend-agent commented Sep 17, 2026 •

Copy link
Copy Markdown
Collaborator

The schedule block added in #1282 is tend's only watch that sits outside the sandbox, so where its failure alarm lands is worth getting right. The comment claimed the alarm "mails the repo owner". GitHub routes it by account identity instead: notifications go to "the user who initially created the workflow", move to a different user who "updates the cron syntax, in the schedule event in the workflow file", and move again to whoever re-enables a scheduled workflow that was disabled (docs). That resolves to the repo owner today, who authored the commit, but the binding follows the cron line rather than the owner role — and this file is hand-maintained, so a later edit by any account takes the alarm with it, silently and without turning anything red. The comment now states that rule, plus the operational consequence: keep that line human-edited, because the bot's own notifications route back through the sandbox this schedule exists to watch from outside.

That consequence is also why this PR no longer touches the cron itself. It originally offset the minute to 37 */6 * * *, on the grounds that the top of the hour is the window GitHub names for scheduler delay. But the edit would have been authored by tend-agent, which under the rule above is exactly what moves the alarm off a human account — for a benefit the change itself described as a small edge, against losing the watch with no red signal. The cron is unchanged from main, so the binding stays with the owner, and the diff is comment-only. If the offset is worth having, it wants a commit from a human account.

uv tool run pre-commit run --all-files passes, actionlint included.

Outside this diff, worth confirming once: the alarm exists at all only if GitHub Actions notifications are enabled on the receiving account, and "only notify for failed workflows" is a separate toggle — without it this cron delivers four success emails a day.

@tend-agent tend-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment correction is right, but the cron-minute change trips the rule the comment now states.

git log -L '/schedule:/,+3:.github/workflows/ci.yaml' shows the cron line's last editor is max-sixty (339aafb, #1282). This commit rewrites that line under the tend-agent account, so the binding the comment documents — notifications follow whoever "updates the cron syntax, in the schedule event in the workflow file" — moves to the bot. That is exactly the case the comment's own caveat, "so long as that account is a human's", exists to exclude, and this diff is what makes it false. The bot's notifications are drained by tend-notifications, which boots an agent inside the same sandbox the comment above says disabled its own detection, so the alarm would sit unread or route back through the thing it exists to watch — with nothing turning red either way.

Whether GitHub rebinds on the commit author or on the merge pusher is the uncertain part; the asymmetry is not. The offset buys "a small edge" against top-of-hour scheduler delay, in this PR's own framing, against silently losing the repo's only out-of-sandbox watch.

So I'm restoring 0 */6 * * * and keeping the comment correction, with the caveat tightened into the rule a future editor needs — keep that line human-edited. If the minute offset is worth having, it wants a commit from a human account rather than this one.

The scheduled-run failure mail follows whoever last edited the cron
syntax, so a bot-authored edit to that line moves tend's only
out-of-sandbox alarm onto an account no human reads.  Restore the
original minute and fold the operational rule into the comment.
@tend-agent tend-agent changed the title ci: correct the scheduled-run notification claim and offset the cron minute ci: correct the scheduled-run notification claim Sep 17, 2026
max-sixty added a commit that referenced this pull request Sep 17, 2026
Five repairs from review of the pin.

`_apt` could not reach the lists: `mktemp -d` leaves its parent at 0700, so the
`chown` bought nothing and apt fell back to fetching every index as root — one
`W: Download is performed unsandboxed` per file in this PR's own run, in the
code tightening the sandbox. The parent gets 711: apt needs to cross it, and
unlike a bwrap bind destination it never lists it.

`--allow-downgrades` made the pin win host-wide, which on a self-hosted runner
persists after the job and would roll back a bubblewrap security update its
owner had already taken. A GitHub-hosted runner is disposable and keeps that
behavior; elsewhere, a host ahead of the pin is now an error naming the
versions, the same restraint the AppArmor branch applies to host policy.

`npm --before` filters the top-level request too, so a `sandbox_runtime_version`
bump published after `PACKAGES_RESOLVED_AT` fails `notarget`. The sweep table
now carries that coupling on the SRT row.

`test_no_other_apt_install_escapes_the_pin` read the worktree for paths it took
from the index. A Tend PR session restores `.claude/**` from the base branch, so
a path this PR adds there is tracked and absent, and the lint raised
FileNotFoundError in every bot session while staying green on a plain checkout.

The `ci` schedule comment takes #1286's correction: GitHub mails a failing
scheduled run to whoever last edited the cron line or re-enabled the workflow,
not to the repo owner, and that account has to stay a human's for the path to
be agent-free.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
max-sixty added a commit that referenced this pull request Sep 17, 2026
…nstant (#1289)

`install-sandbox-runtime.sh` took whatever the Ubuntu archive published
that morning. On 2026-09-17 that was bubblewrap's CVE-2026-87766 fix,
which changed how bwrap resolves a bind destination and failed every
consumer's session at launch with nothing red in this repo. #1277 fixed
Tend against the new bwrap; this stops the archive changing the sandbox
boundary without a commit at all.

SRT's own dependency ranges floated the same way one level down — `zod
^3.24.1`, `commander ^12.1.0`, `node-forge ^1.4.0`,
`@pondwader/socks5-server ^1.0.10` — in the tree that builds the bwrap
argv and terminates the agent's TLS.

## What changed

Both installs now resolve as of one constant, `PACKAGES_RESOLVED_AT`:

- **apt** reads `snapshot.ubuntu.com/ubuntu/<instant>` for `noble`,
`noble-updates` and `noble-security`, and installs
`bubblewrap=0.9.0-1ubuntu0.2`, `socat=1.8.0.0-4ubuntu0.1`,
`ripgrep=14.1.0-1` by name. The sources go in with `-o
Dir::Etc::SourceList` plus a temp `Dir::State::Lists`, so a self-hosted
runner keeps its own apt config and lists; the snapshot's `Release`
verifies against the stock archive keyring, so this is not a weaker
trust path than the live mirror.
- **npm** gets `--before "$PACKAGES_RESOLVED_AT"`, which freezes SRT's
whole tree as of the same instant. That flag filters the top-level
request too, so an SRT bump published after the instant needs the
instant moved with it — the sweep table now says so on the
`sandbox_runtime_version` row.

Two behaviour changes fall out of naming the versions. The staleness
check reads `dpkg-query` rather than testing `/usr/bin/bwrap -x`: a
runner carrying *some* bubblewrap satisfied the old presence check and
still launched a different sandbox. And on a GitHub-hosted runner
`--allow-downgrades` lets the pin win over an image that ships something
newer.

**A self-hosted runner ahead of the pin is an error, not a downgrade.**
That rollback would be host-wide and would outlive the job, so a box
whose owner has already taken the next bubblewrap upload gets a message
naming the versions instead — the restraint the AppArmor branch a few
lines up already applies to host policy. A runner holding all three
exactly still skips apt, and with it sudo. The codename guard runs ahead
of that check, because a host off noble reads as ahead of the pin only
because the pin is a noble build, and no bump here ever reaches it. An
`EXIT` trap clears the apt state, since `lists/` is chowned to `_apt`
and a failure would otherwise strand a tree the runner user cannot
unlink.

## Bumping

`running-tend` gains a `### The sandbox boundary's packages` section and
`refresh_sandbox_pins.py`, which reads the three pockets at a fresh
instant, picks between them with `dpkg --compare-versions`, and rewrites
all four constants in place, printing what moved. `test-sandbox` is the
gate.

The cost of a pin is that an upstream security fix waits for a commit
here, so the rule is explicit that a version which *will not* move is an
issue naming the CVE it is holding back — never a quiet revert of the
version alone.

## Also

The `ci` schedule keeps its cron. Its comment drops the claim that
pinning was unavailable, and takes #1286's correction of who a failing
scheduled run actually mails — whoever last edited the cron line or
re-enabled the workflow, which has to stay a human's account for the
path to be agent-free. #1286 touches only that block and is fully
covered here, so it has nothing left to land; it is a bot PR, so I have
left it open for its own session to retire.

## Verification

Full suite (1180) and pre-commit green. The apt path was driven end to
end in Docker on `ubuntu:24.04`: cold install, a rerun proving the skip,
a real downgrade off an older snapshot, the non-noble guard erroring on
`bookworm`, the self-hosted refusal when the host is ahead, and `_apt`
dropping privileges cleanly at 711 but not at 700. Three lints in
`test_repo_pins.py` fail against dropping `--before`, a bare `apt-get
install`, and an unversioned package.

**Measured on this PR's own first run**, which is what the earlier
revision left open: the snapshot `apt-get update` pulls 21 indices,
~27.6 MB, in 10s at 2.6 MB/s — `noble/universe amd64 Packages` alone is
15 MB. The whole install step is 22.5s and `test-sandbox` finishes at
1m09s, against 1m02s on `main`. Nothing there needs narrowing.

Checked and deliberately left dynamic: `@openai/codex` and
`@openai/codex-responses-api-proxy` have no dependencies and exact
aliases to their platform binaries, so they are already deterministic;
`worker/` and `site/` use `npm ci` against committed lockfiles;
`https://claude.ai/install.sh` is Anthropic's installer for a
version-pinned binary, run as the sandbox UID, where a vendored copy
would rot against their layout.

Known limit: `refresh_sandbox_pins.py` resolves `binary-amd64` only. The
snapshot publishes the same three versions for `binary-arm64` at this
instant, so an arm64 runner installs cleanly, but if the arches ever
diverge the pin becomes unsatisfiable there without the refresh showing
it.

> _This was written by Claude Code on behalf of max-sixty_

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

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
@tend-agent

Copy link
Copy Markdown
Collaborator Author

Closing as superseded — nothing here is left to land.

#1289 rewrote this same comment block and carried the correction verbatim: main's .github/workflows/ci.yaml now reads "a failing scheduled run on the default branch mails whoever last edited the cron line below, or last re-enabled the workflow. Keep both a human's: … silently and without turning anything red", which is this branch's wording character-for-character.

What this branch still carries is the pre-pin framing that #1289 deliberately replaced, so merging it would regress main on two points:

  • The opening premise — "test-sandbox installs bubblewrap from the Ubuntu archive on every run, and the archive moves without a commit here" — is no longer true. PACKAGES_RESOLVED_AT pins the archive.
  • The closing "Pinning the package is not an option: Ubuntu keeps one version per pocket…" is the claim sandbox: pin the boundary's Ubuntu and npm packages to one recorded instant #1289 falsified by pinning the three packages against snapshot.ubuntu.com.

The branch conflicts with main on that block, and resolving the conflict in main's favour leaves an empty diff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant