@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.
- package/dist/auth/CLAUDE.md +37 -10
- package/dist/auth/cell_action_specs.d.ts +261 -35
- package/dist/auth/cell_action_specs.d.ts.map +1 -1
- package/dist/auth/cell_action_specs.js +102 -9
- package/dist/auth/cell_actions.d.ts +51 -0
- package/dist/auth/cell_actions.d.ts.map +1 -1
- package/dist/auth/cell_actions.js +168 -22
- package/dist/auth/cell_audit_events.d.ts +1 -1
- package/dist/auth/cell_audit_events.d.ts.map +1 -1
- package/dist/auth/cell_audit_events.js +3 -2
- package/dist/auth/cell_audit_metadata.d.ts +15 -0
- package/dist/auth/cell_audit_metadata.d.ts.map +1 -1
- package/dist/auth/cell_audit_metadata.js +11 -0
- package/dist/auth/cell_data_schema.d.ts +14 -16
- package/dist/auth/cell_data_schema.d.ts.map +1 -1
- package/dist/auth/cell_data_schema.js +14 -16
- package/dist/db/CLAUDE.md +19 -6
- package/dist/db/cell_ddl.d.ts +24 -2
- package/dist/db/cell_ddl.d.ts.map +1 -1
- package/dist/db/cell_ddl.js +33 -1
- package/dist/db/cell_queries.d.ts +59 -8
- package/dist/db/cell_queries.d.ts.map +1 -1
- package/dist/db/cell_queries.js +50 -12
- package/dist/testing/CLAUDE.md +37 -7
- package/dist/testing/cross_backend/capabilities.d.ts +14 -0
- package/dist/testing/cross_backend/capabilities.d.ts.map +1 -1
- package/dist/testing/cross_backend/capabilities.js +3 -0
- package/dist/testing/cross_backend/cell_crud.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_crud.js +55 -13
- package/dist/testing/cross_backend/cell_gated_create.d.ts +28 -0
- package/dist/testing/cross_backend/cell_gated_create.d.ts.map +1 -0
- package/dist/testing/cross_backend/cell_gated_create.js +213 -0
- package/dist/testing/cross_backend/cell_grant_role.js +4 -4
- package/dist/testing/cross_backend/cell_relations.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_relations.js +30 -24
- package/dist/testing/cross_backend/default_backend_configs.d.ts.map +1 -1
- package/dist/testing/cross_backend/default_backend_configs.js +7 -0
- package/dist/testing/cross_backend/expected_schema.json +4 -0
- package/dist/testing/cross_backend/fact_serving.js +2 -2
- package/dist/testing/cross_backend/full_spine_mount.d.ts.map +1 -1
- package/dist/testing/cross_backend/full_spine_mount.js +9 -1
- package/dist/testing/cross_backend/rust_spine_stub_backend_config.d.ts.map +1 -1
- package/dist/testing/cross_backend/rust_spine_stub_backend_config.js +6 -3
- package/dist/testing/cross_backend/test_cell_gated_create_authorize.d.ts +22 -0
- package/dist/testing/cross_backend/test_cell_gated_create_authorize.d.ts.map +1 -0
- package/dist/testing/cross_backend/test_cell_gated_create_authorize.js +75 -0
- package/dist/testing/cross_backend/ts_spine_backend_config.d.ts.map +1 -1
- package/dist/testing/cross_backend/ts_spine_backend_config.js +5 -2
- package/package.json +1 -1
package/dist/auth/CLAUDE.md
CHANGED
|
@@ -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 `
|
|
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
|
|
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
|
|
205
|
-
handlers. `cell_create` stamps `created_by
|
|
206
|
-
admin-only.
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
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` /
|