Add producer-owned training captures for harness sessions - #1280
Merged
adithya-s-k merged 5 commits intoSep 30, 2026
Merged
Conversation
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
4 tasks done
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b1f5ebd. Configure here.
Contributor
There was a problem hiding this comment.
Post-merge release note: #1280 shipped in v0.7.0. Exact-head probes at 906c9ae2 (CI and 179 focused tests green) still reproduce these, proposed for 0.7.1:
TrainingTraceacceptsturns=[]and globally all-zero loss masks, so both the generic and Harbor exporters can return a "successful" trace with zero supervised tokens.- Native OpenCode never certifies vLLM
--logprobs-mode processed_logprobs; raw pre-temperature logprobs are exported as trainable. - Native OpenCode drops a failed tool-bearing main call; if a tool-less title call succeeds, structural fallback labels it as agent work and it gets one supervised token.
- The Harbor typed exporter ignores
HarborRolloutResult.ok(acceptsok=Falseempty and supervised traces); TRL #6947 ignores the session exit code, so failed results are exported. - Policy: new public core APIs (
TrainingTurn,TrainingTrace,TrainableSession) and the RFC 006 FATAL-to-WARN change are not yet reflected in RFC 006/012.
Sent by Cursor Automation: Release
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
Add
TrainableSession.fetch_training_trace()with validatedTrainingTraceandTrainingTurnobjects. OpenEnv selects agent calls and supplies required token masks, so trainers can consume captures without turn-selection hooks or token reconstruction. This provides the producer side of the contract discussed in TRL #6947.contract.jsonas Capture audit.choice.token_idsin unary and streamed responses.verify()remains the reward source. Trainers still own advantages, packing and loss weighting. Existing capture classification heuristics remain in place; this does not add rollout-normalized weighting or tree attention.Type of Change
Alignment Checklist
.claude/docs/PRINCIPLES.md.claude/docs/INVARIANTS.mdsrc/andtests/lint passes.RFC Status
Test Plan
Merged current main, including #1273 and the existing deprecation notices from #1276. Earlier broad validation: 778 OpenEnv tests passed across Harbor, UI access controls, CLI, capture, native OpenCode and public imports. After the pairing and empty-ID fixes: 111 targeted OpenEnv tests and 76 TRL compatibility tests passed. The two empty-ID regression cases failed before the fix and pass after it. Changed-file lint, import sorting, formatting, and generated environment docs checks pass.
Tests cover typed UI downloads matching
HarborSessionexactly, legacy audit compatibility, partial and zero masks, eval-only captures, download grants, failed upstream requests, streamed choice IDs and token/logprob mismatches. Dependencies for the new Hub APIs and OAuth tests were isolated from the shared training environment.No live GPU training run was performed for this revision.
Claude Code Review
N/A. Implementation and local checks performed with Codex.
Note
Medium Risk
Changes training data contracts, capture validation severity, and proxy request shaping—areas that affect RL training correctness—but keeps legacy exports and adds strict validation at producer boundaries.
Overview
Introduces a producer-owned training capture API: loop-owning sessions implement
fetch_training_trace()and return validatedTrainingTrace/TrainingTurnobjects (engine token IDs, behavior logprobs, explicit full-sequenceloss_mask, uniquenode_ids). Harbor and native OpenCode wire this through sharedto_training_trace()export; rawfetch_proxy_trace()and the legacy Harbor audit export stay available.Harbor UI splits trainable downloads into Training trace (typed object, matches
HarborSession.fetch_training_trace()) and Capture audit (formercontract.json, including excluded turns). Legacy captures without explicit masks can still audit but cannot emit the strict trace.OpenCode transparent proxy gains optional trainer
sampling(requires proxy mode), forwardsreturn_tokens_as_token_ids/ prompt and completion token IDs through streaming, and builds training traces from proxy JSONL.Capture validation downgrades a single-model-call rollout from FATAL to WARN so verifier scores and valid tokens are not blocked; trainers are steered toward
fetch_training_trace()instead of turn-selection hooks in TRL.Reviewed by Cursor Bugbot for commit b1f5ebd. Bugbot is set up for automated code reviews on this repo. Configure here.