• Stefy Lanza (nextime / spora )'s avatar
    say which configuration served the page, and stop reporting a confidence nobody measured (v0.5.1) · 2df41192
    Stefy Lanza (nextime / spora ) authored
    Both found by reading the output of a real page through a real pod, which is
    the only place either was visible.
    
    WHICH CONFIGURATION. A pod answers with the engine it ran, because the
    configuration ids in ocr.engine_configs are an orchestrator-side naming layer
    it has never heard of. So `engine=surya-layout` came back `engine: surya`, same
    as plain surya -- and telling two configurations of one engine apart in the
    answer is most of the point of having two ids. The local path already reported
    the id; now both do, and a plain engine name still reports itself.
    
    A CONFIDENCE NOBODY MEASURED. surya's table recogniser does not score cells in
    the mode we call it in, so every cell carried `conf: 0.0` -- a placeholder
    wearing a measurement's clothes, which is the confusion `confidence_measured`
    already exists to prevent for pages. The key is now present only when surya
    reported a number, and the table says `confidence_measured` so a caller gating
    on cell confidence can tell whether there is anything to gate on. Presence
    decides it rather than truthiness, because a real 0.0 IS a measurement.
    
    Table markup likewise: `html` is absent rather than empty, so "this engine
    returns no HTML" (surya, which returns cells) is distinguishable from "this
    table's HTML is empty".
    
    Two of the tests written for this asserted against a fixed byte window after a
    `def`, and failed on the correct edit that grew the function -- the same
    brittleness fixed in test_image_edit_uses_an_image_pipeline an hour earlier.
    They read the function by AST now.
    Co-Authored-By: 's avatarClaude Opus 5 <noreply@anthropic.com>
    Claude-Session: https://claude.ai/code/session_01S8LAP3ueNzQJtwzhgVbq66
    2df41192
test_ocr_engine_configs_and_layout.py 18.1 KB