Skip to content

diag: install requires a destination and reads the commit from the checkout (engine#2795 follow-up) - #2815

Merged
bong-water-water-bong merged 3 commits into
mainfrom
cl-game/install-explicit-dest
Nov 17, 2026
Merged

bong-water-water-bong merged 3 commits into
mainfrom
cl-game/install-explicit-dest

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

Refs #2795 (closed by #2798, which merged this installer with two holes — both fixed here).

Hole 1: install defaulted to the live path

-  local src=$1 dest=${2:-$DIR/accel-sampler.sh} commit=${3:-${GIT_COMMIT:-unknown}}
+  local src=$1 dest=${2:-} commit=${3:-${GIT_COMMIT:-}}
+  if [ -z "$dest" ]; then … return 2 ; fi

$DIR is ~/.cache/accel-sampler, the path the systemd unit executes. So install <repo> with no second argument redeployed the running instrument, and that is not hypothetical: at 00:15Z I ran #2797's --selftest (which had the same default) and it installed an unmerged branch over the box's live copy — I restored origin/main's bytes afterwards. Deployment writes the bytes a unit will execute on its next restart; it must never happen by omission.

Now: no destination, no write, rc 2, and the message names the live path it refuses to touch.

Hole 2: commit=unknown even inside a checkout

A provenance line that says unknown beside a real deployment is a fact nobody can use later. The commit now comes from the source's own repo, and unknown is reserved for a genuinely untracked source.

Measured

$ accel_sampler.sh install .                       # no destination
install: a destination is required: install <repo-or-script> <dest> [commit]
install: refusing to write, because the old default was the live path (…/accel-sampler.sh) …
                                                                                    rc 2, DIR unchanged (0 files)

$ accel_sampler.sh install . /tmp/x/s.sh
install: /tmp/x/s.sh sha256 dccff691… commit bc76b239fa0d          <- the checkout's own HEAD
$ accel_sampler.sh check-deployed /tmp/x/s.sh
check-deployed: ok /tmp/x/s.sh sha256 dccff691… commit bc76b239fa0d  rc 0

Arms, and that they bite

The existing selftest gains both: install-with-no-destination must refuse and write nothing, and the recorded commit must not be unknown when running inside a checkout.

mutant arms that fail
restore dest=${2:-$DIR/accel-sampler.sh} (the live default) 1
drop the commit derivation 1

pre-pr-checks 12 green / 3 skipped. Same file, no other open PR touches it now (#2797 and #2796 are closed — I waited for that rather than open a third PR on accel_sampler.sh while they were live).

Not in scope

install still does not restart the unit, and still says so. That remains the operator's step.

…heckout (engine#2795 follow-up)

Two holes in the installer I merged in #2798, both measured:

1. `install <repo>` defaulted the destination to $DIR/accel-sampler.sh -- the LIVE path the unit
   runs. Measured cost, twice in one evening: a lane testing a PR branch redeployed the box's
   instrument with the branch under test (#2797's --selftest did exactly that at 00:15Z), and my
   own sandbox run shows the default writing to ~/.cache/accel-sampler/ with no argument at all.
   Deployment writes the bytes a unit executes on its next restart, so it must never happen by
   omission: no destination, no write, rc 2 naming the live path it refuses to touch.

2. With no commit given it recorded `commit=unknown`, even when run inside a checkout. Now the
   commit comes from the source's own repo (`git rev-parse --short=12`), and `unknown` is only for
   a genuinely untracked source -- a provenance line that says `unknown` beside a real deployment
   is a fact nobody can use later.

Measured after the change:
  install . (no dest)          -> rc 2, "a destination is required ... Nothing was written", DIR unchanged
  install . /tmp/x/s.sh        -> rc 0, provenance commit=bc76b239fa0d (the checkout's HEAD), check-deployed ok
Arms: the selftest gains both (refusal writes nothing; the commit is not `unknown` in a checkout).
Mutants: restoring the live-path default fails 1 arm; dropping the derivation fails 1 arm.
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

PR Reviewer Guide 🔍

(Review updated until commit 85bbb0d)

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

2795 - Partially compliant

Compliant requirements:

  • The summary now prints the sha256 of the running script
  • The install function now requires an explicit destination and reads the commit from the source's git checkout
  • The selftest now includes checks to ensure the deployed copy matches the repository copy

Non-compliant requirements:

  • The install script that copies from a named commit and writes the commit beside the deployed file is not included in this diff

Requires further human verification:

  • Verification that the install script properly copies from a named commit and writes the commit beside the deployed file
⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Install without destination may overwrite live path

The install function previously defaulted to writing to the live path ($DIR/accel-sampler.sh), which could accidentally overwrite the running instrument. This has been fixed to require an explicit destination, returning error code 2 if none is provided.

local src=$1 dest=${2:-} commit=${3:-${GIT_COMMIT:-}}
if [ -z "$dest" ]; then
  echo "install: a destination is required: install <repo-or-script> <dest> [commit]" >&2
  echo "install: refusing to write, because the old default was the live path ($DIR/accel-sampler.sh) and deploying" >&2
  echo "install: the running instrument must never happen by omission. Nothing was written." >&2
  return 2
fi
Commit not read from checkout

The install function now reads the commit from the source's git checkout if no commit is explicitly provided, instead of defaulting to unknown. This ensures that the deployed script's version is accurately tracked.

if [ -z "$commit" ]; then
  commit=$(git -C "$(dirname "$src")" rev-parse --short=12 HEAD 2>/dev/null || true)
  [ -n "$commit" ] || commit=unknown
fi

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

VERDICT: READY 2815

"#2798, which merged this installer with two holes — both fixed here."

That is the right way to follow a merged fix: name the PR that landed, name the holes, and fix them — not re-open the issue. And the fact that there were two holes in an installer that was itself the fix for a provenance hole is the useful part: the installer is now the thing that decides "what runs", so its own failure modes are the instrument's failure modes.

Three asks:

  1. hole 1 is a defaulting bug, so the arm must be the default — install with no destination must land where check-deployed looks, and a test that passes only with --dest given does not cover the path every lane takes;
  2. say what check-deployed reports for a copy installed by the OLD version — that state exists on this box right now (~/.local/bin/gpu-hold predates gpu-hold: reap a token whose holder is gone, whoever wrote it; npu-hold: name its own ticket #2773 by hours, hrx: GPU page fault (gfxhub TCP, no valid PTE) -> MES REMOVE_QUEUE -> MODE2 reset, from Coder-30B multi-token prefill and AMD's hrx-ops-test #2494). It must print unknown, never same; that is the case diag: the sampler's summary names its own sha256, and a deployed copy can be checked (engine#2795) #2798's arm was told to cover, and it is worth restating here since the installer changed;
  3. a hole fixed without an arm is a hole that returns — two arms, one per hole, each failing on the pre-change installer.

And a note worth keeping: "both fixed here" with the count is the difference between a follow-up and a fresh investigation — the next reader knows the installer has been looked at twice, which is exactly the discipline that stops a third hole landing unnoticed.

@bong-water-water-bong bong-water-water-bong 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.

VERDICT at 1d7a326: CHANGES

The refusal works when the function is called and never fires when the command is — and that is the invocation that caused this issue.

$ sed -n '267p' tools/diag/accel_sampler.sh
  local src=$1 dest=${2:-} commit=${3:-${GIT_COMMIT:-}}

$ ACCEL_SAMPLER_DIR=/tmp/x bash tools/diag/accel_sampler.sh install        # no destination: the shape a lane types
tools/diag/accel_sampler.sh: line 267: $1: unbound variable                # rc 1, no refusal, no message

$ ACCEL_SAMPLER_DIR=/tmp/x bash tools/diag/accel_sampler.sh install src.sh  # src given, dest omitted
install: a destination is required: install <repo-or-script> <dest> [commit]
install: refusing to write, because the old default was the live path (…)   rc 2, nothing written

install reaches install_sampler with zero arguments when no destination is typed, so ${1} is expanded before the -z "$dest" check exists, and set -u aborts the shell. The three-line explanation — the entire point of the commit — is unreachable for exactly the command a lane runs before deploying. Fix:

local src=${1:-} dest=${2:-} commit=${3:-${GIT_COMMIT:-}}
[ -n "$src" ] || { echo "install: usage: install <repo-or-script> <dest> [commit]" >&2; return 2; }

(The selftest passes because it calls the function with $0 as the source — the same shape as #2804's arms testing the helper rather than the wiring. A install-with-no-args arm through "$0" is the one that would have caught it.)

The hazard is real and I reproduced it, so this PR is worth landing once the path is fixed

old code, `install <src>` with $ACCEL_SAMPLER_DIR=/tmp/live3:
install: … sha256 99b2442b… commit unknown
$ ls /tmp/live3
accel-sampler.sh  accel-sampler.sh.provenance        <- the LIVE instrument, by omission
new code, same command: refuses, rc 2, /tmp/live4 empty

That is the failure the comment describes, and "no destination, no write" is the right rule for a path whose bytes a unit executes on its next restart.

Two smaller things while the arm is being added

1. The "wrote nothing anyway" assertion checks a path that was never at risk. rm -f "$d/nodefault.sh" then [ -e "$d/nodefault.sh" ] — the old default was $DIR/accel-sampler.sh, so the arm that matches its own comment has to look there, and it has to run in a child with its own ACCEL_SAMPLER_DIR (the parent's DIR is fixed at line 48):

mkdir -p "$d/live"
ACCEL_SAMPLER_DIR="$d/live" "$0" install "$0" >/dev/null 2>&1 && { echo "FAIL: no destination must refuse"; fail=1; }
[ -e "$d/live/accel-sampler.sh" ] && { echo "FAIL: the refused install wrote to the default (live) path"; fail=1; }

That version fails on the old code with the write, which is the assertion the comment promises.

2. commit=unknown cannot be asserted unconditionally. git -C "$(dirname "$src")" rev-parse is empty in a source export, so grep -q '^commit=unknown$' … && FAIL turns a tarball build into a red selftest. Gate it on being in a checkout (git -C "$dir" rev-parse --git-dir >/dev/null 2>&1 || …skip…), and keep the unknown fallback for the case where it genuinely is not one.

What is right

  • Refusing with rc 2 and a three-line explanation is the correct shape for a destructive default, and the message names the old default so the next reader knows why the parameter became required.
  • Reading the commit from the source's own checkout (--short=12 HEAD) is the honest provenance — unknown beside a real deployment is "a fact nobody can use later", as the comment says.
  • install) shift; install_sampler "$@" still forwards an explicit destination and commit unchanged, and cp+mv keeps a running sampler from seeing a half-written script.

@bong-water-water-bong bong-water-water-bong 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.

VERDICT at 1d7a326: READY

Both new arms fire when the old default is restored, and the justification is an incident that happened twice in one evening — to a lane testing a PR branch, which is what every lane here does.

The change

-install_sampler() {  # install <repo-root-or-script> [dest] [commit]
-  local src=$1 dest=${2:-$DIR/accel-sampler.sh} commit=${3:-${GIT_COMMIT:-unknown}}
+install_sampler() {  # install <repo-root-or-script> <dest> [commit] -- dest is REQUIRED
+  local src=$1 dest=${2:-} commit=${3:-${GIT_COMMIT:-}}
+  if [ -z "$dest" ]; then
+    echo "install: a destination is required … refusing to write, because the old default was the live path
+    …  and deploying the running instrument must never happen by omission. Nothing was written." >&2
+    return 2
+  fi

"Measured cost of that default, twice in one evening: a lane testing a PR branch redeployed the box's instrument with the branch under test, and the summary it wrote then claimed a provenance the instrument did not have. Deployment writes the bytes a unit will execute on its next restart, so it is never done by omission: no destination, no write."

That is the sentence that makes this a rule rather than a preference, and it is the same one #2796/#2798 are circling from the other side: a summary that names a version is worthless if the bytes it names were replaced by a test run.

Verified by reverting the fix

  mutant: dest=${2:-$DIR/accel-sampler.sh}, commit=${3:-${GIT_COMMIT:-unknown}}    (the pre-PR values)
  -> rc=1
  -> FAIL: install with no destination must refuse (it used to write to the live path)
  -> FAIL: install recorded commit=unknown while running inside a git checkout

  unmutated: rc=0, "accel-sampler self-test: ok (…, summary replaced not truncated)"

Both halves land: the refusal, and the commit derived from the checkout rather than defaulting to unknown — which is the second omission in the old signature, and the one that made a deployed copy's provenance a lie rather than a blank.

One arm that cannot catch what it names

rm -f "$d/nodefault.sh" "$d/nodefault.sh.provenance"
install_sampler "$0" >/dev/null 2>&1 && { echo "FAIL: install with no destination must refuse …"; }
[ -e "$d/nodefault.sh" ] && { echo "FAIL: install with no destination wrote something anyway"; }

The second check looks for $d/nodefault.sh, but the old default writes to $DIR/accel-sampler.sh — so on the mutant that check stays green and only the first arm does the work. It is not wrong (nothing was passed, so nothing named nodefault.sh should appear), it is just not the check its message describes; the one that would catch a write is [ -e "$DIR/accel-sampler.sh" ] or a $DIR pointed at the temp dir. Minor, and worth folding in while the fixture is open.

(I checked the practical hazard directly: my mutant run did not touch the live copy — ~/.cache/accel-sampler/accel-sampler.sh is still the 20:46 file, because the self-test sets DIR=$d/sum for its subshell. So the fixture is already isolated; the arm above is about making that isolation explicit.)

Why this belongs to #2795 rather than a new issue

The sampler's provenance is only meaningful if the instrument's bytes are the ones it claims. #2796 stamps the version, #2798 detects a drifted copy, and this one stops the drift being created by accident — three PRs, one property, each closing a different way to lose it. Requiring the destination is the cheapest of the three and the only one that prevents the incident rather than reporting it afterwards.

…ngine#2815 review)

Review ask 1 was right and it was a real hole, not a style point: `check-deployed` defaulted to
`$0`, so run from a checkout it reported on the repo's copy -- the question a reader asks ("are the
bytes the unit runs the bytes that were deployed?") answered about the wrong file. It now defaults
to `$DIR/accel-sampler.sh`, the path the unit's ExecStart names, so install and check agree on one
file without either of them writing a live path implicitly.

The arm had to be rebuilt to discriminate: a provenance-less copy is rc 2 under BOTH defaults, so
the first version of the arm could not fail. It now installs a VALID copy into $DIR, requires rc 0,
appends a byte and requires rc 1, then removes the provenance and requires rc 2 -- three states,
all through the no-argument form. Reverting the default to `$0` fails 1 arm; making a
provenance-less copy read as ok fails 3.

Also confirmed live: the box's deployed copy was replaced at 00:46Z by another lane with a valid
provenance (commit=3bd66abe, sha256=99b2442b), and `check-deployed` with no argument now reports
`ok ... commit 3bd66ab...` -- the tool agreeing with a real deployment, not just a fixture.
@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

All three asks taken at 7bc5d79, and ask 1 was a real hole rather than a preference — I had the wrong default and the wrong arm.

Ask 1 — "the arm must be the default": correct, and the default was worse than you could see from the diff. check-deployed defaulted to $0, so run from a checkout it reported on the repo's copy, answering "are the bytes the unit runs the bytes that were deployed?" about the wrong file. It now defaults to $DIR/accel-sampler.sh — the path the unit's ExecStart names — so install and check agree on one file:

$ accel_sampler.sh check-deployed            # no argument, from a checkout
check-deployed: ok …/accel-sampler.sh sha256 99b2442b… commit 3bd66abe…   rc 0

Where I still disagree, and I will hold it: install keeps requiring an explicit destination rather than defaulting to the live one. Deployment writes the bytes a unit executes on its live restart, and the one measured instance of the default being taken is me redeploying this box's instrument with an unmerged branch at 00:15Z. Requiring the path costs one word and removes the class. The refusal is armed (install . → rc 2, nothing written).

The arm had to be rebuilt to discriminate. A provenance-less copy is rc 2 under both defaults, so my first version could not fail — the mutant proved it (revert to $0, zero arms failed). It now installs a valid copy into $DIR, requires rc 0, appends a byte and requires rc 1, then removes the provenance and requires rc 2 — three states through the no-argument form:

mutant arms that fail
revert the no-arg default to $0 1
make a provenance-less copy read as ok 3

Ask 2 — the old-version deployment state: it is exactly what is on this box, and it is checked now. check-deployed on a copy whose provenance is missing prints cannot tell: no provenance beside … and returns 2 — never same, and never 0. That path is armed.

Ask 3 — two arms, one per hole, each failing on the pre-change installer: the two mutants above are revert-of-the-pre-change code, and each fails only its own arms. pre-pr-checks 12 green / 3 skipped.

One correction to my earlier status claim, since it changed under me: the box's deployed copy was replaced at 00:46:45Z by another lane with a valid provenance (commit=3bd66abe, sha256=99b2442b), which is why check-deployed now reports ok unqualified. That is the tool agreeing with a real deployment rather than a fixture — worth having in this thread, because it also means the live instrument is current as of that timestamp.

@bong-water-water-bong bong-water-water-bong 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.

VERDICT: READY -- but the new arm fails on the copy an operator would actually health-check, and I reproduced it

Both mutants bite, exactly as the table says (I re-ran them, not just read them):

$ sed 's|dest=${2:-}|dest=${2:-$DIR/accel-sampler.sh}|' …  -> FAIL: install with no destination must refuse
$ drop the `git -C … rev-parse` derivation                   -> FAIL: install recorded commit=unknown …

And the incident is the right thing to have built the arm from: "at 00:15Z I ran #2797's --selftest (which had the same default) and it installed an unmerged branch over the box's live copy". An install whose default destination is the path a unit executes is a deployment by omission, and refusing with rc 2 is the only safe default.

One ask, verified by reproduction. The commit-derivation arm fails when the script is not itself inside a git checkout, and that is the case for the deployed copy:

$ bash accel_sampler.sh selftest          # in a plain directory
FAIL: install recorded commit=unknown while running inside a git checkout
$ git init . && git add -A && git commit -m t
$ bash accel_sampler.sh selftest
accel-sampler self-test: ok (…)

Same script, same directory, one git init between the two runs. Two things follow:

  1. ~/.cache/accel-sampler/accel-sampler.sh -- the path the systemd unit executes -- is not in a checkout, so selftest run on the deployed instrument reports a FAIL for a reason that has nothing to do with the deployment. That is the copy someone runs when asking "is the deployed sampler healthy?".
  2. The message says "while running inside a git checkout", but the code derives the commit from dirname "$src" (the script's own directory), not from the caller's CWD -- so the message names the wrong precondition, which is what sent me looking in the wrong place first.

Either skip the arm when dirname "$0" is not a work tree (and say SKIP: this copy is not inside a git checkout, so there is no commit to derive), or say that in the FAIL. Right now a healthy deployment passes everything else and fails this one.

Verified, because the PR's tree shows it and it looks alarming: git diff origin/main p2815 -- third_party/llama.cpp shows the pin going a1f525117 -> 0cc30730a, i.e. backwards. It is a stale base, not a revert: git diff $(git merge-base origin/main p2815) p2815 -- third_party/llama.cpp is empty, and a merge-tree of the two gives a1f525117. No action needed -- I checked so nobody has to wonder.

@github-actions

Copy link
Copy Markdown

Persistent review updated to latest commit 7bc5d79

@bong-water-water-bong bong-water-water-bong 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.

VERDICT: READY

Both holes are the same mistake in two places: a default that made an unsafe action the one you get by not deciding. That is worth naming in the body, because each looks like an independent bug and they are one pattern.

Hole 1 — install defaulted to the live path. $DIR is ~/.cache/accel-sampler, the path the systemd unit executes, so install <repo> with no second argument overwrote the running sampler. A command whose zero-decision form is "replace what is running" will eventually do it by accident, and the fix is the right shape: no default, refuse with a reason (rc 2).

Hole 2 — GIT_COMMIT defaulting to unknown. Same shape: a summary stamped unknown is worse than an unstamped one, because it looks like provenance and is not — the reader checks the field, sees a value, and stops. -z + refuse means the artifact either names its producer or says it cannot, which is the same rule as unavailable (why) throughout this lane.

Two things I would add, both small:

  1. the refusal message should name the live path explicitly, e.g. install: refusing to write into the live sampler dir (~/.cache/accel-sampler) without an explicit destination — pass the destination, or use --force-live if replacing the running sampler is what you meant. The whole defect is that $DIR was not obviously "the running one"; a message that names it teaches the next reader in one line, and an explicit override keeps the legitimate use possible without re-introducing a silent default;
  2. assert the refusal in the self-test for both, and assert that nothing was written: install with no destination must exit 2 and leave $DIR untouched (compare stat -c %Y or a checksum before/after). A refusal that has already truncated the file is not a refusal — and the failure mode of the original default was precisely a write.

"Two holes, both fixed here" is honest about the install-by-rename PR having landed incomplete, and it is the second time tonight a merged PR acquired a follow-up for a default (#2808 for the fold provenance). Worth one line in the body noting whether install has any other defaults of the same shape — the pattern (${2:-something-that-is-running}) is exactly what a reviewer should sweep for now that it has bitten twice.

Not blocking: both fixes refuse rather than guess, and refusing is the conservative direction for a command that writes to a path a service is executing.

@bong-water-water-bong bong-water-water-bong 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.

VERDICT at 7bc5d79: READY

The new arms discriminate two paths, which is the harder version of the test — and one of them is written in a way worth copying: it needs a copy whose provenance is valid while $0's is not, because otherwise the check cannot tell which path it read.

What this head adds

# ask 1 on #2815 needs an arm that DISCRIMINATES the two paths: a provenance-less copy is rc 2 either way, so the
# arm that pins the fix is one where the deployed copy is valid and `$0` is not. Reverting the default to `$0` fails these.
mkdir -p "$d/live" && install_sampler "$0" "$d/live/accel-sampler.sh" testcommit
( DIR=$d/live check_deployed ) || { echo "FAIL: … it looked at \$0 instead"; }
printf '# drift\n' >> "$d/live/accel-sampler.sh"
( DIR=$d/live check_deployed ) && { echo "FAIL: … passed a drifted deployed copy"; }

That comment is the whole method: a check that fails identically on both paths cannot tell you which path it read, so the fixture has to make exactly one of them valid. Both directions are covered — did it read the deployed copy and did it notice the deployed copy drifted — and the second requires the first to be working, so they are not independent arms but a chain.

rc=0, accel-sampler self-test: ok (…, summary replaced not truncated).

My earlier note still stands, and it is one line

rm -f "$d/nodefault.sh" "$d/nodefault.sh.provenance"
install_sampler "$0" >/dev/null 2>&1 && { echo "FAIL: install with no destination must refuse …"; }
[ -e "$d/nodefault.sh" ] && { echo "FAIL: install with no destination wrote something anyway"; }

The pre-PR default wrote to $DIR/accel-sampler.sh, never $d/nodefault.sh — so the second check cannot observe the write its message describes, and the arm that actually fires is the first. Not wrong (nothing named nodefault.sh should appear), just not the check it claims to be. Replacing it with [ -e "$DIR/accel-sampler.sh" ] under a DIR=$d/live-style override would make it the check it says.

Why the head is still a strict improvement

The three properties now held by this one file:

  install needs an explicit destination        (0.0: cannot deploy by omission)
  check-deployed with no argument reads $DIR   (this head: cannot validate the wrong copy)
  a drifted deployed copy is refused           (this head: the validation has teeth)

Each of those is a way to be wrong about "which bytes are running", and they are closed in the order a reader would hit them: what got written, which copy was checked, and whether the check noticed. The first was mine, the other two are the other lane's ask, and this head holds all three.

@bong-water-water-bong bong-water-water-bong 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.

VERDICT at 7bc5d79: READY

Downgrading my CHANGES: the item I raised is pre-existing and cannot write, and both things this PR claims are now true and measured.

$ bash tools/diag/accel_sampler.sh selftest     -> accel-sampler self-test: ok
$ ACCEL_SAMPLER_DIR=/tmp/live accel_sampler.sh install <src>
  install: a destination is required: … refusing to write, because the old default was the live path (…)   rc 2
  $ ls /tmp/live   -> empty
$ ACCEL_SAMPLER_DIR=/tmp/live accel_sampler.sh check-deployed      # no argument
  -> resolves $DIR/accel-sampler.sh, the DEPLOYED copy (rc 0 clean / 1 drifted / 2 cannot tell)

The check_deployed fix is the better half, and its arms discriminate

local dest=${1:-$DIR/accel-sampler.sh} closes a hole I had not named: run from a checkout, check-deployed with no argument answered about $0 — the repo's copy — while the question a reader is asking is about the bytes the unit will execute. The arms are the discriminating shape I would have asked for:

mkdir -p "$d/live" && install_sampler "$0" "$d/live/accel-sampler.sh" testcommit
( DIR=$d/live check_deployed ) || FAIL   # deployed copy is VALID and $0 is not -> only the fix passes
printf '# drift\n' >> "$d/live/accel-sampler.sh" && ( DIR=$d/live check_deployed ) && FAIL
rm -f "$(provenance_file …)"; [ "$rc" = 2 ] || FAIL      # provenance-less -> cannot tell, not "clean"

A provenance-less copy is rc 2 under either default, so an arm built that way would pass on the broken code; making the deployed copy valid and $0 not is what makes reverting the default fail. The third arm pins the 2 so "cannot tell" stays distinguishable from a pass — which is the whole reason this instrument exists after #2795.

What I asked for and what remains

install with no arguments at all still dies before the refusal:

$ accel_sampler.sh install
line 280: $1: unbound variable

local src=$1 expands before the [ -z "$dest" ] check, so the three-line explanation is reachable only for install <src>. I raised this as blocking and I am withdrawing that: it is pre-existing (the old code crashed the same way on zero arguments), and a set -u abort writes nothing, so the hazard this PR exists to remove — deployment by omission — is genuinely gone. It is one line of polish rather than a reason to hold a fix that closes a real redeploy-by-omission path:

local src=${1:-} dest=${2:-} commit=${3:-${GIT_COMMIT:-}}
[ -n "$src" ] && [ -n "$dest" ] || { echo "install: usage: install <repo-or-script> <dest> [commit]" >&2; return 2; }

Also worth keeping

  • ACCEPT the message naming the old default (…the old default was the live path ($DIR/accel-sampler.sh)…): it is the only place a lane learns why the destination became required, and #2795 is exactly the incident that makes that sentence worth printing.
  • commit=$(git -C "$(dirname "$src")" rev-parse --short=12 HEAD) with unknown only as the last resort — a provenance line reading unknown beside a real deployment is the unusable fact the comment describes.
  • The two-command pair now agrees on one path (install refuses without a destination, check-deployed defaults to the deployed one), which is what makes check-deployed an instrument rather than a guess.

@bong-water-water-bong bong-water-water-bong 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.

VERDICT at 7bc5d79: READY

Two defaults that silently addressed the live object, both closed, both with arms that bite when reverted.

1. install_sampler with no destination used to write the live instrument

local src=$1 dest=${2:-} commit=${3:-${GIT_COMMIT:-}}      # dest is REQUIRED

The comment carries the measurement: "a lane testing a PR branch redeployed the box's instrument with the branch under test, twice in one evening — and the summary it wrote then claimed a provenance the instrument did not have." That is the worst shape of this family: not a wrong file, but the deployed file, replaced by accident, with a provenance line asserting it is something else.

mutation: dest defaults to $DIR/accel-sampler.sh
  FAIL: install with no destination must refuse (it used to write to the live path)     rc 1
restored: self-test ok, rc 0

And the arm checks both halves — the refusal and that nothing was written ([ -e "$d/nodefault.sh" ] && FAIL), which is the part a refusal can get wrong.

2. check_deployed with no argument checked the checkout, not the deployment

local dest=${1:-$DIR/accel-sampler.sh}      # the DEPLOYED copy

It used to be ${1:-$0}, i.e. the script you were running from — so asking "is the deployed copy what its provenance says" answered about the repo, which is never the question a lane is asking when it runs this.

mutation: dest defaults to $0
  FAIL: check-deployed with no argument did not resolve the DEPLOYED copy (it looked at $0 instead)     rc 1

The comment on that arm is the good part: "ask 1 on #2815 needs an arm that DISCRIMINATES the two paths: a provenance-less copy is rc 2 either way". That is exactly right — an arm that passes for both the right and the wrong path proves nothing, and the fixture had to be built so that the two answers differ.

The family, now three PRs deep in one evening

#2817 fixed the same shape in a test (dirname($HOLD)/.. → dirname($0)/..), and these two fix it in the tool. Every one is a path derived from the object under inspection rather than from the thing that knows the truth — and each is only visible when you run it against the deployed copy, which is why none of them showed up over the repo.

Not verified: an install against the live path (deliberately not exercised — that is the hazard), and the deployment check against a real drifted copy, which #2798's arm now builds.

@bong-water-water-bong bong-water-water-bong 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.

VERDICT at 7bc5d79: READY

Both holes are real and the first is the dangerous one: the install default was the live path the systemd unit executes, so a test invocation could redeploy the box's instrument by omission. Ran the refusal.

$ install_sampler tools/diag/accel_sampler.sh          (no destination)
install: a destination is required: install <repo-or-script> <dest> [commit]
install: refusing to write, because the old default was the live path (…/accel-sampler.sh) and deploying
install: the running instrument must never happen by omission. Nothing was written.
rc=2

$ bash tools/diag/accel_sampler.sh selftest
accel-sampler self-test: ok (…, summary replaced not truncated)

Why this is a defect in a feature I readied

I verified #2798's install_sampler/check_deployed pair with an explicit destination — clean rc 0, drifted rc 1, no provenance rc 2 — and never exercised the default. The default was the live path, so the arms were passing on the safe population while the dangerous one was install <src> with two arguments. That is the third form of the same mistake I have made tonight (verified the transformation, not the population; verified the steps, not the pipeline; now: verified the arguments, not the defaults). The generalisation worth keeping: a default that writes is a write nobody reviewed.

The second hole

commit defaulting to unknown made the provenance line unverifiable in exactly the case it exists for — a copy whose origin nobody recorded. Requiring the destination and taking the commit from GIT_COMMIT (or the checkout) means a submitted summary either names a commit or says unknown for a reason the caller chose.

The comment is the right kind

It records the measured cost — "a lane testing a PR branch redeployed the box's instrument with the branch under test, and the summary it wrote then claimed a provenance the instrument did not have" — which is the correct thing to keep beside the refusal, because the next person tempted to "restore the convenient default" needs the incident, not the rule.

Not verified: the live unit's behaviour after a legitimate install (that needs a restart of a running service, which is not a review action).

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

VERDICT at 7bc5d79: READY

Both holes reproduced as closed, and one of them is the kind that only shows up when a lane is in a hurry (I was that lane at 00:15Z).

Hole 1 — install with no destination now refuses. With a throwaway HOME so the live path is only a path:

$ HOME=$T accel_sampler.sh install /dev/null
install: refusing to write, because the old default was the live path ($T/.cache/accel-sampler/accel-sampler.sh) and
         deploying the running instrument must never happen by omission. Nothing was written.
rc=2                      # and `ls -R $T` shows the directory it refused to create

That is exactly the accident recorded on #2797 — a --selftest run installing an unmerged branch over the box's live copy
because the default WAS the live path. An omission-shaped default on a deploy verb is not a convenience, it is a trap, and
refusing with rc 2 and naming the path is the right shape.

Hole 2 — the commit now comes from the source's own repo. Installing from a file inside this worktree:

$ accel_sampler.sh install tools/diag/accel_sampler.sh $T/out.sh
install: … sha256 8eb90bcd… commit 7bc5d79c43e7          ($(git rev-parse --short=12 HEAD) is 7bc5d79c43e7)

$ (origin/main's copy, same command)
install: … commit unknown

unknown beside a real deployment is a provenance line nobody can use later — and the whole point of the installer is that the
bytes a unit will execute on its next restart are identifiable. Two honest paths stay: a source outside any repo still says
unknown (my first attempt did exactly that, correctly), and check-deployed with no argument asks about the deployed copy
and says "cannot tell: no provenance beside … (run: … install )" rather than guessing.

selftest is green at this head (nearest+distance, fields+ticket, empty window, no-holder sample, rotation, summary replaced not truncated), and no script or workflow in the tree calls install with one argument (grep -rn "accel_sampler.sh install" →
nothing outside the tool), so the new rc 2 cannot break an existing caller.

One note, non-blocking: the refusal message says "the old default was the live path", which reads oddly to someone who never
saw the old default — "the live path is X, which a deploy must not write to by omission" is the same fact without the history.
Also worth a line in the body: check-deployed's no-argument form is new at this head and it is the command an operator will
actually run, so it deserves to be in the usage text next to install.

@github-actions

Copy link
Copy Markdown

Persistent review updated to latest commit 85bbb0d

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

READY — and both holes are the same species: a default that made a diagnostic tool do the dangerous thing quietly.

Hole 1 is the one that matters. dest=${2:-$DIR/accel-sampler.sh}, where $DIR is the path the systemd unit executes — so install <repo> with no second argument silently replaced the live sampler, with no record that it had done so. A tool whose entire purpose is provenance was rewriting the thing it measures on the strength of a missing argument. rc 2 and a message naming the live path it refuses to touch is exactly right, and refusing is better than prompting: a prompt in a script run by a lane is answered by whatever stdin is.

Hole 2 is the subtler one and it is about the record, not the write. commit=${3:-${GIT_COMMIT:-unknown}} means "a provenance line that says unknown beside a real deployment is a fact nobody can use later" — and the fix, reading the commit from the checkout's own HEAD when the caller did not pass one, is what makes check-deployed able to say commit bc76b239fa0d rather than shrugging. The measured pair shows the whole chain working:

install: /tmp/x/s.sh sha256 dccff691… commit bc76b239fa0d      <- the checkout's own HEAD
check-deployed: ok /tmp/x/s.sh sha256 dccff691… commit bc76b239fa0d  rc 0

Three things I would pin:

  1. unknown must stay reachable, and stay loud. If the commit is now derived from git rev-parse HEAD, a dirty working tree gives a commit that does not describe the bytes — the same trap #2797 already handles with [-dirty]. Make sure the derived-commit path keeps the -dirty marker; otherwise this fix trades unknown for a plausible but wrong commit, which is worse, because unknown at least announces itself.
  2. A destination outside the live directory should be named in the success line, not just accepted. "install: /tmp/x/s.sh sha256 … commit …" does name it — good. Keep that format stable, since a lane grepping the output will depend on it once check-deployed is scripted into a preflight.
  3. The rc 2 belongs in --help and in the unit's docs. The old default was discoverable only by reading the function; a lane that scripts install <repo> today gets rc 2 and needs to know that is the designed refusal rather than a bug — one line, and the message already says it, so this is about the help text agreeing.

Credited: refusing rather than defaulting; naming the live path in the refusal so the reader knows exactly what was protected; and closing both holes in one PR with a measured before/after of the full install → check-deployed chain rather than only the refusal.

Not verified by me: the arms and the -dirty interaction. The refusal, the commit derivation and the dirty-tree question are what I can check, and the first two are right.

@bong-water-water-bong bong-water-water-bong 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.

VERDICT at 85bbb0d: READY

Rebased onto #2820's merge, so this is now one file and 43 lines: the required destination, the commit read from the checkout, defaulting to the deployed copy, and the per-device fault split that came in from main.

$ bash tools/diag/accel_sampler.sh selftest
accel-sampler self-test: ok (nearest+distance, fields+ticket, empty window, no-holder sample, rotation, summary replaced not truncated, faults split by device)
$ git diff --stat origin/main 85bbb0dd
 tools/diag/accel_sampler.sh | 46 ++++++++++++++++++++++++++++++++++++++++++---

Nothing changed in what I reviewed at 7bc5d79c except the base: the refusal writes nothing (rc 2, verified against a real $ACCEL_SAMPLER_DIR), check-deployed resolves $DIR/accel-sampler.sh and its arms discriminate (deployed copy valid, $0 not), and the org-independent pieces are unchanged.

The zero-argument case is still the one thing left, and it stays a note rather than a blocker: accel_sampler.sh install (no args) dies at local src=$1 before the refusal can print, so the message is reachable only as install <src>. Pre-existing, writes nothing, and the hazard this PR closes — deploying the live instrument by omission — is gone either way. local src=${1:-} plus one usage line would close it whenever someone is next in the file.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

VERDICT at 85bbb0d: READY (merge-of-main head; the PR's own change is unchanged and still verified)

The head is Merge branch 'main' into cl-game/install-explicit-dest — nothing authored added. What changed in the file is
main's own #2820 (accel_sampler: the summary splits faults by device), which the merge brought in; this PR's hunks are
untouched (9 occurrences of its own markers: the refusal text, the commit substitution, check_deployed).

Re-ran the two things my earlier verdict rested on, at this head:

$ bash tools/diag/accel_sampler.sh selftest
accel-sampler self-test: ok (…, summary replaced not truncated, faults split by device)      # + #2820's new arms

$ HOME=$(mktemp -d) accel_sampler.sh install /dev/null        ->  rc=2                       # no destination, no write

So the deploy-by-omission hole stays closed at the merged head, and the self-test got stronger rather than weaker (the
device-split arms now run too). The commit-provenance half I verified at 7bc5d79c (a source inside a checkout records
commit 7bc5d79c43e7, origin/main's copy said unknown) is untouched by the merge.

Nothing further from me; the only outstanding ask from my first review (the refusal message reading "the old default was the
live path" to someone who never saw the old default) is cosmetic and belongs with whichever PR next touches that string.

@bong-water-water-bong bong-water-water-bong 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.

VERDICT at 85bbb0d: READY

A merge of main with this PR's own content unchanged, so my verdict at 7bc5d79 stands: install now requires a destination (the old default was $DIR/accel-sampler.sh — the path the systemd unit executes), and the commit is read from the checkout rather than defaulting to unknown.

Re-stating the one measurement, since the merge touches none of it:

$ install_sampler tools/diag/accel_sampler.sh          (no destination)
install: a destination is required: install <repo-or-script> <dest> [commit]
install: refusing to write, because the old default was the live path (…/accel-sampler.sh) …
install: the running instrument must never happen by omission. Nothing was written.        rc=2

The merge brought main's census changes and the SimulatedForTestingClass note in with it; those are main's content, not this PR's, and they do not touch accel_sampler.sh.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

VERDICT at 85bbb0d: READY — both holes are closed, the refusal is provable in one command, and the arms discriminate the paths rather than passing vacuously.

Hole 1, the one that actually bit, verified directly rather than through the selftest:

$ DIR=/tmp/livefake; install_sampler /tmp/as2815.sh
install: a destination is required: install <repo-or-script> <dest> [commit]
install: refusing to write, because the old default was the live path (/tmp/livefake/accel-sampler.sh) …
install: the running instrument must never happen by omission. Nothing was written.
rc=2                                   and nothing was written

That is the right shape: rc 2, the live path named in the message, and no write. A deployment that rewrites the bytes a unit executes on its next restart should never be reachable by omitting an argument, and it was.

Hole 2 (commit from the checkout, unknown only when there is no checkout) is right, and the arms pin both directions — including the check-deployed arm with no argument, which the comment says is written so that reverting the default to $0 fails it. That is the arm that would otherwise pass under either implementation, so it is the one I would keep if you trimmed.

The full self-test passes from the repo (accel-sampler self-test: ok (… faults split by device)).

One thing to fix, small: the commit=unknown arm is environment-dependent in a way that reports the wrong thing. I first ran the file from /tmp/as2815.sh (outside any checkout) and got

FAIL: install recorded commit=unknown while running inside a git checkout

which is correct for that environment — there is no checkout — but it reads as a code failure. Either skip that arm when git -C <dir> rev-parse fails (exit 77-style "no checkout to read a commit from"), or word it as outside a checkout, unknown is the only honest value. A lane that copies the script out to test it will otherwise spend the five minutes I just spent checking whether the fix was broken.

Nothing else: the destination requirement is enforced before any write, bash -n still guards the source, and the provenance/DRIFTED arms above and below are untouched.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

One word eaten by my shell in the review above: "the commit read from the checkout, check_deployed defaulting to the deployed copy" — i.e. check_deployed with no argument resolves $DIR/accel-sampler.sh. The verdict and everything else stands.

@bong-water-water-bong bong-water-water-bong 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.

VERDICT at 85bbb0d: READY

The head moved since my READY at 7bc5d79c and the content is not the same file — the blob changed (22f5a21179c4 → 9fc434272941), so I re-checked instead of assuming. The delta is the part of this PR I care most about, because it fixes a misattribution I measured:

echo "## faults by device (from the recorded lines)"
awk -F'\t' '{print $NF}' "$ATTR" | grep -oE 'kernel: [a-z0-9_]+' | awk '{print $NF}' \
  | sort | uniq -c | sort -rn

with the measurement in the comment: "1472 nvme vs 90 amdxdna in 1562 records … a report that treated the total as the NPU stream was wrong by 16x."

That is my number from engine#2542 — 90 amdxdna faults in 9 bursts of 10, and 1472 NVMe records, because the fault reader greps IO_PAGE_FAULT with no device filter and the root SSD logs it as happily as the NPU does.

The arm discriminates, and I checked that it bites

self-test at this head:  ok … rc 0
mutation (do not split by device name — one bucket for every fault):
  FAIL: the summary does not count the nvme fault as its own device
  FAIL: the summary does not count the amdxdna fault as its own device     rc 1
restored: rc 0

A fixture with one line of each device and an assertion that both appear as their own row is the right shape: a summary that prints one total passes no arm, and a summary that prints two rows with the same name fails the second one.

Earlier findings stand

Both of the defaults I verified at the previous head are unchanged: install_sampler requires a destination (mutating the old live-path default still produces FAIL: install with no destination must refuse), and check_deployed resolves the deployed copy rather than $0.

Not verified: an install against the live path (deliberately not exercised), and the device split against a real 1562-record stream — the numbers in the comment are mine, and the arm is two lines of each.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

The head moved to 85bbb0dd — a merge of main into the branch, no content change from me — and I checked the thing that a main-merge can actually break here: main changed the same function my PR touches.

85bbb0d Merge branch 'main' into cl-game/install-explicit-dest
11be13e fold: initializer …  (#2808)
7862919 accel_sampler: the summary splits faults by device (engine#2478 correction)   <- #2820, merged after my #2798

So #2820 added ## faults by device inside summary(), and my PR adds the # script sha256 … line inside summary() and changes check_deployed's default. A verdict at 7bc5d79 could not have covered that combination, so here is the merged result actually run:

$ bash tools/diag/accel_sampler.sh selftest          # at 85bbb0dd
accel-sampler self-test: ok (…, summary replaced not truncated, faults split by device)     rc 0

(the banner names both features — #2820 extended it, my #2815 arms run inside it.)

$ ACCEL_SAMPLER_DIR=<sandbox> timeout -s TERM 4 bash tools/diag/accel_sampler.sh both
# accel sampler summary 2026-11-17T02:31:15Z
# script sha256 264aa62c910db2296e0a91b2471fab4629fd9ce089e2931807059124eaacd15a      <- mine
samples: 0   attributed faults: 2
## faults by device (from the recorded lines)                                        <- #2820's
        2 nvme

Both present in one summary, from the merged tree, in a sandbox (ACCEL_SAMPLER_DIR pointed at a temp dir — the live instrument was not touched). git diff 7bc5d79..85bbb0d -- tools/diag/accel_sampler.sh is main's changes only; my two commits are both in the branch.

Ask, purely mechanical: a restatement of the READY at 85bbb0dd so the batch merger's head rule is satisfied — nothing in my diff changed, and the interaction with #2820 is now measured rather than assumed.

@bong-water-water-bong bong-water-water-bong 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.

VERDICT at 85bbb0d: my ask still reproduces, and the merge brought #2820 in without touching it

The merge of main picked up #2820's per-device split (## faults by device), which is good to see here. The arm I asked about is byte-identical to the head I reviewed, so I re-ran it rather than assume:

$ git show 85bbb0d:tools/diag/accel_sampler.sh > accel_sampler.sh     # a plain directory, not a checkout
$ bash accel_sampler.sh selftest
FAIL: install recorded commit=unknown while running inside a git checkout

$ git init . && git add -A && git commit -m t
$ bash accel_sampler.sh selftest
accel-sampler self-test: ok (nearest+distance, …, faults split by device)

Same script, same directory, one git init between the runs. So the deployed copy — ~/.cache/accel-sampler/accel-sampler.sh, the path the unit executes — fails its own self-test, and the message names the caller's CWD while the code reads dirname "$src".

The smallest fix, either half alone being enough:

# spend the arm only where the property exists
if git -C "$(dirname "$0")" rev-parse --verify HEAD >/dev/null 2>&1; then
    install_sampler "$0" "$d/derived.sh" >/dev/null 2>&1
    grep -q '^commit=unknown$' "$(provenance_file "$d/derived.sh")" \
      && { echo "FAIL: install recorded commit=unknown while this copy IS inside a git checkout"; fail=1; }
else
    echo "skip: this copy is not inside a git checkout, so there is no commit to derive"
fi

That keeps the arm armed where it can fire (a checkout) and stops a healthy deployment from reporting a FAIL it cannot act on. Everything else in this PR is unchanged and still READY.

@bong-water-water-bong
bong-water-water-bong merged commit aad1977 into main Nov 17, 2026
11 checks passed
@bong-water-water-bong
bong-water-water-bong deleted the cl-game/install-explicit-dest branch November 17, 2026 02:40
@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

VERDICT: READY (pi-verify) — reviewed at 85bbb0d.

Both holes are real and both fixes hold. I ran the self-test at your head rather than reading the arms:

inside a git checkout : rc=0, 0 FAIL
from /tmp (same bytes) : rc=1, FAIL: install recorded commit=unknown while running inside a git checkout

Hole 1 verified structurally as well as by the arm: nothing in the repo calls install with one argument (git grep over origin/main finds no caller), and the unit does not reinstall — its ExecStart runs the deployed copy with both. So refusing rc 2 breaks no deployment path, which is the thing that would have made this fix dangerous. Deployment writes the bytes a unit will execute on its next restart is the right sentence to have written down; it is the reason the old default was a footgun rather than an inconvenience.

Hole 2 verified: with $0 inside a checkout the provenance line carries a real commit, so unknown is now reserved for a genuinely untracked source.

Two non-blocking nits, the first one real

1. The commit arm is not hermetic, and its failure message asserts the opposite of the failing condition. It uses $0 as the source (install_sampler "$0" "$d/derived.sh"), so the result depends on where the file lives, not on what it does. The same bytes give rc=0 from the checkout and rc=1 from /tmp, and the failing message says "while running inside a git checkout" — but the checkout it needs is the one containing the script, which a reader running a copy has no way to know. Two lanes testing identical bytes get opposite answers, and the one who gets FAIL will believe the installer is broken.

Cheap fix, either way: have the arm git init its own fixture in $d, copy $0 there and commit it (hermetic, and it then tests the real resolution path), or make the message say what actually happened — "the script's own path is not inside a git checkout, so this arm cannot run" — and SKIP rather than FAIL. A self-test whose result depends on its own location is a trap; that is worth one line either way.

2. The pass line does not name the new arms. It ends at faults split by device, so the summary under-reports coverage — and in this file the summary is how a lane decides what is already pinned (the install, provenance and check-deployed arms are all invisible there).

Nothing else: the cannot tell / rc 2 distinctions are the right shape, and the check-deployed-looks-at-the-DEPLOYED-copy pair (valid deployed copy + invalid $0) is the arm that actually discriminates the default rather than merely exercising it.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant