README.md

place.mode.standard lexicons #

AT Protocol lexicon schemas for the open style standard built on the Mise en Mode approach, documented at standard.mode.place.

Status: v1 settled — the community review window is closed. The schemas are frozen: evolution from here is additive-only (new optional fields and new aspects, never a removal or a tightened constraint).

A theme is a user-owned record that maps CSS values to the canonical Mise en Mode intent tokens — an intent-based style identity that travels with a person across any conforming application on the network. In the book's terms: a theme is the intent → value mapping; an expression is the concept it serves — and it is the theme's record key (a bare word like dark for a common concept, or a reverse-DNS string like com.alice.midnight for your own), so a repo holds at most one theme per expression; a mode is a theme applied for its expression (the data-mode binding), not a stored record.

Lexicons #

NSID Type Purpose
place.mode.standard.defs defs Shared type definitions (intent shapes, font descriptor)
place.mode.standard.theme record (any — rkey is the expression) A self-contained theme, keyed by the expression it serves (dark, com.alice.midnight, default): an aspects container (color / typography, each complete when present) of intent → CSS value mappings. One look serving several concepts = several records (same values), synced by the owner's tooling; the protocol has no alias field
place.mode.standard.profile record (self) Participation declaration + verification anchor (no default-theme pointer — the baseline look is the theme saved at record key default)

The intent model is the canonical set of 33 resting-state intents from the Mise en Mode book: color for control / action / surface, typography for text. control has no priority; the others carry primary / secondary / auxiliary. All values are plain CSS strings.

Development #

Authored in TypeScript with prototypey and compiled to JSON. This repo uses Bun.

bun install
bun run lexicon:emit     # src/lexicons/*.ts -> lexicons/place/mode/standard/*.json
bun run lexicon:gen      # smoke test: lexicons/*.json -> ./generated (typed client via @atproto/lex-cli)
bun run lexicon:fixtures # validate the standard.mode.place demo themes against ./generated

lexicon:gen verifies the emitted JSON round-trips through the ecosystem's standard toolchain: it runs @atproto/lex-cli's gen-api over the schemas and writes a typed TypeScript client to generated/ (gitignored — a verification artifact, not a deliverable; the standard intentionally ships no SDK). Consumers who want typed records can run the same command against these JSON files in their own projects.

lexicon:fixtures then runs the demo themes from the standard.mode.place site through that generated validator — the same path a consumer's code takes — so a schema change that would break real themes fails here. It expects that repo checked out beside this one; set FIXTURES_DIR if yours lives elsewhere.

The emitted JSON under lexicons/ is committed — it is the canonical schema artifact, laid out by NSID path as ecosystem convention expects; the TypeScript under src/ is its authoring source. The JSON is published to the mode.place PDS as com.atproto.lexicon.schema records; the lexicon authority is established by the _lexicon.standard.mode.place DNS TXT record.

Publishing #

The lexicons are published. All three resolve as com.atproto.lexicon.schema records on the mode.place account, at at://did:plc:rvraq37xlwydvov7laldai6a/com.atproto.lexicon.schema/<nsid>.

lexicon:check re-verifies that the network still matches local — run it after any schema edit to catch drift. lexicon:publish re-writes the records, which from here is only for shipping additive changes: v1 is frozen, so new optional fields and new aspects are fine, removals and tightened constraints are not.

bun run lexicon:check     # dry run: validate local JSON, report network state; never writes
bun run lexicon:publish   # the real thing — gated, see below

lexicon:check validates the three documents, resolves the target account (mode.place by default), and reports per NSID whether the network already has it and whether it matches local (drift detection after publishing).

lexicon:publish writes each schema to the account's com.atproto.lexicon.schema collection with rkey = NSID. It refuses to run unless all of these hold:

  1. LEXICON_PUBLISH_APP_PASSWORD is set in the environment (an app password for the account; never stored). LEXICON_PUBLISH_IDENTIFIER overrides the default mode.place account.
  2. The _lexicon.standard.mode.place DNS TXT record already equals did=<the account's DID>, so the records are resolvable the moment they exist. (Already live for mode.place — lexicon:check reports it with a ✓.)

There is intentionally no CI workflow for publishing — it is a local, manual, reviewed act.

Getting the app password #

The credential is an app password for the mode.place account — a revocable, limited-scope password its PDS (tngl.sh, hosted by Tangled) can mint. Any of these works:

  • Via bsky.app (works for accounts on any PDS — it resolves the host from the handle): sign in as mode.place with the account's main password, then Settings → Privacy & Security → App Passwords and create one named e.g. lexicon-publish.
  • Via Tangled's account settings, if app-password management is exposed there.
  • Directly against the PDS: createSession at https://tngl.sh with the main password, then com.atproto.server.createAppPassword with the returned token.

Use the app password, not the account's main password (createSession would accept either): an app password can't manage the account and can be revoked the moment publishing is done. Set it for one shell session only — it is read from the environment and never written anywhere:

# bash                                      # PowerShell
export LEXICON_PUBLISH_APP_PASSWORD=…       $env:LEXICON_PUBLISH_APP_PASSWORD = "…"
bun run lexicon:publish                     bun run lexicon:publish

Afterwards, revoke the app password where you created it.

License #

MIT