fix(preprocess): start the first preprocess run instead of crashing on 404#71
Merged
Conversation
…hen the table has no status record yet (404)
SimoneBottoni
requested changes
Jul 9, 2026
SimoneBottoni
approved these changes
Jul 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
run_preprocess()turns a freshly-ingested intercept table into the preprocessed form its collection needs before any query can run or be proven. It checks the current preprocess status first and only then starts a run.The problem: a table that has never been preprocessed has no status record yet, so the status endpoint returns 404. That 404 raised straight out of the initial status check and crashed
run_preprocess()before it ever calledstart_preprocess()— so the very first preprocess never happened.Consequence: the collection stayed
is_valid: false(invalid_reason: table_not_preprocessed), and every proof query against it failed —evaluate_handoff()returnedERRORwith an emptyper_claim. On a fresh setup, verification could never succeed.Changes
run_preprocess(), treat a 404 from the initial status check as "not started" and proceed to start the first preprocess run. Any non-404 error still propagates unchanged.Verification
Reproduced against the live backend: on a never-preprocessed table, row-returning queries returned 500 while
COUNT(*)succeeded, and the collection reportedtable_not_preprocessed. Runningstart_preprocessfirst flipped the collection tois_valid: trueand the same row query resolved. With the fix, a full end-to-end run reachesPASSon an honest claim andCAUGHTon a tampered one.