Harden venue, catalog, cart, and checkout contracts - #33
Merged
mekedron merged 9 commits intoJul 26, 2026
Conversation
Contributor
Author
|
The audit fixes are consolidated into nine logical commits. The PR description contains the complete acceptance mapping, validation results, and known boundaries. |
Contributor
Author
|
Update complete: the branch is rebased onto v2.2.1 ( |
saneruby
force-pushed
the
agent/mcp-audit-hardening-clean
branch
from
July 26, 2026 14:17
273f166 to
fc37928
Compare
saneruby
marked this pull request as ready for review
July 26, 2026 14:24
Owner
|
Thank you — this is excellent work. Reviewed and merging with all commits preserved. |
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
This PR closes the repository-owned defects confirmed by a full CLI/MCP audit:
deliveryandfeesort aliases with typed invalid-sort errorsstructuredContentand a short summary incontent, with an explicit legacy duplication opt-inThe implementation is split into nine logical, English-only commits. Tests and live fixtures are not tied to Georgia, a named venue, a named item, store hours, or a particular time of day.
Audit acceptance coverage
deliveryandfeework as advertised sort aliases; invalid values return the allowed set.purchasable_balancesemantics, including zero and null, are documented and tested.WOLT_DELIVERY_MODE_UNAVAILABLEresult lists valid alternatives.Safety and compatibility
Catalog and availability checks fail closed when upstream state cannot be verified. Any present non-null
disabled_infodisables an item, including unfamiliar payload shapes. Current option definitions win equal-quality merges, while richer fallback data is retained when current data is incomplete.The live smoke test discovers a currently usable venue/category/item dynamically, adds exactly one unit that was absent from the basket, validates checkout behavior, removes only that unit, and verifies restoration. It never calls
cart clear.Content-only MCP clients can explicitly request the legacy full JSON duplicate with
_meta["wolt/duplicate_content"] = true; the default keeps the full typed payload only instructuredContent.Validation
Validated on exact commit
fc3792819481086d090d0e92d2b6ea3899e9f7c8:go build ./...go vet ./...go test -count=1 ./...go test -race -count=1 ./...go test -race -count=10 ./internal/cli ./internal/config ./internal/mcpserver ./scripts/mcp-checkout-smoke ./scripts/mcp-venue-smokegolangci-lint v2.4.0 run— 0 issuesbash -n, ShellCheck 0.9.0, workflow YAML parsing, andgit diff --checkscripts/build-local.ps1; both binaries reportv2.2.1-10-gfc37928-localThe race detector initially exposed a real cancellation race between Gorilla WebSocket deadline mutation and an in-flight JSON write. Cancellation now uses
Conn.Close, which Gorilla permits concurrently with reads and writes; focused repeated tests and the full race suite pass.Known boundaries
Wolt venue hours, items, dynamic catalog payloads, and delivery modes are live upstream data, so regression tests discover fixtures dynamically and deterministic contract tests use upstream-shaped data. Cross-process atomicity against a simultaneous write from another application cannot be guaranteed without an upstream basket revision or conditional-write API; operations are serialized within this process and preserve unrelated baskets.
Windows validation required MinGW-w64 for Go's native race detector and an ASCII temporary drive mapping for golangci-lint because the local checkout path contains non-ASCII characters. These are local environment workarounds and are not included in this PR.