Skip to content

Commit 6b12297

Browse files
thymikeeclaude
andcommitted
docs(command-runtime): clarify entry load and assembly rationale, guard store write order
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
1 parent 2226b62 commit 6b12297

3 files changed

Lines changed: 11 additions & 4 deletions

File tree

‎packages/command-runtime/src/index.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ import type {
1919
RecordingContactSheetCommandResult,
2020
} from './commands/recording/runtime/contact-sheet.ts';
2121

22-
/** The in-process executor binds only capture, selectors and interaction; other families stay lazy. */
22+
/**
23+
* The in-process executor shares the one construction path with `createAgentDevice`, which binds
24+
* every family for the public surface. This shape binds only capture, selectors and interaction;
25+
* the other families stay lazy.
26+
*/
2327
export type CommandSurfaceAgentDevice = AgentDeviceRuntime & {
2428
capture: BoundCaptureCommands;
2529
selectors: BoundSelectorCommands;

‎src/cli/commands/recording.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ export const recordingCommand: ClientCommandHandler = async ({ positionals, flag
2727
const outputPath =
2828
typeof flags.out === 'string' ? resolveUserPath(flags.out, { cwd: host.cwd }) : undefined;
2929

30-
// Load the capture, selector and interaction entry for this action.
31-
// The contact-sheet wrapper then loads the full runtime on demand.
30+
// The package has one entry, so importing it evaluates the capture, selector and interaction
31+
// bindings; the contact-sheet wrapper then loads the full runtime on demand.
3232
const [{ executeRecordingContactSheet }, { createLocalArtifactAdapter }] = await Promise.all([
3333
import('@agent-device/command-runtime'),
3434
import('../../io.ts'),

‎test/integration/interaction-contract/runtime-harness.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ export function createContractDevice(
5757
policy: localCommandPolicy(),
5858
...(overrides.clock ? { clock: overrides.clock } : {}),
5959
});
60-
void device.sessions.set({ name: 'default', snapshot, ...overrides.sessionState });
60+
// The default store writes in memory, so the session exists before the device is returned.
61+
if (device.sessions.set({ name: 'default', snapshot, ...overrides.sessionState }) !== undefined) {
62+
throw new Error('The default session store must write synchronously');
63+
}
6164
return device;
6265
}
6366

0 commit comments

Comments
 (0)