[runtime] preserve schema-verifiable chained receipts#30
Merged
Conversation
Why: chained verb flows should still produce schema-verifiable receipts when callers omit optional x402 fields or verification cannot reach the remote schema host. Contract impact: none
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.
Motivation
clean→summarize→classify) could produce receipts that fail/verify?schema=1when callers supply partialx402envelopes or when the remote schema host is unreachable.classifyrequired a top-levelactor, which prevented it from participating in the same minimal chained flow shape as other deterministic verbs.Description
normalizeX402Envelopeand used it inhandleVerbso partialx402inputs are normalized to includeverb,version, and a versionedentrybefore signing (keeps receipts schema-compatible).warmValidatorForVerband opportunistic validator warmup so/verify?schema=1can precompile validators for verbs used in chained flows.classify.actorrequirement sodoClassifycan run without anactorand participate in chained flows like other verbs.BUILTIN_SHARED_SCHEMASandgetBuiltinSchema) and a fetch fallback infetchJsonWithTimeoutso AJV can validatev1.1.0receipt schemas when the remoteSCHEMA_HOSTis unreachable.full chain clean -> summarize -> classify verifies with schema using partial x402 defaultstoruntime/tests/runtime-signing.test.mjsthat exercises the full flow and theschema_validassertion.Testing
npm run test:unit -- runtime/tests/runtime-signing.test.mjsand the new regression test passed (all unit checks green).npm test(unit tests +node tests/smoke.mjs) and the suite completed successfully with the new test included.Codex Task