From 200ff55ae5f25f681d252259b7ba8c6496f6c645 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sun, 15 Nov 2026 10:08:27 -0800 Subject: [PATCH 1/5] ci(pullfrog): give reviews the dev shell's tools Co-Authored-By: Claude Opus 5.5 --- .github/workflows/pullfrog.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.github/workflows/pullfrog.yml b/.github/workflows/pullfrog.yml index 5d516c9c..efc7a881 100644 --- a/.github/workflows/pullfrog.yml +++ b/.github/workflows/pullfrog.yml @@ -29,6 +29,28 @@ jobs: with: fetch-depth: 1 persist-credentials: false + # Edited: what the review needs to run the repository's checks and + # tests. The environment admits only main, so the dev shell comes from + # the default branch, not a pull request's head. + - uses: DeterminateSystems/nix-installer-action@1d87d45818068401a10cf16bdc5f00b24994a83f # main + with: + determinate: false + - name: Put the dev shell's tools on PATH + run: | + nix print-dev-env --json | + jq -r '.variables.PATH.value' | + tr ':' '\n' | grep '^/nix/store/' | paste -sd: >>"$GITHUB_PATH" + # The installer wrote the job's token into world-readable nix.conf, + # where the agent's shell could read it. + - name: Remove the job token from Nix's config + env: + TOKEN: ${{ github.token }} + run: | + sudo sed -i '/^access-tokens/d' /etc/nix/nix.conf + if sudo grep -rqF "$TOKEN" /etc/nix; then + echo "the job token is still under /etc/nix" >&2 + exit 1 + fi - name: Run agent uses: pullfrog/pullfrog@0741f79ecebfa4469a010644d2aed2d96d32d489 # v0.1.127 with: From 54047e15a29a0f6cfd3fba503988c790c066d1a8 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sun, 15 Nov 2026 10:16:31 -0800 Subject: [PATCH 2/5] ci(pullfrog): fail on a failed print-dev-env, scrub the token from nix.custom.conf and the receipt Co-Authored-By: Claude Sonnet 5.5 --- .github/workflows/pullfrog.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pullfrog.yml b/.github/workflows/pullfrog.yml index efc7a881..efea91c9 100644 --- a/.github/workflows/pullfrog.yml +++ b/.github/workflows/pullfrog.yml @@ -36,17 +36,22 @@ jobs: with: determinate: false - name: Put the dev shell's tools on PATH + # bash, not the default shell, for pipefail: a failing print-dev-env + # must fail the step, not write an empty PATH. + shell: bash run: | nix print-dev-env --json | jq -r '.variables.PATH.value' | tr ':' '\n' | grep '^/nix/store/' | paste -sd: >>"$GITHUB_PATH" - # The installer wrote the job's token into world-readable nix.conf, - # where the agent's shell could read it. + # The installer wrote the job's token into world-readable nix.conf and + # nix.custom.conf, and into /nix/receipt.json's plan, where the agent's + # shell could read it. - name: Remove the job token from Nix's config env: TOKEN: ${{ github.token }} run: | - sudo sed -i '/^access-tokens/d' /etc/nix/nix.conf + sudo find /etc/nix -type f -exec sed -i '/^access-tokens/d' {} + + sudo chmod 0600 /nix/receipt.json if sudo grep -rqF "$TOKEN" /etc/nix; then echo "the job token is still under /etc/nix" >&2 exit 1 From c7d1e76182655f1ed7900b2c1557565967afd3a9 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sun, 15 Nov 2026 10:32:09 -0800 Subject: [PATCH 3/5] ci(pullfrog): keep the job token off disk and the runner user untrusted by Nix The installer trusted the runner user, so the agent could set daemon options such as post-build-hook that run as root. Install with no token and no runner trust, pass the token to the PATH step alone through NIX_CONFIG, and fail if it still reached /etc/nix or the receipt. This replaces scrubbing the token after the installer wrote it. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/pullfrog.yml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/pullfrog.yml b/.github/workflows/pullfrog.yml index efea91c9..ad3eb05a 100644 --- a/.github/workflows/pullfrog.yml +++ b/.github/workflows/pullfrog.yml @@ -35,25 +35,26 @@ jobs: - uses: DeterminateSystems/nix-installer-action@1d87d45818068401a10cf16bdc5f00b24994a83f # main with: determinate: false + # The agent's shell can reach the daemon and read /etc/nix and + # /nix/receipt.json: keep the job's token out of both, and keep the + # runner user untrusted, since a trusted user's settings, such as a + # post-build-hook, run as root. + github-token: "" + trust-runner-user: false - name: Put the dev shell's tools on PATH # bash, not the default shell, for pipefail: a failing print-dev-env # must fail the step, not write an empty PATH. shell: bash + env: + # Authenticated fetches of the flake's inputs, for this step only. + NIX_CONFIG: access-tokens = github.com=${{ github.token }} + TOKEN: ${{ github.token }} run: | nix print-dev-env --json | jq -r '.variables.PATH.value' | tr ':' '\n' | grep '^/nix/store/' | paste -sd: >>"$GITHUB_PATH" - # The installer wrote the job's token into world-readable nix.conf and - # nix.custom.conf, and into /nix/receipt.json's plan, where the agent's - # shell could read it. - - name: Remove the job token from Nix's config - env: - TOKEN: ${{ github.token }} - run: | - sudo find /etc/nix -type f -exec sed -i '/^access-tokens/d' {} + - sudo chmod 0600 /nix/receipt.json - if sudo grep -rqF "$TOKEN" /etc/nix; then - echo "the job token is still under /etc/nix" >&2 + if sudo grep -rqF "$TOKEN" /etc/nix /nix/receipt.json; then + echo "the job token reached Nix's config" >&2 exit 1 fi - name: Run agent From c9a49edef4d652bc97b7da1c0138aa2459dcdf73 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sun, 15 Nov 2026 11:41:32 -0800 Subject: [PATCH 4/5] quest: plan fixing the flaky finished-read waker test Co-Authored-By: Claude Opus 5.5 --- quest/a0/quiche-finished-read-waker.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 quest/a0/quiche-finished-read-waker.md diff --git a/quest/a0/quiche-finished-read-waker.md b/quest/a0/quiche-finished-read-waker.md new file mode 100644 index 00000000..1fa69ec8 --- /dev/null +++ b/quest/a0/quiche-finished-read-waker.md @@ -0,0 +1,23 @@ +# [S] A finished quiche read sometimes still holds its waker + +## Goal + +`a_finished_read_releases_the_poller` in +`rs/web-transport-quiche/tests/ez_wakers.rs` passes every run. It fails about +one run in 200 on `main` (0cb7412), and failed CI's `build` job on +[moq-dev/web-transport#545](https://github.com/moq-dev/web-transport/pull/545), +which changes only a workflow: after the read completes and the test drops its +own `Waker`, `Arc::strong_count` of the poller's waker is 2, not 1. + +## Plan + +Find whether the extra reference is a real retention in the ez read path or +the test racing the driver: the test runs on a two-thread runtime, so a wake +in flight on the driver thread may hold a clone just as the count is read. +Fix the retention if it is one; if it is a transient clone, make the test +wait on the event that releases it rather than reading the count once, +without a sleep or retry. Reproduce with +`for i in $(seq 200); do cargo test -q -p web-transport-quiche --test ez_wakers a_finished_read_releases_the_poller || break; done`. + +Caused by: [moq-dev/web-transport#353](https://github.com/moq-dev/web-transport/pull/353) +added the test and the waker release it checks. From 24253916c6b2ddec076a5ff9477d4523f9a3f602 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sun, 15 Nov 2026 11:41:32 -0800 Subject: [PATCH 5/5] ci(pullfrog): fail the setup if the Nix daemon trusts the runner user trust-runner-user: false only stops the installer adding the runner to trusted-users; assert the daemon really treats it as untrusted, as the token guard does for the token, since neither runs before merge. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/pullfrog.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/pullfrog.yml b/.github/workflows/pullfrog.yml index ad3eb05a..af2bab94 100644 --- a/.github/workflows/pullfrog.yml +++ b/.github/workflows/pullfrog.yml @@ -57,6 +57,10 @@ jobs: echo "the job token reached Nix's config" >&2 exit 1 fi + if ! nix store info --json | jq -e '.trusted == false or .trusted == 0' >/dev/null; then + echo "the Nix daemon trusts the runner user" >&2 + exit 1 + fi - name: Run agent uses: pullfrog/pullfrog@0741f79ecebfa4469a010644d2aed2d96d32d489 # v0.1.127 with: