# Docs code samples now compile against shipped packages (Jun 29, 2026 – Jul 5, 2026)

URL: https://www.getpleach.com/changelog/2026-07-06-docs-code-samples-now-compile-against-shipped

> Docs code samples were re-checked against shipped packages, and core added numbered stream errors, default hash-chain stamping and plain Postgres support.

_Drafted by an AI agent from the package and docs commit history and reviewed by a maintainer before publishing. Each post names what it was drafted from._

_No @pleach/* package is on npm yet. Each name holds a 0.0.1 placeholder until its first release, so the code here describes the source, not an install that works today. [Package status](https://www.getpleach.com/docs/packages)._

The docs re-checked their code samples against the shipped packages, and core gained numbered stream errors and stricter audit defaults. If you copied code from earlier pages, scan the Corrected items.

## Core runtime (`@pleach/core`)

- **Corrected:** config examples used invented fields; safety policies and system prompts go through plugins ([details](/docs/session-runtime)).
- **Corrected:** samples import each symbol from the subpath that ships it ([details](/docs/subpath-exports)).
- **Corrected:** aborting a turn records a user abort, and the resume section matches how a session is rebuilt ([details](/docs/session-lifecycle)).

## Errors and safety (`@pleach/core`)

- Stream error events carry a numeric `codeNum` that matches the shipped error catalog ([details](/docs/error-codes)).
- Naming a safety policy no plugin registered throws `UnknownSafetyPolicyError` at construction, so typos surface at boot ([details](/docs/safety)).

## Events, interrupts and tracing (`@pleach/core`)

- **Corrected:** event reads go through a reader you inject, so any store can back them ([details](/docs/event-log-projections)).
- **Corrected:** the React interrupt hook is `useInterruptUI`, and an approval with edits must be marked approved ([details](/docs/interrupts)).
- **Corrected:** core ships no tracing dependency; pass your own OpenTelemetry exporter to capture spans ([details](/docs/otel-observability)).

## Audit trail (`@pleach/core`)

- **Corrected:** two pages disagreed on the audit row version; both now match the shipped one ([details](/docs/auditable-call-row)).
- **Corrected:** attestation verification always requires a signature, and `verifyInclusionProof` is exported for checking proofs ([details](/docs/attestation)).
- Tamper-evident hash chain stamping is on by default and ships in the schema bundle ([details](/docs/hash-chain)).

## Storage and redaction (`@pleach/core`, `@pleach/compliance`)

- The shipped database schema applies on plain Postgres, not only Supabase ([details](/docs/schema)).
- Message content is scrubbed for personal data before it's written to the event log ([details](/docs/scrubbers)).

## Subagents

- **Corrected:** bare core needs your host to run subagents, and spawns over the limit fail rather than queue ([details](/docs/subagents)).

## Gateway and sandbox (`@pleach/gateway`, `@pleach/sandbox`)

- `@pleach/gateway/next` ships a ready route handler, and the migration page no longer calls it future work ([details](/docs/gateway/migration-from-core)).
- A fresh `@pleach/sandbox` install no longer fails; its cloud SDK clients are now optional dependencies ([details](/docs/changelog/sandbox)).

## Coding agent and MCP

- `@pleach/coding-agent/context` ships two strategies for trimming long-session context ([details](/docs/coding-agent/long-session)).
- **Corrected:** the MCP session registry is live, and resources and prompts are served ([details](/docs/mcp)).

## Evaluation, replay and React

- **Corrected:** eval and replay examples use the real constructors, and chat hook names match `@pleach/react` ([details](/docs/replay)).
