Skip to content

Commit 528cfc6

Browse files
alexbastubaclaude
andcommitted
Re-pin four tests/ui assertions to the values the new defaults produce
A scoped exception to chunk 10a's ownership boundary: main must not be pushed red, and deferring a behavioural fix into a merge commit is the pattern that produced both bad merges on 2026-09-07. Only the four failing assertions are touched — no matcher loosened, no test deleted, no other line in tests/ui/**, and nothing under src/ui, src/demo, src/styles, index.html or tests/browser. Every value below was read from a run, not computed by hand. describe-diff.test.ts "describes what raising the investigation minimum duration actually did" and parameters-panel.test.ts "the diff badge": both pinned `strategy serial → random`. Under D58's rules the "after" analysis has longestAdjacentRun 2 on holes [9,10], which clears serialMinRun 2, so both sides are now serial and the badge reads `strategy unchanged`. The rest of each assertion — −7 investigations, the total-errors clause — is untouched and still agrees with the metrics beside it, which is what the tests are for. describe-diff.test.ts "reports the quadrant time": 78.21 → 78.11 s and 178.37 → 178.27 s. "reports the smoothed path and the mean speed": 391.30 → 390.91 cm and 254.94 → 254.87 cm. Both moved by exactly the two frames D60 no longer fills; the mean-speed clause in the same test was already right and is unchanged. Also: PARAMETER_DECISIONS pointed the five strategy thresholds at O7 and the two gap-filling ones at O10, both of which now read "Superseded by" in decisions.md, so the parameters panel and the XLSX sheet were sending a reader to a superseded entry. They now name D58 and D60. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AiWHKiDDceNzuJdtFpcPkP
1 parent 56777b9 commit 528cfc6

6 files changed

Lines changed: 37 additions & 22 deletions

File tree

‎README.md‎

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,11 @@ npm run typecheck
8181
npm run build # static site in dist/, deployable as-is
8282
```
8383

84-
`npm test` runs 1,090 unit tests. Most cover the pure layers — metrics, event detection,
85-
cleaning, strategy, maze geometry, the export writers, the session file and the MP4 parser; a
86-
smaller set covers the DOM-free parts of the interface. Sixteen skip
87-
without `BARNESTRACK_SAMPLE_DIR` (below); fifteen of those are the sample-video tests and one skips
88-
for its own reason, so pointing that variable at the clips leaves a single skip. At the time of
89-
writing four fail: three in
90-
`tests/ui/components/describe-diff.test.ts` and one in `parameters-panel.test.ts`, all pinning
91-
numbers and a strategy class that the search-strategy and gap-filling defaults changed on
92-
2026-09-07. They are the interface chunk's to re-pin and are listed here rather than quietly
93-
excluded.
84+
`npm test` runs 1,090 unit tests, all passing. Most cover the pure layers — metrics, event
85+
detection, cleaning, strategy, maze geometry, the export writers, the session file and the MP4
86+
parser; a smaller set covers the DOM-free parts of the interface. Sixteen skip without
87+
`BARNESTRACK_SAMPLE_DIR` (below); fifteen of those are the sample-video tests and one skips for its
88+
own reason, so pointing that variable at the clips leaves a single skip and 1,089 passing.
9489

9590
Two optional extras:
9691

‎docs/known-limitations.md‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,22 @@ session it is found (D39).
2020
is honest; the exported number is not obviously wrong to a reader who does not open the card.
2121
Smallest fix: flag when the marked frame's last positioned event point is within the entry radius
2222
of a hole that is not the target, naming that hole — a second branch beside the one D57 added.
23+
- **The two halves of the definitions panel read differently.** Since chunk 10a the 24 parameter
24+
definitions end in their unit alone, while every metric definition still ends in a decision id —
25+
"…never from frame 0 (seconds; O5)." — because `tests/ui/review-format.test.ts` pins
26+
`METRIC_DEFINITIONS[key]` to `/\(.+; [OD]\d+\)\.$/` and that file belongs to the interface
27+
chunk. A user reading the panel sees this project's internal numbering on one half and not the
28+
other. Smallest fix: strip the suffixes from `METRIC_DEFINITIONS`, give `METRIC_DECISIONS` an
29+
explicit table as `PARAMETER_DECISIONS` now has, and re-point that assertion.
30+
- **`gapFilling.enabled` is not a `trials.csv` column, though `gap_fill_max_duration_s` is.** D60
31+
made the on/off switch the load-bearing one — filling is off by default — and the column set
32+
carries only the ceiling it would apply if it were on. Two cohorts differing solely in that
33+
setting are distinguishable by `parameters_hash` and by `parameters.json`, both of which travel
34+
in every export, so nothing is unreconcilable; but a reader comparing threshold columns alone
35+
sees identical rows. Not fixed here because a new column means regenerating
36+
`skills/barnestrack-cohort/SKILL.md` and its binding test for a value the hash already covers.
37+
Smallest fix: a `gap_fill_enabled` bool column in `thresholdColumns()`
38+
(`src/export/rows.ts`) and `TRIAL_COLUMN_META`, plus that regeneration.
2339
- **Every maze nudge re-derives the whole cohort, from a step the user is not looking at.** The app
2440
shell refreshes every step on every store notification, and the Review step re-derives whatever
2541
the store invalidated so its figures and its export line are not left claiming that analysed

‎src/analysis/parameters.ts‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -205,19 +205,20 @@ const ANALYSIS_PARAMETER_DECISIONS: Record<AnalysisParameterPath, string> = {
205205
trialCutoff_s: 'O5',
206206
'targetQuadrant.holeSpan': 'O6',
207207
kinematicsSmoothingWindowFrames: 'O9',
208-
'gapFilling.enabled': 'O10',
209-
'gapFilling.maxDuration_s': 'O10',
208+
// D60 superseded O10, D58 superseded O7: the panel must not name a superseded entry
209+
'gapFilling.enabled': 'D60',
210+
'gapFilling.maxDuration_s': 'D60',
210211
'kinematics.speedWindowFrames': 'O11',
211212
'kinematics.duplicateTimestampFactor': 'O11',
212213
'kinematics.dropGapFactor': 'O11',
213214
noseConfidenceCutoff: 'O16',
214215
outlierVelocityThreshold_cmPerS: 'O17',
215216
'trialCensoring.censorToCutoff': 'O5',
216-
'strategy.spatialMaxErrors': 'O7',
217-
'strategy.spatialMaxHoleDistance': 'O7',
218-
'strategy.spatialMaxCentreCrossings': 'O7',
219-
'strategy.serialMinRun': 'O7',
220-
'strategy.centreZoneRadiusFraction': 'O7',
217+
'strategy.spatialMaxErrors': 'D58',
218+
'strategy.spatialMaxHoleDistance': 'D58',
219+
'strategy.spatialMaxCentreCrossings': 'D58',
220+
'strategy.serialMinRun': 'D58',
221+
'strategy.centreZoneRadiusFraction': 'D58',
221222
'quality.goodMinPositionedFraction': 'D30',
222223
'quality.poorMaxPositionedFraction': 'D30',
223224
};

‎tests/analysis/parameters.test.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,10 @@ describe('definitions', () => {
109109
}
110110
// the strategy rules cite Gawel et al. 2019, Table 1 rather than D58
111111
expect(PARAMETER_DEFINITIONS['strategy.serialMinRun']).toContain('Gawel et al. 2019, Table 1');
112-
expect(PARAMETER_DECISIONS['strategy.serialMinRun']).toBe('O7');
112+
// the decision each default *now* comes from: O7 and O10 were superseded by D58 and D60, and
113+
// the panel must not send a reader to a superseded entry
114+
expect(PARAMETER_DECISIONS['strategy.serialMinRun']).toBe('D58');
115+
expect(PARAMETER_DECISIONS['gapFilling.enabled']).toBe('D60');
113116
expect(PARAMETER_DECISIONS['quality.goodMinPositionedFraction']).toBe('D30');
114117
expect(PARAMETER_DECISIONS['trialCensoring.censorToCutoff']).toBe('O5');
115118
});

‎tests/ui/components/describe-diff.test.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ describe('describeDiff over a real re-derivation', () => {
352352
expect(sentence).toContain(
353353
`total errors ${before.metrics.totalErrors} → ${after.metrics.totalErrors}`,
354354
);
355-
expect(sentence).toContain('strategy serial → random');
355+
expect(sentence).toContain('strategy unchanged');
356356
});
357357

358358
it('reports the quadrant time, which only the quadrant span moves', () => {
@@ -364,7 +364,7 @@ describe('describeDiff over a real re-derivation', () => {
364364
targetQuadrant: { holeSpan: 9.5 },
365365
}));
366366
expect(after.metrics.targetQuadrantTime_s).toBeGreaterThan(before.metrics.targetQuadrantTime_s);
367-
expect(describeDiff(before, after)).toContain('target quadrant time 78.21 s → 178.37 s');
367+
expect(describeDiff(before, after)).toContain('target quadrant time 78.11 s → 178.27 s');
368368
});
369369

370370
it('reports the smoothed path and the mean speed, which only the filter width moves', () => {
@@ -373,7 +373,7 @@ describe('describeDiff over a real re-derivation', () => {
373373
kinematicsSmoothingWindowFrames: 31,
374374
}));
375375
const sentence = describeDiff(before, after);
376-
expect(sentence).toContain('smoothed path length 391.30 cm → 254.94 cm');
376+
expect(sentence).toContain('smoothed path length 390.91 cm → 254.87 cm');
377377
expect(sentence).toContain('mean speed 2.19 cm/s → 1.43 cm/s');
378378
});
379379

‎tests/ui/components/parameters-panel.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ describe('the diff badge', () => {
433433
);
434434
const badge = container.querySelector('.diff-badge')!;
435435
expect(badge.textContent).toContain('−7 investigations');
436-
expect(badge.textContent).toContain('strategy serial → random');
436+
expect(badge.textContent).toContain('strategy unchanged');
437437
panel.destroy();
438438
});
439439

0 commit comments

Comments
 (0)