Repository navigation
Sweep leftover path identity probes in startup recovery (#181) - #192
Merged
Merged
Conversation
The probe's container and anonymous volume now carry the database's runner token and `io.codeboost.probe=path-identity`, a label shape for runner-scoped objects. Startup recovery, under the runner lock, removes this runner's probe containers (by full ID) and then their volumes (by name), and leaves anything of another runner, anything without the probe kind, and anything with attempt, allocation or other kind labels. A probe without a runner label is reported. Closes #181 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…181) Review round 1: the fake daemon exits 0 for a missing volume under --force and refuses a volume a container mounts; tests for a refused probe container and a malformed runner token; docs state the probe exception to the scoped recovery rule and what an orphaned client can do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
) Review round 2: a probe volume that a container recovery leaves still mounts is kept for a later start rather than failing every start; a probe volume counts only with this runner's label, since it is removed by name; a lone leftover volume is tested; doc wording. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… 27.4 (#181) Review round 3: an object listed under this runner but inspected with another's is neither removed nor reported; the fake's rm --force of a missing container exits 0, as Docker 27.4 does; the kept in-use volume's wording says it goes once its holder is gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e fixture (#181) Review round 4. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🔵 Needs a closer look
Destructive Docker cleanup needs human confirmation of real-Docker validation, which remains unverified in this review.
No open issues 🎉
What changed in this PR
Addresses #181 by making interrupted path identity probes discoverable and removable during runner startup recovery.
Changes:
- Labels probe containers and volumes with the runner token and probe kind.
- Adds ownership-checked cleanup, removing containers before volumes and networks.
- Adds regression coverage and updates recovery documentation.
| File | Description |
|---|---|
| test/runner-workspace.test.ts | Adds real-Docker recovery and runner-isolation coverage. |
| test/runner-production.test.ts | Verifies recovery and probing use the same runner token. |
| test/path-identity-probe.test.ts | Checks labelled arguments and invalid-token rejection. |
| test/agent-recovery.test.ts | Covers cleanup ordering, ownership checks, and failures. |
| runner/production.ts | Passes the runner token to the probe. |
| docs/implementation/runner-lifecycle.md | Documents startup probe recovery. |
| docs/implementation/agent-isolation.md | Describes probe ownership and cleanup rules. |
| docs/architecture.md | Records the probe-recovery follow-up. |
| agents/recovery.ts | Recognizes and removes owned leftover probes. |
| agents/labels.ts | Defines validated runner-scoped probe labels. |
| agents/container/storage.ts | Labels probe containers and anonymous volumes. |
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #181
What changes
agents/labels.ts).PROBE_LABELisio.codeboost.probe, andrunnerProbeLabels(runnerOwner, 'path-identity')validates the token. A probe carries the runner label and its kind, and no attempt or allocation label.agents/container/storage.ts).pathIdentityProbeArgsputs both labels on the container, and withvolume-label=on its anonymous volume as well.probeTaskStoragePathIdentity(imageId, runnerOwner, …)takes the database's runner token, whichsetUpRunnerpasses.agents/recovery.ts), under the runner lock and before this process probes:path-identity, no attempt, allocation, invocation, egress or storage label, and a namecodeboost-path-identity-<uuid v4>.unknown-kind. A probe without a runner label is reported asno-runner-label;PROBE_LABELwas added to the unowned scan for this.--rmorrm --volumesfailed to remove is found and removed by the next startup's recovery.Tests
test/runner-workspace.test.ts): a probe left by a killed runner, created from the probe's own arguments, is removed with its volume. Another runner's probe stays, and so does this runner's container without the probe kind label.test/agent-recovery.test.ts, answeringvolume rm/volume inspectas Docker 27.4.0 does):test/path-identity-probe.test.ts): the exact labelled arguments, and a malformed token refused before any Docker call.test/runner-production.test.ts: the probe gets the token recovery ran under.Review record
Each independent round was a fresh general-purpose agent with no shared context, reviewing the full diff against
origin/main. Baseaced300for rounds 1–4; base46567ea(after #190 merged) for round 5.rm --forceof a missing container was not Docker 27.4's. Nits: comment scope; a relabelled volume was reported as this runner's--rm; the failure message did not mention recoveryValidation at the reviewed head (94b21ae, base 46567ea):
real-dockerpassed in 21m6s (run 39530270190). It ran the new real-Docker recovery test intest/runner-workspace.test.ts.testpassed in 24m15s (run 39530270067).npm run typecheckpasses, and so dotest/agent-recovery.test.ts,test/path-identity-probe.test.tsandtest/runner-production.test.ts.Declined (round 5 observations, with the reason):
unownedblocks startup, and the documented design keeps the volume until its holder is gone.docker ps -a --filter name=codeboost-path-identity-.Review lessons (merge gate):
🤖 Generated with Claude Code