Skip to content

[runtime] Short-circuit cached-only /verify schema checks early#37

Open
GsCommand wants to merge 1 commit intomainfrom
codex/fix-/verify-endpoint-to-short-circuit-validation
Open

[runtime] Short-circuit cached-only /verify schema checks early#37
GsCommand wants to merge 1 commit intomainfrom
codex/fix-/verify-endpoint-to-short-circuit-validation

Conversation

@GsCommand
Copy link
Contributor

Motivation

  • Cold schema compilation was blocking POST /verify?schema=1 long enough to cause client aborts instead of returning the documented fast 202 warmup response.

Description

  • Move extraction of verb and add an early cached-only guard in POST /verify (in server.mjs) so that when wantSchema && VERIFY_SCHEMA_CACHED_ONLY && !hasValidatorCached(verb) the endpoint immediately enqueues warmup work and returns 202 with validator_not_warmed_yet before any schema fetch or AJV compilation happens.
  • Remove the later cached-only branch from the in-flow schema validation so cold compilation paths cannot start before the short-circuit decision.
  • Preserve existing proof/hash/signature verification behavior and only short-circuit schema-related work; add reason: "validator_not_warmed_yet" to the warmup response for the chain test retry path.

Testing

  • Ran npm run check and the syntax check passed.
  • Ran targeted unit tests with node --test runtime/tests/runtime-signing.test.mjs and all tests passed.
  • Ran full test suite with npm test (unit + smoke) and all tests passed.

Codex Task

Why: cold schema compiles were delaying /verify responses long enough to trigger client aborts instead of returning the documented 202 warmup response.
Contract impact: none
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant