Fix repayments that overcharged, and act on the first Frontier playtest

A debt repayment took its whole instalment even when less was owed: four
dollars owed at the store cost twenty. Content could not express "pay what is
owed", so an add effect's amount may now be read from state, with a cap. Five
repayments across both packs use it, and a conformance test holds every pack to
it. The turn record now says which options were hidden, so the analyser stops
counting doors nobody saw, and it reads only feedback logs.

From the same session: wages are labelled as wages, a clamped change says where
it stopped, two unreadable option labels are rewritten, the sale barn no longer
offers what the player already owns, Ward hints at what the promotion waits for,
and the office has five more events. DECISIONS #38-40.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C6UDQ9o6L6Ey173U7XVou6
This commit is contained in:
JesseMarkowitz
2026-09-15 10:23:15 -04:00
co-authored by Claude Opus 5
parent d84ae495f4
commit 112e558dbb
22 changed files with 723 additions and 90 deletions
+13 -3
View File
@@ -17,11 +17,18 @@ import { fileURLToPath } from 'node:url';
const root = resolve(dirname(fileURLToPath(import.meta.url)), '..');
const logsDir = resolve(root, 'logs');
/** The most recently modified log in logs/, when none was named. */
/**
* The most recently modified feedback log in logs/, when none was named.
*
* Feedback logs only. A save export is a .json too, and a playtester who
* exports both — as the first one to do so did — would otherwise have the save
* read as a log whenever it was the later of the two.
*/
async function newestLog() {
let names;
try {
names = (await readdir(logsDir)).filter((name) => name.endsWith('.json'));
names = (await readdir(logsDir))
.filter((name) => name.startsWith('theladder-feedback-') && name.endsWith('.json'));
} catch {
return null;
}
@@ -130,7 +137,10 @@ function reportGates(entries) {
const blocked = new Map();
for (const entry of entries) {
for (const option of entry.offered ?? []) {
if (option.available) continue;
// A hidden option was never on screen, so it was never a door anybody
// met. Logs from before 0.3.4 do not record `hidden`, and still count
// such options here. See DECISIONS #39.
if (option.available || option.hidden) continue;
const reasons = (option.failed ?? [])
.map((c) => `${c.path} ${c.op} ${JSON.stringify(c.value)}`)
.join(', ') || 'unstated';