Skip to content

fix(ci): the sweep runs in a workspace it owns, not the runner's (#264) - #266

Merged
github-actions[bot] merged 1 commit into
mainfrom
fix/264-sweep-honours-no-foreign-workspace
Nov 2, 2026
Merged

github-actions[bot] merged 1 commit into
mainfrom
fix/264-sweep-honours-no-foreign-workspace

Conversation

@aitrawog

@aitrawog aitrawog commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The required validate / validate check failed before it reviewed anything — on two
independent heads, at the same step, with the same message:

step "Sweep the tree for withdrawn identifiers"
go: ../go.work requires go >= 1.26.8 (running go 1.26.0; GOTOOLCHAIN=local)
##[error]Process completed with exit code 1.
  • opencharly/charly#1099 — run 41354275367, job 124990877965, head 4afa3547
  • opencharly/charly#1100 — run 41356369597, job 124997169458, head a9fc2bb7
  • re-measured this round on opencharly/charly#1102 — run 41370344019, job 125039622862, head d0dd4fc2

Mechanism. go run walks UP from contract/ looking for a go.work. The directory
above it is the runner's workspace root, which actions/checkout never cleans — it
cleans only the directory it manages. A sibling job that checked out at that root leaves
its own committed go.work there (opencharly/charly's CI uses a plain
actions/checkout@v5 with no path:, and that repository tracks a go.work). A later job
that checks out into repo/ inherits that residue, and the sweep dies on toolchain
resolution instead of judging the tree.

Missed control. The arm assumed Go would resolve the contract's own modules; nothing
made the module boundary explicit, so an ambient file the gate does not own could decide
the verdict. Nothing ties "the Go I run" to "the module I pinned".

Blast radius. Every PR in every repository the org ruleset covers, whenever it lands on
a runner that served a root-level checkout before it. The failure is indistinguishable
from a real finding, so authors spend a round chasing a phantom — and it blocked four
otherwise-green PRs this round: charly#1099, #1100, #1101, #1102, each measured at
this step (124990877965, 124997169458, 125021297186, 125039622862).

Deliberately NOT counted in that blast radius. layer-krun#2 and layer-criu#2 also
show a red validate / validate, but their failure step is Enable auto-merge, which
is the repositories' allow_auto_merge=false setting — an operator-owned repo PATCH, not
this defect. Measured on jobs 120099882198 and 120093148970 before writing this line,
because assuming the two were the same would have overstated the fix's reach.

Root fix. The contract ships its own go.mod, so workspace mode is turned OFF for
the sweep: GOWORK=off go run ./retired/cmd/retired-sweep …. That is not a suppression —
it declares the module boundary the arm already intended, and it is the same guard this
file applies two other places
, to charly's tools/* modules in the lint job. The fix
lives in the one org-owned file; there are no per-repo copies to update (R2).

Diff, every item accounted for:

File Change
.github/workflows/pr-validator.yml the sweep step's run: text gains GOWORK=off, with the RCA and the #264 citation recorded in the comment beside the other rationale for how this step is pinned
scripts/retired-sweep-arm_test.sh the coverage gains case 6 (a workspace whose root carries a foreign go.work must still PASS) and negative control 5 (remove the guard from a workflow copy → the coverage must go RED for that exact reason); WS is now a variable so a second workspace can be built, and run_sweep pins GOTOOLCHAIN=local, which is what actions/setup-go sets in the real job, so the case decides what the ARM does and not what a toolchain download did

How tested

The coverage extracts the shipped run: text and executes that, so the thing under
test and the thing that ships are one artefact.

$ bash scripts/retired-sweep-arm_test.sh
retired-sweep-arm_test: OK (clean tree passes; a carrier fails and is named; the table is
read from the tree in opencharly/.github and from the org checkout everywhere else; a
covered hit is a RECORD and a stale record fails; the sweep is a guarded step of the
required validate job; a go.work the job does not own cannot decide the verdict)
rc=0

It fails without the change, and that is asserted, not claimed. Case 6 builds a
workspace root carrying go 1.999.0 (a version no toolchain can satisfy) and requires the
sweep to still PASS. Negative control 5 re-runs the whole coverage against a copy of the
workflow with GOWORK=off removed, and the run fails — so if the guard were deleted,
this coverage would go red instead of silently passing. The control greps for case 6's own
failure text, so it cannot pass for the wrong reason.

$ bash scripts/retired-sweep-arm_test.sh   # with GOWORK=off removed from a workflow copy
NEGATIVE CONTROL ... (asserted inside the run; the suite is rc=0 only when the mutated
workflow turns it red)

Reproduced against the real contract, not only the fixture. Cloning opencharly/spec at
the pinned tag v0.2026305.1919 and placing a go.work one level above it:

$ go run ./retired/cmd/retired-sweep --tree ../repo --repo opencharly/example-repo --records …
go: ../go.work requires go >= 1.99.0 (running go 1.27.3; GOTOOLCHAIN=local)
rc=1

$ GOWORK=off go run ./retired/cmd/retired-sweep --tree ../repo --repo opencharly/example-repo --records …
PASS    no withdrawn name is live in the tree
rc=0

Same message shape as the runner's requires go >= 1.26.8 (running go 1.26.0; GOTOOLCHAIN=local); the only change between the two arms is the guard.

Sibling owner-script tests that share the same extraction layer, run on the committed tree:

scripts/head-settle_test.sh               PASS
scripts/assert-org-rulebook_test.sh       PASS

YAML is parsed and the step is re-read from the parsed document (GOWORK in run text: True).

What this PR does NOT claim. The workflow-checks job was not run locally — it
additionally checks action runtime pins and executes the pinned Node runtime against
GitHub. It runs on this PR in CI, and I will read its result in full. Nor can this PR
self-certify: by design the required workflow is read from main, never from the PR
under judgement (T1), so this PR is validated by the unfixed gate. The proof the fix
works is the next validate / validate that reaches the sweep on an affected repository.

Rulebook compliance

  • R0 — skills loaded for the area before any action; the dispatcher row for git/gh
    workflow applied.
  • R1 — the anomaly has a four-field RCA (above and on The required validator's withdrawn-identifier sweep reads a stale workspace-root go.work: 'requires go >= 1.26.8 (running go 1.26.0)' fails PRs whose diff is green #264), was filed with an issue
    number and a measured reproduction before any fix, and the root fix is in the product
    (the gate's own step) plus its coverage. No finding is absorbed, deferred or labelled
    "pre-existing".
  • R2 — one owner: the gate's logic lives only in this repo; the dispatcher points at
    pr-validator.yml@main, so there are no per-repo copies to drift. The fix reuses the
    guard this file already uses rather than inventing a second mechanism.
  • R3 — no sleep, no retry, no suppression. GOWORK=off states the module boundary the
    arm already requires; it does not hide a failure, and the failing path stays loud (it is
    what the negative control exercises).
  • R4 — no prose routes around a defect; the product is fixed.
  • R5 — nothing retired; no dual path left (the guard is unconditional).
  • R6 — git status read before any action; no force-push, no bypass, no foreign work
    touched. opencharly/.github#207 (another session, DIRTY since 2026-10-15) was read and
    not modified; this branch touches neither its files (candy-validate.yml,
    scripts/action-runtime-pins.tsv) nor its lines in pr-validator.yml.
  • R7 — the coverage fails without the change, proven by a negative control that mutates
    the shipped workflow; the changed path executed live with output retained.
  • R8 — no service boundary in this change.
  • R9 — no runtime OS dependency and no binary involved.
  • R10 — the change class is CI/gate logic, not runtime; the owning gate is
    workflow-checks, which runs on this PR. Its full run is reported in the thread, not
    claimed here.

Change classification

Gate / CI configuration. No runtime path, no schema, no image, no pin. The security
surface is the org-wide required check, and this change strengthens it (the gate stops
depending on runner residue) without widening what it reads.

Filed issues

None new — this PR closes opencharly/.github#264, which carries the RCA, the two
measured heads and the blast radius. Closes has not auto-closed an issue in this org, so
#264 will be closed explicitly after the merge and verified on its timeline.

Agent: containerd-crabbox-program · session 8b1c01cf-7f79-4a75-bff8-240415a06208
Assisted-by: Claude Code deepseek-v4.1-flash:cloud (analysed on a live system)

The required `validate / validate` failed BEFORE reviewing anything, on two
independent heads, with `go: ../go.work requires go >= 1.26.8 (running go
1.26.0; GOTOOLCHAIN=local)`.

`go run` walks up from `contract/` for a `go.work`, and the directory above it
belongs to the runner: `actions/checkout` cleans only the directory it manages,
so a sibling job that checked out at the workspace root leaves its own committed
`go.work` one level up. A green diff then reads as a finding it never made.

The contract pins its own modules, so the sweep now runs `GOWORK=off` — the same
guard this file already applies to charly's `tools/*` modules in the lint job.

Coverage is discriminating, not tautological: a sixth case builds a workspace
whose root carries a foreign `go.work` and requires a PASS, and a fifth negative
control removes the guard from a workflow copy and requires the coverage to go
red for that exact reason.

Agent: containerd-crabbox-program
Assisted-by: Claude Code deepseek-v4.1-flash:cloud (analysed on a live system)
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Review — PASS

Head SHA: 3ee0a84d307617caff8947f57210f107e4fcdca0 (branch: fix/264-sweep-honours-no-foreign-workspace)

Security screen: PASS
Checklist: All applicable rules PASS or NA. Comment thread: 0 comments (nothing to disposition).

Verdict: PASS


ollama-cloud/deepseek-v4.1-flash — action-review.

View action run

@github-actions
github-actions Bot enabled auto-merge (squash) November 2, 2026 01:42
@github-actions
github-actions Bot merged commit 7e2fc73 into main Nov 2, 2026
4 checks passed
charly-auto-merge Bot added a commit that referenced this pull request Nov 2, 2026
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.

2 participants