Add ts CLI ad-template config diagnostics and browser audit#823
Draft
prk-Jr wants to merge 33 commits into
Draft
Add ts CLI ad-template config diagnostics and browser audit#823prk-Jr wants to merge 33 commits into
prk-Jr wants to merge 33 commits into
Conversation
Replace the custom trusted-server CLI lifecycle and config payload plumbing with a thin EdgeZero delegation layer using typed config push/validate flows. Add TrustedServerAppConfig wrapper in core with deploy-time validation and move blob reconstruction into runtime helpers. Drop flattened config entry publishing and route app-config through EdgeZero blob envelope handling while keeping edgezero flag reads in trusted_server_config. Update CLI and architecture docs for the new model and adjust fastly adapter store selection.
…e/ts-cli-ad-templates # Conflicts: # Cargo.lock # crates/trusted-server-adapter-fastly/src/main.rs # crates/trusted-server-core/Cargo.toml # crates/trusted-server-core/build.rs # crates/trusted-server-core/src/publisher.rs # crates/trusted-server-integration-tests/Cargo.lock # trusted-server.toml
13 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
[creative_opportunities]) configuration: static path/slot diagnostics viats config ad-templates …, and browser-backed live verification viats audit …(local Chrome/Chromium over CDP).chromiumoxide) are excluded from thewasm32-wasip1build, and the runtime ad-stack gate is shared withpublisher.rsso the CLI cannot drift from server behavior.Changes
trusted-server-core/src/creative_opportunities.rs[creative_opportunities]config types,match_slots, and a sharedevaluate_ad_stack_gateruntime gatetrusted-server-core/src/publisher.rsshould_run_server_side_ad_stackthrough the shared gate (behavior-preserving)trusted-server-cli/src/config_ad_templates.rsts config ad-templates {lint,match,check,explain}static diagnosticstrusted-server-cli/src/app_config.rstrusted-server-cli/src/ad_templates/{expected,compare,output}.rstrusted-server-cli/src/audit/{mod,page,collector,browser,ad_templates}.rs,audit/ad_template_collector.jsts audit page+ts audit ad-templates verify: chromiumoxide collector, read-only GPT/APS/DOM init script, verifier orchestrationtrusted-server-cli/src/run.rs,src/lib.rsauditnamespaceCargo.toml,trusted-server-cli/Cargo.tomlchromiumoxide/tokio/futures/which/tempfiledeps, cfg-gated off wasmtrusted-server.example.toml[creative_opportunities]blockdocs/superpowers/{specs,plans}/2026-06-26-server-side-ad-template-cli*Closes
Not yet linked to an issue.
Test plan
cargo test --workspacecargo clippy --workspace --all-targets --all-features -- -D warningscargo fmt --all -- --checkcd crates/trusted-server-js/lib && npx vitest run(393 passed)cd crates/trusted-server-js/lib && npm run formatcd docs && npm run formatcargo build --package trusted-server-adapter-fastly --release --target wasm32-wasip1(pluscargo build -p trusted-server-cli --target wasm32-wasip1— browser deps stay out of wasm)cargo test -p trusted-server-cli --target <host-triple>(48, incl. a Chrome-gated browser fixture); manualts audit ad-templates verifyagainst a local fixture —confirmed(exit 0) and--stricton a missing slot (exit 2)How to use
Configure slots
In your (gitignored)
trusted-server.toml— fictional values shown:Static diagnostics (no browser)
Browser-backed audit (needs local Chrome/Chromium)
Shared config flags (all of the above)
Exit behavior
verifyis auditor-assist: exits0even with missing/partial evidence.--strictexits non-zero when a matched slot is missing or only partially confirmed (CI gate). A page-level navigation failure also exits non-zero.[auction].enabled = false) mark a page "skipped" so--strictdoes not fail it.Local live test (deterministic, no external site)
Many large ad publishers block headless/non-evasive browsers, so
verifyagainst them sees a challenge page, not the article (this tool does not evade bot detection). To exercise the full pipeline reliably, serve a local fixture:Checklist
unwrap()in production code — useexpect("should ...")println!/eprintln!in library code (CLI output useswriteln!; errors uselog)