# Changelog

All notable changes to this project are documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.2.1] - 2026-08-02

### Fixed

- **Top-level session isolation (B031):** goals are fenced to their owning Pi session within each repository. Foreign sessions stay read-only; ownership changes only through `/goal resume --takeover`.

## [0.2.0] - 2026-07-23

### Fixed

- **Inert inside subagent sessions** (B031): pi-subagents runs child sessions in-process with extensions enabled and the same cwd; the extension used to activate there too — restoring the parent's cwd-keyed goal on `session_start` and injecting goal messages into the subagent's conversation. Now stays fully inert (no tools, commands, or handlers) when loaded at pi-subagents extension depth > 0.
- **Planner wait timeout no longer silent-degrades** (B024/B025/B027/B028): after a planner subagent is spawned, wait timeout is fail-closed (`planning_failed` / pause), stops the orphaned agent, and never baselined a structural skeleton as success. Late planner results after stop are intentionally ignored.
- **Degraded kickoff reason honesty** (B026): kickoff copy distinguishes ping/spawn/agent failure from true unavailability; timeout never reaches execute kickoff.
- **`plannerTimeoutMs`** (B029, default 30m) separate from panel `subagentsTimeoutMs` (default 10m).
- **`plannerReason` on planning events** (B030): `planning_completed` / `planning_failed` / `goal_start` include reason codes.

### Added

- **Planner inherits parent session context** (B023): spawn with `inheritContext` / `inherit_context` (pi-subagents parent-conversation fork), plus optional parent-branch text handoff via `extractParentContextText` when `sessionManager` is present; degraded path unchanged (same parent session).
- **Progress milestones** in kickoff/rules: require `update_goal(message)` at `researched` / `implementing` / `pre-complete` (B005).
- **Lifecycle events** for dogfood/debug: `planning_*`, `goal_start`, `progress`, `verify_started` (always), `verify_not_achieved`, `verify_achieved`, `goal_completed`, `verify_paused`; kind table in README (B006).
- **Statusline planner agent id** during planning (`◎ plan <shortId>` via optional `plannerAgentId` on orchestration) (B018).
- **Goal-kind verify policy** (B020): `selectSkepticN` / `resolveSkepticNForVerify` — analysis/research → N=1, code-change → N=3; read kind from plan.md on `completed:true`; documented in README.
- **Harness contract test** (B021): `tests/harness-contract.test.ts` with memory bus + `installMockSubagentsRpc` asserts `goal_set` → planning → `goal_start` → `verify_started` → complete order.
- **Skeptic panel on critical path** for `update_goal(completed:true)`: after preverify + evidence gate, spawn N verifiers (config `skepticN`), wait, `parseVerifierVerdict` + `aggregateVerdicts` before Achieved; emit `verify_started` with agent ids before waits (B011/B015).
- **Completion UX**: notify + display summary with objective, receipt path, reload hint; track completed goal ids so no further continuation injects (B007/B012).
- `src/loop/panel.ts` + mock multi-spawn helpers for CI without live LLMs.
- **Planner via pi-subagents** on `/goal` start: protocol-v2 RPC client, `runPlanner` (Explore subagent → write `plan.md`, fail soft to structural draft), baseline refresh after plan, `completePlanning` → execute kickoff (no full draft paste).
- **Full goal harness (Phase 0–3 core)**
  - Pure `GoalTracker` FSM (`src/tracker.ts`) with pause/resume/stall/cap/blocked
  - Plan contract: `src/plan/*` → `plan.md` + baseline under `.pi/goal/<id>/`
  - `/goal` lifecycle + `update_goal` + `goal_expand` / `/goal-expand`
  - Continuation directives + next-step miner from task checklist
  - Pre-verify + evidence-index completion gate (degraded verify without live skeptics)
  - Disk store, receipts, statusline, `pi-goal-expander:event` messages
  - Role prompts: planner / verifier / strategist / summarizer
  - pi-subagents RPC client (`src/subagents/client.ts`) for future N=3 panel
- Design spec: `docs/superpowers/specs/2026-07-20-goal-harness-design.md`
- CI + OIDC release workflows, `just release`, `RELEASE.md`

### Changed

- Panel timeout/infra policy: bus missing → degraded evidence path; bus present but total panel failure → fail-CLOSED `NotAchieved` (`verifier panel unavailable`). Removed fire-and-forget post-Achieved verifier spawn.
- **`waitSubagent` cleans up bus listeners on timeout** so hung skeptics do not leave dangling handlers; unit-tested with panel wait-timeout fail-closed (B015).
- README documents panel timeout/infra policy and post-complete quiet UX (B011/B007/B012).
- License is **Unlicense only**
- Package description reflects full harness, not expand-only

## [0.1.0] - 2026-07-20

### Added

- Initial pi package scaffold.
- `/goal-expand` command and `goal_expand` tool.
- Deterministic structural expansion into objective, acceptance criteria, subgoals, risks, and open questions.
