CB-WP-0043: a Problem sits where its Stress lands
Some checks failed
ci / check (push) Failing after 4s
Some checks failed
ci / check (push) Failing after 4s
The picture had become a lie. A row across the middle says "these are the table's" — true under the baseline, false under H2, where three of five cards fall on particular seats. Global goes to the middle, personal beside its owner, and bond on the mean midpoint of the owner's Bond edges. A bond Problem whose owner has no Bond is drawn as personal, because that is the rule — bond_network falls back to the owner at degree 0 — and the picture must agree with the arithmetic. The baseline page is untouched: the scoped layout is taken only when a non-global scope exists, so every prior look at the baseline still holds. The scope reaches the view as a separate marker rather than a field on ProblemView, because the delta says "place owner marker on the card" — a token beside a card — and it is public while the card is face down, which a ProblemView variant could not express. The coverage probe forced a real improvement. It demanded a text token for the new fields and a POSITION is not a token — which is the probe being right: position alone is invisible to text_of and to a screen reader, and illegible when two anchors coincide. So each scoped Problem now says whose it is: everyone's, P1's alone, P2's Bond network, and "P1's alone — no Bond to share it" at degree 0. The fixture gained a third Problem. With two, one of the three placement rules was unexercised and the probe unsatisfiable — a fixture that cannot reach a branch is how a rule ships untested. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
47e7941057
commit
3174c5507a
6 changed files with 373 additions and 12 deletions
|
|
@ -108,6 +108,7 @@ mod coverage {
|
|||
"players",
|
||||
"relations",
|
||||
"problems",
|
||||
"problem_markers",
|
||||
"focus",
|
||||
"selections",
|
||||
"ground_modes",
|
||||
|
|
@ -180,6 +181,14 @@ mod coverage {
|
|||
("support_responses.*", "accepted P3\u{2019}s Support"),
|
||||
("darvo_targets.*.problem", "Problem 1"),
|
||||
("darvo_targets.*.player", "darvo target P2"),
|
||||
// CB-WP-0043: H2's owner marker. The scope is expressed as
|
||||
// POSITION, which no text probe can see — so each scoped Problem
|
||||
// also says whose it is, and that is what these match. A probe
|
||||
// that could only be satisfied by geometry would have to be
|
||||
// OMITTED, and the page would be illegible to `text_of` and to a
|
||||
// screen reader alike.
|
||||
("problem_markers.*.owner", "P1\u{2019}s alone"),
|
||||
("problem_markers.*.scope", "P2\u{2019}s Bond network"),
|
||||
("outcome.total", "total 9"),
|
||||
("outcome.threshold", "of 12"),
|
||||
("outcome.group_success", "failure"),
|
||||
|
|
@ -687,6 +696,76 @@ mod gamelog {
|
|||
}
|
||||
}
|
||||
|
||||
/// **A Problem is drawn where its Stress lands** (CB-WP-0043).
|
||||
///
|
||||
/// H2 scopes End-of-Round Stress, so a row across the middle — true
|
||||
/// under the baseline — becomes a lie: three of five cards belong to
|
||||
/// particular seats. This checks the placement rule rather than the
|
||||
/// fact that something was drawn.
|
||||
#[test]
|
||||
fn a_problem_sits_where_its_stress_lands() {
|
||||
use games_ground::edition::StressScope;
|
||||
use games_ground::view::ProblemMarker;
|
||||
|
||||
let v = crate::testfix::view(Some(PlayerId(0)));
|
||||
let svg = crate::doc::document(&v, &[], "/c", Some(PlayerId(0)), false);
|
||||
|
||||
// Each scope says whose it is — position alone is invisible to
|
||||
// `text_of` and to a screen reader.
|
||||
let text = crate::text_of(&svg);
|
||||
assert!(
|
||||
text.contains("everyone\u{2019}s"),
|
||||
"the global Problem is unlabelled: {text}"
|
||||
);
|
||||
assert!(
|
||||
text.contains("P1\u{2019}s alone"),
|
||||
"the personal Problem is unlabelled"
|
||||
);
|
||||
assert!(
|
||||
text.contains("P2\u{2019}s Bond network"),
|
||||
"the bond Problem is unlabelled"
|
||||
);
|
||||
|
||||
// And the anchors really differ: a global Problem must not be
|
||||
// drawn where a personal one is.
|
||||
let mut baseline = v.clone();
|
||||
baseline.problem_markers.clear();
|
||||
let row = crate::doc::document(&baseline, &[], "/c", Some(PlayerId(0)), false);
|
||||
assert_ne!(
|
||||
row, svg,
|
||||
"the scoped layout is identical to the baseline row — scope is not \
|
||||
reaching the placement"
|
||||
);
|
||||
assert!(
|
||||
!crate::text_of(&row).contains("P1\u{2019}s alone"),
|
||||
"the baseline page labels Problems with owners it does not have"
|
||||
);
|
||||
|
||||
// A bond Problem whose owner has no Bond says so, because the
|
||||
// RULE falls back to personal at degree 0 and the picture must
|
||||
// agree with the arithmetic.
|
||||
let mut lonely = v.clone();
|
||||
lonely.relations.clear();
|
||||
lonely.problem_markers.insert(
|
||||
7,
|
||||
ProblemMarker {
|
||||
owner: Some(PlayerId(1)),
|
||||
scope: Some(StressScope::Bond),
|
||||
},
|
||||
);
|
||||
let alone = crate::text_of(&crate::doc::document(
|
||||
&lonely,
|
||||
&[],
|
||||
"/c",
|
||||
Some(PlayerId(0)),
|
||||
false,
|
||||
));
|
||||
assert!(
|
||||
alone.contains("no Bond to share it"),
|
||||
"a bond Problem with no Bonds should read as personal: {alone}"
|
||||
);
|
||||
}
|
||||
|
||||
/// CB-WP-0034. The move button must name **who**.
|
||||
///
|
||||
/// Reported three times across three sessions, two days apart, and it
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue