nes-datagen: capture cross-file next edits (xtab-cross-file sample task)#323168
Open
g1910 wants to merge 2 commits into
Open
nes-datagen: capture cross-file next edits (xtab-cross-file sample task)#323168g1910 wants to merge 2 commits into
g1910 wants to merge 2 commits into
Conversation
Previously the pipeline only labeled same-file next edits. This adds support for cross-file targets: bucket post-request edits per document, compose per-file replacements, resolve each target file's request-time content, and generate multi-file CustomDiffPatch responses. Adds an optional --patch-order (first-touch|anchor-first) option.
…ta by --patch-order Synthetic, oracle-based e2e (xtabCrossFilePipeline.e2e.spec.ts + xtabCrossFileFixtureData.ts) covering the multi-file CustomDiffPatch label, --patch-order block ordering (first-touch vs anchor-first), targetFiles/targetFilePaths/isCrossFile metadata, and the xtab single-file fallback. Also makes buildXtabCrossFileClassification take the patch-ordered target list so metadata matches the label block order.
a68c2f4 to
aa63015
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request extends the nes-datagen training-data simulation pipeline in extensions/copilot/test/pipeline/ to support a new xtab-cross-file sample task that can label the “next edit” across multiple files, including ordering control via --patch-order, and emits corresponding per-file metadata.
Changes:
- Adds
xtab-cross-filetask selection +--patch-orderoption to simulation CLI options. - Buckets post-request edits across files, reconstructs request-time content per file, and generates multi-file
CustomDiffPatchassistant labels. - Adds an end-to-end test and synthetic fixture data to validate multi-file labeling, ordering policies, and the single-file
xtabfallback.
Show a summary per file
| File | Description |
|---|---|
| extensions/copilot/test/base/simulationOptions.ts | Adds xtab-cross-file task and --patch-order option parsing/help text. |
| extensions/copilot/test/pipeline/alternativeAction/types.ts | Extends NextUserEdit to include per-file composed edits (fileEdits). |
| extensions/copilot/test/pipeline/alternativeAction/processor.ts | Buckets post-request edits by file, composes per-file replacements, preserves first-touch order. |
| extensions/copilot/test/pipeline/replayRecording.ts | Captures targetFileEdits with request-time content per touched file for label generation. |
| extensions/copilot/test/pipeline/responseStep.ts | Introduces multi-file response generation for CustomDiffPatch labels. |
| extensions/copilot/test/pipeline/pipeline.ts | Dispatches xtab-cross-file, orders target files (first-touch/anchor-first), wires response + metadata classification. |
| extensions/copilot/test/pipeline/output.ts | Adds discriminated-union classification payload for cross-file metadata. |
| extensions/copilot/test/pipeline/test/xtabCrossFilePipeline.e2e.spec.ts | New e2e test validating multi-file label ordering + metadata + xtab fallback. |
| extensions/copilot/test/pipeline/test/fixtures/xtabCrossFileFixtureData.ts | Synthetic fixture recordings for cross-file and anchor-only scenarios. |
Review details
- Files reviewed: 9/9 changed files
- Comments generated: 2
- Review effort level: Low
Comment on lines
+433
to
+438
| for (const file of nonEmptyFiles) { | ||
| const result = generateResponse(responseFormat, file.edit, file.docContent, file.filePath, input.userPrompt, log); | ||
| if (!('error' in result) && result.assistant) { | ||
| blocks.push(result.assistant); | ||
| } | ||
| } |
Comment on lines
+186
to
190
| const targets = crossFile | ||
| ? orderTargetFiles(p.targetFileEdits, p.activeFilePath, patchOrder) | ||
| : p.targetFileEdits.filter(f => f.relativePath === p.activeFilePath); | ||
| const files = targets.map(f => ({ filePath: f.relativePath, docContent: f.docContent, edit: f.edit })); | ||
| responseInputs.push({ |
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
Extends the
nes-datagensimulation pipeline to produce cross-file next-edittraining samples via a new
xtab-cross-filesample task. Until now the pipeline onlylabeled the next edit inside the active file; this captures edits that span multiple files.
For each recording the pipeline now:
filename:linepatch block per touched file).targetFiles/targetFilePaths/isCrossFilein the sample metadata,ordered to match the response blocks.
A new
--patch-orderoption (first-touch(default) |anchor-first) controls per-fileblock ordering.
What changed
Pipeline:
test/base/simulationOptions.ts—xtab-cross-filetask +--patch-orderoption, with validation and help text.test/pipeline/alternativeAction/processor.ts,types.ts— bucket multi-file edits into per-filefileEdits[].test/pipeline/replayRecording.ts— expose each target's request-time content (targetFileEdits).test/pipeline/responseStep.ts— multi-file CustomDiffPatch generation (anchor-only fallback when not cross-file).test/pipeline/pipeline.ts— task dispatch +orderTargetFiles(first-touch / anchor-first).test/pipeline/output.ts— discriminated-unionSampleClassificationarm carrying cross-file metadata.Tests:
test/pipeline/test/xtabCrossFilePipeline.e2e.spec.ts+test/pipeline/test/fixtures/xtabCrossFileFixtureData.ts— synthetic, oracle-based e2e covering the multi-file label,
--patch-orderordering,cross-file metadata, and the
xtabsingle-file fallback. No model/network calls.How to test
From
extensions/copilot/:All pipeline suites pass (87 passed, 1 skipped), including the new
xtab-cross-filecases.Generate cross-file samples from a recording:
(
--config-filemust include...xtabProvider.modelConfiguration; output defaults to<input>_output.jsonl.)Notes
xtab; existingxtab/cursor-*tasks are unchanged.