Skip to content

Latest commit

 

History

History

core

Folders and files

README.md

allthings-core

The data layer the Worker (web/) runs on: repositories over Postgres with Effect SQL, and the migrations that define the schema.

One catalog

The site's pages, the MCP tools (which the CLI and the Claude plugin call), the v1 API and the feeds all say which evenings and people there are. They must say the same, so each fact is stated once, in src/catalog.ts, as a typed SQL fragment, with its TypeScript twin where something is sorted or decided in code. Every public read builds its statement from it.

  • Which evenings are public: published(e). An evening is found by its long slug, its short link or a link it had before (resolve), the short link winning.
  • Their order: soonestFirst(e) and latestFirst(e), ids breaking ties, and the Order that selectEvents sorts by.
  • Ahead or over: ahead(e, now) and ended(e, now), which agree with eventStatus (live through its end) at every instant, a test holds. now is one instant for every surface, asOf (src/clock.ts): the Clock's, at the start of its minute. The pages, the feeds, the MCP tools and the v1 API all read it, never the time itself; the guard below lists the code that reads the time for its own work.
  • Ours or shared: ours(e). Whether a surface counts the evenings we share is a named choice, never a filter written inline.
  • Which year: inYear(e, year), the year an evening starts in on San Francisco's calendar (yearOf(e)), so an evening at 11pm on December 31st is that year's though UTC has moved on.
  • An evening's lineup: its talks in running order, each talk's speakers in the order they were attached, with their part; its hosts, as attached; its people, by role. talksOf, hostsOf and peopleOf read them in that order, each surface choosing the fields it publishes, and talkOrder, speakerOrder, hostOrder and peopleOrder are the orders themselves, for a statement that joins them its own way. A talk's links (its recording, slides, code) are artifactsOf it, in artifactOrder.
  • A person's appearances: their talks (talkAppearances) and their parts in evenings as a whole (roleAppearances) at published evenings, each scoped by whose evenings (ours or any) and when (any, or once ended), latest evening first (latestTalkFirst, latestAppearanceFirst). /people is our evenings' at any time; a person's page, every evening's; /about counts ours once over, and a year (src/year.ts) counts the same at that year's evenings; the sitemap lists everyone at any; the speakers list (list_speakers, /api/v1/speakers) counts our evenings' talks once ended, and the talks library (/talks, src/talks-library.ts) lists those talks, each evening's lineup by talksOf.

Each surface still reads in one statement, since from a Worker every round trip costs more than the query, and builds it from these fragments. What a surface adds is how it shows what the catalog selects: home's limits, its hero (always ours); /events and /talks by year; an event page's posts, schedule, notes, venue and guest count; the people page's groups and its X-follower order; the API's and the tools' published fields, long slugs, limits, search and error texts. None of that decides which evenings or people there are, or their order.

tests/catalog-guard.test.ts reads core's and the Worker's source and fails on any file that states one of these rules itself (selecting by is_draft, a comparison on end_date, curation = '…', an ORDER BY on start_date, or a lineup's order) outside src/catalog.ts. It lists the code that isn't a public read (the Luma sync, the organizers' tools, the reports), each with why; the list only shrinks, and a listed file that states no rule fails it too. tests/catalog.test.ts holds the fragments to the schema, ahead and ended to eventStatus at every instant around an evening's start and end, and each scope of a person's appearances.

web/tests/parity.test.ts holds the surfaces to each other over one seeded database at one instant: the same evenings in the same order from list_events, /api/v1/events, the feed, /events and home; the same lineup from get_event, /api/v1/events/:id and the event page, by every link; the same people and talks from list_speakers, /api/v1/speakers, /talks, /people, people's pages, /about and the sitemap, and each evening's talks on /talks in its page's running order; and whose each evening is, from list_events and /events.

The public contract is src/contract.ts, the one source of it. The CLI's zod copy (cli/src/schemas.ts) is held to it by tests/contract.test.ts, which the core workflow runs whenever cli/src changes. The old app's schemas and answers are legacy: where tests still compare the Worker with the answers it recorded before it was deleted (web/tests/support/app.ts), it is on the fields the app had.

Luma sync

src/luma/ is the hourly Luma calendar sync, carried over from the old app, as Effect services for a Worker cron to run: Luma reads the calendar's public iCalendar feed over HttpClient (retrying 429, 5xx, timeouts and dropped connections), and LumaSync writes it to events in one statement, touching only the events Luma changed, so updated_at says when it last did. Which columns Luma owns, and which the site does, is written down in src/luma/sync.ts. Nothing in the tests reaches Luma.

LumaSync.rehearse is the dry run. It runs the same statement in a transaction that always rolls back, and reports every event the sync would create and every column it would change, before and after. Nothing is committed. bun run sync:rehearse prints that report for the database at DATABASE_URL. Run it as site_sync, the role the sync writes as, so the dry run also proves the role's grants:

DATABASE_URL=$(op read "op://allthings/allthings site_sync/credential") bun run sync:rehearse

Every op:// reference in this repository reads the allthings 1Password vault. Your own op session (the 1Password desktop app integration) can read it, and agents read it with OP_SERVICE_ACCOUNT_TOKEN. infra/vault-items.json lists the vault's items and their fields, and tests/vault.test.ts fails on a reference to anything it doesn't list. An item still to be made is listed pending; bun infra/scripts/vault-items.ts checks the list against the vault itself.

The studio's connection

The event studio's commands connect as studio, a login role made by infra/scripts/studio.ts: plan, readiness, luma create, update, publish, cover, registration and hosts, luma:drafts --add and --forget, social bluesky, discord and x, posts, photos, people photo, hosts logo, talks, community, proposals and collab (all but collab access end-sessions, which reaches only Cloudflare). Its connection string is the 1Password item "allthings studio" (credential), so every one of them runs as

DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run plan search "trivia"

and every invocation in this README says so; tests/vault.test.ts fails on one that doesn't.

Every studio write also says who is writing: ALLTHINGS_ACTOR, set once in the environment, like erik, andre, erik/claude-personal or erik/claude-work. A write refuses to run without it, and writes nothing; reads never ask. It is a label the person or agent declares, not proof of who they are: everyone shares the one studio role. Per-person roles would make it proof, if that's ever needed. A write that touches a draft evening puts it in that evening's log (see "A draft's log, notes and status").

Every command also tells allthings.dev when it ends that its data may have changed (src/site-refresh.ts, through Database.scriptLayer), so a change shows on the site within about two minutes rather than the hour it checks on its own (web/src/page-store.ts). A command connected to Neon reads the site's token from 1Password itself (op read of "allthings site refresh", signed in as you are), so nothing has to be exported; SITE_REFRESH_TOKEN in the environment wins when it is set. When neither has it, the command says so on stderr; nothing else changes. tests/site-refresh.test.ts holds every script to the layer.

  • Exactly what its commands use. The script lists each grant with the command whose statement needs it: planning's tables, the collaboration's included, read whole and written by column; on public, reads of only tables site_reader already reads (and community_metrics and community_gaps, which bun run community reads and the site never shows), and writes of only the columns the studio writes (a draft's stored event, its program, its cover, the lineup publish copies, photos and their images, a profile's photo, a host's logos, a talk's title, description and speakers, posts).
  • Every row of the collaboration, and only there by policy. Its tables have row security, which the studio doesn't bypass: its own policies (migrations/0029_studio_collab.ts) show it every row, and its grants say what it may do with them. collab and readiness check they see every row (planning.collab_row_counts(), one of the two functions it is granted, counts them as their owner) and refuse, or leave it out, otherwise.
  • No DELETE on an evening. luma:drafts --forget removes a draft through planning.forget_draft() (migrations/0030_forget_draft.ts), the other function it is granted, which deletes as its owner and only a draft nothing public, no idea and no collaboration points at: a grant can't hold DELETE on events to drafts.
  • Nothing for migrations. No DDL, no ownership, no other function, no sequence, no TRUNCATE, and no BYPASSRLS. Its statements, lock waits and idle transactions time out at 30 seconds or less.
  • Proved. tests/studio-role.test.ts makes the role with the script's statements and holds every column of public and planning to its grants, both ways, and its catalog privileges to the script's list exactly. bun run test:studio runs the studio's own suites as the role.

The database owner's connection is for migrations only. It is never stored in the vault, nor in any repository secret: the maintainer fetches it with neonctl when it is needed, and passes it without printing it:

DATABASE_URL=$(bunx neonctl@latest connection-string br-round-dust-a6avtg0r \
  --project-id wispy-sea-75401301 --org-id org-broad-sea-60121176 \
  --role-name neondb_owner --database-name neondb) \
  bun run migrate --dry-run

Production is the Neon project wispy-sea-75401301, branch br-round-dust-a6avtg0r, database neondb, owner role neondb_owner, in the Neon organization All Things Web (org-broad-sea-60121176), which is Andre's. neonctl reaches it only signed in as an account that is a member: Erik's is [email protected]; [email protected] is not a member, and neonctl answers it with "not an organization member". Check before fetching anything:

bunx neonctl@latest me          # Email: the account neonctl is signed in as
bunx neonctl@latest orgs list   # must list org-broad-sea-60121176  All Things Web

If the org isn't listed, sign in as a member (bunx neonctl@latest auth opens the browser), or ask Andre to invite your Neon account to All Things Web. Without it, nothing here needs the owner but migrations and the backfills below.

Until they have a role of their own, the backfills still need it, so only the maintainer runs them (OWNER_ONLY in the script says why): hosts, lineups, programs, curation, event-extras, external-talks, talk-artifacts and luma:people. They rewrite the public record from reviewed files: they create profiles and companies, and delete talks and people's parts, which no role in the shared vault should be able to do. Filling profiles from a people file (bun run people) has its own role, profile_editor, and needs no owner (see "Filling in profiles").

Image ingestion

src/ingest/ is the image half of the hourly sync, carried over from the old app, as an Effect service, ImageIngest. It fills in three kinds of missing image:

  • each event without a cover gets its Luma cover
  • each profile without a photo gets the one at its photo_source_url
  • each post gets its image and its author's avatar

Downloads are HTTPS only, from a per-kind host list, with every redirect checked first, a 15 MiB cap, and a check that the bytes are an image.

Processing goes through Pictures. In the Worker that is Cloudflare's Images binding, because the app's sharp, heic-convert and openimg don't run in Workers. HEIC, HEIF, WebP and AVIF are stored as JPEG (the app stores PNG), and other formats keep their bytes.

Storing an image means putting it in the MediaBucket under a new key. Then one statement records it in images and sets it on its row, only while the row still has none. An object stored for nothing is deleted again.

Each phase starts nothing new after its budget, and pending is the dry run: it lists what would be fetched and fetches nothing.

Who took part

event_people holds a person's part in an event as a whole: an allthings organizer, a co-host or the MC. Who was on stage, and in what capacity, is on the talks: talks.format (a talk, a panel or a fireside chat) and each speaker's talk_speakers.role (speaking or moderating), so a panelist is a panel's speaker and a fireside's guest is its speaker (src/people.ts). Events.getPublished returns all of it, with Luma's guest counts.

An evening's talks run in order: event_talks.position, from 0, and event_talks.starts_at where the start is known. Pages, the public API, promotion drafts and the completeness report all list talks by position; a talk attached without one follows, in the order it was attached. A lineup in backfill/lineups.json sets both per talk (position, startsAt with its offset, "2026-09-30T18:41:00-07:00"); it never clears them, so unplacing a talk is a manual update of that one row:

UPDATE event_talks SET position = NULL, starts_at = NULL, updated_at = now()
WHERE event_id = $1 AND talk_id = $2;

A lineup can also correct the record. An event is found by its Luma id, or by slug where it has none, and its remove lists what the evening didn't have, each with its sources: talks to take off it (a talk on no other evening is deleted with its speakers) and people's parts in it (by an existing profile and role).

A lineup can name the companies that hosted an evening (hosts), each by its exact name in sponsors and with its sources, where Luma doesn't list the company's own account as a host. They are only ever added; a company the database lacks comes in through backfill/hosts.json first.

Editing a talk

bun run talks update edits a talk that exists (src/talk-edits.ts): its title, its description (editor HTML, as the site stores it) and its speakers. The old admin did this. A lineup never changes a talk's title or description, and never takes a speaker off a talk it keeps. What a run isn't given stays as it is. talks list prints an evening's talks, in page order, with their ids and speakers.

  • Speakers are the talk's whole list, in the order its page shows them, one --speaker each, by profile slug or id, with :moderator for a moderator. A changed list replaces the old one in talk_speakers, in that order.
  • --dry-run prints each value as it is and as it will be, as a diff, and an approval token for that change. It changes nothing.
  • --approve <token>, with the same values, locks the talk and works the change out again in one transaction. It refuses unless the change still hashes to the token, so a title or a speaker changed in between stops it.
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run talks list effect   # ids, titles, speakers
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run talks update <talk id> --title "…" --description-file talk.html \
  --speaker ada-lovelace --speaker grace-hopper:moderator --dry-run
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run talks update <talk id> --title "…" --description-file talk.html \
  --speaker ada-lovelace --speaker grace-hopper:moderator --approve <token>

Speaker order: X followers

Speaker lists are ordered by how many follow each person on X, most first. Nobody picks this order; it is how the order is decided. Among equal counts, and among people without one (who always come after everyone counted), the list keeps its own order (byFollowers in src/followers.ts; /people's speakers: whoever took part latest first).

Each profile keeps a snapshot, x_followers with x_followers_at, read from public data: X's own API with the app's bearer token (X_BEARER_TOKEN), by user id, up to 100 accounts a request, $0.010 each on pay-per-use, or the keyless FixTweet API without it. The sync Worker refreshes the missing and oldest snapshots on its schedule, a bounded number per run, reading for at most its window (30 s); a handle X doesn't know, or a failed read, leaves the snapshot as it was, and the least recently tried go first (x_followers_tried_at), so a handle that keeps failing never holds the slots. A count is only ever its handle's: changing or clearing twitter_handle clears the snapshot (a trigger, in both migrations), and a count read while the handle changed is not stored.

A profile knows its X account by its numeric user id (x_user_id), which never changes: people change handles, and X lets others take a freed one. The refresh stores the id the first time it reads a handle. A handle whose account has another id now is never adopted: it is cleared, the id is kept, and x_handle_lost records it for the completeness report ("person whose X handle is now someone else's"). A source that can look an account up by id (X's own API; FixTweet can't) reads by id, and a renamed account's new handle is stored as it is. Editing a handle by hand forgets the old account: its id, its count and a lost handle. The post search knows X authors by id too.

DATABASE_URL=… bun run followers --dry-run   # read the counts, write nothing
DATABASE_URL=… bun run followers             # store them
DATABASE_URL=… bun run followers --stale-days 0 --max 1000   # re-read everyone

The community's numbers

community_metrics keeps the community's public numbers, one snapshot a day (UTC), so they have a history (src/community-metrics.ts, migrations/0037_community_metrics.ts): a row per day, source and metric. community_gaps (migrations/0038_community_gaps.ts) keeps the days a source couldn't be read for a known, temporary reason: a row per day and source, with the latest reason, the tries and the first and latest try.

Source Metrics Read from
x followers, following, posts, listed X's API, @allthingswebdev by its user id, with the app's bearer token
bluesky followers, following, posts app.bsky.actor.getProfile for allthingsweb.dev
youtube subscribers, views the channel's public page (YouTube has no keyless API)
discord members, online the server's invite, with counts
meetup members Meetup's GraphQL, the group's member count
luma guests, checked_in, events the database: the sums of published evenings' Luma counts
npm downloads_day, downloads_week npm's downloads API for allthings
github stars, forks GitHub's API for this repository, from GitHub Actions (below)

The sync Worker takes it in each hourly run (community): it reads each source the day has no row for yet and stores what it reads, never replacing a value (the day's first stays). A source not read is read again the next hour, and the step's log line names it, as one of two kinds:

  • A gap (gaps): known and temporary, so it never fails the sync. A rate limit (429) or a refusal (403), which public APIs answer Cloudflare's shared addresses at times; the source down (5xx) or not answering; npm's counts of a package too new to have them (404). Each is recorded in community_gaps, with what the answer said about when to ask again (Retry-After, a rate limit's remaining and reset, Cloudflare's 1015). Discord is asked once more within the run when its 429 asks to wait 5 s or less (its Retry-After, else its body's retry_after); only a second 429, or a longer wait, is a gap.
  • A failure (failed): someone has to act. An answer that isn't what it should be, any other status, a missing key, the database; and a gap that has lasted, a source with no number for three days, today included (gapDays). The step fails (needsAction), and with it the run's summary, which is what the sync's alerts read (infra/README.md, "Alerts").

tests/community-metrics.test.ts ("which outcomes count as failures") holds each case. X bills each read, so it is read once a day at most: only in the run of the day's first hour (UTC), whatever comes of it. A dry run reads every source but X (whose read is billed), those the day already has too, so it checks each integration, and stores nothing: it reports what it would store (wouldStore, only what the day lacks) and whether this hour's run would attempt to read X. It writes as site_sync, which may read which sources the day has (day, source, metric) and insert rows, but never update one, and read the events' Luma guest and check-in counts for Luma's sums; migration 0037 grants exactly that, as infra/scripts/site-sync.ts lists; it records gaps with the columns migration 0038 grants it (inserting a day's row, then updating its reason, tries and latest try), never reading a reason. Nothing in either identifies anyone.

GitHub's API refuses the Worker most hours: it reads without a key from Cloudflare's shared addresses, whose hourly allowance others use up. So GitHub Actions takes GitHub's snapshot too (.github/workflows/community.yaml, four times a day): bun run community-snapshot --only github reads it with the run's built-in GITHUB_TOKEN and stores it as site_sync (NEON_SYNC_URL), through the same snapshot, so the day's first value stays and the Worker leaves GitHub alone once the day has it.

The studio reads both, day by day, a line per source and metric, gap on a day a source had a gap and no number, then each gap with its reason and tries:

DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run community             # the last 14 days
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run community --days 90

Luma descriptions

The feed's DESCRIPTION is only a link to the event's page, so each evening's words come from Luma's API (description_md, the Markdown of Luma's editor). src/luma/description.ts makes it rich text the way talk descriptions are kept: headings become bold paragraphs, images, rules and raw HTML go, and the rest passes sanitizeRichText. It also takes a one-line summary: the leading sentences, up to 200 characters, of the first paragraph that reads as prose.

src/luma/descriptions.ts writes both to events.luma_description and luma_summary, which Luma owns: each import makes them what Luma has now. events.description is the site's own, for an organizer to say it differently, and nothing from Luma writes it. The event page's "About" row shows the site's description when it says something, and Luma's otherwise. The tagline stays the site's too: while it is the sync's placeholder ("See Luma for event details and registration."), the summary stands in for it on the page, in its structured data and in the feed (src/tagline.ts). The four " at All Things Web" taglines the app's first sync wrote became that placeholder in the migration.

Drafts' descriptions come with the draft refresh (see "Drafts the feed doesn't carry").

The hourly sync imports descriptions after the events and images, in a window of their own (web/src/sync/run.ts). Luma's API says nothing about when an event changed (no updated_at or ETag, and the feed's SEQUENCE is the feed's own time), so each run asks about the evenings never asked about, or not over a week ago, and two older ones in turn: with about 30 older evenings now, each is asked about again every 15 hourly runs (longer as they grow), and an hour's run asks about a handful, not every evening. To run it now, for every event, from core/:

DATABASE_URL=… LUMA_API_KEY=… bun run luma:descriptions --dry-run   # ask Luma, print what would change
DATABASE_URL=… LUMA_API_KEY=… bun run luma:descriptions             # write it

tests/luma-descriptions.test.ts runs the conversion, the client against fixtures and the import against tests/seed.sql; nothing reaches Luma.

Talks given elsewhere

external_talks holds talks people gave away from our evenings: at conferences, other meetups, on podcasts and in videos. Each has its event (the conference, meetup, podcast or channel), its kind, the day, its page and recording where they exist, and where its facts were read and when. ExternalTalks.forProfiles reads them, latest first, for person pages.

backfill/external-talks.json carries them from public sources (YouTube, conference and meetup pages, podcast pages, people's own sites). What could not be confirmed, a date or a same-name speaker above all, is kept under held with its reason and never written.

DATABASE_URL=… bun run external-talks --dry-run   # what would be written, rolled back
DATABASE_URL=… bun run external-talks             # write it, in one transaction

Applying is safe to repeat: a talk is known by its speaker, title and day, and one already there only takes corrected links and sources.

What talks left behind

talk_artifacts holds a talk's links: its recording, its slides, its code (repo), its site, or something else. Each is a row, so whatever adds one later, the recorder in the room or a speaker sharing their slides, needs no new column. A link may have a label, and a recording of the whole evening has the talk's start_seconds. A link from the same talk given somewhere else says where (elsewhere, "Chain React 2024"). A talk's links are shown in position order, and go with it if it is deleted.

The talk's own recording, the one its title links to, is its first recording with no elsewhere, played from its start (talkLinks and playAt in src/talk-artifacts.ts). Every surface reads the links with the catalog's artifactsOf and artifactJson, so it is the same one everywhere.

backfill/talk-artifacts.json carries links found in public sources, each with the page that confirms it (it names the talk, or our evening, and the speaker) and the day it was read. A talk's links are listed in the order they are shown. What only looks right is kept under held with the question for the speaker that would settle it, and never written. The run refuses a talk whose stored title differs, a link listed twice, a start on anything but a recording, and a talk that would have two recordings of its own.

DATABASE_URL=… bun run talk-artifacts --dry-run   # what would be written, rolled back
DATABASE_URL=… bun run talk-artifacts             # write it, in one transaction

Applying is safe to repeat: a link is known by its talk and URL, and one already there only takes corrected details. Links the file doesn't list are kept.

Hidden venues

While Luma shows an event's venue to guests only ("location_visibility": "guests-only"), its calendar feed hides it: LOCATION is the event's own page and DESCRIPTION says "Check event page for more details". The sync takes that as no venue, so an event it creates then has none and keeps none (All Things Sync, 2026-04-29, at CodeRabbit's rooftop, was one). Luma's API gives the address all the same, and src/luma/venues.ts fills in each published event's missing venue from it, the way the sync writes a venue the feed shows. It never replaces a stored venue, and keeps any field an organizer wrote. The hourly sync does it after the events (web/src/sync/run.ts); to run it now, from core/:

DATABASE_URL=… LUMA_API_KEY=… bun run luma:venues --dry-run   # ask Luma, print the venues
DATABASE_URL=… LUMA_API_KEY=… bun run luma:venues             # write them

The completeness check fails on any published evening without a venue, however old, since Luma always knows where one was.

Where Luma's venue is wrong, the organizers' replaces it: a venue in an evening's entry in backfill/lineups.json, with its sources, written by bun run lineups and marked events.venue_by_organizer. From then on neither sync, core's nor the app's, nor the venue fill changes it (All Things Sync was on CodeRabbit's 18th-floor rooftop, not the 12th floor Luma lists).

Drafts the feed doesn't carry

Luma's calendar feed carries no private event. Once the sync has stored an event as a draft (it went private, or was made private), the feed never says what became of it, and its row keeps the name and times it had: the draft stored as JS Trivia Night on 2026-04-29 is Markdown Trivia Night on 2026-05-22 on Luma. src/luma/drafts.ts asks Luma's API about every draft we know, by its Luma id, and writes what Luma owns where it differs: the name, the times, the venue unless the organizers set one, and its description and summary, converted as the import of published evenings converts them (so the draft preview shows its About text). It only reads from Luma. Whether an evening is a draft stays the feed's: one Luma now shows publicly comes back in the feed and the sync publishes it, so the refresh only reports it. An event Luma no longer shows us (403, or 404 once cancelled) is left as it is: the refresh names it, with the command that forgets its draft (below). The hourly sync does it after the venues (web/src/sync/run.ts); to run it now, from core/:

DATABASE_URL=… LUMA_API_KEY=… bun run luma:drafts --dry-run   # ask Luma, print what would change
DATABASE_URL=… LUMA_API_KEY=… bun run luma:drafts             # write it

For the same reason, an evening made private from the start (bun run luma create) never reaches the database by the feed. --add <evt-…> stores one: it asks Luma's API for the event and inserts it as the sync would have, as a draft, with the sync's slug and placeholder tagline. It refuses an event that isn't private (the feed brings those in) and one already stored. From then on the refresh keeps it in line.

DATABASE_URL=$(op read "op://allthings/allthings studio/credential") \
  LUMA_API_KEY=$(op read "op://allthings/allthings Luma API key/credential") \
  bun run luma:drafts --add evt-… --dry-run   # what it would store
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") \
  LUMA_API_KEY=$(op read "op://allthings/allthings Luma API key/credential") \
  bun run luma:drafts --add evt-…   # store it

A draft whose private event was deleted on Luma (replaced by another, say) stays a draft until it is forgotten: the refresh lists its Luma id as not shown to us, every hour. --forget <slug or evt-…> removes it, only when both say so:

  • Luma's API answers 403 or 404 for its event, asked first; and
  • the database finds nothing that keeps it, asked by planning.forget_draft() (migrations/0030_forget_draft.ts) as its owner, with the evening locked: it is still a draft, with no short link; nothing public points at it (people, talks, hosts, photos, posts, schedule, notes, short links, review sessions); it was never claimed for a publish (planning.publishes) or posted about (sent_posts); no idea is its or was inspired by it (relink it first, plan idea update); and it has no collaboration. A refusal names each, with its rows, and writes nothing.

Then, in one transaction, it adds its line to the draft's log, as ALLTHINGS_ACTOR, and deletes its private lineup and talks (draft_people, draft_talks, draft_talk_people) and the evening, and its stored cover (the images row the ingestion keeps of its Luma cover, migrations/0031_forget_draft_cover.ts) unless anything else points at it; the object in the bucket stays, as a replaced photo's does. Its log and notes, and the collaboration's audit, are kept: no foreign key holds them to it. --dry-run asks Luma and the database the same and says what it would delete and keep.

DATABASE_URL=$(op read "op://allthings/allthings studio/credential") \
  LUMA_API_KEY=$(op read "op://allthings/allthings Luma API key/credential") \
  bun run luma:drafts --forget <slug or evt-…> --dry-run   # what it would delete and keep
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") \
  LUMA_API_KEY=$(op read "op://allthings/allthings Luma API key/credential") \
  bun run luma:drafts --forget <slug or evt-…>   # forget it

Luma people import

The calendar feed names no hosts and counts no guests. src/luma/api.ts asks Luma's official API (GET /v1/events/get on public-api.luma.com) with a Luma calendar's API key, which needs Luma Plus, in LUMA_API_KEY; without it the import does nothing. src/luma/people-sync.ts asks about every published event, matches hosts to profiles as src/luma/people.ts plans it, and writes event_people (its own rows only), profiles.luma_user_id, and events.luma_guest_count and luma_checked_in_count, in one statement.

Hosts are matched by Luma user id, then by exact name with a review line. A host whose Luma user id is a hosting company's (sponsors.luma_user_id, from backfill/hosts.json) is that company: it is attached to the event as a hosting company (event_sponsors, only ever added), never matched to a person. Nothing is created without an organizer's decision: Luma's hosts include companies' accounts not yet on record and people under other names. The hourly sync attaches hosting companies the same way for evenings that ended within the last week (src/luma/company-hosts.ts), and reports the hosts whose Luma account is neither a company's nor a profile's; people stay this import's. Run it from core/:

DATABASE_URL=… LUMA_API_KEY=$(op read "op://allthings/allthings Luma API key/credential") \
  bun run luma:people --dry-run                          # ask Luma, print the plan and what to review
bun run luma:people --create usr-… --link usr-…=<profile id> --dry-run   # decide the hosts it listed
bun run luma:people --create usr-… --link usr-…=<profile id>             # write

tests/luma-people.test.ts runs the client against fixtures in the shape docs.luma.com documents, and the import against tests/seed.sql; nothing in the tests reaches Luma.

What kind of evening

events.program says what an evening was: talks (a lineup on stage), an open-floor (community demos with no fixed lineup), social (a hangout, trivia, an after-party) or a hackathon. It's talks unless an organizer says otherwise, and is_hackathon, which the public API still publishes, must agree with it. Only an evening of talks is asked for talks, and the event page says an open floor was open to anyone before any demos it knows.

core/backfill/programs.json names every event's program, each sourced to its Luma page, with a note wherever the evening had no lineup. Run it from core/; it lists any event the file doesn't name:

DATABASE_URL=… bun run programs --dry-run   # do everything, print it, roll back
DATABASE_URL=… bun run programs             # write

Short links

The lockup is the link (brand/foundations.md, "Name"): allthings/effect lives at allthings.dev/effect. src/short-slugs.ts is the rule, taking evenings in the order they start:

  1. An evening's base is its topic as a URL segment (react native → react-native, web show & tell → web-show-and-tell), or its name when the name yields no topic.
  2. It takes the first of these that no other evening holds and no page is at: the base, then the base with its month in San Francisco (web-2024-11), then the day (web-2024-11-12), then a count.
  3. A shared evening is someone else's, never allthings/anything, so its link is under shared/ (shared/typescript-ai-demo-day). The bare root is the lockup's alone, and a shared name can't take a topic ours might want.

A link, once given, is that evening's for good. The first evening of a topic keeps the bare one, and a later evening of the same topic is dated, so nothing printed, posted or put in a QR code ever comes to mean another evening. event_slugs records every link given (its key holds each to one evening), and events.short_slug is the one in use. events.slug, the app's long slug, stays as the app serves it.

The Worker serves an evening at its link: its pages, lists, sitemap, feed, canonical URL, card, structured data, calendar file and promotion drafts all use it. Its long slug, and any link it had before, redirect there (301): Luma's descriptions, posts and QR codes link the long ones. An evening without a link yet is served at its long slug. The v1 API and the MCP tools keep the long slug as the app publishes it, and get_event takes any link, as the evening's page does: the long slug, the short link, or one it had before (resolve in src/catalog.ts).

src/slugs.ts gives every published evening without a link its own; drafts get none, so a cancelled evening holds no link. The hourly sync does it after the events (web/src/sync/run.ts). To run it now, from core/:

DATABASE_URL=… bun run slugs --dry-run   # the links it would give
DATABASE_URL=… bun run slugs             # give them

To move an evening to another link, add the new one to event_slugs for it, then set events.short_slug to it (a foreign key holds the link to the evening's own); the old one keeps redirecting.

Ours, or shared

events.curation says whose evening an event is: ours, or shared, someone else's evening we share with our community because we think it's good. A shared event names who organizes it, events.organized_by, a company in sponsors (the table that already holds companies with their sites and handles, so pages link out and drafts tag them); the database holds a shared event to having one, and only it. Rows.Curation is the discriminated type: { kind: "ours" } or { kind: "shared", organizer }.

What follows from it:

  • A shared evening is named as written, never allthings/ (eventTopic), on its page, in lists, in feeds and on its card.
  • /events and home list it in the same rows, marked "shared · by Mastra". Home's hero is always our next evening, and its photos (the wall) are of ours.
  • Its page says who organizes it, linked to their site, and has no "your hosts". Its structured data names the organizer, not us.
  • /about's numbers count our evenings alone, and the people page and the speakers list (list_speakers, /api/v1/speakers) list who was on stage at ours; people from a shared evening are on its page.
  • The MCP tools say whose an evening is: curation (ours or shared) and organizer (its name and site; null for ours), and the CLI marks a shared one "shared · by Mastra". The v1 API publishes curation and organizedBy.
  • Completeness asks a shared evening for no organizers, MC or topic.
  • Promotion drafts recommend it, by its organizer, and say why; it gets no Luma description or Meetup listing of ours.

core/backfill/curation.json names the shared evenings and their organizers, sourced; an organizer the database lacks is added, one it has is kept as it is. Run it from core/:

DATABASE_URL=… bun run curation --dry-run   # do everything, print it, roll back
DATABASE_URL=… bun run curation             # write

Completeness

src/completeness.ts lists what each published event's record lacks. It's a pure function over what one statement reads, so the same rows always give the same report:

  • talks, for an evening of talks (see "What kind of evening", below), and each listed talk's speakers and description
  • the event's people and an organizer among them
  • everyone named on the event: title, bio, photo, links
  • hosts, with their logo and about, and their website and X, Bluesky or LinkedIn
  • venue address, the lockup's topic, a description (the site's or Luma's), a tagline that is no placeholder or a summary to stand in for it, a cover
  • for past events: photos, a recording link, and Luma's guest count

Links, cover, recording and guest count are optional; the rest is required. Nothing reads text for meaning, so a description's tense is not judged.

DATABASE_URL=$(op read "op://allthings/allthings site_reader/credential") bun run completeness          # table, then each event's gaps
DATABASE_URL=… bun run completeness --json   # the same, for tools
DATABASE_URL=… bun run completeness --check  # also fail if an evening of talks that ended in the last 30 days has none,
                                             # or any published evening, past or upcoming, has no venue

It only reads, so the read-only site_reader role is enough. .github/workflows/completeness.yaml runs --check against production every Monday and puts the report in the run's summary.

Posts about events

event_posts holds posts about each event on X, Bluesky and LinkedIn. Each row has the post's canonical URL (unique), its plain text, its author, when it was posted, and a status: approved shows, hidden was taken down, pending waits for an organizer. Nothing approves itself. Images are kept as their source URLs, and the hourly sync copies them into the media bucket (src/ingest/). Pages show only those copies.

src/posts/ reads a post from public sources that need no key. X posts come through the FixTweet API (api.fxtwitter.com), Bluesky posts through the public AppView. LinkedIn serves nothing public, so its text and author come from whoever adds the post; the time comes from the post's id. Then it stores the post, approved. Adding a post that is already there changes nothing.

DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run posts add <event slug> <post url> [--dry-run]
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run posts add <slug> <linkedin url> --author-name "…" --text "…" [--author-url …]
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run posts apply [--dry-run]   # every post in backfill/posts.json

tests/posts.test.ts runs against recorded answers; nothing in the tests reaches X, FixTweet or Bluesky.

Finding posts

src/posts/candidates.ts finds posts about evenings on its own. For each evening it searches Bluesky's public search (app.bsky.feed.searchPosts, keyless) and, once the X app has a token, X's search, for posts that link the evening's Luma page or its page on the site, name it, or come from or mention the people on its stage, from two weeks before it to a week after. Each post is scored the same way every time (scoreCandidate: a link to the evening, its name, "allthings" with its topic, a host, its people, the night itself), and the ones that score at least 5 are added as pending. Nothing is approved here: an organizer approves or hides each.

DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run posts find --dry-run   # the last week's evenings, scored, nothing written
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run posts find --past   # every evening so far
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run posts pending   # what waits for review
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run posts approve <post url>   # show it on its evening's page
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run posts hide <post url>   # never show it

X is searched only with X_BEARER_TOKEN (1Password: "allthings X app" in the allthings vault); recent search reaches seven days back, and X_SEARCH=archive uses full-archive search where the app has it. The sync Worker searches the last week's evenings on its schedule and queues what it finds as pending. As site_sync it can add posts only through public.queue_event_post (migrations/0018_pending_posts.ts), a SECURITY DEFINER function with its search path pinned that checks every field and inserts nothing but pending posts; the role holds no INSERT on event_posts, and EXECUTE is revoked from everyone else.

An evening's links, to search by, are its Luma page (on luma.com and lu.ma), its short links (event_slugs, allthings.dev/aie) and its long slug on allthings.dev and allthingsweb.dev.

Sweeping one evening

The agent running an evening keeps its page's posts live with a sweep (src/posts/sweep.ts): the same search for that one evening, named by its long slug or short link, from two weeks before it to a week after, whether or not it has started. It adds what scores enough as pending, then prints what is new, what it found again, and every post of the evening waiting for review. A sweep adds nothing it added before, so running it again is safe. --every <minutes> sweeps again at that interval until the evening's window closes; run it in the background for the lead-up and the night.

DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run posts sweep aie --dry-run   # what it would add
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run posts sweep aie --every 30   # until a week after

X's search needs a paid key, so X is searched in a browser instead. bun run posts x-searches <slug or short link> prints the searches to run on x.com, each with its URL: one for each of the evening's links (its short link and Luma page first), its name, its topic with "allthings", and its people saying allthings or mentioned with it, held to the evening's window by day. Copy each result's post URL into a file, one a line (a line starting with # is a note), then add them all at once. Each post goes in once, however often the file names it, as pending; one that can't be read is reported and the rest go on.

DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run posts x-searches aie
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run posts add <long slug> --from x-posts.txt [--dry-run]

An evening's photos

src/photos.ts adds photos to an evening. Each file is re-encoded the way the bucket keeps photos (scripts/encode.ts: upright, at most 4096 pixels on its long edge, JPEG at quality 88, every bit of metadata stripped, so no location), stored through the upload Worker under events/<event id>/<sha-256 of the file>.jpg, and recorded in images and event_images. Pages list an evening's photos by event_images.created_at, so one run adds its photos in the order given, after those already there. The key is the file's contents, so adding a file again changes nothing, and an object an interrupted run stored is reused only when it serves exactly the bytes made. Objects are stored first, then one transaction writes every row.

Every photo needs its alt text, one --alt per file in the files' order, saying what the scene shows ("Effect 4.0 merged live on stage at CodeRabbit"), never naming people from their faces. HEIC is not read: export JPEGs first. Run it from core/ with the studio's connection string (see "The studio's connection") and the upload Worker's URL and token (see scripts/reencode-originals.ts):

DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run photos add effect a.jpg b.jpg --alt "…" --alt "…" --dry-run   # encode, check, roll back
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") \
  MEDIA_UPLOAD_URL=$(op read "op://allthings/allthings media upload/url") \
  MEDIA_UPLOAD_TOKEN=$(op read "op://allthings/allthings media upload/token") \
  bun run photos add effect a.jpg b.jpg --alt "…" --alt "…"

To replace one of an evening's photos, say with a retouched copy, name it by its position on the page (from 1) or its image id. The new photo is encoded and stored as above and takes the old one's place in the order. In the same transaction the old link and its images row are deleted, and only when nothing else points at that row (imageReferences, which a test holds to the schema's foreign keys). That is checked before anything is stored, so a refusal stores nothing, and again under the transaction's lock. The old object stays in the bucket: nothing deletes one.

DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run photos replace effect 5 retouched.jpg --alt "…" --dry-run   # encode, check, roll back
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") \
  MEDIA_UPLOAD_URL=$(op read "op://allthings/allthings media upload/url") \
  MEDIA_UPLOAD_TOKEN=$(op read "op://allthings/allthings media upload/token") \
  bun run photos replace effect 5 retouched.jpg --alt "…"

To take a photo off an evening, list its photos, then remove one by its position on the page (from 1) or its image id. --dry-run prints exactly what would change, and an approval token for it, and changes nothing. --approve <token> makes that change in one transaction, after working it out again under lock. It refuses if anything moved since the dry run: the photo, its place, or what else points at its images row. The photo's link is deleted. Its images row goes too, but only when nothing else points at it; otherwise the output names what still uses it. The object stays in the bucket, and the output says so. Neither step needs the upload Worker, and list only reads.

DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run photos list effect   # positions, image ids, alt texts
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run photos remove effect 5 --dry-run   # what would change, and its token
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run photos remove effect 5 --approve <token>   # exactly that change

tests/photos.test.ts runs it against tests/seed.sql with a media origin that only keeps what it is given.

From the Photos library on Erik's Mac

bun run photos library <slug or short link> reads the Apple Photos library on this Mac (scripts/photo-library.ts, through osxphotos, which uv runs pinned) for the photos taken from an hour before the evening to an hour after, San Francisco time. It never writes to the library. Being in the library doesn't make a photo Erik's: anything in a shared album, a shared moment or an iCloud Shared Library, or Shared with You, is left out, by osxphotos's filters and again by what the library says of each photo (isOwn), his own shared ones too. So is a photo the library says nothing of on any of those four. It keeps what the library says of the rest in ~/Desktop/allthings-photos/<date>/library.json, copies each one's still preview (which the library keeps even for a photo only in iCloud) into previews/, and draws a shortlist the same way every time:

  1. A photo less sharp than a quarter of the set's median is blurred and left out.
  2. Of photos that are the same shot (difference hashes within 10 bits), the one the library scores best stays.
  3. A close-up (one to three faces) is shortlisted only when the library names every face in it as someone on the evening's stage or running it. Any other close-up is a guest's: it is listed for Erik to pick, never shortlisted. Crowds, rooms and the stage are fine.
  4. The rest are taken by kind in turn (the stage, a crowd, the room, close-ups), best first, up to --max (8).

Look at the previews, pick, then export the picks at full size into candidates/, as JPEG named by uuid, and add them as above with alt text written from looking at each one. A photo only in iCloud is downloaded through Photos, which macOS asks Erik to allow once (System Settings > Privacy & Security > Photos, for the app this runs in); when macOS refuses, the command says exactly what to allow. Only the evening's own photos, as the library has them when it runs, can be exported, and each export must leave a new file, or the command fails naming the photos it didn't write. --dry-run reads the library and draws the shortlist from the previews where the library keeps them, and writes, copies and exports nothing.

DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run photos library agent-setups --dry-run   # the shortlist, nothing written
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run photos library agent-setups   # previews and the shortlist
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run photos library agent-setups --export <uuid> --export <uuid>   # the picks, full size

Other people's photos are never copied: they come in as their posts (see "Posts about events"), which pages show with their author's name and a link, so the photo stays theirs.

The home lab's wall, faces and tally

The home lab (web/src/pages/lab/, at /lab/home) tries heroes that show how big allthings is. Beside home it reads Community (src/community.ts), in one statement: the about page's tally (held and tally in src/about.ts, which /about reads too), a wall of photos, and faces.

  • The wall is core/backfill/wall-photos.json: about forty photos of crowds and energy across many evenings, picked by looking at every photo, in the order the wall shows them. Each is shown only as a photo of the evening it names, which must be one of ours, published and over, with the image on the media origin; each carries its evening's date and short link. Home's slash grid shows the wall too. When the lab can show none of them, it shows every photo of our evenings held, latest first.
  • Every evening held comes with the photo that stands for it, for the lab's contact sheet: its first on the wall, else its first attached, or none, latest evening first.
  • The faces are core/backfill/faces.json: people who have been on stage at our evenings, by profile id, whose profile photo is of them (a logo or a drawing is left out). The lab shows each while the profile has a photo on the media origin and has been on stage at one of our evenings held. When it can show none, it shows everyone on stage with a photo, latest first.

bun run hero-photos fails, naming each, when a page can't show one of the wall's photos or faces (a photo's images row is deleted when it is replaced or removed), and .github/workflows/hero-photos.yaml runs it against production when either file changes, on main, and every Monday.

DATABASE_URL=$(op read "op://allthings/allthings site_reader/credential") bun run hero-photos

Running an evening's page

One agent runs each evening and keeps its page live, from two weeks before it to three days after, with the commands above. <slug> is the evening's short link (aie); the commands that need the long slug print it.

When Do
T-14 days Start posts sweep <slug> --every 360 in the background: a sweep every six hours, until a week after the evening.
T-14 to T-1, daily The X pass: posts x-searches <slug>, run each search on x.com (read only), put the posts' URLs in a file, posts add <long slug> --from <file>. Then review.
The night Stop the six-hourly sweep and start posts sweep <slug> --every 30. The X pass every hour from an hour before to three hours after. Review each time.
T+1 day The X pass and review. The photos: photos library <slug>, look at the previews, pick, photos library <slug> --export <uuid>…, then photos add with alt text written from looking at each one.
T+3 days The last X pass and review. Stop the sweep. Anything still pending goes to Erik as a question.

Review from posts pending --slug <long slug>, each post once:

  • Approve a post by us (allthings, Erik, Andre, the evening's organizers) about the evening, and a clear post about the evening by someone who came or is coming.
  • Hide a post that isn't about the evening: another event, a search's false match, spam.
  • Leave pending, and ask Erik in the run's report, anything that names other companies' events or sponsors, complains, is about a person more than the evening, or that you aren't sure of.

Photos: Erik's come from his Photos library, his own only; a guest's close-up goes up only when Erik picks it. Other people's photos come in only as their posts, which the page shows with their author's name and a link. Never copy them.

DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run posts sweep aie --every 360   # the lead-up, in the background
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run posts x-searches aie   # the X pass's searches
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run posts pending --slug <long slug>   # what to review

The guide

The allthings guide (/guide) stars happenings beyond our evenings the way the Michelin guide stars a restaurant: three stars are worth a special journey, two a detour, one a stop. The stars are the organizers' judgment, written by hand in core/backfill/guide.json, never counted or voted.

It is editorial, as the wall is: it names other people's conferences and evenings, which we neither host nor sync, so it is a file, not a table. src/guide.ts decodes it at import and refuses an entry without a sentence of why, an official https site and a source for its facts, or one named twice. A next edition's days are written only once its organizers announce them, and the guide shows them through the edition's last day in San Francisco; the site's version names the start of the day after as a boundary (guideBoundaries, src/site-version.ts), so no kept page shows days that are over.

Agents and scripts read the same guide, as of the same clock, from the MCP server's get_guide and from /api/v1/guide: the contract's Guide (src/contract.ts), which toGuide builds, each entry with what its stars mean and its place on the page, /guide#<id>.

The letter

The allthings letter is one a month, written by Claude and sent only once Erik has read it and said y. Each issue is a file in core/letters/ (2026-12.ts), listed in core/letters/index.ts; src/letter.ts decodes it at import. Its sections come in one order (our next evenings, happenings worth your time, new open source, papers, jobs, then a closing paragraph), and a section with nothing real in it is left out. Each item names its data: an evening by its short link, a guide entry by its id, a talk by its id. Happenings may only name the guide's entries and evenings the site publishes, so nothing reaches the letter that isn't already out.

letterFindings holds an issue to our voice (src/voice.ts) and to the letter's own rules: a word budget per section and 400 words in all, one question at most, no greeting and no "this month" opener, and every link https, written as words, to what the issue names or a page of this site. tests/letter.test.ts fails on any issue that breaks one.

An issue is published (its page, the API, the MCP server, the sitemap) only once core/letters/approvals.json holds Erik's y with the approval token of exactly what he read (src/approval.ts); change a word and it is a draft again; so does a new address for a guide entry it names, since the token covers where each item links. publishedLetters is the only way a surface reads them.

Before Erik reads an issue, approve --dry-run checks its evenings and talks against the database (sourceFindings): each evening a published one at that short link, ours and not yet over in our next evenings, and each talk given at the evening it names. It prints the token only when the issue breaks no rule, and --approve refuses one that does.

Agents read the published issues from /api/v1/letters, /api/v1/letters/<yyyy-mm> and the MCP server's get_letter: the contract's Letter (src/contract.ts), which toLetter builds.

bun run letter list            # every issue, draft or approved
bun run letter show 2026-12    # as it reads, its budgets and findings; no database
DATABASE_URL=$(op read "op://allthings/allthings site_reader/credential") bun run letter approve 2026-12 --dry-run
DATABASE_URL=$(op read "op://allthings/allthings site_reader/credential") bun run letter approve 2026-12 --approve <token>   # only on Erik's y for that token

Erik's edits to a draft become rules in src/letter.ts or src/voice.ts where they generalize, and examples in core/letters/before-after.json where they don't: every after must read in our voice, and no issue may say a before again. bun run letter show counts his edits to an issue by kind (cut, reword, fact); fewer cuts over time is the measure.

Schedules and notes

Some events' pages say more than the record: a hackathon's schedule, its awards, theme and how teams form. event_schedule_items holds an event's schedule in order, each step's time as the organizers wrote it ("1 - 7 pm", "~7:00 pm"); event_notes holds rows of the page under their own label ("Awards", "Theme"), with bodies in editor HTML that are sanitized as talk descriptions are. EventPages reads both, and the Worker's event page shows a Schedule row and a row per note.

core/backfill/event-extras.json carries what the app's own pages for four events said (three hackathons at Sentry and NextDev.fm Live), with the pages as sources. Who hosted NextDev.fm Live and who was its guest is in core/backfill/lineups.json: a fireside chat its hosts moderated.

For each event the file names, it is the whole schedule and the whole set of notes: applying replaces anything else, and changes nothing where the database already matches. Run it from core/:

DATABASE_URL=… bun run event-extras --dry-run   # do everything, print it, roll back
DATABASE_URL=… bun run event-extras             # write

Filling in profiles

backfill/people.json fills what profiles of people on published events lack: a title, a bio, X, Bluesky and LinkedIn handles, and a photo, and what they do now (and, below, their standout posts on X, which are found and refreshed through X's API with the app's bearer token). Every other fact carries the URL it was read from and the day it was read, taken from public, keyless sources: the person's own X or Bluesky profile, GitHub, their site, a company team page or a conference speaker page. A value no one page holds all of lists the others under also, and one written at an organizer's request, as a best attempt before the person gives their own, says so under askedBy: who asked, the day, and their words.

  • A filled column is kept; only blank ones (or handles stored as empty strings) are set. The one exception: a fact may name the exact stale value it replaces (was), and replaces it only while the column still holds just that. A photo source is never replaced once its image is copied.
  • A title is the person's job title now, as of the day it was read (their talks already say when they spoke), and never a stale one: "Role, Company" only when a public page from the last 12 months says so, just the company when only that is confirmed ("Moss"), and otherwise their part at our evenings, as the site names it ("Speaker, at/ai").
  • A bio is the person's own words, at most trimmed or put in the third person, or one an organizer asked for (askedBy): two or three sentences in the site's voice on what they build, what they're known for and what they did at allthings, every claim on a page the fact lists. A terse profile line is no bio.
  • A photo is only ever a photo_source_url on a host the hourly ingestion copies from (profilePhotoHosts in src/ingest/remote.ts), which then makes it the profile's image.
  • Anything uncertain, a same-name collision above all, is kept under held with its reason and never written.

It runs as profile_editor, from any machine, with no owner and no neonctl: its connection string is the 1Password item "allthings profile_editor" (field credential) in the allthings vault, read with op signed in to the 1Password account that holds that vault (the desktop app, or OP_SERVICE_ACCOUNT_TOKEN, as the agents' service account does):

DATABASE_URL=$(op read "op://allthings/allthings profile_editor/credential") bun run people --dry-run   # what would be filled, rolled back
DATABASE_URL=$(op read "op://allthings/allthings profile_editor/credential") bun run people             # fill it, in one transaction

[file] is backfill/people.json unless given, relative to core/ or absolute. When it ends, the command tells allthings.dev its data changed with the site's own token (see "The studio's connection"), which needs no database role.

  • Exactly what the pipeline does. migrations/0034_profile_editor.ts makes the role and grants it, on public.profiles alone, SELECT of the columns src/people-enrichment.ts reads (the id, the name and each value it compares) and UPDATE of those it writes: title, bio, the X, Bluesky and LinkedIn handles, photo_source_url, now_record, x_posts (granted by migration 0036) and updated_at. No INSERT or DELETE, no other table, no DDL, no function but PUBLIC's; its statements time out as the studio's do. Anything else people might do one day takes a migration first.
  • Its login is set by infra/scripts/profile-editor.ts, run by the maintainer with the owner's connection once the migration is on production: --dry-run shows it, --apply sets a new password, stores the connection string in "allthings profile_editor" without printing it, and signs in with what 1Password holds. Rerun --apply to rotate it.
  • Proved. tests/profile-editor-role.test.ts holds the role's catalog privileges to the lists above, tries every column of public and planning both ways, and runs the whole pipeline as the role.
  • people photo is the studio's (below), and people stale --speakers reads as site_reader.

What they do now

An entry's now is what the person does now (docs/now.md, src/now.ts): a line of one or two sentences whose every fact is a [phrase](https://source) link, up to four links to their own recent work (latest first, each with its title, its day or month, and its kind), and checkedOn, the day it was all read. It is stored whole in profiles.now_record (migration 0032).

  • Only this file writes it, so a record is written whenever it differs from the stored one: no was is needed to refresh it.
  • "now": null takes it down and keeps it off: the person asked, or it was wrong. An entry without now leaves the column as it is.
  • A claim that couldn't be confirmed goes under held as "field": "now", beside the record it was left out of.

bun run people stale prints, as JSON, the records checked --days (90) or more days ago, oldest first, with their held claims, for an agent to look at again under docs/now.md's rules. --speakers adds everyone who has spoken at one of our evenings and never had a record. --organizers adds, as organizers, judged on the printed today (the UTC day, as readiness judges them, and as every day in the file is, so a check recorded with it counts at once), everyone who organizes or co-hosts an evening of ours not over yet whose title and bio the file hasn't both read in the last 90 days, with those evenings: what readiness blocks a draft on, and what to check before any evening ahead. It reads the database too: site_reader's connection sees the published lineups, and a role that may read planning adds each draft's lineup as planned (readiness checks those on the draft itself). Only these two read the database, and site_reader's connection is enough for both:

bun run people stale --days 90
DATABASE_URL=$(op read "op://allthings/allthings site_reader/credential") bun run people stale --speakers
DATABASE_URL=$(op read "op://allthings/allthings site_reader/credential") bun run people stale --organizers

Their posts on X

An entry's xPosts are the person's standout recent posts on X (src/x-posts.ts): up to three of their own posts, latest first, each its address (https://x.com/<handle>/status/<id>), the day it was posted, a short quote of its words (at most 140 characters, one line) and its likes, reposts and replies, with readOn, the day it was all read. It is stored whole in profiles.x_posts (migration 0036), and their page shows it after the bio as "On X · as of" that month: each post a link to X, never an embed, with its day, the quote and its counts.

It sits beside now rather than in it. now is a line about what someone does, every fact sourced, written by hand; these are picked from what they posted by how people took it, and their counts are read again by a command. A post is never in both: bun run people refuses one that the profile's now also links, from its line or its links, as the file or the database holds it.

  • Like now, only this file writes it, so a record is written whenever it differs from the stored one; "xPosts": null takes it down and keeps it off, and an entry without xPosts leaves the column as it is.
  • Every post must be by the profile's X handle, as stored or as the same entry sets it, and readOn can't be after the day it runs.
  • Picking them: bun run people posts --find prints, as JSON, up to --top (8) of each person's own posts of the last --days (90) days, no reposts or replies and none without words of their own, ranked by likes plus twice their reposts and quotes, with each one's whole text. Replies don't count: a giveaway draws them. A person whose stored X id now posts under another handle gets none, and is told to run bun run followers first. The ranking only orders the list; an agent picks up to three that stand out for building software (their work, a launch, an idea, a talk), not the most liked giveaway, and writes each in as the command printed it, the picks latest first by postedOn (the record refuses any other order). It writes nothing.
  • Refreshing them: bun run people posts --refresh reads the counts of every post the file holds again (--days limits it to records read that many days ago or more), drops each one X no longer serves (deleted, or its account private or suspended: X's terms say such a post must go), takes down a record left with none, and writes the file for review and bun run people. --dry-run only prints. bun run people stale lists, as posts, the records read --posts-days (30) or more days ago.

Both read X's own API with the app's bearer token, read only, which bills each post it returns ($0.005, once a UTC day per post) and each account it looks up ($0.010): --find reads at most --read (100, and at least 5, the fewest X answers a page) posts a person, after looking the account up once where the profile has no X user id yet; --refresh reads one per post the file holds, up to 100 a request, and drops a post X now gives as another account's. --cache <dir> keeps every answer that reads as one for the rest of its UTC day, so a rerun is free; a dry run reads it but keeps nothing new. --find reads the profiles' handles from the database, where site_reader's connection is enough:

DATABASE_URL=$(op read "op://allthings/allthings site_reader/credential") X_BEARER_TOKEN=$(op read "op://allthings/allthings X app/Bearer Token") bun run people posts --find --only "Ada Lovelace" --cache /tmp/x-cache
X_BEARER_TOKEN=$(op read "op://allthings/allthings X app/Bearer Token") bun run people posts --refresh --dry-run

A photo from a file

bun run people photo sets a profile's photo from a local file, for a person whose photo no public source has. The profile is named by its id, its slug (as /people/<slug> has it) or its exact name, if only one profile has it. The file is encoded as the photos are (upright, at most 4096 pixels on its long edge, JPEG, or WebP where it is see-through, every bit of metadata stripped). It is stored through the upload Worker and recorded in images, with the old admin's key and alt text: profiles/<name>-<image id>.<jpg|webp> (profilePhotoKey, as the ingestion keys photos) and the person's name. src/profile-photo.ts sets it through src/image-columns.ts, as hosts logo sets logos:

  • Deterministic. The image id comes from the profile and the file's SHA-256, so the dry run names the exact id, key and URL.
  • --dry-run prints exactly what would change, and an approval token for it. It stores and writes nothing.
  • --approve <token> refuses before storing anything unless the change still hashes to the token. It checks the token again in its transaction, with the profile and its old photo locked.
  • The old photo loses its images row only when nothing else points at it, such as a post's author avatar. Its object stays in the bucket.
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run people photo ada-lovelace ada.jpg --dry-run
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") \
  MEDIA_UPLOAD_URL=$(op read "op://allthings/allthings media upload/url") \
  MEDIA_UPLOAD_TOKEN=$(op read "op://allthings/allthings media upload/token") \
  bun run people photo ada-lovelace ada.jpg --approve <token>

Hosting companies' links

Each hosting company (sponsors) may store its own website, its X, Bluesky and LinkedIn handles and its Luma account, each checked for its shape by the database (the Luma account is also unique: one company per account; the people import attaches the company to the events Luma lists it as a host of). The event page links a host's name to its site, promotion drafts tag and link hosts, and the completeness report flags a host without a website or without any handle.

backfill/hosts.json holds them as researched from each company's official site and profiles, every fact with the URL it was read from. What could not be confirmed is left out, or kept under held with its reason, and never written. A company the database doesn't hold yet is added when its entry says what it does (about, sourced).

DATABASE_URL=… bun run hosts --dry-run   # what would change, rolled back
DATABASE_URL=… bun run hosts             # write it, in one transaction

Applying is safe to repeat; a column the file doesn't name is left as it is.

Their logos

bun run hosts logo sets a company's two square logos from local files: one for dark backgrounds (square_logo_dark) and one for light (square_logo_light). The company is named by its exact name or its id. Each file is encoded as the photos are (scripts/encode.ts: upright, at most 4096 pixels on its long edge, JPEG, or WebP where it is see-through, every bit of metadata stripped). It is stored through the upload Worker and recorded in images, with the old admin's key and alt text: sponsors/<name>-<dark|light>-<image id>.<jpg|webp> and "Acme dark logo". src/host-logos.ts sets them through src/image-columns.ts.

  • Deterministic. The image id comes from the column, the company and the file's SHA-256. So the dry run names the exact id, key and URL, and setting the same file again changes nothing.
  • --dry-run encodes and reads, and prints exactly what would change and an approval token for it. It stores and writes nothing, and needs no upload credentials.
  • --approve <token> works the change out again and refuses before storing anything unless it hashes to the token. It stores each new object, checks the media origin serves exactly those bytes, and then, in one transaction with the company and the logos it replaces locked, checks the token once more and writes.
  • A replaced logo loses its images row only when nothing else points at it (imageReferences); otherwise the output names what still uses it. Its object stays in the bucket.
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run hosts logo Acme --dark acme-dark.png --light acme-light.png --dry-run
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") \
  MEDIA_UPLOAD_URL=$(op read "op://allthings/allthings media upload/url") \
  MEDIA_UPLOAD_TOKEN=$(op read "op://allthings/allthings media upload/token") \
  bun run hosts logo Acme --dark acme-dark.png --light acme-light.png --approve <token>

Promotion drafts

src/promo/ drafts an evening's promotion from its record, in the brand's voice (brand/foundations.md): the Luma description with every speaker and their bio, the Meetup cross-post (seats-on-Luma notice, five topics, the host's named place, and a checklist of the settings Meetup only takes by hand), and posts for X, Bluesky, LinkedIn and Discord to announce the evening, on the day, and after. People and hosting companies are tagged by their stored handles, and descriptions link hosts to their sites; the recap counts photos and approved posts and thanks those who posted. Each draft is the richest of its candidates that fits its platform's limit (src/promo/limits.ts), and what the record lacks is listed first as gaps. Drafts only: nothing posts.

DATABASE_URL=… bun run promo <slug>                              # every draft, as text
DATABASE_URL=… bun run promo <slug> --channel x --channel meetup # only these
DATABASE_URL=… bun run promo <slug> --json                       # with each draft's length and limit
DATABASE_URL=… bun run promo <draft slug> --draft                # drafts for a draft evening, as the studio reads it

Meetup crops covers to 16:9, which would cut a square Luma cover. bun run promo:cover <slug> [--out <file>] writes the evening's stored cover centered on black in the smallest exact 16:9 frame that holds it, unscaled (scripts/pad-cover.ts), by default to the system's temporary directory.

It only reads. tests/promo.test.ts keeps each seeded evening's drafts as golden files in tests/fixtures/promo/; after an intended change, regenerate them with UPDATE_GOLDEN=1 bun test tests/promo.test.ts and read the diff.

The launch kit

src/promo/launch.ts drafts the rebrand's announcement: an X thread, posts for Bluesky, the LinkedIn company page and Discord, the Luma calendar's newsletter, an announcement for each Meetup group the evenings are listed in, and a note for /about's history. It says what changed (the name and the domain, short links, person pages, shared evenings, the at/hack starter, and the allthings command with the public MCP server it reads: both on X, LinkedIn, Discord and Luma, the command alone on Meetup, neither on Bluesky or in the /about note), says the brand's line, "An open door and a high bar.", and names the next evening once one is published (--next); until then each draft says the next one goes up on luma.com/allthings first. The X handle is one value, launchXHandle (@allthingswebdev: X declined @allthings). A checklist of what has to be true before posting comes first.

bun run promo:launch                                  # every draft, pointing to Luma for what's next
bun run promo:launch --channel x --channel discord    # only these
bun run promo:launch --x-handle allthingsdev          # from another X account
DATABASE_URL=… bun run promo:launch --next <slug>     # naming a published, upcoming evening of ours

Only --next reads the database. tests/promo-launch.test.ts keeps the kit without a handle or a next evening, and with both, as golden files; regenerate them with UPDATE_GOLDEN=1 bun test tests/promo-launch.test.ts.

Planning

Every evening starts in planning, a Postgres schema of its own (migrations/0012_planning.ts): ideas for evenings (title, pitch, program, topic, and a status from idea through drafting to scheduled, or postponed (put off with no date, keeping its draft evening and all on it), or dropped, linked to the draft evening it becomes and to a past one it builds on), speakers we'd like on stage (a profile, or a contact without one) with their topics and when they're free or not, companies we'd like to host (one we know, or a new name) with who to talk to and when each last hosted, notes on the people and companies we know, and an unpublished evening's lineup (draft_people, migrations/0024_draft_lineup.ts): its organizers, co-hosts and MC, which readiness reads for the draft and publishing copies to the evening's public lineup. Nothing about an unpublished evening goes into core/backfill/lineups.json, which is the lineup of published ones. Each publish is claimed in publishes before it writes anything, so two never overlap, and recorded published once Luma says so; from the claim on, the private lineup can't change.

Draft talks

An unpublished evening's talks are private too (draft_talks and draft_talk_people, migrations/0027_draft_talks.ts): each a talk, a panel or a fireside, in running order, with the people on it named by their wanted speaker, so they can be on it before they've said yes or have a profile. Whether they've said yes is that wanted speaker's status, never kept twice. A talk has speakers, a panel a moderator and panelists, a fireside a moderator and a speaker; someone who declined can't be added. Readiness reads each as one of the draft's talks, with the speakers who have a profile, and blocks on everyone on it who hasn't said yes or has no profile yet, by name. Publishing doesn't copy them yet.

The schema is public; the rows are private. site_reader and site_sync are never granted the schema, so no grant on public, not even one on every table in it, reaches planning, and tests/planning-privacy.test.ts proves both roles, made with their scripts' own statements, are refused. The same test fails if any seed, fixture or backfill in this repository holds planning rows: they live only in the database, written through the CLI.

src/planning/ is the service, and bun run plan its CLI. It connects as the studio (see "The studio's connection"); no site role may use the schema. Each change runs in one transaction and prints the row as it now is; every command takes --json, for scripts and agents to read. People and companies are named by id or exact name, events by slug, and a name two rows share is refused with both ids. Every command that writes takes --dry-run: the write runs in a transaction that is rolled back, so it prints exactly what it would be and keeps nothing. Run it from core/:

DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run plan idea add --title "…" --pitch "…" --program social --inspired-by <slug> --dry-run   # what it would be; kept: nothing
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run plan idea add --title "…" --pitch "…" --program social --inspired-by <slug>
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run plan idea update <id> --status drafting --event <draft slug>
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run plan speaker add --profile "Ada Lovelace" --topic effect \
  --window '{"startsOn":"2027-01-01","note":"free after Dec"}'
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run plan speaker list --topic effect --available-on 2027-01-14
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run plan host add --sponsor CodeRabbit --contact-name "…" --note "…"
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run plan note add --profile "Ada Lovelace" --body "…" --author Erik
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run plan lineup set <draft slug> --mc "Erik Thorelli" --organizer "Erik Thorelli" --organizer "Andre Landgraf" --dry-run
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run plan lineup show <draft slug>
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run plan lineup talk add <draft slug> --kind panel --title "…" --moderator <wanted id> --panelist <wanted id> --dry-run
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run plan lineup talk list <draft slug>
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run plan lineup talk remove <draft slug> <talk id>
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run plan search "trivia"
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run plan audit   # fails if site_reader, site_sync or PUBLIC may reach planning

A draft's log, notes and status

Every studio write that touches a draft evening appends a line to its log, planning.draft_log (migrations/0028_draft_log.ts), in the same transaction as the write (src/planning/draft-log.ts): kept with it, or rolled back with it, so a dry run leaves none. Each line says who (ALLTHINGS_ACTOR), the command, a summary, and what changed as JSON: ids, counts and the values a command chose among (kinds, roles, statuses, times, positions). Never anything someone typed or named (a title, a name, a note), an approval token, a secret or an email; the table refuses an email anyway. The log is append-only: a trigger refuses any change or delete, the owner's too.

  • plan: an idea that is or was the evening's (idea add, idea update), lineup set, lineup talk add and remove, and its notes.
  • luma: luma:drafts --add (the evening stored) and --forget (the evening forgotten: its line outlives it), update, cover, registration, hosts, and publish (its claim, then published, or taken back). Luma has no transaction to share: a write that goes to Luma first asks for the actor before it sends anything, and adds its line once Luma has it.
  • collab: invitations and revocations, rounds, the brief, tasks, logistics, reviews and hidden comments. An invitation's line names the role, never the person or their email.

planning.draft_notes holds what the organizers say about an evening: a note, a decision or a question, with who and when. Each is written once: a trigger refuses any change but resolving an open question. Adding or resolving one is a write, with its line in the log.

plan status is the draft in one read: its facts (private or public on Luma, its times, venue and program, and whether its cover is current, drawn for facts that have since changed, not ours, or none), readiness's blockers and advice, its lineup and talks with whether each person has said yes, the companies we'd like to host, its collaboration (rounds, active invitations by role, submissions; only as a role that reads every row of it), its open questions, decisions and notes, and the last 20 lines of its log.

DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run plan note <draft slug> --kind question --text "CodeRabbit or Vercel?" --dry-run
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run plan note <draft slug> --kind decision --text "Five rounds, Erik MCs."
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run plan note resolve <question id>
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run plan status <draft slug> [--json]

Talk proposals

planning.proposals (migrations/0040_proposals.ts) holds talks people propose to give at one of our evenings: a title, an abstract and a format (a talk of about 20 minutes, a lightning talk of about 5, or a demo of about 10), who proposes it, their email, a few lines about them, up to four https links, notes for the organizers, where it came from, whether we accepted it, and, once it is on one, the evening it is on. Like the rest of planning it is private: no site role can read it, nothing public shows it, and no seed or fixture holds one.

src/proposals.ts is the module and bun run proposals its CLI, as the studio. readProposal reads one in as anyone sends it, trimmed and held to the table's limits, with a reason per field a person can act on; every way in uses it.

  • list prints the proposals with a status (new, the default, accepted, declined or all), oldest first, so nobody waits behind a newer one; show prints one whole. Both only read.
  • add records a proposal sent to an organizer by email or a message, as ALLTHINGS_ACTOR; --dry-run makes it and rolls it back.
  • accept, decline and remove decide one, exactly as a dry run showed it, like talks update: --dry-run prints the proposal, the decision (with --note, why) and an approval token; --approve <token> locks the proposal, works the decision out again, and refuses unless it still hashes to the token. Who decided and when are kept with it. remove deletes the row: spam, a test, or someone asking to be forgotten (/privacy).
  • place puts an accepted talk on an evening (--event <slug>, a draft or one published), with the same dry run and token, so planning stops suggesting it for others. Placing it on another evening moves it; declining or removing it takes it off. A move onto or off a draft is a line in that draft's log, ids and the format alone, and the evening's day and draft state are in the token, so a moved evening stops the approval.
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run proposals list [--status new|accepted|declined|all] [--json]
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run proposals show <id> [--json]
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run proposals add --title "…" --abstract "…" --name "…" --email "…" \
  [--format talk|lightning|demo] [--about "…"] [--link https://…] [--notes "…"] --dry-run
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run proposals accept <id> --note "…" --dry-run
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run proposals accept <id> --note "…" --approve <token>
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run proposals decline <id> --dry-run
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run proposals remove <id> --dry-run
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run proposals place <id> --event <draft slug> --dry-run

Taking proposals from anyone

Anyone may propose, so the public way in writes as a role that can do nothing else: proposal_intake (made by the same migration, stated in src/proposal-intake-role.ts). It may INSERT a proposal's columns, as any source but an organizer (it can't name one), and nothing more: no SELECT, not even of what it just added, no UPDATE or DELETE, no other table, and statements of at most 5 seconds. submitProposal (src/proposal-intake.ts) is all it runs, and it returns nothing, so whoever sends a proposal learns only that it was taken.

Before a proposal from outside is kept, the table's trigger proposals_intake, which runs as the owner, drops it quietly when the same email, title and abstract are already waiting, and refuses it past 100 from outside in a day (ProposalIntakeFull), so a flood that gets past the edge's rate limit stops at the table. An organizer's are never limited.

  • The ways in all hand what they were sent to the Worker's takeProposal (web/src/proposals.ts): it counts the sender against the edge's rate limit, reads the proposal in with readProposal, and keeps it as this role through prod's INTAKE Hyperdrive (infra/README.md, "Talk proposals"). The first is POST /api/v1/proposals, a JSON body of the proposal's fields (title, abstract, name and email; format, about, links and notes if wanted): 202 when it is taken, 422 with each field's problem, 429 past the rate limit or the day's, 503 on a stage that doesn't keep them. Only application/json, which a browser can't send to another origin without a preflight it never answers, and a browser's request from another site's page is refused.
  • /propose, the site's form (web/src/pages/propose.tsx), works without a script: it posts URL-encoded to itself, only from the site's own page, and answers with the page again, thanks or each problem by its field. A hidden field no person fills (website) marks a script's form, which is thanked and kept nowhere.
  • propose_talk, the MCP server's one tool that writes (web/src/mcp/propose.ts): the proposal's fields as its input, and as its answer only that it was taken, or each problem. It runs on every call, never through the page store, and the store's own address refuses it. A call from the allthings command (its User-Agent says allthings-cli/) is kept as the CLI's, any other as MCP's.
  • Its login is set by infra/scripts/proposal-intake.ts, run by the maintainer with the owner's connection once the migration is on production, as profile_editor's is: --dry-run shows it, --apply sets a new password, stores the connection string in "allthings proposal_intake" without printing it, and signs in with what 1Password holds. Rerun --apply to rotate it.
  • Proved. tests/proposal-intake-role.test.ts holds the role's catalog privileges and settings to the lists above, tries every column of public and planning both ways, and runs submitProposal as the role: a proposal kept, the same one sent twice kept once, and the 101st of a day refused.

Readiness

src/readiness/ says whether a draft evening is ready to go out, and what to add. A draft is an event the Luma sync stored as one (a private or cancelled Luma event), named by slug, or an idea from planning, named by id: through its draft evening when it has one, else on its own, with everything still to do. Its checks and rankings are pure functions of what the database holds at the Clock's now and of backfill/people.json, the record of when each host's title and bio were checked (PeopleRecord, which Readiness.layerWith replaces in a test).

A draft that came from an idea is checked as the idea's kind of evening (a social, a hackathon): the program is kept in planning, private, while the evening is a draft, and publishing writes it to the event. A dropped idea no longer counts. A postponed one still does, and its draft is put off: readiness blocks on that alone, never on a date that passed while it waited, until it has a date ahead (bun run luma update) and its idea is back to drafting (bun run plan idea update <id> --status drafting).

Checks. The completeness rules run ahead of time, all but the ones only a past evening can have (photos, a recording, a guest count): what the report requires blocks publishing, the rest is advice. Then what only a draft is asked:

  • it is still a draft, and has a private Luma event
  • it starts ahead, ends after it starts, starts in the evening and runs at most six hours (a hackathon may do neither)
  • nothing of ours is published the same San Francisco day; a draft or a shared evening that day is advice
  • its venue is named and has a known neighborhood (src/places.ts)
  • a hackathon has its schedule
  • once the Luma event exists (for an evening of ours), its cover is ours: bun run luma cover set and recorded it, and the facts it says (day, place, hosts, link) are still the evening's. A cover that isn't ours (Luma's default, or one set by hand) blocks, and so does one drawn before a fact changed; the site's copy of it, which the hourly ingestion stores, is advice
  • every organizer and co-host (its lineup as planned, while a draft) has a title and a bio that backfill/people.json read in the last 90 days (src/organizer-profiles.ts): what the people hosting an evening say about themselves goes out with it, so an old title or bio, or one never checked, blocks until someone reads it against their own sources and records both facts with that day as read (see "Filling in profiles"; a value that is still right only moves its read)

Suggestions, each ranked deterministically, so the same rows suggest the same in the same order:

  • network speakers whose past talks share the most of the evening's words (its topic, the idea's, and any --topic given), then the most recent
  • wanted speakers whose topics share one, free that day
  • talks people proposed and we accepted (see "Talk proposals") that are on no evening yet, whose title or abstract shares the evening's words: most shared first, then the one accepted longest ago, so nobody waits behind a newer one. proposals place takes one off the list for good
  • host prospects, and hosts that last had us more than 90 days ago, longest first
  • open dates on the three weekdays our evenings have been on most, with nothing else that day and none of ours within three days
  • the guest count of the evening it builds on (no guest lists are stored)

Planning's rows join only as a role that may read planning (the studio, or the owner); as site_reader the report leaves them out and says so. The collaboration's advice (see "Collaborating on a draft") joins only as a role that sees every row of it, the studio (through its own policies) or the owner: as any other role the report leaves it out, and says so (collaboration in its JSON).

DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run readiness --event <draft slug> [--topic git --topic ai] [--json]
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run readiness --idea <id>

It exits 1 when something blocks publishing, 2 on a draft that isn't there.

Collaborating on a draft

An organizer can invite outside collaborators to help make one evening: guest round hosts, a venue contact, a promo partner. They work on our own site, in the draft preview (web/src/preview/), never in a shared document. This is the design. It is being built in small pull requests, each described where it lands. Until a piece is here, the studio does that part by hand.

Who. Each invitation is a row in planning.collaborators: an email, the name the others see, and a role. An invitation expires a few days after its evening ends, so collaboration carries on after the evening goes public (round hosts hand in after the announcement) and stops on its own.

Role Sees Writes
viewer the page, the brief's sections for it nothing
commenter the same comments
round_host the same, and their own round comments, their round's questions and answers
venue the same, and the logistics comments, logistics answers
organizer everything on that evening, and emails comments

The stack's organizers (PREVIEW_VIEWERS, infra/src/preview.ts) are organizers of every evening. Only the studio invites, through bun run collab invite … --dry-run | --approve <token>, never the site. Revoking takes effect on the collaborator's next request.

Signing in, twice over:

  • At the edge. The preview's Access application admits the organizers, and an Access email list, "draft collaborators", that the studio keeps equal to the active invitations whenever it invites or revokes. Revoking also ends the person's Access sessions. The list's emails are never in this repository. The studio does this with its own Cloudflare token, limited to Zero Trust (infra/scripts, in 1Password as "allthings zero trust").
  • In the Worker, in two steps on every request:
    • Who signed in. It verifies the token Access signs, as it does now: the signature against the team's keys, the issuer, this application's audience, the times, and an email. The check against PREVIEW_VIEWERS moves out of this step, so an invited email passes it.
    • What they may do. An organizer is someone on the stack's list. A collaborator has an active invitation to the evening, read from the database through a Hyperdrive that never caches, so a revoked one is refused at once. Anyone else gets the answer of an evening that doesn't exist, as before: Access let them in, and the Worker shows them nothing.

What collaborators do. Everything they write is a submission or a comment, and only ever added. Organizers accept or reject through the studio, and anything that changes the evening's own record goes through the commands that already change it (bun run luma update, bun run plan). The site has no accept action, and no collaborator writes public or Luma.

  • The brief is stored a section at a time (brief_sections), each with the roles it is for. Sections about relationships, other venues, or people not yet asked are for organizers only.
  • Tasks carry a due date and are for everyone, for a role, or for one person: "first drafts of your 8 + 1 by Tue Oct 20".
  • A round host's questions and answer key (round_submissions): the answer-key format as a form, each save a new row. Only that round's hosts and the organizers ever see it. Players never do.
  • The venue answers each logistics item in the panel: yes, no or unsure, with a note of up to 1000 characters if it needs one. Each answer is a new row, and the latest shows, with its review. Only the venue and the organizers see the items, and only the venue answers them (POST /<slug>/logistics, through the same checks as every form).
  • Comments on the evening, a section, or a round. A comment on a round shows only to its hosts and the organizers. They're plain text, and the studio can hide one.

Security:

  • Least privilege. The Worker writes as draft_collab, a login role made like site_sync (infra/scripts/draft-collab.ts). It holds column grants on these tables alone, adds rows without changing or deleting any, and has statement timeouts. Not the owner: the owner reads all of planning (contacts, notes on people, sent posts) and writes public, and the Worker that takes outsiders' input is the code most exposed. site_reader and site_sync are never granted any of it (tests/planning-privacy.test.ts).

  • Row security. Every table has it. The policies read who is asking from collab.email and collab.organizer, which the Worker sets in each transaction from the verified token. So the database itself, and not only the Worker's queries, keeps one evening from another and one host's round from the next. The policies ask SECURITY DEFINER functions (planning.collab_*), so the role never reads a collaborator's email unless it organizes that evening.

  • Answer keys are encrypted at rest with AES-256-GCM. The Worker seals each submission with a key it holds as a secret (kept in 1Password too). The row's ids are bound into the seal, so a ciphertext can't be moved to another host's row, and each row names its key, so the key can be rotated. This doesn't protect against a compromised Worker. It does keep answers out of database dumps, branches of production, and any tool that prints planning's rows. bun run collab export decrypts a round for the night into a file, not the terminal.

  • Forms, with no scripts. The pages run no JavaScript, as the site's don't. Forms post to the same page, which then redirects. Every write needs:

    • a same-origin request (Origin, or Sec-Fetch-Site: same-origin);
    • a form token: an HMAC of the signer, the evening, the form, and when Access signed them in, keyed by a Worker secret;
    • form encoding, under a size limit.

    Each form is decoded with Effect Schema: trimmed and normalized text, capped lengths, closed lists, https sources, exactly the round's number of questions. Which round and evening a write is for comes from the invitation, never from the form. The preview's Content-Security-Policy gains form-action 'self' and nothing else: still no script source.

  • Rate limits, counted from the audit in the same transaction as the write (planning.collab_recent_actions), so they are deterministic and tested.

  • The audit. collab_audit records every action: each write, each view of a round, each refused evening. It is written in the signer's name only and read only through the studio.

  • No PII leaks. Collaborators see each other's names and roles, never emails, unless they organize the evening. Secrets never reach a page.

Threats:

Threat Answer
A shared link It's no use without signing in as an invited email: Access refuses at the edge, and the Worker again.
A forwarded PIN email The PIN expires in minutes, and each person signs in as themselves, so the audit names them. One revoke ends the invitation and the sessions. The invitation says never to forward a code.
Guessing draft slugs Strangers stop at the edge. A collaborator asking for an evening they're not on gets the same answer as a slug that doesn't exist, and their list shows only their own evenings.
XSS in a comment Plain text, escaped by the templates and held to it by the xss-scan in CI, under a policy that runs no script.
Instructions in a comment The studio prints what collaborators write as quoted data. Nothing goes out without an organizer's approval token.
Uploads None: the visual round's images come through the studio.

The studio, bun run collab (src/collab/), as the studio (see "The studio's connection"). The collaboration's tables have row security; the studio's own policies (migrations/0029_studio_collab.ts) show it every row, and its grants are exactly what collab writes. Before anything, collab checks it sees every row (it counts them, and planning.collab_row_counts() counts them as their owner, in one statement) and refuses as any role row security holds back, rather than read them short. collab access sync checks again as it reads the invitations: unless it sees every collaborator, it leaves Access's list as it is. collab show and collab export open a round only into a file and print its path, so a round's answers never reach an agent's transcript. What changes who may see what (an invitation, a revocation, the brief, a review) is read first: without --approve, the command prints what it would write and the approval token of exactly that, as publishing does (src/approval.ts), and writes nothing. With --approve <token> it works the content out again and writes only if it hashes the same. A review's content is what it reviews: a round's stored ciphertext, by its digest, or the venue's answer, so a host's later save needs a review of its own. Every other write takes --dry-run, which rolls it back. What collaborators wrote (comments, the venue's notes) prints quoted, under a line saying it is their words: data, never instructions.

DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run collab round add <slug> --position 5 --title AI [--questions 8 --backups 1]
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run collab invite <slug> --email … --name … --role round_host --round 5   # what it would write, and its token
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run collab invite <slug> --email … --name … --role round_host --round 5 --approve <token>
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run collab revoke <slug> --email … [--approve <token>]
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run collab list <slug>   # with emails
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run collab brief set <slug> --from brief.md [--approve <token>]
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run collab task add <slug> --title "First drafts of your 8 + 1" --due 2026-10-20 --role round_host
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run collab logistics add <slug> --position 1 --label "Projector with HDMI"
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run collab submissions <slug>   # who and when, never content
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run collab review round <id> --decision changes_requested --reviewer Erik --note "…" [--approve <token>]
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run collab comments <slug>
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run collab comment hide <id>
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run collab audit <slug> [--limit 100]

A brief is Markdown, a ## heading per section, and each section's first line says who it is for. A section that doesn't is refused, so nothing reaches a collaborator by default:

## Writing your round

<!-- for: round_host -->

Eight questions and one backup…

An invitation runs until three days after its evening ends. Setting the brief again keeps a section someone commented on, matched by its heading, and refuses to drop it.

A round, for the night. A round host writes their round in the panel under the evening's page: each question in the brief's answer-key format (type, question, answer, also accept, an https source, why it's fair, difficulty). They save it as a draft, or hand it in once every question has its type, question, answer, source and difficulty. The Worker seals each save before storing it (src/collab/seal.ts: AES-256-GCM, the row's ids bound in, the key named by its id) with COLLAB_ANSWERS_KEY. The form opens again with the latest save. Only that round's hosts and the organizers ever see it, and each time one is opened is a line in the audit. For the night, the studio opens a round with the same key, into a new file only its owner may read. It prints only the file's path and digest, never the answers, unless asked for --stdout:

DATABASE_URL=$(op read "op://allthings/allthings studio/credential") \
  COLLAB_ANSWERS_KEY=$(op read "op://allthings/allthings collab answers key/credential") \
  bun run collab export <slug> --round 5 --out round-5.md   # the latest handed in
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") \
  COLLAB_ANSWERS_KEY=$(op read "op://allthings/allthings collab answers key/credential") \
  bun run collab show <submission id> --out save.md

The edge. An approved invitation or revocation also sets Access's list of collaborators to every active invitation, and a revocation ends that person's Access sessions (src/collab/access.ts). Both need the studio's token, CLOUDFLARE_ZERO_TRUST_TOKEN ("allthings zero trust" in 1Password; infra/README.md, "The studio's Zero Trust token"), passed without printing it. Without the token, an approval writes nothing. If Cloudflare fails after the database was written, the command says so: the Worker already enforces the change, and collab access sync finishes it.

DATABASE_URL=$(op read "op://allthings/allthings studio/credential") \
  CLOUDFLARE_ZERO_TRUST_TOKEN=$(op read "op://allthings/allthings zero trust/credential") \
  bun run collab invite <slug> … --approve <token>
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") \
  CLOUDFLARE_ZERO_TRUST_TOKEN=$(op read "op://allthings/allthings zero trust/credential") \
  bun run collab access sync [--dry-run]   # the list, set to the invitations
CLOUDFLARE_ZERO_TRUST_TOKEN=… bun run collab access end-sessions --email …

Readiness reports what the collaboration still needs (src/readiness/collab.ts), as advice: a round with no host, not handed in (late once its hosts' task date has passed), or handed in and not accepted; anything the venue hasn't confirmed and had accepted; and a task past its date. None of it blocks publishing: an evening goes out on Luma well before its rounds are due.

On the page. The draft's page as the public will see it, and below it a "for collaborators" panel in the site's own design:

  • your role and who else is on the evening;
  • your tasks with their dates;
  • the brief's sections for you;
  • your form;
  • the comments.

It has the same grid, rules and type, and layout tokens only.

The brief as one document. /<slug>/brief on the preview, linked from the panel, is the brief's sections for you as one page to read through or hand to a co-host: the evening's lockup as its cover, in the evening's mode, then a numbered ledger row per section (web/src/preview/brief-document.tsx). Who may open it is who may open the page, and it holds exactly the sections the panel shows you. Printed or saved as a PDF from the browser, the cover takes the first sheet and the site's frame stays off the paper.

Putting an evening out on Luma

src/luma/publish.ts takes an evening's Luma event from private draft to public through Luma's official API (src/luma/write.ts: events/create, events/update, events/get, images/create-upload-url, and the two-step events/cancel, each as docs.luma.com documents it), with the calendar's key in LUMA_API_KEY:

  • create makes the event private, always, in San Francisco's time zone, from an idea's pitch when one is named. The calendar feed never carries a private event, so luma:drafts --add stores it as a draft (see "Drafts the feed doesn't carry"), which readiness checks and the draft preview shows.
  • update changes a private event: name, times, place (--venue for a place Google Maps knows, so its name shows; --address as written), the description the promotion drafts write. Never a cover: that is luma cover's, drawn from the evening's facts (see "Its cover"). --description-from-idea <id> sets the description to an idea's pitch again, as create did, after the pitch changes. A public event is refused.
  • publish --dry-run prints exactly what would go out: the event as Luma has it, with the drafts' description, and its approval token, the first 16 hex digits of the SHA-256 of that content as canonical JSON. It refuses while readiness finds a blocker, and while the cover Luma shows isn't the one we set and recorded: Luma's default, or any other (readiness reads only the record). With --approve <token> it works the content out again and goes on only if it hashes the same, sets the description and the visibility in one update, and reads the event back to check both took. An evening of ours (not shared) with no talks on record that comes from an idea (a trivia night, a social) publishes with the idea's pitch instead: the drafts write their description from talks, and it has none. A shared evening is refused, as before. Publishing also writes the program of the idea the evening came from to its event, which until then kept the program the sync gave it.
  • cancel-test deletes only a private test event named "allthings API test…" with no guests.

Writes are sent once: a timed-out create may have happened, and a retry could make a second event. Every write has --dry-run, which prints the body and sends nothing. Nothing in the tests reaches Luma.

DATABASE_URL=$(op read "op://allthings/allthings studio/credential") \
  LUMA_API_KEY=$(op read "op://allthings/allthings Luma API key/credential") \
  bun run luma create --name "…" \
  --start 2026-11-18T18:00:00-08:00 --end 2026-11-18T21:00:00-08:00 --venue "CodeRabbit, 201 Spear St" --idea <id> --dry-run
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") \
  LUMA_API_KEY=$(op read "op://allthings/allthings Luma API key/credential") \
  bun run luma update --event <draft slug> --description-from-drafts --dry-run
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") \
  LUMA_API_KEY=$(op read "op://allthings/allthings Luma API key/credential") \
  bun run luma update --luma evt-… --description-from-idea <id> --dry-run
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") \
  LUMA_API_KEY=$(op read "op://allthings/allthings Luma API key/credential") \
  bun run luma publish <draft slug> --dry-run   # what would go out, and its token
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") \
  LUMA_API_KEY=$(op read "op://allthings/allthings Luma API key/credential") \
  bun run luma publish <draft slug> --approve <token>  # exactly that, public
LUMA_API_KEY=… bun run luma show evt-…                                             # the event as Luma has it

Its cover

Every evening's Luma cover is allthings-branded and its own, never one of Luma's defaults (images.lumacdn.com/gallery-images/, what a new event starts with). src/cover.ts says what the cover says, from the evening as its page reads it: allthings/ (or the name, where it yields no topic), with the cursor while it is ahead; its day, hour and year in San Francisco; its neighborhood; who hosts it, or the venue's name with no host on record; its short link, the one a draft gets when it is published; and its mode, Night or Paper. The brand's template draws those facts, square, with uv (brand/marks/cover.py). Same facts, same pixels.

An evening a conference made one of its official community events may wear that conference's cover instead, when its organizers allow it: allthings/aie, during AI Engineer's Code Summit (November 9 to 12, 2026). src/cobrands.ts is the one place that decides which: a co-brand claims the evening with its topic on one of its San Francisco days. Only then do the facts carry cobrand (its id, and the day year first, 2026.11.11), so the approval token covers which template draws it, and brand/marks/summit_cover.py sets the lockup, day and place on the art. Every other evening's facts have no cobrand key at all, so their tokens, and the covers already recorded against them, are unchanged. Nothing about it is stored: no column says it, and readiness compares the token as for any cover.

bun run luma cover sets it, as publish does, in two steps:

  • --dry-run draws the cover, writes the PNG to look at (--out, or a fresh temporary directory), says what it replaces on Luma (Luma's default, the one we last set, or another) and prints the approval token: the first 16 hex digits of the SHA-256 of the event (with its visibility and dates on Luma), the facts, the PNG's SHA-256 and the cover it replaces, as canonical JSON. It sends nothing.
  • --approve <token> draws and works it out again, and goes on only if it hashes the same: a fact or Luma's cover changed in between stops it. It uploads the PNG to Luma's CDN, sets it on the event, reads the event back to check it took, and records it on the evening: generated_cover_url (as Luma reads it back), generated_cover_sha256 and generated_cover_facts (the facts' approval token), from migrations/0025_generated_cover.ts. It lets go of the evening's stored copy of the old cover, so the hourly image ingestion stores the new one.

Readiness compares against that record (see "Readiness"), and publishing against Luma itself: an evening of ours goes out only with the cover we set, saying what its facts say now.

Only a private event of ours is changed. A public one changes only through publish and a shared one's Luma page is its organizer's; a public evening's cover is still drawn to look at, and the dry run exits 1 saying why it wouldn't be set.

One exception: a published evening of ours that is past, over on Luma too, and still shows a stock photo, one of Luma's defaults or an Unsplash picture (isStockCover in src/cover.ts), may get its own cover even when it is public. Nobody is coming to it any more, and a cover anyone uploaded is never replaced this way; once it shows ours, it is out of reach again. If recording that cover fails, the stock photo is put back on Luma, so the evening is as it was and approving again can finish it.

DATABASE_URL=$(op read "op://allthings/allthings studio/credential") \
  LUMA_API_KEY=$(op read "op://allthings/allthings Luma API key/credential") \
  bun run luma cover <draft slug> --dry-run   # draw it, read it, and its token
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") \
  LUMA_API_KEY=$(op read "op://allthings/allthings Luma API key/credential") \
  bun run luma cover <draft slug> --approve <token>
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") \
  LUMA_API_KEY=$(op read "op://allthings/allthings Luma API key/credential") \
  bun run luma cover evt-… --dry-run --out cover.png

Nothing in the tests reaches Luma or runs uv: tests/luma-cover.test.ts draws with a stand-in renderer, and uv run generate.py --check in brand/marks holds the template to two past evenings' covers.

The calendar

src/luma/calendar.ts holds what the Luma calendar's page should say, and sets it through Luma's API (calendars/update):

  • the name: allthings;
  • the two sentences from brand/foundations.md;
  • Bridge, the slash's color, as its tint;
  • the site, and the channels the site's footer lists (web/src/links.ts);
  • the a/ app icon as its avatar (brand/public/icon-512.png).

tests/luma-calendar.test.ts holds each of these to its source. The address changes only with --slug. It moved from luma.com/allthingsweb to luma.com/allthings on 2026-11-04 (--slug allthings), and Luma sends the old address to the new one. It works the way publish does:

  • --dry-run prints each field that differs, from what to what, and its approval token.
  • --approve <token> makes exactly those changes in one update. It uploads the avatar if Luma's isn't the same image, then reads the calendar back to check each change took.

Luma's API can't set a calendar's cover or its social preview image, so an organizer uploads those in the calendar's settings: brand/covers/calendar.png and brand/og/og-home.png.

LUMA_API_KEY=… bun run luma calendar --dry-run                    # what differs, and its token
LUMA_API_KEY=… bun run luma calendar --dry-run --slug allthings   # and move it to luma.com/allthings
LUMA_API_KEY=… bun run luma calendar --approve <token> [--slug allthings]

Registration

src/luma/registration.ts reads and sets an evening's registration on Luma: whether registering needs an organizer's approval, whether a full event takes a waitlist, its capacity, and its questions in order, each required or optional. What Luma's API can set, by its OpenAPI spec (public-api.luma.com/openapi.json):

  • capacity: max_capacity on events/update, or none for no limit;
  • waitlist: waitlist_status on events/update;
  • questions: registration_questions on events/update, all at once. The studio writes text questions only, and an event that has a question of another type (company, select, terms and the rest) is refused by name;
  • approval: the event's require_approval can only be read. Luma keeps it on each ticket type (ticket-types/update), so it is set on every one that differs, hidden ones too; an event with no ticket types is refused by name.

Whatever can't be set as asked is a gap, refused, never skipped. It works the way publish does: --dry-run reads and prints each change from what to what and the approval token for exactly that (the event, its registration now and the changes), saying so when the event is public and guests see the change at once; --approve <token> works the plan out again, goes on only if it hashes the same, sets approval on the ticket types, sends one event update with the rest, and reads registration back to check each took. Questions are the whole list, in the order given across --question (required) and --question-optional; --clear-questions asks none.

DATABASE_URL=$(op read "op://allthings/allthings studio/credential") \
  LUMA_API_KEY=$(op read "op://allthings/allthings Luma API key/credential") \
  bun run luma registration --event <slug>   # as Luma has it
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") \
  LUMA_API_KEY=$(op read "op://allthings/allthings Luma API key/credential") \
  bun run luma registration --event <slug> --approval on --waitlist on \
  --capacity 120 --question "Your team?" --question-optional "Anything we should know?" --dry-run
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") \
  LUMA_API_KEY=$(op read "op://allthings/allthings Luma API key/credential") \
  bun run luma registration --event <slug> … --approve <token>

Hosts

src/luma/hosts.ts lists and changes an evening's hosts on Luma: the people and company accounts its page names, and who can manage it. What Luma's API can do, by its OpenAPI spec (public-api.luma.com/openapi.json): events/get lists them (id, email, name); hosts/add adds one by email only, at an access level; hosts/remove removes one by email, never the event's creator. Adding by Luma user id (the API takes none, and a user's email isn't ours to see) and removing the creator are refused by name, never skipped.

It works the way publish does: --dry-run reads and prints who would be added and removed and the approval token for exactly that (the event, its hosts now and the changes), saying so when the event is public; --approve <token> works the plan out again, goes on only if it hashes the same, adds, then removes, and reads the hosts back to check each took.

Each host is added at the least access it needs: none (shown on the page, no rights to manage it: a hosting company, anyone credited) unless --access right after its --add says check-in (checks guests in, never shown) or manager (changes the event and its guests; only for an organizer). Luma's own default, manager, is never taken by leaving it out.

Luma keeps an unpublished evening's hosts itself, privately with its event, so nothing about them goes into a file here (backfill/hosts.json is the public record of hosting companies). Once the evening is public, the Luma people import reads its hosts like any evening's.

DATABASE_URL=$(op read "op://allthings/allthings studio/credential") \
  LUMA_API_KEY=$(op read "op://allthings/allthings Luma API key/credential") \
  bun run luma hosts --event <slug>   # as Luma has them
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") \
  LUMA_API_KEY=$(op read "op://allthings/allthings Luma API key/credential") \
  bun run luma hosts --event <slug> --add [email protected] --access manager \
  --add [email protected] --remove usr-… --dry-run
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") \
  LUMA_API_KEY=$(op read "op://allthings/allthings Luma API key/credential") \
  bun run luma hosts --event <slug> … --approve <token>

Posting to Bluesky

src/social/announce.ts posts an evening's Bluesky draft (the promotion drafts' announce, day-of or recap text) from @allthingsweb.dev, exactly as an organizer approved it, through the AT Protocol (src/social/bluesky.ts: createSession on bsky.social, createRecord on the account's PDS, and resolveHandle and getAuthorFeed on the public AppView):

  • --dry-run reads only: it prints the post, with a facet for every link and every mention whose handle Bluesky resolves (by UTF-8 byte offsets; a handle it doesn't stays plain text), says whether our account already posted that text, and prints its approval token, the first 16 hex digits of the SHA-256 of the account, evening, moment and post as canonical JSON (src/approval.ts, which Luma publishing shares). It needs no password.
  • --approve <token> makes the post again and goes on only if it hashes the same, our account hasn't posted that text, and the app password signs in as our DID. Then it posts once: a post Bluesky didn't take is never retried, and the feed check stops a second try from doubling it.

The app password is the 1Password item "allthings Bluesky" (handle, app password). Nothing in the tests reaches Bluesky.

DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run social bluesky <slug> --moment announce --dry-run   # the post, and its token
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") \
  BLUESKY_HANDLE=$(op read "op://allthings/allthings Bluesky/handle") \
  BLUESKY_APP_PASSWORD=$(op read "op://allthings/allthings Bluesky/app password") \
  bun run social bluesky <slug> --moment announce --approve <token>   # exactly that, once

Sending to the Discord

src/social/announce-discord.ts sends an evening's Discord draft to our server through its channel webhook (src/social/discord.ts: GET the webhook, and POST it with ?wait=true, as Discord's docs describe them), exactly as an organizer approved it. allowed_mentions is empty, so no text in a draft can ping anyone.

A webhook can post but can't read the channel, so planning.sent_posts (migrations/0021_sent_posts.ts, src/social/sent-posts.ts) records what was sent: one row per channel, evening and moment.

  • --dry-run reads only. It prints the message, the server and channel the webhook posts to, whether that moment was already sent, and the approval token. The token covers the webhook, its channel, the evening, the moment and the message.
  • --approve <token> makes the message again and goes on only if it hashes the same and nothing was sent or started for that moment. Then it claims the moment, sends once and records the message's page.
    • If Discord refuses the message (4xx), the claim is dropped.
    • If there's no answer (30 seconds at most), or a 5xx, the claim is kept as unanswered, since the message may be out. Nothing goes out again until an organizer has looked in the channel and settled it:
      • --sent <message id> when the message is there. The webhook reads it back by id, and it must hash to the approved token, even if the draft has changed since.
      • --release when it isn't, so it can be approved again.
    • A claim still sending five minutes on counts as unanswered (its process died). One that is younger is still going, so neither command touches it.
    • A sent message is never released.

The webhook URL is the 1Password item "allthings Discord webhook" (url). It is a secret: nothing prints it. The record is in the planning schema, which the studio's connection may write. Nothing in the tests reaches Discord.

DATABASE_URL=$(op read "op://allthings/allthings studio/credential") \
  DISCORD_WEBHOOK_URL=$(op read "op://allthings/allthings Discord webhook/url") \
  bun run social discord <slug> --moment dayOf --dry-run   # the message, where it goes, its token
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") \
  DISCORD_WEBHOOK_URL=$(op read "op://allthings/allthings Discord webhook/url") \
  bun run social discord <slug> --moment dayOf --approve <token>  # exactly that, once
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") \
  DISCORD_WEBHOOK_URL=$(op read "op://allthings/allthings Discord webhook/url") \
  bun run social discord <slug> --moment dayOf --sent <message id>  # record the message an unanswered send left
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run social discord <slug> --moment dayOf --release   # let go of an unanswered send that left none

Posting to X

src/social/announce-x.ts posts an evening's X draft as @allthingswebdev, exactly as an organizer approved it, through X's API v2 (src/social/x.ts).

What went out is recorded in planning.sent_posts, as for Discord (see "Sending to the Discord"), with the exact text approved (migrations/0022_x_sent_posts.ts). Nothing reads our posts on X to find out.

  • --dry-run reads only, and nothing from X. It prints the post, the moment's record (not posted yet, sent, or not settled), and the approval token (the SHA-256 of the account, evening, moment and text). It doesn't sign in.

  • --approve <token> makes the post again and goes on only if it hashes the same and nothing was posted or started for that moment. It claims the moment, then, in order:

    1. Signs in with the stored OAuth 2.0 refresh token, as the app (X_CLIENT_ID, X_CLIENT_SECRET).
    2. Stores the new refresh token X hands back, before anything else. X spends a refresh token when it is used.
    3. Checks that the sign-in is our account (/2/users/me).
    4. Renews the claim and posts once.

    Anything that stops it before step 4 drops the claim, and so does X refusing the post (a 4xx; X refuses a duplicate text with 403). No answer (30 seconds at most), or a 5xx, marks it unanswered. Nothing is posted again until an organizer has looked at our profile:

    • --sent <post id> when the post is there. X reads it back with the app's bearer token (one billed read), and it must be ours and say the text approved. X shortens links to t.co and escapes &, so links compare as one and entities are read back.
    • --release when it isn't, so it can be approved again.

The sign-in lives in the 1Password item "allthings X app", field oauth2 refresh token (src/social/x-sign-in.ts, through op with OP_SERVICE_ACCOUNT_TOKEN). The token is handed to op in a file only this user can read, removed right after, never on its command line.

x-sign-in --from-xurl stores the sign-in that xurl auth oauth2 --app allthings allthingswebdev made. While xurl's access token is unexpired, it first checks that the token is our account. The first post spends xurl's copy; that same xurl command signs xurl in again. The client ID, client secret and bearer token are in the same item. DATABASE_URL is the studio's, which may write the record in the planning schema. Nothing in the tests reaches X or 1Password.

DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run social x <slug> --moment announce --dry-run   # the post, and its token
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") \
  OP_SERVICE_ACCOUNT_TOKEN=… \
  X_CLIENT_ID=$(op read "op://allthings/allthings X app/Client ID") \
  X_CLIENT_SECRET=$(op read "op://allthings/allthings X app/Client Secret") \
  bun run social x <slug> --moment announce --approve <token>   # exactly that, once
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") \
  X_BEARER_TOKEN=$(op read "op://allthings/allthings X app/Bearer Token") \
  bun run social x <slug> --moment announce --sent <post id>  # record the post an unanswered post left
DATABASE_URL=$(op read "op://allthings/allthings studio/credential") bun run social x <slug> --moment announce --release   # let go of an unanswered post that left none
OP_SERVICE_ACCOUNT_TOKEN=… bun run social x-sign-in --from-xurl                          # keep xurl's sign-in as ours

Migrations

migrations/ holds the schema as Effect SQL migrations, applied by Effect's migrator (src/migrator.ts). Production takes migrations from here alone.

Writing one

  • One file per change: migrations/NNNN_short_name.ts, the next id after the last, default-exporting statements([...]) with one SQL statement per entry. Add it to migrations/index.ts; a test fails if a file is missing there or an id is skipped.
  • Forward only, and never edited after merge: production records each migration by id and name and will not run it again. To change something, add a migration. migrate refuses a database whose record is not a prefix of the migrations here.
  • Each runs in one transaction with the others pending, so no CREATE INDEX CONCURRENTLY; split such a change out when it is needed.
  • Add the lines the migration creates to tests/fixtures/production-schema.txt, which is production's catalog once every migration here has run (bun run migrate, below).
  • Its number must be free: CI's migration guard (bun run migration-guard, src/migration-guard.ts, on every pull request and on main) fails when a branch's migrations don't extend what production has applied, in order (it reads effect_sql.migrations as site_reader), or when a pull request adds a migration under a number another open pull request adds. The failure names each migration to renumber, and the number it should take.

0001_baseline is production's schema on 2026-10-04, read from its catalog, not a replay of the old Next app's drizzle migrations: production received changes by hand that those never recorded. tests/fixtures/production-schema.txt is that catalog plus what each later migration adds, and the tests hold the migrations to it both in PGlite and on Postgres 17 (tests/postgres.test.ts, in CI).

neon_auth is Neon Auth's schema, not ours. The baseline still makes a stand-in neon_auth.users_sync where Neon Auth isn't on (tests, local Postgres), because production had it in 2026-10. Since 0023_drop_admin_tables, nothing of the site's references it, and the snapshot (src/schema-snapshot.ts) compares only public and planning. So Neon Auth on or off changes nothing the migrations or tests check; a test drops the schema to show it.

Running them

DATABASE_URL=postgres://… bun run migrate --dry-run   # what would run
DATABASE_URL=postgres://… bun run migrate             # run it

DATABASE_URL here is the database owner's, which only the maintainer holds: fetched with neonctl (with --org-id org-broad-sea-60121176, signed in as a member of All Things Web), never stored (see "The studio's connection").

A migration reaches production before the code that needs it: every stage's Web Worker, pull request previews included, reads production's database, so code that reads a new column fails until it exists. Once a pull request with a migration is approved and green, check out its final head commit and run both against production; the dry run must list exactly that pull request's migrations as pending. Then merge, and push nothing to the branch in between, since production records each migration by name. This works because the code already on main must keep running on the migrated schema: add before using, and split a drop or rename into a migration after the code stops using the old shape.

DATABASE_URL comes from the environment only: the script does not read .env files. The record of applied migrations is effect_sql.migrations, in its own schema like drizzle's drizzle.__drizzle_migrations, so neither tool sees the other's and drizzle-kit, which manages public, leaves it alone.

Stamping production at the cutover

Production already has the baseline's schema, so the baseline must be recorded there, not run (running it would fail on the first existing table, and migrate refuses to try). stamp records the pending migrations as applied without running them, and only if the live schema is exactly what they create:

DATABASE_URL=… bun run migrate stamp --dry-run   # reads only: shows any difference
DATABASE_URL=… bun run migrate stamp             # records 0001_baseline (and any later ones)

It builds the expected schema by applying the migrations to an in-process PGlite, then, through the migrator itself, inserts the records and compares production's catalog to the expected schema in the same transaction: on any difference it fails and records nothing. It changes no table of the app's. To undo it, delete the stamped rows from effect_sql.migrations (or drop the effect_sql schema). After the stamp, bun run migrate applies later migrations, and drizzle's migrations stop. Production was stamped at 0001_baseline on 2026-10-04.

In CI, once a Neon credential exists

Each pull request gets a Neon branch of production: create it, run bun run migrate against it (the branch inherits production's record, so only the pull request's new migrations run), run the tests against it, then delete the branch. On deploy, bun run migrate runs against production before the new Worker goes live. Neither job exists yet.