Add protocol-aware trajectory capture and tokenization#756
Draft
bradhilton wants to merge 9 commits into
Draft
Conversation
971cb1b to
39a165b
Compare
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.
Summary
TypedDicts with known native SDK fields plus arbitrary extension fields, and responses as native OpenAI/Anthropic modelsTrajectory/TrajectoryGroupscopes and coroutine helpers while preserving legacy trajectory/group construction behind deprecationsDesign
art.trajectories.__init__is the public interface; transport, protocol, scope, compatibility, serialization, and tokenization details live in private modulesextra_items=Anypreserves provider and Caladan extensionsexchange.modelis a serialized computed property derived from the request first and response second, so stored metadata cannot diverge from the captured wire objectsNaNonly when fallback tokenization cannot recover a logproballow_training_without_logprobs=True; prompt-tokenNaNs remain expectedmodel,base_model, chat template, and template kwargs override inferred values; W&B checkpoint metadata and tokenizer defaults provide best-effort inferenceAdversarial hardening
Independent Codex and Claude Fable 5 reviews found no P0, then drove focused fixes:
choice.indexecho=Trueuntil their multi-history/masking semantics are implemented correctly/v1-less compatible endpoint pathsTrajectoryGroupgenerators exactly once while retaining the deprecated awaitable overloadCompatibility and scope
TrajectoryGroupconstruction, and the awaitable group overload remain supportedauto_trajectoryandcapture_auto_trajectoryremain as deprecated aliases>=0.77.0, the first verified version exposing the streaming accumulator imports used by captureValidation
ty 0.0.59caladan-trajectory-validation/trajectory-capture-0714Open integration decisions
Trajectory.messages()need an explicitly chosen protocol-history/view API; no public view is added in this PR yetstagingand preserves exchange payloads, but serverless must pin the merged ART revision before exchange preprocessing is operationalReview focus
A separate Caladan change will correct the Qwen vLLM tool-parser mismatch found by strict multi-turn validation. Serverless-training compatibility is tracked in coreweave/serverless-training#283.