Skip to content

Expose bounded raw Factory ingress to opt-in receiver v2 - #39

Draft
flujo-app wants to merge 7 commits into
codex/openai-stream-usagefrom
codex/communityai-raw-ingress-proof
Draft

flujo-app wants to merge 7 commits into
codex/openai-stream-usagefrom
codex/communityai-raw-ingress-proof

Conversation

@flujo-app

@flujo-app flujo-app commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner

The v1 Factory admission callback sees only a Pydantic-normalized request, so the host cannot compare the real Flow SDK body's 299 raw bytes with what CommunityAI received. This stacked draft adds an opt-in v2 receiver profile that gives the host bounded, receiver-observed ASGI body bytes and SHA-256, method and route, selected headers, and an independent normalized-body digest. It requires a host-issued transport capability and an explicit v2 admission bound to that observation before HTTP bearer authentication. The v1 path remains available.

An outer ASGI gate limits every v2 POST to 32,768 body bytes before FastAPI parses JSON, rejects a declared excess without reading a body frame, stops at the first excess chunk, and replays accepted bytes exactly. Route validation accepts a canonical direct path or a canonical path under an ASCII mount root, and requires the exact raw_path bytes; an absent or encoded raw path is denied before host callbacks. The observation continues to report the application route /v1/chat/completions. Offline tests retain a held dispatch claim; this PR does not enable physical send or deployment.

This is a receiver observation seam, not an authenticated Original or receiver receipt. ASGI headers are post-proxy observations, not the independently captured ten SDK-final headers. A host still needs to authenticate the Original issuer, sender and credential generation; verify transport channel plus deployed receiver identity, build and generation; compare sender and receiver projections under an explicit proxy policy; and supply fresh authority, a durable one-attempt claim, and a separately authenticated post-POST receipt. The edge must globally limit ASGI frame/request size and duration because one oversized frame can exist transiently before the in-app gate rejects it. FACTORY's separate held v3 candidate commits the same 307-byte Python-normalized body; its pre-POST projection and synthetic post-POST receipt shape do not establish the authenticated join.

At exact head e8f8528, hosted Black/isort and Ubuntu/macOS run-tests passed. A direct ASGI harness also passed direct and mounted requests and denied missing raw_path; Python compilation and diff checks passed. Linux and Windows package jobs failed only at Build and smoke unsigned public-alpha bundle because the inherited signed model catalog has expired; prior runtime, protocol, and installed-desktop self-test steps passed. The previous head passed 47 focused tests locally. No issuer, deployed receiver, provider, or network qualification is claimed.

@flujo-app flujo-app changed the title Capture bounded ASGI ingress for held Factory v2 admission Expose bounded raw Factory ingress to opt-in receiver v2 Oct 4, 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.

1 participant