ravensight-playtest 0.10.4 → 0.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,242 @@
1
+ // The local CLI carries this file unchanged from the hosted runner (the platform repo, lib/claimwords.mjs).
2
+ // The words of a playtester's claim, and the questions its claim check is asked: pure text rules, no run, no page, no model.
3
+ // Which class of claim a sentence makes (stuck, absence, difficulty, layout, other), whether a claim of no other class is a
4
+ // fact about the screen or a matter of taste, whether it is praise, what a claim check's answer says, and the question the
5
+ // check is asked. lib/claims.mjs (the gates) and lib/verify.mjs (the checks) import these and export them again unchanged.
6
+ // The same file is carried by the local CLI (ravensight-playtest, src/run/claimwords.js), so a local run's claims are
7
+ // sorted and asked about by exactly these rules; lib/anygame/shared-hashes.json holds the two copies together.
8
+ const noDashes = s => String(s ?? '').replace(/[\u2013\u2014]/g, ',');
9
+
10
+ const text = x => noDashes(String(x ?? '')).replace(/\s+/g, ' ').trim();
11
+ const clip = (s, n) => noDashes(String(s ?? '').replace(/\s+/g, ' ').trim()).slice(0, n);
12
+
13
+ const STUCK = /\b(stuck|frozen|froze|freezes?|freezing|hangs?|hung|hanging|soft ?lock(?:ed|s)?|dead ?lock(?:ed|s)?|unresponsive|not respon(?:ding|sive)|no response|nothing (?:happens|happened|happening|changes|changed|moves|moved|responds|responded)|(?:does|do|did)(?:n't| not) (?:respond|react|move|advance|progress|do anything|register|work)|never (?:ends|ended|finishes|finished|advances|advanced|moves|moved|responds|responded|comes|came)|won't (?:advance|move|respond|end|start)|wait(?:s|ing|ed)? forever|no (?:ai |enemy |visible )?(?:action|movement|reaction))\b/i;
14
+ const ABSENCE = /^(?:there (?:is|are|was|were) )?no\b|\b(?:without|missing|lacks?|lack of|absent|(?:is|are|was|were)(?:n't| not) (?:shown|displayed|visible|indicated|given)|not (?:shown|displayed|visible|indicated)|never (?:shows?|shown|displays?|displayed|appears?|appeared)|(?:does|do|did)(?:n't| not) (?:show|display|indicate|tell|confirm|warn)|gives? no|shows? no|has no|have no|with no|there (?:is|are|was|were) no|no (?:visible|clear|obvious|explicit))\b/i;
15
+ const DIFFICULTY = /\b(too (?:hard|difficult|slow|fast|quick|quickly|short|tight|punishing|steep|strict|precise)|(?:nearly|almost|virtually|practically) (?:impossible|uncrossable|unbeatable|unwinnable|unreachable)|impossible|uncrossable|unbeatable|unwinnable|unfair|unforgiving|punishing|(?:very|overly|extremely|really|quite) (?:strict|tight|hard|difficult|precise|punishing)|(?:timing|window|jump|gap)\b[^.]{0,40}\b(?:strict|tight|precise|inconsistent|unreliable|hard|difficult)|(?:strict|tight|precise|inconsistent|unreliable)\b[^.]{0,30}\b(?:timing|window|jump)|(?:attempts?|tries|retries)\b[^.]{0,60}\bfail(?:ed|s|ing)?|fail(?:ed|s|ing)? to (?:clear|cross|reach|beat|complete|make|land|pass)|could(?:n't| not) (?:clear|cross|reach|beat|complete|make|land|pass|get past|get through)|cannot be (?:reached|cleared|beaten|crossed|completed)|can't be (?:reached|cleared|beaten|crossed|completed)|hard to (?:time|clear|cross|land|beat))\b/i;
16
+ // "Sometimes fails", "fails silently": the playtester's own word for the notice decides when it gave one (a defect the screen shows is checked as one).
17
+ // How the screen is drawn: what a still picture shows, and what marks drawn over that picture can make it look like.
18
+ // How a block of words is set out on the screen: one paragraph, no line breaks, a wall of text. What a still frame shows, so a claim
19
+ // of fact (honesty round 8: on pt_job_c26bb24fd58be467d014 "Dense instructional text block ... one dense paragraph with no line
20
+ // breaks" was published as an opinion on "could not settle", and the title screen's own frame shows four separate centred lines).
21
+ // Words only, never "block" alone: a falling block in a puzzle game is not text.
22
+ export const TEXT_LAYOUT = /\b(wall of text|(?:one|a single|single|long|large|big|solid) (?:dense |long |large |big |solid )?(?:paragraph|block of text|text block)|dense (?:\w+ ){0,2}(?:text|paragraph|wording)|no (?:line |paragraph )?breaks?|(?:all )?on (?:a single|one) line|(?:lines?|bullets?|rules?|sentences?|steps?) (?:are |were )?(?:run|squeezed|crammed|jammed) together|text[- ]heavy)\b/i;
23
+ const LAYOUT = /\b(overlap\w*|cut ?off|cuts off|clipped|clipping|truncat\w+|misalign\w*|cramped|crowded|cluttered|off[- ]?screen|overflow\w*|out of (?:its|the) (?:box|bounds|frame)|runs? (?:off|outside|past)|spills?|wrap(?:s|ped|ping)? (?:oddly|badly|wrongly|awkwardly)|(?:drawn|placed|positioned|rendered) (?:in the wrong place|oddly|wrongly|twice)|(?:covers?|covered|obscur\w+|hides?|hidden) (?:by|behind|under|the|a|part)|on top of|too (?:small|tiny|dense) to read|illegible|dense and small)\b/i;
24
+ // How something LOOKS on the screen: underlined, boxed, outlined, highlighted, coloured, styled like a button. A claim of fact about
25
+ // the picture, never an opinion, and on a canvas game exactly what the runner's own marks (magenta boxes and labels, the blue
26
+ // grid) make the playtester's copy look like: on pt_job_81998fb24333c33ede3b "Instruction text looks like clickable buttons ...
27
+ // underlined and boxed" was published as an opinion, and the title screen's own frame shows plain text.
28
+ export const APPEARANCE = /\b(underlin\w*|boxed|outlined|bordered|framed|encircled|circled|highlight(?:ed|ing)?|(?:in|inside|within|with|surrounded by|drawn in) (?:a |an )?(?:box(?:es)?|frames?|borders?|outlines?|rectangles?|highlights?)|(?:styled|drawn|rendered|formatted) (?:like|as) (?:a |an )?\w+|(?:looks?|looked|looking|shown|displayed|resembl(?:es?|ing)) (?:like |as )?(?:a |an )?(?:clickable |interactive |plain |real )?(?:buttons?|links?|hyperlinks?|tabs?|controls?)|colou?red|tinted|shaded|gr[ae]yed|in (?:magenta|pink|purple|blue|cyan|red|green|yellow|bold|italics?)|bold(?:ed)?|italic\w*)\b/i;
29
+ const UNRELIABLE = /\b((?:sometimes|often|occasionally|randomly|silently|intermittently)( \w+)? fails?|fails? (?:sometimes|silently|randomly|repeatedly|every time|to ))\b/i;
30
+
31
+
32
+ /**
33
+ * What kind of claim a judgement makes: `stuck`, `absence`, `difficulty`,
34
+ * `layout` or `other`. `kind` is the playtester's own word for a notice
35
+ * (lib/notice.mjs); the words are read in English, so a claim in another
36
+ * language is `other` unless its `kind` says difficulty, and passes the
37
+ * general rule only. `marked` says the playtester's copy of the picture it
38
+ * judged from carried the runner's marks and grid: only then is a judgement
39
+ * of how the screen is drawn its own class, `layout`.
40
+ */
41
+ export function claimClass({ title = '', detail = '', kind = null, marked = false } = {}) {
42
+ const t = text(title), d = text(detail);
43
+ if (kind === 'difficulty') return 'difficulty';
44
+ // Words of difficulty in the title decide whatever the playtester called it: a notice it filed as a defect is still its own failed play.
45
+ if (DIFFICULTY.test(t)) return 'difficulty';
46
+ if (STUCK.test(t)) return 'stuck';
47
+ if (ABSENCE.test(t)) return 'absence';
48
+ if (DIFFICULTY.test(`${t}. ${d}`)) return 'difficulty';
49
+ if (!kind && UNRELIABLE.test(`${t}. ${d}`)) return 'difficulty';
50
+ if (marked && (LAYOUT.test(`${t}. ${d}`) || TEXT_LAYOUT.test(`${t}. ${d}`) || APPEARANCE.test(`${t}. ${d}`))) return 'layout';
51
+ if (STUCK.test(d)) return 'stuck';
52
+ return 'other';
53
+ }
54
+
55
+ // A judgement of taste or clarity, by its words (English): nothing a frame can show to be so or not so.
56
+ const OPINION = /\b(unclear|not (?:clear|obvious|intuitive|explained)|(?:is|are|was|were)(?:n't| not) (?:clear|obvious|intuitive|explained)|confus\w*|ambiguous|vague|unintuitive|counter-?intuitive|unexplained|poorly explained|(?:hard|difficult|tricky) to (?:tell|read|see|understand|know|find|notice|distinguish|follow|parse|spot|make out|judge|predict|learn)|(?:can(?:no|')t|could(?:n't| not)|do(?:n't| not)|did(?:n't| not)) (?:tell|know|understand|figure out|work out|see how|see why|see what|see which)|not sure|unsure|easy to miss|feels?|felt|seems?|seemed|boring|tedious|repetitive|bland|dull|ugly|cluttered|overwhelming|too (?:small|big|large|bright|dark|dim|faint|subtle|loud|quiet|busy|much|many|few|little|long|wordy|dense)|could (?:be|use)|should|would (?:be|help|like)|needs? (?:a|an|more|better|clearer)|lacks? (?:polish|feedback|clarity|guidance|explanation)|little (?:feedback|guidance|explanation|warning)|purpose|what .{1,40} (?:means?|does|do|is for|are for))\b/i;
57
+ // A claim about what the screen shows or what the game did, by its words (English).
58
+ const SCREEN_FACT = /\b(still|unchanged|(?:did|does|do)(?:n't| not)|(?:is|are|was|were)(?:n't| not)|won't|will not|fails? to|failed to|never|no longer|stays?|stayed|remains?|remained|shows?|showed|shown|displays|displayed|reads|appears?|appeared|disappears?|disappeared|vanish\w*|resets?|broken|wrong|incorrect|garbled|misspel\w+|typos?|placeholder|blank|flicker\w*|glitch\w*|duplicat\w+|twice|negative|nan|undefined|null|corrupt\w*|missing)\b/i;
59
+
60
+ // A sentence that says the screen did NOT show something at the claim's moment: "selecting unit 1 shows no clear move range", "the
61
+ // button does not highlight", "the score is not shown", "no marker appears". Whatever the playtester called it (ux, clarity) and
62
+ // however its title is worded ("Unclear move feedback"), that is a claim about what one frame shows, so it is held to the frame
63
+ // and asked about fault (honesty round 7: on pt_job_3b563b9b0c637486f45c "Selecting unit 1 shows no clear move range" was published
64
+ // as an opinion on "could not settle", and the frame shows the unit had just moved and the game saying "Moved. Hit an enemy beside
65
+ // it, pick another unit, or end the turn."). What it is NOT: a judgement of the player's own understanding or of taste, even one
66
+ // that names a missing thing as its reason in passing ("unclear which units have moved: it just shows text, no visual marker
67
+ // beforehand", "not clear how many each card costs", "not explained", "does not obviously trigger attack feedback", "hard to read").
68
+ // Only a verb of showing, negated, or a thing said to be missing or absent, makes it a claim of fact.
69
+ export const NOT_SHOWN = /\b(shows? no|showed no|(?:does|do|did)(?:n't| not) (?:show|display|indicate|highlight|mark|appear)|(?:is|are|was|were)(?:n't| not) (?:shown|displayed|visible|highlighted|indicated|marked)|no (?:clear |visible |obvious )?[a-z]+(?: [a-z]+){0,2} (?:appears?|appeared|is shown|was shown|is visible|was visible|is displayed|was displayed)|never (?:shows?|showed|shown|appears?|appeared|highlights?|highlighted)|missing|absent)\b/i;
70
+
71
+ // The facts a playtester may state for one claim, and how long each may be (lib/notice.mjs NOTICE_LINE asks for 1 to 3, 12 words each).
72
+ export const MAX_FACTS = 3;
73
+ export const FACT_MAX_CHARS = 100;
74
+
75
+ /**
76
+ * The facts the playtester stated a claim rests on, with its own word on whether the claim is a matter of taste (lib/notice.mjs):
77
+ * `{ facts, taste }`, or null when it stated neither (an older reply, a look back, a test's result). A claim marked taste may come
78
+ * with no facts; one not marked taste needs at least one fact, since a fact is what its check is asked about. A fact about the
79
+ * runner's marks, labels or grid is about the tool, and lib/notice.mjs drops the whole notice before it gets here.
80
+ */
81
+ export function statedFacts({ facts = null, taste = null } = {}) {
82
+ const list = (Array.isArray(facts) ? facts : []).map(f => text(f).slice(0, FACT_MAX_CHARS)).filter(f => f.length >= 3).slice(0, MAX_FACTS);
83
+ if (taste === true) return { facts: list, taste: true };
84
+ if (taste === false && list.length) return { facts: list, taste: false };
85
+ return null;
86
+ }
87
+
88
+ /**
89
+ * Whether a judgement that is none of the classes above is a claim of `fact`
90
+ * about the screen or an `opinion` (see the top of this file). `fact: true`
91
+ * fixes it for a judgement that is a reading of the picture or the result of
92
+ * a test (lib/report.mjs). Otherwise the title's own words decide first, then
93
+ * the playtester's own word for the notice (`kind`, lib/notice.mjs: it is
94
+ * written in any language, where the words are read in English only), then
95
+ * its category. With no sign that it is taste, a claim about the game is a
96
+ * claim of fact: it is held to the frame.
97
+ */
98
+ export function claimBasis({ title = '', detail = '', kind = null, category = null, severity = null, fact = false, facts = null, taste = null } = {}) {
99
+ if (fact === true) return 'fact';
100
+ // The playtester's own statement of the facts a notice rests on, and whether it is a matter of taste (lib/notice.mjs): it decides,
101
+ // and the word lists below are only the fallback for a claim that came with no facts (an older reply, a look back, a test).
102
+ const stated = statedFacts({ facts, taste });
103
+ if (stated) return stated.taste ? 'opinion' : 'fact';
104
+ const t = text(title);
105
+ // How the words on the screen are set out (TEXT_LAYOUT) is what one frame shows, whatever the playtester called it.
106
+ if (TEXT_LAYOUT.test(t) || TEXT_LAYOUT.test(text(detail))) return 'fact';
107
+ // How something looks is what the picture shows, whatever else the words say ("looks confusing" is taste; "looks like a button" is not).
108
+ if (APPEARANCE.test(t.replace(/\blooks? (?:confusing|odd|strange|weird|off|bad|good|nice|cheap|dated|unfinished|unclear|busy)\b/gi, ''))
109
+ || APPEARANCE.test(text(detail).replace(/\blooks? (?:confusing|odd|strange|weird|off|bad|good|nice|cheap|dated|unfinished|unclear|busy)\b/gi, ''))) return 'fact';
110
+ // A sentence that the screen did not show something is a claim of fact, whatever the title or the kind says (NOT_SHOWN).
111
+ if (NOT_SHOWN.test(t) || NOT_SHOWN.test(text(detail))) return 'fact';
112
+ if (OPINION.test(t)) return 'opinion';
113
+ // Graded cosmetic, it is about how the screen looks, which the frame shows; a title in words of taste ("bland", "ugly") stays an opinion above.
114
+ if (severity === 'cosmetic') return 'fact';
115
+ if (kind === 'defect') return 'fact';
116
+ if (SCREEN_FACT.test(t)) return 'fact';
117
+ if (kind === 'clarity' || kind === 'opinion') return 'opinion';
118
+ if (category === 'bug') return 'fact';
119
+ if (category === 'balance' || OPINION.test(text(detail))) return 'opinion';
120
+ return 'fact';
121
+ }
122
+
123
+ /**
124
+ * What a claim check said, whatever vocabulary its record is in: `shows` (the
125
+ * frame shows what the claim says), `opposite` (the frame shows the claim is
126
+ * wrong), `cannot_tell`, `not_contradicted`, or null when no check was made.
127
+ *
128
+ * A check made now carries `says` (lib/verify.mjs). A record without it was
129
+ * made under the question "does this image contradict the claim: yes, no,
130
+ * unclear", where "no" meant only "it does not contradict it": that is
131
+ * `not_contradicted`, and it confirms no claim of fact. The two questions
132
+ * that already asked about the thing itself (`question` absence or layout)
133
+ * answered "no" only when the frame clearly showed the claim.
134
+ */
135
+ export function checkSaid(claim) {
136
+ if (!claim || typeof claim !== 'object') return null;
137
+ // The two answers of the fault question (lib/verify.mjs): the frame shows the game failing, or the game working as designed.
138
+ if (claim.says === 'at_fault') return 'at_fault';
139
+ if (claim.says === 'as_designed') return 'as_designed';
140
+ if (claim.says === 'shows_it') return 'shows';
141
+ if (claim.says === 'shows_opposite') return 'opposite';
142
+ if (claim.says === 'cannot_tell') return 'cannot_tell';
143
+ if (claim.answer === 'yes') return 'opposite';
144
+ if (claim.answer === 'unclear') return 'cannot_tell';
145
+ if (claim.answer === 'no') return claim.question === 'absence' || claim.question === 'layout' ? 'shows' : 'not_contradicted';
146
+ return null;
147
+ }
148
+
149
+ const GOOD = /\b(clear|clearly|good|great|nice|nicely|well|easy|easily|helpful|intuitive|smooth|smoothly|satisfying|fun|enjoyable|polished|responsive|readable|lovely|pleasant|delightful|works|worked)\b/i;
150
+ const COMPLAINT = /\b(but|however|although|though|except|yet|not|no|never|none|nothing|unclear|hard|harder|difficult|confus\w*|missing|lacks?|lacking|without|too|slow|slowly|broken|wrong|fails?|failed|bugs?|issues?|problems?|stuck|can't|cannot|couldn't|doesn't|don't|didn't|isn't|aren't|wasn't|won't|hidden|poor|poorly|bad|badly|only|barely|hardly|inconsistent|overlap\w*|cut off|should|needs?|unless|worse|annoying|frustrat\w*|tedious|miss(?:es|ed)?|narrow|tight)\b/i;
151
+
152
+ /**
153
+ * Whether a judgement says something is good and nothing else: "Clear
154
+ * instructions", "The title screen explains the controls well". Praise is
155
+ * not a finding at any severity: it goes with what worked (lib/report.mjs).
156
+ * A mixed sentence ("clear instructions but the timer is hidden") keeps its
157
+ * complaint, so it is not praise and passes the normal gates.
158
+ */
159
+ export function praiseClaim({ title = '', detail = '', why = '' } = {}) {
160
+ const said = `${text(title)}. ${text(detail)}`;
161
+ // A judgement of difficulty is the playtester's own play, whatever kind word sits in it ("easy to miss" is not praise).
162
+ if (COMPLAINT.test(said) || DIFFICULTY.test(said)) return false;
163
+ return GOOD.test(said) || /\bpraise\b/i.test(text(why));
164
+ }
165
+
166
+ // The three answers a claim check may give, as asked for and as recorded (`says`). On the paid runs of 2026-11-13 the question was
167
+ // "does this image contradict the claim: yes, no, unclear", and "no" (it does not contradict it) stood in for "the frame shows it":
168
+ // a frame of room 1 back in play "did not contradict" a claim that the screen still showed the lost state.
169
+ // A claim that the game did something wrong is asked about fault instead (`claimText`, the playtester's own claims about what the game
170
+ // did): "game at fault" or "as designed" in place of "shows it". On the paid run of 2026-11-13 (88bfdd8) "enemy still shows 8 HP"
171
+ // was answered "shows it", and the frame did show 8 HP, beside the game's own "Too far: a unit hits only an enemy right beside it".
172
+ export const CLAIM_SAYS = Object.freeze({ 'shows it': 'shows_it', 'shows the opposite': 'shows_opposite', 'cannot tell': 'cannot_tell', 'game at fault': 'at_fault', 'as designed': 'as_designed' });
173
+ // The same answer in the words the report's readers already have (`answer`: yes the frame contradicts it, no it does not, unclear).
174
+ // "no" is now given only when the frame shows the claim, so it never says less than it did. "As designed" contradicts no fact and
175
+ // confirms no fault: on the wire it is "unclear" (the server reads no other word), and `says` keeps it.
176
+ export const CLAIM_WIRE = Object.freeze({ shows_it: 'no', shows_opposite: 'yes', cannot_tell: 'unclear', at_fault: 'no', as_designed: 'unclear' });
177
+ export const CLAIM_SYSTEM = 'You check playtest findings against their evidence. You are shown one frame from the session and one claim about the game at that moment. A red box, when there is one, marks where the input landed. Answer the question under the claim with exactly one of the answers that question lists and nothing else. Unless it lists others, the answers are: "shows it" when the frame itself shows what the claim says; "shows the opposite" when the frame shows the claim is wrong; "cannot tell" when the frame does not settle it. A frame that merely does not contradict the claim is "cannot tell".';
178
+ // The fault question: what the playtester says the game did is held to whether the game is at fault, not only to whether the fact is so.
179
+ export const FAULT_QUESTION = 'The claim says the game did something wrong. Is the GAME at fault in this frame? Answer "game at fault" only if the frame shows the game failing to do what it should. Answer "as designed" if the frame shows the game responding as it is meant to: a message on screen that explains the outcome (such as "Too far", "not enough", "select a unit first"), or the plain effect of the playtester\'s own input (End Turn ends the turn); after "as designed:" quote that message, at most 10 words, when there is one. Answer "shows the opposite" if the frame shows the claim is wrong, "cannot tell" if the frame does not settle it.';
180
+ // A claim from a test's result that something did not appear: the game's own message explaining why is the game working.
181
+ // The playtester's own claim that something is missing (a notice, a test's result, a problem named looking back; honesty round 7):
182
+ // the thing missing is a fact, and the question is whether the game is at fault for it.
183
+ export const ABSENCE_FAULT = 'The claim says something is missing from the screen. Look for that thing in this frame. Answer "shows the opposite" if the thing is visible in the frame (the claim is wrong). Answer "as designed" if the frame shows why it is not there as the game means it: a message that explains it (such as "Too far" or "Moved"), or the plain effect of the playtester\'s own input; after "as designed:" quote that message, at most 10 words, when there is one. Answer "game at fault" only if the frame shows the game without that thing where it should be shown. Answer "cannot tell" if the frame does not settle it.';
184
+
185
+ /** The claim as the check reads it: severity, title, description, and expected against actual when the run recorded them. */
186
+ export function claimText(finding, moment = {}) {
187
+ const lines = [`Claim (${finding.severity}): ${clip(finding.title, 160)}`, clip(finding.description, 1200)];
188
+ // The facts the playtester said the claim rests on (lib/notice.mjs): the question below is about them. "Shows it" or "game at fault"
189
+ // needs every one of them in the frame; any one the frame shows is wrong is "shows the opposite".
190
+ const facts = Array.isArray(finding.facts) ? finding.facts.filter(f => typeof f === 'string' && f.trim()).slice(0, 3) : [];
191
+ if (facts.length) lines.push(`The claim rests on ${facts.length === 1 ? 'this fact' : 'these facts'} about the frame: ${facts.map(f => `"${clip(f, 100).replace(/"/g, "'")}"`).join('; ')}. Judge the claim by ${facts.length === 1 ? 'that fact' : 'those facts'}: it holds only if the frame shows ${facts.length === 1 ? 'it' : 'every one of them'}, and it is wrong if the frame shows ${facts.length === 1 ? 'it' : 'any of them'}, or anything else the claim says, is wrong.`);
192
+ // A claim of what was missing before an input is shown the screen just before it (`cutFrames`), and asked about that moment.
193
+ if (finding.beforeInput === true) lines.push('The claim is about the moment BEFORE an input. This frame is the screen just before that input; what the game showed after the input is not in it and does not settle the claim.');
194
+ if (moment.expected) lines.push(`Expected before the input: ${moment.expected}`);
195
+ if (moment.actual) lines.push(`Measured after the input: ${moment.actual}`);
196
+ // A claim that something is missing is asked about the thing itself: a frame "not contradicting" it is not the thing being absent.
197
+ if (moment.cls === 'absence' && moment.fault) lines.push('', ABSENCE_FAULT);
198
+ else if (moment.cls === 'absence') lines.push('', 'The claim says something is missing from the screen. Look for that thing in this frame. Answer "shows the opposite" if the thing is visible in the frame (the claim is wrong), "shows it" only if the frame clearly shows the game without that thing, "cannot tell" if the frame does not settle it.');
199
+ // What the playtester says the game did: a true fact is not yet the game at fault (lib/claims.mjs).
200
+ else if (moment.fault && (moment.cls === 'other' || moment.cls === 'stuck')) lines.push('', FAULT_QUESTION);
201
+ // A judgement of how the screen is drawn was made from a copy of the picture with the tester's marks on it: it is asked about the game's own frame.
202
+ // A layout claim is a claim the game drew something wrong, so it is asked about fault, as a claim of what the game did is: the claim
203
+ // judge's two live runs answered "shows it" for "Game over text overlaps unit boxes", a modal drawn over the dimmed board, even with
204
+ // "as designed" offered beside "shows it". Only "game at fault" confirms it now (`designed` in the record).
205
+ else if (moment.cls === 'layout') lines.push('', 'The claim is about how the screen is drawn. It was judged from a copy of this picture that had numbered boxes, labels and a grid drawn over it by the testing tool. This frame is the game\'s own picture with none of that on it. Is the GAME at fault in this frame? Answer "game at fault" only if this frame itself shows the game drawing it wrongly, such as text cut off or overlapping so it cannot be read. Answer "as designed" if what the claim describes is drawn that way on purpose, such as a dialog or message over a dimmed screen. Answer "shows the opposite" if the frame does not show it or if what the claim describes could only be the drawn boxes, labels or grid (the claim is wrong), "cannot tell" if the frame does not settle it.');
206
+ else lines.push('', 'Does this frame itself show what the claim says? Answer "shows it" only if you can see it in the frame, "shows the opposite" if the frame shows the claim is wrong, "cannot tell" if the frame does not settle it (a frame that only fails to contradict the claim is "cannot tell").');
207
+ return lines.join('\n');
208
+ }
209
+
210
+ /**
211
+ * A claim check reply as one of the three answers: `shows_it`, `shows_opposite` or `cannot_tell`. Anything else is
212
+ * `cannot_tell`, a bare "yes" or "no" among it: under this question "yes" could mean either, so it confirms nothing
213
+ * and contradicts nothing.
214
+ */
215
+ export function claimSays(text) {
216
+ return claimRead(text) || 'cannot_tell';
217
+ }
218
+
219
+ /** The same, or null when the reply is none of the three answers (so a run can count the replies it could not read). */
220
+ export function claimRead(text) {
221
+ // The answer is asked for alone: it must open the reply (after "the frame" at most) and end its sentence there, so
222
+ // "the frame shows it is wrong" is not read as "shows it".
223
+ const m = String(text || '').toLowerCase().replace(/[_-]+/g, ' ').match(/^[^a-z]*(?:(?:the|this) (?:frame|image|picture) )?(shows the opposite|shows it|cannot tell|(?:the )?game (?:is )?at fault|as designed)(?=[^a-z]*$|\s*[.,;:!"')\n])/);
224
+ if (!m) return null;
225
+ return CLAIM_SAYS[m[1].replace(/^the /, '').replace(' is ', ' ')];
226
+ }
227
+
228
+ /** The game's own words a reply quoted after "as designed:", or ''. A reply cut at its token ceiling keeps what came. */
229
+ export function claimMessage(text) {
230
+ const m = /^[^A-Za-z]*(?:(?:the|this) (?:frame|image|picture) )?as[ _-]designed\s*[:,.;-]\s*(.+)$/is.exec(String(text || '').trim());
231
+ if (!m) return '';
232
+ const rest = noDashes(m[1]).replace(/\s+/g, ' ').trim();
233
+ // A quoted message ends at its closing quote: on pt_job_3b563b9b0c637486f45c the reply `as designed: "Enemy is moving", Enem` (cut at
234
+ // its token ceiling) was printed as "Enemy is moving', Enem". What follows the quote is the model's own words, not the game's.
235
+ const quoted = /^["“]([^"”]{1,160})["”]/.exec(rest) || /^'([^']{1,160})'/.exec(rest);
236
+ return (quoted ? quoted[1] : rest.replace(/^["'“”]+|["'“”.]+$/g, '')).trim().slice(0, 160);
237
+ }
238
+
239
+ /** A claim check answer in the report's older words (yes the frame contradicts it, no, unclear), from the reply. */
240
+ export function claimAnswer(text) {
241
+ return CLAIM_WIRE[claimSays(text)];
242
+ }
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Two independent ceilings:
5
5
  *
6
- * 1. **Images.** `routing.json`'s `persona_playtest.act` sets
6
+ * 1. **Images.** The server routing table's `persona_playtest.act` sets
7
7
  * `max_images: 1`, and the proxy counts image blocks across the WHOLE
8
8
  * `messages` array and answers 400 `too_many_images` past that. So the
9
9
  * ceiling is on the context, not on the newest turn: exactly one image
@@ -14,7 +14,7 @@
14
14
  *
15
15
  * The brief asked for at most two images per call. One is what the
16
16
  * server actually allows on this step, and a body with two comes back
17
- * 400 with nothing played, so this file follows routing.json. It is a
17
+ * 400 with nothing played, so this file follows the server routing table. It is a
18
18
  * constant rather than a literal so that a routing change is a one line
19
19
  * change here, and `shrinkImages` exists so a caller that meets
20
20
  * `too_many_images` anyway can retry smaller instead of failing the run.
@@ -29,6 +29,8 @@ import fs from 'node:fs/promises';
29
29
  import path from 'node:path';
30
30
 
31
31
  import { buildObservation, needsVision } from './godot-observation.js';
32
+ // The game's own analytics events (the hosted runner's lib/events.mjs, carried unchanged).
33
+ import { createGameEvents } from '../events.js';
32
34
  import { pngFingerprint, screenDelta, significant } from '../pixels.js';
33
35
  import {
34
36
  detectGodotBinary,
@@ -181,7 +183,7 @@ export function holdWallMs(holdMs, scale = 1) {
181
183
  *
182
184
  * Godot needs a real environment to start, but it is also running the
183
185
  * customer's game code, and that code has no business seeing the developer's
184
- * ANTHROPIC_API_KEY, RAVENSIGHT_TOKEN, cloud credentials or CI secrets. So the
186
+ * model provider API keys, RAVENSIGHT_TOKEN, cloud credentials or CI secrets. So the
185
187
  * environment is built from this list rather than inherited wholesale. Names are
186
188
  * matched case insensitively, because Windows environment blocks are.
187
189
  */
@@ -421,6 +423,8 @@ export class GodotDriver {
421
423
  this._logTail = [];
422
424
  this._logPending = '';
423
425
  this._consoleQueue = [];
426
+ // The game's own Ravensight SDK events: the driver addon mirrors every event the SDK queues (`ravensight_event`), at once.
427
+ this.gameEvents = createGameEvents();
424
428
  this._videoTimer = null;
425
429
  this._framesDir = null;
426
430
  this._stopped = false;
@@ -1668,7 +1672,7 @@ export class GodotDriver {
1668
1672
 
1669
1673
  /** Console errors since the previous call, from Godot stdout and driver events. */
1670
1674
  async consoleErrors() {
1671
- const fromEvents = (this.rpc?.drainEvents() ?? [])
1675
+ const fromEvents = this._drainDriverEvents()
1672
1676
  .filter((event) => event.type === 'error')
1673
1677
  .map((event) => ({ kind: 'error', text: event.message, source: event.source, frame: event.frame }));
1674
1678
  // The persona loop labels a console note by its `type`, as the browser
@@ -1678,6 +1682,38 @@ export class GodotDriver {
1678
1682
  return out;
1679
1683
  }
1680
1684
 
1685
+ /**
1686
+ * The driver's notifications since the last drain. The game's own SDK events
1687
+ * among them go to the game event log as they come; the rest are returned.
1688
+ */
1689
+ _drainDriverEvents() {
1690
+ const drained = this.rpc?.drainEvents() ?? [];
1691
+ const rest = [];
1692
+ const sdk = [];
1693
+ for (const event of drained) {
1694
+ if (event && event.type === 'ravensight_event' && typeof event.name === 'string') sdk.push({ event: event.name, data: event.data && typeof event.data === 'object' ? event.data : {}, timestamp: null });
1695
+ else rest.push(event);
1696
+ }
1697
+ // One body, in the SDK's own batch shape, so the shared parser reads it; untimed, so each is placed by when it came.
1698
+ if (sdk.length > 0) this.gameEvents.tap({ body: JSON.stringify({ events: sdk }) });
1699
+ return rest;
1700
+ }
1701
+
1702
+ /** Mark input `step` (or 'end' after play): what came before it is placed at the step before. Godot's events come as they are queued. */
1703
+ async markGameEvents(step) {
1704
+ const rest = this._drainDriverEvents();
1705
+ // Errors drained here are kept for the next consoleErrors() read.
1706
+ for (const event of rest) if (event && event.type === 'error') this._consoleQueue.push({ kind: 'error', text: event.message, source: event.source, frame: event.frame });
1707
+ this.gameEvents.mark(step, null);
1708
+ }
1709
+
1710
+ /** Nothing is held back: the addon mirrors each event as it is queued. Reads what is still unread. */
1711
+ async flushGameEvents() {
1712
+ const rest = this._drainDriverEvents();
1713
+ for (const event of rest) if (event && event.type === 'error') this._consoleQueue.push({ kind: 'error', text: event.message, source: event.source, frame: event.frame });
1714
+ return { bodies: 0, ms: 0 };
1715
+ }
1716
+
1681
1717
  async chapter(title) {
1682
1718
  this.chapters.push({ title, at: this._startedAt === null ? 0 : this._now() - this._startedAt });
1683
1719
  }
@@ -7,6 +7,8 @@ import { STRIP_MIN_MS, stripNote, stripTimes, stripTokens } from '../strip.js';
7
7
  import { GAMEPAD_BUTTONS, gamepadState, virtualGamepadInit } from '../gamepad.js';
8
8
  // any-game hook: sound as measured evidence (../anygame/sound.js).
9
9
  import { soundProbeInit, soundSelfTest, readSound } from '../anygame/sound.js';
10
+ // The game's own analytics events (the hosted runner's lib/events.mjs, carried unchanged).
11
+ import { createGameEvents } from '../events.js';
10
12
  import { writeFile } from 'node:fs/promises';
11
13
  import { PHONE_VIEWPORT } from '../phone.js';
12
14
  import { mkdir, rename, stat, readdir, rm, chmod } from 'node:fs/promises';
@@ -1183,6 +1185,27 @@ export function injectPlaytestIdentity(identity) {
1183
1185
  * claim that does not check out is a 403, never a real session): `check`
1184
1186
  * is never recorded as a player.
1185
1187
  */
1188
+ /** The SDK's documented track paths (the hosted runner's lib/network.mjs routes the same two). */
1189
+ export const SDK_TRACK_PATH = /\/api\/v1\/track(?:\/batch)?\/?$/;
1190
+
1191
+ /**
1192
+ * Hand one request the page made to the game event log when it is the game's
1193
+ * own SDK sending events: a POST to a track path. Read only, and never throws.
1194
+ */
1195
+ export function tapSdkEvents(request, log) {
1196
+ try {
1197
+ if (!request || typeof request.method !== 'function' || request.method() !== 'POST') return false;
1198
+ const url = new URL(request.url());
1199
+ if (!/^https?:$/.test(url.protocol) || !SDK_TRACK_PATH.test(url.pathname)) return false;
1200
+ const body = typeof request.postDataBuffer === 'function' ? request.postDataBuffer() : request.postData();
1201
+ if (!body) return false;
1202
+ log.tap({ body, headers: typeof request.headers === 'function' ? request.headers() : {} });
1203
+ return true;
1204
+ } catch {
1205
+ return false;
1206
+ }
1207
+ }
1208
+
1186
1209
  export const CHECK_PLAYTEST_IDENTITY = Object.freeze({ token: 'check', runId: null, jobId: null, persona: 'check' });
1187
1210
 
1188
1211
  /**
@@ -1396,6 +1419,8 @@ export function createWebDriver({ importer, headless = true, playtest = null, pl
1396
1419
  let browser = null;
1397
1420
  let context = null;
1398
1421
  let page = null;
1422
+ // The game's own Ravensight SDK events, read from the track calls the page makes (read only: every call goes out unchanged).
1423
+ const gameEvents = createGameEvents();
1399
1424
  let target = null;
1400
1425
  let runDirectory = null;
1401
1426
  let videoRequested = false;
@@ -2808,6 +2833,8 @@ export function createWebDriver({ importer, headless = true, playtest = null, pl
2808
2833
  // for wraps it and still sees every read.
2809
2834
  if (!touch && typeof context.addInitScript === 'function') await context.addInitScript(virtualGamepadInit);
2810
2835
  if (typeof context.addInitScript === 'function') await context.addInitScript(capabilitySignalsInit);
2836
+ // The game's own SDK events: its track calls are read as they leave the page, never held, changed or answered here.
2837
+ if (typeof context.on === 'function') context.on('request', request => tapSdkEvents(request, gameEvents));
2811
2838
  // The page never leaves the build, recording or not. A top-level
2812
2839
  // navigation off it (a clicked link, a form, a script) is answered with
2813
2840
  // an empty 204, which a browser treats as "stay where you are": the
@@ -3178,6 +3205,19 @@ export function createWebDriver({ importer, headless = true, playtest = null, pl
3178
3205
  * scene it has not seen before (../screenshots.js).
3179
3206
  * @returns {Promise<Buffer>}
3180
3207
  */
3208
+ /** The game's own SDK events this run (../events.js): marked at each input, flushed before the page closes, read by the report. */
3209
+ gameEvents,
3210
+ /** Mark the page clock just before input `step` (or 'end' after play), so each event is placed at the step it happened. */
3211
+ async markGameEvents(step) {
3212
+ if (!page || pendingDialog || gameGone) { gameEvents.mark(step, null); return; }
3213
+ await gameEvents.markPage(page, step).catch(() => gameEvents.mark(step, null));
3214
+ },
3215
+ /** Ask the game's SDK to send what it still holds, as it does when a tab is hidden: only once play and every check after it are done. */
3216
+ async flushGameEvents() {
3217
+ if (!page || pendingDialog || gameGone || gameEvents.size === 0) return null;
3218
+ return gameEvents.flush({ page }).catch(() => null);
3219
+ },
3220
+
3181
3221
  /** any-game hook: whether this browser can run and measure an audio graph: a tone in a blank page of its own, asked once. */
3182
3222
  async soundSelfTest() {
3183
3223
  if (soundTest === null && browser && typeof browser.newContext === 'function') soundTest = await soundSelfTest(browser).catch(() => ({ ok: false, state: 'error', peak: 0, why: 'the audio self test could not run' }));