feat(agentctl): runPartitionHealJourney for split-brain heal

Headless journey injects equal-seq presence conflict, runs partition
heal, and exports diagnostics for Phase 646 verification.

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
Raven Scott
2026-06-01 21:17:35 -04:00
co-authored by Cursor
parent f91ad35354
commit 1b4c1f1b31
2 changed files with 24 additions and 0 deletions
+2
View File
@@ -29,6 +29,8 @@ Both modes use **`pearcord-ui-flow` `dispatchUiMessage`** — the same handler a
**v0.8.617 (Phase 645):** `runLargeGuildMemberJourney` (seed 120+ members → partial bundle → member page request); IPC `request-member-page`. Bundle: `npm run test:phase645-large-guild-mesh`. See [LARGE_GUILD_MESH.md](../../docs/LARGE_GUILD_MESH.md).
**v0.8.618 (Phase 646):** `runPartitionHealJourney` (split-brain presence → heal → diagnostics); IPC `run-partition-heal-sync`. Bundle: `npm run test:phase646-partition-heal`. See [PARTITION_HEAL.md](../../docs/PARTITION_HEAL.md).
`AgentClient` resolves RPC replies before treating `{ event: "state" | "sidecar" }` push lines as events (fixes `wait-event` responses that include an `event` field).
**v0.8.574 (Phase 611):** Headless `createThreadFromLastMessage` `refreshView` re-verified for threads hub bundle. Bundle: `npm run test:agentctl-phase611-threads` (chains `test:agentctl-phase484-threads`).
+22
View File
@@ -1085,6 +1085,28 @@ class HeadlessSession {
return { threadId, compact, diagnostics }
}
/** Journey: simulate split-brain presence + run partition heal. */
async runPartitionHealJourney (guildId) {
if (!this.platform) throw new Error('headless not started')
const gid = guildId || this.platform.guild?.guild?.id
if (!gid) throw new Error('no guild')
const userId = 'partition-test-user'
const t0 = Date.now()
await this.platform._ingestPresenceVectorBundle(gid, [
{ userId, status: 'idle', at: t0 - 5000, vectorSeq: 7 }
])
await this.platform._ingestPresenceVectorBundle(gid, [
{ userId, status: 'dnd', at: t0, vectorSeq: 7 }
])
const map = this.platform._presenceVectorByGuild.get(gid)
const before = map?.get(userId)?.status
const heal = await this.platform.runPartitionHealSync({ source: 'agentctl' })
const after = map?.get(userId)?.status
const diagnostics = this.platform.exportGuildSyncDiagnostics(gid)
await this.refreshView()
return { before, after, heal, diagnostics }
}
/** Journey: seed large roster, partial bundle, member page burst + diagnostics. */
async runLargeGuildMemberJourney (guildId, memberCount = 120) {
if (!this.platform) throw new Error('headless not started')