# Changelog

English | [简体中文](CHANGELOG.zh-CN.md)

User-visible changes to Pi Metrics. Measurement schema versions are independent of package release versions.

## 0.0.7 — 2026-10-28

Prepare the first public npm distribution under the existing `@orbit-labs-ai/pi-metrics` name and keep Translator receipt subtotals separate from native session accounting. Registry publication still requires maintainer verification; preparing this release does not activate or update any installation.

### Fixed

- Correct accounting labels: native whole-session totals update as Pi records usage and already include current Workbench child usage from top-level tool results. Subagent details are breakdowns, not excluded charges, and are never added again. Details distinguish native whole-session usage from current-activity performance and current-branch context/cache hit rate.

### Added

- Show a separate **Translator reported usage** section in `/metrics` and `/metrics details`, reading numeric `orbit.translator.usage.v1` per-attempt receipts across the whole session. Show reported subtotals and provider/model/direction/status breakdowns; leave native footer totals, prompt handling and performance calculations unchanged. Do not show a combined bill: child translation receipts may never reach the parent.
- Validate receipt fields and numeric usage, deduplicate request IDs across branches/resume, exclude conflicting IDs, report ignored data, and never sum legacy Translator outcome aggregates. Missing receipts are unavailable (reporting starts after a compatible Translator upgrade); `usage: null` is unreported, not free. Numeric zero costs are not proof of free requests.
- Add synthetic receipt unit/adapter/real-SDK regressions, including immutable history, command rendering, native child accounting without double counting and disk resume. Keep offline CLI/terminal coverage and bilingual accounting/upgrade limits, without real provider calls or personal configuration/history access.
- Add offline npm dry-run and actual packed-tarball regressions: verify the exact file list, public metadata, local license and host peers; load the extracted package in an isolated official-SDK profile and run both accounting commands with a synthetic receipt, without installation or provider calls.

### Changed

- Remove the npm-private barrier and declare public publish access. Ship only the six runtime TypeScript modules (including the required `translator.ts`), package manifest, paired READMEs/changelogs and a local copy of the repository MIT license. Exclude tests, scripts, logs, personal runtime data, generated host declarations and bundled dependencies. Retain Pi-provided peers; do not bundle Pi or add external dependencies.
- Document pinned npm installation, one-run loading, manual upgrades from local 0.0.6 copies and removal in both languages, while retaining stable-copy installation outside branch-switching checkouts. npm commands apply after publication is verified. Existing sessions and schema versions remain unchanged; receipt reporting still needs a compatible Translator upgrade.

## 0.0.6 — 2026-10-22

The footer and `/metrics` can now show TTFT/TPS for explicitly instrumented child or other agents separately from the parent session, and the collapsed one-line footer leads with the parent TTFT/TPS.

### Added

- Separate, branch-local request TTFT/EFF TPS for explicitly instrumented child/other agents. Add a numeric-only `orbit.pi-metrics.agent.v1` bus/tool-details contract and `createAgentMetricsBridge` for child Pi SDK sessions, with local monotonic clocks, final usage, attribution, validation, persistent deduplication, interruption handling and explicit coverage. No child spawning, provider wrapping, extra model calls or automatic IPC injection.
- Import final usage-only reports from the shipped Pi 1.3.0 `subagent` single/parallel/chain details shape. That tool does not expose request/delta clocks: TTFT/TPS remain unavailable without instrumentation, never inferred from tool wall time. Agent records and details usage never inflate parent performance or Pi-native token/cost totals.
- Show separate agent performance/status as space allows; `/metrics` and details retain all agent identities, model/timing/usage fields, coverage and rejected-event counts. Add deterministic regressions, real-SDK localhost parallel-child/continuation/resume tests and no-install one-run terminal tests.

### Changed

- Make the collapsed one-line footer prioritize parent TTFT/TPS with the same retained/pending/provisional qualifiers as the expanded view. Context warnings, active statuses and attributed agent performance take precedence over optional model/path metadata; details retain hidden values. The expanded row limit, parent request/activity semantics and parent measurement schema 2 remain unchanged.

## 0.0.5 — 2026-10-18

### Changed

- Update bilingual release references and verification-guide links.
- Keep the existing footer symbols while improving spacing and type hierarchy: the working directory is bold and accent-colored, values are bold, and secondary labels stay quieter. Expanded mode is capped at three rows, with active statuses sharing the last row; long paths retain their directory tail and overflow groups show a count rather than adding rows.
- Add a one-row collapsed view, a fullscreen mouse button, `Alt+M`, and `/metrics footer collapse|expand|toggle`. High-context warnings remain visible independently of long model names. Layout changes never stop recording or reclaim another extension's footer.
- Hide only exact known idle states (`LSP: idle` and zero background tasks) by default. Prioritize warning/error status text, preserving unfamiliar statuses and the original extensions' state.
- Add `/metrics details` to inspect/copy all metrics and statuses, including overflow and hidden idle states. Native editor edits are discarded, even on submit; no model request or session entry is created. No font installation, terminal-settings change, measurement/schema change or persistent layout preference is introduced.

## 0.0.4 — 2026-10-14

### Changed

- Simplified the extension's internals without changing what it measures or saves: requests and activities use the same first-arrival tracking code, sums and means use shared helpers, the branch reader finds activity summaries through one small helper and reads the branch's records once when restoring a session or answering `/metrics`, and the footer renders its header, performance and usage rows separately. Saved session entries keep their schema and fields, existing sessions read as before, and the footer and `/metrics` output are unchanged.

### Notes

- Routine patch release. No configuration or session change is needed. To use it, copy the release into a fresh directory and switch the package registration, as the README's **Updates** paragraph describes.

## 0.0.3 — 2026-10-10

### Fixed

- Keep the last valid EFF TPS estimate visible across tool calls, new content, continuation requests and new activities until a new estimate replaces it. A retained value is labeled `last`; pending/incomplete recorded coverage and `/metrics` calculations remain unchanged.
- Restore retained estimates from finalized records on the active branch without treating provisional response checkpoints as final measurements or carrying values into a new session.
- Hide OBS TPS while no positive live estimate exists, including initial waits and silent windows that decay to zero. Resume its real-time display when the rolling rate becomes positive; keep zero/silent samples in session storage.

## 0.0.2 — 2026-10-10

### Fixed

- EFF TPS now estimates decode speed using reported output divided by the time from the first observed token to response completion. Every request's initial wait (TTFT) is excluded, including across tool rounds; OBS TPS remains the separate, real-time rolling estimate.
- Requests without a known positive stream duration show an unavailable EFF TPS instead of falling back to full request time. Reported reasoning is still included once; hidden reasoning and buffering can skew this client-observed estimate.
- Historical request/activity rates are recomputed from stored stream durations where available, without rewriting session history. New records identify the stream-time throughput basis and retain full request durations separately.
- Interrupted activities no longer retain a provisional EFF TPS when Pi shuts down during tool execution. Resumed incomplete activities show an unavailable rate, including previously saved interrupted summaries.

## 0.0.1 — 2026-10-10

### Added

- Theme-aware Pi 1.1.0+ footer with activity TTFT, effective request throughput, a separately labeled approximate observed-stream rate, context/cache information, and Pi-native whole-session usage/cost. Other extensions' status text is preserved; headless sessions record without a footer.
- `/metrics` active-branch summaries and coverage counts, `/metrics footer on|off`, and `--metrics-no-footer`. No extra model calls or prompt transformations.
- Schema 2 request, activity and trace entries in the Pi session, including per-request latency, reasoning accounting, tool timings, timing definitions, capture status, provisional checkpoints and durable assistant IDs.
- Lossless retention of all produced numeric samples in 128-sample batches, including silent waiting periods. First-observation and response-end checkpoints save timing before tools finish. Tool IDs are scoped to requests; parallel/nested tool wall time uses interval unions.
- Bilingual guides for loading, stable-copy installation/updates outside Git, definitions, privacy, failures and removal without deleting session history.
- Offline deterministic, real-SDK/local-provider and shipped-CLI/PTY tests, plus strict host-SDK type checking. `npm run test:cli` covers installation/removal, JSON, fullscreen/regular modes, themes, resize, opt-out/toggles, source reload, cancellation, clean exit and resume.

### Changed

- The headline TTFT is now the first observed content of an activity, fixed through tool rounds and automatic continuation loops until `agent_settled`. Individual request TTFT remains recorded separately.
- Completed throughput now divides normalized output by **full request elapsed time**, including the silent pre-delta period. Reported reasoning is already part of output and is never added twice. The old first-visible-delta denominator could exaggerate reasoning-inclusive speed.
- The footer distinguishes `EFF TPS` from `OBS TPS ≈`. Pending or incomplete activity coverage does not display a supposedly final rate. `/metrics` gives explicit covered/recorded request counts.
- Reasoning hidden by the UI still counts; reasoning hidden by the provider contributes through normalized final usage and full request time. Unobservable hidden-token counts/durations remain null. A zero/absent normalized reasoning breakdown does not prove no thinking.
- Removed sample downsampling and the 1,200-sample history cap. Session files and in-memory history grow with full retention; crashes can still lose an unflushed batch or final record. Storage failures are reported and marked incomplete.
- Existing schema 1 entries remain unchanged. Readers recompute eligible request rates from stored full durations; they do not invent legacy activity grouping or recover discarded samples.

### Fixed

- Host dependency lookup supports nested npm layouts and pnpm-style SDK/dependency symlinks, including a symlinked SDK entry.
- Handle late settlement notifications after direct SDK disposal without using an invalid context. Retain partial/interrupted checkpoints rather than presenting them as completed activities.
- Preserve partial measurements on a superseded request and reset sample counters after setup failures.
- Clip the approximate arrival-rate window at request start rather than first arrival, avoiding startup inflation from counting the first chunk over only the time after it arrived.

### Notes

- First GitHub release. The package remains private and is not published to npm. This release does not change existing personal installations.

### Verification and limitations

- On macOS with Pi 1.1.0, Node.js 26.8.2 and tmux 3.7c: **48 tests passed with no skips**, and strict TypeScript checking passed. Tests cover both API-unstreamed reasoning and UI-hidden thinking, activity/tool boundaries, full sample persistence and v1 compatibility.
- These are client-observed metrics, not server first-token/decode timing. Provider-reported usage can be incomplete; hidden internal reasoning cannot be reconstructed. Native whole-session accounting includes auxiliary work, but conversational throughput does not.
- Host-dependent checks explicitly skip without their prerequisites. Desktop visual acceptance, arbitrary footer combinations, other host versions/platforms and live-provider benchmarks remain separate checks. These are local checks, not CI.
