feat(attest): reproducible, minimal replay-runner Docker image#9244
Merged
Conversation
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
loopover-ui | 51b1c7d | Commit Preview URL Branch Preview URL |
Jul 27 2026, 09:02 AM |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9244 +/- ##
=======================================
Coverage 95.21% 95.21%
=======================================
Files 729 729
Lines 59151 59151
Branches 20947 20947
=======================================
Hits 56321 56321
Misses 1613 1613
Partials 1217 1217
Flags with carried forward coverage won't be shown. Click here to find out more. |
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.
Summary
Closes #9214 (epic #8534): a container image for
attested-backtest-run.tsthat anyone can independently rebuild and verify — attestation over an unpinned, irreproducible workload is theater, so the launch measurement inside a real envelope has to correspond to something checkable.What's in the image, and what isn't:
node:22-slim@sha256:...), not a mutable tag.npm ciagainst committed lockfiles only — no fuzzy dependency resolution anywhere in the build.--persistflag (which shells towrangler d1 execute --remote) is unreachable from this image's default invocation.--network none: the default (sample-attester) path never touches the network.USER replay-runner, uid 10001).@loopover/engine's full@anthropic-ai/claude-agent-sdk+tree-sitter-wasmsdependency tree, pulled in only because the barrel (@loopover/engine's default export) re-exportsminer/repo-map.ts, which statically importsweb-tree-sitter— unrelated to anything this script touches. Fixed at the root: two new subpath exports (./calibration/attester,./calibration/attestation-envelope,./calibration/backtest-corpus) letattested-backtest-run.tsand its sibling scripts bypass the barrel entirely, mirroring the exact precedent already in this codebase (src/db/repositories.ts's@loopover/engine/parse-pull-request-target-key, added for the same reason — avoiding an unrelated heavy import graph). For a measured, eventually-TEE-hosted image, this is a real security property (smaller trusted computing base), not just a size optimization.tsx(needed becausescripts/**'s relative imports are extensionless per scripts: unify relative-import specifiers with src/** (extensionless) and add a drift guard #9221, and Node's own ESM loader can't follow that without a bundler-aware resolver) is installed in its own isolated stage against a dedicated, committed lockfile (scripts/replay-runner/tsx-runtime/) — not by keeping the whole root devDependency tree around.Reproducibility manifest (
scripts/replay-runner-image-manifest.json+scripts/replay-runner-image-manifest-core.ts): a declared-inputs digest over the pinned base image ref, the Dockerfile's text,package-lock.json's text, and every source file the image's runtime stage copies in.npm run replay-runner-manifest:check(wired intotest:ci) fails on any drift.scripts/replay-runner/README.mddocuments the exact reproduction procedure and, per the issue's own requirement, states plainly what this claim does and does not cover — it's a declared-inputs digest, not a claim that the built Docker image ID itself is bit-for-bit reproducible across machines (a real, separate, harder gap that layer-metadata non-determinism creates industry-wide, not something this repo has solved).CI (
.github/workflows/replay-runner-image.yml, push-to-main only, mirroringselfhost.yml's own build-boot job and its stated reasoning — the fast manifest-drift check already gates every PR, so a slow Docker build only needs to run post-merge): builds the pinned Dockerfile, confirms the non-root user, runs a real attested pass with--network none, and confirms the fail-closed path (TEE claimed, no reachable hardware → exit 1).Validation
npm run replay-runner-manifest:check— clean.npm run import-specifiers:check— clean.npm run actionlint— clean (new workflow validated).npm run typecheck— clean.npm run build --workspace @loopover/engine+npm run test --workspace @loopover/engine— 737/737 pass.npx vitest runtargeted at every touched/new suite (attester, snp-attester, attested-backtest-run-core, the real-subprocess E2E, backtest-corpus-export-core, the new replay-runner-image-manifest-core suite) — 52/52 pass. New manifest-core suite: 9/9 pass, 100% statement/branch/function/line coverage.docker build+ full manual smoke test (build, non-root check, attested run with--network none, fail-closed path) — all pass, mirrored exactly by the new CI workflow, which I dry-ran locally command-for-command before committing it.Safety
sqlStringLiteralduplicated intoattested-backtest-run-core.tsrather than imported cross-file, for the same reason the codebase already duplicates it betweenbacktest-corpus-export.tsandbacktest-logic-check-core.ts(avoiding unwanted coupling to an unrelated file's own import graph).