CB-WP-0018 T03/T04: explanations, and window 1's verdict
Some checks failed
ci / check (push) Failing after 3s

T03: input::describe writes a sentence per legal command; data-descs
carries them in step with data-targets; the ghost already following the
pointer shows the one for whatever legal target is under it, so the
explanation lands beside the target with no overlay layer to keep
aligned. ADR-0010 D1 binds -- the page renders it, never composes it.

Both mutations INITIALLY SURVIVED because the fixture's Attack card had
exactly one target, where an off-by-one shift and a truncation are both
no-ops. CB-EV-0014's lesson one level in: a fixture too thin to express
a failure is how the failure survives. Two attack targets now, both red.

T04: chaos rate d4 -> d8, window 2 open at 12 declarations, retiring if
an override changes nothing twice running. Window 1's condition was NOT
met -- both overrides changed the outcome -- so the mechanism is kept.
The weakest part of the decision is that it is a rate change argued from
n=2, so window 2 carries a falsifier: no override at all is evidence the
rate went too far, not that the mechanism is healthy.

InnerLoop.md hit 401 lines and the loadability gate fired; the rationale
moved to InnerLoopReference.md, structurally, per the standing precedent
that limits are not raised.

CB-WP-0017 settled at $9.48/40 against $5.19/23 reported mid-flight,
83% higher. Six for six, always low -- read by re-running the instrument
at the moment of quoting, which is CB-EV-0015's correction applied for
the first time.

make all exits 0.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
tegwick 2026-08-03 02:24:13 +02:00
parent 7a78c58404
commit a733826d95
9 changed files with 424 additions and 30 deletions

View file

@ -56,7 +56,7 @@ fn cards(list: &[games_ground::SolutionCard]) -> String {
/// The only JavaScript in the project. See the module docs.
pub const SCRIPT: &str = r#"
(function () {
var down = null, held = null, marked = [], ghost = null;
var down = null, held = null, marked = [], ghost = null, ghostLabel = '';
function node(e) {
var n = e.target;
@ -70,6 +70,19 @@ pub const SCRIPT: &str = r#"
// wrote. This matches on them. It does not compute, infer, filter or
// default one -- a script that pattern-matched ids to guess what is
// legal would be forbidden even though the visible result is identical.
// ADR-0010 D1 again: `data-descs` is written by Rust, in step with
// `data-targets`. The script pairs them by index and renders one. It
// does not compose a description from an id.
function describeOf(held, key) {
if (!held) { return null; }
var t = held.getAttribute('data-targets');
var d = held.getAttribute('data-descs');
if (!t || !d) { return null; }
var i = t.split(' ').indexOf(key);
var all = d.split('|');
return i >= 0 && i < all.length ? all[i] : null;
}
function mark(n) {
var spec = n.getAttribute('data-targets');
if (!spec) { return; }
@ -88,6 +101,7 @@ pub const SCRIPT: &str = r#"
if (held) { held.classList.remove('held'); held = null; }
if (ghost && ghost.parentNode) { ghost.parentNode.removeChild(ghost); }
ghost = null;
ghostLabel = '';
down = null;
}
@ -102,7 +116,8 @@ pub const SCRIPT: &str = r#"
if (n.getAttribute('data-targets')) {
ghost = document.createElement('div');
ghost.id = 'cb-ghost';
ghost.textContent = n.textContent;
ghostLabel = n.textContent;
ghost.textContent = ghostLabel;
ghost.style.left = e.clientX + 'px';
ghost.style.top = e.clientY + 'px';
document.body.appendChild(ghost);
@ -113,6 +128,11 @@ pub const SCRIPT: &str = r#"
if (!ghost) { return; }
ghost.style.left = e.clientX + 'px';
ghost.style.top = e.clientY + 'px';
// The explanation, beside the pointer and therefore beside the
// target it is over (CB-WP-0018 T03).
var over = describeOf(held, key(node(e)));
ghost.textContent = over || ghostLabel;
ghost.className = over ? 'over' : '';
});
document.addEventListener('pointercancel', clear);
@ -165,6 +185,7 @@ h1,h2{font-size:1rem;margin:1.2rem 0 .4rem;color:#9cf}
.dropok{outline:2px dashed #9cf;outline-offset:3px;background:#1d2a33}
.dropok text{fill:#cfe}
/* The ghost that follows the pointer, so a drag is not invisible. */
#cb-ghost.over{background:#1d3347;border-color:#9cf;color:#cfe}
#cb-ghost{position:fixed;pointer-events:none;z-index:9;padding:.3rem .5rem;
border-radius:6px;background:#243;border:1px solid #5a7;color:#dde;
font:13px ui-monospace,monospace;box-shadow:0 6px 16px #000b;
@ -572,24 +593,32 @@ fn move_section(
// wherever the real target set was narrower, which is almost
// everywhere: Investigate is legal on problems 2 and 3 but
// not 1 (CB-WP-0017).
let targets: Vec<String> = seat
// CB-WP-0018 T03: targets and their meanings, in step, both
// written by Rust. ADR-0010 D1 forbids the page composing the
// second from the first.
let offered: Vec<(String, String)> = seat
.map(|seat| {
legal
.iter()
.filter_map(|c| crate::input::affordance(c, seat))
.filter(|(f, _)| *f == action_id(a))
.map(|(_, t)| t)
.filter_map(|c| {
crate::input::affordance(c, seat)
.filter(|(f, _)| *f == action_id(a))
.map(|(_, t)| (t, crate::input::describe(c, seat)))
})
.collect()
})
.unwrap_or_default();
let targets: Vec<String> = offered.iter().map(|(t, _)| t.clone()).collect();
let descs: Vec<String> = offered.iter().map(|(_, d)| d.clone()).collect();
if !targets.is_empty() {
let _ = write!(
s,
"<div class=\"card act pick\" data-drop=\"{id}\" \
data-targets=\"{targets}\">{a:?}<br>\
data-targets=\"{targets}\" data-descs=\"{descs}\">{a:?}<br>\
<span class=\"k\">onto</span> {names}</div>",
id = action_id(a),
targets = esc(&targets.join(" ")),
descs = esc(&descs.join("|")),
names = esc(&target_names(&targets)),
);
}