at.tensei.mapping
One source collection → user-shaped output (§4.1). Also defines the field, expression and presentation types that at.tensei.pipeline refers to.
Details · record, key tid
| Kind | record |
|---|---|
| Record key | tid |
| Authority | tensei.at |
| Indexed |
Record
record · key tidProperties
createdAt
stringWhen the mapping was created: a datetime as §3.1 reads one, which accepts forms atproto's `datetime` format does not, so the format is not declared.
guards
array§5 predicate leaves over source paths (§4.1); no all/any/not groups.
origin
refPresent on an adopted copy: the exact version copied (§1.3). Attribution and update-check input; execution never reads it.
presentation
refFor a standalone preview and to keep a migrated draft's choices; a pipeline's own presentation is authoritative after downstream edits (§3.8). Its entries must name fields in slots.
schema
refThe output fields: an object keyed by field names the user chooses, any non-empty name and not limited to a preset's, each value a #mappingField. The lexicon language has no map type, so the names and values are stated here rather than declared.
The NSID of the collection this mapping reads, and the only place its field names appear.
The document version. A document without one is the Phase-2 fixed-preset form, which is migrated explicitly to version 1 (§8.3) and never published as it is.
const: 1
viewType
stringThe built-in preset this mapping started from, as attribution only. It never adds, limits or requires a field (§3.8).
enum: review | bookmark
#fieldDefinition
objectA field's declared type and authored requiredness (§3.1). `required` is always written; validation supplies no default.
Properties
#fieldType
objectA declared output type (§3.1). `namespace` is required when `kind` is key and names the key namespace (§3.6).
Properties
enum: text | text[] | number | bool | datetime | uri | did | ref | media | score | key | json
namespace
ref#fixedPoint
objectA number that is not an integer, where no type is declared for it (§1.5): `value` is the number times 10⁶, rounded to six decimal places, so 0.4 is {value: 400000}. An integer is never written this way; it is written as it is. Wherever `$type` names this def, the object is that number. Not stated by the lexicon, and enforced by the reader: it holds no property but `$type` and `value`.
Properties
minimum: -999999999999999maximum: 999999999999999
#guard
objectA §5 leaf. `field` is a §4.2 source path. `value` is a scalar (a string, an integer, a #fixedPoint for any other number, or a boolean; never null or an object), or for in/notIn an array of scalars, and is absent for exists/notExists; the lexicon language has no type for a scalar of any kind, so `value` is not declared.
Properties
minLength: 1
#keyNamespace
stringenum: isbn | olwork | goodreads | hive | tmdb | url
#mappingExpression
objectA source-mapping expression (§4.3): path {path}, constant {value}, operation {op, inputs, args?} or lookup {input, from, to}. Not stated by the lexicon: which properties each kind requires; `value`, any JSON value, in which a number that is not an integer is a #fixedPoint; `args`, whose count and types each operation fixes (a string separator for split, join and concat, a string find and replacement for replace, an optional string format for parseDate, a non-zero divisor for divide, none otherwise; a number that is not an integer is a #fixedPoint); the input count (one, or one or more for coalesce and concat); §4.2 path syntax; and a nesting depth of at most 64 levels.
#mappingField
objectOne output field of a mapping (§4.1): a #fieldDefinition plus how this source fills it. An unmapped field has no `expr`.
Properties
by
stringenum: constraint | name | stats | model | human
confidence
integerProposal metadata: a number from 0 to 1, in fixed point, the value times 10⁶ (§1.5), as a bare integer: 0.4 is 400000.
minimum: 0maximum: 1000000
expr
ref#normalization
objectSource-specific input normalization (§4.1), not part of the shared field type. A mapped score field needs {kind: score, scale}, a mapped media field {kind: media, mediaKind}, and canonical {namespace} belongs on a uri field only.
#operationName
string§4.3's closed list of operations. A new operation is a spec change, not an extension point.
enum: split | join | wrap | first | trim | lower | replace | divide | parseDate | coalesce | concat
#origin
objectThe original record an independent copy was made from (§1.3, §8.3).
Properties
The CID of the exact version copied. The `cid` format accepts any spelling of a CID; the validator accepts only the form atproto writes: version 1, in base32, over a SHA-256 digest.
The record copied. Not stated by the lexicon, and enforced by the validator: exactly at://<DID>/<collection NSID>/<record key>, with a DID rather than a handle for its authority.
#predicateOp
string§5's closed list of operators.
enum: eq | ne | lt | lte | gt | gte | contains | notContains | startsWith | matches | exists | notExists | in | notIn
#presentation
objectHow the output is shown (§3.8); it never changes data or requiredness. Entries are unique by `field`, each names a field of the shape it presents, and `display` is allowed on a score field only.
Properties
enum: list | table | review | bookmark
#presentationField
object#scale
objectA source's score scale (§3.4), each bound in fixed point, the value times 10⁶ (§1.5), as a bare integer: a scale of 1 to 10 is 1000000 to 10000000. Not stated by the lexicon, and enforced by the validator: min < max.
#schemaPin
objectThe schema version the mapping was written against (§4.1, §11). Not stated by the lexicon, and enforced by the validator: `nsid` is the mapping's `source`; a published pin has `cid` and no `hash`, an inferred one `hash` and no `cid`.
Properties
cid
string · cidA published pin's version: the CID of the lexicon record. The `cid` format accepts any spelling of a CID; the validator accepts only the form atproto writes: version 1, in base32, over a SHA-256 digest.
hash
stringAn inferred pin's version: `sha256:` and 64 lowercase hex digits, a form the lexicon language cannot state.
minLength: 1
enum: published | inferred
resolvedAt
stringWhen the version was resolved: a datetime as §3.1 reads one, which accepts forms atproto's `datetime` format does not, so the format is not declared.
Similar lexicons
semantic matchLexicons whose schemas describe something close to this one. Check them before publishing a new one that overlaps.
-
at.tensei.pipeline
recordA Tensei pipeline, version 1 (spec §6, §7): source nodes reading through mappings, downstream nodes over the fields the user authored, and one output. Shapes on wires are derived from the graph, never stored. The atproto data model has integers only, so a number in the record is an integer written as it is, or any other number as an at.tensei.mapping#fixedPoint, the value times 10⁶ (spec §1.5). Where the lexicon language cannot state a rule the version-1 validator enforces, the property is left