Repository navigation
feat: run subcommand and the full guardrail set - #4
Merged
Merged
Conversation
webtest run <scenario.hcl> renders the scenario's page and drives it via driver.Run, with every guardrail go-wasmcontainers asked for: - Dry-run by default: a submit step always computes PreviewSubmit's own preview; only --submit performs the real request. - Pinned-page check: already in driver.Run itself, nothing new needed here. - Session persistence (session.go): cookies the real http.Client actually received are kept in a 0600 file under the user's own config dir, never in an argument/env var/log line. A file found with any other permission is treated as corrupted, not silently trusted. cookiejar.Jar exposes no "list every cookie" method, so saving asks it per-host for exactly the hosts this run touched. - Append-only audit log (auditlog.go): one JSON line per submit step (time/url/method/body/dry_run), 0600, rotated past 10 MiB. - Bounds: --timeout (default 30s), --max-steps (default 200, checked before any rendering happens). - Anti-bot detection (antibot.go): a small, named marker set for well-known CAPTCHA providers and Cloudflare's own interstitial — found, run refuses outright. A heuristic, not exhaustive, and deliberately biased toward false positives over false negatives (stopping on an ordinary page that happens to mention one of these words is the safer failure direction for a tool whose whole point is never to route around a real challenge). Decisive test: TestRunPersistsCookiesAcrossInvocations — a login run (--submit) followed by a SEPARATE run invocation that only succeeds because the persisted cookie carried the session across. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
4 tasks done
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
Final piece of the automation layer (closes the plan at
~/.claude/plans/federated-nibbling-pixel.md):webtest run <scenario.hcl>renders the scenario's page and drives it viadriver.Run, with every guardrail go-wasmcontainers asked for:submitstep always computesPreviewSubmit's own preview; only--submitperforms the real request.driver.Runitself (PR feat: driver package — execute a scenario against a real LiveDocument #3), nothing new needed here.session.go): cookies the realhttp.Clientactually received are kept in a 0600 file under the user's own config dir, never in an argument/env var/log line. A file found with any other permission is treated as corrupted, not silently trusted.cookiejar.Jarexposes no "list every cookie" method, so saving asks it per-host for exactly the hosts this run touched.auditlog.go): one JSON line per submit step (time/url/method/body/dry_run), 0600, rotated past 10 MiB.--timeout(default 30s),--max-steps(default 200, checked before any rendering happens).antibot.go): a small, named marker set for well-known CAPTCHA providers and Cloudflare's own interstitial — found,runrefuses outright. A heuristic, not exhaustive, and deliberately biased toward false positives over false negatives (stopping on an ordinary page that happens to mention one of these words is the safer failure direction for a tool whose whole point is never to route around a real challenge).Decisive test:
TestRunPersistsCookiesAcrossInvocations— a login run (--submit) followed by a SEPARATEruninvocation that only succeeds because the persisted cookie carried the session across.Test plan
TestRunDryRunByDefaultNeverPosts— test server fails if a POST ever arrivesTestRunSubmitFlagPerformsRealRequestTestRunMaxStepsExceededTestRunRefusesAntiBotPageTestRunPersistsCookiesAcrossInvocationsTestLoadCookieJarMissingFileIsEmptyNotError/TestLoadCookieJarRefusesWrongPermissions/TestSaveAndLoadCookieJarRoundtrip/TestSaveCookieJarOnlyNamedHostsTestAppendAuditLogCreatesAndAppends/TestAppendAuditLogRotatesWhenTooLargeTestDetectAntiBotFindsRecaptcha/TestDetectAntiBotFindsCloudflareInterstitial/TestDetectAntiBotOrdinaryPagego build/go vet/gofmt -l/govulncheck ./...cleango test ./...green (46 tests across all packages),go test ./... -raceclean🤖 Generated with Claude Code