The cup climbs: easy to hard, deterministic — the shuffle retires with its screen

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
wuwiandClaude Fable 5 committed 2026-08-29 16:49:36 +02:00
1 parent dbfd085493
commit a5a681f9f2
5 files changed
+47 -57

No files matched your search

+13 -20
View File
@@ -1233,29 +1233,22 @@ test('THE TOURNAMENT: bands draw, bodies deepen, rounds hold their body, the cha
assert.ok(pr && pr.to === 2, 'the ceremony is parked for the menu to play');
});
test('THE DRAW: a passed draw is validated per round, honoured, or honestly re-rolled', () => {
// The screen would be worse than nothing if it dealt a different tournament from the one it just
// showed you settling (main.buildBracket hands its rungs straight to startMatch). The guard is
// the other half: a rung that is not in the round's band falls back to an honest roll rather
// than dealing THE CHAMPION in round one.
const { LADDER } = cfg;
const R = cfg.cupRoundsFor(1); // a fresh profile's cup is league one's
const drawn = [3, 1, 2, 4]; // a legal shuffle of the sub-band, the final settled
_startMatch(true, drawn); G.modal = null; G.modalQ.length = 0;
assert.equal(G.match.opp, drawn[0], 'round one walks on the body the screen landed on');
assert.deepEqual(G.match.cup.draw, drawn, 'and the rest of the draw rides with the run');
endMatch();
// a nonsense draw is refused per round, not trusted
_startMatch(true, [LADDER, LADDER, LADDER, LADDER]); G.modal = null; G.modalQ.length = 0;
assert.ok(R[0].band.includes(G.match.opp),
'a rung round one cannot contain is rolled instead of dealt');
endMatch();
// ...and no draw at all is the old behaviour, which the #cup back door still uses
test('THE CUP CLIMBS: rounds run easy to hard, deterministic, the final the top of the band', () => {
// the shuffle retired with the draw screen (Oliver: "warum sollten wir noch mischen?") — a bad
// roll paired the strongest challenger with the shortest round, inverting the tuned curve
for (const l of cfg.LEAGUES) {
const R = cfg.cupRoundsFor(l.id);
const order = R.map(r => (assert.equal(r.band.length, 1, 'one settled body per round'), r.band[0]));
for (let i = 1; i < order.length; i++)
assert.ok(order[i] > order[i - 1], `${l.name}: round ${i + 1} is the harder body`);
assert.equal(order[0], l.band[0], `${l.name} opens on its easiest`);
assert.equal(order[order.length - 1], l.band[1], `${l.name} ends on its final`);
}
// ...and the run reads that order off exactly
_startMatch(true); G.modal = null; G.modalQ.length = 0;
assert.ok(R[0].band.includes(G.match.opp), 'no draw: the round rolls its own');
assert.equal(G.match.opp, 1, 'round one walks on the easiest body');
endMatch();
});
test('cup rallies never strand the latch: no-crossing points, the fall, and the mid-round game', () => {
// Oliver's second lock: in the quarter-final, matchFallWillPlay still divided by 4 while
// matchPoint divided by 4*need — it promised a fall on a point that crossed nothing, the