Repository navigation
AutoStory 2D core: scene judges, transitions and interrupts - #361
Conversation
Restores the files commit f4b149c moved out of nav/screen-state, unchanged: Interrupts, Transitions, SceneJudges, FadeProfiles and WarpJudge with their tests. The warp-seen and talk-over cases now live in Pokemon_SceneJudges_Tests rather than back in the core Pokemon_ScreenEvents_Tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
…ts links Pokemon_Direction.cpp) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
|
API review (claude-sonnet-5-5) at 3be04b2: LGTM_with_nits No bugs or hard-rule violations found. The synthetic expectations I spot-checked against the tracker and classifier logic agree (timeout boundary, log overflow, FRLG flash, fade-in-progress). The findings below are judgement-level only: two comments that describe the PR instead of the code, headers split from their definitions, redundant includes, and a few small readability items.
|
…shared expect_equal, frame-name parsing Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
dayfine
left a comment
There was a problem hiding this comment.
Reviewed SHA: ae1941b
Verdict
changes_requested
One defensive-reader bug; everything else is nits. Supersedes the f89bc00 review (LGTM_with_nits) for this SHA.
Bug
- [bug]
Pokemon_Transitions.cpptransition_sample()/TransitionTracker::level_of():TransitionSample::frameis documented "May be empty", andtransition_sample()leavesmiddledefault-constructed (count 0, average and stddev all zero) for an emptyVideoSnapshot.level_of()never checksmiddle.count, so a zero-stat sample satisfiesstddev <= uniform_max_stddev_sum && sum <= dark_max_sumand is classifiedLevel::DARK. Pushing an empty/dropped frame therefore starts or extends a black fade, and a run of them reaches HOLD and later reports a FADE_BLACK warp. The test at Pokemon_Transitions_Tests.cpp:160 only checksmiddle.count == 0; no test pushes an empty sample into the tracker. Fix: treatcount == 0as "no reading" inpush()(ignore the sample, or return std::nullopt without touching phase/m_before), and add a tracker test that interleaves empty frames in a scene and in a hold.
Unverified claim
- [nit] The description says "Code health 0 failures against autostory/engine". I could not reproduce it:
devtools.code_healthis not importable in the review worktree (module absent at this SHA), so I treat the claim as unverified. Say which checkout/command produced it, or drop it. - [nit] "unchanged" for the moved suites: the diff against nav/grid-nav is all additions (17 files, +2254), so I could not check the move against #313's f4b149c with
--color-moved; the description should give that command.
Prior-review nits still apply (not re-listed in full): bare bool on_partial/on_uniform(sample, bool white) (Transitions.cpp), output parameter in add_fade_evidence(const FadeSpan&, Changes&) (Interrupts.cpp:84), sentinel -1 in the SceneJudges test helper, literal ImageFloatBox(0.1, 0.1, 0.8, 0.8) not tied to fade_of_screen(), and lab-run IDs/issue numbers in comments (WarpJudge.h).
Checked and fine: empty-log paths in classify_interrupt (guarded front(), last_frame().value_or), Transition::hold() with unset peak/rise, *m_current.rise in RISING (only reachable after HOLD sets it), *warp.fade->up in the WARPED case (only produced when up is set).
An empty or dropped frame has count 0 and zero stats, which level_of() read as uniform and dark, so it could start or extend a black fade and give a false FADE_BLACK warp. push() now skips such samples. Tests mix empty frames into a scene and into a rise. Also: named bool args, optional beat in the talk-over test, no issue numbers in comments. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Depends on #360 (base nav/grid-nav; the diff shows only this change).
Second 2D core PR: brings back the screen-state pieces only tile games use, which left #313 in f4b149c: Interrupts, Transitions, SceneJudges, FadeProfiles and WarpJudge with the Interrupts and Transitions suites. The warp-seen and talk-over cases that used to sit in the core ScreenEvents suite now live in a new
Pokemon::SceneJudgessuite. Review fix:TransitionTracker::push()ignores samples with no stats, so an empty or dropped frame can no longer start a black fade; the Transitions suite gained empty-frame cases (red before the fix).Testing: headless
SerialProgramsTests(scratch merge of the headless runner, not in this branch),--filterfor Pokemon::Transitions, Pokemon::SceneJudges and Pokemon::Interrupts: all pass. Code health 0 failures:python -m devtools.code_health --base-ref origin/nav/grid-nav --root <worktree>from the agents checkout, at 8e0fa63.🤖 Generated with Claude Code
https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss