Pouchy World — documentation index

Twenty-odd world documents live in this directory and, until this file existed, a reader arriving at the repository had no way to tell the three they need from the seventeen written for whoever was on shift that week. This is the routing table.

What it is, in one paragraph. The Companion SDK gives you one character talking to one person. A world is several characters sharing a single committed state — so the questions change: who speaks this beat, what actually changed, and who is allowed to know it. A cast of independent chatbots is not a story; three agents each holding a private idea of what happened contradict each other by the third exchange. A world has one writer. A beat selects who speaks, runs them, and commits once; nothing reaches a reader until the state their lines narrate is true.

See one running: pouchy.ai/worldFLIGHT ZERO, an interactive drama in Chinese and English.


Start here

If you want to… Read
Understand the product before writing code pouchy.ai/sdk#world — capabilities, the two lanes, how to read a turn result
Build a drama an audience can change world-quickstart-drama.md
Build NPCs that share one world world-quickstart-npc.md
Put a world inside your own Next.js app world-quickstart-nextjs.md
Know what a refusal means and whether to retry world-sdk-errors.md
Take a played worldline to a published script world-production-workflow-integration.md
Pin a version and know what may change under you world-api-compatibility.md
Read the wire contract itself pouchy.ai/v1/world/openapi

The npm package's own README (packages/world-sdk/README.md, also on npm) is the method-by-method reference; this index does not duplicate it.


The four things integrators get wrong first

Each of these cost a real support round, so they are named here rather than left in the document that explains them.

  1. The two lanes are not one lane. The machine lane (sessions, turns, events) needs a project Secret Key and a provider signature over the exact bytes sent. The owner lane (authoring, reading, script drafts) takes an owner token, or a project admin key for an unattended backend. Every signed door answers the same uniform 403 on a bad signature — deliberately, because an endpoint that names the failing credential is an oracle. → world-sdk-errors.md

  2. The turn id IS the idempotency key. Mint one per beat and re-send the same one to retry. A new id is a new beat: new model calls, a new commit.

  3. executionStatus and deliveryStatus answer different questions. The first says whether the world moved; the second says whether the audience has heard yet. A pending delivery is a durable outbox retrying, not a failed turn.

  4. Patch validation is all-or-nothing. One invalid op voids the whole batch — including the ops that were fine — so the beat moves nothing. rejectedEffects on the thrown error names which op and why; an undeclared id means the instance is pinned to an older story revision, while an unmet node prerequisite means an earlier beat never committed. Those two need completely different fixes.


Operating and release

These are not published — they describe how we operate the platform rather than how you build on it, and they are named here so the list is honest about what exists rather than implying this index is everything.

Document What it is
world-sdk-release-runbook.md How a @pouchy_ai/world-sdk version ships, plus the SDK ↔ world API compatibility matrix. The matrix itself is public — see World API — versions and compatibility
world-pilot-gates.md The release gates, and the two verdicts kept deliberately apart
world-environment-deletion-option-b.md How a world environment is deleted, and what deletion means for a ledger
world-story-contract-v3-readiness.md Why machine-evaluable ending rules are a content contract, not a runtime flag
world-story-contract-v4-public-flags.md Contract v4: an author-declared public flag, and the checkpoint's publicFlags — a runtime exit instead of a static scene list

Internal records — history, not instructions

These are acceptance logs and plans kept for provenance. They describe what was done on a given day and are not guidance for building against the platform; read them only when tracing why something is the way it is.

pouchy-world-batches.md · pouchy-world-batch10-plan.md · pouchy-world-public-demo-plan.md · world-batch8-* · world-batch10-* · world-deliberation-sandbox-audit.md · world-environment-deletion-proposal.md · dispatch-serial-world-providerref.md


Where the code lives

Path What it holds
packages/world-sdk/ The published client — the only supported way in
src/lib/world/ Client-importable story types: package, state patches, episodes, progress
src/lib/server/world/ Server-side world plane: deliberation, ledger reads, script drafts, archive
src/lib/server/platform/world-coordinator.ts The single writer — role selection, effect resolution, the one commit
src/routes/v1/projects/…/instances/…/ The public /v1 doors the SDK calls
src/lib/world-demo/, src/routes/world/ FLIGHT ZERO — the public demo, a real integrator of the same public plane

The demo is worth reading as an example precisely because it takes no shortcuts: it drives the platform through PouchyWorldClient against the public /v1 plane, exactly as a third party would, and never imports an internal world store.