oficina / fichas Public

Clone
git clone https://amadan.net/oficina/fichas

Plain git — no account needed to clone.

Download

Download this file

πŸ€– fichas

The Oficina suite's card cabinet. One instance per team.

A ficha is an index card; a fichero is the cabinet it sits in.

Nothing is built. This repo is a design document and this README. There is no module, no binary and no schema yet.

What it is meant to be

Typed records β€” cards β€” with append-only entries attached to them, and references out to items in Docs, Sheets and Calendar. The first stack is a CRM: a Customer card, a Call Log entry, and a summary on the card that is derived from its entries and cites them.

The ancestor is DabbleDB, not Microsoft Access. What is worth stealing is schema-by-refinement, entity promotion and views-as-first-class-objects β€” not the generic-database-builder positioning, whose best execution still found no market. The part that could not have been built in 2008 is that the model replaces HyperTalk: you reshape a card type in a sentence rather than in a dialog.

Why it is not part of memoria

memoria is not an app of record and its decision 7 keeps it that way β€” it serves nobody to ask, so it cannot own content that needs an owner, a deletion story and a per-item visibility answer. Fichas owns its content and answers for it; memoria indexes it, cites it and reaches into it like any other sibling.

Fichas would also be the first app to serve the suite contract's server half β€” suite/README.md says that half "arrives with the first app that serves one, and the fixtures get corrected by the second". memoria is the waiting consumer.

The design

docs/superpowers/specs/2026-09-19-fichas-design.md.

Read Β§1 first: half of its decisions table is marked Proposed and has not been ruled on. A proposal read as a ruling is the failure this suite's specs work hardest to prevent.

Two things block slice 1, both in Β§10 β€” the seal-tier list (which card fields leave the seal, and therefore what can be filtered, sorted and grouped), and the reach credential ruling.

Building it

A rastrillo app. make ci is the gate β€” vet, gofmt, tests, migration check β€” one definition for CI and for you. AGENTS.md carries the working conventions.

internal/fichastest/browser_test.go walks the app in a real Chromium and is loud on any console error, failed request, or JS value that leaked to the screen:

go test -tags browser ./...

It needs a Chromium on PATH, via RASTRILLO_CHROME, or in a Playwright cache. A skip is not a pass: with no browser it fails unless RASTRILLO_BROWSER_OPTIONAL=1 makes the skip a deliberate, visible choice. make ci runs the plain suite only.

Deploying, and the DEK

The app is claimed on CARLOS as fichas in account bds (https://console.carloku.com/a/bds/apps/fichas). It is not deployed, and it should not be until sign-in lands β€” see the warning at the end.

1. Mint the DEK

The DEK is 32 random bytes, base64. It is not carlos secrets genkey, which mints the secrets keypair that seals config β€” a different thing at a different layer.

head -c 32 /dev/urandom | base64

Keep a copy somewhere you will still have it in a year. Everything in fichas β€” every card value, every call logged, every label β€” is sealed under this key and under nothing else. Lose it and the database is unreadable: there is no recovery path, by design, and no fallback key is generated because a fallback would seal this boot's cards under a key the next boot cannot derive and lose the data quietly instead of refusing loudly. memoria keeps its copy at memoriadrive/DEK-production.txt alongside carlos secrets; do the same here, or better.

2. Set it, with the origin

carlos secrets set --app fichas --account bds FICHAS_DEK='<the base64>'
carlos env     set --app fichas --account bds FICHAS_ORIGIN='https://fichas.oficina.works'

FICHAS_ORIGIN is the CSRF yardstick and the base of every link the app emits, so it must be the host the browser is actually on. Unset, the app warns and falls back to loopback.

3. Ship it

make release          # refuses a dirty tree; stamps the version from git describe
carlos deploy --app fichas --account bds --channel edge --timeout 5m \
  releases/fichas-linux-arm64

Mail submission. Ship every build with --mail submit: it declares that the build sends through CARLOS mail submission (mail.FromCarlos, internal/fichas/mailer.go). Until carlos email submission on --app fichas runs, fichas keeps sending over CARLOS_SMTP_*; after it the agent sets CARLOS_MAIL=submit, fichas holds no SMTP credential, and every instance must run a build shipped with the flag. carlos deploy has no --mail flag yet (carlos main 9eec0236), so until it does ship and promote instead:

carlos ship --app fichas --account bds --mail submit releases/fichas-linux-arm64
carlos promote --app fichas --account bds <version> edge

Sign-in

Magic link through rastrillo's auth, with the owners list as the admission gate β€” the lone shape of suite ruling 5. FICHAS_SHAPE=suite is the intended default and refuses to boot: it needs the home's identity bridge and roster pull, and booting into it before those exist would mean an admission gate that is really the owners list while the operator believes it is the home's roster.

carlos secrets set --app fichas --account bds \
  FICHAS_DEK='<32 random bytes, base64>' \
  FICHAS_INSTANCE_KEY='<any long random string>'
carlos env set --app fichas --account bds \
  FICHAS_ORIGIN='https://fichas.oficina.works' \
  FICHAS_OWNERS='paul@keymail.dev'

FICHAS_INSTANCE_KEY seals the pending sign-in blob; auth.New refuses an empty one, because an empty input hashes to a fixed value identical across every deployment. FICHAS_OWNERS has no default: an empty admission gate on a public hostname admits anyone who can receive mail, so the app refuses to start without one.

Mail goes through the platform's sender:

carlos email enable --app fichas --account bds --from noreply@fichas.bds.oncarlos.com

The app refuses to boot without it. mail.FromEnv falls back to mail.Logged on missing SMTP with nothing but a warning, and mail.Logged writes the magic link β€” a live credential β€” into platform log storage we cannot grep and cannot retract. The first deploy of this app ran in exactly that state and nothing failed; a WARN scrolled past. LoadConfig now refuses, and FICHAS_ALLOW_LOGGED_MAIL=1 accepts it only on a loopback origin.

Live

https://fichas.oficina.works β€” account bds, channel edge. Sign in with an address in FICHAS_OWNERS.

fichas.bds.oncarlos.com still answers. It is the platform route the custom hostname sits in front of, not a second deployment, and signing in there still starts β€” but FICHAS_ORIGIN is the base of every sign-in link and the client_id keymail validates against, so the flow lands you on oficina.works and the session is set for that host. Use the canonical name. memoria made the same move, and its README says why being precise about it matters.

The hostname was attached on 2026-09-27 and the certificate took about 45 minutes to issue, with carlos domains list reporting issuing-cert and no guidance throughout. Do not switch FICHAS_ORIGIN until HTTPS actually answers on the new name: until then every emailed link points at a host that fails the TLS handshake. The list's STATE column also lags β€” it still said issuing-cert after HTTPS was serving β€” so check with curl, not with the list.