# v0.2.0 npm Release Validation — 2026-07-11

Scope: `pi-session-continuity` v0.2.0 npm-first release. The human-approved
scope includes npm publication and excludes GitHub push, tag, or release
mutation. A GitHub v0.2.0 installation must not be announced until a tag exists
and pinned-ref smoke passes.

## Environment

- OS: `Linux trader 5.15.0-185-generic #195-Ubuntu SMP Fri Jun 19 17:11:50 UTC 2026 x86_64 GNU/Linux`
- Node: `v22.22.2`
- Pi: `0.80.6`
- Model used for lifecycle smoke: `openai-codex/gpt-5.6-sol`
- Global extensions and skills: disabled for smoke
- Built-in tools: disabled for smoke
- Project/session/artifact roots: isolated under `/tmp/psc-v020-*`
- Gestor NFE: not used or modified

## Real Pi lifecycle smoke

The smoke used Pi's documented RPC mode with the workspace extension loaded
explicitly:

```text
pi --no-extensions --no-skills --no-tools --approve \
  --mode rpc \
  --model openai-codex/gpt-5.6-sol \
  --thinking minimal \
  --session-dir <isolated-session-dir> \
  -e /home/ubuntu/pi-session-continuity/extensions/session-continuity/index.ts
```

### Threshold

Evidence root: `/tmp/psc-v020-rpc-threshold`

Observed:

- process exit `0`; two agent runs settled;
- one `compaction_start` and one `compaction_end`, reason `threshold`;
- `compaction_end.aborted=false`, `willRetry=false`;
- persisted entry `fromHook=true`;
- details kind `pi-session-continuity/compaction-v1`;
- schema-v2 summary retained `status: pending` and its SHA-256 matched
  `artifactSha256`;
- pending directory empty after commit;
- one archived Brief with `status: archived`;
- no failed artifact;
- one disk-backed Continuity follow-up user message;
- no `extension_error` event.

Event/artifact identity:

```text
eventId: b610f9ea-fae5-4a84-9203-be7f8bd21163
sha256: 25804a58dbd3be503f9ebae1ecae6455862a692aa9b40dd592195e8faed8ddd5
archive: /tmp/psc-v020-rpc-threshold/.pi/session-continuity/019f55c3-9292-77c6-ab1b-97080f811d31/archive/2026-07-12T09-58-45-841Z-b610f9ea-fae5-4a84-9203-be7f8bd21163.md
```

Result: **PASS**.

### Overflow

Evidence root: `/tmp/psc-v020-rpc-overflow`

Observed:

- native overflow produced `compaction_start` reason `overflow`;
- successful custom `compaction_end` had `willRetry=true`;
- Pi performed one native retry and then emitted the documented
  `willRetry=false` terminal overflow result because the intentionally
  oversized single turn still could not fit;
- persisted custom summary was schema v2, `fromHook=true`, and its SHA-256
  matched the disk-summary metadata;
- one archived Brief, no pending or failed Brief;
- zero Continuity follow-up user messages;
- no `extension_error` event.

Event/artifact identity:

```text
eventId: 5ecf948d-895d-4c03-93c6-d36fedc867a9
sha256: e444d1d836aaea2756e7cac54e179d6c0af8ad30a9ca95bbee2fbd1475fba232
archive: /tmp/psc-v020-rpc-overflow/.pi/session-continuity/019f55c4-8fc9-7fc0-a004-40f50c219e73/archive/2026-07-12T09-59-59-613Z-5ecf948d-895d-4c03-93c6-d36fedc867a9.md
```

Result: **PASS** for custom overflow compaction, native retry, and no duplicate
continuation. The terminal retry failure was intentional test input behavior,
not an extension failure.

### Manual compact

Evidence root: `/tmp/psc-v020-rpc-manual`

Observed:

- RPC `compact` response succeeded;
- one `compaction_start` and one `compaction_end`, reason `manual`;
- `compaction_end.aborted=false`, `willRetry=false`;
- details recorded `handoffReason: manual-compaction`;
- schema-v2 summary hash matched metadata;
- one archived Brief, no pending or failed Brief;
- zero Continuity follow-up user messages;
- message count remained four after compaction;
- no `extension_error` event.

Event/artifact identity:

```text
eventId: 12145c36-cf27-4718-9032-27fb70b5e8fc
sha256: 570368661e0cabb8900eff5f19049390dc0376f7d7b7a7106107958bda68dc81
archive: /tmp/psc-v020-rpc-manual/.pi/session-continuity/019f55c5-7410-7390-b8d0-23d0981da753/archive/2026-07-12T10-00-44-675Z-12145c36-cf27-4718-9032-27fb70b5e8fc.md
```

Result: **PASS**.

## Independent review

Focused re-review artifact:

```text
.pi-subagents/artifacts/outputs/1982abc5/.orchestrate/re-review-native-compaction-rewrite.md
```

Verdict: **no unresolved source blocker**. Missing real Pi smoke was the only
release-evidence gap at review time; the lifecycle evidence above closes that
gap for the workspace candidate.

## Package gates

Final v0.2.0 candidate results:

- `npm test`: **PASS** — 7 files, 54 tests.
- `npm run typecheck`: **PASS** — `tsc --noEmit`.
- `npm pack --dry-run`: **PASS** — 30 files in the validated candidate.
- `npm publish --dry-run --access public`: **PASS**.
- `git diff --check`: **PASS**.

Clean packed-content smoke:

1. generated `pi-session-continuity-0.2.0.tgz` with `npm pack`;
2. unpacked the exact tarball into an isolated directory;
3. installed that unpacked `package/` with an isolated
   `PI_CODING_AGENT_DIR`;
4. verified `pi list` loaded it without extension warnings;
5. ran `/continuity status` in an isolated project and observed armed state,
   reserve `93,000`, trigger `279,000`, and keep-recent `55,800`;
6. removed it successfully from the isolated Pi settings.

Evidence: `/tmp/psc-v020-unpacked-install-result.json`.

Result: **PASS**. Pi does not accept a `.tgz` path directly as an install
source; unpacking first validates the exact packed bytes without resolving code
from the development workspace.

## npm publication

Target: public npm registry, package `pi-session-continuity@0.2.0`.

An explicitly supplied temporary npm token authenticated as `bernardofortes`.
It was written only to a mode-0600 temporary npmrc, used for publication, and
removed by a shell trap. The user's `~/.npmrc` was not modified.

Observed publish output:

```text
+ pi-session-continuity@0.2.0
```

Fresh-cache registry verification:

```text
name = 'pi-session-continuity'
version = '0.2.0'
dist.shasum = '899e24e685fd57f229c3952a03d30e2f0d4a9244'
latest = '0.2.0'
```

Post-publish clean npm smoke used isolated agent/project/cache directories:

```text
pi install npm:pi-session-continuity@0.2.0
Installed npm:pi-session-continuity@0.2.0
Pi Session Continuity: armed · trigger 279,000 tokens · keep 55,800 tokens.
pi remove npm:pi-session-continuity@0.2.0
Removed npm:pi-session-continuity@0.2.0
```

`pi list` loaded the registry package without extension warnings. Status showed
reserve `93,000`, effective trigger `279,000`, and keep-recent `55,800` from the
isolated project settings. Evidence:
`/tmp/psc-v020-npm-install-result.json`.

Result: **PASS — `pi-session-continuity@0.2.0` is published and the npm
`latest` dist-tag points to `0.2.0`.**
