Skip to content

Commit 85f9c85

Browse files
authored
Inspect Sidekick exchanges and recorded XMD feedback (#1340)
* Inspect saved Sidekick exchanges and feedback * Align Sidekick exchange and feedback details with reviewed layouts * Assert Sidekick feedback before later table output
1 parent 90d1cdb commit 85f9c85

13 files changed

Lines changed: 1028 additions & 94 deletions

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<WhenPrompt template="{?context}Initialize this Sidekick for an ACP attachment.{?rest}" />
2+
3+
<Let as="ready" select="code">
4+
```xmd
5+
<Output>Conversation fixture ready.</Output>
6+
```
7+
</Let>
8+
{ready}
9+
10+
<WhenPrompt template={"{?context}The person says:\n\nReview checkout."} />
11+
12+
<Let as="read" select="code">
13+
```xmd
14+
<REPL.Environment />
15+
```
16+
</Let>
17+
{read}
18+
19+
<WhenPrompt template="Host facts, as they stand at this moment:{?environment}- working directory:{?after}" />
20+
21+
<Let as="submit" select="code">
22+
````xmd
23+
<Let as="entry" select="code">
24+
```xmd
25+
<Output>Checkout output witness.</Output>
26+
```
27+
</Let>
28+
<REPL.EntryInput>{entry}</REPL.EntryInput>
29+
<REPL.Submit />
30+
````
31+
</Let>
32+
{submit}
33+
34+
<WhenPrompt template="{?before}Entry entry-1 completed.{?details}Checkout output witness.{?after}" />
35+
36+
<Let as="done" select="code">
37+
```xmd
38+
<Output>Checkout review complete.</Output>
39+
```
40+
</Let>
41+
{done}
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
<Cwd as="checkout" />
2+
<Let as="fixtureRoot" value={checkout + "/examples/repl-bench/fixtures"} />
3+
4+
<Test name="#931 a Sidekick exchange groups three real turns and lets the reader inspect them" timeout="75s">
5+
<Terminal columns={160} rows={36}>
6+
<XMD.Repl scenario={fixtureRoot + "/repl-ui-conversation.md"} waitTimeout="20s" expectExit={true} as="closed">
7+
<Repl.Focus.Message />
8+
<Terminal.Type text="Review checkout." />
9+
<Terminal.Key key="Enter" />
10+
<Terminal.WaitForText text="Checkout review complete." />
11+
<XMD.Repl.EntryOutput entry={1} as="entry" />
12+
<AssertEquals actual={entry.status} expected="completed" />
13+
<AssertStringIncludes actual={entry.text} expected="Checkout output witness." />
14+
<Terminal.Region name="transcript">
15+
<Terminal.WaitForText text="[U] Review checkout." />
16+
<Terminal.WaitForText text="[S] Checkout review complete." count={1} />
17+
<Terminal.WaitForText text="[X] Round 1 result sent" as="feedback" />
18+
</Terminal.Region>
19+
<Terminal.Screenshot name="finished-exchange" />
20+
21+
<Terminal.Click at={feedback} />
22+
<Terminal.WaitForText text="Show recorded feedback" />
23+
<Terminal.Click at={feedback} />
24+
<Terminal.WaitForText text="Show recorded feedback" present={false} />
25+
<Terminal.Click at={feedback} />
26+
<Terminal.WaitForText text="Show recorded feedback" />
27+
<Terminal.Key key="Enter" />
28+
<Terminal.WaitForText text="Entry entry-1 completed." />
29+
<Terminal.WaitForText text="Hide recorded feedback" />
30+
<Terminal.Screenshot name="recorded-feedback" />
31+
<Terminal.Key key="Escape" />
32+
<Terminal.WaitForText text="Hide recorded feedback" present={false} />
33+
34+
<Terminal.Region name="transcript">
35+
<Terminal.WaitForText text="[S] Checkout review complete." as="reply" />
36+
</Terminal.Region>
37+
<Terminal.Click at={reply} />
38+
<Terminal.WaitForText text="linked entry Round 1" as="wholeLink" />
39+
<Terminal.WaitForText text="Checkout review complete." row={wholeLink.row + 2} as="shownOutput" />
40+
<Terminal.WaitForText text="SAVED TURNS" as="savedHeading" />
41+
<AssertEquals actual={Math.sign(savedHeading.row - shownOutput.row)} expected={1} />
42+
<Terminal.Screenshot name="exchange-with-output" />
43+
<Terminal.Click at={wholeLink} />
44+
<Terminal.WaitForText text="SAVED TURNS" present={false} />
45+
<Terminal.WaitForText text="Entries › Entry 1" />
46+
<Terminal.Click at={reply} />
47+
<Terminal.WaitForText text="Turn 2" as="savedTurn" />
48+
<Terminal.Click at={savedTurn} />
49+
<Terminal.WaitForText text="saved turn 2 of 3" />
50+
<Terminal.WaitForText text="Turn 2 · this turn · prompted by [X]" as="currentTurn" />
51+
<Terminal.WaitForText text="REPL.Environment result" row={currentTurn.row + 1} />
52+
<Terminal.WaitForText text="linked entry Round 1" />
53+
<Terminal.Screenshot name="saved-turn-2" />
54+
<Terminal.WaitForText text="DRAFT" present={false} />
55+
<Repl.Focus.Draft />
56+
<Terminal.WaitForText text="saved turn 2 of 3" present={false} />
57+
<Terminal.WaitForText text="DRAFT" />
58+
<Terminal.Type text="visible-draft-witness" />
59+
<Terminal.WaitForText text="visible-draft-witness" />
60+
61+
<Terminal.Resize columns={120} rows={30} />
62+
<Terminal.WaitForText text="HISTORY" row={29} />
63+
<Terminal.WaitForText text="[S] Checkout review complete." as="mediumReply" />
64+
<Terminal.Click at={mediumReply} />
65+
<Terminal.WaitForText text="Turn 2 · prompted by [X]" as="mediumTurn" />
66+
<Terminal.WaitForText text="REPL.Environment result" row={mediumTurn.row + 1} />
67+
<Terminal.Screenshot name="wrapped-turns" />
68+
<Terminal.Click at={mediumTurn} />
69+
<Terminal.WaitForText text="saved turn 2 of 3" />
70+
<Terminal.WaitForText text="Turn 2 · this turn" />
71+
<Terminal.WaitForText text="linked entry Round 1" as="savedLink" />
72+
<Terminal.Click at={savedLink} />
73+
<Terminal.WaitForText text="saved turn 2 of 3" present={false} />
74+
<Terminal.WaitForText text="Entries › Entry 1" />
75+
76+
<Terminal.Resize columns={72} rows={20} />
77+
<Terminal.WaitForText text="HISTORY" row={19} />
78+
<Repl.Focus.Message />
79+
<Terminal.WaitForText text="↳ [X] Round 1 result sent" as="narrowFeedback" />
80+
<Terminal.Click at={narrowFeedback} />
81+
<Terminal.WaitForText text="Show recorded feedback" />
82+
<Terminal.WaitForText text="Outcome · ✓ COMPLETED" />
83+
<Terminal.WaitForText text="Output · Checkout output witness." />
84+
<Terminal.WaitForText text="Esc closes · Tab moves · PageUp/PageDown in Content" row={18} />
85+
<Terminal.WaitForText text="Entry entry-1 completed." present={false} />
86+
<Terminal.Screenshot name="narrow-feedback-drawer" />
87+
<Terminal.WaitForText text="linked entry Round 1" as="linked" />
88+
<Terminal.Click at={linked} />
89+
<Terminal.WaitForText text="* Entries" row={1} />
90+
<Terminal.WaitForText text="Show recorded feedback" present={false} />
91+
<Terminal.Resize columns={160} rows={36} />
92+
<Terminal.WaitForText text="[exit]" row={35} as="exit" />
93+
<Terminal.Click at={exit} />
94+
</XMD.Repl>
95+
<AssertEquals actual={closed.exitCode} expected={0} />
96+
<XMD.Repl resume={closed.resume}>
97+
<Terminal.Region name="transcript">
98+
<Terminal.WaitForText text="[S] Checkout review complete." count={1} />
99+
</Terminal.Region>
100+
<Terminal.WaitForText text="1 ✓" />
101+
<Terminal.WaitForText text="2 ✓" present={false} />
102+
<Terminal.Region name="transcript">
103+
<Terminal.WaitForText text="[X] Round 1 result sent" as="reopenedFeedback" />
104+
</Terminal.Region>
105+
<Terminal.Click at={reopenedFeedback} />
106+
<Terminal.WaitForText text="Show recorded feedback" />
107+
<Terminal.Key key="Enter" />
108+
<Terminal.WaitForText text="Entry entry-1 completed." />
109+
</XMD.Repl>
110+
</Terminal>
111+
</Test>

0 commit comments

Comments
 (0)