Skip to main content

Module app_surface

Module app_surface 

Expand description

Which app surface the changes an app makes are decided against.

Every signed op names the content hash of its app’s surface.toml ([collab_types::SignedOp::surface]), the file the app’s package ships at its payload root. Whoever starts the app names that file (SURFACE_FILE_ENV) and its hash (SURFACE_HASH_ENV): the launcher the file in the package it runs, tilo-app run/dev the app’s committed file. The app reads it, checks the hash and registers it (register_named); an app’s own binary does not carry the file. A host that runs an app in its own process (the shell’s built-in apps, the web build) carries its committed file instead (register_built_in). The bytes are kept in the app’s content store, from where they reach the devices and relays that decide its changes.

Constants§

SURFACE_FILE_ENV
The variable naming the path of the app’s surface.toml.
SURFACE_HASH_ENV
The variable carrying the lowercase hex hash of that file, as whoever started the app read it.

Functions§

app_of_kind
The app that keeps records of kind kind, when this process knows it: a link naming the kind reaches the app that declares it without naming that app itself.
arrived
A surface became readable other than by being named: an app’s update installed it. A change decided against a surface that was not here may be decided again (registered moves).
bytes_of
The surface bytes of app_id, when this process carries them.
claims_of
The claims of the changes mutation carries, a change this process made to a record of app_id, each naming as units what its action may write (with_footprints): what the op that carries it is signed with.
hash_of
The hash of the surface app_id’s changes are decided against.
hash_of_kind
The hash of the surface the changes to a record of kind kind are decided against: its app’s.
keeps_person_record
parse_hash
Parse a lowercase hex hash, as SURFACE_HASH_ENV carries it.
person_record_kinds
The person-record kinds app_id’s surface declares (its ResourceApp::PERSON_RECORDS): the records it may keep in, or read from, the person’s own workspace. Empty when this process holds no surface for it.
reads_app
Whether reader’s surface declares that it reads a resource kind of owner’s (its reads): the read-only join to owner’s records an app may hold. False when this process holds either surface not.
refusal
Why a workspace refuses mutation, a change this process made to record of app_id, by what the app’s surface publishes, if it does: the check every receiver runs on its claims ([collab_types::check_claims_by_kind]), the grants aside, which the broker decides. None when this process holds no surface for the app: its receivers then hold the change until one arrives.
register_built_in
Name bytes, the committed surface of an app a host runs in its own process (built into the host, no package of its own), for app_id, unless a package already named one.
register_kind
Records of kind kind belong to the app app_id.
register_named
Name bytes, the surface file whoever started the app named, for app_id, when they hash to hash, the hash it was named with.
register_package
Name bytes, the surface the signed package app_id ships, as the one it runs with, replacing any its host held before (an update of the app).
registered
How many times an app’s surface was named in this process: a change decided against a surface that was not here may be decided again once this moves.
with_footprints
claims naming as units what each action may write by app_id’s surface: what a relay that cannot read a sealed change checks it against (devices that open it check what it really wrote). Every host that signs a change names its units this way; a claim left on the whole record is refused wherever the action may only write some of its units (a comment, a message). Unchanged when this process holds no surface for the app.