Skip to content
pleach
Reference

Release checks

The checks that protect the `@pleach/*` packages you install — package shape, plugin contracts, event-log integrity, multi-tenant scoping, and the graph lattice — and the checks you can run yourself.

Pleach's CI checks the @pleach/* packages for the properties you build on: an import resolves, a plugin hook is wired, an event type has a redaction decision, a graph edge stays on the lattice.

You don't run these checks. They run in Pleach's own CI. This page lists what they cover, the errors your app raises when the same rules apply at runtime, and the checks you can run in your own project.

To read the same checks by the promise they back, see How the audit contract is checked. To go from an error in your app to the fix, see When a check fails.

The packages you install

Each package is packed with npm pack, installed into an isolated directory, and imported from there. That catches the failures a monorepo build hides: a path that only resolves locally, or a declaration file that never got emitted.

What's checkedWhat it means for you
Every package.json exports key imports from a clean installA documented subpath resolves in your project, not only in Pleach's.
Every third-party import in dist/ is declaredYou don't hit a missing-module error from an undeclared dependency.
Every declared .d.ts path exists and isn't emptyYour editor and tsc get types for every subpath.
SessionRuntime and createPleachRuntime import from an isolated installThe main entry points load outside Pleach's own workspace.
@pleach/core holds no host-specific vocabularyThe core stays domain-agnostic: no brand names, vendor backends, or product terms.
Every published package carries the same license termsEach package declares FSL-1.1-Apache-2.0 and carries the canonical LICENSE and a NOTICE file.

The plugin contract

The plugin contract runs both ways: a contributeX hook has to reach something, and a host has to stay on the public surface.

What's checkedWhat it means for you
Every contributeX hook on HarnessPlugin has a collectX accessor and a consumerA hook you implement is read by the runtime. It doesn't silently go nowhere.
Every hook belongs to exactly one of the nine contribution namespacesThe namespace map stays complete.

The event log and hash chain

The event log is the record of every session turn.

What's checkedWhat it means for you
Every core event type has a SCRUBBABLE_FIELDS entryEach one carries a redaction decision. An empty [] entry is a valid one.
Every event type has a producerA type in the union is one the runtime really writes.
The hash-chain wire-in stays intactverifyChainForChat, generateProof, and computeGenesisSeed keep working against the rows the writer stamps.
EventLogWriter stamps a config-manifest hash on every rowEach row can recover the configuration that wrote it.

The config manifest

The config manifest records which runtime configuration ran each session, content-addressed and referenced by every event-log row.

What's checkedWhat it means for you
Two builds of the same configuration produce identical hashesA timestamp can't leak into a hash and make replay report a false change.
The event-log foreign key carries its canonical clausesREFERENCES, ON DELETE SET NULL, and DEFERRABLE INITIALLY DEFERRED stay on the migration.
SessionRuntime wiring reaches the manifest writeNew sessions record their manifest.
A retention pass leaves no surviving event pointing at a dropped manifestGarbage collection doesn't orphan a row you still keep.

Multi-tenant scoping

What's checkedWhat it means for you
Core's event log write paths carry the tenant idEvent rows stay attributable to a tenant.

Core's base schema ships owner and service-role policies. The tenant policies come with @pleach/compliance, so apply its tenant RLS schema tier and verify it on your database with auditRlsPolicies().

The graph and lattice

The compiled agent graph obeys the four-stage lattice (anchor-plan → tool-loop → synthesize → post-turn, one-way, with a bounded synthesize → tool-loop re-entry, at most once per turn).

What's checkedWhat it means for you
Every edge in the default graph stays on the latticeReplay reproduces a graph whose edges are fixed.
Node and edge counts are identical for the same configurationA compile is deterministic.
Every cross-stage edge is documented in the edge catalogThe catalog is a full list of transitions.
Recovery runs in one place, the post-turn stream filtersA retry can't enter through a second path.
The graph barrel's public and internal exports stay separatedThe public graph surface doesn't shift between releases.
ChatOptions.agentic === false is respected at every recursive callSingle-call mode stays single-call.
The AuditableCall row shape and AuditRecordVersion move togetherThe row shape changes additively, with a version bump.

Errors your app raises

Some of these rules also apply in your process. These are the ones you can hit.

What you didWhat you see
Registered a malformed pluginPluginManager.register throws PluginValidationError with the failing hook.
Added a graph node with no subscribes or writesRegistration refuses the node and names it.
Declared a plugin node under a core node's name, at a different stageRegistration throws and asks you to rename the node.

When a check fails has the fix for each one.

Checks you can run

Two commands ship in @pleach/core.

# Drive your plugin through a scenario battery; non-zero exit on a failed expectation
npx @pleach/core dev --plugin ./my-plugin.mjs --scenarios ./scenarios.json --assert ./expect.json

# Verify the permission ledger's chain; exits 1 if it's broken
npx @pleach/core audit verify

The CLI reference lists every flag.

Add your own checks

Pleach's checks protect the packages. Your app has its own rules: a per-tenant key never appears in logs, every domain tool has a detector, a feature flag doesn't outlive its sunset date.

The pattern carries over:

  • Write a script that walks the relevant source and asserts the rule. Exit non-zero with a message that names the file and line.
  • Wire it into package.json and your PR-blocking CI job.
  • Document it next to its siblings, so the next contributor knows it exists.

Keep one rule per script. Adding a rule means adding a check, not a line on a review checklist.

Where to go next