Repository navigation
Store: a transfers collection's sum never changes on delete or create (#928) - #935
Merged
Merged
Conversation
…reate (#928) On a collection declaring transfers, deleting a record whose amount property is nonzero is refused with 409 balance_not_zero (fixed message, no amount) and nothing is written, on every delete path: HTTP DELETE, a host transaction's remove, and urlcode-store ownerless-delete (refused as a whole when any ownerless record holds a balance). Zero-balance deletes are unchanged. Activation now requires the amount property to be in readOnlyProperties, to default to 0 and not to be set or stamped by a transition, so a create, PUT or PATCH cannot change the sum either. The OpenAPI description lists the 409 on DELETE for such collections; STORE.md, the store README, llms.txt and CHANGELOG document it. Store unpacked budget 480 KiB. Co-Authored-By: Claude Opus 5.5 <[email protected]>
jimhoyd
enabled auto-merge (squash)
September 29, 2026 17:07
jimhoyd
added a commit
that referenced
this pull request
Sep 29, 2026
… busy-timeout 503 in the cross-connection transfer race Co-Authored-By: Claude Opus 5.5 <[email protected]>
jimhoyd
added a commit
that referenced
this pull request
Sep 29, 2026
…nt defaults to 0) Co-Authored-By: Claude Opus 5.5 <[email protected]>
jimhoyd
added a commit
that referenced
this pull request
Sep 29, 2026
…up refusal, single audit drainer (#927) (#936) * feat(store,audit)!: several serving processes on one host: declaration fence, setup refusal, single audit drainer (#927) Schema version 5 adds store_declarations, store_servers and the audit drain lease. Each activation records its collections' declaration fingerprints; every write transaction checks them and user_version under the write lock and answers 503 storage_unavailable on a mismatch, writing nothing. Activation refuses a database on a network filesystem (Linux statfs; also for the audit database) and a live peer on another host (boot id / hostname lease), and warns once that throttles and caches are per process. Only the drain lease holder peeks and acks. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(store): type the busy-timeout check in the cross-connection race Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(store): multi-process fixture follows #935's transfer rule (amount defaults to 0) Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
This was referenced Sep 29, 2026
jimhoyd
added a commit
that referenced
this pull request
Sep 29, 2026
…ate.members and a unique-handle directory (#956, #957) (#992) * feat(store): editable/deletable states and unique values across owners (#952, #953) editable and deletable, in the shape of a transition's from (a value or a list per readOnly property), refuse PUT/PATCH and DELETE outside the named states with 409 record_locked, under the write lock after If-Match, on HTTP, StoreExports and host transactions. Creates, transitions, increments and transfers are unaffected. Allow on a record and allow on a list are the hint. unique: [prop] keeps a bounded string property unique across every record, across owners on an owned collection, with 409 value_taken through a partial expression index; activation refuses stored duplicates. Documented as an existence oracle: public handles only. Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(recipes): store-approval recipe; booking and credits use slot grids, create.members and a unique-handle directory (#956, #957) - store-booking: intervals length/step (PT1H) replace the hour pattern, and create: {members: staff} makes booking staff-only; seeded from tests/seed.json. - store-credits: a unique lower-case handle and a projected readers directory (/api/directory, properties: [handle]) so pay-by-lookup cannot be spoofed; the issuer pattern and #935 transfer rules are unchanged. - store-approval (new, YAML only): owner submit/withdraw, by: others approve/reject for a reviewers list stamping reviewedBy/reviewedAt, editable/deletable lock decided requests, a reviewers queue with showOwner. - plan-feature ranks store-approval for approval goals; booking and credits stay excluded. recipes search approval finds it. - READMEs drop the stale scratch-database advice and say plainly the fixtures need the stand-in bearer principal, and how to rewrite them as sign-in steps. - The plumbing counterexamples follow the recipes; FRAMEWORK.md re-measured. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
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.
Fixes #928, found by the second agent trial: deleting a funded wallet changed the collection's sum.
Changes
Delete guard: on a collection with
transfers, deleting a record with any nonzero amount property is refused with409 balance_not_zero(a fixed message; the amount is never shown). It covers every delete path:remove, both throughremoveIn. The guard runs after scope and If-Match, so a stale ETag still gets 412.ownerless-delete: the whole command is refused if any ownerless record holds a balance.A refused delete writes nothing and keeps no Idempotency-Key claim. Zero-balance deletes work as before.
Creates and replacements: activation now refuses an amount property that:
readOnlyProperties, so no body can set it and PUT keeps it;Breaking: collections that opened records with a nonzero balance must fund them through a members-gated issuer transfer.
OpenAPI: DELETE lists
409 balance_not_zeroon transfers collections.Docs: STORE.md "Declared transfers" (only a transfer changes an amount, deleting, funding), the store README, llms, the schema descriptions, CHANGELOG, and FRAMEWORK's trial gap note.
Evidence (macOS, Node 26)
removegets 409 and rolls back with the transaction's other writes; draining a record by transfer and then removing it in one transaction succeeds.ownerless-deleteis refused while any balance remains.bankissuer; the collection sum stays 0.npm run verifypasses on current main (store 176).npm run test:packagepassed before the rebase. Store unpacked budget raised to 480 KiB (measured 487,562 bytes).🤖 Generated with Claude Code