Upload native v1 Episodes to Platform - #2278
Merged
Merged
Conversation
mrmoxon
marked this pull request as ready for review
August 6, 2026 20:41
mrmoxon
force-pushed
the
feature/native-v1-platform-upload
branch
from
August 6, 2026 20:47
96eff01 to
9b94ff7
Compare
Contributor
ApprovabilityVerdict: Needs human review This PR changes the upload granularity from one sample per Trace to one sample per Episode, embedding the full native Episode in the Platform API payload. This is a significant behavioral change affecting the external API contract and downstream consumers. You can customize Macroscope's approvability policy. Learn more. |
mrmoxon
force-pushed
the
feature/native-v1-platform-upload
branch
from
August 6, 2026 22:10
9b94ff7 to
1e076ff
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes 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 1e076ff. Configure here.
mikasenghaas
reviewed
Aug 6, 2026
mrmoxon
force-pushed
the
feature/native-v1-platform-upload
branch
from
August 7, 2026 20:58
75716f7 to
0aa7a48
Compare
mikasenghaas
approved these changes
Aug 7, 2026
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
info.native_wrappernemo-gymextra inuv.lockso locked hooks runWhy
The current uploader flattens every native v1 Trace before sending it. Platform can reconstruct part of that structure, but native node identity, branches, trace ordering, and Episode state should be transported intact.
This activates the native path without changing the create → samples → finalize API lifecycle. Oversized Episodes remain uploadable through the existing projected representation.
Architecture
ADR: Native v1 Episode upload compatibility bridge
Validation
Note
Upload one Platform sample per Episode with full Episode payload as native source of truth
platform.py. A summary trace (preferring the first trainable trace) is used for legacy-compatible flat fields, while the full Episode record is stored insample.info['native_wrapper'].Episode.to_record()inepisode.pyto serialize an Episode to a JSON-ready dict, excludingNonevalues and raw trace tensor fields defined byEXCLUDE_FIELDS.json_bytesutility to compute payload size using compact JSON encoding, used for batching logic.Macroscope summarized 0aa7a48.
Note
Medium Risk
Changes the shape and cardinality of Platform sample uploads (episode-level IDs and nested native data) while relying on a size-based fallback; failures during sample build are now swallowed by the best-effort upload path.
Overview
Platform eval uploads now send one sample per v1
Episodeinstead of flattening every trace into its own row. Each sample keeps legacy flat fields from the first trainable trace (or the first trace), setssample_idto the episode id, and addsinfo.native_wrapper(full episode viaEpisode.to_record()) plusnative_trace_indexso older UI can still anchor on a summary trace.Episode.to_record()serializes the episode to JSON while stripping per-trace tensor fields (EXCLUDE_FIELDS), matching trace disk/msgpack behavior.build_samplesmeasures payload size with a sharedjson_byteshelper; if a native episode sample would exceed the 25 MiB API cap, it logs and falls back to the previous per-trace projection.push_tracesnow builds samples inside the upload try/except, and several platform helpers are renamed from private to module-level (credentials,run_metrics,build_samples).Reviewed by Cursor Bugbot for commit 0aa7a48. Bugbot is set up for automated code reviews on this repo. Configure here.