Repository navigation
Harden hosted run-scope lookup against HTML error pages - #84
Merged
Merged
Conversation
Synthetic and v2 bindings no longer request an execution scope, looked-up scopes use the same usability checks as the pinned path, and non-JSON error pages keep their HTTP status instead of crashing as invalid JSON. Co-authored-by: Jeff Skafi <jeffskafi@gmail.com>
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.
Implements AUG-335 for AUG-333. Parent issue merges this.
Base
4b97519caf3fcf5e9cc23e71fc7920266f9eaa34(main). Headff1689d39ae93ea562c0582c68dc8f170328ce32.What changed
getRunExecutionScope, so they never request a scope. Authorized packets that still have no scope keepINVALID_EXECUTION_SCOPE.assertHostedScopeUsableholds the shared post-fetch checks (release capability, workspace, availability, authority verification, scope and authority expiry, target boundary). The pinned path still compares revision and hash. Run lookup skips only those two comparisons.getRunExecutionScopereturnsundefinedonly for HTTP 404. Other failures, including 5xxCLOUD_REQUEST_FAILED, propagate.#requestno longer turns a non-JSON error page intoINVALID_CLOUD_RESPONSE. Non-2xx non-JSON bodies continue through the existing status handling with no body, and the message names the method and path. Non-JSON 2xx bodies still throwINVALID_CLOUD_RESPONSE. Billing HTML error bodies are unchanged.Tests added
test/cloud/request-errors.test.ts: HTML 404 keepshttp_status: 404; HTML 200 isINVALID_CLOUD_RESPONSE; a billing HTML error body staysINVALID_CLOUD_RESPONSE.test/real-data/contract.test.ts: synthetic and v2 bindings make no scope request; a looked-up scope that passes the shared checks is used; each failed check is rejected with that check's code; an HTML 404 lookup isINVALID_EXECUTION_SCOPE; a 503 lookup propagates; a stale pinned revision is still rejected before availability.test/recovery/recovery.test.ts:recover --resumefor a synthetic run completes against an HTML 404 fallback.test/selection/execution.test.ts: a saved v2 suite run completes against an HTML 404 fallback.test/investigation/admission.test.ts: an investigation rerun completes against an HTML 404 fallback.Verification
npm run checkpassed (1092 tests passed, 1 skipped).npm run smoke:packpassed.npm run test:packed-core-release:localpassed. LocalreleaseReadystays false because registry identity and the live-authorized environment are not run; every executed check passed.node scripts/packed-saved-suite-release.mjspassed.node scripts/packed-real-data-privacy.mjspassed.node scripts/packed-report-fixture.mjspassed withAUGMENTWORKS_PACKED_BINpointed at the built CLI (the script requires that variable;smoke:packinvokes it the same way).Linear Issue: AUG-335