feat(agentctl): add DM poll vote journey

Add `runDmPollVoteJourney` to validate single-choice replacement and
multi-select retention behavior in headless DM sessions.

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
Raven Scott
2026-06-02 03:20:57 -04:00
co-authored by Cursor
parent dbac96077c
commit 580545891c
2 changed files with 25 additions and 0 deletions
+2
View File
@@ -2,6 +2,8 @@
Agent control plane for Pearcord — send the same IPC messages the UI sends, read `view` snapshots, and run scripted journeys against a **live worker** or an in-process **headless** session.
**Phase 659 (v0.8.638):** Added `runDmPollVoteJourney` to verify DM single-choice and multi-select poll vote behavior; smoke `test:agentctl-dm-poll-phase659`.
**Phase 658 (v0.8.638):** Added DM thread closure journeys: `runDmThreadArchiveJourney` (archive/unarchive state) and `runDmThreadP2PAuditJourney` (topic audit). Smokes: `test:agentctl-dm-thread-archive-phase658`, `test:agentctl-dm-thread-p2p-audit-phase658`.
**Phase 656 (v0.8.631):** `runDmVoiceLiveJourney`, `runGroupDmAddMemberJourney`; smokes `test:agentctl-dm-voice-live-phase656`, `test:agentctl-group-add-member-phase656`.
+23
View File
@@ -906,6 +906,29 @@ class HeadlessSession {
return { count: out.count, nonP2PCount: out.nonP2PCount || 0 }
}
async runDmPollVoteJourney (peerUserId, peerDisplayName) {
if (!this.platform) throw new Error('headless not started')
await this.openDmWithPeer(peerUserId, peerDisplayName)
const single = await this.sendDmMessage('/poll Lunch? | Pizza | Sushi | Salad')
if (!single?.id) throw new Error('expected dm single poll message')
await this.platform.voteDmPoll(single.id, 0)
await this.platform.voteDmPoll(single.id, 1)
await this.refreshView()
const rxSingle = this._lastView?.reactions?.[single.id] || {}
if (rxSingle['1️⃣']?.me) throw new Error('single poll should clear prior vote')
if (!rxSingle['2️⃣']?.me) throw new Error('single poll should keep last vote')
const multi = await this.sendDmMessage('/pollm Ship today? | Yes | No | Later')
if (!multi?.id) throw new Error('expected dm multi poll message')
await this.platform.voteDmPoll(multi.id, 0)
await this.platform.voteDmPoll(multi.id, 1)
await this.refreshView()
const rxMulti = this._lastView?.reactions?.[multi.id] || {}
if (!rxMulti['1️⃣']?.me || !rxMulti['2️⃣']?.me) {
throw new Error('multi poll should allow selecting multiple options')
}
return { singleMessageId: single.id, multiMessageId: multi.id }
}
async runDmVideoLiveJourney (peerUserId, peerDisplayName) {
if (!this.platform) throw new Error('headless not started')
await this.openDmWithPeer(peerUserId, peerDisplayName)