Skip to content

Verify content rewriting pipeline is platform-agnostic (PR 8)#600

Open
prk-Jr wants to merge 8 commits intofeature/edgezero-pr7-geo-client-infofrom
feature/edgezero-pr8-content-rewriting
Open

Verify content rewriting pipeline is platform-agnostic (PR 8)#600
prk-Jr wants to merge 8 commits intofeature/edgezero-pr7-geo-client-infofrom
feature/edgezero-pr8-content-rewriting

Conversation

@prk-Jr
Copy link
Copy Markdown
Collaborator

@prk-Jr prk-Jr commented Mar 31, 2026

Summary

  • Verifies that the content rewriting pipeline (html_processor, streaming_processor, streaming_replacer, rsc_flight) has zero Fastly imports and requires no PlatformContentRewriter trait — future adapters (PR 16/17) need not implement any content-rewriting interface.
  • Documents this outcome in platform/mod.rs, html_processor.rs, and streaming_processor.rs so it is discoverable for Cloudflare, Axum, and Spin adapter authors.
  • The publisher.rs handler layer uses fastly::Body/Request/Response at its function boundaries, but this is an HTTP-type coupling addressed in Phase 2 (PR 11), not a content-rewriting concern.

Changes

File Change
crates/trusted-server-core/src/platform/mod.rs Add "Platform-Agnostic Components" section documenting no PlatformContentRewriter trait is needed
crates/trusted-server-core/src/html_processor.rs Add # Platform notes section confirming zero Fastly imports
crates/trusted-server-core/src/streaming_processor.rs Add # Platform notes section confirming StreamingPipeline::process is generic over R: Read + W: Write
crates/trusted-server-adapter-fastly/src/platform.rs Fix unresolved intra-doc link (EdgeRequestedgezero_core::http::Request) caught by cargo doc
docs/superpowers/plans/2026-03-31-pr8-content-rewriting-verification.md Add implementation plan for this PR

Closes

Closes #489

Test plan

  • cargo test --workspace
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • cargo fmt --all -- --check
  • JS tests: cd crates/js/lib && npx vitest run
  • JS format: cd crates/js/lib && npm run format
  • Docs format: cd docs && npm run format
  • WASM build: cargo build --package trusted-server-adapter-fastly --release --target wasm32-wasip1
  • Manual testing via fastly compute serve

Checklist

  • Changes follow CLAUDE.md conventions
  • No unwrap() in production code — use expect("should ...")
  • Uses tracing macros (not println!)
  • New code has tests
  • No secrets or credentials committed

@prk-Jr prk-Jr self-assigned this Mar 31, 2026
@prk-Jr prk-Jr changed the base branch from feature/streaming-pipeline-phase3 to feature/edgezero-pr7-geo-client-info March 31, 2026 12:21
@prk-Jr prk-Jr changed the title Verify content rewriting pipeline is platform-agnostic Verify content rewriting pipeline is platform-agnostic (PR *) Mar 31, 2026
@prk-Jr prk-Jr changed the title Verify content rewriting pipeline is platform-agnostic (PR *) Verify content rewriting pipeline is platform-agnostic (PR 8) Mar 31, 2026
@prk-Jr prk-Jr linked an issue Mar 31, 2026 that may be closed by this pull request
Copy link
Copy Markdown
Collaborator

@aram356 aram356 left a comment

Choose a reason for hiding this comment

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

Summary

Documentation-only PR (plus one intra-doc link fix) that verifies the content rewriting pipeline is platform-agnostic. Core claims are accurate — html_processor, streaming_processor, streaming_replacer, and rsc_flight have zero fastly imports. Good separation of concerns that saves future adapter authors from implementing unnecessary abstractions.

Non-blocking

🤔 thinking

  • Broken intra-doc link syntax in html_processor.rs:12`impl `[`StreamProcessor`] has an awkward space between backtick-wrapped impl and the link. Consider `impl` [`StreamProcessor`] or plain `impl StreamProcessor`.
  • Missing blank line before use in html_processor.rs:17-18 — The original file had a blank line between the doc block and imports. Lost in the edit; inconsistent with streaming_processor.rs which has the blank line.

♻️ refactor

  • publisher.rs caveat in platform/mod.rs:31-37 — The handler-coupling detail feels like it belongs in publisher.rs itself rather than the platform module doc. Consider moving it there and keeping platform/mod.rs focused on what adapters need to know.

🌱 seedling

  • PR number references in doc comments may age poorly — "PR 8", "PR 11", "PR 16/17" will be opaque without EdgeZero migration context. Consider more descriptive labels (e.g., "the HTTP-type migration" instead of "PR 11").

⛏ nitpick

  • StreamingPipeline::process<R: Read, W: Write> in platform/mod.rs:27 — Angle brackets are plain text, not a link or code. Should be wrapped in backticks or use an intra-doc link.

👍 praise

  • Good call not introducing a PlatformContentRewriter trait — the pipeline is already generic.
  • Nice catch fixing the unresolved EdgeRequest doc link.

CI Status

  • integration tests: PASS
  • browser integration tests: PASS
  • prepare integration artifacts: PASS

- Fix intra-doc link syntax and restore missing blank line in `html_processor`
- Replace opaque PR number references with descriptive context labels
- Move HTTP-type coupling caveat from `platform` module down to `publisher.rs`
- Convert `StreamingPipeline::process` plain-text generics to an intra-doc link
Copy link
Copy Markdown
Collaborator

@aram356 aram356 left a comment

Choose a reason for hiding this comment

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

Summary

Documentation-only PR that verifies the content rewriting pipeline is platform-agnostic and documents this for future adapter authors. The doc comments are well-structured and the separation of concerns (platform-agnostic pipeline vs platform-coupled handler layer) is correctly captured.

Blocking

🔧 wrench

  • Unresolved intra-doc link: StreamingPipeline::process in platform/mod.rs:26 does not resolve — StreamingPipeline is not in scope from the platform module. This is a new cargo doc warning not present on the base branch. Needs the full path.

  • Inconsistent PR number references: streaming_processor.rs still uses opaque "PR 8" (line 11) and "PR 16/17" (line 17) while html_processor.rs and platform/mod.rs were updated to descriptive labels in commit 2333227. This file was missed.

Non-blocking

🤔 thinking

  • 350-line plan document: docs/superpowers/plans/2026-03-31-pr8-content-rewriting-verification.md is an agentic implementation plan with task checkboxes and bash commands — 350 lines of process artifact for ~55 lines of doc comment changes. It also still contains opaque "PR 8"/"PR 11"/"PR 16/17" references. Is this pattern intended to be kept long-term, or should plans be cleaned up after the PR ships?

CI Status

  • integration tests: PASS
  • browser integration tests: PASS
  • prepare integration artifacts: PASS

@prk-Jr prk-Jr requested a review from aram356 April 10, 2026 08:46
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.

Content rewriting trait (or verification)

3 participants