@fuzdev/fuz_app 0.102.0 → 0.104.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/dist/auth/CLAUDE.md +37 -10
  2. package/dist/auth/cell_action_specs.d.ts +261 -35
  3. package/dist/auth/cell_action_specs.d.ts.map +1 -1
  4. package/dist/auth/cell_action_specs.js +102 -9
  5. package/dist/auth/cell_actions.d.ts +51 -0
  6. package/dist/auth/cell_actions.d.ts.map +1 -1
  7. package/dist/auth/cell_actions.js +168 -22
  8. package/dist/auth/cell_audit_events.d.ts +1 -1
  9. package/dist/auth/cell_audit_events.d.ts.map +1 -1
  10. package/dist/auth/cell_audit_events.js +3 -2
  11. package/dist/auth/cell_audit_metadata.d.ts +15 -0
  12. package/dist/auth/cell_audit_metadata.d.ts.map +1 -1
  13. package/dist/auth/cell_audit_metadata.js +11 -0
  14. package/dist/auth/cell_data_schema.d.ts +14 -16
  15. package/dist/auth/cell_data_schema.d.ts.map +1 -1
  16. package/dist/auth/cell_data_schema.js +14 -16
  17. package/dist/db/CLAUDE.md +19 -6
  18. package/dist/db/cell_ddl.d.ts +24 -2
  19. package/dist/db/cell_ddl.d.ts.map +1 -1
  20. package/dist/db/cell_ddl.js +33 -1
  21. package/dist/db/cell_queries.d.ts +59 -8
  22. package/dist/db/cell_queries.d.ts.map +1 -1
  23. package/dist/db/cell_queries.js +50 -12
  24. package/dist/testing/CLAUDE.md +37 -7
  25. package/dist/testing/cross_backend/capabilities.d.ts +14 -0
  26. package/dist/testing/cross_backend/capabilities.d.ts.map +1 -1
  27. package/dist/testing/cross_backend/capabilities.js +3 -0
  28. package/dist/testing/cross_backend/cell_crud.d.ts.map +1 -1
  29. package/dist/testing/cross_backend/cell_crud.js +55 -13
  30. package/dist/testing/cross_backend/cell_gated_create.d.ts +28 -0
  31. package/dist/testing/cross_backend/cell_gated_create.d.ts.map +1 -0
  32. package/dist/testing/cross_backend/cell_gated_create.js +213 -0
  33. package/dist/testing/cross_backend/cell_grant_role.js +4 -4
  34. package/dist/testing/cross_backend/cell_relations.d.ts.map +1 -1
  35. package/dist/testing/cross_backend/cell_relations.js +30 -24
  36. package/dist/testing/cross_backend/default_backend_configs.d.ts.map +1 -1
  37. package/dist/testing/cross_backend/default_backend_configs.js +7 -0
  38. package/dist/testing/cross_backend/expected_schema.json +4 -0
  39. package/dist/testing/cross_backend/fact_serving.js +2 -2
  40. package/dist/testing/cross_backend/full_spine_mount.d.ts.map +1 -1
  41. package/dist/testing/cross_backend/full_spine_mount.js +9 -1
  42. package/dist/testing/cross_backend/rust_spine_stub_backend_config.d.ts.map +1 -1
  43. package/dist/testing/cross_backend/rust_spine_stub_backend_config.js +6 -3
  44. package/dist/testing/cross_backend/test_cell_gated_create_authorize.d.ts +22 -0
  45. package/dist/testing/cross_backend/test_cell_gated_create_authorize.d.ts.map +1 -0
  46. package/dist/testing/cross_backend/test_cell_gated_create_authorize.js +75 -0
  47. package/dist/testing/cross_backend/ts_spine_backend_config.d.ts.map +1 -1
  48. package/dist/testing/cross_backend/ts_spine_backend_config.js +5 -2
  49. package/package.json +1 -1
@@ -171,12 +171,19 @@ Generic-only — no app vocabulary on the wire; per-kind shape is the
171
171
  consumer's `validate_data` pass-through callback on `CellActionDeps`.
172
172
 
173
173
  - `auth/cell_data_schema.ts` — `CellData` base (`z.looseObject` with
174
- optional `kind` / `label` / `summary`); per-kind sub-API extends it.
174
+ optional `label` / `summary`); per-kind sub-API extends it. **`kind` is
175
+ not in `data`** — it is a top-level `cell.kind` column (peer to
176
+ `visibility` / `path`), the write-once capability/identity axis; a stray
177
+ `kind` inside `data` is rejected fail-loud (`ERROR_CELL_KIND_IN_DATA`).
175
178
  - `auth/cell_action_specs.ts` — `CellVisibility` enum, `CellPath` brand,
176
- `CellJson`, the six generic verb specs (`cell_create / get / update /
177
- delete / list / clone`), error reasons, and `all_cell_action_specs`
179
+ `CellJson`, the generic verb specs (`cell_create / get / update /
180
+ delete / list / clone / moderate`), error reasons, and `all_cell_action_specs`
178
181
  (spreads in the grant / field / item / audit registries so codegen + UI
179
- see one cell namespace). `CellJson` has no hub axis; `path` is global.
182
+ see one cell namespace). `CellJson` has no hub axis; `path` is global. The
183
+ directory-tree columns `parent_id` / `root_id` (containment, immutable in v1)
184
+ - the `moderation` lifecycle marker (`pending` / `approved` / `rejected`) are
185
+ top-level `CellJson` keys, peer to `visibility` (set by the create authorizer's
186
+ verdict + the `cell_moderate` verb, never in `data`).
180
187
  - `auth/cell_grant_action_specs.ts` / `cell_field_action_specs.ts` /
181
188
  `cell_item_action_specs.ts` / `cell_audit_action_specs.ts` — the
182
189
  `cell_grant_*` (3) / `cell_field_*` (3) / `cell_item_*` (4) /
@@ -201,12 +208,32 @@ auth, ids)`: batched strict relation-read filter. Every relation read —
201
208
  Two queries for the whole id-set (avoids the N+1 of a per-row check). The
202
209
  reverse list verbs additionally cap the fetch by the wire `limit` so a
203
210
  heavily inbound-linked target can't force an unbounded scan.
204
- - `auth/cell_actions.ts` — `create_cell_actions(deps)`, the six generic
205
- handlers. `cell_create` stamps `created_by`; `path` writes are
206
- admin-only. `cell_update` gates `visibility` writes on `can_manage_cell`
207
- (`ERROR_CELL_VISIBILITY_MANAGE_ONLY`). `cell_get` bundles
208
- visibility-filtered `fields` + `items` (one over the cap for truncation
209
- detection). `cell_clone` deep-walks viewable children only.
211
+ - `auth/cell_actions.ts` — `create_cell_actions(deps)`, the generic
212
+ handlers. `cell_create` stamps `created_by` + writes the top-level `kind`
213
+ column; `path` writes are admin-only. It also resolves the directory tree:
214
+ `parent_id` (wire) → the governing `root_id` (`parent.root_id ?? parent.id`),
215
+ **404**-masking a hidden parent. `cell_update` gates `visibility`
216
+ writes on `can_manage_cell` (`ERROR_CELL_VISIBILITY_MANAGE_ONLY`) and
217
+ **never touches `kind`** / `parent_id` / `root_id` / `moderation` (all
218
+ write-once-at-birth or control-gated, never on the update patch).
219
+ `cell_get` bundles visibility-filtered `fields` + `items` (one over the cap
220
+ for truncation detection). `cell_clone` deep-walks viewable children only
221
+ (each clone inherits its source's `kind`; clones are unparented). The optional
222
+ parent-aware `authorize_create` dep (`CellCreateAuthorize` — wider input
223
+ `{kind, data, parent_id, root_id, root_data, scope_id}` than `validate_data`,
224
+ returning a `CellCreateVerdict` `{allow:false} | {allow:true, moderation_required}`)
225
+ gates create by capability; it runs after the validator + the parent-resolve.
226
+ A **viewable**-parent / root-creation deny is **403** `cell_create_forbidden`
227
+ (the create-path **404** mask is reserved for a hidden parent); `Allow` folds
228
+ the moderation outcome (born `pending`+private vs `approved`+author-visibility).
229
+ The authorizer is **pure** — the handler reads the governing root's `data`
230
+ in-tx and hands it over as `root_data`, so a directory policy resolves
231
+ `root.data.policy[kind]` without its own DB read (which also dodges the
232
+ single-connection PGlite deadlock). `None`/omitted = open create (the default;
233
+ mirrors `validate_data`). `cell_moderate` is the `pending → approved | rejected`
234
+ transition, gated on `can_manage_cell` of the **governing root** (admin / root
235
+ owner — the author lands a 403, the anti-self-approval guard); approve flips
236
+ `moderation → approved` + `visibility → public`, reject sets `rejected`.
210
237
  - `auth/cell_grant_actions.ts` / `cell_field_actions.ts` /
211
238
  `cell_item_actions.ts` / `cell_audit_actions.ts` — the relation + ACL +
212
239
  audit handlers, exporting `to_grant_json` / `to_field_json` /