You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Request]: Declarative persistence: store/collection handler and a file-backed CRUD recipe #253
enhancementNew feature or requestexamplesRecipes, starters, init templates and worked examplesextensionInvolves an extension or companion package (store, ui, auth, admin)importantHigh-priority work selected for near-term focus
Tried: persist todos across restarts using only declared URLCode features. Expected: a declarative store/collection handler, or at minimum a recipe for file-backed CRUD. Got: neither exists (recipes search "crud store persist" returns nothing; docs list a guest storage broker as unavailable). Both runs hand-wrote a JSON-file store inside a trusted function (queue + atomic rename): about 26-40 lines each, inside 112-116 LOC of custom backend JS. That is why 63-64% of application code stayed imperative. Suggestion: a store:/collection handler (list/get/create/patch/delete, id + createdAt/updatedAt, file- or SQLite-backed) or an extension, plus a crud-todo recipe. Related: #133 (read-through data binding, closed). Evidence: an A/B benchmark on URLCode 0.4.1 with Sonnet 5 agents building the same Todo app from the repo docs. Run 1 (benchmark Agent B, no authoring skill, no browser check) and run 2 (session "Todo application with URLCode", authoring skill loaded, tightened prompt) hit this independently. n=1 each; single small app, so treat frequency as anecdotal. The Agent A control (no URLCode) needed 2 shell calls and 0 dependencies for the same app. Not verified: how much of the custom code a store handler would remove for apps beyond a Todo list.
docs/PROJECT-DIRECTION.md: operators own credentials, storage and capability grants, and application data stays in the operator's systems. docs/EXTENSIONS.md describes extensions as operator-installed trusted modules mounted on routes.
Precedent: stored short links were moved out of core into an extension. That package has since been retired and unpublished. Read the reason for that decision before building a second data extension; I did not verify it.
Adoption cost: a project cannot declare or choose an extension, so an operator must install it. Ship a urlcode init --with store scaffold and the CRUD recipe in the same release; otherwise an AI agent will still hand-write a JSON-file store, as both benchmark agents did.
Clarification from the maintainer: the data store is built as an operator-installed extension, as decided above. This is not reopened.
Correction to the earlier note about the retired short-link extension. That comment said to read why urlcode-dynamic-link was retired before building. The reason is now known: it did not belong, and the project started locked down in a sandbox and later moved to trust by default. That change opened up many possibilities and lets core stay smaller and cleaner. So its retirement is not a precedent against a data-storing extension, and no further reading is needed before building.
Unchanged from the decision: ship urlcode init --with store and a CRUD recipe in the same release, and sequence after #254 (PR #306).
Shipped in #315: new workspace package @jimhoyd/urlcode-store (declared collections, file-backed, single-writer lock, per-collection limits), init --with store, and docs/STORE.md. Not done: release wiring (so init --with store does not yet work from npm) and a recipes/ catalog entry. Tracking both as follow-ups; keeping this open until the release wiring lands.
Design recommendation after reviewing the shipped store, recipe, release wiring and CRUD composition: keep this as three independently usable layers. Store owns the bounded collection contract and JSON API; UI owns optional presentation; the scaffold can bundle UI, auth and store for a ready CRUD app. Do not make store depend on UI or auth.
Before the first production data, settle two extension-level seams:
An operator-host storage-driver boundary so a future SQLite backend does not put provider or storage selection in YAML.
An explicit schema-evolution rule. Today incompatible collection changes correctly refuse activation, but operators need a documented migration path or an explicit migration-required contract.
Security/default recommendation: keep raw store usable for intentional public APIs, but make a writable public collection an explicit scaffold choice. The ready CRUD scaffold should compose auth by default or require an explicit public-access selection.
Merged-main alignment audit follow-up: the first store slice is intentionally narrow and should stay that way. The next work now has explicit boundaries:
The practical sequence is: publish the already-wired store package (#323), settle scaffold access/composition (#337/#338), then ownership and query/backend seams before positioning it for multi-user or production domain records.
Done: the store extension shipped in #315 (with the CRUD recipe in #325, the release wiring in #326, the CRUD screen in #328 and the public-write acknowledgement in #343), and @jimhoyd/[email protected] is on npm (verified against the registry). One known gap is tracked in #346: the published store needs a core newer than the published core for the no-auth --allow-public-write path. Per-record ownership is #331, filtering and sorting is #330, and migration/composition with auth and admin is #336.
enhancementNew feature or requestexamplesRecipes, starters, init templates and worked examplesextensionInvolves an extension or companion package (store, ui, auth, admin)importantHigh-priority work selected for near-term focus
Activity
jimhoyd commentedon Sep 20, 2026
Placement: build this as an extension, not core.
docs/PROJECT-DIRECTION.md: operators own credentials, storage and capability grants, and application data stays in the operator's systems.docs/EXTENSIONS.mddescribes extensions as operator-installed trusted modules mounted on routes.extension: storemounted on/api/todos/*, with a declared collection (fields, types, limits, id, createdAt/updatedAt). The store owns the endpoints, so a Todo app needs no custom JS. Give it its own field schema so it does not depend on [Request]: Declarative validation for JSON request bodies and path parameter patterns #254.urlcode init --with storescaffold and the CRUD recipe in the same release; otherwise an AI agent will still hand-write a JSON-file store, as both benchmark agents did.Record the declarative persistence recommendation on the open-decisio…
Record the declarative persistence recommendation on the open-decisio…
jimhoyd commentedon Sep 20, 2026
Decision: confirmed as the placement comment above: build as an operator-installed
storeextension, not core.urlcode init --with storeand a CRUD recipe in the same release, otherwise agents will keep hand-writing JSON-file stores.Add Todo A/B agent benchmark baseline (run 1) (#294)
Record decisions for eight benchmark-driven authoring requests (#297)
jimhoyd commentedon Sep 20, 2026
Clarification from the maintainer: the data store is built as an operator-installed extension, as decided above. This is not reopened.
Correction to the earlier note about the retired short-link extension. That comment said to read why
urlcode-dynamic-linkwas retired before building. The reason is now known: it did not belong, and the project started locked down in a sandbox and later moved to trust by default. That change opened up many possibilities and lets core stay smaller and cleaner. So its retirement is not a precedent against a data-storing extension, and no further reading is needed before building.Unchanged from the decision: ship
urlcode init --with storeand a CRUD recipe in the same release, and sequence after #254 (PR #306).jimhoyd commentedon Sep 20, 2026
Progress: an agent has started on this; a PR will be linked here when it opens.
Add the operator-installed store extension and init --with store (refs …
Add the operator-installed store extension and init --with store (refs …
jimhoyd commentedon Sep 20, 2026
Shipped in #315: new workspace package @jimhoyd/urlcode-store (declared collections, file-backed, single-writer lock, per-collection limits), init --with store, and docs/STORE.md. Not done: release wiring (so init --with store does not yet work from npm) and a recipes/ catalog entry. Tracking both as follow-ups; keeping this open until the release wiring lands.
jimhoyd commentedon Sep 20, 2026
Design recommendation after reviewing the shipped store, recipe, release wiring and CRUD composition: keep this as three independently usable layers. Store owns the bounded collection contract and JSON API; UI owns optional presentation; the scaffold can bundle UI, auth and store for a ready CRUD app. Do not make store depend on UI or auth.
Before the first production data, settle two extension-level seams:
Security/default recommendation: keep raw store usable for intentional public APIs, but make a writable public collection an explicit scaffold choice. The ready CRUD scaffold should compose auth by default or require an explicit public-access selection.
jimhoyd commentedon Sep 20, 2026
Merged-main alignment audit follow-up: the first store slice is intentionally narrow and should stay that way. The next work now has explicit boundaries:
init --withextension composition independent of argument order #337: makeinit --withcomposition dependency-aware so extension spelling order is not semantic.The practical sequence is: publish the already-wired store package (#323), settle scaffold access/composition (#337/#338), then ownership and query/backend seams before positioning it for multi-user or production domain records.
jimhoyd commentedon Sep 20, 2026
Done: the store extension shipped in #315 (with the CRUD recipe in #325, the release wiring in #326, the CRUD screen in #328 and the public-write acknowledgement in #343), and @jimhoyd/[email protected] is on npm (verified against the registry). One known gap is tracked in #346: the published store needs a core newer than the published core for the no-auth --allow-public-write path. Per-record ownership is #331, filtering and sorting is #330, and migration/composition with auth and admin is #336.