Skip to content

feat: bound HTTP/1.1 semantics to authenticated streams - #11

Draft
seonghobae wants to merge 361 commits into
mainfrom
feat/http11-semantics
Draft

feat: bound HTTP/1.1 semantics to authenticated streams#11
seonghobae wants to merge 361 commits into
mainfrom
feat/http11-semantics

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Buyer-visible problem

OriginWeave still needs one bounded HTTP/1.1 exchange over an already authenticated AuthenticatedTlsConnection. This branch contains the extensive implementation and fail-first history for issue #9, but it is no longer integration-ready against current protected main.

Intended product boundary

  • one HTTP/1.1 GET or HEAD exchange over the existing governed TLS stream;
  • strict RFC 9110/9112 framing and no automatic redirect follow;
  • bounded status/header/body/chunk/trailer/interim/decode/deadline resources;
  • bounded gzip/deflate;
  • RFC 9530 digest evidence;
  • conservative MIME/no-sniff/disposition metadata;
  • credential-free immutable evidence;
  • no DNS, reconnect, ambient proxy/PAC, Chromium control, cookies, file persistence, or model call.

The design and implementation history remain in:

  • docs/superpowers/specs/2026-08-07-http11-semantics-design.md
  • docs/superpowers/plans/2026-08-07-http11-semantics.md

Current integration state

Current contributor head: 293ab063e13b1bf23f622935c3e01886cf06dbff.
Current protected main: 076da4296a13d11c70cce8f99163ebcd10ad2daf.

This PR is Draft and not mergeable because it is based on historical main and has diverged substantially while destination/proxy, sensitive-data, resource, TLS-horizon, extension-authority, review-governance, and hourly-automation work integrated on protected main. Historical exact-head successes on predecessor heads remain useful regression evidence but do not qualify the current branch or current live base.

The next integration action is a non-destructive reconstruction/reconciliation onto the exact current protected main, preserving all unique HTTP implementation/tests/doctoring while adopting current workspace, coverage, governance, and adjacent authority contracts. No predecessor check, approval, mergeability result, or synthetic merge evidence transfers after that head changes.

Governance

Merge eligibility follows current protected-main docs/quality-gates.md: exact-head CI/security/coverage/rustdoc, resolved current findings, live-base/writer-lease checks, branch protection, and any operationally required review authority. No self/synthesized approval or technical-gate weakening is permitted.

Closes #9 only after the reconciled exact head satisfies the complete issue acceptance boundary.

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

인증된 TLS 연결에서 단일 HTTP/1.1 GET/HEAD 교환을 수행하는 originweave-http 크레이트를 추가했습니다. 요청·응답 검증, 자원 예산, 콘텐츠 디코딩, digest·MIME·redirect 메타데이터, 불변 증거, typed error, 통합 테스트 및 reason phrase 진단 보존을 포함합니다.

Changes

HTTP/1.1 의미론

Layer / File(s) Summary
정책 및 요청 계약
Cargo.toml, crates/originweave-http/Cargo.toml, crates/originweave-http/src/{error,policy,field,target,request,lib}.rs, crates/originweave-http/tests/{policy,request}_contract.rs
워크스페이스 등록, 의존성, 정책 제한, typed error, 요청 필드, origin-bound target 및 결정적 GET/HEAD 요청 직렬화를 추가했습니다.
응답 파싱 및 콘텐츠 검증
crates/originweave-http/src/{response_head,framing,chunked,content,integrity,mime,disposition}.rs, crates/originweave-http/src/tests/*
엄격한 응답 헤드·프레이밍·chunked body 파서와 bounded decoding, digest 검증, MIME 분류, 안전한 disposition·redirect 메타데이터를 추가했습니다.
TLS 교환 및 증거
crates/originweave-http/src/{exchange,evidence}.rs, crates/originweave-http/tests/*integration.rs
인증된 TLS 연결의 peer·ALPN·origin을 검증하고, deadline 기반 I/O와 응답 검증을 수행한 뒤 본문, 원시 reason phrase 및 불변 증거를 반환합니다.
통합 검증 및 저장소 계약
crates/originweave-http/tests/*, tests/test_http_governance.py, tests/test_repository_contract.py
계약, loopback TLS, 오류 회귀, 금지 API, 의존성, 문서 및 모듈 경계를 검증합니다.
설계 문서 및 커버리지 진단
docs/adr/*, docs/doctoring*, docs/superpowers/*, scripts/ci/verify_coverage.py, tests/test_verify_coverage.py
HTTP/1.1 범위, chunked 메시지 경계, reason phrase 처리 및 표준 근거를 문서화하고 LLVM coverage 진단에 파일·region·segment·expansion 위치를 포함합니다.

Estimated code review effort: 5 (Critical) | ~120 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Caller
  participant HttpExchangePlan
  participant AuthenticatedTlsConnection
  participant ResponseParser
  participant ContentDecoder
  participant Evidence
  Caller->>HttpExchangePlan: 요청 및 정책으로 계획 생성
  HttpExchangePlan->>AuthenticatedTlsConnection: peer·origin·ALPN 검증
  HttpExchangePlan->>AuthenticatedTlsConnection: HTTP/1.1 요청 쓰기
  AuthenticatedTlsConnection->>ResponseParser: 응답 헤드와 본문 전달
  ResponseParser->>ContentDecoder: framing된 본문 디코딩
  ContentDecoder->>Evidence: 콘텐츠·digest·MIME 결과 기록
  Evidence-->>Caller: AuthenticatedHttpResponse 반환
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 79.92% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Linked Issues check ❓ Inconclusive 주요 요구사항은 구현되었지만 Cargo.lock은 필터링되었고, 실제 100% 커버리지와 권한 흐름 다이어그램은 검증할 수 없습니다. Cargo.lock을 포함한 의존성 검토와 실제 커버리지 결과 및 Mermaid 권한 흐름 다이어그램을 확인하십시오.
✅ Passed checks (3 passed)
Check name Status Explanation
Out of Scope Changes check ✅ Passed 변경 사항은 bounded HTTP/1.1 교환, 테스트, 커버리지 검증 및 관련 문서라는 연결 이슈의 범위에 포함됩니다.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 인증된 스트림에 제한된 HTTP/1.1 의미론을 구현한다는 PR의 주요 변경 사항을 정확하고 간결하게 설명합니다.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/http11-semantics

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@seonghobae seonghobae left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Standards-conformance finding on exact head 9032b5f7aeaac2626be926a05ab0252f3e8ba06d: response_head::parse_status_line currently accepts HTTP/1.1 200 without the mandatory separator SP, while rejecting HTTP/1.1 200 when the reason phrase is absent. RFC 9112 §4 defines status-line = HTTP-version SP status-code SP [ reason-phrase ] and explicitly requires the server to send the separator SP even when the reason phrase is absent. Add the regression contract first (accept the empty reason phrase after the mandatory SP; reject a missing second SP), then adjust the parser. Keep strict CRLF and field parsing unchanged. Primary source: RFC 9112 §4, https://www.rfc-editor.org/rfc/rfc9112.html#section-4

Comment thread .github/workflows/repair-http-reachability.yml Fixed
Comment thread .github/workflows/repair-http-transport-flake.yml Fixed

Copy link
Copy Markdown
Contributor Author

/oc

Repair the exact-head CI failures on 112b44b1f589f0184b95d9641d2e9c456771a4f3 directly in permanent Rust source/tests; keep the PR Draft. Do not add a one-shot/self-mutating/branch-writer workflow, lower coverage thresholds, add coverage exclusions, or use #[allow(dead_code)]/coverage pragmas to hide reachable production behavior.

  1. Run cargo +1.97.1 fmt --all and commit only the canonical rustfmt changes, including the two HttpError::DigestMismatch match blocks in crates/originweave-http/tests/transport_failure_integration.rs.
  2. Use the exact coverage artifact from run 31171601796 (coverage.json and missing-lines.txt) to close the remaining production deficit with executable tests first: branches 831/846, functions 645/647, lines 6345/6365, regions 8462/8604.
  3. Add focused tests for every uncovered real path, prioritizing the two uncovered production functions and the remaining exchange/framing/content/integrity/MIME/disposition error branches. Exercise failures through the public or narrow private test boundary rather than duplicating implementation logic in tests.
  4. Preserve one authenticated TLS stream, no DNS/connect/reconnect/proxy/redirect/cookie/file-write authority, strict RFC 9110/9112 framing, bounded gzip/deflate expansion, RFC 9530 digest semantics, conservative MIME/no-sniff/disposition evidence, total monotonic deadline, credential-free provenance, and deterministic public errors.
  5. Keep tests realistic: segmented and truncated authenticated responses, conflicting or surplus framing bytes, close-notify versus transport EOF, decompression and digest failures, and bounded deadline/byte-count edges.

Run repository Python contracts, cargo +1.97.1 fmt --all --check, cargo +1.97.1 check --locked --workspace --all-features, all tests, strict Clippy, rustdoc warnings-as-errors, and exact nightly function/line/region/branch coverage at 100%. Then regenerate exact-head Security Scan and SAST evidence and run git diff --check. Keep Draft until the unchanged workflow-free head is fully green.

@seonghobae
seonghobae marked this pull request as ready for review August 9, 2026 01:41

Copy link
Copy Markdown
Contributor Author

@opencode-agent address

Exact-current-head repair request for 223513b77c675a63a26443b29d690e5ec37cc29f only. Revalidate head/base before writing and stop if the branch moved or another writer is active.

Current production defect: crates/originweave-http/src/exchange.rs still calls validate_representation_digest(..., &network.encoded_content, ...) before decode_content(...). RFC 9530 Repr-Digest covers representation data, so for Content-Encoding: gzip or zlib-wrapped deflate the digest must be checked against the decoded representation bytes. Content-Digest must remain checked against the encoded message content.

Use strict RED→GREEN TDD. First add realistic authenticated-loopback regressions that (1) accept a valid Repr-Digest computed over decoded payload bytes for gzip and deflate, and (2) reject a Repr-Digest that matches only the encoded compressed bytes. Observe the intended failure on this exact head. Then make the smallest production change: decode after successful Content-Digest validation and validate Repr-Digest against decoded.bytes, preserving no-content, partial-content, deadline, resource, MIME, and error semantics. Run the focused regressions, full Rust contracts, Clippy, rustdoc, and exact production coverage. Do not edit .github/**, AGENTS.md, CLAUDE.md, unrelated governance, dependencies, or merge the PR.

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.

[Product Gap] Bound HTTP/1.1 semantics over the authenticated TLS stream

2 participants