> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bijection.com/llms.txt
> Use this file to discover all available pages before exploring further.

# bijection.lock

> The committed, reviewable list of everything an app exposes, with the label, grave acts and guards of each path.

`bijection.lock` sits beside `bijection/app.ts`. It is derived
from the app tree, never written by hand, and committed with the source. A
change to who may call what, under which label, through which guard, shows up
as a diff in review.

```sh theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
bijection check --write-lock   # derive it, then review and commit the diff
bijection check                # refuses stale authority or view plans
```

Deploy derives the lock again and refuses when it differs from the committed
file, so no authority change reaches an installation unreviewed.

## What it lists

```text bijection.lock theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
# bijection.lock: derived by `bijection check --write-lock`; review the diff, do not edit
contract 7c1e9a…
floor public
path notes.add mutation allow team.member under tenant guards guards.noSpam
path notes.items table
path notes.recentNotes query allow sys:anyone
path notes.purge mutation
path stories.publish mutation allow team.editor under tenant acts disclose(stories.lift)
grant class:anyone enter{notes.recentNotes} parent program:/
role team.editor enter{stories.publish} clear{tenant} erase{} hold{} include{} attest{} register{}
role team.member enter{notes.add} clear{tenant} erase{} hold{} include{} attest{} register{}
role team.owner enter{} clear{} erase{} hold{} include{team.editor,team.member} attest{} register{} issue
founders team.owner
guard guards.noSpam where on enter(notes.add) under public pred {…}
guard guards.closing when on grant(team.member) under desk tested [reads holdings]

app /
  program grant class:anyone anyone enter{notes.recentNotes}
  program grant module module enter{…} clear{…} …

# Public reads
public read notes.recentNotes notes.items
```

| Line | States |
| - | - |
| `contract <digest>` | The app contract: the digest of the exposed tree's paths, arguments, values and codes. A client written by `bijection client` pins it. |
| `floor` | The lowest label any entry runs under. |
| `path <path> <kind> …` | One line per leaf of the tree: its kind, and `allow` (the roles that may enter it; absent means internal), `under` (its commit label), `acts` (its grave acts: every `grant`, `revoke`, `erase`, `branch`, `land`, `discard`, `pin`, `unpin`, `answer`, `withdraw`, `hold`, `lift` and `disclose(<release>)` it performs, itself or through `ctx.call` or `ctx.try`; `bijection check` finds them in the source, and deploy compares the rest of the line), `commit` (its commit label as check infers or you declare it: a submit's `once` binds at it, so inference never moves it; `bijection check --write-lock --relabel <path>` records a move as `relabel <old>`, and deploy refuses an unrecorded one with `IdentityRelabelled`) and `guards` (the guards whose scope names it). The class roles `role.anyone` and `role.signedIn` print as `sys:anyone` and `sys:signedIn`. |
| `role <path> enter{…} clear{…} erase{…} hold{…} include{…} attest{…} register{…} [issue]` | The role's bundle: the functions it enters (those whose `allow` names it, and its own `enter`), the labels it clears, the units it may erase and hold, the roles it includes, the issuer shapes it may trust and the families it may found. `issue` ends the line when its holders may issue the role and every role it includes. |
| `grant class:anyone\|class:signedIn <rights> parent program:<app>` | A class grant the program issues at install: the functions every caller (`class:anyone`) or every signed-in person (`class:signedIn`) enters, and any right the app declares for the class in `classes`, such as `register{…}`. Nothing is ambient: these lines are the only entries open without a grant to a named principal. The root app is `/`. |
| `founders <roles>` | The roles the installation's founder receives at creation. |
| `founder <family> -> <role> parent program:<app> at register` | The family's founder role, which the program's grant issues to the registrant at each founding. |
| `field <table>.<field> label=<label> [below <fact>] [by <release>]` | A field label: a sealed field above its fact, or a presence field below it (the existence bit is the field `_existence`). |
| `app <path>` and its `program grant …` lines | Each app's program grants, which deploy installs: its module grant, its code sites' grants (`site:<paths> program-site`), its class grants and its program roles (`role:<role>`). `program grant founder` lines are issued at founding, not at deploy. |
| `family <name> not erasable` | A family whose members are outside the erasure lifecycle. |
| `exposed <table> index(<fields>) "<message>"` | The values of one ordered projection the store can see, with its review message and any declared cover targets. |
| `exposed <table> search(<index>, <field>) "<message>"` | The text field one ranked projection exposes to the store, with its review message and any declared cover targets. |
| `guard <path> <tier> on <scopes> under <label> …` | Each `forbid` guard: its path, its tier, its scopes and its `under`. A `where` guard carries its compiled predicate; a `when` guard ends in `tested`. A guard that reads the caller's holdings ends in `[reads holdings]`, since a new grant can make it stricter. |
| `fact …` | Each point a `where:` guard reads. |
| `budget <path> measure <name> quota <units> every <ms>ms for <family>\|pool shared true\|false spenders <paths>` | Each [budget](https://docs.bijection.com/operate/usage.md#budgets): what it caps, whether each member of a label family keeps its own account (`for`), the budget is one account at public (`pool`), or it is one host-only installation counter judged at commit (`shared true`), and the functions whose metered sends pay it. |
| `receiver <name>` | A declared receiver. |
| `plan <path> view …` | The generated view read's digest, mechanism, steps, statement bound, disclosure edges and coherence. |
| `view-load <receiver> …` | The derived hourly standing request load and declared receiver budget. |
| `receiver <name> open <schemes> port <ports> hosts <hosts>` | The address policy for an open-endpoint receiver. |
| `secret <name> credential -> <receiver>` | A named secret the receiver driver uses to authenticate. |
| `entry route … verifier <kind> …` | How the route checks a request. `as principal allow <roles>` attributes entry to the principal the verifier returns. `as app roles <roles>` uses the app's listed roles. |
| `entry cron … coalesce <true\|false> …` | A clock entry's cadence and whether missed firings run once (`true`) or each in turn (`false`). |
| `meter <target> measure <name> reserve <units> field <pointer>` | The measure, reservation and result field for a metered target. |
| `reserve <path> budget <budget> units <units>` | What a mutation [reserves](https://docs.bijection.com/operate/usage.md#accounts-and-labels) for each task it records under another label. |
| `read <function> <table> <path\|-> <kind> [of <family>] places <n>` | Each read a function's source makes: the table, the index, search, vector or aggregate it names (for a natural-key point such as `users({ email })`, the unique index its fields spell, such as `byEmail`; `-` for its facts), the kind (`point`, `keyedPoint`, `selection`, `changes`, `count`, `aggregate` or `ranked`), the family `.of(member)` pins, and the root places it can touch at the function's `under`. `bijection check` and deploy admit each function's reads as one frame: a wide read under a family stem or a shared clause with no declared `across:` cover refuses `CoverRequired`, a static frame bound past 64 places refuses `ReadPlacesUnbounded`, an argument-dependent bound is marked `member-dependent`, and a count, aggregate or ranked read over overlapping roots refuses `CoverOverlap`. |
| `call <function> <callee\|?>` | Each function a function's source enters with `ctx.call` or `ctx.try`, by its path; `?` when the analysis cannot resolve the callee to a query or mutation placed in the app tree. A callee runs in its own frame under its own `under`, so its reads are admitted at the callee, never in its caller's frame. A query that declares `replays: { days }` must find that much `history` on every table the reads of its whole call closure name; `bijection check` and deploy walk these lines and refuse `ReplayHistory` otherwise, and when the closure reaches a `?`. |

The **Public reads** section lists public tables read by entries that a
class grant enters. It includes reads through calls the source
analysis can resolve.

Rights print as `<verb>{<object>[@<scope>|…],…}`, one token per verb; an
objectless `issue` or `revoke` prints as the bare verb. A right without `@`
holds at installation scope and at every member; `-` is no right.

Other lines record route and reaction entries, releases, secrets and label
retirements. Each is a fact the host enforces.

## View read plans

A generated view read has one derived plan. Check prints changes classified
by mechanism, disclosure, cost and coherence. A missing or changed line
refuses `PlanStale` in check and deploy. Run `bijection check --write-lock`,
review the classified changes, and commit the lock.

Deploying to a branch stages its reviewed plan lines with the candidate
Program. Branch deploy and write review show the plan diff against the
installed Program. Landing the branch promotes its candidate Program and
writes together.

```text bijection.lock theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
plan customers.lookup view digest=… mechanism=key-route steps=["read:accounts","land:billing"] statements≤1 disclosure=["billing->warehouse:app"] coherence=mixed objectives={} load=[]
view-load warehouse statements/hour=400 budget/hour=2000
```

The statement bound describes source acquisition needed by the read plan.
A query answers from its landed state and frame. The load describes the
standing requests implied by declared `serve` populations. The owning
lookup plan records each materialized population under `acquisition=`,
including its maintainer and any standing worker, cadence, and volume
bound. Check and deploy require this evidence for a standing population or
copy. If the receiver cannot fund the standing load, check refuses
`FreshnessInfeasible` and shows the load and budget. [Views](https://docs.bijection.com/objects/views.md#read-plans-and-objectives)

## Compiled statements

Warehouse statements and pipeline programs are part of the lock. Each
virtual table prints a `plan` line with its compile request digest
(`request=`), dialect, compiler revision (`compiler=semantics@…`), key and
origin (`relation`, `typed ir=…` for a typed relation, `native template=…
source=…` for native text). Each of its shapes prints a `plan` line with the
statement digest, the dialect's settings profile, the row bound, the
committed file and the binds it sends. The clock bind prints
`at:instant(cut)` on a dated statement and `at:instant(observed)` otherwise:
the source instant the answer reflects. A fused route prints `plan <driver>
fused` and one line per variant. Pipelines add `pipeline`, `program` and
`producer` lines.

```text bijection.lock theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
plan sales.orders request=sha256:5be2… dialect=sqlSnowflake compiler=semantics@13.9 key=id evidence=… closure=… clock=true typed ir=sha256:c07e…
plan sales.orders point request=sha256:5be2… statement=sha256:3a1f… profile=sqlSnowflake/semantics@13.9{…} rows=1 file=bijection.statements/sales/orders/point.sql sends key0:string, at:instant(observed)
pipeline pipelines/regionCounts request=sha256:… run=… dialect=sqlSnowflake compiler=semantics@13.9 class=group cell=equal meaning=sha256:… binds=(level) shadow=first+every=P1D+rebuild+engine access=leases
pipeline pipelines/regionCounts program rebuild statement=sha256:… compiler=semantics@13.9 target=… access=leases file=bijection.statements/pipelines/regionCounts/rebuild.program.json
producer region_counts <- pipelines/regionCounts
```

### Committed statements

`bijection check --write-lock` also writes every rendered statement under
`bijection.statements/` beside `app.ts`, one file per statement, and removes
stale ones. Commit the tree with the lock: a change to a statement shows up
as a diff in review.

| File | Holds |
| - | - |
| `<tree path>/<shape>[.dated].sql` | A virtual table's statement for one shape, after a header with the dialect, statement digest, compiler revision, profile, row bound, binds, columns, merged reads and origin. |
| `<tree path>/fused.<route>.<request>[.dated].sql` | A fused route's statement under its driver's tree path. `<route>` joins target path segments with `_` and targets with `+`, shortened if needed. `<request>` is the full hexadecimal request digest and distinguishes different bindings to the same targets. |
| `<owner>/<pipeline>/<role>.sql` and `<role>.program.json` | A pipeline's `rebuild`, `step` or `shadow` program, readable, and the exact bytes the run target installs. The file layout for pipelines may still change. |

Plain `bijection check` refuses a committed file that differs from what the
source compiles. Deploy refuses a file that does not hash to a digest the lock
names, or a lock program without its file (`StatementStale`), and a compiler
revision the release's gateway does not carry (`CompilerMissing`). Rewrite
with `bijection check --write-lock` and review the diff.

`bijection describe <tree path>` prints a declaration's contract followed by
its committed statements. `bijection describe sha256:<hex>` prints the
committed statement with that digest; add `--format json` for JSON.

## Review it

A `function-contract` line records a deferred calling contract. A
`function-migration` line records the declared change, and
`function-chain` records an accepted boundary. Check compares these
declarations with the previous lock. The lock records relabel releases
and history endings alongside drops. Deployment trial includes the
numeric generation and its history verdict.

Read the diff as a change in authority:

* a new `allow` exposes a function, and a new `grant class:` entry opens it
  to every caller or every signed-in person;
* a new right on a `role` line, or a new `issue`, widens what every holder
  of the role may do;
* a changed `under` changes what the function may read and where it commits;
* a new entry in `acts` gives a path a grave act;
* an upward `relabel` adds the previous commit label to the path's `onceScopes` chain. Retries read earlier bindings at those scopes. New identities bind at the new commit label without a release;
* a removed `guards` entry, or a `where` guard turned `when`, weakens what is
  proved.

`bijection check` prints the same content as a summary, and, with a solver on
`PATH`, the acts the change newly forbids or allows. See
[`bijection check`](https://docs.bijection.com/development/cli/check#guards).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.