Skip to main content
bijection check analyzes the app tree that bijection/app.ts exports, without installing anything or running a handler. Run it before every commit and as a required CI step.
It does four things:
  1. Types. It type-checks the backend with the CLI’s pinned TypeScript compiler. The SDK’s types check shapes: addresses, indexes, verbs, spec keys and value types. They do not check label flow.
  2. Label flow. It infers each function’s commit label and checks every read, write, open, call and disclosure against it. Flow is checked here and enforced again by the host; it is never a TypeScript error.
  3. Guards. It lists every forbid guard with its tier, its under and the facts it reads, and analyzes the analyzable ones.
  4. The lock file. It derives the app’s authority and refuses when the committed bijection.lock differs (AuthorityLockStale). It compiles every warehouse statement and pipeline program through the semantics guest, offline, and refuses a committed file under bijection.statements/ that differs (StatementStale). --write-lock rewrites both for review.
PathRepeats flags paths such as orders.orders. SnakeCaseField flags fact fields such as order_total and suggests camelCase. Both are warnings that allow the check to continue.

The lexicon

bijection check enforces the SDK’s written lexicon: one word for each meaning. It refuses an app identifier that uses a word the lexicon retires or a synonym it refuses, and the sentence names the lexicon’s word:
Field names (a table’s fields, a function’s args) are your own and are not checked.

Flow sentences

Each flow refusal is one sentence at path:line:col. It names the code, what went wrong and the fix. A helper in your app that a function hands its ctx to (audit(ctx, fact)) is checked under that function’s under, at the helper’s own lines. The types never check label flow: a helper’s QueryCtx or MutationCtx takes every function’s context.
bijection/ledger.ts

Guards

For each guard, check prints its path, its tier, its under and the tables its condition reads:
A where: guard is written with the declarative predicate builder, so it is analyzable. With cvc5 or z3 on PATH, check warns about where: guards that can never match, and reports the policy diff against the committed lock: the acts the change newly forbids or newly allows, with an example of each, or that the guards mean the same as before. Without a solver it says analysis unavailable. A when: guard is a TypeScript function: it is tested, not proved, and the lock marks it tested. --prove <query> asks whether any act matching a query can be allowed by the guards. The query is a scope and an optional predicate in the guard IR. It prints an allowed example and fails when one exists:
The proof covers the guards only: positive authority (allow, grants and clearance) is not modelled, so an allowed example is an act no guard refuses.

Pending lowerings

A timed lowering is an ordinary scheduled task that changes a fact’s label field through a release you declare, built with labelSwitch from @bijectionhq/library-label-switch (see Eventual labels and timed lowering). check reports it like any other code: the functions that schedule it carry a submit, and its release is listed with the others in the lock. The lowerings still pending at run time are tasks in sys.tasks.

Exposure

check ends with what the lock states: the app contract, every exposed function with its allow, under and guards, the internal functions, and the paths that carry grave acts.

Options