audit-wg-pi-compaction-continuation-seams

Audit WG Pi compaction continuation seams

Metadata

Statusdone
Agent identity02e879681e52e0a384106169be043416c4d946e850ab26b2269c57681b52a6e7
Created2026-08-05T20:52:42.385721234+00:00
Started2026-08-06T05:24:26.224657198+00:00
Completed2026-08-06T05:59:16.337158090+00:00
Tagspi, compaction, watchdog, research

Description

Objective

Audit the current WG implementation to locate the correct authority and delivery seam for a post-compaction kick. Trace the real task-worker path from generated wrapper -> pi --mode json -> embedded @worksgood/pi extension -> raw stream observer -> PiWatchdog -> lifecycle/convergence/finalization.

Pay special attention to whether compaction_start/end, queue updates, summarization retries, agent_end, and agent_settled are projected today; whether returned ActionKinds are consumed or discarded; whether the stock continuation prompt is appended as a non-context custom entry versus actually delivered to Pi; and how terminal/wait receipts and process/continuation epochs suppress further work. Compare plugin-level, wrapper-level, RPC/JSON harness-level, and WG watchdog-level placement.

Write docs/research/wg-pi-compaction-continuation-seams.md with a sequence diagram, current gaps, security/idempotency constraints, and recommended ownership. Do not implement the fix.

Validation

  • Every claim cites current file/function/line evidence.
  • Demonstrate whether the existing watchdog currently causes a real Pi turn after threshold compaction or only records state/session markers.
  • Identify the exact current-process/session/route/attempt proof available at each candidate seam.
  • Explain how a fix composes with first-terminal-wins, finite continuation budget, wrapper exit, and convergence without creating a new attempt or retry domain.
  • git diff --check passes and the report names the minimal production/test files likely to change.

Depends on

Required by

Messages 2 messages (2 unread)

  1. #1user2026-08-05T20:53:17.121579118+00:00delivered
    Initial audit lead: src/pi_watchdog/mod.rs ingest_native_value currently maps turn/message/tool/agent_settled but not compaction_start/end, queue_update, or current summarization_retry_* event names. src/commands/pi_stream_bridge.rs observe_live calls ingest_native_line but ignores returned ActionKind. PiWatchdog::emit_completion_prompt appends a custom session marker; no production consumer of ActionKind::LaunchSameSession/AppendCompletionPrompt was found by rg. Verify rather than assume.
  2. #2audit-wg-pi-compaction-continuation-seams2026-08-06T05:38:00.056624889+00:00read
    Completed the requested verification: report confirms missing event projection, discarded ActionKinds, non-context marker-only behavior, and recommends watchdog authority plus plugin delivery. Artifact committed as d8c9f6dc.

Log