feat(agentctl): runGuildMeshTriplePinsJourney for Phase 805
3-peer pin journey with channelPinIncludes matchers on both guests. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -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 805 (v0.8.772):** `runGuildMeshTriplePinsJourney` (3-peer pins). Bundle: `npm run test:ci-phase805`.
|
||||
|
||||
**Phase 804 (v0.8.771):** `runGuildMeshTripleSoundJourney` (3-peer soundboard). Bundle: `npm run test:ci-phase804`.
|
||||
|
||||
**Phase 803 (v0.8.770):** `runGuildMeshTripleStickerJourney` (3-peer custom sticker). Bundle: `npm run test:ci-phase803`.
|
||||
|
||||
+66
@@ -4803,6 +4803,72 @@ class HeadlessSession {
|
||||
}
|
||||
}
|
||||
|
||||
/** Phase 805: 3-peer mesh — host pin visible on both guests. */
|
||||
async runGuildMeshTriplePinsJourney () {
|
||||
const { connectGuildMeshTriple } = require('./mesh-helpers')
|
||||
const token = `mesh805_${Date.now()}`
|
||||
const base = path.join(os.tmpdir(), `pearcord-agentctl-pins805-${Date.now()}`)
|
||||
const host = new HeadlessSession({ storagePath: path.join(base, 'host') })
|
||||
const guest1 = new HeadlessSession({ storagePath: path.join(base, 'guest1') })
|
||||
const guest2 = new HeadlessSession({ storagePath: path.join(base, 'guest2') })
|
||||
await host.start()
|
||||
await guest1.start()
|
||||
await guest2.start()
|
||||
try {
|
||||
await host.registerUser({ username: 'pnhost805', displayName: 'Pin Host 805' })
|
||||
await host.createGuild({ name: 'Pins Triple 805', publicListing: false })
|
||||
await host.wait({ mode: 'guild' }, 45000)
|
||||
const invite = await host.platform.createInvite().catch(() => null)
|
||||
const code = invite?.shareCode || invite?.code
|
||||
if (!code) throw new Error('host invite missing')
|
||||
await guest1.registerUser({ username: 'pnguest805a', displayName: 'Pin Guest 805a' })
|
||||
await guest2.registerUser({ username: 'pnguest805b', displayName: 'Pin Guest 805b' })
|
||||
await guest1.ipc({ type: 'join-invite', code })
|
||||
await guest2.ipc({ type: 'join-invite', code })
|
||||
await guest1.wait({ mode: 'guild' }, 45000)
|
||||
await guest2.wait({ mode: 'guild' }, 45000)
|
||||
const chId = (await host.refreshView()).activeChannelId
|
||||
if (!chId) throw new Error('active channel missing')
|
||||
await guest1.ipc({ type: 'select-channel', channelId: chId })
|
||||
await guest2.ipc({ type: 'select-channel', channelId: chId })
|
||||
await guest1.wait({ activeChannelId: chId }, 30000)
|
||||
await guest2.wait({ activeChannelId: chId }, 30000)
|
||||
await connectGuildMeshTriple(
|
||||
host.platform,
|
||||
guest1.platform,
|
||||
guest2.platform,
|
||||
50000
|
||||
)
|
||||
await host.wait({ meshPeersMin: 1 }, 30000)
|
||||
await guest1.wait({ meshPeersMin: 1 }, 30000)
|
||||
await guest2.wait({ meshPeersMin: 1 }, 30000)
|
||||
await host.sendGuildMessage(token)
|
||||
await guest1.wait({ activeChannelMessagesMin: 1 }, 90000)
|
||||
await guest2.wait({ activeChannelMessagesMin: 1 }, 90000)
|
||||
const hv = await host.refreshView()
|
||||
const msg = (hv.messages || []).find((m) => String(m.content || '').includes(token))
|
||||
if (!msg?.id) throw new Error('host message missing')
|
||||
await host.platform.pinMessage(msg.id)
|
||||
for (const p of [host.platform, guest1.platform, guest2.platform]) {
|
||||
if (typeof p.requestGuildSyncFanout === 'function') {
|
||||
p.requestGuildSyncFanout()
|
||||
}
|
||||
}
|
||||
await guest1.wait({ channelPinIncludes: msg.id }, 90000)
|
||||
await guest2.wait({ channelPinIncludes: msg.id }, 90000)
|
||||
const g1v = await guest1.refreshView()
|
||||
const g2v = await guest2.refreshView()
|
||||
const hit1 = (g1v.pins || []).find((p) => p.messageId === msg.id)
|
||||
const hit2 = (g2v.pins || []).find((p) => p.messageId === msg.id)
|
||||
if (!hit1 || !hit2) throw new Error('guest missing channel pin on triple mesh')
|
||||
return { messageId: msg.id, pinCount: (g1v.pins || []).length }
|
||||
} finally {
|
||||
await host.close()
|
||||
await guest1.close()
|
||||
await guest2.close()
|
||||
}
|
||||
}
|
||||
|
||||
/** Phase 792: 2-peer mesh — host pin visible in guest channel pins. */
|
||||
async runGuildMeshPinsJourney () {
|
||||
const { connectGuildMeshPeers } = require('./mesh-helpers')
|
||||
|
||||
Reference in New Issue
Block a user