Files
vscode/extensions/copilot/test/base/simulationOptions.spec.ts
T
68e1826dff nes: fix: compose complete recording oracles (#329454)
* nes: fix: compose complete workspace recording oracles

Compose raw workspace changes before applying the configurable disjoint-edit limit. Include accepted completion chains and omit targets that are later continued across recording, generated, idle, or cursor boundaries.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: f23381fa-6246-44d2-a0a3-167c28272a57

* nes: fix: group nearby workspace recording edits

Treat cursor moves as soft oracle boundaries when user-intent edits continue nearby in the same document. Preserve distant and idle cursor boundaries so coherent multi-edit episodes remain grouped without crossing into unrelated work.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: f23381fa-6246-44d2-a0a3-167c28272a57

* nes: fix: omit empty workspace oracles

Drop workspace-recording candidates whose collected operations compose to no net edit, such as typing and then deleting the same character.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: f23381fa-6246-44d2-a0a3-167c28272a57

* nes: fix: share composed oracle policy across formats

Apply compose-before-limit oracle collection to alternative-action and continuous inputs, including idle and cursor locality boundaries, no-op filtering, restore handling, and parallel CLI propagation. Preserve workspace-specific source classification and end-of-recording rules.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: f23381fa-6246-44d2-a0a3-167c28272a57

---------

Co-authored-by: Dmitriy Vasyura <dmitriv@microsoft.com>
Copilot-Session: f23381fa-6246-44d2-a0a3-167c28272a57
2026-08-06 23:23:59 +00:00

35 lines
1.4 KiB
TypeScript

/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { describe, expect, it } from 'vitest';
import { DEFAULT_NES_DATAGEN_ORACLE_EDIT_LIMIT, SimulationOptions } from './simulationOptions';
describe('SimulationOptions nes-datagen', () => {
it('parses the workspace recording oracle edit limit', () => {
const defaults = SimulationOptions.fromArray(['node', 'simulate', 'nes-datagen', '--input', 'recording.jsonl']);
const configured = SimulationOptions.fromArray(['node', 'simulate', 'nes-datagen', '--input', 'recording.jsonl', '--max-oracle-edits', '3']);
expect({
defaultValue: defaults.nesDatagen?.maxOracleEdits,
configuredValue: configured.nesDatagen?.maxOracleEdits,
}).toEqual({
defaultValue: DEFAULT_NES_DATAGEN_ORACLE_EDIT_LIMIT,
configuredValue: 3,
});
});
it('rejects a non-positive workspace recording oracle edit limit', () => {
expect(() => SimulationOptions.fromArray([
'node',
'simulate',
'nes-datagen',
'--input',
'recording.jsonl',
'--max-oracle-edits',
'0',
])).toThrow('--max-oracle-edits must be a positive integer');
});
});