Some checks failed
wai-quantum energy-landscape jobs / does this change touch it (push) Successful in 12s
WAI breaking changes and the conformance runner / WAI breaking · does this change touch WAI (push) Successful in 22s
wai-audit collector and player integration / does this change touch it (push) Successful in 19s
wai-fleet service / does this change touch it (push) Successful in 21s
joule-moq-web browser client / joule-moq-web · does this change touch it (push) Successful in 23s
joule-moq-remote host agent / joule-moq-remote · does this change touch it (push) Successful in 33s
wai-sink-swift native sink package / does this change touch it (push) Successful in 23s
WAI Studio / does this change touch it (push) Successful in 18s
wai-sink-android native sink library / does this change touch it (push) Successful in 47s
wai-quantum for JavaScript / does this change touch it (push) Successful in 1m0s
wai-app and Create / wai-app · does this change touch it (push) Successful in 1m2s
wai-key-proxy / does this change touch it (push) Successful in 1m2s
WAI operation catalogue / does this change touch it (push) Successful in 1m3s
joule-moq-room room service / joule-moq-room · does this change touch it (push) Successful in 1m9s
wai-ledger service / does this change touch it (push) Successful in 1m2s
wai-quantum studio and desktop / does this change touch it (push) Successful in 1m2s
wai-fleet service / service · macos (push) Successful in 55s
wai-app and Create / wai-app · tests, clippy, the line language's verifier (linux) (push) Successful in 51s
joule-moq-remote host agent / joule-moq-remote, every target (macos) (push) Successful in 1m25s
wai-audit collector and player integration / collector, player integration and the browser end to end · macos (push) Successful in 1m35s
WAI breaking changes and the conformance runner / WAI breaking · wire, record and API against main · linux (push) Successful in 1m48s
wai-key-proxy / proxy · linux (push) Successful in 1m41s
WAI Studio / the catalogue's actions, the unit tests and the core · linux (push) Successful in 2m0s
wai-ledger service / service · macos (push) Successful in 56s
wai-fleet service / service · linux (push) Successful in 2m32s
wai-ledger service / service · linux (push) Successful in 2m13s
wai-audit collector and player integration / collector · linux (push) Successful in 2m57s
wai-quantum for JavaScript / javascript · linux (push) Successful in 4m8s
joule-moq-remote host agent / joule-moq-remote, every target (linux-arm64) (push) Has been cancelled
joule-moq-room room service / joule-moq-room, every target (push) Has been cancelled
repository checks / lockfiles, advisories, tests in CI, workflow hygiene, spec and section references, public text (push) Has been cancelled
joule-moq-web browser client / joule-moq-web · browser end-to-end (macos) (push) Has been cancelled
wai-app and Create / wai-app · Create, browser end-to-end (macos) (push) Has been cancelled
wai-quantum energy-landscape jobs / the same bits · linux-arm64 (push) Has been cancelled
wai-quantum energy-landscape jobs / the same bits · macos (push) Has been cancelled
wai-quantum studio and desktop / studio · browser (push) Has been cancelled
wai-sink-android native sink library / the JNI layer and the platform-free half on the host JVM · linux-arm64 (push) Has been cancelled
WAI breaking changes and the conformance runner / WAI breaking and conform · their tests, and the independent verifiers through wai conform · linux (push) Successful in 5m13s
wai-quantum studio and desktop / desktop app · macos (push) Has been cancelled
wai-sink-android native sink library / every ABI, the AAR, and the instrumented tests in a headless emulator · macos (push) Has been cancelled
wai-quantum energy-landscape jobs / the module under wasm32-wasip2 (wasmtime) (push) Has been cancelled
wai-sink-swift native sink package / libwai slices, desktop tests, simulator tests · macos (push) Has been cancelled
wai-quantum energy-landscape jobs / native against WebAssembly, over many seeds (push) Has been cancelled
wai-quantum studio and desktop / desktop app · windows (push) Has been cancelled
WAI Studio / Studio in Chromium and Firefox · macos (push) Has been cancelled
WAI operation catalogue / the catalogue and every door · linux (push) Has been cancelled
WAI Studio / Studio in WebKit · linux (push) Has been cancelled
wai-quantum studio and desktop / desktop app · linux (push) Has been cancelled
wai-quantum energy-landscape jobs / reader, kernels, answers and the stated result · linux, release (push) Has been cancelled
extensions/audience-decision.md registers two route-record documents, each signed in its canonical form under its own domain. `wai.video.audience` (`wai-audience-decision`): a decider's signed decision of whether the sessions in one region may be shown a programme over a span, under the blackouts in force. Each blackout is named by the id a session class carries (http-delivery Appendix H `blackouts`) and lists its regions in rung-price §2's region codes, with the programme shown in its place. A session aggregates its own location before it leaves the session: to the one listed code that holds it, to outside, or to unresolved (no location, or a country of which only subdivisions are listed); the aggregation decides exactly what the location would. A decision whose evidence holds anything else (coordinates, a postal code, a session's identifier) or a region finer than the aggregation gives is refused `audience_location_not_aggregated`; one whose region the blackouts neither list nor hold, `audience_region_not_in_set`. The blackouts applied (every one, unresolved), the verdict (show, withhold, or alternate when all that apply name one programme) and that programme are recomputed; a session class of the programme carries the applied set as its `blackouts` and the region's country as its `geo`, and a verifier given both states the class's hash. `wai.delivery.territory` (`wai-territory`): a publisher's signed statement of where its content may be shown (everywhere, only in some regions, everywhere but some). Its latest statement stands alone; a lapsed or contradicted latest revives none. The territory (within, outside, undetermined, or unstated with its reason) is reported beside a server key's placement, which cache-authority §4.4 computes from its own inputs and no statement changes; a statement that names servers, nodes, origins, roles or may_sign is refused `territory_scopes_serving`. cache-authority §4.3 and §4.4 are unchanged; §4.4 gains a paragraph saying so. The reference is the `audience_decision` module of wai-rs (feature `audience_decision`); the corpus is live-conformance/audience/ (13 aggregations, 67 decisions, 17 classes, 39 statements, 32 territories, 10 placements), and audience_decision_verify.py is its second implementation: 178 cases agree, 21 of 21 mutated copies fail and 34 of 34 weakened verifiers are caught. Twelve faults planted in the reference each fail its tests: the evidence's extra-member check and its finer-region check, rule 6 (a region not the blackouts'), the serving-member check and `may_sign` among its members, a placement refused beside an outside territory, a decision's and a statement's signature verified without the domain, over the text as written and under the other record's domain, an unresolved session read as outside, and a lapsed statement letting an earlier one stand. Co-Authored-By: Claude Opus 5.5 <[email protected]>
52 lines
2.4 KiB
Rust
52 lines
2.4 KiB
Rust
//! `wai.video.audience` and `wai.delivery.territory` (extensions/audience-decision.md): the
|
|
//! committed corpus `live-conformance/audience/` regenerates byte for byte from its fixed seeds,
|
|
//! holds no other file, every case in it gets the outcome it states, and §7 lists exactly the
|
|
//! reasons the reference reports.
|
|
#![cfg(feature = "audience_decision")]
|
|
|
|
use std::collections::BTreeMap;
|
|
use std::path::PathBuf;
|
|
use wai::audience_decision::{corpus, CODES};
|
|
|
|
fn wai_dir() -> PathBuf {
|
|
PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("..")
|
|
}
|
|
|
|
fn committed() -> BTreeMap<String, String> {
|
|
let dir = wai_dir().join("live-conformance/audience");
|
|
std::fs::read_dir(&dir)
|
|
.expect("the committed corpus")
|
|
.flatten()
|
|
.map(|e| (e.file_name().to_string_lossy().into_owned(), e.path()))
|
|
.filter(|(n, _)| n != "README.md")
|
|
.map(|(n, p)| (n, std::fs::read_to_string(p).expect("a text file")))
|
|
.collect()
|
|
}
|
|
|
|
#[test]
|
|
fn the_committed_corpus_regenerates_from_its_seeds() {
|
|
let files = committed();
|
|
let generated: BTreeMap<String, String> = corpus::generate().into_iter().collect();
|
|
let extra: Vec<&String> = files.keys().filter(|k| !generated.contains_key(*k)).collect();
|
|
let missing: Vec<&String> = generated.keys().filter(|k| !files.contains_key(*k)).collect();
|
|
let differ: Vec<&String> = generated.iter().filter(|(k, v)| files.get(*k).is_some_and(|f| f != *v)).map(|(k, _)| k).collect();
|
|
assert!(extra.is_empty() && missing.is_empty() && differ.is_empty(), "extra {extra:?}, missing {missing:?}, differ {differ:?}: run `wai_audience_decision_vectors gen`");
|
|
}
|
|
|
|
#[test]
|
|
fn every_case_gets_its_stated_outcome() {
|
|
let fails = corpus::verify(&committed());
|
|
assert!(fails.is_empty(), "{}", fails.join("\n"));
|
|
}
|
|
|
|
/// §7 of the extension lists exactly the codes `CODES` has, each once, in order.
|
|
#[test]
|
|
fn the_extension_lists_the_reasons() {
|
|
let text = std::fs::read_to_string(wai_dir().join("extensions/audience-decision.md")).expect("the extension");
|
|
let at = text.find("\n## 7. Reasons").expect("a §7");
|
|
let end = text[at + 1..].find("\n## ").map_or(text.len(), |e| at + 1 + e);
|
|
let listed: Vec<String> =
|
|
text[at..end].lines().filter(|l| l.starts_with("| `")).filter_map(|l| l.split('`').nth(1).map(String::from)).collect();
|
|
let want: Vec<String> = CODES.iter().map(|c| c.to_string()).collect();
|
|
assert_eq!(listed, want, "§7's table and CODES differ");
|
|
}
|