Skip to content

fix(lock): write nothing into a lock file, and keep the truncate that makes it empty - #33

Merged
atrawog merged 10 commits into
mainfrom
feat/lock-file-no-pid
Aug 16, 2026
Merged

atrawog merged 10 commits into
mainfrom
feat/lock-file-no-pid

Conversation

@atrawog

@atrawog atrawog commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary of changes

AcquireFileLock wrote pid=%d into every lock file it created. Nothing read it.

Measured, not assumed — 13 acquisition sites across spec, sdk, candy and charly. Acquisition sites, not call sites: two of the thirteen never name AcquireFileLock at all, which is the whole content of the wrapper finding below.

The load-bearing claim is the PAIR, not the population: exactly one caller writes the file's content — candy/plugin-box's build-activity lock, which overwrites it with the build CalVer immediately after acquiring — and exactly one reads it back, candy/plugin-clean's retention floor. That pair never moved. Everything below is the denominator, which is context.

$ grep -rn "AcquireFileLock(" --include=*.go spec/ sdk/ candy/ charly/ | grep -v _test.go
   1 definition        spec/lock/filelock.go
   3 internal          spec/lock/filelock.go x2 + spec/lock/bed_vm_domain.go   (all `package lock`)
   1 alias re-export   sdk/kit/filelock.go:12   (not a call site; a paren-pattern misses it)
  11 EXTERNAL call sites
       spec/refs/git.go · sdk/deploykit/bake_plugins.go · sdk/deploykit/deploy_config_cycle.go
       sdk/kit/install_ledger.go · sdk/kit/http_fetch.go · candy/plugin-box/box.go  <- writes
       candy/plugin-check/bed_session.go · candy/plugin-clean/retention.go         <- reads
       candy/plugin-preempt/arbiter.go · candy/plugin-vm/vm_build.go · charly/plugin_loader.go

$ grep -rln "pid=" --include=*_test.go spec/ sdk/ candy/ charly/
(no output — no test anywhere pinned the content)
$ grep -rn "AcquireImageBuildLock\|AcquireVmDomainLock" --include=*.go candy/ | grep -v _test.go
candy/plugin-build/podman.go:37          -> kit.AcquireImageBuildLock
candy/plugin-check/bed_session.go:383    -> lock.AcquireVmDomainLock
   2 WRAPPER-MEDIATED acquisitions — invisible to ANY grep on "AcquireFileLock"

So, naming the framing rather than assuming it: 13 ACQUISITION SITES — 11 direct + 2 wrapper-mediated — of which 1 needs the content and 12 do not. Acquisitions is the right population because a lock taken through a wrapper carried the pid= line just the same. No test pinned the content, and spec/lock had no test file at all.

Which means the original figure of 13/12 was right, reached by a raw match count that happened to total correctly, then moved away from the answer by two successive refinements that each improved the method. Wrong method, right number; better method, wrong number.

And the fourth divergence is the one that matters: those two sites were invisible to every pattern all three reviewers published, because none of them names AcquireFileLock. Publishing patterns reconciled us with each other and left us jointly wrong about the population. Agreement between patterns that share a blind spot is not corroboration.

Corrected in review, three times, for three unrelated reasons — and the reasons matter more than the number. Three parties counting the same thing produced 13, 12 and 11:

Divergence Cause
13 → 12 the unit was never stated. A rule does produce 13: git grep -l 'AcquireFileLock(' -- '*.go' ':!*_test.go' summed per tree gives spec 3 + sdk 4 + superproject 6 = 13 files containing a call — a correct count of a different unit, labelled "call sites". -l and -n differ by one character and the number -l yields is plausible, stable and wrong about what it names. This row previously claimed the 13 had no derivation; that was false and is retired. The claim here is only that a rule produces 13, not that this is the keystroke that was run — which is neither provable nor needed
12 → 11 classification — bed_vm_domain.go was called external because it is a different FILE. It is package lock, the same package that defines the function. The package is what matters; the directory only coincides
line anchors disagreed revision — :91/:105 on origin/main vs :103/:117 with this fix applied, which adds 12 comment lines above them
one site went unseen pattern — AcquireFileLock( with a paren cannot match the alias assignment at sdk/kit/filelock.go:12

None was carelessness, and all four were invisible until the patterns were published. A count whose pattern is not shown cannot be reconciled, only traded — and this one was the change's central justification while its pattern stayed private.

Because the one caller that needs content writes its own afterwards, the line is load-bearing for zero callers, and no new API is required to remove it.

Why a line nobody reads was worth removing

It was not inert. A pid= line in a lock file is the visual signature of a pidfile lock, and pidfile locks genuinely do go stale — so the artifact taught a mechanism it does not have, and the wrong mechanism prescribes an action: hand-deleting a lock file the CLI owns.

The real mechanism is the opposite. The kernel releases an flock when the holder dies while the file persists untouched, so presence proves nothing and absence proves nothing. ps is the only discriminator.

Not theoretical: the line misled three independent readers in one session, two of them people who had that same day written down that these are not pidfile locks. Not a subtle trap for the careless — a reliable one for the careful.

The Truncate(0) is KEPT, and that is the half most likely to be undone

With the write gone it reads as purposeless. os.OpenFile(O_CREATE|O_RDWR) does not truncate, so removing it makes a re-acquired lock retain the previous holder's bytes — replacing misleading content with stale misleading content, which is worse, because staleness reads as currency. The code carries a comment saying so, the CHANGELOG says so, and a test fails if it is removed.

Change class

spec code, single repo for this leg. The consuming charly gitlink bump is a separate leg and lands after this one is tagged.

How tested

Coverage is capability-creation, not regression — the first tests in spec/lock. There is no failing-then-passing pair to show, because the behaviour was never asserted anywhere; a reviewer looking for one will not find it, and its absence is not a gap.

gofmt -l lock/     (empty)
go vet ./lock/     clean
go test ./lock/    ok  github.com/opencharly/spec/lock

--- PASS: TestAcquireFileLock_WritesNothing
--- PASS: TestAcquireFileLock_TruncatesStaleContent
--- PASS: TestAcquireFileLock_WriteAfterAcquireSurvives
--- PASS: TestAcquireFileLock_NonBlockingBusy

NonBlockingBusy exists because the other three are content assertions: a change that broke locking entirely — never taking the flock — would leave all three green.

Both halves mutation-proved, each reverted alone, against the committed fix:

reinstate the pid= write
  --- FAIL: TestAcquireFileLock_WritesNothing          lock file carries 12 bytes ("pid=2790729\n")
  --- FAIL: TestAcquireFileLock_TruncatesStaleContent
remove Truncate(0)
  --- FAIL: TestAcquireFileLock_TruncatesStaleContent  previous holder's 14 bytes ("2026.001.0000\n")
restored (verified byte-equal to the committed fix, both times)
  ok  github.com/opencharly/spec/lock

Disclosure — the first mutation run was invalid and is not the one above. It restored with git checkout -- while the fix was still uncommitted, so each "restore" reverted to origin/main and silently destroyed the fix. Worse, the guard I used to detect that (git diff --stat returning empty) reports success for exactly that state — clean relative to a mutable reference is not clean, applied to the index. The fix was re-applied, committed first, and the proof above re-run with the restore verified byte-equal to the committed fix rather than to the index.

R10 sub-bullets

  • Named gate: gofmt -l · go vet ./lock/ · go test ./lock/, plus a two-mutation proof of both halves against the committed fix. Change class is spec Go code with no runtime substrate of its own.

  • Eval beds run: N/A, with reason. No bed can fail on this change. System-observable behaviour is identical: the only consumer of a lock file's bytes is plugin-clean's retention floor, and ParseCalVer rejects "" and "pid=123" at the same guard (calver_parse.go:46, len(parts) != 3 — neither string splits into three parts). The fd offset after the write is unobservable because AcquireFileLock returns only a release closure. A bed would therefore be green before and after regardless of correctness, and demanding a gate that cannot fail on the change is ceremony. The unit suite can fail on it, and does — see the mutation proof.

  • Fresh-rebuild / R9: N/A for this leg — spec ships no binary. R9 binds on leg 2, the charly gitlink bump, which builds charly against this spec and runs the beds. charly/go.mod carries replace … => ../spec and go.work has use ./spec, so leg 2's beds genuinely exercise this code rather than a published copy.

  • Concurrency — answered on the merits, not as N/A. This PR changes the build-lock primitive itself, so "no concurrency impact" needs an argument rather than an assertion.

    The flock acquisition and release paths are untouched — same syscall.Flock, same LOCK_EX/LOCK_NB, same release closure. What changes is only what the file contains while held.

    There is one genuinely concurrent window: between AcquireFileLock returning and plugin-box completing its os.WriteFile, a concurrent plugin-clean retention sweep can read that file. Before: it read "pid=<n>". After: it reads "". Both fail ParseCalVer at the same len(parts) != 3 guard, so both set floorOK = false and the sweep declines to compute a floor — identical outcome, and it was already the outcome before this change. The window is not new, not widened, and not altered in effect.

    No lock ordering, hold duration, or blocking/non-blocking semantics change. Answer: no observable concurrent behaviour changes, and the one window where it could have is unchanged by construction.

Harness rulebook compliance

  • R0 skills: /charly-internals:strict-policy, /charly-internals:go, /charly-internals:git-workflow loaded before the first tool call.
  • R1 RCA: two anomalies, both RCA'd before remediation and neither retried. The mutation proof's first run was invalid — git checkout -- restored from the index while the fix was uncommitted, reverting it; disclosed below rather than silently re-run. The call-site count was wrong — a raw match count folding in the definition and two wrappers; corrected with the pattern published. Zero warnings.
  • R2 no deferral: nothing deferred. The count error and the invalid proof were both fixed in this branch, not filed.
  • R3 no duplication: a one-line deletion; no new API. The WithContent variant I first proposed proved unnecessary because the one content-needing caller already writes after acquiring.
  • R4 / R4a no workaround: no sleep, retry, magic number, or shim. The Truncate(0) is kept rather than documented-around, and the reason is in the code, the CHANGELOG and a test — the product is fixed, not the prose.
  • R5 hard cutover: the pid= write is gone, not deprecated. The self-test returns three hits, all intended and all kept:
    $ git grep -n 'pid=%d'
    CHANGELOG/2026.227.2330.md:6   the release note describing the removal
    lock/filelock.go:58           the rationale comment explaining why nothing is written
    lock/filelock_test.go:19      the test doc explaining what it pins
    
    An earlier revision of this line claimed the sweep "returns nothing outside history", which was false — the two rationale comments are deliberate and must stay, since a deletion whose reason is unrecorded is one refactor from being undone.
  • R6 git safety: git status before destructive actions; one real slip, disclosed in the How tested section above (the invalid first mutation run). No force-push; the branch advances by added commits only.
  • R7 prove behaviour: the changed path executes under go test; both halves mutation-proved. Runtime proof on the substrate is leg 2's, stated as such rather than claimed here.
  • R8 artifacts: N/A — no generation change, no Containerfile, no OCI label.
  • R9 binary == source: N/A this leg (spec ships no binary); binds on leg 2.
  • R10 disposable + coverage: coverage that fails without the change is the mutation proof; no non-disposable target touched; no bed owed, with the reason above.
  • RDD: the high-risk assumption was "is this line load-bearing anywhere?" — settled by reading every call site before editing, not after.
  • ADE: N/A — no candy, no plan:.
  • SDD: N/A — no .cue schema change.
  • Hard cutover: one atomic change, one repo for this leg; no transitional path, no TODO, no phase 2.
  • Kernel/plugin boundary law: N/A — spec/lock is a shared primitive imported by both core and plugins; no kind schema, kind-word switch, or per-kind map introduced.
  • Disposable-only autonomy: nothing destroyed or rebuilt.
  • Clean architecture + Go gates: gofmt -l empty, go vet clean, go test green.
  • CHANGELOG: CHANGELOG/2026.227.2330.md, placeholder after v2026.227.2226, no tag or filename collision, H1 byte-matches the filename stem.

Attribution tier

analysed on a live system. The changed path executed live under go test, both halves mutation-proved. Not fully tested and validated because the consuming bed has not run against this spec — that happens on the charly gitlink leg, where every bed acquires both a bed lock and build-activity locks.

Landing order

spec (this PR) → tag → charly gitlink bump. This leg must be tagged before the superproject pins it.


Assisted-by: Claude Code Anthropic Claude Opus 5 (analysed on a live system)

… makes it empty

AcquireFileLock wrote `pid=%d` into every lock file it created. Nothing read it.

The ONE caller that needs content — candy/plugin-box's build-activity lock —
overwrites the file with its build CalVer immediately after acquiring, and the ONE
reader — candy/plugin-clean's retention floor — reads only that. For the other
twelve call sites across spec, sdk, candy and charly the line was read by nothing,
while teaching every human who opened the file that this is a PIDFILE lock whose
staleness must be reasoned about.

It is not. The kernel releases an flock when the holder dies, so the file's
PRESENCE proves nothing and its ABSENCE proves nothing; `ps` is the only
discriminator. The artifact taught a mechanism it does not have, and it misled
three independent readers tonight — twice people who had that same day written
down that it is not a pidfile.

**The Truncate(0) is KEPT and is not dead code.** With the write gone it reads as
purposeless, so this records why before someone tidies it away: O_CREATE|O_RDWR
does not truncate, so without it a re-acquired lock retains the previous holder's
bytes. That would replace misleading content with STALE misleading content, which
is worse — staleness reads as currency.

Coverage: the first tests in this package. CAPABILITY-CREATION, not regression —
there is no before/after pair, because the behaviour was never asserted anywhere.
Four tests, gating both halves plus the two things a content-only test cannot see:

  WritesNothing            fails if the pid write returns
  TruncatesStaleContent    fails if Truncate(0) is removed
  CallerContentSurvives    the plugin-box pattern still works
  NonBlockingBusy          the flock is actually taken — without it, a change that
                           broke locking entirely would leave the content
                           assertions green

Assisted-by: Claude Code Anthropic Claude Opus 5 (analysed on a live system)
Records what the measurement showed (13 call sites, one content writer, one
reader), why a line nobody reads was worth removing (it taught pidfile semantics
this lock does not have, and misled three readers), and why the Truncate(0) is
KEPT — with the write gone it reads as dead code, and removing it would replace
misleading content with stale misleading content.

Assisted-by: Claude Code Anthropic Claude Opus 5 (analysed on a live system)
…deletion

Not a third assertion in a list. It pins the CONTRACT the deletion depends on, and
it is where all the risk lives: the fix removes something twelve callers did not
need, so the entire exposure sits with the ONE that did — which is exactly where
the coverage has to be strongest.

Until this test existed, the deletion's safety rested on two people having read
box.go:373-377. Now the package guarantees that a caller writing after acquiring
keeps its bytes, so the change survives a fourteenth call site appearing with
nobody re-reading anything.

A one-line deletion justified by a survey is only as durable as the survey;
justified by a test, it stops depending on anyone remembering.

Renamed CallerContentSurvives -> WriteAfterAcquireSurvives so the name states the
contract rather than the observation, and said the same in the CHANGELOG.

Assisted-by: Claude Code Anthropic Claude Opus 5 (analysed on a live system)
@atrawog

atrawog commented Aug 15, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — CHANGES REQUESTED ❌

Head validated: ae2513e26ba701fe8ce926964a78542c9e5cbe9f (re-derived four times — two ls-remote calls, gh pr view, and a local git fetch of refs/pull/33/head, all agreeing). Note this is not the head named in my spawn brief (8e33517f); the branch advanced by one commit (test(lock): name the write-after-acquire test as the licence for the deletion) between the brief being written and my claim, and the diff is +225/-1 across 3 files, not +204/-1. I validated the current head.

Change class: spec Go code (single repo, leg 1 of a cross-repo cutover).


The engineering is correct. I confirmed it independently.

Stating this first because the block below is not about the change being wrong. I re-derived every load-bearing claim from the artifacts rather than from the body, and all of them hold:

Claim How I checked it Result
Exactly ONE production caller writes the lock file's content Grepped AcquireFileLock/AcquireImageBuildLock/AcquireLocalPkgBuildLock across charly, spec, sdk, plugins, docs, then read every call site to see what path it writes Confirmed — only candy/plugin-box/box.go:377 writes to the lock path itself (os.WriteFile after acquire). install_ledger, deploy_config_cycle, bake_plugins, plugin_loader, vm_build, bed_session, arbiter all lock one path and write a different one
Exactly ONE production reader Grepped every ReadFile/Stat against a lock path + every ParseCalVer call site Confirmed — only candy/plugin-clean/retention.go:320
Zero tests pin the pid= content candy/plugin-box/box_test.go:216 does read a lock file's bytes Confirmed harmless — it asserts "2026.188.1900\n", the caller's CalVer, i.e. the same contract WriteAfterAcquireSurvives pins. Stays green
The retention floor is unaffected Read ParseCalVer (spec/spec/calver_parse.go:44) Confirmed — ParseCalVer("") and ParseCalVer("pid=123") both return false via the same len(parts) != 3 guard, so the transient window between acquire and the caller's write yields floorOK = false before and after this change, byte-for-byte

The load-bearing test models the real pattern. TestAcquireFileLock_WriteAfterAcquireSurvives does AcquireFileLock → os.WriteFile(path, …) → read back — structurally identical to acquireBuildActivityLock, not a simplified stand-in.

Both mutations re-run by me, not accepted from the paste. Restore verified by SHA-256 against the committed HEAD blob (9da5d67b…) rather than git diff --stat — the failure mode disclosed in the body:

committed blob sha256: 9da5d67b8873697a7c7a799ed783a8c4c7d5a573edd5f34bde9cd1c7255bce48
worktree file sha256 : 9da5d67b8873697a7c7a799ed783a8c4c7d5a573edd5f34bde9cd1c7255bce48   <- fix IS committed (b422f0fa)

M1  reinstate the pid= write
    --- FAIL: TestAcquireFileLock_WritesNothing          lock file carries 12 bytes ("pid=2803180\n")
    --- FAIL: TestAcquireFileLock_TruncatesStaleContent  ... 12 bytes ("pid=2803180\n")
    restore -> sha256 byte-equal to committed HEAD blob -> ok

M2  remove Truncate(0)
    --- PASS: TestAcquireFileLock_WritesNothing
    --- FAIL: TestAcquireFileLock_TruncatesStaleContent  previous holder's 14 bytes ("2026.001.0000\n")
    --- PASS: TestAcquireFileLock_WriteAfterAcquireSurvives
    --- PASS: TestAcquireFileLock_NonBlockingBusy
    restore -> sha256 byte-equal to committed HEAD blob -> ok

M3 — a mutation I added, which the body did not claim. The body asserts NonBlockingBusy exists because a totally broken lock would leave the content assertions green. I tested that assertion rather than believing it — stubbed the syscall.Flock call to a no-op:

M3  never take the flock
    --- FAIL: TestAcquireFileLock_NonBlockingBusy    (the only failure — the other three stayed green)

The claim is accurate, and the suite is genuinely probative in all three directions.

Gates, in an isolated worktree (GOWORK=off, per-worktree GOLANGCI_LINT_CACHE, golangci-lint cache clean first, -count=1):

gofmt -l .                  (empty)
go build ./...              clean
go vet ./lock/              clean
golangci-lint run ./...     0 issues
go test -count=1 ./...      all 13 packages ok, zero warnings

golangci-lint is probative here, not vacuous — I perturbed lock/filelock.go with an unused variable and it reported declared and not used: unusedVar (typecheck), then restored.

CHANGELOG: 2026.227.2330.md — no tag or file collision; newest spec tag is v2026.227.2226, so the placeholder does not predate it; H1 is byte-exact # 2026.227.2330 — a lock file that says nothing, and the truncate that keeps it that way; git show --stat shows real content magnitudes on both touching commits (no | 0 dropped-edit signature).

R5 sweep at the PR head: no Fprintf(f remains; the only surviving pid= mentions in spec are the rationale prose in the new comment and test doc ("This previously wrote…"), which is the thing that stops the line coming back — not a stale reference.


What blocks: the PR body is missing a mandated section

The template (opencharly/.github/.github/PULL_REQUEST_TEMPLATE.md) states that the validator "FAILS a body that leaves any applicable section blank." Measured against it, this body supplies Summary of changes, Change class, pasted test output, and Attribution tier — and omits the following.

1. ## Harness rulebook compliance is absent entirely. Not partially filled — the whole section is missing. Every line of it is unanswered: R0, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, RDD/ADE/SDD, Hard cutover, Kernel/plugin boundary law, Disposable-only autonomy, Clean architecture + Go gates, CHANGELOG. Most are a one-line N/A — <reason> for this change class, so this is a short fix, but it is the mechanism by which you assert each rule was considered, and it cannot be inferred from the diff.

2. ## How R10-tested is missing 4 of its 5 required sub-bullets. The prose How tested section carries the pasted output, but not:

  • the gate for this change class, named per /charly-check:check "R10 gate by change class";
  • Eval beds run — the template requires an explicit list or an explicit N/A with the reason;
  • Fresh rebuild (the R9 line);
  • Concurrency — and this one is substantive, not clerical. The template's own enumeration of what triggers it is "the loader/discover walk, deploy ledger, podman store, resource arbiter, VM/pod lifecycle, or a build lock." This PR changes the build-lock primitive itself, so the bullet is unambiguously applicable and is unanswered.

On that last point, here is the specific question the bullet exists to force, which nothing in the body addresses: between AcquireFileLock returning and plugin-box's os.WriteFile landing, the lock file is empty, and plugin-clean's retention floor can read it in that window. I worked it through and it is a non-regression — the pre-change window contained pid=N\n, which ParseCalVer rejects exactly as it rejects "", so floorOK = false in both worlds — but that analysis is the author's to record, not the validator's to supply.

3. No sweep output is pasted. The body's central justification is a survey ("13 call sites… twelve read by nothing"), and the commands producing it appear nowhere. A sweep claim needs its actually-executed output, because a plausible-reading survey that was never run against the real diff is a known failure shape in this project. I re-ran it myself and the claim holds — so this is an evidence gap, not a false claim, and I want that distinction on the record. But R5's line in the compliance section is where that output belongs.

Not blocking, for the record

  • Three commits on feat/ is fine — /charly-internals:git-workflow explicitly permits accumulation on the branch ("Atomic on main, never on feat/"); the squash-merge collapses them.
  • Tier. analysed on a live system is correct and correctly declined from higher. The changed path executed live under go test with mutation proof, and the fresh-rebuild bed gate has not run. I also confirmed the bed leg genuinely arrives rather than evaporating: charly/go.mod carries replace github.com/opencharly/spec => ../spec and go.work has use ./spec, so the consuming beds on the gitlink leg will exercise this code. The deferral is the sanctioned producer-first cross-repo landing order, with a named next leg — not an R2 "follow-up" park.
  • No bed required on this leg. I considered demanding one and concluded it would be ceremony by the matrix's own principle ("a gate that cannot fail on the change proves nothing"): the system-observable behaviour is identical, the fd offset is unobservable (the function returns only a release closure, never the *os.File), and no consumer distinguishes an empty lock file from a non-empty one. The gate that can fail on this change is the unit suite, and it does.
  • Architecture gate — placement: CORRECT. No charly/*.go in the diff, so the per-item trace is empty by construction: no new or grown *_aliases.go, no new kit import, no boundary-law question. The change is a deletion inside spec/lock, an already-correctly-placed fabric primitive.

Checklist

# Item Verdict
0 Security & anti-tampering (T1–T4) PASS — 3 files, all read in full; no secrets, network, egress, or guardrail change; diff matches the description exactly (13 comment lines + 1 deletion); no instruction directed at the validator
1 Description complete FAIL — compliance section absent; 4/5 R10 sub-bullets unanswered
2 Change-class gate matches evidence PASS — no dry-run/rebuild-alone fraud; live go test + mutation proof
3 Attribution tier justified PASS — correctly declined from fully tested and validated
4 R0 skills honored PASS
5 R1 RCA + zero warnings PASS — zero warnings across all gates
6 R2 no out-of-scope split PASS — next leg is named, not parked
7 R3 no duplication PASS
8 R4 no ad-hoc workaround PASS
9 R5 hard cutover + grep PASS on substance (I re-ran it); the pasted evidence is part of finding 3
10 R6/R8/R9 artifact integrity N/A — no destructive git action, no generation change, no binary/dep change
11 R10 disposable + coverage PASS — coverage fails without the change, proved by M1/M2/M3
12 RDD / ADE / SDD N/A — no candy, no .cue, no generated file, not a wire type
13 Concurrency mandate + anti-cheat FAIL — applicable bullet unanswered (finding 2)
14 Hard cutover — atomic on main PASS
15 Architecture gate PASS — placement: CORRECT; per-item trace empty (no charly/*.go staged)
16 Disposable-only autonomy N/A
17 Clean architecture + Go gates PASS — gofmt/vet/lint-0/test all green, lint probativeness verified
18 CHANGELOG present PASS

Comments considered: none — the PR carried no comments at validation time.

Cross-PR interactions considered: swept spec, charly, sdk, plugins, docs. spec#33 is the only open spec PR. Open siblings are sdk#138 (Alpine sshd/bootstrap) and plugins#178 (docs) — neither touches lock/, AcquireFileLock, or any lock call site. none-found; no coordination comment needed.


Decision: The change itself is correct, well-covered, and independently confirmed down to the mutation level — I have no technical objection to it, and I expect to pass it on the next round. What I cannot do is merge it on an evidence record that omits an entire mandated section, because the compliance section is where the author asserts the rules were checked, and one of its bullets (Concurrency) is genuinely applicable to a build-lock change and genuinely unanswered.

To fix, in one round: add ## Harness rulebook compliance with a one-line HOW or N/A — <reason> per rule; fill the four missing ## How R10-tested sub-bullets, answering Concurrency on the merits (the acquire→write window above); and paste the actual git grep output behind the 13/1/1 survey under R5. Push a commit — the status resets and I re-run. No code change is required.

Assisted-by: Claude Code Anthropic Claude Opus 5 (analysed on a live system)

…ed it

The survey is this change's central justification and its headline figure was
wrong. "Thirteen production call sites" and "the other twelve" came from a raw
grep match count, which folds in the function's own DEFINITION and two internal
wrappers inside filelock.go.

Classified:

  15 matching lines
   1 definition          spec/lock/filelock.go:35
   2 internal wrappers   spec/lock/filelock.go:103, :117
  12 EXTERNAL call sites

So: 12 external call sites, of which 1 needs the file's content and 11 do not.
The 1/1 writer/reader pair is unchanged and was never in question.

The pattern is now published beside the count, because a count whose pattern is
not shown cannot be reconciled, only traded — and it was caught only by publishing
it while gathering the evidence a review asked for. A bare number that nobody can
re-derive is the same defect this program has been finding all night, and it was
sitting in the justification for the fix.

Assisted-by: Claude Code Anthropic Claude Opus 5 (analysed on a live system)
…nt moved

Third and final correction of this figure. It is 11 external, not 12 or 13, and
the change rests on the PAIR rather than the population: exactly one caller writes
the file's content and exactly one reads it back. That pair never moved.

The denominator moved three times for three independent causes, and the causes are
worth more than the number:

  13 -> 12   a raw match count folded in the DEFINITION and the internal wrappers
  12 -> 11   classification — bed_vm_domain.go was called external because it is a
             different FILE. It is `package lock`, the same package that defines
             the function. The package is what matters; the directory coincides.
  anchors    revision — :91/:105 on origin/main vs :103/:117 with this fix applied,
             which adds 12 comment lines above them
  a miss     pattern — `AcquireFileLock(` with a paren cannot match the alias
             assignment in sdk/kit/filelock.go:12

None was carelessness and all four were invisible until the patterns were
published. A reader who sees "wrong, then right" learns nothing; the causes are the
content, so the CHANGELOG carries them.

Assisted-by: Claude Code Anthropic Claude Opus 5 (analysed on a live system)
@atrawog

atrawog commented Aug 15, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — CHANGES REQUESTED ❌ (round 2)

Head validated: 14af166c3751def8db09f0cdeb065d3eee4e7cbb — three probes agreeing (2× ls-remote, gh pr view), plus a local fetch of refs/pull/33/head. One commit past the ae2513e2 I validated in round 1 (not two). Supersedes my round-1 verdict.

Both round-1 blockers are fixed. ## Harness rulebook compliance is present with a reasoned line per rule; the R10 sub-bullets are complete. Two of them are better than what I asked for, and I want that on the record:

  • Eval-beds N/A keeps the mechanism, which is the thing a paraphrase usually drops — it cites calver_parse.go:46 and the len(parts) != 3 guard by name, and keeps the fd-offset half. I re-read that guard myself: line 46 is if len(parts) != 3 {, and "" and "pid=123" both die there. The citation is exact.
  • R1 names both anomalies — the invalid mutation proof and the wrong count — rather than claiming a clean run.

First, a correction I owe this PR

In round 1 I wrote that I "re-ran it myself and the claim holds" about the survey. That was overstated, and it was picked up and relayed to you. What I actually verified was the 1 writer / 1 reader pair, by reading every call site. I never verified the 13. If any part of this branch's history rests on my having confirmed that number, it should not — I hadn't, and it was wrong.

I have now derived the count properly, and it is the first blocker.


Blocker 1 — the corrected count is still wrong, and all three numbers reconcile

Derived at exact revisions, so nothing depends on a working checkout. This matters here: the superproject's spec/ submodule is parked at 4cff4d08 — six commits behind main. Any grep -rn … spec/ run from the superproject root reads that tree, and its filelock.go line numbers (:91, :105) differ from the head's (:103, :117). Both earlier counts were taken through that path.

$ git -C spec grep -n 'AcquireFileLock(' 14af166c -- '*.go' ':!*_test.go'
$ git -C sdk  grep -n 'AcquireFileLock(' origin/main -- '*.go' ':!*_test.go'
$ git        grep -n 'AcquireFileLock(' origin/main -- 'candy/*.go' 'charly/*.go' ':!*_test.go'
    -> 15 lines total

Criterion: is the call site in package lock? That is the abstraction boundary the word "external" is reaching for, and unlike "is it in filelock.go" it does not change when a function is moved between files.

Class Count Sites
definition 1 spec/lock/filelock.go:35
in-package wrappers (package lock) 3 filelock.go:103 AcquireImageBuildLock · filelock.go:117 AcquireLocalPkgBuildLock · bed_vm_domain.go:66 AcquireVmDomainLock
external call sites 11 spec/refs/git.go:356 · sdk/deploykit/bake_plugins.go:138 · sdk/deploykit/deploy_config_cycle.go:108 · sdk/kit/http_fetch.go:325 · sdk/kit/install_ledger.go:89 · candy/plugin-box/box.go:373 ← the writer · candy/plugin-check/bed_session.go:366 · candy/plugin-clean/retention.go:326 · candy/plugin-preempt/arbiter.go:685 · candy/plugin-vm/vm_build.go:67 · charly/plugin_loader.go:227

AcquireVmDomainLock is package lock, takes a name, derives a path under ~/.cache/charly/.locks/, and delegates — structurally identical to the two the entry already classifies as internal. Grouping it with the callers because of the file it happens to sit in makes the count depend on file layout rather than on the boundary, and that is what produced the off-by-one.

But the reconciliation has a second half, and it is the interesting one. There are also wrapper-mediated acquisition sites — places that take a lock through a wrapper and never name AcquireFileLock:

candy/plugin-build/podman.go:37      -> AcquireImageBuildLock
candy/plugin-check/bed_session.go:383 -> AcquireVmDomainLock
AcquireLocalPkgBuildLock             -> no production caller (test only)

So the three numbers are not three opinions — they answer three different questions, and two of them are right:

Number Question it answers Verdict
11 direct external call sites of AcquireFileLock correct
13 distinct acquisition sites (11 direct + 2 through wrappers) correct
12 — not an answer to any consistent question

Which means the original entry's 13 / "the other twelve" was right — reached by the wrong method, but right — and the correction moved it off. Under either consistent framing the current text is off by one:

  • as direct call sites: twelve → eleven, and "the other eleven" → ten;
  • as acquisition sites: twelve → thirteen, and "the other eleven" → twelve.

This blocks because lock/filelock.go:62 now ships "eleven external call sites" as a permanent source comment. A PR whose thesis is that an artifact teaching something false is not inert should not leave a false count in the same file. The AcquireLocalPkgLock in the CHANGELOG is also missing its Build (AcquireLocalPkgBuildLock).

Blocker 2 — the pasted test output is stale

The ## How tested block still reads:

--- PASS: TestAcquireFileLock_CallerContentSurvives

That test does not exist at this head. It was renamed in ae2513e2, two commits ago:

$ grep -o 'func TestAcquireFileLock_[A-Za-z]*' lock/filelock_test.go
func TestAcquireFileLock_WritesNothing
func TestAcquireFileLock_TruncatesStaleContent
func TestAcquireFileLock_WriteAfterAcquireSurvives   <- renamed
func TestAcquireFileLock_NonBlockingBusy

The suite passes — I ran it — so nothing is being hidden. But an evidence block presented as the proof for this head demonstrably was not produced against it, and the rename was the whole point of the commit that introduced it. This is the third paste-integrity item on this branch, after the invalid mutation run and the count, and that is the pattern worth naming rather than the individual line.

Not blocking, but fix while you are in there

  • R5 line: "git grep 'pid=%d' in spec/ returns nothing outside this entry's history" — it returns three hits: the CHANGELOG line plus filelock.go:58 and filelock_test.go:19. Those two are the deliberate rationale and should stay (they are what stops the line coming back), but the sentence as written is not what the command does.
  • CHANGELOG: "placeholder after v2026.227.2122" — newest spec tag is v2026.227.2226. The conclusion survives (2330 is after both), the cited fact does not.
  • R6 line: "one real slip, disclosed — see below" — the disclosure is above it.

Verified again at this head

The code is unchanged from what I validated in round 1 and I re-proved it rather than assuming:

comment-stripped sha256 of lock/filelock.go
  ae2513e2 (round 1): a702dfce1f5fe327...
  14af166c (round 2): a702dfce1f5fe327...   identical -> only comment text moved
gofmt -l .                  (empty)
go vet ./lock/              clean
golangci-lint run ./...     0 issues        (isolated cache, cache clean first)
go test -count=1 ./...      all packages ok, zero warnings

M1 reinstate pid=      --- FAIL WritesNothing + FAIL TruncatesStaleContent
M2 remove Truncate(0)  --- FAIL TruncatesStaleContent  (only)
restore -> sha256 byte-equal to committed HEAD blob

Both mutations still fail for the reason the mutation creates — M2 reports the previous holder's CalVer, not pid=, which is the discriminator that caught the invalid first proof.

Concurrency answer accepted on the merits. It matches the analysis I did independently in round 1, including the acquire→write window and the identical-outcome argument. placement: CORRECT, per-item trace empty — no charly/*.go in the diff.

Comments considered: my own round-1 verdict (superseded by this one; its survey-verification claim corrected above). No other comments.

Cross-PR: spec#33 is still the only open spec PR; sdk#138 and plugins#178 touch no lock call site. none-found.


Decision: Everything structural is now right, and the two rules I most wanted answered — Eval-beds and Concurrency — are answered better than the template requires. What remains is arithmetic that ships into source. The fix is three numbers and a test name; no code change, and the 1 writer / 1 reader pair the deletion actually rests on has been confirmed at every round and is not in question.

Pick a framing, state it, and make the two texts agree with it — eleven external call sites / the other ten, or thirteen acquisition sites / the other twelve. Either is defensible; I have verified both. Then re-paste the test block from a real run. I will merge on the next round.

Assisted-by: Claude Code Anthropic Claude Opus 5 (analysed on a live system)

…ee patterns shared

The framing is now named rather than assumed, because "call sites" was answering a
question nobody had agreed on. Thirteen ACQUISITION SITES: eleven that name
AcquireFileLock directly, plus two that acquire through a wrapper and never name it
at all —

  candy/plugin-build/podman.go:37        -> kit.AcquireImageBuildLock
  candy/plugin-check/bed_session.go:383  -> lock.AcquireVmDomainLock

A lock acquired through a wrapper carried the pid= line just the same, so
acquisitions is the population the claim is about. Of the 13, one writes content
and twelve did not need it.

Which means the ORIGINAL figure of 13/12 was right — reached by a raw match count
that happened to total correctly, then "corrected" off by two successive
refinements that each improved the method and moved the number away from the
answer. Wrong method, right number; better method, wrong number.

The blind spot is the finding, not the number. No grep on "AcquireFileLock"
reaches those two sites, so every pattern the three reviewers published was
structurally blind to the same pair. Publishing patterns reconciled us with each
other and left us jointly wrong about the population: agreement between patterns
that share a blind spot is not corroboration.

Also: the CHANGELOG now names v2026.227.2226 as the newest landed tag (it cited
v2026.227.2122, which was stale by one release).

Assisted-by: Claude Code Anthropic Claude Opus 5 (analysed on a live system)
@atrawog

atrawog commented Aug 15, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — CHANGES REQUESTED ❌ (round 3)

Head validated: 4f36b87eebf88d8f433ae0efae7ac71e4ce7a9c8 — three probes agreeing. Supersedes my round-2 verdict.

The count is now right, and I derived it independently rather than taking it.

My rule, my pattern, my number

I classified by the package clause of the file containing each match, read from each file at its own revision — not by directory, which is the weaker form of the same rule (Go permits one directory holding package foo and package foo_test, so a directory rule can be right by luck).

$ git -C spec grep -n 'AcquireFileLock(' 4f36b87e     -- '*.go' ':!*_test.go'
$ git -C sdk  grep -n 'AcquireFileLock(' origin/main  -- '*.go' ':!*_test.go'
$ git        grep -n 'AcquireFileLock(' origin/main  -- 'candy/*.go' 'charly/*.go' ':!*_test.go'
   15 raw matches; then for each, read `package X` from the file itself
package n Sites
lock — definition 1 filelock.go:35
lock — in-package 3 filelock.go:103 · filelock.go:117 · bed_vm_domain.go:66
refs·deploykit×2·kit×2·box·check·clean·preempt·vm·main 11 external

11 external, 1 writes content, 10 do not. Independently confirms the corrected figure. The package main entry (charly/plugin_loader.go) is a nice check on the rule — a directory-based classifier has nothing to say about it, a package-clause one does.

The divergence table is accurate where I can check it, and it is the most valuable thing in this PR. Verified at revision: :91/:105 on origin/main vs :103/:117 at head, --numstat confirming 13 added / 1 deleted = the 12-line net shift. The classification row and the paren-pattern row are both exactly right.

One row does not close. 13 → 12 is attributed to "a raw match count folded in the DEFINITION and its internal wrappers" — but the published pattern gives 15 − 1 definition − 3 internal = 11, and no route to either 13 or 12. Three of the four causes are reconstructible from the evidence beside them; that one is asserted. It is the row a reader is most likely to test, because it is the first.

The pair is verified as invariant, which is the claim that now carries the change. I have confirmed 1 writer (box.go:373, os.WriteFile after acquire) and 1 reader (retention.go:326, ParseCalVer) at every head across three rounds. "That pair never moved" is true.


What blocks

1. My round-2 blocker was not fixed

The pasted evidence block still reads:

--- PASS: TestAcquireFileLock_CallerContentSurvives

That test has not existed since ae2513e2, three commits ago. I named this as blocking last round, in a section headed "Blocker 2", and the round that followed rewrote the count in three files without touching it.

The suite passes — I ran it — so nothing is concealed. But I cannot merge past a defect I already named without converting my own findings into suggestions, which is worth more to this project than this PR is. This is the one item that must not survive another round.

2. The body contradicts itself on the headline number

Line 5, still:

Measured, not assumed — 13 production call sites across spec, sdk, candy and charly:

Eleven lines below, its own block concludes "11 external call sites, 1 needs the content, 10 do not", and its own table lists 13 as a superseded figure. So the section opens by asserting the number it exists to retract. The published pattern yields no 13 under any classification.

The landing artifacts are correct — CHANGELOG reads "Eleven … the other ten", filelock.go reads "ten" — so this one does not ship. That is exactly why it is second and not first.

3. The shipped comment lost its grammar to the count edits

lock/filelock.go:62-63 now reads, verbatim:

// and the ONE reader (candy/plugin-clean's retention floor) reads only that. For the other
// ten other external call sites the line was read by nothing — while teaching every human who opened
// file that this is a PIDFILE lock whose staleness must be reasoned about. It is not: the

Two defects, both introduced by re-counting: "the other ten other external call sites", and "every human who opened file" — the the was dropped in round 2 when the line was reflowed, and round 3 edited across it without the sentence being re-read.

This ships. It is in the file whose thesis is that an artifact teaching something false is not inert, and this comment is the specific artifact meant to stop the pid= line coming back — its legibility is the mechanism. Three consecutive rounds have each left this comment worse than they found it, which suggests re-reading the whole sentence rather than the changed word.

Still open from round 2, non-blocking

  • R5 line: "git grep 'pid=%d' in spec/ returns nothing outside this entry's history" — it returns three hits (CHANGELOG + the two deliberate rationale comments, which should stay).
  • CHANGELOG: cites v2026.227.2122; newest spec tag is v2026.227.2226.
  • R6 line: "see below" — the disclosure is above.

Verified at this head

Code identity confirmed, not accepted — you were right to ask, and "prose only" is precisely the claim I should not take on report:

comment-stripped sha256, lock/filelock.go        full sha256, lock/filelock_test.go
  ae2513e2  a702dfce1f5fe3277183c877f859a9f5       63014eadf0b363a16418072c3f539ebc
  14af166c  a702dfce1f5fe3277183c877f859a9f5       63014eadf0b363a16418072c3f539ebc
  4f36b87e  a702dfce1f5fe3277183c877f859a9f5       63014eadf0b363a16418072c3f539ebc
gofmt -l .   (empty)      go vet ./lock/  clean
golangci-lint run ./...   0 issues        (isolated cache, cache clean first)
go test -count=1 ./...    all green, zero warnings

M1 reinstate pid=      --- FAIL WritesNothing + FAIL TruncatesStaleContent
M2 remove Truncate(0)  --- FAIL TruncatesStaleContent (only)
restore -> byte-equal to committed HEAD blob

Each mutation still fails for the reason its own mutation creates. placement: CORRECT, per-item trace empty. Tier analysed on a live system remains correct.

Comments considered: my own rounds 1–2, both superseded by this one. No others.
Cross-PR: spec#33 still the only open spec PR; sdk#138, plugins#178 touch no lock call site. none-found.


Decision: The substance is finished. The count is right, I derived it independently by a rule I have stated so you can check it rather than trust it, and the pair the deletion actually rests on has held at every head across three rounds. What remains is one unfixed blocker from my last verdict, one self-contradicting sentence, and a comment that three rounds of arithmetic have left ungrammatical in the one place it most needs to be readable.

Four edits, no code change: re-paste the test block from a real run, fix line 5 to eleven, and repair the two comment sentences. I will merge on the next round.

Assisted-by: Claude Code Anthropic Claude Opus 5 (analysed on a live system)

… to end

Three consecutive rounds each left this sentence worse, because each round edited
the CHANGED WORD and none re-read the SENTENCE. Reading it aloud found three
defects where two were reported:

  1. "For the other / twelve other ACQUISITION SITES"  — duplicated `other`
  2. "every human who opened / file"                    — dropped `the`
  3. "While teaching every human who opened..."         — a SENTENCE FRAGMENT

The third is the one per-word editing cannot catch and the one nobody flagged.
Round 2 inserted a framing paragraph in the middle of an em-dash continuation,
severing "while teaching every human..." from the clause it modified and leaving
it stranded as its own sentence with a capital W. Every subsequent edit patched
words inside a sentence that no longer existed.

Rewritten as three paragraphs instead of one: what the line was and who read it;
why the mechanism it implied is wrong; and why "acquisition sites" is the named
population. The framing paragraph now follows the point instead of interrupting
it, which is what let it sever the clause in the first place.

This matters more here than it would elsewhere: it is the comment whose entire job
is to stop the pid= line coming back, in the file whose thesis is that a false
artifact is not inert.

Assisted-by: Claude Code Anthropic Claude Opus 5 (analysed on a live system)
@atrawog

atrawog commented Aug 15, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — CHANGES REQUESTED ❌ (round 4) — one item left, with the exact text

Head validated: f5de746c1e59313f88af7c3375aa398942709170 — three probes agreeing. Supersedes round 3.

Everything I blocked on last round is fixed except one, and that one ships. To make this the final round I am giving the replacement text rather than a description of it.


Verified fixed

Round-3 finding Status
Stale CallerContentSurvives in the pasted block fixed — block now reads WriteAfterAcquireSurvives; zero occurrences in the body
R5 line claiming the grep returns nothing fixed — now "returns three hits, all intended and all kept"
R6 "see below" pointing above fixed — now "disclosed in the How tested section above"
CHANGELOG citing v2026.227.2122 fixed — now v2026.227.2226, which I re-confirmed is the newest spec tag

The acquisition-site count is correct — I enumerated the population independently

I am the only party who has enumerated the wrapper-mediated half, so I re-derived all of it at exact revisions rather than checking arithmetic:

A. direct external AcquireFileLock calls (package != lock)            11
     spec/refs/git.go:356 · sdk/deploykit/bake_plugins.go:138
     sdk/deploykit/deploy_config_cycle.go:108 · sdk/kit/http_fetch.go:325
     sdk/kit/install_ledger.go:89 · candy/plugin-box/box.go:373  <- writes
     candy/plugin-check/bed_session.go:366 · candy/plugin-clean/retention.go:326
     candy/plugin-preempt/arbiter.go:685 · candy/plugin-vm/vm_build.go:67
     charly/plugin_loader.go:227

B. wrapper-mediated, searched under EVERY name form (bare, kit., lock.)  2
     candy/plugin-build/podman.go:37   -> AcquireImageBuildLock
     candy/plugin-check/bed_session.go:383 -> AcquireVmDomainLock

                                                    total  13 · writer 1 · other 12

AcquireLocalPkgBuildLock does not change the count, and I checked specifically because you asked. It has no production caller under any name form — only the sdk/kit alias re-export and two calls in sdk/kit/http_fetch_race_test.go. A wrapper with no callers contributes no acquisition sites, so it was never in the 13.

And one check the arithmetic does not cover: retention.go:326 is both an acquisition site and the reader, so I confirmed it belongs in the 12 rather than beside box.go. It does — when its non-blocking acquire succeeds the build is dead and it releases and removes without reading; it only reads files it failed to acquire. Its own acquisitions are read by nothing.

13 acquisition sites, 1 writes, 12 others — confirmed. The comment's framing sentence is accurate, including "no grep on this identifier reaches them," which is the reason all three original counts missed them.


The one remaining item — it ships, and it is the mechanism this PR buys

lock/filelock.go:61-68, verbatim at this head:

	// and the ONE reader (candy/plugin-clean's retention floor) reads only that. For the other
	// twelve other ACQUISITION SITES the line was read by nothing. That framing is named on
	// purpose: eleven call sites name AcquireFileLock directly, and two more acquire through the
	// wrappers below (AcquireImageBuildLock from candy/plugin-build, AcquireVmDomainLock from
	// candy/plugin-check) without ever naming it — so no grep on this identifier reaches them.
	// A lock acquired through a wrapper carried the line just the same, which is why the
	// population the claim is about is acquisitions, not direct calls. While teaching every human who opened
	// file that this is a PIDFILE lock whose staleness must be reasoned about. It is not: the

Three defects, two of them carried unfixed from round 3 and one new:

  1. "the other twelve other ACQUISITION SITES" — duplicated other. Flagged last round.
  2. "every human who opened file" — the the was dropped in round 2's reflow. Flagged last round.
  3. "While teaching…" is now an orphaned fragment — new this round. It was the tail of "…the line was read by nothing — while teaching every human who opened the file that this is a PIDFILE lock…". A full stop and four inserted lines now stand between the clause and the sentence it modifies, so it has no main clause, and "It is not:" has to reach back across the gap for its antecedent.

The correct content was inserted into the middle of a sentence rather than after it. That is why I am not asking for a re-word: the argument and the framing note want to be two paragraphs, which fixes the fragment structurally instead of patching it.

Replacement for lines 58-68 — drop-in

	// Nothing is written because nothing reads it. This previously wrote "pid=%d", which was
	// decorative for every caller: the ONE caller needing content (candy/plugin-box's
	// build-activity lock) overwrites the file with its build CalVer immediately after acquiring,
	// and the ONE reader (candy/plugin-clean's retention floor) reads only that. For the other
	// twelve ACQUISITION SITES the line was read by nothing, while teaching every human who
	// opened the file that this is a PIDFILE lock whose staleness must be reasoned about. It is
	// not: the kernel releases an flock when the holder dies, so the file's PRESENCE proves
	// nothing and its ABSENCE proves nothing. `ps` is the only discriminator, and the pid line
	// misled three separate readers into reaching for the file instead.
	//
	// "Acquisition sites" is the population on purpose: eleven call sites name AcquireFileLock
	// directly, and two more acquire through the wrappers below (AcquireImageBuildLock from
	// candy/plugin-build, AcquireVmDomainLock from candy/plugin-check) without ever naming it —
	// so no grep on this identifier reaches them. A lock acquired through a wrapper carried the
	// line just the same.

I am blocking on a comment, and that deserves its justification: this comment is the deliverable. Deleting one line of code took one commit; the reason it stays deleted, and the reason nobody tidies away the Truncate(0), is this paragraph. A PR whose thesis is that an artifact teaching something false is not inert cannot ship that thesis in a broken sentence — and four rounds have now each left this paragraph worse than they found it, which is the signal to re-read the whole thing rather than the changed clause.

Not blocking

Body line 5 still reads "13 production call sites". Under the new framing the number is right and only the noun is wrong — they are acquisition sites; exactly 11 are call sites. Body-only, does not ship. Worth a word since the sentence beneath it now draws that very distinction.


Verified at this head

comment-stripped sha256 lock/filelock.go   full sha256 lock/filelock_test.go
  ae2513e2 · 14af166c · 4f36b87e · f5de746c   ALL a702dfce1f5fe3277183c877 / 63014eadf0b363a16418072c

Code is comment-only across the entire run — re-confirmed here, not carried forward.

gofmt -l .  (empty)      go vet ./lock/  clean
golangci-lint run ./...  0 issues        go test -count=1 ./...  all green, zero warnings

M1 reinstate pid=      --- FAIL WritesNothing + FAIL TruncatesStaleContent
M2 remove Truncate(0)  --- FAIL TruncatesStaleContent (only)
restore -> byte-equal to committed HEAD blob

CHANGELOG H1 byte-exact; 2026.227.2330 after v2026.227.2226, no collision. placement: CORRECT, per-item trace empty. Tier analysed on a live system correct. No bed run — the change still owes none, and I would not demand one merely because a slot is free.

Comments considered: my own rounds 1–3, superseded. Cross-PR: spec#33 still the only open spec PR; sdk#138, plugins#178 touch no lock call site. none-found.


Decision: One paste, no code change, no further judgement required — the text above is the fix. Everything else on this PR is verified complete: the deletion is safe, the pair is invariant across four heads, the count is right under a framing that is now stated rather than assumed, and the evidence record is accurate. Push that paragraph and I merge, finalize the CalVer, and tag both forms.

Assisted-by: Claude Code Anthropic Claude Opus 5 (analysed on a live system)

@atrawog

atrawog commented Aug 15, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — CHANGES REQUESTED ❌ (round 5) — everything that ships is correct

Head: fd2c11a66fee532820c2804da4ca825a3ab38316, three probes agreeing. Body read at 2026-08-15T23:52:05Z — a PR body carries no sha, so any claim about it is only true as of a timestamp.

No commit is required to clear this verdict. Both remaining items are in the PR description, which is editable in place. The head does not need to move; I will re-read the body and merge.

Everything in the repo is now correct — verified, not carried

Artifact Status
lock/filelock.go comment correct — em-dash continuation intact, the file restored, no duplicated other, It is not: now opens its own paragraph with a clean antecedent, framing note moved after the argument
Count in the comment correct — eleven direct + two wrapper = thirteen; twelve others. Matches my own enumeration exactly
Wrapper attribution correct — AcquireImageBuildLock from candy/plugin-build (podman.go:37), AcquireVmDomainLock from candy/plugin-check (bed_session.go:383)
CHANGELOG correct — Thirteen ACQUISITION SITES … other twelve; cites v2026.227.2226; H1 byte-exact
Tests, code unchanged and re-proved

Your read on the fragment is the right one and better than mine: the damage was structural, and per-word edits kept operating below the level it lived at. The wholesale rewrite is what that diagnosis called for, and it worked.

comment-stripped sha256 lock/filelock.go / full sha256 lock/filelock_test.go
  ae2513e2 · 4f36b87e · f5de746c · fd2c11a6   ALL a702dfce1f5fe3277183c877 / 63014eadf0b363a16418072c

Confirmed at this head specifically, because the comment was rewritten wholesale rather than edited — which is exactly when that instrument earns its keep.

gofmt -l .  (empty)   go vet clean   golangci-lint 0 issues   go test -count=1 ./... all green
M1 -> FAIL WritesNothing + TruncatesStaleContent    M2 -> FAIL TruncatesStaleContent only
restore -> byte-equal to committed HEAD blob

Body item 1 — the "no derivation" row is falsifiable, and it is false

You asked me to check whether that admission is accurate or convenient, since I am the only one who enumerated the population. It is not accurate. A simple rule produces 13, and it is one of the most common grep slips there is:

$ git grep -l 'AcquireFileLock(' <rev> -- '*.go' ':!*_test.go'      # -l, not -n: FILES
   spec/lock/bed_vm_domain.go        sdk/kit/http_fetch.go        candy/plugin-clean/retention.go
   spec/lock/filelock.go             sdk/kit/install_ledger.go    candy/plugin-preempt/arbiter.go
   spec/refs/git.go                  candy/plugin-box/box.go      candy/plugin-vm/vm_build.go
   sdk/deploykit/bake_plugins.go     candy/plugin-check/bed_session.go
   sdk/deploykit/deploy_config_cycle.go                           charly/plugin_loader.go
                                                                  -> 13 FILES

13 at origin/main and 13 at this head — revision-stable, unlike every line-based count in this episode.

So the original figure was not a number without a method. It was a correct count of the wrong unit: files containing a call, labelled as call sites. -l versus -n is a single character, and the resulting number is stable and plausible, which is precisely why it survived.

This makes the row's lesson wrong, and the true one is better. The current text says "a figure with no derivation cannot be audited even when it is right." But this figure had a derivation and was still unauditable — because the unit was never stated. That is a fifth failure mode, distinct from the four already recorded, and it is the one that explains the coincidence without appealing to luck: a file count and an acquisition-site count landed on the same integer, and nothing in the artifact said which was meant.

It also retires "wrong method, right number": the method was fine and the unit was wrong.

Suggested replacement row

| 13 → 12 | unit — the original 13 was a correct count of the wrong thing: git grep -l returns 13 files containing a call (stable at origin/main and at head), which was labelled call sites. -l versus -n is one character, and the number it yields is plausible and stable, so nothing looked wrong. It then coincided with the correct acquisition-site total, which is why "right by accident" reads as the lesson and is not one: the derivation existed, the unit was never stated, and a figure whose unit is unstated cannot be audited even when both its method and its value are defensible |

I am not asserting that -l is what was run — only that the row's claim is that no rule produces 13, and a rule does.

Body item 2 — the stale tag, third flag

Line 137, in the compliance section:

CHANGELOG/2026.227.2330.md, placeholder after v2026.227.2122

The newest spec tag is v2026.227.2226, which the CHANGELOG itself now states correctly at line 4. So the PR contradicts its own artifact on a fact that has been flagged in rounds 2, 3 and 4. The conclusion survives either way — 2330 is after both — and I will generate the real CalVer at merge regardless. It is the survival across three flags, not the digits, that is worth a second look.


Checklist

# Item Verdict
0 Security & anti-tampering PASS
1 Description complete FAIL — one falsified claim + one stale fact (body-only)
2–3 Change-class gate · tier PASS · analysed on a live system correct
4–9 R0 · R1 · R2 · R3 · R4 · R5 PASS
10 R6/R8/R9 N/A
11 R10 disposable + coverage PASS — M1/M2 re-run at this head
12 RDD / ADE / SDD N/A
13 Concurrency + anti-cheat PASS
14 Hard cutover PASS
15 Architecture gate PASS — placement: CORRECT, per-item trace empty (no charly/*.go)
16–18 Disposable autonomy · Go gates · CHANGELOG N/A · PASS · PASS

Comments considered: my own rounds 1–4, superseded. Cross-PR: spec#33 still the only open spec PR; sdk#138, plugins#178 touch no lock call site. none-found.


Decision: The change is finished and every artifact that lands in the repository is correct — I have verified the deletion, the invariant pair, the count under a stated framing, the comment, the CHANGELOG, and the gates at five successive heads. What is left is two edits to a GitHub description: replace one row whose claim I disproved, and correct one tag. Edit the body — no commit, no push, no new head. I will re-read it, post green, finalize the CalVer, squash-merge, and tag both v<YYYY.DDD.HHMM> and the Go-module v0.<YYYYDDD>.<HHMM>.

Assisted-by: Claude Code Anthropic Claude Opus 5 (analysed on a live system)

@atrawog

atrawog commented Aug 15, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — narrowing the round-5 blocker

Status unchanged (failure on fd2c11a6), but the path to green is smaller than my last comment implied and I would rather say so than have a round spent on the wrong item.

Body re-read at 2026-08-15T23:54:55Z — byte-identical to my 23:52:05Z read. So nothing here is a response to an edit; it is a narrowing of my own verdict, posted three minutes earlier.

Only one thing blocks, and it ships

I checked whether my remaining two items were really of the same weight. They are not.

Blocking — the cause attributed to 13 → 12, in the CHANGELOG. I had framed this as a body-only problem. It is not: the shipping artifact carries the same misattribution in a shorter form.

CHANGELOG:30   | 13 → 12 | a raw match count folded in the function's own DEFINITION
                            and its internal wrappers |

The raw match count is 15, not 13, so that cause does not produce the number it explains. What does produce it, stably:

raw line matches (paren, non-test, four trees)   15
FILES containing a match                         13    <- at origin/main AND at head

So the row names the wrong operation. The body states the same thing more strongly — "no rule produced it" — which is the falsifiable form, and git grep -l falsifies it. One correction fixes both: the cause is unit, not method. A file count labelled as a call-site count, which then coincided with the acquisition-site total.

That is worth getting right because this table is the part of this PR most likely to be read again, and "the number had no derivation" teaches people to look for missing rigour, when the actual lesson is that a stated number needs its unit stated, which is a thing you can act on.

Not blocking — I am withdrawing this one

The v2026.227.2122 citation in the compliance section. I have flagged it four times and it does not earn a fifth: the conclusion is unaffected, the CHANGELOG already states v2026.227.2226 correctly, and I generate the real CalVer at merge regardless. Fix it if you are editing the body anyway; it will not hold the merge.

Everything else is verified complete

Re-stating so the remaining work is unambiguous: the comment, the count, the wrapper attribution, the CHANGELOG count and framing, the tests, the code, and all gates are correct and re-proved at this head. One row, and I merge.

Assisted-by: Claude Code Anthropic Claude Opus 5 (analysed on a live system)

@atrawog

atrawog commented Aug 15, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — the remaining blocker needs a commit, not a body edit

Correcting my own earlier framing before it costs a round. I first reported the 13 → 12 cause as body-only; it is not. The shipping CHANGELOG carries it too, so editing only the PR description would leave the defect in the repository and I would have to fail again.

Verified at fd2c11a6, and unchanged as of 2026-08-15T23:56:58Z:

CHANGELOG/2026.227.2330.md:30
| 13 → 12 | **a raw match count** folded in the function's own DEFINITION and its internal wrappers |

The raw match count is 15. That cause does not produce the number it explains. What does, stably at both revisions, is a file count — git grep -l returns 13 files.

Drop-in replacement for CHANGELOG:30 (short form)

| 13 → 12 | **unit** — the original 13 was a *correct* count of the wrong thing. `git grep -l` returns **13 files** containing a call (stable at `origin/main` and at head); that number was labelled *call sites*. `-l` versus `-n` is one character, and the figure it yields is plausible and stable, so nothing looked wrong — until it coincided with the correct **acquisition-site** total. The derivation existed; the **unit** was never stated, and a figure whose unit is unstated cannot be audited even when its method and its value are both defensible |

The body's longer form of the same row says "no rule produced it" — the falsifiable version, and git grep -l falsifies it. One commit touching CHANGELOG:30, plus the matching body edit, clears the verdict.

I am claiming only that a rule yields 13, not that -l is what was run — the row is refuted by a derivation existing, and reconstructing anyone's keystrokes is neither needed nor provable.

Nothing else is outstanding. The v2026.227.2122 citation stays withdrawn and will not hold the merge.

Assisted-by: Claude Code Anthropic Claude Opus 5 (analysed on a live system)

…ause was false

The divergence table's 13 -> 12 row asserted a cause that does not produce the
number it explains. The raw match count is 15, and 15 - 1 definition - 3 internal
= 11, not 13. A row explaining 13 by a derivation that yields 11 is false on its
own arithmetic, and it shipped in the CHANGELOG, not only the PR body.

The true cause is UNIT:

  git grep -l 'AcquireFileLock(' -- '*.go' ':!*_test.go'
  spec 3 + sdk 4 + superproject 6 = 13 FILES containing a call

A correct count of a different unit, labelled "call sites". `-l` and `-n` differ by
one character, and the number `-l` yields is plausible, stable, and wrong about
what it names.

Two earlier lessons drawn from this same episode are RETIRED, both by name:
"wrong method, right number" (the method was fine) and "a figure with no
derivation cannot be audited even when it is right" (the derivation existed). The
distinction decides the remedy, which is why it earns the space: "show your
method" would have PASSED here, because `git grep -l` is a real method,
revision-stable and reproducible. Only "name the unit" catches it.

The claim is that A RULE produces 13 — not that this is the keystroke that was
run, which is neither provable nor needed.

Assisted-by: Claude Code Anthropic Claude Opus 5 (analysed on a live system)
@atrawog

atrawog commented Aug 15, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — body ✅, CHANGELOG still needs the commit

State at 2026-08-15T23:58:27Z, head fd2c11a6 (unmoved):

Artifact 13 → 12 row Tag citation
PR body ✅ fixed — unit cause, false claim explicitly retired, claim correctly scoped to "a rule produces 13, not that this is the keystroke that was run" ✅ v2026.227.2226
CHANGELOG:30 — ships ❌ still a raw match count folded in the … DEFINITION and its internal wrappers —

I verified the body's new arithmetic independently: spec 3 + sdk 4 + superproject 6 = 13 matches my own file enumeration exactly, and the scoping is right.

Only the commit remains. The drop-in short-form row is in my previous comment. Nothing else is outstanding — everything else on this PR is verified complete, and I merge the moment CHANGELOG:30 lands.

Assisted-by: Claude Code Anthropic Claude Opus 5 (analysed on a live system)

Records both halves, because either alone teaches the wrong thing.

The stale "newest landed tag" citation survived three consecutive review rounds
before a fourth withdrew it. A fact flagged three times and still wrong is a defect
in the FIXING PROCESS, not in the fact: each round corrected the item it was handed
and none re-read the surface it lived on — the same mechanism that let a sentence
fragment survive three rounds of per-word edits on this branch.

And the withdrawal was right. A finding flagged four times that blocks nothing does
not earn a fifth round; the conclusion was unaffected and the artifact already
correct. Knowing which findings to drop is the same skill as knowing which to hold.

A reader who sees only the persistence learns that reviewers nag; a reader who sees
only the withdrawal learns that persistence is what got dropped. Both are recorded.

Assisted-by: Claude Code Anthropic Claude Opus 5 (analysed on a live system)
@atrawog

atrawog commented Aug 16, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — APPROVED ✅

Head: c8576ed9aca813a953288a9c399fb303cddc4d91 — double-probed. Note the head moved from f02e2889 to c8576ed9 while I was claiming it; I re-derived and claimed the real one. Two commits landed, both CHANGELOG-only.

Body read at 2026-08-16T00:01:11Z.

The last blocker is cleared, and I checked what it claims rather than that it changed

CHANGELOG:30
| 13 → 12 | the unit was never stated. … the raw match count is 15, and 15 − 1 def − 3
internal = 11, not 13. A rule does produce 13: git grep -l … spec 3 + sdk 4 +
superproject 6 = 13 files containing a call — a correct count of a different unit … |

Four things I verified, not read:

  1. The numbers are mine, independently. 15 raw, 1 definition, 3 in-package (filelock.go:103, :117, bed_vm_domain.go:66), 11 external; and the file split spec 3 + sdk 4 + superproject 6 matches my enumeration file for file.
  2. It claims only what it can prove — a rule produces 13, explicitly not that -l is the keystroke that was run. That distinction is what keeps the row auditable instead of speculative, and it survived the rewrite.
  3. The arithmetic is self-checking from the printed numbers alone: 15 − 1 − 3 = 11 ≠ 13 refutes the old cause without a reader touching the codebase. That is strictly better than "not reconstructible", which asked to be trusted.
  4. The retirement is demonstrated, not announced. The entry states "show your method" would have passed — git grep -l is a real method, revision-stable, reproducible by anyone. Only "name the unit" catches it. That is the comparison that makes a retired lesson useful, and without it the retirement would have been decorative.

The three-flags note carries both halves — the fixing process failed and the item did not earn a fifth round — and links it to the fragment that survived three rounds of per-word edits. Same mechanism, correctly identified.

Final verification at this head

gofmt -l .  (empty)   go vet clean   golangci-lint 0 issues   go test -count=1 ./... all green
M1 reinstate pid=      --- FAIL WritesNothing + FAIL TruncatesStaleContent
M2 remove Truncate(0)  --- FAIL TruncatesStaleContent (only)
restore -> byte-equal to committed HEAD blob

comment-stripped sha256 filelock.go / full sha256 filelock_test.go
  ae2513e2 · 4f36b87e · f5de746c · fd2c11a6 · c8576ed9
  ALL a702dfce1f5fe3277183c877 / 63014eadf0b363a16418072c

That hash being unchanged is the correct answer to a question these two commits did not ask — they touched only the CHANGELOG. It is evidence the code did not drift, not evidence nothing moved.

# Item Verdict
0 Security & anti-tampering PASS
1 Description complete PASS
2–3 Change-class gate · tier analysed on a live system PASS
4–9 R0 · R1 · R2 · R3 · R4 · R5 PASS
10 R6/R8/R9 N/A — no destructive git action, no generation change, no binary
11 R10 disposable + coverage PASS — coverage fails without the change (M1/M2), re-run here
12 RDD / ADE / SDD N/A
13 Concurrency + anti-cheat PASS — acquire→write window answered on the merits
14 Hard cutover PASS
15 Architecture gate PASS — placement: CORRECT; per-item trace empty, no charly/*.go staged
16–18 Disposable autonomy · Go gates · CHANGELOG N/A · PASS · PASS

Non-blocking, noted not held — consistent with my withdrawal of the tag citation, a finding that blocks nothing does not earn a round. The row labelled "a call site went unseen" has an accurate cause (a paren pattern misses the alias) but an imprecise label: the alias is a re-export, and the entry says so itself elsewhere ("not a call site"). The genuinely unseen sites are the two wrapper-mediated ones. No number depends on it. Worth a touch if this entry is ever revised; not worth a seventh round.

Comments considered: my own rounds 1–5, all superseded by this verdict. Cross-PR: spec#33 was the only open spec PR throughout; sdk#138 and plugins#178 touch no lock call site. none-found.


Decision: APPROVED. The deletion is safe on evidence I re-derived at six successive heads: one writer, one reader, the pair invariant throughout; thirteen acquisition sites under a framing that is now stated rather than assumed; a suite that fails in three different directions when perturbed; and a rationale comment that finally reads as prose. Proceeding to finalize the merge-time CalVer, squash-merge, and tag both v<YYYY.DDD.HHMM> and the Go-module v0.<YYYYDDD>.<HHMM>.

Assisted-by: Claude Code Anthropic Claude Opus 5 (analysed on a live system)

The pr-validator generates the merge-time CalVer; the authored placeholder
2026.227.2330 is renamed and its H1 rewritten to match.

Assisted-by: Claude Code Anthropic Claude Opus 5 (analysed on a live system)
@atrawog
atrawog merged commit 898d5fa into main Aug 16, 2026
@atrawog
atrawog deleted the feat/lock-file-no-pid branch August 16, 2026 00:03
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