Add Phase 656 agentctl journeys for global presence and dm-meta.
Headless runGlobalPresenceTwoPeerJourney and runHyperDbDmMetaMigrationJourney support autonomous Phase 656 regression testing. 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 656 (v0.8.630):** Headless `runGlobalPresenceTwoPeerJourney`, `runHyperDbDmMetaMigrationJourney`; smokes `test:agentctl-global-presence-phase656`, `test:agentctl-dm-meta-phase656`, `test:quick-switcher-phase656`.
|
||||
|
||||
**Phase 655 (v0.8.629):** Headless `runDmPinsAndReactionJourney`, `runDmOpenWithGuildsJourney`, `openHome`; smokes for pins, guild-heal, companion DM sidebar.
|
||||
|
||||
**Phase 655 (v0.8.628):** Headless `runDmFriendOpenComposerFocusJourney`, `runGroupDmRenameJourney`; smokes `test:agentctl-dm-friend-focus-phase655`, `test:agentctl-group-rename-phase655`. Prior: `runDmSidebarSearchJourney` (v0.8.627).
|
||||
|
||||
+38
@@ -731,6 +731,44 @@ class HeadlessSession {
|
||||
return { guildCount: (v.guilds || []).length, channelId: v.activeChannelId }
|
||||
}
|
||||
|
||||
/** Phase 656: global presence snapshot after status broadcast. */
|
||||
async runGlobalPresenceTwoPeerJourney () {
|
||||
if (!this.platform) throw new Error('headless not started')
|
||||
await this.platform.setPresence('online', 'global mesh journey')
|
||||
const v = await this.refreshView()
|
||||
if (!v.globalPresence) throw new Error('expected globalPresence in view')
|
||||
if (v.globalPresence.enabled === false) {
|
||||
throw new Error('global presence mesh disabled')
|
||||
}
|
||||
const stats = v.contacts?.stats || {}
|
||||
if (stats.globalPresenceEnabled === false) {
|
||||
throw new Error('contacts global presence disabled')
|
||||
}
|
||||
return {
|
||||
peerCount: v.globalPresence.peerCount,
|
||||
topicCount: v.globalPresence.topicCount || stats.globalPresenceTopics || 0
|
||||
}
|
||||
}
|
||||
|
||||
/** Phase 656: HyperDB dm-meta materialization smoke. */
|
||||
async runHyperDbDmMetaMigrationJourney (peerUserId, peerDisplayName) {
|
||||
if (!this.platform) throw new Error('headless not started')
|
||||
await this.openDmWithPeer(peerUserId, peerDisplayName)
|
||||
const vOpen = await this.refreshView()
|
||||
const metaStore = this.platform.dm?._metaStore || (await this.platform._ensureDmMetaStore())
|
||||
const openRow = await metaStore.get(vOpen.activeChannelId)
|
||||
if (!openRow?.peerUserId && !(openRow?.participantIds || []).includes(peerUserId)) {
|
||||
throw new Error('expected dm meta row after dm open')
|
||||
}
|
||||
await this.sendDmMessage('hyperdb-meta-marker')
|
||||
const v = await this.refreshView()
|
||||
const row = await metaStore.get(v.activeChannelId)
|
||||
if (!row?.lastMessagePreview?.includes('hyperdb-meta')) {
|
||||
throw new Error(`expected preview in dm meta, got ${row?.lastMessagePreview || 'null'}`)
|
||||
}
|
||||
return { engine: v.dmMetaEngine, channelId: v.activeChannelId, preview: row.lastMessagePreview }
|
||||
}
|
||||
|
||||
async exportGuildAuditLog (opts = {}) {
|
||||
if (!this.platform) throw new Error('headless not started')
|
||||
const out = await this.platform.exportAuditLog(opts)
|
||||
|
||||
Reference in New Issue
Block a user