Files
HealthLog/prisma/migrations/0341_arrival_reaction_cost_owner/migration.sql
T
Marc-André Bombeck b565edc48d docs(ai): drop planning vocabulary from the ledger comments
CLAUDE.md forbids planning shorthand in committed artefacts, and this branch
introduced 74 lines of it across source, tests, a schema field and two
migrations. Someone reading the migration SQL in a year has no way to resolve a
wave letter or a round number, and a comment that points at something outside
the repository names no reason at all.

Three passes. A version followed by a parenthetical keeps the version and loses
the parenthetical, because the version says since when something holds. A
sentence that leaned on the vocabulary to carry its meaning is rewritten to
state the reason directly: the arrival reservation now says it was refused over
money the operator never spent, rather than naming the defect a wave existed to
remove. Three test titles carried the marker in the name itself and are renamed
to what they pin.

Comments only. No behaviour, no renames beyond those three titles.
2026-09-11 12:37:54 +02:00

19 lines
1.1 KiB
SQL

-- v1.38.19 — the arrival reaction remembers who paid for
-- its reservation.
--
-- The row persisted the reserved amount and the date key but not the cost
-- owner, and two readers need it. The supersede refund in `data-arrival.ts`
-- reverses a pre-provider reservation with no chain in hand at all, so without
-- this column it could only reverse `total_tokens` — leaving the operator
-- share of every superseded reservation on the row forever, walking the
-- operator's ceiling upward against spend that never happened. The resume path
-- in `reaction-line.ts` re-derived the owner from the chain as it stands NOW,
-- and the chain is re-resolved per run and reordered by the health ledger, so
-- a reservation booked to the operator could be reconciled as the user's (the
-- same leak) or vice versa (draining another request's balance).
--
-- Nullable, no default: an existing row's owner is genuinely unknown, and the
-- two readers fall back to the previous behaviour for those.
ALTER TABLE "arrival_reactions"
ADD COLUMN IF NOT EXISTS "generation_cost_owner" TEXT;