feat(trace): give the cassette lane a schema, including the conversation fields - #596
Open
HappyDevs1 wants to merge 2 commits into
Open
HappyDevs1 wants to merge 2 commits into
HappyDevs1 wants to merge 2 commits into
Conversation
…ion fields Multi-turn conversations (#375) added `delivery_index` and `deliveries` to the cassette, but the cassette had no JSON Schema at all - the fields existed only as Rust structs, so nothing a consumer could validate against described the on-disk shape. Plan 012 called for adding one if the cassette turned out to be serde-only. It was. cassette-v1.schema.json describes the lane only, following the side-effect lane's precedent rather than attempting the whole agent-trace document. The conformance test pins the property the multi-turn work rests on: both new fields are absent at their defaults, so every cassette recorded before they existed still validates.
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.
Part 1 of 3 closing out #375.
Why
Multi-turn conversations (#584) added
delivery_indexanddeliveriesto the cassette, but the cassette has no JSON Schema at all — those fields exist only as Rust structs. #375 lists "the JSON Schema ... in the same change" as an acceptance criterion, andplans/012-agent-multiturn-conversations.mdexplicitly said to add a schema if the cassette turned out to be serde-only. It is.What
crates/flowproof-trace/schema/cassette-v1.schema.json— describes thecassettelane only, followingside-effect-v1.schema.json's precedent rather than attempting the wholeAgentTracedocument.crates/flowproof-trace/tests/cassette_conformance.rs— mirrorsside_effect_conformance.rs. Pins the load-bearing property: both new fields are absent at their defaults, so every pre-conversation:cassette still validates.docs/trace-format.md— a "Cassette lane" section documenting both fields. Moves with the schema, as the ratchet requires.The doc states the window invariant the way
validate_delivery_windowsactually enforces it: windows tile the turn list exactly (contiguous, non-empty, dense, nothing outside a window), which is what stops a timeout or early exit from minting a passing cassette.Test plan
cargo test -p flowproof-trace— 4 new tests pass, 92 total green.cargo fmt --checkandcargo clippy -p flowproof-trace --all-targets -- -D warningsclean.delivery_index, an unknown dialect, adeliveriesentry missingturn_count, and unknown keys.