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.
This commit is contained in:
Marc-André Bombeck committed 2026-09-11 12:37:54 +02:00
1 parent c66bcbc295
commit b565edc48d
30 files changed
+86 -84

No files matched your search

@@ -266,7 +266,7 @@ describe("ArrivalReaction — the day claim", () => {
expect(usage).toMatchObject({ totalTokens: 280, messageCount: 1 });
});
// v1.38.19 (Wave E, fix round 1) — the refund reverses BOTH counters.
// v1.38.19 — the refund reverses BOTH counters.
//
// The reservation booked `operator_tokens` whenever the chain's primary was
// operator-funded. The supersede refund reversed only the total, and nothing
+5 -4
View File
@@ -1,5 +1,5 @@
/**
* v1.38.19 (Wave E) — the daily coach ledger attributes tokens to the COST
* v1.38.19 — the daily coach ledger attributes tokens to the COST
* OWNER of the hop that actually served them.
*
* Production evidence (operator instance, 2026-09-11): the chat refused with
@@ -219,12 +219,13 @@ describe("coach_usage.operator_tokens (real Postgres)", () => {
expect(row?.operatorTokens).toBe(OPERATOR_COST_CAP);
});
// v1.38.19 (Wave E, fix round 1) — the incident, end to end.
// v1.38.19 — the incident, end to end.
//
// The 06:42Z row verbatim: 1.2 M tokens on the day, none of them the
// operator's, on the chain `[admin-openai, codex, openai-compatible]`. The
// chat must open. Before the wave it was refused because the ledger had no
// owner dimension; this pins that the refusal cannot come back.
// chat must open. It was refused while the ledger had no owner dimension and
// counted every token against the operator's ceiling; this pins that the
// refusal cannot come back.
it("does not refuse the chat for a day of background spend on the user's own plan", async () => {
const { reserveBudget, resolveDailyCap, resolveCostOwner } =
await import("@/lib/ai/coach/budget");
@@ -38,7 +38,7 @@ describe("reserveBudget (real Postgres)", () => {
// Pre-spend 900 so a single 600-token reservation stays under the cap
// but two concurrent ones cannot both be admitted.
//
// v1.38.19 (Wave E) — the 900 sits on BOTH counters. The ledger grew a cost
// v1.38.19 — the 900 sits on BOTH counters. The ledger grew a cost
// dimension: an operator-owned reservation is measured against
// `operator_tokens`, so a fixture that pre-spends only the mixed total no
// longer states its own premise ("900 already spent under this cap") and