Add cache-header audit design spec for ts dev audit headers - #930
Add cache-header audit design spec for ts dev audit headers#930vasujain00 wants to merge 3 commits into
Conversation
aram356
left a comment
There was a problem hiding this comment.
Summary
The spec is a solid starting shape for ts dev audit headers (clear taxonomy, verdict rollup, task breakdown), but several load-bearing claims about the codebase are stale or incorrect — ts dev is already a subcommand tree, there is no CliError enum, reqwest is not a CLI dependency, and the discovery section probes edge-only /_ts/ routes against the publisher origin. Two cacheability rules also fail the strictest correct configuration, and the doc itself is what's breaking the format-docs CI check.
Details are in the inline comments (8 blocking 🔧, 5 🤔, 1 ♻️, 2 🌱, 2 ⛏). Cross-cutting items below.
Blocking
🔧 wrench
- format-docs CI failure: prettier rejects this file's tables —
cd docs && npm run format:write(line 30) - Dependency graph must be mermaid: docs use vitepress-plugin-mermaid; ASCII art won't render (line 391)
- Stale
ts devpremise:DevCommandsubcommand tree already exists on main; noServeto default to (lines 254, 289) CliErrordoesn't exist: CLI errors areCliResult<T> = Result<T, String>(line 271)reqwestis not a CLI dep + target scoping unaddressed: workspace default target iswasm32-wasip1; spec must say where deps are scoped and that audit is cross-platform, unlike the macOS-only proxy (line 323)- Discovery probes edge routes against origin:
/_ts/*paths 404 onpublisher.origin_url(line 131) - Wrong issue link: #293 text links to /issues/834 (line 7)
- HTML/RTB rules fail
no-storealone: RFC 9111's strongest posture would FAIL the audit (lines 75, 106)
Non-blocking
📌 out of scope
- Plan document and epic breakdown still pending: issue #835 asks for a spec and a plan under
docs/superpowers/plans/plus a task breakdown in epic #834; this PR delivers the spec only (Section 10 is a partial plan). Also, the PR body retains the unfilled template (empty Summary/Changes tables, danglingCloses #).
CI Status
- format-docs: FAIL (caused by this file)
- All other checks (fmt, clippy targets, Rust/JS tests, integration, parity, CodeQL): PASS
Technical spec for epic IABTechLab#834: origin cache-header audit with per-content-type cacheability diagnostics. Covers content-type taxonomy, cacheability rules for all five directives (Cache-Control, Surrogate-Control, Surrogate-Key, Vary, ETag), per-type verdict rollup, CLI integration into the ts dev group, and a 7-task implementation breakdown. Closes IABTechLab#835
Resolves all 8 blocking 🔧 items from @aram356's review: 1. format-docs CI: ran prettier (tables now padded correctly) 2. Dependency graph: replaced ASCII art with mermaid flowchart 3. Stale ts dev premise: rewrote §8.1 to add Audit variant to existing DevCommand enum (no Serve default, no DevArgs invention) 4. CliError: corrected §8.2 to use existing CliResult<T>/cli_error() pattern 5. reqwest scoping: added §8.3 explaining cfg(not(wasm32)) dep scoping and cross-platform requirement for audit (unlike macOS-only proxy) 6. Discovery probes: rewrote §5 to HTML-parse origin root page instead of probing edge-only /_ts/ routes against origin 7. Issue link: fixed [IABTechLab#293] to link to IABTechLab/issues/293 (was linking IABTechLab/issues/834) 8. HTML/RTB no-store rules: no-store alone now passes per RFC 9111 §5.2.2.5 Non-blocking items also addressed: - Verdict: changed to unit enum (messages on HeaderVerdict) - Author: corrected @Vasujai to @vasujain00 - s-maxage: added to audited headers with explanation - Vary: now evaluated on all cacheable groups (not just HTML) - application/woff*: removed (redundant with font/*) - Content-Type param stripping: documented in §3 - Module path: corrected to commands/dev/audit/headers/
cf69725 to
e268913
Compare
|
@vasujain00 Thank you for addressing Please implement it per spec. You can use this pr for the implementation as well. |
Technical spec for epic #834: origin cache-header audit with per-content-type cacheability diagnostics. Covers content-type taxonomy, cacheability rules for all five directives (Cache-Control, Surrogate-Control, Surrogate-Key, Vary, ETag), per-type verdict rollup, CLI integration into the ts dev group, and a 7-task implementation breakdown.
Closes #835
Summary
Changes
Closes
Closes #
Test plan
cargo test-fastly && cargo test-axumcargo clippy-fastly && cargo clippy-axumcargo fmt --all -- --checkcd crates/trusted-server-js/lib && npx vitest runcd crates/trusted-server-js/lib && npm run formatcd docs && npm run formatcargo build --package trusted-server-adapter-fastly --release --target wasm32-wasip1fastly compute serveChecklist
unwrap()in production code — useexpect("should ...")tracingmacros (notprintln!)