feat(agentctl): add replication compact headless journey

runReplicationCompactJourney exercises create-thread, archive, and
_lastReplicationCompact for Phase 644 smoke and live diagnostics.

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
Raven Scott
2026-06-01 21:00:59 -04:00
co-authored by Cursor
parent 812db83b2f
commit d8834a162a
2 changed files with 27 additions and 0 deletions
+2
View File
@@ -25,6 +25,8 @@ Both modes use **`pearcord-ui-flow` `dispatchUiMessage`** — the same handler a
**v0.8.615 (Phase 643):** Mesh churn spans (`guild.mesh.churn`); IPC `get-mesh-stability-stats` / `export-mesh-stability-stats`; offline recovery refreshes discovery mesh. Bundle: `npm run test:phase643-mesh-churn` (chains Phase 642). See [MESH_CHURN.md](../../docs/MESH_CHURN.md).
**v0.8.616 (Phase 644):** `runReplicationCompactJourney` (create thread → archive → sparse compact); UI `archive-thread` IPC wired in thread bar. Bundle: `npm run test:phase644-replication-crdt`.
`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`).
+25
View File
@@ -1060,6 +1060,31 @@ class HeadlessSession {
return { recovery: out, diagnostics }
}
/** Journey: create thread, archive, sparse compact + diagnostics. */
async runReplicationCompactJourney (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')
await this.ipc({ type: 'send-message', content: 'Replication compact journey probe' })
await this.refreshView()
const msgs = this._lastView?.messages || []
const last = msgs[msgs.length - 1]
if (!last?.id) throw new Error('no message for create-thread')
await this.ipc({
type: 'create-thread',
messageId: last.id,
name: 'compact-journey'
})
await this.refreshView()
const threadId = this._lastView?.activeChannelId
if (!threadId) throw new Error('thread not active after create')
await this.platform.archiveThread(threadId, true)
const compact = this.platform._lastReplicationCompact
const diagnostics = this.platform.exportGuildSyncDiagnostics(gid)
await this.refreshView()
return { threadId, compact, diagnostics }
}
/** Journey: sync burst + diagnostics snapshot (mesh stability). */
async runMeshStabilityJourney (guildId) {
if (!this.platform) throw new Error('headless not started')