Repository navigation
Bind approvals to reviewed evidence, sandbox validation network, fix flaky test - #15
Merged
Merged
Conversation
The test waited for the Worker responseId by polling the in-memory store, then built a second controller that reads the state file from disk. The store publishes a mutation in memory before its atomic write lands, so recover() could see the stale 'submitting' assignment, replay the held POST with the same idempotency key, and block until the 5 s timeout (17/20 failures under CPU load). Poll the on-disk state instead (0/90 under the same load). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DXCvrGWmmRNDLmy7nYS2QP
approveRun computed the evidence digest at click time, so a decision applied to whatever evidence existed when the request arrived, even if it changed after the operator looked (a validation retry, a correction cycle, another tab). The GitHub merge path already required the reviewed head SHA; do the same for the Foreman decision. GET /api/runs/:id/decision returns the evidence digest and identity for a run at a decision checkpoint. Approve and reject now require that evidenceDigest: missing or malformed is a 400, and a digest that no longer matches the stored evidence is a 409 with nothing recorded. The UI fetches the digest when it renders a decidable run, keyed on the Worker response, validation and Reviewer recommendation it shows, never at click time. It ignores out-of-order responses and refuses a digest issued for evidence other than what is on screen. Both Approve/Reject pairs are disabled until the digest is ready; a 409 shows the server's message and refetches. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DXCvrGWmmRNDLmy7nYS2QP
Validation commands now run inside a network namespace with no interfaces by default, so a check cannot reach services on the host (the bridge, local databases) or cloud credential endpoints. - Each validation command carries an optional `network` flag. When it is absent, the default is decided at execution time from the command: npm, pnpm and yarn installs get network, everything else does not. Older recorded runs therefore keep the same evidence digest and still promote. - Repository inspection sets `network: true` explicitly on the suggested install, cargo test and go test checks. - The open-repository dialog shows each suggested check with a network toggle, and the checks pipeline shows a network badge on checks that run with network. - With FOREMAN_VALIDATION_SANDBOX=none the flag has no effect and every command keeps host networking, as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DXCvrGWmmRNDLmy7nYS2QP
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.
Third batch of audit fixes. Three commits:
Bind the human decision to the evidence the operator reviewed (
3a1e627)GET /api/runs/:id/decisionreturns the current evidence identity:evidenceDigest,pinnedBaseCommit,workerResponseId,validationIdandrecommendationId.evidenceDigest(64 hex characters).ui/decision-digest.tsfetches the digest keyed on the evidence identity that is on screen.docs/workspace-bridge.mdis updated to cover the approve step.Run validation commands without network unless they need it (
906cd75)--unshare-netunless it needs network. A check therefore cannot reach services on the host (the bridge, local databases) or cloud credential endpoints.networkflag.tests/recorded-integration.test.tscovers this.network: trueon the suggested install,cargo testandgo testchecks.FOREMAN_VALIDATION_SANDBOX=nonenothing changes: every command keeps host networking.Fix the flaky live Worker persistence test (
734d19e)Verification
pnpm test:bridge: 54/54 passing.🤖 Generated with Claude Code
https://claude.ai/code/session_01DXCvrGWmmRNDLmy7nYS2QP
Generated by Claude Code