Skip to content

Store recipes: store-approval; booking and credits on slot grids, create.members and a unique-handle directory (#956, #957) - #992

Merged
jimhoyd merged 6 commits into
mainfrom
claude/recipes-956-957
Sep 29, 2026
Merged

jimhoyd merged 6 commits into
mainfrom
claude/recipes-956-957

Conversation

@jimhoyd

@jimhoyd jimhoyd commented Sep 29, 2026

Copy link
Copy Markdown
Collaborator

Fixes #956
Fixes #957

Builds on #984 (store editable/deletable and unique), which has since merged; this branch merges origin/main.

What changed

  • store-booking: intervals.length/step (PT1H) replace the hour pattern, so a 12-hour booking or a 10:30 start is 422; create: {members: staff} makes booking staff-only (403 membership_required for a non-member). Staff come from tests/seed.json.
  • store-credits: wallets carry a lower-case handle with unique: [handle] (409 value_taken) and a projected readers mount readers: {directory: {mount: /api/directory, properties: [handle]}}; the fixtures look the recipient up and pay the id they get back. The issuer pattern and the Store: a transfers collection's sum never changes on delete or create (#928) #935 transfer rules are unchanged. There are now 2 routes.
  • store-approval (new, YAML only, 4 routes): owner submit/withdraw; approve/reject as by: others transitions gated by members: reviewers that stamp reviewedBy/reviewedAt; editable: {status: draft} and deletable: {status: [draft, rejected]} lock decided requests (409 record_locked); a reviewers queue at /api/review with showOwner: true.
  • Planner and search: recipes search approval finds store-approval. plan-feature ranks it first for approval goals, and booking and credits stay excluded (test/feature-plan.test.ts updated from fix(core): plan-feature offers booking and credits recipes only on their own terms (#957) #981).
  • READMEs: the stale scratch-database advice is gone, because test and audit are hermetic. Each README says plainly that the fixtures need the stand-in bearer principal (the real auth extension does not accept it) and explains how to rewrite them as sign-in steps with auth.users in tests/seed.json.
  • Docs: RECIPES.md catalog, STORE.md pointers, TOOLING.md, AI-AUTHORING.md, llms.txt/llms-full.txt, and the store CHANGELOG.
  • test(store): measure the plumbing declared intervals and transfers remove (#902 item 6) #965 plumbing: the counterexamples in packages/store/test/plumbing/ follow the recipes. The booking one gets a one-hour check and creates as the caller under the declared create gate. The credits one gets handle, unique and a hand-written directory. FRAMEWORK.md has the re-measured table: booking 50 / 0 against 49 / 139, credits 51 / 0 against 50 / 186.

Evidence

  • packages/store/test/recipes.test.ts runs all three recipes through the CLI with --local-review and hermetic seeds: validate, test twice, and audit ready with each recipe's own route count. plumbing.test.ts runs the recipe fixtures against the counterexamples.
  • npm run verify and npm run test:package pass locally (macOS). Package budgets were unchanged and within the policy.

Limitations

  • The fixtures still use the stand-in bearer principal, not the Better Auth sign-in steps. The READMEs say this and show how to convert them. No fixture was run against the real auth extension.
  • This is CI and local evidence only. It is not an independent security review.

🤖 Generated with Claude Code

jimhoyd and others added 4 commits September 29, 2026 17:06
#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]>
…ids, 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]>
@jimhoyd
jimhoyd enabled auto-merge (squash) September 29, 2026 22:42
jimhoyd added a commit that referenced this pull request Sep 29, 2026
…irectory (Windows EBUSY) (#999)

t.after hooks run in registration order, and directory() registered the rm before connect() registered the close, so on
Windows the rm hit EBUSY on lease.sqlite and retried until the test timed out (seen on PR #992's Windows shard).

Co-authored-by: Claude Opus 5.5 <[email protected]>
@jimhoyd
jimhoyd merged commit 7454d3f into main Sep 29, 2026
26 checks passed
@jimhoyd
jimhoyd deleted the claude/recipes-956-957 branch September 29, 2026 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant