Phase 791: runGuildMeshStickerJourney and guildStickerCount diagnostics.
Two-peer mesh journey verifies remote custom sticker appears in guest view. 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 791 (v0.8.758):** `runGuildMeshStickerJourney` (2-peer custom sticker gossip). Bundle: `npm run test:ci-phase791`.
|
||||
|
||||
**Phase 790 (v0.8.757):** `runGuildMeshEmojiJourney` (2-peer custom emoji gossip). Bundle: `npm run test:ci-phase790`.
|
||||
|
||||
**Phase 789 (v0.8.756):** `runGuildMeshReactionsJourney` (2-peer reaction gossip). Bundle: `npm run test:ci-phase789`.
|
||||
|
||||
@@ -329,6 +329,14 @@ function matchView (view, spec) {
|
||||
if (hit) return false
|
||||
continue
|
||||
}
|
||||
if (key === 'guildStickerNamed') {
|
||||
const needle = String(expected).toLowerCase()
|
||||
const hit = (view?.guildStickers || []).some(
|
||||
(s) => String(s?.name || '').toLowerCase() === needle
|
||||
)
|
||||
if (!hit) return false
|
||||
continue
|
||||
}
|
||||
if (key === 'auditLogIncludesAction') {
|
||||
const needle = String(expected)
|
||||
const hit = (view?.auditLog || []).some((e) =>
|
||||
|
||||
+46
@@ -4803,6 +4803,52 @@ class HeadlessSession {
|
||||
}
|
||||
}
|
||||
|
||||
/** Phase 791: 2-peer mesh — host custom sticker visible in guest guildStickers. */
|
||||
async runGuildMeshStickerJourney () {
|
||||
const { connectGuildMeshPeers } = require('./mesh-helpers')
|
||||
const token = `mesh791-${Date.now()}`
|
||||
const base = path.join(os.tmpdir(), `pearcord-agentctl-sticker791-${Date.now()}`)
|
||||
const host = new HeadlessSession({ storagePath: path.join(base, 'host') })
|
||||
const guest = new HeadlessSession({ storagePath: path.join(base, 'guest') })
|
||||
await host.start()
|
||||
await guest.start()
|
||||
try {
|
||||
await host.registerUser({ username: 'sthost791', displayName: 'Sticker Host 791' })
|
||||
await host.createGuild({ name: 'Sticker Mesh 791', 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 guest.registerUser({ username: 'stguest791', displayName: 'Sticker Guest 791' })
|
||||
await guest.ipc({ type: 'join-invite', code })
|
||||
await guest.wait({ mode: 'guild' }, 45000)
|
||||
await connectGuildMeshPeers(host.platform, guest.platform, 45000)
|
||||
await host.upsertGuildSticker({
|
||||
name: token,
|
||||
description: 'Mesh 791 sticker',
|
||||
image: {
|
||||
data: Buffer.from(
|
||||
'R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7',
|
||||
'base64'
|
||||
),
|
||||
filename: `${token}.gif`,
|
||||
mimeType: 'image/gif'
|
||||
}
|
||||
})
|
||||
if (typeof host.platform.requestGuildSyncFanout === 'function') {
|
||||
host.platform.requestGuildSyncFanout()
|
||||
}
|
||||
await guest.wait({ guildStickerNamed: token }, 90000)
|
||||
const gv = await guest.refreshView()
|
||||
const hit = (gv.guildStickers || []).find((s) => s.name === token)
|
||||
if (!hit) throw new Error('guest missing custom sticker')
|
||||
return { stickerName: token }
|
||||
} finally {
|
||||
await host.close()
|
||||
await guest.close()
|
||||
}
|
||||
}
|
||||
|
||||
/** Phase 790: 2-peer mesh — host custom emoji visible in guest guildEmojis. */
|
||||
async runGuildMeshEmojiJourney () {
|
||||
const { connectGuildMeshPeers } = require('./mesh-helpers')
|
||||
|
||||
@@ -44,6 +44,7 @@ function snapshotWaitDiagnostics (view, match) {
|
||||
Number(view?.guildSyncHealthRail?.[view?.guild?.id]?.retryCountdownMs) || 0,
|
||||
reactionMessageCount: Object.keys(view?.reactions || {}).length,
|
||||
guildCustomEmojiCount: (view?.guildEmojis || []).filter((e) => !e.builtin).length,
|
||||
guildStickerCount: view?.guildStickers?.length ?? 0,
|
||||
sessionReady: !!view?.sessionReady,
|
||||
workerPoll: view?.workerPoll || null,
|
||||
viewBuildStats: view?.viewBuildStats || null
|
||||
|
||||
Reference in New Issue
Block a user