Skip to content

Replace body-cap source checks with tests through both request boundaries - #23

Draft
adewale wants to merge 4 commits into
mainfrom
claude/test-audit-campaign
Draft

adewale wants to merge 4 commits into
mainfrom
claude/test-audit-campaign

Conversation

@adewale

@adewale adewale commented Oct 3, 2026 •

Copy link
Copy Markdown
Owner

Replace the source-text body-cap check with tests through the real request boundaries. Every cached-GET-miss, uncacheable-GET and POST call from Default.fetch must pass MAX_SUBMITTED_BODY_BYTES; worker_asgi_bridge.fetch must forward it and reject an oversize request before the app runs.

The old assertion searched for a substring that occurred at three call sites, so losing one cap stayed green. Its bridge checks also pinned local spelling rather than request behavior. Keep the existing fake runtime harness and add no production logic or dependencies.

Current verification — 2026-11-01

  • Full Python suite: 255 tests passed.
  • Fault control: remove only the cached-GET cap. Main's old versions of both test files pass; this PR fails at test_every_bridge_call_caps_the_request_body_at_the_submit_limit. Every changed file was restored afterwards.
  • Each call-site subtest checks the selected cache branch and call count, preventing the previous call's kwargs from satisfying the next case.

This replaces the contradictory earlier description that called the tests unexecuted while also reporting executed controls. The earlier session's permission rejection is historical, not a current validation result.

No production or rendered-output changes. This PR does not retire unrelated migration/documentation tests or assert that every body-limit scenario is covered. The complete browser/build/example-verification pipeline was not rerun in this follow-up. Final-head CI remains the merge check.

claude added 2 commits October 3, 2026 01:34
The bridge-side cap is already exercised behaviourally by
test_process_request_rejects_oversize_body_before_running_app. The only
contract unique to the source-text test was that main.py hands the cap to
the bridge; the grep passed as long as any one of the three asgi.fetch call
sites still had it. Drive all three (cached GET miss, uncacheable GET, POST)
through Default.fetch and assert each passes max_body_bytes=100_000, the
limit the user-facing "over 100 kB" message promises.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019boFsNWgtPe2zZQxPFRRWp
…y bridge.fetch

Review follow-ups: compare against MAX_SUBMITTED_BODY_BYTES rather than a
literal (the contract is that the two caps agree), check the call count per
subtest so a skipped call site cannot reuse the previous call's kwargs, and
cover worker_asgi_bridge.fetch forwarding max_body_bytes to process_request,
which no test (old or new) exercised.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019boFsNWgtPe2zZQxPFRRWp
Clean merge: #19 touched figures, theme tokens and figure-content
checks; this branch only touches the request-body-cap tests. Generated
files were rebuilt with make build and check-social-cards; nothing
drifted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012eisRQmQvg4TphwztxhQGJ
@adewale adewale changed the title Test audit: test the request-body cap through Default.fetch and bridge.fetch, not source text Replace body-cap source checks with tests through both request boundaries Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants