@cosmicdrift/kumiko-framework 0.398.0 → 0.400.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 (143) hide show
  1. package/AGENTS.md +33 -19
  2. package/agents/api/dev-server-testing.md +23 -0
  3. package/agents/api/framework-db.md +277 -0
  4. package/agents/api/framework-engine.md +1810 -0
  5. package/agents/api/framework-errors.md +119 -0
  6. package/agents/api/framework-event-store.md +99 -0
  7. package/agents/api/framework-seeding.md +26 -0
  8. package/agents/api/framework-ui-types.md +542 -0
  9. package/agents/api/renderer-web.md +1450 -0
  10. package/agents/api/testing-helpers.md +189 -0
  11. package/agents/api/testing-stack.md +144 -0
  12. package/agents/api/types.md +5124 -0
  13. package/agents/api.md +20 -0
  14. package/agents/examples/derived-fields-sql.md +251 -0
  15. package/agents/examples/documents.md +161 -0
  16. package/agents/examples/inspection-checklist.md +807 -0
  17. package/agents/examples.md +3 -0
  18. package/agents/features-index.md +178 -0
  19. package/agents/features.md +9 -1
  20. package/dist/api/entity-read-access.d.ts +2 -0
  21. package/dist/api/entity-read-access.js +46 -2
  22. package/dist/api/server-boot-checks.js +2 -2
  23. package/dist/api/server-routes.js +3 -1
  24. package/dist/db/derived-field-sql.d.ts +23 -0
  25. package/dist/db/derived-field-sql.js +115 -0
  26. package/dist/db/derived-related-sql.d.ts +31 -0
  27. package/dist/db/derived-related-sql.js +137 -0
  28. package/dist/db/driver-row-coercion.d.ts +1 -0
  29. package/dist/db/driver-row-coercion.js +13 -0
  30. package/dist/db/eagerload.d.ts +3 -1
  31. package/dist/db/eagerload.js +4 -6
  32. package/dist/db/event-store-executor-context.js +1 -1
  33. package/dist/db/event-store-executor-read-paging.js +1 -1
  34. package/dist/db/event-store-executor-read-search.d.ts +3 -0
  35. package/dist/db/event-store-executor-read-search.js +17 -9
  36. package/dist/db/event-store-executor-read-sort.d.ts +9 -2
  37. package/dist/db/event-store-executor-read-sort.js +27 -14
  38. package/dist/db/event-store-executor-read-where.d.ts +0 -5
  39. package/dist/db/event-store-executor-read-where.js +3 -9
  40. package/dist/db/event-store-executor-read.js +23 -4
  41. package/dist/db/event-store-executor-write-steps.d.ts +6 -1
  42. package/dist/db/event-store-executor-write-steps.js +20 -1
  43. package/dist/db/event-store-executor-write.js +8 -8
  44. package/dist/db/money.d.ts +4 -0
  45. package/dist/db/money.js +34 -29
  46. package/dist/db/parent-ref-clause.d.ts +1 -0
  47. package/dist/db/parent-ref-clause.js +18 -8
  48. package/dist/db/read-gate-clause.d.ts +7 -0
  49. package/dist/db/read-gate-clause.js +188 -0
  50. package/dist/db/read-ownership.d.ts +9 -0
  51. package/dist/db/read-ownership.js +12 -0
  52. package/dist/engine/boot-validator/boot-check.d.ts +3 -1
  53. package/dist/engine/boot-validator/boot-check.js +7 -11
  54. package/dist/engine/boot-validator/boot-context.d.ts +26 -0
  55. package/dist/engine/boot-validator/boot-context.js +57 -0
  56. package/dist/engine/boot-validator/boot-options.d.ts +33 -0
  57. package/dist/engine/boot-validator/boot-options.js +1 -0
  58. package/dist/engine/boot-validator/boot-phases-app.d.ts +5 -0
  59. package/dist/engine/boot-validator/boot-phases-app.js +103 -0
  60. package/dist/engine/boot-validator/boot-phases.d.ts +11 -0
  61. package/dist/engine/boot-validator/boot-phases.js +140 -0
  62. package/dist/engine/boot-validator/boot-report.d.ts +6 -0
  63. package/dist/engine/boot-validator/boot-report.js +47 -0
  64. package/dist/engine/boot-validator/boot-rule.d.ts +12 -0
  65. package/dist/engine/boot-validator/boot-rule.js +14 -0
  66. package/dist/engine/boot-validator/boot-warnings.d.ts +2 -0
  67. package/dist/engine/boot-validator/boot-warnings.js +20 -0
  68. package/dist/engine/boot-validator/derived-sql-fields.d.ts +4 -0
  69. package/dist/engine/boot-validator/derived-sql-fields.js +184 -0
  70. package/dist/engine/boot-validator/entity-handler.d.ts +3 -0
  71. package/dist/engine/boot-validator/entity-handler.js +6 -3
  72. package/dist/engine/boot-validator/entity-list-screens.js +3 -1
  73. package/dist/engine/boot-validator/field-conditions.d.ts +2 -0
  74. package/dist/engine/boot-validator/field-conditions.js +178 -0
  75. package/dist/engine/boot-validator/i18n-keys.d.ts +2 -2
  76. package/dist/engine/boot-validator/i18n-keys.js +1 -3
  77. package/dist/engine/boot-validator/index.d.ts +5 -34
  78. package/dist/engine/boot-validator/index.js +24 -204
  79. package/dist/engine/boot-validator/pii-retention.js +2 -7
  80. package/dist/engine/boot-validator/projection-list-screens.js +19 -1
  81. package/dist/engine/boot-validator/read-gate.d.ts +2 -0
  82. package/dist/engine/boot-validator/read-gate.js +54 -0
  83. package/dist/engine/boot-validator/screens-forms.js +19 -6
  84. package/dist/engine/boot-validator/screens-kind-entity-list.js +8 -6
  85. package/dist/engine/boot-validator/screens-lists.js +8 -0
  86. package/dist/engine/boot-validator/zod-shape.js +4 -2
  87. package/dist/engine/build-app-schema.js +11 -5
  88. package/dist/engine/embedded-derived.d.ts +8 -6
  89. package/dist/engine/embedded-derived.js +25 -7
  90. package/dist/engine/entity-handlers.d.ts +1 -1
  91. package/dist/engine/entity-handlers.js +17 -18
  92. package/dist/engine/entity-list-runtime-options.d.ts +5 -1
  93. package/dist/engine/entity-list-runtime-options.js +103 -4
  94. package/dist/engine/factories.d.ts +5 -5
  95. package/dist/engine/factories.js +3 -5
  96. package/dist/engine/field-access.d.ts +2 -0
  97. package/dist/engine/field-access.js +48 -1
  98. package/dist/engine/field-state.d.ts +12 -0
  99. package/dist/engine/field-state.js +67 -0
  100. package/dist/engine/handler-helpers.d.ts +3 -0
  101. package/dist/engine/handler-helpers.js +7 -1
  102. package/dist/engine/index.d.ts +2 -1
  103. package/dist/engine/index.js +2 -1
  104. package/dist/engine/ownership.d.ts +1 -1
  105. package/dist/engine/ownership.js +9 -5
  106. package/dist/engine/registry-state.d.ts +1 -0
  107. package/dist/engine/registry-state.js +1 -1
  108. package/dist/engine/schema-builder.js +3 -0
  109. package/dist/engine/strip-unreadable-related-lists.d.ts +4 -0
  110. package/dist/engine/strip-unreadable-related-lists.js +80 -0
  111. package/dist/entrypoint/index.js +1 -0
  112. package/dist/entrypoint/internals.d.ts +2 -0
  113. package/dist/files/assert-file-refs-belong-to-tenant.js +26 -6
  114. package/dist/files/bind-pending-file-refs.d.ts +3 -2
  115. package/dist/files/bind-pending-file-refs.js +11 -12
  116. package/dist/files/bind-referenced-files.write.js +5 -5
  117. package/dist/files/create-file-ref-from-bytes.d.ts +2 -0
  118. package/dist/files/create-file-ref-from-bytes.js +2 -0
  119. package/dist/files/create-file-ref.d.ts +2 -0
  120. package/dist/files/create-file-ref.js +39 -22
  121. package/dist/files/dispose-removed-file-refs.js +5 -8
  122. package/dist/files/file-field-slots.d.ts +10 -0
  123. package/dist/files/file-field-slots.js +53 -0
  124. package/dist/files/file-ref-entity.d.ts +1 -1
  125. package/dist/files/file-ref-table.d.ts +1 -1
  126. package/dist/files/file-routes.js +30 -9
  127. package/dist/files/index.d.ts +1 -0
  128. package/dist/files/index.js +1 -0
  129. package/dist/files/load-save-file-refs.js +3 -4
  130. package/dist/files/record-read-check.js +2 -30
  131. package/dist/files/record-write-check.d.ts +2 -0
  132. package/dist/files/record-write-check.js +18 -3
  133. package/dist/files/upload-field-resolution.d.ts +4 -1
  134. package/dist/files/upload-field-resolution.js +57 -12
  135. package/dist/pipeline/dispatch-batch.js +6 -5
  136. package/dist/pipeline/dispatch-write.js +2 -1
  137. package/dist/pipeline/write-result-masking.js +2 -1
  138. package/dist/schema-cli/validate-command.js +46 -12
  139. package/dist/schema-cli.js +1 -1
  140. package/dist/ui-types/index.d.ts +2 -1
  141. package/dist/ui-types/index.js +2 -1
  142. package/package.json +3 -3
  143. package/src/changes.json +67 -0
@@ -4,6 +4,7 @@ import { assertRowLevelSecurityTableState, createDbConnection, generateMigration
4
4
  import { isLiveFrameworkTable } from "../db/known-table-names.js";
5
5
  import { readMigrationSqlTexts } from "../db/migrate-runner.js";
6
6
  import { diffReplayAgainstSnapshot, replayMigrationsDir } from "../db/replay-migration-sql.js";
7
+ import { BootValidationError } from "../engine/boot-validator/boot-rule.js";
7
8
  import { validateBoot } from "../engine/boot-validator.js";
8
9
  import { describeThrown, loadPreviousSnapshot, loadSchemaModOrReport, nextSequenceNumber, SNAPSHOT_FILENAME, } from "./shared.js";
9
10
  import { featureDefinitionsOf, parseValidateBootOptions, withFileStoragePresence, } from "./validate-boot-input.js";
@@ -35,6 +36,16 @@ function checkSchemaDrift(ctx, schemaMod, prevSnapshot) {
35
36
  out.err(" Fix: `kumiko-schema generate <name>`, then commit the migration.");
36
37
  return false;
37
38
  }
39
+ function unclassifiedViolation(check, e) {
40
+ return { ruleId: `unclassified/${check}`, check, message: describeThrown(e) };
41
+ }
42
+ function reportBootViolations(out, violations) {
43
+ for (const v of violations) {
44
+ out.err(` ✗ boot [${v.ruleId}] ${v.message}`);
45
+ if (v.fix !== undefined)
46
+ out.err(` Fix: ${v.fix}`);
47
+ }
48
+ }
38
49
  // 2. Boot validity — needs the composed feature set.
39
50
  function checkBootValidity(out, schemaMod) {
40
51
  let bootFeatures;
@@ -43,11 +54,11 @@ function checkBootValidity(out, schemaMod) {
43
54
  }
44
55
  catch (e) {
45
56
  out.err(` ✗ boot: ${describeThrown(e)}`);
46
- return false;
57
+ return { ok: false, violations: [unclassifiedViolation("featureDefinitionsOf", e)] };
47
58
  }
48
59
  if (bootFeatures === undefined) {
49
60
  out.log(" · boot: skipped — add `export const FEATURES = composeFeatures(APP_FEATURES, { includeBundled: true })` to kumiko/schema.ts to enable validateBoot.");
50
- return true;
61
+ return { ok: true, skipped: true, violations: [] };
51
62
  }
52
63
  try {
53
64
  validateBoot(bootFeatures, {
@@ -55,11 +66,15 @@ function checkBootValidity(out, schemaMod) {
55
66
  env: withFileStoragePresence(process.env),
56
67
  });
57
68
  out.log(" ✓ boot: feature configuration is valid");
58
- return true;
69
+ return { ok: true, violations: [] };
59
70
  }
60
71
  catch (e) {
72
+ if (e instanceof BootValidationError) {
73
+ reportBootViolations(out, e.violations);
74
+ return { ok: false, violations: e.violations };
75
+ }
61
76
  out.err(` ✗ boot: ${describeThrown(e)}`);
62
- return false;
77
+ return { ok: false, violations: [unclassifiedViolation("validateBoot", e)] };
63
78
  }
64
79
  }
65
80
  function declaredTablesOf(schemaMod) {
@@ -150,7 +165,8 @@ function checkMigrationContentDrift(ctx, prevSnapshot) {
150
165
  // added/changed but never generated → missing table → prod 500)
151
166
  // 2. boot validity: validateBoot over the composed FEATURES (QN/screen/
152
167
  // nav/role refs). Runs only if kumiko/schema.ts exports FEATURES;
153
- // honours its optional VALIDATE_BOOT_OPTIONS export.
168
+ // honours its optional VALIDATE_BOOT_OPTIONS export. `--json` prints
169
+ // this result as one JSON document on stdout.
154
170
  // 3. migration-content drift: replay every committed *.sql file and
155
171
  // diff the result against .snapshot.json — catches a migration
156
172
  // file whose SQL body doesn't match what its own snapshot entry
@@ -161,14 +177,32 @@ function checkMigrationContentDrift(ctx, prevSnapshot) {
161
177
  // 4. live row-level security (only with DATABASE_URL): the boot's
162
178
  // table-state check against the real database (not the role: that is a boot-time property).
163
179
  // The DB-level gate (assertKumikoSchemaCurrent) stays at boot/deploy.
180
+ function printBootJson(ctx, boot) {
181
+ const { ok, skipped, violations } = boot;
182
+ ctx.out.log(JSON.stringify({ boot: { ok, ...(skipped ? { skipped } : {}), violations } }));
183
+ }
164
184
  export async function runValidateCommand(ctx) {
165
- const schemaMod = await loadSchemaModOrReport(ctx);
166
- if (schemaMod === undefined)
185
+ const jsonMode = ctx.argv.includes("--json");
186
+ // stdout carries exactly one JSON document in --json mode.
187
+ const out = jsonMode ? { log: ctx.out.err, err: ctx.out.err } : ctx.out;
188
+ const humanCtx = { ...ctx, out };
189
+ const schemaMod = await loadSchemaModOrReport(humanCtx);
190
+ if (schemaMod === undefined) {
191
+ if (jsonMode) {
192
+ const message = "kumiko/schema.ts could not be loaded";
193
+ printBootJson(ctx, {
194
+ ok: false,
195
+ violations: [{ ruleId: "unclassified/loadSchemaMod", check: "loadSchemaMod", message }],
196
+ });
197
+ }
167
198
  return 1;
199
+ }
168
200
  const prevSnapshot = loadPreviousSnapshot(join(ctx.migrationsDir, SNAPSHOT_FILENAME));
169
- const schemaOk = checkSchemaDrift(ctx, schemaMod, prevSnapshot);
170
- const bootOk = checkBootValidity(ctx.out, schemaMod);
171
- const migrationsOk = checkMigrationContentDrift(ctx, prevSnapshot);
172
- const rowLevelSecurityOk = await checkLiveRowLevelSecurity(ctx.out, schemaMod);
173
- return schemaOk && bootOk && migrationsOk && rowLevelSecurityOk ? 0 : 1;
201
+ const schemaOk = checkSchemaDrift(humanCtx, schemaMod, prevSnapshot);
202
+ const boot = checkBootValidity(out, schemaMod);
203
+ const migrationsOk = checkMigrationContentDrift(humanCtx, prevSnapshot);
204
+ const rowLevelSecurityOk = await checkLiveRowLevelSecurity(out, schemaMod);
205
+ if (jsonMode)
206
+ printBootJson(ctx, boot);
207
+ return schemaOk && boot.ok && migrationsOk && rowLevelSecurityOk ? 0 : 1;
174
208
  }
@@ -28,7 +28,7 @@ function printSchemaCliUsage(out) {
28
28
  out.log("");
29
29
  out.log(" Subcommands:");
30
30
  out.log(" generate <name> Write a new migration from the EntityTableMeta diff");
31
- out.log(" validate Static CI gate (no DB): schema drift + validateBoot");
31
+ out.log(" validate [--json] Static CI gate (no DB): schema drift + validateBoot");
32
32
  out.log(" apply Apply pending checked-in SQL files");
33
33
  out.log(" baseline Mark checked-in migrations as applied (no SQL run)");
34
34
  out.log(" status List applied vs pending");
@@ -1,6 +1,7 @@
1
1
  export { NO_WIDGET_FIELD_TYPES } from "@cosmicdrift/kumiko-types/fields";
2
2
  export type { DerivedCellRoundingTarget } from "../engine/embedded-derived.ts";
3
- export { computeDerivedCellValue, roundDerivedCellValue } from "../engine/embedded-derived.ts";
3
+ export { computeDerivedCellValue, roundDerivedCellValue, withDerivedCells, } from "../engine/embedded-derived.ts";
4
+ export { findMissingConditionalRequirements, isFieldRequired, isFieldVisible, isMissingRequiredValue, } from "../engine/field-state.ts";
4
5
  export type { FormDerivationScreen } from "../engine/form-derivations.ts";
5
6
  export { applyFormDerivations, isFormDerivationInputMode, isUnusedFallbackOperand, } from "../engine/form-derivations.ts";
6
7
  export type { ParsedRefTarget } from "../engine/parse-ref-target.ts";
@@ -20,7 +20,8 @@
20
20
  // When adding a symbol here, verify it's either a type or a pure
21
21
  // helper with no cross-module side-effects.
22
22
  export { NO_WIDGET_FIELD_TYPES } from "@cosmicdrift/kumiko-types/fields";
23
- export { computeDerivedCellValue, roundDerivedCellValue } from "../engine/embedded-derived.js";
23
+ export { computeDerivedCellValue, roundDerivedCellValue, withDerivedCells, } from "../engine/embedded-derived.js";
24
+ export { findMissingConditionalRequirements, isFieldRequired, isFieldVisible, isMissingRequiredValue, } from "../engine/field-state.js";
24
25
  export { applyFormDerivations, isFormDerivationInputMode, isUnusedFallbackOperand, } from "../engine/form-derivations.js";
25
26
  export { parseRefTarget } from "../engine/parse-ref-target.js";
26
27
  export { ACTION_FORM_PSEUDO_ENTITY, availableSelectOptions, evalFieldCondition, findUnavailableSelectOptions, isExtensionEditSection, isFieldsEditSection, isFormatSpec, isRecordLocked, isUnchangedValue, isWriteFormEditSection, normalizeEditField, normalizeListColumn, resolveNavParentScreen, sectionFieldSpecs, } from "../engine/screen-helpers.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosmicdrift/kumiko-framework",
3
- "version": "0.398.0",
3
+ "version": "0.400.0",
4
4
  "description": "Framework core — engine, pipeline, API, DB, and every other bit that makes Kumiko go.",
5
5
  "license": "MIT",
6
6
  "author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
@@ -203,7 +203,7 @@
203
203
  "./package.json": "./package.json"
204
204
  },
205
205
  "dependencies": {
206
- "@cosmicdrift/kumiko-types": "0.398.0",
206
+ "@cosmicdrift/kumiko-types": "0.400.0",
207
207
  "bullmq": "^5.76.7",
208
208
  "hono": "^4.13.14",
209
209
  "i18next": "^26.1.0",
@@ -225,7 +225,7 @@
225
225
  }
226
226
  },
227
227
  "devDependencies": {
228
- "@cosmicdrift/kumiko-testing": "0.398.0",
228
+ "@cosmicdrift/kumiko-testing": "0.400.0",
229
229
  "bun-types": "^1.4.4",
230
230
  "fflate": "^0.8.3",
231
231
  "meilisearch": "^0.58.0",
package/src/changes.json CHANGED
@@ -1,4 +1,71 @@
1
1
  [
2
+ {
3
+ "version": "0.400.0",
4
+ "type": "improvement",
5
+ "title": "Boot validation reports all violations at once",
6
+ "detail": "validateBoot runs its checks in phases and collects the violations of each phase into one BootValidationError with a `violations` list (ruleId, check, feature, message). Structural violations (duplicate API names, screen short-id collisions, unresolved query references, circular dependencies, extension usages, API exposure, reference fields, parent refs) abort before the per-feature and app-wide checks, which would only echo them. The error message starts with `Boot validation failed: N violation(s)` followed by one line per violation, each keeping its original text. A feature whose action or field wiring is invalid skips its screen check. `kumiko-schema validate` prints one ✗ line per violation and takes `--json`, which prints a single JSON document on stdout and moves the human lines to stderr."
7
+ },
8
+ {
9
+ "version": "0.400.0",
10
+ "type": "improvement",
11
+ "title": "Slimmer checklist cards and locale numbers in embedded lists",
12
+ "detail": "On narrow screens an embedded list with an `inRange` derived cell no longer shows the min and max sub-fields as their own rows. The card shows them as a hint under the measured value (\"Limit 0.05 to 0.2\", \"At least …\", \"At most …\"; new keys `kumiko.field.embedded-list.limit-range`, `limit-min`, `limit-max`). The result badge sits next to the measured value without a label. The new `embeddedList.cardHiddenCells` on an entityEdit field hides sub-fields that only steer a row (such as the kind of a checkpoint) on phone cards; boot rejects names that are not sub-fields. The desktop table is unchanged. Number and decimal cells now use the locale text input (`NumberInput`) instead of a native `type=\"number\"`, so input and read-only cells share one locale format (\"0,31\" in de, \"0.31\" in en). Tests that located these cells by role `spinbutton` must use `textbox`."
13
+ },
14
+ {
15
+ "version": "0.400.0",
16
+ "type": "improvement",
17
+ "title": "SQL derived fields, query-gated relatedList tabs, count badge",
18
+ "detail": "A derived field with `sql` (coalesce over fields, or a related-table count, countDistinct or first with optional label and conditions incl. activeOn/today/now) is computed inside the list SELECT and may set `sortable: true`, also as entityList defaultSort; JS `derive` fields stay display-only and read the SQL values. Related rows and measured fields respect the viewer's read access, a gated value is NULL. GET /api/schema removes relatedList sections (tabs, entityEdit sections, expandableRow) whose query the caller's roles cannot run, and metrics linking to a removed tab lose their navigate. `count: true` on a relatedList tab shows the tab badge from the section's own query total. A metric only becomes clickable when its entityId target resolves, and groupBy labels now also resolve for entities with a backingTable. `valueType: \"money\"` is allowed for a SQL derived `related` + `first` on a money field: amount and currency are read together and the row carries the stored money shape (no key when unset), sorting is by minor units. Ownership where-rules of a label target or related table are qualified with the subquery's own alias (a label of a row the viewer cannot read no longer leaks when the target is the outer entity), the related entity and label target must also be readable through a query handler of the viewer's roles, backingTable entities are read from their real table (also for reference labels, reference search and label sort, which returned a 500 before), an entity may derive from itself, and a sortable related derived field needs an index on the join column."
19
+ },
20
+ {
21
+ "version": "0.400.0",
22
+ "type": "improvement",
23
+ "title": "Entity readGate and the documents feature",
24
+ "detail": "`createEntity({ readGate: { anyLink, fileOwner, linkExemptRoles } })` hides a row unless the viewer can read at least one linked host (join rows with a parentRef) and the owner of the referenced file; it is applied in list, detail, eager-load and relation reads, fail-closed without the registry, and the framework system user passes. Hand-written list/detail handlers for a gated entity are rejected at boot, live signals for gated entities stay anonymous. `ParentVisibilityOption` gains `canReadEntity` and `resolveTable`. The new `documents` feature (`createDocumentsFeature({ categories, linkTargets, capture?, retention? })`) files documents with category, issue and expiry date, links them to records (link, unlink, for-record and per-type queries, expiry overview), lists them on the `documents:screen:list` projection list through `documents:query:overview` (an `expiry` state per row and an \"expiring\" filter that returns expired and soon-expiring documents), captures files saved into configured entity fields via a postSave hook, and offers an idempotent SYSTEM-only import for jobs. Updating or deleting a document needs write access to one of its linked hosts (admin roles and the system user are exempt). Reference search and sort on a readGate target now apply the gate, and `parentVisibilityFor` decides `canReadEntity` by the entity's own detail query, the same rule the file route uses, so a `liveEntities` query no longer widens what a file owner shows. A document cannot claim another user's unbound upload. A document never defaults its title to the file name."
25
+ },
26
+ {
27
+ "version": "0.400.0",
28
+ "type": "fix",
29
+ "title": "Hooks run for handlers that return response data; readOnly related lists",
30
+ "detail": "A write handler wrapped by `withResponseData` (for example `tenant:write:remove-member`) lost its lifecycle result, so postSave/postDelete hooks and projections were skipped. `WriteResult` now carries an optional `lifecycle` that the dispatcher and batch flush use and that is stripped from client responses. `EditRelatedListSection` gains `readOnly: true` for plain tables without an entity; the boot validator rejects it together with rowClick/rowActions and guard R2 skips it. The bin test helpers and `envWithoutGitOverrides` now also strip GIT_COMMON_DIR and the other git location variables."
31
+ },
32
+ {
33
+ "version": "0.400.0",
34
+ "type": "breaking",
35
+ "title": "An untouched money field is no longer submitted as 0",
36
+ "detail": "Forms seed a money field with its currency only and drop that currency-only value on submit, so a handler can tell a deliberately typed 0 from an untouched field. A currency-only value counts as missing for required checks, and the input shows empty instead of 0.00; config forms keep their plain-number contract.",
37
+ "migration": "A form that left a required money field untouched used to submit 0 and now fails validation; type the amount (also in e2e and DOM tests) or give the field a value through `load` or the record. Handlers that read an absent optional money field as 0 must default it themselves."
38
+ },
39
+ {
40
+ "version": "0.400.0",
41
+ "type": "improvement",
42
+ "title": "documents entities are filed-document and filed-document-link; safe import; split access",
43
+ "detail": "The documents feature registers its entities as `filed-document` (table `read_filed_documents`) and `filed-document-link` (table `read_filed_document_links`), so an app that has its own `document` entity keeps its events and tables; handler and query names follow (`documents:write:filed-document:create`, `documents:query:filed-document:list`, `documents:query:filed-document-link:list`), and so do the field label keys `documents:entity:filed-document:field:*`. `documents:write:import` now fails with a conflict (`documents.errors.import-id-taken`) and links nothing when the id is already used by a stream that is not a document; a repeat import of the same document, deleted or not, still changes nothing; the check reads the stream, so a row-level `readAccess` cannot turn a retry into a refusal. With `readAccess` set, the system user keeps reading every document, so capture and import still find the ones the rule hides. An imported document's createdAt is the time of the import, because the event store does not backdate events; issuedAt carries the business date. `createDocumentsFeature({ access })` takes either one rule for everything, as before, or `{ read, write, delete }` (type `DocumentsAccess`): read covers the lists, detail, for-record, the overviews and the list screen, write covers create, update, link and unlink; a missing read or write keeps the TenantAdmin and TenantMember default and a missing delete follows write. The readGate on the document is unchanged."
44
+ },
45
+ {
46
+ "version": "0.400.0",
47
+ "type": "improvement",
48
+ "title": "Embedded list as inspection checklist",
49
+ "detail": "Every entity field and every embedded sub-field takes `visibleWhen` and `requiredWhen` (FieldCondition). The executor enforces `requiredWhen` on create and update; it returns `validation_error` with paths like `checkpoints.0.finding`, and on update it only checks fields whose value or condition field changed. A field is required only while it is visible, and hidden values are kept. Embedded sub-fields can be `images` (with `capture`) or `files` (`maxSize`, `accept`, `maxCount`). Uploads send `subField` next to `fieldName`, and `file_refs.fieldName` stays the embedded field, so binding, tenant check, disposal, read access, GDPR forget and retention work as for top-level file fields. The new derived op `inRange` (`from: [value, min, max]`, `inside`, `outside`) writes into a select sub-field. Any derived cell can carry a row-level `when`, and server and client compute through the same `withDerivedCells`. Select sub-fields take `optionTones`; segments show the tone of the selected option, and narrow screens render cards with 44px controls and the read-only label as the card title. Boot validates the condition fields and rejects `required: true` combined with `visibleWhen`/`requiredWhen`. Saving now enforces `access.write` on embedded sub-fields per row (`ownership_denied`, path `field.subField`); before, only the read side honored sub-field access. Saving also checks each newly placed file id against the `accept`/`maxSize` of the sub-field it lands in (`file_violates_bind_target`). Boot also rejects a numeric derived op whose target is not numeric, which can break an app that derived into a text or select cell. Recipe: `samples/recipes/inspection-checklist`."
50
+ },
51
+ {
52
+ "version": "0.400.0",
53
+ "type": "fix",
54
+ "title": "count badge works with strict query schemas",
55
+ "detail": "The boot check for a relatedList with `count: true` treated every Zod object with a catchall as having open keys and skipped the `limit` and `totalCount` lookup, so a query declared with `.strict()` (catchall `never`) failed boot although it accepts both keys. Only a catchall other than `never` now counts as open; `.loose()` and `.catchall()` schemas still fail the check."
56
+ },
57
+ {
58
+ "version": "0.399.0",
59
+ "type": "improvement",
60
+ "title": "Agent docs ship an API reference and a compact feature index",
61
+ "detail": "`packages/framework/agents/` now contains `api.md` with one file per app-facing entry point (engine, errors, ui-types, db, event-store, seeding, renderer/web, testing/stack, testing/helpers, dev-server/testing) plus `api/types.md` for the types they reference. Signatures are one line each, option types are property lists with the first doc sentence, and `@internal` declarations are left out. `features-index.md` lists every bundled feature with one sentence, the import of its factory, its required features, config keys without a default and secrets. `AGENTS.md` points agents at the index first and at `api.md` instead of `dist/*.d.ts`. Both files are generated by `bun run gen:agent-docs` and checked by the agent-docs-drift guard."
62
+ },
63
+ {
64
+ "version": "0.399.0",
65
+ "type": "improvement",
66
+ "title": "Opt-in anonymous uploads per file field",
67
+ "detail": "Since the upload route rejects anonymous callers, `POST /api/files` answered 401 for every anonymous visitor. A file, image, files or images field with `anonymousUpload: true` now accepts a pending upload from an anonymous visitor (entityType and fieldName, no entityId, no actionForm); the app binds the file itself. Everything else stays 401 for anonymous callers."
68
+ },
2
69
  {
3
70
  "version": "0.398.0",
4
71
  "type": "fix",