Skip to content

feat(D147): oversized files reach a URL route; pass 413 from the spend lease - #550

Merged
fazpu merged 2 commits into
mainfrom
feat/url-route-no-size-refusal
Nov 7, 2026
Merged

fazpu merged 2 commits into
mainfrom
feat/url-route-no-size-refusal

Conversation

@fazpu

@fazpu fazpu commented Nov 7, 2026

Copy link
Copy Markdown
Member

Two changes: an owner decision (2026-11-07) and a team-lead request.

1. No size refusal or card when the file reaches the converter by URL. The reading limits (100 MB for office and PDF, 200 MB for spreadsheets; D138/D139) guard this process, which would otherwise read the file. When the routed converter is a UrlConverter (#545) and the raw store presigns, the engine reads nothing, so:

  • an oversized PDF is no longer refused (PDF exceeds the pre-OCR reading limit); it goes to the URL route;
  • an oversized non-PDF is no longer carded; it goes to the URL route.

On the in-process bytes path (the self-host default), the limits stay exactly as before as the engine's resource guard. A converter's own declared provider_limit_bytes still applies. An oversized file with no route is still carded (non-PDF) or refused (PDF), as before. Bounded reads are already in place: #548 cards without reading, and the URL path never reads.

2. Spend lease 413. ControlPlaneSpendLease now passes a control-plane 413 through as SpendLeaseRefused, next to 401/403/423. The middleware then answers 413 instead of 503 spend_lease_unavailable when the control plane refuses an over-size hold.

Tests

  • Integration (CI): with a patched 10-byte limit, an oversized Markdown file and an oversized PDF are both converted by a URL route, with zero read_bytes calls.
  • Unit: test_adapter_passes_an_oversize_refusal_through.
  • Existing card and limit tests on the bytes path are unchanged.

Checks: ruff, pyright (0), unit lane (3153 passed). DB tests run in CI.

🤖 Generated with Claude Code

https://claude.ai/code/session_01F9cMsQBqiW2qU2ow4zeNCm

fazpu and others added 2 commits November 7, 2026 13:19
…d lease

- Owner decision 2026-11-07: the 100/200 MB reading limits guard this
  process, which would read the file, so they apply only on the bytes path.
  A file over its limit whose route fetches it by URL from a presigning
  store goes to that route instead of being refused (PDF) or carded.
- ControlPlaneSpendLease passes a control-plane 413 through as
  SpendLeaseRefused, so an over-size hold answers 413, not
  503 spend_lease_unavailable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F9cMsQBqiW2qU2ow4zeNCm
…stated

Codex round 1 minor: D147, the format conversion design and the file-types
guide now say the reading limits guard the engine process and do not apply
when the route fetches the file by URL.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F9cMsQBqiW2qU2ow4zeNCm
@fazpu

fazpu commented Nov 7, 2026

Copy link
Copy Markdown
Member Author

Codex review (gpt-6.1-sol, max effort)

VERDICT: APPROVE

  • Minor — decisions.md:7420: The new URL exception follows wording that still says oversized non-PDFs are always carded. Binding format docs and the file-types guide retain that blanket rule. Simplest fix: qualify the existing wording as bytes-path-only and state the URL exception.

No blocker or major findings. Routing and guard ordering, oversized ingest routability, PDF provider limits, parking, unread card fallback, and representation replay satisfy the owner decision. No processing-version or reuse-key bumps occur. CP 413 passes through the adapter and middleware unchanged, before ingest runs.

Validation: 166 passed, 3 skipped; 25 direct conversion cases and an adapter-to-HTTP 413 check passed. Database integration tests remain pending in CI. No containers started; worktree unchanged.

Disposition (Claude)

The minor is accepted and fixed in f4cd315. D147, the format conversion design §(over the reading limit) and the file-types guide now say the reading limits guard the engine process, apply on the bytes path only, and that a file whose route fetches it by URL goes to that route.

@fazpu
fazpu merged commit 38fa769 into main Nov 7, 2026
21 checks passed
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.

1 participant