From ffa1174915558091b49142d551defe8ce3c440d2 Mon Sep 17 00:00:00 2001 From: prk-Jr Date: Tue, 31 Mar 2026 17:23:03 +0530 Subject: [PATCH 1/7] Document content rewriting as platform-agnostic in platform module --- .../trusted-server-core/src/platform/mod.rs | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/crates/trusted-server-core/src/platform/mod.rs b/crates/trusted-server-core/src/platform/mod.rs index 7e26a5f9..b79510df 100644 --- a/crates/trusted-server-core/src/platform/mod.rs +++ b/crates/trusted-server-core/src/platform/mod.rs @@ -12,6 +12,30 @@ //! - [`PlatformBackend`] — dynamic backend registration //! - [`PlatformHttpClient`] — outbound HTTP client //! - [`PlatformGeo`] — geographic information lookup +//! +//! ## Platform-Agnostic Components +//! +//! The following components were evaluated for platform-specific behavior +//! (PR 8) and found to have a platform-agnostic rewriting pipeline. No +//! platform trait is required; future adapters (PR 16/17) need not provide +//! any content-rewriting implementation: +//! +//! - **Content rewriting** — `html_processor`, `streaming_processor`, +//! `streaming_replacer`, and `rsc_flight` modules use only standard Rust +//! (`std::io::Read`/`Write`, `lol_html`, `flate2`, `brotli`). The pipeline +//! is accessed via `StreamingPipeline::process` which +//! accepts any reader, including `fastly::Body` (which implements +//! `std::io::Read`). +//! +//! The `publisher.rs` handler module is platform-coupled at its handler +//! layer — it accepts and returns `fastly::Body` in function signatures +//! such as `process_response_streaming`. This is an HTTP-type coupling +//! that will be addressed in Phase 2 (PR 11) alongside all other +//! `fastly::Request`/`Response`/`Body` migrations. It is not a +//! content-rewriting concern. +//! +//! No `PlatformContentRewriter` trait exists or is needed. +//! mod error; mod http; From fbbf767950bba05234102a897d4d02c3be6dcdd7 Mon Sep 17 00:00:00 2001 From: prk-Jr Date: Tue, 31 Mar 2026 17:27:11 +0530 Subject: [PATCH 2/7] Document html_processor as platform-agnostic --- .../trusted-server-core/src/html_processor.rs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/crates/trusted-server-core/src/html_processor.rs b/crates/trusted-server-core/src/html_processor.rs index 540ab29d..259860b7 100644 --- a/crates/trusted-server-core/src/html_processor.rs +++ b/crates/trusted-server-core/src/html_processor.rs @@ -1,6 +1,20 @@ -//! Simplified HTML processor that combines URL replacement and integration injection +//! Simplified HTML processor that combines URL replacement and integration injection. //! -//! This module provides a `StreamProcessor` implementation for HTML content. +//! This module provides a [`StreamProcessor`] implementation for HTML content. +//! It handles `