• Stefy Lanza (nextime / spora )'s avatar
    call the accessor by its real name, and check that workers' helpers exist (v0.5.0) · 903195bc
    Stefy Lanza (nextime / spora ) authored
    The layout pass read its per-page option with `_opt("layout", True)`. The
    accessor is `_page_override`. A pod answered
    
        500 {"detail": "surya ocr failed: name '_opt' is not defined"}
    
    after the image was built, pushed, signed and booted, because nothing executes
    these modules until a page reaches a pod: `codai/ocr/workers/*` run OUTSIDE the
    package -- the surya worker in its own venv, forbidden from importing codai --
    so no test had ever run a line of them. The test I wrote for the layout pass
    asserted the SOURCE STRING of that call and proved only that the text was
    there.
    
    So the fix comes with a guard that would have caught it: every `_`-prefixed
    name a worker module loads must be bound somewhere in that module. Those are
    the module's own helpers, so an unbound one is a typo and not a global from
    elsewhere. Pure ast + builtins -- no linter, nothing added to requirements --
    and it is checked against the bug itself, because a checker that passes
    everything is worse than none.
    Co-Authored-By: 's avatarClaude Opus 5 <noreply@anthropic.com>
    Claude-Session: https://claude.ai/code/session_01S8LAP3ueNzQJtwzhgVbq66
    903195bc
Name
Last commit
Last update
codai Loading commit data...
docs Loading commit data...
packaging Loading commit data...
samples Loading commit data...
tests Loading commit data...
third_party Loading commit data...
tools Loading commit data...
.dockerignore Loading commit data...
.gitignore Loading commit data...
AI.PROMPT Loading commit data...
CODERAI_API_DOCUMENTATION.md Loading commit data...
CoderAI.gif Loading commit data...
DISTRIBUTION.md Loading commit data...
LICENSE.md Loading commit data...
MULTIMODAL_CAPABILITIES.md Loading commit data...
MULTIMODAL_UI_EXAMPLES.md Loading commit data...
README.md Loading commit data...
REQUEST-geoclip-embeddings.md Loading commit data...
REQUEST-vpr-embeddings.md Loading commit data...
amdgpu-coredump-05000.bin Loading commit data...
build-oci.sh Loading commit data...
build.ps1 Loading commit data...
build.sh Loading commit data...
coderai Loading commit data...
coderai-broker-implementation-reference.md Loading commit data...
coderai-integration.md Loading commit data...
commands Loading commit data...
osxbuild.sh Loading commit data...
package-oci.sh Loading commit data...
package-tarball.sh Loading commit data...
requirements-crisperwhisper.txt Loading commit data...
requirements-h3.txt Loading commit data...
requirements-longcat-train.txt Loading commit data...
requirements-longcat.txt Loading commit data...
requirements-melotts.txt Loading commit data...
requirements-nemo.txt Loading commit data...
requirements-nvidia.txt Loading commit data...
requirements-ocr-paddle.txt Loading commit data...
requirements-ocr.txt Loading commit data...
requirements-pyannote.txt Loading commit data...
requirements-surya.txt Loading commit data...
requirements-vllm.txt Loading commit data...
requirements-vulkan.txt Loading commit data...
requirements.txt Loading commit data...
run-oci.sh Loading commit data...
smoke-test-oci.sh Loading commit data...
todo.md Loading commit data...