73 Commits
Author SHA1 Message Date
extant2000git 83e2a6c14a Merge pull request 'Throttle relay token mints per account (todo 507)' (#13) from p2-507-relay-throttle into main 2026-11-14 00:19:25 +00:00
1andClaude Opus 5.5 dd664b1a03 Throttle relay token mints per account (todo 507)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 19:13:50 -05:00
extant2000git ec75ee3f75 Merge pull request 'Mint one token per relay with iss, aud and jti (todo 370)' (#12) from fix/370-relay-token-claims into main 2026-11-13 19:48:40 +00:00
1andClaude Opus 5.5 594234c263 Mint one token per relay with iss, aud and jti (todo 370)
POST /sessions/relay trades a session token for a 5 minute token naming
one relay. Session tokens are unchanged, so shipped apps keep working.
A token with aud is refused as a session here and at the file server.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 14:44:52 -05:00
Paul HittandClaude Opus 5 02d5a60d87 Land what production already runs: the account_devices grant and the closed share link
Main did not have either of these. Production has run both since they
were made, so main was the copy that was wrong, and a rebuild from main
would have put the 500 back and reopened /s/:shareID.

845bd6fb adds the GRANT that 040_account_devices.sql never carried. The
blanket GRANT ... ON ALL TABLES IN SCHEMA in 010 covers what existed when
it ran, so account_devices arrived readable by its owner alone and every
Android sign-in got a 500 from POST /sessions. Production was granted by
hand on 2026-09-03; the file is now right too.

caf50d89 removed ShareController and the share routes. Main had already
deleted the whole of Sources/EnclaveServer, so those two files stay
deleted and only the SQL and the test come across.

Of the three tests the branch added, one survives. The other two read
sql/tenant and Sources/EnclaveServer/SQL/tenant, both gone from main
with the rest of the tenant server, so they would assert against paths
that no longer exist.

Verified before merging:
- accounts.flamenet.io/healthz 200, /s/test 404, / 404. The share route
  and the site controller are already gone from the running service.
- swift test --filter EnclaveSQLTests: 12 tests, 0 failures.
- The grant test fails with the GRANT line removed and passes with it
  restored, checked both ways rather than assumed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-10-14 13:32:26 -04:00
Paul Hitt 6c4aaf28dd Merge branch 'fix/deleting-an-account-tells-the-account-service' into 'main'
Remove Flamenet Files, and delete accounts outright

See merge request paulhitt/flamenet-files!10
2026-09-26 17:17:13 +00:00
Paul Hitt 5f6004a1dd Merge remote-tracking branch 'origin/main' into fix/deleting-an-account-tells-the-account-service
# Conflicts:
#	SECURITY.md
2026-09-21 17:42:35 -04:00
Paul HittandClaude Opus 5 7abe9c0ab2 Remove Flamenet Files, and delete accounts outright
Files was folded into the messenger, so this repository is the account
service and nothing else. The file server, its web client, its tenant
schemas and the documentation for all of it are gone.

Removed: EnclaveServer and its routes, EnclaveAccess, EnclaveCrypto, the
browser client under client/, the Files spec and vectors, the tenant SQL
under sql/, the web build and the node CI job, and the Leaf dependency
that only ever rendered the file server's pages. The Dockerfile built
EnclaveServer and shipped Public/ and Resources/; it now builds the
account service alone.

Nothing was lost. Every table in the production Files database was empty
when this was written: no nodes, no blobs, no identities, no tenants.
flamenetfiles.com, www.flamenetfiles.com and files.flamenet.io were
served by that stack and now answer 404; the compose file, the env and a
schema dump are on the box under /srv/prod/backups/, and the two docker
volumes were kept rather than pruned.

The service now issues pseudonyms for one product. `050_retire_files.sql`
deletes the `files` rows and replaces the CHECK constraint rather than
dropping it, so a container still being drained cannot write one back.
Every account had a `files` pseudonym and none had a `files` identity,
which is why there is no key material to migrate: the row was bookkeeping
for a product nobody enrolled in.

That also settles the delete endpoint added on this branch. It was built
around keeping a shared account alive while another product still held an
identity, and with one product that rule can never fire. `AccountRemoval`
and its five tests are gone, the response no longer reports which of two
outcomes happened, and a delete simply removes the account. None of it
had shipped, so there is no wire compatibility to keep.

Verified: the suites pass, the live delete script passes against a real
Postgres and a running service, and the image builds and boots to its
"DATABASE_URL is required" refusal, which is the account service and not
a file server.

`flamenet/files/auth/v1` stays as the authentication context string. It
is a wire constant baked into every stored verifier, not a product name,
and changing it would lock out every existing account. Said so in
ARCHITECTURE.md so nobody tidies it later.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-21 17:30:55 -04:00
Paul HittandClaude Opus 5 6daaf6eb69 Delete the account here when a client deletes it there
A Messenger account deleted from the phone removed the relay's copy and
stopped. This service kept its row, so the handle stayed taken and the
person stayed registered with a service they believed they had left.
Found on 2026-09-21 by creating and deleting an account against
production: the relay row went, `enclave_accounts.accounts` did not, and
the leftover had to be removed by hand.

There was no delete endpoint at all, so this adds one. It costs the same
proof a sign-in costs, because there is nothing else to check: a relay
credential means nothing here, and a sign-in token has long expired by
the time anybody deletes anything. Same constant-time shape as
`sessionInner`, so an unknown handle costs what a known one costs and
this is not an enumeration oracle.

What it deletes is the part worth arguing about. One handle backs both
products, so the widest reading takes the `identities` row that wraps
somebody's file key, and nothing else holds a copy. So the product asking
is not what decides: what decides is whether anything is still enrolled
once that product is gone. Messenger never writes an identity, so a
Messenger-only account has nothing enrolled and the row goes, which is
the case that was broken. An account Files is using keeps its account and
loses only the Messenger binding.

`AccountRemovalTests` pins that decision. It is pure on purpose, because
the alternative reading is a silent data loss and a rule that can only be
checked against a live database is a rule nobody checks.
`scripts/test-account-delete.sh` covers what the unit tests cannot reach:
the transaction, the schema's cascades, and that a refused passphrase
leaves the row where it was. Inverting the decision turns three unit
tests and scenario B red.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-21 16:15:02 -04:00
Paul Hitt b9ec330c6d Merge branch 'docs/say-which-half-of-the-model' into 'main'
Say which half of the model is enforced (ios#65, android#15)

See merge request paulhitt/flamenet-files!9
2026-09-07 11:57:59 +00:00
Paul HittandClaude Opus 5 525d7f7be5 Say which half of the model is enforced (ios#65, android#15)
ios#65 ends with a line worth acting on before anything else in it:
"'we implement Bell-LaPadula' should not be said anywhere until this is
settled, and I have not checked whether it already is."

It is said, here, in a public repository:

    It implements the *model*, for commercial multi-tenancy.

Only half of it does. Naming a model is a claim about which of its rules
hold, so the half that does not hold has to be named too.

What is enforced, checked rather than recalled: the server's
`Policy.decide` gates every mode on `subject.dominates(object)` — no read
up — and its default `WriteRule.equal` allows a write only at exactly the
session label. Both clients gate on `Clearance.permits`.

What is not: a principal cleared to a high label may open a session at a
lower one and write there, carrying down what they read above it. Neither
client stops that, and neither does the server, because a session label
inside a principal's clearance range is a legitimate session. That is the
★-property, and it is the half a lattice exists for — no-read-up stops
somebody reaching material above them, which most systems get right;
no-write-down stops it leaking downward through somebody allowed to see
it.

⚠️ Filed under "What it does not protect" rather than fixed, which is the
issue's own reading and worth restating: a rule enforced on one client
and not the other is worse than the gap, and strict enforcement with no
downgrade path produces a workaround culture. Doing it properly needs an
explicit downgrade action with an audit trail. Until that exists this is
written down rather than implied away.

79 tests.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-07 07:44:41 -04:00
Paul Hitt c6e75e0c01 Merge branch 'feat/asymmetric-session-tokens' into 'main'
Sign sessions with a key that verifiers cannot forge

See merge request paulhitt/flamenet-files!1
2026-09-07 01:30:15 +00:00
Paul HittandClaude Opus 5 b64c4640fe Test the encoding the published key is written in
This MR shipped 108 new lines of session signing with no tests, and the
repository had no CI to notice. It has both now, so it is worth adding
the ones that can exist.

`base64URLEncodedString` is the piece worth pinning, and its own comment
says why: standard base64 and base64url differ in three characters, and
plenty of JWT libraries accept the wrong one. A mistake there works
against whatever it was first tried with and fails somewhere else,
months later, for a relay operator who cannot verify a single session and
has nothing to go on. That is precisely what publishing a standard
`/.well-known/jwks.json` was for.

⚠️ Moved into `EnclaveAccountsKit` to do it. `EnclaveAccounts` is an
executable target and SwiftPM will not link one into a test, so the
function was unreachable from any test that could exist. A pure function
nothing can call from a test is a pure function nobody checks.

The fixture is three bytes chosen because their standard base64 contains
all three characters that must change — `+`, `/` and `=`. Encoding
something that happens to contain none of them passes with no
substitutions performed at all, which is the version of this test that
would have proved nothing.

🔴 And the first version of it CRASHED rather than failed. `UInt8(...)`
traps above 255, so `UInt8($0 * 7 + 200)` died at the ninth element — and
a trap is not a failure: the suite reported "Executed 0 tests, with 0
failures", which reads as a pass to anything grepping the log. Same shape
as the Poly1305 trap in the obfs4 port. `truncatingIfNeeded` now.

Checked by breaking the encoder: leave the padding in and two of the four
redden.

79 tests on Linux, 0 failures — verified in `swift:6.1-noble`, which is
where CI runs it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-06 21:22:46 -04:00
Paul HittandClaude Opus 5 09d14b1323 Actually sign with the key that was registered
Registering an EdDSA key does not make it the signer. `JWTKeyCollection` signs
with whichever key was added first unless a `kid` names another, and the HMAC
key is added first on purpose so existing verifiers keep working — so the
service logged that it signs with Ed25519 and then minted HS256.

Nothing would have broken. Every relay would have gone on verifying HS256,
`/.well-known/jwks.json` would have published a key nothing ever signed with,
and a relay somebody else runs would have stayed impossible for the same reason
as before, with a changelog saying it had been fixed.

Found by running both halves together. The enclave built, 52 unit tests passed,
and the relay accepted a hand-minted EdDSA token in eight separate checks —
every one of those is consistent with the service emitting the wrong algorithm,
because none of them asked the service for a token.

Verified end to end afterwards: a session minted by this service, signed EdDSA
with the published key, accepted by a relay holding ONLY the public key and no
shared secret.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-06 21:19:19 -04:00
Paul HittandClaude Opus 5 a8271cfab9 Sign sessions with a key that verifiers cannot forge
Sessions are signed with a shared HMAC secret. That is fine while every verifier
is a service we run, and it permanently excludes everyone else: HMAC cannot
separate verifying from minting, so a relay given the secret in order to CHECK a
FlameNet session could equally FORGE one for any account here. There is no
configuration of a shared secret that makes it safe to hand out — which is why
somebody else's relay has never been able to accept FlameNet identities.

Ed25519 separates the two. The private half stays in this service; the public
half is published at `/.well-known/jwks.json` in the standard shape, so a relay
operator points ordinary JWT tooling at it rather than writing something bespoke
against a format only this project uses. Anyone can verify. Nobody else can
sign.

Both algorithms are registered during the changeover, and signing only moves to
EdDSA once a key is configured. Existing verifiers hold the shared secret and
nothing else, so they would reject every token the moment this service started
signing with a key they have never seen. Retiring HMAC is a separate step that
has to follow the verifiers, not lead them.

Additive: with ENCLAVE_JWT_PRIVATE_KEY unset nothing changes, and the service
logs why third-party relays cannot be added in that state rather than leaving it
to be discovered.

`kid` is present from the first key even though there is only one. Without it a
second key later forces every verifier to try each key against every token, and
a rotation becomes indistinguishable from a forgery attempt in the logs.

Existing suites pass unchanged (52 tests). What this does NOT do: the relay
still verifies with the shared secret, so nothing can use this yet — that side
is the next change, and until it lands this is capability without a consumer.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-06 21:19:19 -04:00
Paul Hitt 3c635735d0 Merge branch 'ci/this-repo-has-never-had-a-pipeline' into 'main'
Give this repository a pipeline, which it has never had

See merge request paulhitt/flamenet-files!8
2026-09-07 00:58:54 +00:00
Paul HittandClaude Opus 5 e738a2ea7b The gate was written in python, and the Swift image has no python
The suite passed — 75 tests, 0 failures — and the job died anyway, twelve
minutes in:

    python3: command not found

`swift:6.1-noble` has no python3, and no curl, xxd or jq either. That is
a documented trap in this account, written down after it bit three times,
and this is the fourth. I read the note about the vector pin from the
same memory an hour ago and still wrote the gate in python.

Both gates are awk now, which every image has, and neither job installs
anything.

Verified by extracting the awk back out of the YAML and running it
against the real Linux `swift test` output captured from a container —
not against this Mac's, because the two platforms format the run
differently and a gate checked only here can read zero on the machine it
runs on. It reads 75. A shrunken suite exits 1, and so does a suite with
failures; both were checked with synthetic logs rather than assumed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-06 20:52:31 -04:00
Paul HittandClaude Opus 5 426d843f5e The test suite did not compile on the platform the service runs on
The first pipeline this repository has ever had failed in its first
minute, on Linux, in a file that builds cleanly on macOS:

    error: let 'secret' is not concurrency-safe because non-'Sendable'
    type 'SymmetricKey' may have shared mutable state

Apple's CryptoKit marks `SymmetricKey` as `Sendable`. swift-crypto, which
is what builds on Linux, does not — so a private global `let` of one is a
strict-concurrency error there and fine here. The service is deployed as
a Linux container built from this repository, and its tests had never
once been compiled on that platform, because there was nothing to compile
them.

`nonisolated(unsafe)`, which is sound as written rather than a way of
switching the check off: both are immutable test fixtures, read and never
mutated, so the compiler's concern does not apply.

Verified on Linux rather than reasoned about — `swift build --build-tests`
then `swift test` under `swift:6.1-noble`: 75 tests, 0 failures.

⚠️ And the gate itself was verified against real Linux output, not just
against this Mac's. The two platforms format the run differently — macOS
produces three test bundles here, Linux one — and a gate that summed
per-bundle totals could have read zero on the platform it actually runs
on while looking correct locally. It reads 75 there.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-06 20:35:30 -04:00
Paul HittandClaude Opus 5 a95a64cde9 Give this repository a pipeline, which it has never had
Both open merge requests show `pipeline: None` — not failed, not
skipped, never run. There was no `.gitlab-ci.yml`, so nothing has ever
tested a change to the service that holds people's files and is about to
start signing their sessions. !1 has been open since 23 August waiting
for a verdict that could not arrive.

Two jobs, because the two suites answer different questions and
TESTING.md is right that neither answers the whole one: `swift test`
proves the lattice, the SQL and the accounts kit; the node suite proves
the client modules the browser runs. Whether a route or a button is wired
to any of it is what the integration scripts are for, and those need a
live stack, so they stay manual.

Both gates assert on COUNTS rather than on exit status:

  - The package builds three separate test bundles. A target that
    silently stopped being built would take its tests with it, and the
    remaining bundles would still report a clean run. The gate sums the
    per-bundle totals and floors them at 68 against today's 75.
  - `node --test client/test/` — the directory rather than the glob —
    runs NOTHING and reports one opaque failure. I verified that rather
    than taking TESTING.md's word for it, because a warning nobody has
    checked is how the last one I wrote turned out to be false. The glob
    matching too little is the same failure in the other direction, so
    the count is floored at 85 against today's 95.

⚠️ One thing I could not pin down and will not paper over: the very first
node run in a fresh container reported 94 passed and 1 failed, and I have
not reproduced it in nine subsequent runs, six warm and three cold. No
subtest was marked failing in that output — every one of the 95 said ok —
so the failure was at file level. If this job goes red intermittently
that is the thing to chase, and the count gate will show it as 94 rather
than as a vague red.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-06 20:13:30 -04:00
Paul HittandClaude Opus 4.8 caf50d8904 Close the public share link
The /s/:shareID page and the whole share API are gone.

It was cryptographically sound: only the id reached the server, the secret
rode in the URL fragment, and browsers do not transmit that — so the
server genuinely could not open what it served. What was wrong is what the
link IS. A bearer token for a classified document, pasteable into any
chat, mailable to anybody, forwardable for ever, and with nothing on the
far end that knows or cares what the file was labelled.

Sharing is inside the apps now: a document goes to a named contact through
the ratchet, carrying its label, and the sender is told who will be able
to open it. Worse for handing something to a stranger, which is the point.

⚠️ Checked before removing rather than after: five shares had ever been
created and none were still live, so no link in anybody's hands stopped
working.

The controller is deleted rather than commented out — code kept "in case"
is code the next reader has to work out the status of. The `shares` table
is left in place; dropping it is a migration and a separate decision from
closing the door.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-03 13:55:46 -04:00
Paul HittandClaude Opus 4.8 845bd6fb55 The grant account_devices never had, and a test that would have caught it
🔴 Android sign-in returned "something went wrong on the server" for every
attempt. POST /sessions read the accounts row, then hit "permission denied
for table account_devices" reaching for the device list, and returned a
500.

The cause is a line in 010_accounts.sql that reads like a standing rule
and is not one:

    GRANT ... ON ALL TABLES IN SCHEMA enclave_accounts TO accounts_service;

That grants what exists when it runs. Every table added afterwards arrives
readable by its owner alone. 020 and 030 both carry their own GRANT for
exactly this reason; 040 did not.

⚠️ Nothing about the failure pointed at grants. The app was up, the
database was up, the table existed with the right columns, and the person
signing in was told only that something had gone wrong. That is the whole
argument for the test: this class of bug is invisible until it is in
production, and then it looks like everything else.

Production was granted directly and sign-in verified — POST /sessions now
answers 401 for bad credentials instead of 500.

The test asserts every table created outside 010 is granted to
accounts_service, and was confirmed to FAIL with the grant removed and
pass with it restored, rather than being assumed to work.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-03 12:35:24 -04:00
Paul Hitt 022af50f2b Merge branch 'fix/account-devices-as-its-own-migration' into 'main'
account_devices as its own migration

See merge request paulhitt/flamenet-files!6
2026-09-03 11:28:02 +00:00
Paul Hitt e1feaa5f02 account_devices as its own migration, because the first way was a no-op
The table went into 010_accounts.sql, which Fluent has already recorded as
applied. So it created itself perfectly on a fresh database and did nothing
at all on production — the deploy reported success and the table was not
there.

The warning for this is written on AddRateLimitCounters, in this same file,
because the identities table was nearly lost to it: "A NEW migration, not an
edit to InstallAccountsSchema. Fluent records what it has run and never runs
it twice, so appending this DDL to an applied migration would work perfectly
on a fresh database and silently do nothing on the deployed one." I read that
comment while writing the code that ignored it.

The baseline goes back to frozen, and the table lives in SQL/040 behind
AddAccountDevices, the way identities and rate limits do.

⚠️ No client sends a device id yet, so nothing was broken by the gap — the
INSERT is only reached when one is supplied. It would have broken sign-in for
the first client that did, which is a worse place to find it.

42 tests.
2026-09-03 07:27:49 -04:00
Paul Hitt a3393f1fe4 Merge branch 'fix/qualify-tables-inside-policies' into 'main'
Qualify every table a policy names, and test that they are

See merge request paulhitt/flamenet-files!5
2026-09-03 11:19:36 +00:00
Paul Hitt e8ee08db5a Qualify every table a policy names, and test that they are
The files deployment failed on this: `relation "clearance_revocations"
does not exist`. A policy body is parsed when the policy is CREATED, under
whatever search_path the migration runs with — and the migrator's does not
include the tenant schema. So `SELECT 1 FROM clearance_revocations` inside
a policy is a script that parses perfectly, passes every test this repository
had, and fails only against a real database.

Four references across 004 and 005, all now :schema.-qualified, which is the
convention 003 already followed.

⚠️ It failed AFTER creating the table, so t_default was left with
clearance_revocations present and the migration unrecorded. Both scripts use
CREATE TABLE IF NOT EXISTS and DROP POLICY IF EXISTS — the idempotence the
migrator's own documentation asks for — so re-running lands cleanly on that
state rather than needing it unpicked by hand.

The new test would have caught it: reintroducing the exact line fails with
the file and line number. It skips `IS DISTINCT FROM` and `EXTRACT(x FROM
y)`, which are not table references and which the first version of the check
reported as bugs.

accounts.flamenet.io is already on the new image and healthy; files is still
on the previous one because the migration gate stopped before it was
restarted, which is the gate working.
2026-09-03 07:19:25 -04:00
Paul Hitt 3f1e98d60f Merge branch 'feat/revocation-rotates-the-label-key' into 'main'
Revoking a clearance rotates the label key, or it revokes nothing

See merge request paulhitt/flamenet-files!4
2026-09-03 11:07:49 +00:00
Paul Hitt cae48d9e1d Vendor the BIP-39 wordlist, and prove it against the published vectors
Fetched from bitcoin/bips rather than written out from memory — reproducing
2,048 words by hand is exactly the failure the roadmap objected to. Its
SHA-256 is 2f5eed53a4727b4bf8880d8f3f199efc90e58503646d9ff8eff3a2ed3b24dbda,
which matches the constant already pinned in bip39.js.

🔴 The digest alone would not have been enough. It proves the file is the one
that was published; it says nothing about whether this implementation packs
the bits the same way everyone else does. A correct list with a wrong
bit-packing derives a valid-LOOKING phrase for the wrong wallet, and the way
somebody finds that out is restoring into another app and seeing an empty
account.

So the official vectors are asserted end to end: entropy produces the phrase
every other wallet produces, those phrases decode back to the same entropy,
and — the one that settles it — the seed for the all-zero vector is
c55257c3…e7463b04, byte for byte.

The .txt is the vendored artefact, byte-identical to upstream, so checking it
against the source is a file comparison rather than a review of 2,048 lines.
scripts/build-wordlist.mjs generates the module Node and the browser import,
and nothing about that generation is trusted: verifyWordlist re-checks the
digest at runtime, where a mis-generation would do harm.

Also removed a seed constant I had written into the vector table from memory
and never asserted. It looked plausible and was unverified; the next person
to add an assertion would have been pinning my guess.

The web bundle now carries the wallet, so it is reachable from a browser
without waiting on Swift and Kotlin ports.

95 client tests, 0 failures.
2026-09-03 06:50:37 -04:00
Paul Hitt cbeff79037 Wallet seeds: BIP-39, and the two doors from SPEC §8
Implements §8 against the spec written for it, with one deliberate gap.

🔴 The wordlist is INJECTED, not vendored here, and `verifyWordlist` refuses
any list whose SHA-256 does not match the published digest. That is the whole
mitigation for the objection recorded in the roadmap: 2,048 words that must
be byte-exact is a footgun, and a corrupted list does not error — it produces
a DIFFERENT wallet from the same phrase, discovered when somebody restores
and finds an empty account. Checked at load, that becomes a failure at
startup.

I did not vendor the list from memory. Reproducing 2,048 words by hand is
precisely the failure being guarded against, and a wrong constant here fails
CLOSED — a correct list would be rejected and nothing would derive, which is
the safe direction to be wrong in.

🔴 The ENTROPY is stored, never the seed. A seed is a one-way function of the
phrase, so a record holding one would open the wallet and never produce the
words: somebody who lost their phrase but kept their account could spend and
could never move elsewhere or write it down again — self-custody in name
only. Keeping the entropy means the account can always regenerate the phrase.

🔴 Either door alone opens the same wallet, and a test asserts the two seeds
are identical: the account, and the phrase with no account involved at all.
Losing both is unrecoverable by anyone including us, which is the honest
shape of this and belongs on screen where a phrase is first shown.

The record is bound to `flamenet/wallet/seed/v1` as AAD, so a record made
for another context does not open here — the same separation that stops a
Files identity record being read as Messenger's.

Twenty-two tests: entropy round-trips at every permitted size, a swapped word
fails the checksum rather than naming another wallet, an unknown word is
named rather than ignored, an altered list changes the digest, imports from
other wallets work, and a bad phrase is refused at import rather than stored
and discovered later.

90 client tests, 42 Swift tests, 0 failures.
2026-09-03 06:37:20 -04:00
Paul Hitt 5e1bcf09fd Rotate the label key on the client, which is the only place it can happen
The server records that a revocation was asked for and which generation ends
it. This is the part it cannot do: it holds no key that opens a label key, a
node key or a content key.

🔴 Grants first, re-wraps second, and that order is the entire safety
argument. Re-wrapping node keys before the grants land and then dying leaves
every file at that label wrapped to a key NOBODY holds — not a failed
rotation, permanent data loss for everyone still cleared. The other order
fails softly: grants land, the process dies, node keys are still at the old
generation, everyone reads exactly what they read before, and it can be run
again. One order loses the data; the other loses only the property you were
trying to gain, and only until the next attempt.

🔴 A resume must reuse the key the abandoned run minted. Found by writing the
resume test and then noticing I had skipped a file in its assertion — the
kind of skip that hides the bug it is standing next to. Minting again looks
harmless and loses data: both runs write the same generation, so the node
keys the first finished are under key A and the rest under key B while every
grant names B, and the first run's files open under nothing anybody holds.
The rows are consistent, the generations agree, and the data is gone.

The abandoned key is recoverable precisely BECAUSE grants are written first:
a run that re-wrapped anything had already granted itself the new key. An
ordering chosen for crash-safety turns out to be what makes resuming possible
at all. A second test demonstrates the failure rather than describing it —
two runs that each mint a key, and the first run's work unreadable.

Rotating to nobody is refused. Wrapping every file under a key that is then
discarded is not a rotation, and a label with no cleared holders needs a
decision about its data rather than a silently unopenable set of files.

6 rotation tests, 68 client tests, 42 Swift tests.
2026-09-03 05:17:15 -04:00
Paul Hitt fd8624f4bb Specify the wallet, and say why its seed is not derived
Writes the wallet into the spec as §8, in the same form as the sections
around it, before any code exists to disagree with.

The decision the rest follows from: the seed is NOT derived from the account
passphrase, the way Files and Messenger identities are. Two reasons and
either is decisive. A passphrase can be changed, and a Files identity can be
re-wrapped when it is — coins sent to an address nobody can derive again
cannot. And a derived seed is not portable, which was the requirement: a
phrase that only means something beside a Flamenet passphrase does not
restore into anybody else's wallet, and one that can be exported without it
makes the derivation decoration.

So the wallet root is its own secret, and recovery is BIP-39 rather than this
system's Crockford codes. That reverses a decision recorded in the roadmap,
and deliberately: the objection to a word list — 2,048 entries that must be
byte-exact — is right for Files and does not survive a requirement that
outside software understand the phrase. The mitigation is a test that checks
the vendored list against its published SHA-256, which turns silently wrong
into fails-at-build.

🔴 Two doors, both wanted. The passphrase opens the wallet on a synced
device; the phrase restores it anywhere, including into a wallet that has
nothing to do with this project. That second one is the promise, and it is
what stops this being a custodial product wearing a self-custody label.

⚠️ Compartmented wallets are deliberately NOT specified. Putting wallet keys
in the lattice fits and would be genuinely unusual, but it inherits key
rotation on revocation — and a revocation event that re-encrypts the wrap
around somebody's seed has a worse worst case than one that re-encrypts a
document. Worth doing once rotation has been exercised where the worst case
is recoverable.

Also corrects §9, which still listed recovery phrases as unbuilt months after
they shipped, and now describes what half of rotation actually exists.
2026-09-02 22:28:48 -04:00
Paul Hitt 3f682eef7a Upload as a transfer, and collect it
Completes the courier chain: an upload can be a transfer, the devices waiting
for it are recorded, and a device says when it has the bytes.

The device list travels in the TOKEN, not from the uploading client. A tenant
role has no grant on the account schema and never will, so Files cannot ask
who else is signed in — and letting the uploader name the recipients is the
quietly worse alternative: a client that under-declares produces a transfer
that completes early and is swept before the device it forgot ever asks. The
account service knows, so the account service says. Capped at 32, most
recently seen first, because this rides on every request.

Courier is opt-in per upload via X-Enclave-Blob-Mode and the default is what
Files has always done. A header that silently turned an upload into something
the server will delete is the wrong default in the one direction that cannot
be undone.

The uploading device is excluded from its own transfer — it has the file, and
waiting for it would mean no transfer ever completes. The response says how
many devices are waiting, so a client can tell somebody that a courier upload
with nowhere to go will expire rather than arrive.

🔴 Collection is a separate call from the download, and that is the whole
point of it. A download that has STARTED is not a file that has ARRIVED: the
response can fail halfway, the disk can be full, the app can be killed.
Acknowledging on the GET would release the server's copy while the only
complete copy was still in flight. The client says so once the bytes are
written down.

The update only sets collected_at when it is null, so a device acknowledging
in a loop cannot hold the grace window open for ever.

42 tests, 0 failures.
2026-09-02 22:27:34 -04:00
Paul Hitt 27e452fd4f One device list, shared between Files and Messenger
Files had no notion of a device at all: a session carried a principal, a
clearance and a label, so "hold this until the other device has it" had
nothing to be complete against.

Rather than invent a second registry, the identifier is the one Messenger
already uses. Messenger registers devices with the relay and holds their keys
there — that registry is cryptographic and stays exactly where it is. This
adds the much smaller thing Files actually needs, in the one place both
products already share: which devices exist for an account.

A person has devices, not Files-devices and Messenger-devices. Two registries
that disagreed about that would strand a transfer waiting for a device the
other product does not believe in.

The account service records the device at sign-in and seals it into the
token, so it cannot be swapped per request without authenticating again.

⚠️ Bound, not proved. The client names its own id; this says a device EXISTS,
not that the caller is it. What it is trusted for is scoped to match: deciding
when a couriered transfer has reached everything waiting for it. A device
lying about its id marks somebody else's transfer collected and loses its own
copy sooner — it gains no access, because every blob is still ciphertext under
a label key it would also have to hold.

🔴 The claim is optional and must stay optional. Every token already in a
client's hands predates it, and a non-optional field would fail to decode all
of them — signing out every session on deploy for a claim nothing reads yet.
A test pins that a token with no `dev` still decodes; making the field
non-optional does not even compile.

Devices are deliberately never reaped for inactivity. A transfer waiting on a
laptop that has been shut for a month should still be waiting when it opens.
The courier backstop bounds that by the age of the transfer, which is the
honest measure, rather than by the habits of a device.

42 tests, 0 failures.
2026-09-02 21:31:42 -04:00
Paul Hitt 50f1cc27c6 The sweep that does the deleting, switched off
Mirrors the relay's retention loop, including the lesson written into it:
`.notice`, not `.info`, because that sweeper logged at a level production
suppressed and the only way to know it was alive was to query the database
and find nothing past a window.

Order of operations is the upload path's, reversed: row first, object
second. A crash between them leaves an orphan, which is collectable, rather
than a row pointing at a file that is gone, which reads to every caller as
data loss. `BlobStore.remove` treats an already-missing object as success
for the same reason — a retry after that crash should carry on, not fail for
ever on a blob nobody can reference.

Only courier rows are even SELECTed. `CourierSweep.verdict` refuses to drop
a stored blob anyway, but not fetching them means a mistake in the IO layer
cannot reach one either.

🔴 ENCLAVE_COURIER_SWEEP, off unless set. Nothing is courier mode today, so
it would find zero rows either way — which is precisely the right moment to
make it deliberate. A sweeper is easy to switch on when the feature arrives
and impossible to un-delete if it runs before anyone expected it.

⚠️ And it is still not the feature, because device identity does not exist
yet. A session carries a principal, a clearance and a label, and no notion
of which device is asking; `blob_deliveries.device_id` has nothing behind
it. Until that lands, every transfer has zero intended devices, which reads
as awaiting collection and is held to the backstop. Safe, and honest about
what it is.

38 tests, 0 failures.
2026-09-02 21:22:36 -04:00
Paul Hitt 689f55168d Decide what a courier sweep deletes, separately from deleting it
The rule that decides whether somebody's file is removed now lives in one
readable function with no database, clock or object store behind it, and
fifteen cases pinning every branch — including the branches whose only job is
to stop a deletion.

Three of those matter more than the rest:

- `stored` is checked first and returns before anything else is considered.
  A blob uploaded under "we keep this for you" cannot be reached by a
  delivery rule however old it is or however few devices asked for it.
- Zero intended devices is NOT complete. Between an upload and its delivery
  rows being written there is a moment with no recipients recorded; reading
  the empty set as satisfied would delete a file whose only copy may still be
  in flight.
- Complete but with no recorded completion time is KEPT. The server knows it
  landed and not when. Guessing late costs a day of storage; guessing early
  costs the file.

Partial delivery is not delivery: a file that reached the phone and not the
laptop has not arrived, and dropping it there loses it for the laptop for
ever. Over-collection is treated as complete, so a device acknowledging
twice cannot wedge a transfer open.

Retention defaults to the relay's numbers — a day after delivery, thirty for
something that never arrived — and is configurable so a self-hoster can hold
less without editing code.

Checked that these tests can fail: removing `intended > 0` from
`isComplete`, the exact bug the comment warns about, fails four of them.

38 tests, 0 failures.
2026-09-02 21:19:44 -04:00
Paul Hitt 7fdcf3a4d1 The server as a courier, without deleting what it already holds
Adds the transfer model: a blob may be 'stored' (kept until the owner
deletes it — what Files has always done) or 'courier' (held only until every
intended device has collected it, then dropped).

🔴 The migration does not change existing data, and that is the point. Every
blob written before today was uploaded under "we keep this for you".
Sweeping those on a delivery rule would delete files people believe they
still have, and correct new behaviour does not make that anything other than
data loss. `mode` defaults to 'stored', existing rows take the default, and
courier applies only to uploads that ask for it.

Delivery is tracked per DEVICE, not per person: a file that reached the
phone and not the laptop has not arrived, and dropping it then loses it for
the laptop for ever. `blob_transfer_state` also refuses to read "no
delivery rows" as "everyone has it" — a transfer nobody was named for is
incomplete, not complete, or it would be swept the moment it was uploaded.

The retention shape is the relay's, deliberately. Messenger has run exactly
this for envelopes since it shipped — a delivered flag, a short grace, a
longer backstop for a recipient who never appears. Same vocabulary rather
than a second one to reason about.

⚠️ Courier mode is not a backup and the interface must not imply it is. If
every device holding a file loses it, it is gone; the server has no copy by
design. That is the trade for "nothing stored permanently" and belongs in
plain words on screen, not in a surprise.

Still to come: the sweep itself, the upload path that sets the mode, and the
client that acknowledges collection. Schema and its invariants first, so the
thing that decides what gets deleted is reviewable on its own.

23 tests, 0 failures.
2026-09-02 21:15:39 -04:00
Paul Hitt cbcbe44234 Revoking a clearance rotates the label key, or it revokes nothing
The roadmap has carried this as a known hole: "Revoking a compartment should
rotate the label key and re-encrypt; today a revoked holder keeps the old key
and prior content stays readable to them." There was no revoke path at all —
`label_key_grants` carried SELECT and INSERT to the tenant role and nothing
else.

That gap was not an oversight about DELETE. Deleting the grant row is the
DANGEROUS version of this feature: the key is already on the revoked
person's device, so removing their row removes a record rather than an
ability, and every node key at that label stays wrapped to the key they
still hold. A screen saying "access removed" on the strength of that would
be stating something untrue.

So revocation is modelled as the two separate things it actually is:
withdrawing the grant, which is immediate and worth little on its own, and
rotating the label key, which ends access to anything filed afterwards and
which the SERVER CANNOT DO — it holds no key that opens anything. Only a
cleared client can perform the rewrap.

That is the shape `regrade_requests` already uses, and this follows it
rather than inventing a second vocabulary: the server records intent, a
cleared client moves it to done and must name itself to do so.

🔴 The status vocabulary refuses to lie. There is no `revoked` state
reachable by withdrawing a grant alone. The states are what is true —
`requested` (the grant is gone, the key is not), `rotating`, `rotated`.

Also here, because both were found while writing it:

- The incremental tenant scripts were never parse-tested. Only the baseline
  schema was, and the baseline runs once per tenant and never again — so an
  unparseable incremental breaks upgrades for every existing deployment
  while a fresh install stays healthy. Both tenant scripts are now covered.
- Those scripts exist twice, at sql/tenant/ and in the bundled resources,
  kept in step by hand. A test now fails if they drift, because the bundled
  copy is the one that runs and the other is the one people read.

Not yet done, and deliberately a separate change: the client side that
performs the rewrap, and the controller that drives the state machine.
23 tests, 0 failures.
2026-09-02 21:13:22 -04:00
Paul Hitt aa45b9fb82 Merge branch 'feat/donate-connected-account' into 'main'
Take the donation here, on FlameNet's own account

See merge request paulhitt/flamenet-files!3
2026-08-25 19:00:17 +00:00
Paul HittandClaude Opus 5 6f704cfb72 Take the donation here, on FlameNet's own account
Two things, and the second is why the first had to change.

The money was landing on the wrong account. `FN_DONATE_SECRET` is a Stripe
platform key, and a call that does not name a connected account is answered
against the platform itself — with a 200, a receipt and a charge, so
nothing about the page looks wrong and the only symptom is which balance it
turns up in. `FN_DONATE_ACCOUNT` is now sent as `Stripe-Account` when the
session is created, making the charge a direct one on FlameNet: its
balance, its fees, its payout, FLAMENET on the statement. Unset stays valid
and still means "charge whatever account this key belongs to", which is
what a self-hoster with their own key wants — and boot now says which of
the two it is doing, because the wrong one is otherwise silent.

Taking the payment on the page is the other half. The session is created
with `ui_mode=embedded_page` and mounted on `/donate`, so nobody is sent to
Stripe's site and returned. The card fields are still Stripe's own, in a
frame this server cannot read, which is what keeps this out of PCI scope —
`js.stripe.com` is the price of that and cannot be self-hosted.

⚠️ `ui_mode=embedded` — the documented value when this was written — is now
REJECTED: "The ui_mode value `embedded` is no longer supported. Use
`embedded_page` instead." Nothing pins a Stripe-Version, so the account's
default decides, and a rename on their side arrives as a 400 on a live
donate page rather than as a build failure here.

`Environment.value` comes with it, because the controller needs "blank
means absent": Compose sets every `VAR: ${VAR:-}` to the empty string and
`Environment.get` hands that back, so a plain `!= nil` reads an
unconfigured deployment as a configured one — which is how a page offers
payment with no processor behind it. The refusal is now specific: a missing
publishable key, a test secret paired with a live publishable key, or an
`FN_DONATE_ACCOUNT` that is not an account id each name themselves rather
than rendering a form that cannot work.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-25 14:55:53 -04:00
Paul Hitt 784ba853c8 Merge branch 'feat/durable-throttle' into 'main'
A rate limit a restart resets is not a rate limit

See merge request paulhitt/flamenet-files!2
2026-08-24 20:35:18 +00:00
Paul Hitt 594e553a48 A rate limit a restart resets is not a rate limit
The throttle counted attempts in an actor's dictionary, so every restart
handed out a fresh budget from every address. "Three sign-ups per hour"
was true only between restarts, and a deploy, a crash or an OOM kill each
silently cleared it. Found by exploiting it: restarting the accounts
container to get past the limit during testing worked, and anything that
works for me works for a script.

Counters now live in Postgres. Rows per attempt rather than a counter,
because the window slides and only timestamps can answer "three in the
last hour". The decision — count, compare, record — happens inside one
function under a per-bucket advisory lock: counting in the service and
inserting afterwards is a check-then-act race that a single process never
had and a shared table absolutely does. A negative control confirms it
matters, admitting 7 against a limit of 5 without the lock.

The in-memory limiter stays in the kit as the reference implementation.
Its unit tests pin semantics that are easy to get subtly wrong, and a
test needing a live database is a test that gets skipped.

Two test scripts, because the first one was not enough. The SQL-level
tests passed while the service was returning 500 on every sign-in: psql
sends literals the parser coerces, but the driver binds in binary with a
declared type, so `text` and `bigint` arrived at a function taking
`interval` and `integer` and no call ever resolved. Only the real binary
against a real database caught it, so that run is now a script too — and
it ends by restarting the service and checking the budget is still spent,
which is the whole point of the change.
2026-08-24 16:34:44 -04:00
Paul HittandClaude Opus 5 f1fcb5f47e Test the account surface, and the traps that made it untestable
Adds `scripts/integration/account-functions.mjs`: registration, sign-in,
changing a passphrase you still know, and getting back in with the code
when you don't — twenty-six checks against a live stack, using the same
modules the browser runs rather than a second implementation of them.

The one that matters most is that the code shown after recovering is the
one the account service will accept next time. Both mobile clients failed
it: they minted the replacement code twice, sent one to the account
service and printed the other, so a first recovery looked perfect and left
the account openable only with a code nobody had ever seen.

Along the way, the things that made any of this reproducible:

- `reset-local.sh`, because the open area is shared and every test run
  leaves rows in it. After a few hundred runs a new folder is no longer on
  screen and the app suites fail for reasons that have nothing to do with
  the apps.
- `seed-ui-account.mjs`, because choosing where a file is filed needs a
  clearance, clearance is assigned by command with no endpoint by design,
  and a test inside a simulator cannot run one.
- `local-for.sh`, for the two-addresses problem: one advertised account
  service URL cannot be right for a browser and an emulator at once.
- TESTING.md, for all of the above plus the device-isolation rules. Two
  test runners on one simulator produce failures that look exactly like
  product bugs, and `connectedAndroidTest` silently runs on every attached
  device.

`currentLabelKey` now says "Choose an area first" instead of dying inside
a key-name helper with "cannot read properties of null", which sent me
looking at the crypto rather than at the missing step.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-22 20:26:40 -04:00
Paul Hitt 672add8f14 Say what the internal accounts URL is for in .env.example
Commented out, because the bundled compose already sets it and a
self-hoster should not have to think about it. It only matters when the
two services are split across hosts, and the failure it prevents reads as
"could not reach the account service" while the service is plainly
running.
2026-08-21 22:28:32 -04:00
Paul Hitt e04b5a7825 No clearance row is the bottom of the lattice, not the absence of one
The clearance check refused any account without an assignment, which meant
two ordinary new users could not share the public area — the commonest
case there is — while their tokens plainly permitted it.

`sessionInner` has always treated an absent assignment as the bottom of
the lattice when minting a token. This now does the same, so the two agree
about what a fresh account is allowed to do. They disagreeing was the bug.

Found by running it through the iOS client against production rather than
by reading it: two fresh accounts, both at Public, and the grant came back
"Not found".

The integration test covers it now, alongside the case it was confused
with — an account genuinely below the label being refused.
2026-08-21 22:18:39 -04:00
Paul Hitt 1876fc537b Note the lazy-minting consequence in the roadmap 2026-08-21 22:12:00 -04:00
Paul Hitt b9e8437b22 "Encrypted for another key", not "another area"
Wrong in exactly the case that matters. A row at your own label, filed by
somebody whose key you have not been given, was labelled as belonging to
another area — while the chip above it said you were in that area. That
reads as a bug rather than as the design, and it is the first thing two
testers at the same level will see.
2026-08-21 22:11:04 -04:00
Paul Hitt a219e91fdc Make sharing an area actually work, and fix two things that stopped it
The feature was committed and did not work. Two separate faults, both
found by running it rather than by reading it.

Fluent's `create` appends `RETURNING "id"`, and Postgres runs that read
back through the table's SELECT policy — which restricts label_key_grants
to your own rows. Inserting a grant for somebody else therefore failed at
the read, not the write, and the redacted PSQLError read exactly like a
unique-constraint violation. It is a raw INSERT without RETURNING now; the
id is generated here and grant_audit is what records that it happened.

Switching to an area no longer mints a key. Minting on arrival meant two
people cleared for the same label each self-granted a different key the
moment they *looked* at it, so the later gift always collided with the key
the recipient had already made for themselves. Sharing would have failed
almost every time in real use. A key is minted on the first write instead,
by which point the caller has committed to putting something there and a
collision is a genuine conflict rather than an artefact of browsing.

Also: the server needs a different address for the account service than
the browser does. ENCLAVE_ACCOUNTS_URL goes into /api/config and is what a
tab dials; inside a container 127.0.0.1 is the container, and the failure
reads as "could not reach the account service" while it is plainly
running. ENCLAVE_ACCOUNTS_INTERNAL_URL defaults to the public one, because
on a single host they genuinely are the same.

And the share panel lists the links already made for a file, with a way to
revoke them. It only ever showed the link it had just created, so a link
made last week could not be revoked from the interface at all — the API
could list and revoke it, nothing asked.

scripts/integration/area-sharing.mjs covers the whole thing against a live
stack, using the same modules the browser runs: that bob sees the row and
cannot read it before the grant, reads it after, that an uncleared account
is refused, and that granting twice is a conflict.
2026-08-21 22:07:33 -04:00
Paul Hitt 9c66120dff Two people can finally share an area
Until now every account was an island. Two people cleared for the same
label saw each other's rows and could decrypt none of them, because
`ensureLabelKey` mints a fresh random key per principal when none has been
granted. It is the first thing a two-person test hits, and the reason it
stayed broken is that the file server cannot see clearances — a tenant role
has no grant on the account schema, deliberately.

So the check is split across the two places that can each see half of it.
The database enforces that the granter already holds a key at exactly the
session label, so nobody mints a key for a label they cannot assert. The
account service enforces that the recipient is cleared, asked with the
caller's own token.

That endpoint is shaped to avoid being a membership oracle: it takes a
handle rather than an id, and every kind of no — unknown, uncleared, not
enrolled — is the same 404. Who holds a compartment is exactly what the
read policy on label_key_grants refuses to disclose, and this must not
become the way around it.

The clearance check is the weaker half and the comments say so. A label key
alone opens nothing: rows at that label stay hidden from a session whose
token lacks the clearance, so a grant that slipped past would hand somebody
ciphertext and a server that will never serve it to them.

Grants are recorded in grant_audit, readable by either party and nobody
else. There is no revocation — the row can go, the key cannot — and the
interface says "give them the key" rather than offering a delete button
that would imply otherwise.

Also here, because they were in the way:

Tenant schemas have an upgrade path. The template ran once per tenant and
never again, so share links reached new deployments and no existing one.
Numbered scripts under SQL/tenant/ are each their own migration now, listed
explicitly in Swift — enumerating bundle resources is not portable and an
explicit list is reviewable in a diff.

Registration has its own rate limit, three per address per hour against
forty sign-ins per five minutes, consumed before the account is written and
never refunded. Registering and guessing are the same shape to a limiter
and nothing alike in what abuse of them costs.

And SECURITY.md and README.md said things that stopped being true: that
nothing was encrypted, that no native client existed, that there was no
rate limiting, that blob storage was unwired. A security page that is
wrong about its own limits is worse than no security page.
2026-08-21 21:46:20 -04:00
Paul Hitt 7adbdf4a09 Two gaps the mobile work surfaced: tenant schema upgrades, and sharing a label key 2026-08-21 18:41:17 -04:00
Paul Hitt 85f1549686 The phone apps are open source now, so say so accurately
The comparison table claimed all of it was MIT while the app repositories
were private. Both are public now, so the claim is true — but it was not
when it was written, and that is the kind of thing to fix by changing the
world or the sentence, never by leaving it.

The source page names both app repositories, and the self-hosting page
gains a section on what the apps do when pointed at a self-hosted box:
nothing to configure. They ask the server which account service to trust
and it answers with its own. There is no list of blessed hostnames in the
apps, so self-hosting is the same case rather than a lesser one.
2026-08-21 18:21:14 -04:00
Paul Hitt 912c07a4c1 Add server discovery, fix the identity migration, correct the source claims
Three things the mobile work turned up.

A GET /api/config endpoint, unauthenticated, so a native app can be
handed one server address and learn from it which account service that
server trusts. files.flamenet.io names accounts.flamenet.io; a
self-hosted box names its own bundled service. No build flags and no
client-side list of which hostnames are "ours", which would be wrong the
moment somebody forks this.

The identity table moves to its own migration. Appending DDL to
InstallAccountsSchema worked perfectly on a fresh database and did
nothing at all on every existing one, because Fluent records what it has
run and never runs it twice. Found by a registration that failed with a
handle-collision message it had no business showing; that rollback is now
logged at notice rather than debug for the same reason.

The comparison page claimed all of it was MIT. The phone apps are not, and
the source page now says so plainly rather than leaving a reader to infer
it from a list that happens not to mention them.
2026-08-21 18:11:07 -04:00