Skip to content

feat: per-key quota, relative form date bounds, store-owned CRUD screen, capability-only extension installs (#703, #705, #709, #711) - #727

Merged
jimhoyd merged 6 commits into
mainfrom
claude/sleepy-shannon-xvazgl
Sep 25, 2026
Merged

jimhoyd merged 6 commits into
mainfrom
claude/sleepy-shannon-xvazgl

Conversation

@jimhoyd

@jimhoyd jimhoyd commented Sep 25, 2026

Copy link
Copy Markdown
Collaborator

Problem and change

Four decided issues, one commit each, plus a small recipe fix.

  • Closes [Request]: bearer quota follow-ups: per-key budget override and RateLimit fields on allowed responses #703: per-key quota and credential RateLimit fields.
    • Key quota: issueApiKey({name, scopes, quota}) and the CLI's stdin JSON accept an optional quota: {requests, window}, stored in new nullable auth_api_keys columns (additive migration, same pattern as existing ones). The bounds are the same as the route quota.
    • Precedence: a key's own quota replaces the route's auth.bearer.quota. It is one counter per key and applies on every bearer route the key authenticates on, so a plan-tier key is limited everywhere. Keys without a quota use the route's.
    • Allowed responses: auth now implements middleware(). On quota'd bearer routes, allowed responses carry RateLimit-Policy/RateLimit with the "credential" member, next to core throttle's "default" member when both apply.
    • Caching: protected routes are already forced to Cache-Control: no-store, and a cache strategy other than no-store is refused at startup. Tests assert both. The misleading wording of that refusal is filed separately as [Bug]: cache refusal on an extension-protected route says "conditional routing requires cache disabled or no-store" #725.
  • Closes [Request]: relative date bounds for forms date and datetime-local fields #705: relative date bounds in forms.
    • Syntax: minimum/maximum on date/datetime-local accept today or {from: today, add: <±PnYnMnD>}.
    • Time zone: "today" is the date in the flow's new timeZone, an IANA name validated at load, or UTC when it is absent, never the host's zone.
    • Arithmetic: years and months move first and clamp to the month end; then days move.
    • datetime-local: a relative minimum is 00:00 of that day and a relative maximum is the end of that day.
    • Where it is enforced: the server resolves the bounds per request and is authoritative. The rendered min/max can go stale across midnight, and the README documents that.
  • Closes Decouple UI data screens from the store extension's private configuration #709: store owns its CRUD screen. extensions.ui.config.screens moves to extensions.store.config.screens.
    • How ui gets it: store contributes a UiScreenSource through contributes: {ui: {screens}}. ui never loads the project document or reads store config, and a test scans packages/ui/src to enforce that.
    • Add-on graph: add-on descriptors now carry contributes (validated in parseDescriptor), so the store→ui edge is visible.
  • Closes Separate application examples from extension installation scaffolds #711: capability-only installs by default. urlcode extensions add <name> and init --with install only the capability. The new generic --example flag writes each extension's example, from an example() hook beside scaffold, reproducing the old output.
    • store: empty collections, no mount. The example is /api/todos, plus /todos when ui is present.
    • forms: CSRF key and empty flows. The example is /contact.
    • auth: keeps its /account/* mount and {member, admin} role model, which are capability configuration. The example is /private.
    • admin, ui, mcp: no example.
    • Onboarding: the starter, getting-started docs, recipes, skills and CI pass --example.

Verification

Run on Node v26.10.0, on this stack before it was moved onto main. The files are identical to main + these commits, because #726 was squash-merged from the same tree.

  • npm run verify:
    • Root tests: 819 passed, 0 failed.
    • Workspaces: 33, 97, 231 and 28 passed with 0 failed. Store had 41 of 42: the store-crud recipe test failed because Separate application examples from extension installation scaffolds #711's rewording wrapped --ack store:public-write across two lines. Fixed in the last commit; store is now 42 of 42.
    • After the fix, npm run verify:workspaces exited 0: every workspace suite, build-addon-manifest --check, audit:packages and test:addons (4 of 4).
  • npm run check: exit 0.
  • npm run test:package: exit 0 from the main checkout ("Packed installation and starter/cookbook checks passed"). An earlier run from a linked git worktree failed while cloning, which is an artefact of that setup, not of this change.

Compatibility and security

🤖 Generated with Claude Code

https://claude.ai/code/session_014jmv9dMggduiprzSsNd7iP


Generated by Claude Code

…responses (#703)

An API key can carry its own quota (issueApiKey({name, scopes, quota}),
or quota in the api-key-issue JSON), stored in new auth_api_keys columns
added in place; existing keys have none. A key's own quota replaces the
route's auth.bearer.quota for that key on every bearer route; keys without
one use the route's. Core policies.throttle is unchanged.

The auth extension now implements middleware(): an allowed, counted
bearer response carries RateLimit-Policy/RateLimit under "credential",
ahead of core throttle's "default" member. Core already forces
Cache-Control: no-store on auth-protected routes and refuses a cache
strategy other than no-store on them, so these per-credential values are
never cached; tests assert both.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014jmv9dMggduiprzSsNd7iP
…ne (#705)

minimum/maximum on date and datetime-local fields now accept `today` or
`{from: today, add: <signed ISO 8601 years/months/days duration>}`. Today is
the date in the flow's new IANA `timeZone` (UTC when absent), never the host
zone, and is resolved per request for the authoritative server check and the
rendered min/max. Years and months move first and clamp to the month end,
then days. A relative datetime-local minimum is 00:00 and a maximum the end
of that day. Activation refuses unknown zones, durations with weeks or time
parts, and relative windows that are empty on some day.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014jmv9dMggduiprzSsNd7iP
…ng store config (#709)

ui no longer loads the project document or reads extensions.store. A data
screen now reaches ui through the owning extension's contributes.ui.screens
(UiScreenSource: resolves {<path>: {title, collection, columns?}} once at ui
activation). extensions.ui.config.screens is removed; screens are declared
under extensions.store.config.screens, and the store scaffold (not ui's) adds
the /todos screen and its extension: ui route when ui is installed.

The optional store -> ui edge is visible: urlcode.json descriptors record
`contributes`, store declares ui an optional peer, and workspace ordering
builds a contribution target first. Core still imports no package.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014jmv9dMggduiprzSsNd7iP
…mos (#711)

`urlcode extensions add <name>` (and `init --with`) now writes only what an
extension needs to function. The extension contract gains an optional
`example(request)` beside `scaffold`; one generic `--example` flag writes it on
top (config deep-merged, colliding routes refused, lists appended), keeps
acknowledgements and no-overwrite behavior, and refuses when nothing added
ships an example. Core still knows no package names.

- store: blank = empty collections, no mount, no ack; example = todos on
  /api/todos (+ /todos screen with ui), ack without auth.
- forms: blank = CSRF key + empty flows; example = /contact flow.
- auth: blank = /account/* mount, operator service with the documented
  {member, admin} role model, keys; example = /private.
- admin, ui, mcp: capability only, no example (admin notes that auth's mount
  is a configurable default, admin({authMount})).

Starter, getting-started docs, package READMEs, llms, skills, CI and
pack-addons pass --example where a working demo is expected. Integration and
unit tests cover blank vs --example.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014jmv9dMggduiprzSsNd7iP
…rud recipe (#711)

The recipe test matches the flag as one phrase; the #711 rewording had
wrapped it across two lines.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014jmv9dMggduiprzSsNd7iP
…ges (#709)

store now contributes its CRUD screen to ui and its screens test imports
@jimhoyd/urlcode-ui/extension, so the store workspace-verify job must
build ui first (it failed with TS2307), and a ui change must select store
as a reverse dependency.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014jmv9dMggduiprzSsNd7iP
@jimhoyd
jimhoyd merged commit affa074 into main Sep 25, 2026
23 checks passed
@jimhoyd
jimhoyd deleted the claude/sleepy-shannon-xvazgl branch September 25, 2026 04:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants