pub.techne.draft.query
A query over indexed records, as data: sent inline to pub.techne.draft.query.listRecords or countRecords, or published as a record in an app's own repo and run by its URI, so what an app reads is public. The platform runs it only over what the caller may read: every query is scoped to the viewer by the platform (public records not hidden; permissioned records the caller's own, or in a space whose read policy admits the caller now and not an act the reach limit withholds for its author: a held share or circle add), so there is no operator for access. Values that start with `$` are parameters: `$viewer` (the caller: compared with a DID, it matches any DID of the caller's person now, every account linked with the signed-in one, or only the signed-in DID while a sign-in method of one of them is frozen) and `$now` (the instant of the call) are filled by the platform, any other the caller passes in `params`; a published query is a template. Each record type declares which of its fields fill the shared roles in its `{collection}.query` document; a type with none is still listable by the roles every record has (`type`, `author`, `space`, `subject`, `written`, `uri`). Before running, the platform checks that every top-level `any` branch is driven by an index and refuses, naming the branch, if not. A feed is a query plus the signals it asks for plus its `weights`, which only the client applies. Draft tier.
Details · record, key any
| Kind | record |
|---|---|
| Record key | any |
| Authority | draft.techne.pub |
| Commit rev | 3n3iob7p3ko2u |
| Indexed |
Record
record · key anyProperties
any
arrayBranches, each naming its own view, for a list that reads curated records of one kind and records as written of another in one request (a feed of curated events and beacons). A record that matches two branches comes once. Instead of `where` and `view`.
minLength: 1maxLength: 8
createdAt
string · datetimecurated
booleanDeprecated: `view` replaced it. It has no default. Accepted beside `view` only when it agrees (true with `curated`, false with `asWritten`); alone, it is refused like a missing view, except from Beacon builds from before views through 2027-03-01, where true or absent reads unscoped branches curated and false reads every branch as written.
held
booleanOnly the signed-in caller's own permissioned records that the reach limit holds back from the people they would reach (each marked `held`; a held act, a share or a circle add, is answered to its author alone). No public record answers; an anonymous caller gets none.
default: false
limit
integerThe page size when the call names none.
minimum: 1maximum: 500default: 50
order
stringExactly one thing to order by: a role (`written`, newest first; `start` or `end`, soonest first), a measure named by `as` (a `near` distance, nearest first; a `matches` rank, best first), or `shuffle` (one deterministic order per `seed`: the same seed answers the same order on every call and across pages; a shuffle sorts all its query matches, so every branch must be driven at its top by a `near` or by an author, space, subject, URI or reference with `is`/`in`). Ties break on the record URI. Default `written`. Ordering by a role lists only records that have it; a measure orders only a query with one branch (two branches could give one record two numbers).
maxLength: 64
seed
stringThe seed of `order: shuffle`, a literal or a parameter (`$seed`); required with it and refused without it.
minLength: 1maxLength: 256
signals
arrayNumbers the platform attaches to each result from data the client does not have. They never filter.
maxLength: 8
view
stringWhich public records the branches of `where` read: `curated` (the commons' listed records: one curated record per thing, merged from its sources by a curator the commons root trusts, moderated, not hidden; an event only inside the supported areas) or `asWritten` (every public record as its author wrote it: each source copy and the curated record, not hidden, not superseded). Required with `where`, never beside `any` (each branch names its own there): there is no default. `curated` on a branch whose `type` names a type no curator covers is refused with NotCurated, naming the type. A permissioned record is read the same way in both views (it is never curated). Beacon builds from before views, which name none, are answered with the old default through 2027-03-01 (the last day).
maxLength: 16knownValues: curated | asWritten
weights
arrayFor a feed: how the client combines measures and signals into one rank. The platform never reads them.
maxLength: 16
#branch
objectOne branch of a query's `any`: its view and what it selects. A `where` whose top is itself an `any` makes one branch of each child, all in this view.
#closeness
objectGraph hops from `from` (only `$viewer` today) to the result's author over the viewer-scoped graph walk: 0 for the viewer's own records (any DID of the viewer's person now); absent when the walk does not reach the author, and for an anonymous caller.
Properties
maxLength: 64
#condition
objectOne operator and its value. A string value starting with `$` is a parameter.
Properties
after
stringAn RFC-3339 instant, or a parameter (`$now`); strictly after.
maxLength: 64
as
stringThe name of the number an operator produces (`near`: metres away; `matches`: rank), in letters, digits, `.`, `_` and `-`. Default `<role>.<operator>`.
maxLength: 64
before
stringAn RFC-3339 instant, or a parameter (`$now`); strictly before.
maxLength: 64
covers
stringOn `location`: a point (`<latitude>,<longitude>`, an H3 cell, or a `$param`) that a stated area contains.
maxLength: 64
followed
booleanWith `in` or `covers`: also match a record through the subject its type declares (a receipt through its recipient), one hop.
in
arrayAny of these values; each is a value or a `$param` (a param holding a list adds all its values). On `location`: the areas (at most 8).
maxLength: 100
maxLength: 2048
is
stringmaxLength: 2048
kind
stringWith `in` or `covers`: the kind of stated location to match (`serves`, `registered`, ...). Default `at` (is at).
maxLength: 64
matches
stringWords the text must hold (all of them); the last word may be the start of a word, as typed so far. Produces a rank, best first.
maxLength: 256
#has
object`has`: some public record the caller may read (not hidden, not a hidden or suspended account's, not across a block) names this record through the role `via`, by this record's own author when `by` is `author`, and matches `where`. One index probe per record the branch reads; it narrows a branch and never drives one. It counts as one condition, plus one for each leaf in `where`. A `has` inside a `has` is refused.
Properties
by
string`author`: only a record in this record's own author's repo. Any other value is refused.
maxLength: 16knownValues: author
The other record's role that holds this record's AT-URI: a URI role every record has other than its own `uri` (today only `subject`).
maxLength: 64
#near
object#node
objectOne node of the `where` tree: exactly one property. `all` (every child holds), `any` (at least one holds; at the top level each child is a branch the platform runs on its own index), `not` (a list of one node that must not hold; it narrows and never drives a branch), `has` (some other record names this one; it narrows and never drives a branch), or a leaf naming one role with one condition. A leaf that produces a number (`near`, `matches`) is allowed only at the top of a branch.
Properties
author
refThe DID whose repo holds the record. Operators: is, in.
category
refThe record's category, one exact token (declared per type; a place's Overture `categories.primary`, e.g. `park`). Compared whole, never as a substring. Operators: is, in. It narrows a branch and never drives one.
end
refWhen it ends (declared per type; a type may assume a duration when the end is not stated, and then a start at a midnight in its own stated offset, never the reader's zone, runs at least to the next midnight in that offset, a day). Operators: before, after.
has
refSome public record the caller may read names this one through the role `via`. Under `not`, none does (an anti-join).
location
refWhere it is. Operators: near (declared per type: a point or cell within a radius, never an area); in (a list of up to 8 areas, each the AT-URI of an area record (a type whose query document declares `extent`; placeV2 today) or a `$param`: a stated location whose centre lies in one of them); covers (a point: an area the record states, such as one it serves, that contains the point). in and covers read every stated location (any type with a location or a subject), take `kind` and `followed`, are allowed only at the top of a branch, and give each record `matched`, the locations that matched (entry, kind, asserter, source; at most 8). They match public records only: the index they read holds public records, so a permissioned record never matches them (near does). In the curated view only the author's own locations and claims by writers the commons root endorses count, with the precedence rerun over them; as written every claim is weighed. A read whose `near` or `covers` point or `in` area lies outside this operator's coverage, or names an area not held here, is answered with `notServedHere`.
references
refAT-URIs it names in the fields its type declares, which may include its subject; a DID is named as its repo AT-URI `at://{did}`. Operators: is (names this one), in (names any of these).
space
refThe space a permissioned record counts in (at://{authority}/{spaceType}/{skey}); a public record is in none. Operators: is, in.
start
refWhen the thing the record describes begins (declared per type). Operators: before, after.
subject
refThe record the record is about (its indexed subject). Operators: is, in.
text
refIts words (declared per type). Operator: matches.
type
refThe record's collection NSID. Operators: is, in.
uri
refThe record's own AT-URI. Operators: is, in.
written
refWhen the record was indexed. Operators: before, after.
#roles
queryRoleCatalogThe shared roles, as data: what each role is, the operators it takes, the index column that drives it, and the order it lists in. Kinds: `nsid`, `did`, `space`, `uri`, `uris` (a list of AT-URIs), `micros`, `instant`, `location`, `text`, and `token` (one exact string, compared whole: never a substring). `every` roles are on every record; the others are filled per type by its `{collection}.query` document. A new role is one generic column and its index, added once for every type, and goes through review like a new space policy.
#signal
objectOne server-side signal: exactly one kind, and the name it is attached under.
#weight
objectSimilar lexicons
semantic matchLexicons whose schemas describe something close to this one. Check them before publishing a new one that overlaps.
-
The platform's generic list query: one page of the records a pub.techne.draft.query names, in its order. Every record is read through the platform's one read path, whatever the query says: no record of a hidden or suspended account is answered, nor, to a signed-in caller, another's record across a block either way (the caller blocked its author, or its author blocked the caller); a public record also leaves out anything moderation holds back (a trusted verdict or `!takedown`); a permissioned rec
-
Records by URI, as listRecords answers them: the query `{"view": "asWritten", "where": {"uri": {"in": uris}}}`, as written (a read scoped to named records), each only if the caller may read it. A URI the caller may not read, or that names nothing, is left out: as in every generic read, that includes a record whose author is blocked either way with a signed-in caller (see `includeBlockedByMe`), or whose account is hidden or suspended. In the order asked. With `curated`, each URI answers as the cu
-
How many records a pub.techne.draft.query names: the records listRecords would answer for it (the same read path, the platform's `decide` on every record answered as written or permissioned, and a curated `location` `in`/`covers` match settled again over the locations the curated view trusts), each once, so the count is what paging the list to its end would answer. The count stops at 1000 (`capped`). The query's `order`, `limit` and `signals` are ignored, so a record without the role a list is o
-
pub.techne.draft.query.composeRecords
procedureUp to 12 generic reads in one call. Each step is a pub.techne.draft.query.listRecords call (a list step) or a pub.techne.draft.query.getRecords call (a get step) and answers exactly as that method would for the same caller. A step runs once the steps it binds to have answered (at most 4 at once); the answer does not depend on which finished first. A binding, a string `$<step>.<output>` in a list step's `params` or among a get step's `uris`, stands for that output over the earlier step's records,