Repository navigation
A2 follow-up: the people budget records consumption only - #2044
Merged
neuromechanist merged 9 commits intoNov 5, 2026
Conversation
Delete refundJob and its statement (no production caller), refuse a charge correction that lowers a charge and names the budget, and have the admin route name it only when the charge rises. Final settlement stays the one entry that may lower the budget. Tests show the budget does not move.
The help said the people budget follows a charge correction; it now says raising counts against it and lowering does not. The CLI test also checks the budget after a decrease.
Comment-only edit: the owner chose option A, so the table comments say the code owns the rule and no longer call it open.
ADR 0118 gets inline superseded markers and one amendment line, implementation notes say the code implements option A, and the invented archive field name is replaced by the real Tapis one.
Comment-only: the ledger kind and reason lists keep refund for the table vocabulary, and the comments now say nothing writes it.
The ADR 0118 index row says the ledger code is option A now.
neuromechanist
force-pushed
the
feature/issue-2007-a2b-people-budget-consumption-only
branch
from
November 5, 2026 01:46
0bf0c03 to
ddc300a
Compare
📦 Package PreviewYour package is ready to test! bun install -g nemar-cli@PR2044Version: 🤖 Updated on each push. |
The scan flags any refund literal in a shipped ledger insert that is not a comparison, and a kind that is not a plain literal in the kind column's position. Planted shapes cover a later column, a SELECT list, and a bound kind.
The help and route doc said only a final settlement lowers it; the owner's own correction of the platform budget does too. Help gains the sentence on undoing a raise made by mistake, and the route comment says what the owner rule settles.
ADJUST_INSERT_SQL now writes nothing for a budget with a charged change that does not raise it, so a caller that binds it directly cannot credit the budget. A test binds it directly. The budget test header lists the guards.
neuromechanist
merged commit Nov 5, 2026
405ec3b
into
feature/issue-2005-epic-compute-core
17 of 20 checks passed
neuromechanist
deleted the
feature/issue-2007-a2b-people-budget-consumption-only
branch
November 5, 2026 04:32
This was referenced Nov 5, 2026
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to phase A2 (#2007, epic #2005): makes the owner's decision of 2026-11-04 true in code, option A, the
peoplebudget records consumption only. Nothing an administrator or a person does to a person's pool credits the budget back. No migration change: the 0114 triggers already allowed either option.What changed
refundJob,REFUND_INSERT_SQL,refundKeyand therefundreason default are deleted (preferred option: the refund had no production caller, only A2's own tests, and compensation is a grant). Therefundkind stays in the table's vocabulary and nothing writes it.adjustPoolrefuses, withinvalid_argumentand nothing written, a charge correction that lowers a charge and names a budget, andADJUST_INSERT_SQLcarries the same refusal as a WHERE term (?2 IS NULL OR ?4 > 0), so the exported statement writes nothing when bound directly with a budget and a charged change that does not raise it; the admin route names thepeoplebudget only when the charge is raised. A lowering correction moves the person's or partner's pool alone. A correction of the granted amount is unaffected, and platform pools stay owner-only and name no budget.settleFinalis unchanged in behaviour and is documented (comments and tests) as the one entry that names the budget and may lower it, because it corrects a figure that was recorded as consumption; its delta is the job's own, so it cannot take back more than the job consumed.pool adjusthelp (the only entries that lower the budget are a job's final settlement and the owner's own correction of the platform budget, and a raise made by mistake is undone only by that owner correction), migration 0114 comment block (comment-only edit), ADR 0118 (inline superseded markers and one amendment line at the end of item 5 of the A2 amendment, nothing deleted or renumbered), implementation notes.Tests
backend/test/compute-ledger-budget.test.ts: lowering a charge leaves the budget's charged and held totals as they were (account and partner pools), raising raises both, a grant correction moves neither, the final settlement lowers by the job's difference and never below what other jobs consumed, an enumerated table of every service operation against the budget (exactly one lowers it), a check that the rows cover every kind in the vocabulary butrefund, and the refund path no longer exists.refundliteral that is not a comparison, or a kind that is not a plain literal in the kind column's position (a later column, a SELECT list, a bound or computed kind; a statement cut short by a template interpolation is seen only as far as the interpolation, which the behavioural tests cover); route and CLI tests show the budget unchanged after a decrease.migrations:d1-checkonce. Each guard was mutated one at a time and watched fail.ADJUST_INSERT_SQLdirectly with a budget and a charged change that is negative or zero and asserts nothing is written. The header ofcompute-ledger-budget.test.tslists every guard and where it is held.bun testand CI, because the standing rule is targeted tests only; would check the rest of the suite before the epic merges to dev.After A5 (#2041) merged
refundJob), the notes' section 10 and thecompute-lifecycle.tsheader comment no longer namerefundJobas callable, the ADR index row says the ledger code is option A now, and theLEDGER_ENTRY_KINDSandCOMPUTE_LEDGER_REASONScomments inshared/compute-state.tssay therefundkind has no writer. The other refund wording inshared/compute-state.tsandcompute-s3.tswas already fixed by A5.compute-ledger.ts(compute-lifecycle*,compute-full-path, callbacks, jobs, source scan), the admin compute CLI suites, the compute-state and contract unit tests and the ADR index test, plus typecheck, biome on touched files andmigrations:d1-checkonce. Three guards were mutated again after the rebase and each still fails the suites that cover it.Optional hardening for the owner (not done)
The table would still accept a lowering correction that names the budget, or an entry of kind
refund; the code and its tests hold option A. Migration 0114 is unreleased, so a BEFORE INSERT trigger could refuse a budget-naming entry with a negative charged delta unless it is a job'sadjust, and refuse kindrefund, which would make option A a table rule. It was left out on purpose (no migration change in this PR).Commit efa3268's message says the invented
archiveIncludeLaunchFilesfield name was replaced; that fix landed in A5 and the rebase dropped it from this branch, so the message is inaccurate on that point and is left as it is (the history is not rewritten).