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 (
registeredmoves). - bytes_
of - The surface bytes of
app_id, when this process carries them. - claims_
of - The claims of the changes
mutationcarries, a change this process made to a record ofapp_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
kindare decided against: its app’s. - keeps_
person_ record - parse_
hash - Parse a lowercase hex hash, as
SURFACE_HASH_ENVcarries it. - person_
record_ kinds - The person-record kinds
app_id’s surface declares (itsResourceApp::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 ofowner’s (itsreads): the read-only join toowner’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 torecordofapp_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.Nonewhen 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), forapp_id, unless a package already named one. - register_
kind - Records of kind
kindbelong to the appapp_id. - register_
named - Name
bytes, the surface file whoever started the app named, forapp_id, when they hash tohash, the hash it was named with. - register_
package - Name
bytes, the surface the signed packageapp_idships, 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 claimsnaming as units what each action may write byapp_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.