Forget a deleted host in the exchange, and prove the janitor's teardown - #40
Merged
Conversation
czpython
force-pushed
the
dru-401-per-box-lifecycle
branch
from
September 6, 2026 16:30
8f8c085 to
c5b7e95
Compare
czpython
force-pushed
the
dru-461-refresh-on-expiry
branch
4 times, most recently
from
September 7, 2026 05:52
0cd8887 to
10404df
Compare
czpython
force-pushed
the
dru-401-per-box-lifecycle
branch
from
September 7, 2026 05:59
c5b7e95 to
2d75103
Compare
The exchange drops the secrets of every host that has no row on each pass of its timer, so no fetch runs for a dead box. A test proves that the janitor removes an expired host's secrets before its VM, through the same path as an API delete. On docker-sbx a value directory that cannot be removed at teardown is a provider error now, so the row stays for a retry and no value file outlives its row. A missing directory is a removed one. The docs say that the janitor deletes an expired host the same way, and that a sandbox must be removed through drukbox, never with sbx rm, since its secrets would stay in sbx's store until its row expires.
czpython
force-pushed
the
dru-401-per-box-lifecycle
branch
from
September 7, 2026 06:01
2d75103 to
f3373ed
Compare
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.
What changes
Teardown was built in the two PRs before this one. This PR closes the ticket with what was left.
Secrets.forget_deleted_hostsdrops the secrets of every host that has no row, so no fetch runs for a dead box.delete_host, the same as an API delete. The pool shed takes the same path.sbx rm, since its secrets would stay in sbx's store until its row expires.Where this differs from the ticket
delete_secretfor each entry inhost.secrets, by placeholder. The seam PR before this one removes the sandbox's whole scope in one call, listed from sbx, and never reads the row. The row keeps only a fingerprint of the placeholder, and a row whose secrets no longer decrypt must still go.Names
New names, open to change:
Secrets.forget_deleted_hosts.Gates
uv run ruff check,uv run ruff format --check,uv run pyright, anduv run pytestare green.Acceptance
docker-sbx on the KVM bed, with a host on a 60 second lease, an anthropic secret from an issuer stub, and a static github secret:
claude -pansweredokwhile the lease lasted, and the exchange pushed seven times.Review
The adversarial review reported one finding, applied: on docker-sbx the value directory was removed with errors suppressed, so a filesystem error would have let the VM and the row go while plaintext files stayed behind with nothing left to retry. The removal now raises a provider error on any failure but a missing directory, which keeps the row for a retry. The provider's own best-effort removal on a failed create stays, since nothing else removes the files on that path.