implement-wg-pi-compaction-kick

Implement authoritative WG Pi compaction kick

Metadata

Statusin-progress
Assignedagent-16
Agent identity02e879681e52e0a384106169be043416c4d946e850ab26b2269c57681b52a6e7
Created2026-08-05T20:52:42.575689353+00:00
Started2026-08-06T12:47:35.948396021+00:00
Tagspi, compaction, watchdog, regression
Tokens48466290 in / 94761 out

Description

Objective

Implement the ratified docs/design-pi-compaction-kick.md so an unattended WG Pi task worker that becomes idle after a successful threshold compaction receives one safe continuation kick and resumes the exact unresolved task. Start from the credential-free reproducer and make it RED before production changes.

Requirements:

  • Reuse the existing Pi watchdog/lifecycle continuation authority and first-terminal-wins boundary; do not create a second retry controller.
  • Detect only the designed qualifying threshold-compaction gap. Deliver through Pi’s native extension/session API only after a durable WG permit, with exact action idempotency and acknowledgement.
  • Preserve generation, attempt/fence, worktree lease, exact session/branch, frozen handler/provider/model/reasoning/endpoint, and same process epoch for an in-process nudge.
  • Suppress on terminal/wait receipt, queued messages, active/non-idle agent, overflow retry, manual or failed/aborted compaction, unsafe effects, proof mismatch, and exhausted finite budget.
  • Expose bounded diagnostics in existing wg show / wg pi-watchdog status surfaces.
  • If worksgood-pi/src/** or compat changes, run make embed-worksgood-pi and commit worksgood-pi/embedded/; do not depend on a globally installed extension.
  • Add a permanent grow-only smoke scenario owned by this task which drives the installed WG binary, generated task wrapper, embedded plugin, and Pi JSON/session event path. The pre-fix behavior must fail because no post-compaction turn occurs; the fixed behavior must show exactly one kick followed by a concrete continuation/terminal receipt.

Validation

  • RED-first focused test reproduces successful threshold compaction_end(willRetry=false) -> idle/settled with unresolved WG task and no queued work.
  • Fixed flow emits/delivers/acks exactly one durable kick and the next Pi turn sees the compacted summary and same task/session/route/worktree proof.
  • Crash/restart tests at permit, session-send, acknowledgement, settle, and wrapper-exit boundaries never duplicate prompt, process, budget charge, side effect, owner, attempt, or session.
  • Must-not-trigger tests cover manual, overflow, aborted/failed compaction, queued message, active agent, accepted done/fail/wait, non-WG Pi console/chat, unsafe tool/effect, and budget/proof failures.
  • Existing Pi watchdog, continuation-epoch, native progress/session proof, candidate finalization, and wrapper/convergence tests remain green.
  • Live installed-binary smoke is registered in tests/smoke/manifest.toml with owner implement-wg-pi-compaction-kick and passes without credentials.
  • npm test/typecheck for worksgood-pi, cargo fmt, cargo fmt --check, cargo clippy, focused/full tests, make embed-worksgood-pi when applicable, cargo install --path . --locked, and owned smoke pass.

Depends on

Required by

Messages 6 messages (6 unread)

  1. #1user2026-08-05T20:53:17.566193817+00:00delivered
    Implementation seed only: current Pi 0.83.0 already includes PR #5115 queue draining, so do not patch that. The missing behavior is threshold compaction with an empty queue. Preserve manual/overflow/failed-compaction controls and re-embed plugin if changed.
  2. #2implement-wg-pi-compaction-kick2026-08-06T08:29:58.209727274+00:00read
    Acknowledged implementation seed — I will target only empty-queue successful threshold compaction, preserve manual/overflow/failed controls, and re-embed the plugin after source changes.
  3. #3user2026-08-06T11:59:57.927819619+00:00read
    Recovery context: commit 059c5468 is preserved; the nine dirty files in your exact worktree are the post-FLIP fixes for failed/aborted suppression, crash boundaries, settle persistence, replay refresh fail-closed, summary proof, and must-not-trigger coverage. Inspect/preserve them, complete validation, commit, and resubmit. Prior exit was schema infrastructure, now repaired.
  4. #4implement-wg-pi-compaction-kick2026-08-06T12:48:05.259048888+00:00read
    Acknowledged recovery context — preserving commits 059c5468/4022184b and all current post-review dirty fixes; I will audit, validate, commit, install, and run the owned live smoke.
  5. #5implement-wg-pi-compaction-kick2026-08-06T13:25:14.245040100+00:00read
    Final validation complete in 0f5cbe82; checking the task inbox before handoff as required.
  6. #6implement-wg-pi-compaction-kick2026-08-06T13:25:44.702090088+00:00read
    Done — final validation and the owned installed-flow smoke pass on commit 0f5cbe82; proceeding to the smoke-gated handoff.

Log