fix(conformance): async-safe docker probes + real imageDigests staleness#363
Merged
Conversation
Two review follow-ups in the dev-only parity-harness runner. #4 (Principle V): the Docker channel observers spawned blocking `docker inspect` from a sync capture() invoked inside async fns, blocking the tokio executor. The runner now pre-fetches the container inspect ONCE off the executor via tokio::task::spawn_blocking and stores it on RunContext.container_inspect; the four Docker observers became pure readers of it (no subprocess). Net: one inspect per case instead of 4+, and no observer blocks the executor. The one-shot refresh / snapshot-check CLIs and the Drop cleanup guard keep direct sync calls (the sanctioned non-concurrent exception). #5: imageDigests was a declared staleness field that was never populated or recomputed, so image-content drift on a future Docker snapshot case would go undetected. New image_digests_for_case recomputes the digest of each image a Docker case's fixtures pin (empty, and docker-free, for non-Docker cases so a read-configuration snapshot never gates on a base image); wired into capture_provenance (record) and snapshot_oracle (live gate, offloaded). The hermetic snapshot check carries recorded digests (no docker → cannot verify). The only existing snapshot case is config-only, so its imageDigests stays empty and the committed snapshot is unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019vhr7Tcf8ybvSZSE1owqBT
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.
Conformance runner: async-safe Docker probes + real
imageDigestsstalenessTwo follow-up fixes from the
/code-reviewof the 022 declarative conformance runner (findings #4 and #5). Both are contained to the dev-onlyparity-harnesscrate.#4 — no blocking
std::process::Commandon the async executor (Principle V)The Docker channel observers each spawned their own blocking
docker inspectfrom a synccapture()invoked insideasync fns, blocking the tokio executor.docker inspectonce, off the executor viatokio::task::spawn_blocking, and stores it onRunContext.container_inspect.image/process-graph/injected-process/temporal) became pure readers of that pre-fetched value — no subprocess, no blocking.execute_opsis likewise offloaded viaspawn_blocking.Net effect: a Docker case now pays one inspect instead of 4+, and no observer blocks the async executor.
spawn_blockingworks on the current-thread runtime#[tokio::test]uses. The one-shot refresh /snapshot checkCLIs and theDropcleanup guard keep direct sync calls (non-concurrent, the sanctioned exception).#5 —
imageDigestsis now a real staleness signalimageDigestswas declared a staleness field but was never populated or recomputed — an image-content change on a future Docker snapshot case would go undetected.image_digests_for_case: for a Docker case, recomputes the digest of each image its fixtures pin (docker image inspect→RepoDigests/.Id); for a non-Docker case it returns empty without touching docker (aread-configurationsnapshot must never gate on a base-image digest — the same false-staleness trap avoided for host tool versions in BUG: Features installed in running container instead of during image build #1).capture_provenance) and the live replay gate (snapshot_oracle, offloaded). The hermeticsnapshot check(no docker) keeps carrying the recorded digests — it cannot verify a Docker case's images, so it must not falsely flag them (returnsNone→ carry recorded).The only existing snapshot case (
case-readconfig-snapshot) is config-only, so itsimageDigestsstays empty and the committed snapshot is unchanged.Verification
cargo fmt --all -- --check+cargo clippy --all-targets --all-features -- -D warningsclean.image_digests_for_case/fixture_image.parity_conformance_runnerpasses against real Docker + the pinned oracle.🤖 Generated with Claude Code
https://claude.ai/code/session_019vhr7Tcf8ybvSZSE1owqBT