Skip to content

Commit e1020a2

Browse files
test(output-economy): reuse shared fixtures in routine-workflow oracle
Address review finding #2 on #1190: chain the workflow onto the shared per-surface fixtures instead of copy-pasting them. - orient/recheck reuse SNAPSHOT_RESULT + SNAPSHOT_DAEMON_RESULT; the first mutation reuses SETTLE_ADDED_REF_RESULT, so session identity and ref generations come from ./fixtures.ts and the two suites cannot drift. - Only the genuinely workflow-specific pieces remain local: the unchanged recheck, a tail retargeted onto a settled-diff ref (SETTLE_TAIL_RESULT taps an unsurfaced @e6 and can't chain), the in-session timeout failure, and its recovered retry. routine-workflow.ts drops ~110 LOC. - Rendered-output ref guard preserved: @E5 (settled diff) and @e7 (tail) surface only from formatter output; recovery semantics unchanged. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
1 parent bd6f7f5 commit e1020a2

3 files changed

Lines changed: 88 additions & 160 deletions

File tree

‎test/output-economy/output-economy.baseline.json‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -112,24 +112,24 @@
112112
"shape": "$.content:array|$.content[].text:string|$.content[].type:string|$.content[]:object|$.isError:boolean|$.structuredContent.identifiers.session:string|$.structuredContent.identifiers:object|$.structuredContent.nodes:array|$.structuredContent.nodes[].depth:number|$.structuredContent.nodes[].enabled:boolean|$.structuredContent.nodes[].hittable:boolean|$.structuredContent.nodes[].identifier:string|$.structuredContent.nodes[].index:number|$.structuredContent.nodes[].label:string|$.structuredContent.nodes[].parentIndex:number|$.structuredContent.nodes[].rect.height:number|$.structuredContent.nodes[].rect.width:number|$.structuredContent.nodes[].rect.x:number|$.structuredContent.nodes[].rect.y:number|$.structuredContent.nodes[].rect:object|$.structuredContent.nodes[].ref:string|$.structuredContent.nodes[].role:string|$.structuredContent.nodes[].type:string|$.structuredContent.nodes[].value:string|$.structuredContent.nodes[]:object|$.structuredContent.refsGeneration:number|$.structuredContent.truncated:boolean|$.structuredContent.visibility.partial:boolean|$.structuredContent.visibility.reasons:array|$.structuredContent.visibility.totalNodeCount:number|$.structuredContent.visibility.visibleNodeCount:number|$.structuredContent.visibility:object|$.structuredContent:object|$:object"
113113
},
114114
"workflow.orient.cli.text": {
115-
"bytes": 471,
115+
"bytes": 154,
116116
"lines": 6,
117-
"refs": 3,
118-
"hints": 1,
117+
"refs": 4,
118+
"hints": 0,
119119
"shape": "text"
120120
},
121121
"workflow.orient.mcp.json": {
122-
"bytes": 1294,
122+
"bytes": 1173,
123123
"lines": 1,
124-
"refs": 3,
124+
"refs": 4,
125125
"hints": 0,
126126
"shape": "$.content:array|$.content[].text:string|$.content[].type:string|$.content[]:object|$.isError:boolean|$.structuredContent.identifiers.session:string|$.structuredContent.identifiers:object|$.structuredContent.nodes:array|$.structuredContent.nodes[].depth:number|$.structuredContent.nodes[].enabled:boolean|$.structuredContent.nodes[].hittable:boolean|$.structuredContent.nodes[].identifier:string|$.structuredContent.nodes[].index:number|$.structuredContent.nodes[].label:string|$.structuredContent.nodes[].parentIndex:number|$.structuredContent.nodes[].rect.height:number|$.structuredContent.nodes[].rect.width:number|$.structuredContent.nodes[].rect.x:number|$.structuredContent.nodes[].rect.y:number|$.structuredContent.nodes[].rect:object|$.structuredContent.nodes[].ref:string|$.structuredContent.nodes[].role:string|$.structuredContent.nodes[].type:string|$.structuredContent.nodes[].value:string|$.structuredContent.nodes[]:object|$.structuredContent.refsGeneration:number|$.structuredContent.truncated:boolean|$.structuredContent.visibility.partial:boolean|$.structuredContent.visibility.reasons:array|$.structuredContent.visibility.totalNodeCount:number|$.structuredContent.visibility.visibleNodeCount:number|$.structuredContent.visibility:object|$.structuredContent:object|$:object"
127127
},
128128
"workflow.recheck.cli.text": {
129-
"bytes": 550,
130-
"lines": 4,
129+
"bytes": 193,
130+
"lines": 3,
131131
"refs": 0,
132-
"hints": 1,
132+
"hints": 0,
133133
"shape": "text"
134134
},
135135
"workflow.mutation-confirm.cli.text": {
@@ -140,7 +140,7 @@
140140
"shape": "text"
141141
},
142142
"workflow.mutation-tail.cli.text": {
143-
"bytes": 161,
143+
"bytes": 165,
144144
"lines": 6,
145145
"refs": 3,
146146
"hints": 0,
@@ -154,16 +154,16 @@
154154
"shape": "text"
155155
},
156156
"workflow.failure.shared.json": {
157-
"bytes": 328,
157+
"bytes": 335,
158158
"lines": 1,
159159
"refs": 1,
160160
"hints": 1,
161161
"shape": "$.code:string|$.details.reason:string|$.details.ref:string|$.details.refsGeneration:number|$.details.session:string|$.details.timeoutMs:number|$.details:object|$.hint:string|$.message:string|$.retriable:boolean|$:object"
162162
},
163163
"workflow.retry.cli.text": {
164-
"bytes": 131,
165-
"lines": 5,
166-
"refs": 2,
164+
"bytes": 88,
165+
"lines": 3,
166+
"refs": 1,
167167
"hints": 0,
168168
"shape": "text"
169169
}

‎test/output-economy/routine-workflow.test.ts‎

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,13 @@ describe('routine-workflow output-behavior oracle', () => {
4242
.map((step) => [step.targetRef, step.targetSurfacedBy]),
4343
);
4444
expect(surfacedBy['@e3']).toBe('orient');
45-
expect(surfacedBy['@e4']).toBe('mutation-confirm');
45+
// @e5 (View receipt) exists only in the settled diff's added lines, never in
46+
// the orienting snapshot — so its surfacer proves the rendered diff, not a
47+
// re-observation, handed it over.
4648
expect(surfacedBy['@e5']).toBe('mutation-confirm');
47-
// The removals-only settle's unchanged-interactive tail is the only place
48-
// the Done button (e6) appears before it is tapped.
49-
expect(surfacedBy['@e6']).toBe('mutation-tail');
49+
// @e7 (Continue) first appears in the removals-only settle's unchanged-
50+
// interactive tail, the only place it shows up before it is tapped.
51+
expect(surfacedBy['@e7']).toBe('mutation-tail');
5052
});
5153

5254
test('exactly one recovery retry, driven by an actionable failure', () => {
@@ -62,13 +64,13 @@ describe('routine-workflow output-behavior oracle', () => {
6264
expect(measurement.recoveryPreservesSession).toBe(true);
6365
expect(measurement.recoveryFields).toEqual({
6466
code: 'COMMAND_FAILED',
65-
session: 'checkout',
66-
refsGeneration: 22,
67+
session: 'economy-fixture',
68+
refsGeneration: 14,
6769
retriable: true,
6870
hint: expect.stringContaining('Retry'),
6971
});
7072
// Recovery identity keys on structured details, not on message text.
71-
expect(error.details).toMatchObject({ reason: 'timeout', timeoutMs: 10_000, ref: '@e6' });
73+
expect(error.details).toMatchObject({ reason: 'timeout', timeoutMs: 10_000, ref: '@e7' });
7274
expect(error.retriable).toBe(true);
7375
});
7476

@@ -94,7 +96,7 @@ describe('routine-workflow output-behavior oracle', () => {
9496
orient.samples.mcp && 'data' in orient.samples.mcp ? orient.samples.mcp.data : undefined;
9597
expect(mcp).toMatchObject({
9698
isError: false,
97-
structuredContent: { refsGeneration: 20 },
99+
structuredContent: { refsGeneration: 12 },
98100
content: [{ type: 'text', text: expect.stringContaining('@e3 [button] "Place order"') }],
99101
});
100102
});

0 commit comments

Comments
 (0)