fix-pi-native-progress-session-proof

Restore Pi native activity and canonical session proof

Metadata

Statusdone
Assignedagent-921
Modelpi:openai-codex:gpt-5.6-sol
Created2026-07-27T21:08:32.802600940+00:00
Started2026-07-27T22:21:27.681554099+00:00
Completed2026-07-27T23:43:21.622203046+00:00
Tokens21783581 in / 38210 out

Description

Objective

Fix the false-stuck Pi monitoring and duplicate-session proof defect exposed by implement-strong-agent attempt attempt-0-19. Status/TUI must report bounded native activity from Pi events and exact continuation must resolve the substantive journal unambiguously.

Incident evidence

  • raw_stream.jsonl contained more than 1,500 message/turn/tool events and exceeded 12 MiB while watchdog status remained phase=Unknown, progress_seq=0, event_seq=0, no tool, no token activity, and 17+ minutes of alleged silence.
  • The session directory contained both a 146-byte wg_<session>.jsonl bootstrap header and a growing substantive timestamped journal for the same session ID; watchdog pinned the header-only path/leaf.
  • This duplicates the earlier implement-crash-safe exact-session ambiguity that required archival reconciliation.

Requirements

  • Establish one canonical session journal/leaf per launch. If Pi creates a bootstrap header plus substantive journal, select and attest the substantive append-only journal deterministically; preserve bootstrap bytes as evidence without treating them as a second resumable session.
  • Reject genuinely ambiguous multiple substantive journals fail-closed. Do not delete or silently rewrite session evidence.
  • Bridge Pi NDJSON message/turn/tool/usage activity into watchdog native_activity and monotonic progress/activity counters in real time, including current bounded tool label/class, child/receipt state, output/thinking activity counts, and Pi usage receipts.
  • Never expose raw chain-of-thought or attacker-controlled content in status/TUI; only bounded labels, counts, timestamps, and digests.
  • Make soft suspicion depend on the ratified meaningful-progress classes while clearly showing live-but-unproven native activity; total runtime is still not a deadline.
  • Exact-session continuation must preserve session ID, route, worktree, attempt/fence/lease, and the attested substantive leaf.

Validation

  • Fake-Pi emits a bootstrap header, substantive journal, text/thinking/tool/usage events, and a long build tool; status/TUI updates live with monotonic bounded counts and does not call it silent.
  • One header-only plus one substantive journal resumes exactly; two substantive matches refuse loudly; no bytes are deleted.
  • Restart/replay deduplicates repeated stream snapshots and usage receipts without resetting progress or double-counting cost.
  • No raw reasoning or unbounded payload appears in JSON/text/TUI status.
  • Existing Pi watchdog human flow, exact-session continuation, crash-safe finalization, accounting, and plugin smokes pass.
  • cargo fmt --check, cargo clippy, focused/full tests and owned smoke pass; commit/push and wg done complete normally.

Depends on

Required by

Log