@cosmicdrift/kumiko-framework 0.413.0 → 0.414.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/AGENTS.md +5 -2
- package/agents/api/framework-db.md +14 -3
- package/agents/api/framework-engine.md +64 -13
- package/agents/api/framework-event-store.md +14 -0
- package/agents/api/framework-ui-types.md +149 -21
- package/agents/api/renderer-web.md +93 -9
- package/agents/api/testing-helpers.md +3 -2
- package/agents/api/testing-stack.md +3 -0
- package/agents/api/types.md +205 -14
- package/agents/api.md +7 -7
- package/agents/boot-rules.md +63 -9
- package/agents/examples/api-docs.md +2 -6
- package/agents/examples/auth-mfa.md +57 -10
- package/agents/examples/chat-channels.md +2 -0
- package/agents/examples/currencies-global.md +1 -0
- package/agents/examples/env-composition.md +7 -11
- package/agents/examples/helpdesk.md +15 -8
- package/agents/examples/managed-pages.md +90 -1
- package/agents/examples/pwa-shell.md +210 -0
- package/agents/examples/rate-limiting.md +3 -3
- package/agents/examples/record-detail-layout.md +1537 -67
- package/agents/examples/workflow-engine.md +16 -12
- package/agents/examples.md +1 -0
- package/agents/features-index.md +4 -2
- package/agents/features.md +22 -7
- package/agents/widgets.md +19 -1
- package/dist/api/api-constants.d.ts +1 -0
- package/dist/api/api-constants.js +4 -0
- package/dist/api/auth-middleware.js +4 -3
- package/dist/api/auth-routes-shared.js +2 -1
- package/dist/api/entity-read-access.d.ts +1 -0
- package/dist/api/entity-read-access.js +18 -0
- package/dist/api/export/export-route.d.ts +6 -1
- package/dist/api/export/export-route.js +27 -1
- package/dist/api/export/export-rows.js +19 -3
- package/dist/api/routes.d.ts +2 -0
- package/dist/api/routes.js +9 -1
- package/dist/api/server-extra-routes.js +2 -1
- package/dist/api/server-feature-http-routes.d.ts +9 -0
- package/dist/api/server-feature-http-routes.js +109 -0
- package/dist/api/server-middleware.js +2 -19
- package/dist/api/server-pat-rate-limit-guard.d.ts +3 -0
- package/dist/api/server-pat-rate-limit-guard.js +19 -0
- package/dist/api/server-rate-limit-wiring.d.ts +10 -0
- package/dist/api/server-rate-limit-wiring.js +37 -0
- package/dist/api/server-routes.d.ts +4 -12
- package/dist/api/server-routes.js +12 -171
- package/dist/api/server-schema-route.d.ts +3 -0
- package/dist/api/server-schema-route.js +58 -0
- package/dist/api/server-wiring.js +2 -37
- package/dist/api/server.js +3 -1
- package/dist/compliance/override-schema.js +5 -5
- package/dist/compliance/sub-processors.js +10 -1
- package/dist/crypto/index.d.ts +1 -1
- package/dist/crypto/index.js +1 -1
- package/dist/crypto/pii-field-encryption.d.ts +2 -0
- package/dist/crypto/pii-field-encryption.js +16 -1
- package/dist/db/apply-entity-event.js +4 -0
- package/dist/db/bun-sql-connection-codes.d.ts +1 -0
- package/dist/db/bun-sql-connection-codes.js +7 -0
- package/dist/db/collect-table-metas.js +4 -1
- package/dist/db/config-seed.js +1 -1
- package/dist/db/derived-field-sql.js +15 -13
- package/dist/db/derived-related-sql.d.ts +2 -2
- package/dist/db/derived-related-sql.js +4 -2
- package/dist/db/dialect.d.ts +3 -0
- package/dist/db/dialect.js +1 -3
- package/dist/db/driver-row-coercion.js +2 -2
- package/dist/db/driver-value-preparation.js +1 -1
- package/dist/db/eagerload.js +15 -12
- package/dist/db/entity-table-meta.d.ts +2 -0
- package/dist/db/entity-table-meta.js +7 -0
- package/dist/db/event-store-executor-context.js +13 -8
- package/dist/db/event-store-executor-read-aggregate-currencies.js +2 -2
- package/dist/db/event-store-executor-read-aggregate.js +2 -2
- package/dist/db/event-store-executor-read-filter.d.ts +4 -0
- package/dist/db/event-store-executor-read-filter.js +28 -11
- package/dist/db/event-store-executor-read-search.d.ts +1 -0
- package/dist/db/event-store-executor-read-search.js +6 -6
- package/dist/db/event-store-executor-read-sort.js +3 -3
- package/dist/db/event-store-executor-read-where.js +14 -5
- package/dist/db/event-store-executor-read.js +7 -7
- package/dist/db/event-store-executor-write.js +50 -95
- package/dist/db/executor-managed-tables.js +4 -1
- package/dist/db/index.d.ts +4 -2
- package/dist/db/index.js +4 -2
- package/dist/db/known-table-names.d.ts +1 -0
- package/dist/db/known-table-names.js +7 -5
- package/dist/db/list-aggregate-labels.d.ts +1 -0
- package/dist/db/list-aggregate-labels.js +9 -1
- package/dist/db/migrate-generator.js +23 -4
- package/dist/db/migrate-rls-diff.d.ts +1 -0
- package/dist/db/migrate-rls-diff.js +15 -1
- package/dist/db/migrate-runner.js +2 -2
- package/dist/db/money.d.ts +1 -1
- package/dist/db/money.js +1 -4
- package/dist/db/parent-ref-clause.d.ts +6 -2
- package/dist/db/parent-ref-clause.js +76 -23
- package/dist/db/parent-ref-global-hosts.d.ts +20 -0
- package/dist/db/parent-ref-global-hosts.js +47 -0
- package/dist/db/production-schema-command-hint.d.ts +1 -0
- package/dist/db/production-schema-command-hint.js +3 -0
- package/dist/db/queries/backfill-pii.js +55 -29
- package/dist/db/queries/ddl.js +13 -2
- package/dist/db/queries/event-store-open-streams.d.ts +15 -0
- package/dist/db/queries/event-store-open-streams.js +33 -0
- package/dist/db/queries/event-store-payload-scrub.d.ts +5 -0
- package/dist/db/queries/event-store-payload-scrub.js +11 -0
- package/dist/db/queries/event-store.js +0 -1
- package/dist/db/queries/raw-sql.js +0 -1
- package/dist/db/queries/rebuild-rls-guard.d.ts +2 -1
- package/dist/db/queries/rebuild-rls-guard.js +24 -11
- package/dist/db/queries/rls-boot-catalog.d.ts +1 -0
- package/dist/db/queries/rls-boot-catalog.js +13 -8
- package/dist/db/queries/rls-shape.d.ts +2 -1
- package/dist/db/queries/rls-shape.js +10 -0
- package/dist/db/queries/session-advisory-lock.js +2 -1
- package/dist/db/queries/test-stack.js +7 -7
- package/dist/db/query.js +16 -11
- package/dist/db/rebuild-marker.js +11 -2
- package/dist/db/render-rls-ddl.d.ts +2 -0
- package/dist/db/render-rls-ddl.js +16 -11
- package/dist/db/replay-migration-sql.js +1 -1
- package/dist/db/row-level-security-boot-check.js +18 -5
- package/dist/db/row-level-security-connection.js +25 -12
- package/dist/db/row-level-security-scope.d.ts +2 -1
- package/dist/db/row-level-security-scope.js +9 -5
- package/dist/db/sql-identifier.d.ts +1 -0
- package/dist/db/sql-identifier.js +3 -0
- package/dist/db/system-tenant-read-db.d.ts +5 -0
- package/dist/db/system-tenant-read-db.js +28 -0
- package/dist/db/table-builder.d.ts +3 -1
- package/dist/db/table-builder.js +18 -8
- package/dist/db/table-info.d.ts +1 -2
- package/dist/db/table-introspection.d.ts +3 -0
- package/dist/db/table-introspection.js +6 -0
- package/dist/db/table-push.d.ts +1 -0
- package/dist/db/table-push.js +7 -1
- package/dist/db/tenant-db-runner.d.ts +3 -0
- package/dist/db/tenant-db-runner.js +19 -1
- package/dist/db/transaction-serialization.d.ts +1 -0
- package/dist/db/transaction-serialization.js +20 -3
- package/dist/db/where-clause.js +11 -2
- package/dist/db/write-ownership-failures.d.ts +25 -0
- package/dist/db/write-ownership-failures.js +82 -0
- package/dist/engine/boot-validator/boot-check.js +7 -1
- package/dist/engine/boot-validator/boot-phases-app.js +5 -5
- package/dist/engine/boot-validator/boot-phases.js +3 -2
- package/dist/engine/boot-validator/boot-rules.d.ts +293 -26
- package/dist/engine/boot-validator/boot-rules.js +4 -0
- package/dist/engine/boot-validator/bundled-lists-table.js +2 -2
- package/dist/engine/boot-validator/card-meta-overflow.js +1 -0
- package/dist/engine/boot-validator/config-deps.d.ts +0 -1
- package/dist/engine/boot-validator/config-deps.js +0 -28
- package/dist/engine/boot-validator/config-key-rules.d.ts +0 -15
- package/dist/engine/boot-validator/config-key-rules.js +0 -15
- package/dist/engine/boot-validator/dashboard-screen-target.d.ts +22 -0
- package/dist/engine/boot-validator/dashboard-screen-target.js +20 -0
- package/dist/engine/boot-validator/dashboard-stat-navigate.d.ts +1 -0
- package/dist/engine/boot-validator/dashboard-stat-navigate.js +25 -17
- package/dist/engine/boot-validator/definition-webhook-events-rules.d.ts +5 -0
- package/dist/engine/boot-validator/definition-webhook-events-rules.js +5 -0
- package/dist/engine/boot-validator/derived-sql-fields.js +1 -2
- package/dist/engine/boot-validator/entity-declaration-rules.d.ts +5 -0
- package/dist/engine/boot-validator/entity-declaration-rules.js +5 -0
- package/dist/engine/boot-validator/entity-list-screens.d.ts +1 -0
- package/dist/engine/boot-validator/entity-list-screens.js +33 -6
- package/dist/engine/boot-validator/entity-structure-rules.d.ts +5 -0
- package/dist/engine/boot-validator/entity-structure-rules.js +5 -0
- package/dist/engine/boot-validator/list-column-layout.js +10 -6
- package/dist/engine/boot-validator/list-row-guidance-rules.d.ts +67 -0
- package/dist/engine/boot-validator/list-row-guidance-rules.js +67 -0
- package/dist/engine/boot-validator/list-row-guidance.d.ts +20 -0
- package/dist/engine/boot-validator/list-row-guidance.js +129 -0
- package/dist/engine/boot-validator/list-sort-summary-rules.d.ts +42 -0
- package/dist/engine/boot-validator/list-sort-summary-rules.js +42 -0
- package/dist/engine/boot-validator/list-sort-summary.d.ts +5 -0
- package/dist/engine/boot-validator/list-sort-summary.js +149 -0
- package/dist/engine/boot-validator/list-table-options.js +15 -1
- package/dist/engine/boot-validator/list-table-rules.d.ts +10 -5
- package/dist/engine/boot-validator/list-table-rules.js +10 -5
- package/dist/engine/boot-validator/list-toolbar-options.d.ts +10 -0
- package/dist/engine/boot-validator/list-toolbar-options.js +31 -0
- package/dist/engine/boot-validator/named-filter-rules.d.ts +32 -2
- package/dist/engine/boot-validator/named-filter-rules.js +32 -2
- package/dist/engine/boot-validator/ownership.js +10 -1
- package/dist/engine/boot-validator/parent-ref.js +87 -50
- package/dist/engine/boot-validator/projection-list-screens.d.ts +1 -0
- package/dist/engine/boot-validator/projection-list-screens.js +31 -1
- package/dist/engine/boot-validator/query-output-columns.js +62 -9
- package/dist/engine/boot-validator/query-output-guidance.d.ts +7 -0
- package/dist/engine/boot-validator/query-output-guidance.js +39 -0
- package/dist/engine/boot-validator/query-refs.js +24 -1
- package/dist/engine/boot-validator/row-decoration.d.ts +11 -0
- package/dist/engine/boot-validator/row-decoration.js +16 -0
- package/dist/engine/boot-validator/screens-dashboard-links.d.ts +10 -0
- package/dist/engine/boot-validator/screens-dashboard-links.js +36 -0
- package/dist/engine/boot-validator/screens-dashboard-narrow.d.ts +4 -0
- package/dist/engine/boot-validator/screens-dashboard-narrow.js +211 -0
- package/dist/engine/boot-validator/screens-dashboard-rules.d.ts +84 -4
- package/dist/engine/boot-validator/screens-dashboard-rules.js +84 -4
- package/dist/engine/boot-validator/screens-dashboard.js +29 -7
- package/dist/engine/boot-validator/screens-kind-entity-list.js +32 -27
- package/dist/engine/boot-validator/screens-kind-projection-detail-guidance.d.ts +3 -0
- package/dist/engine/boot-validator/screens-kind-projection-detail-guidance.js +46 -0
- package/dist/engine/boot-validator/screens-kind-projection-detail-rules.d.ts +20 -0
- package/dist/engine/boot-validator/screens-kind-projection-detail-rules.js +20 -0
- package/dist/engine/boot-validator/screens-kind-projection-detail.js +2 -0
- package/dist/engine/boot-validator/screens-kind-projection-list.js +4 -0
- package/dist/engine/boot-validator/screens-kind-rules.d.ts +25 -0
- package/dist/engine/boot-validator/screens-kind-rules.js +25 -0
- package/dist/engine/boot-validator/screens-lists.d.ts +8 -2
- package/dist/engine/boot-validator/screens-lists.js +19 -3
- package/dist/engine/boot-validator/screens.js +1 -1
- package/dist/engine/boot-validator/sort-nulls.d.ts +2 -0
- package/dist/engine/boot-validator/sort-nulls.js +15 -0
- package/dist/engine/boot-validator/zod-shape.d.ts +2 -1
- package/dist/engine/boot-validator/zod-shape.js +19 -1
- package/dist/engine/build-app-schema.js +4 -0
- package/dist/engine/config-helpers.d.ts +1 -2
- package/dist/engine/config-helpers.js +6 -7
- package/dist/engine/define-feature.js +1 -0
- package/dist/engine/define-handler.d.ts +1 -0
- package/dist/engine/define-handler.js +4 -2
- package/dist/engine/definition-violations.js +2 -2
- package/dist/engine/entity-handlers.js +3 -8
- package/dist/engine/entity-list-runtime-options.js +9 -8
- package/dist/engine/factories.d.ts +2 -0
- package/dist/engine/feature-config-events-jobs.js +1 -0
- package/dist/engine/feature-entity-handlers.js +5 -2
- package/dist/engine/field-access.d.ts +1 -1
- package/dist/engine/field-access.js +7 -10
- package/dist/engine/find-entity.js +3 -3
- package/dist/engine/form-derivations.js +3 -3
- package/dist/engine/index.d.ts +3 -3
- package/dist/engine/index.js +2 -2
- package/dist/engine/named-filter-roles.d.ts +3 -0
- package/dist/engine/named-filter-roles.js +23 -0
- package/dist/engine/pipeline.js +0 -1
- package/dist/engine/project-app-schema-for-roles.js +17 -2
- package/dist/engine/qualified-name.js +0 -1
- package/dist/engine/registry-facade.js +1 -2
- package/dist/engine/registry-state.d.ts +1 -1
- package/dist/engine/registry-state.js +5 -2
- package/dist/engine/registry-validate.d.ts +1 -0
- package/dist/engine/registry-validate.js +9 -1
- package/dist/engine/registry.js +2 -1
- package/dist/engine/resolve-named-list-filters.js +5 -2
- package/dist/engine/schema-builder.js +6 -10
- package/dist/engine/screen-helpers.d.ts +12 -0
- package/dist/engine/screen-helpers.js +17 -1
- package/dist/engine/soft-delete-cleanup.js +5 -8
- package/dist/engine/state-machine.js +0 -1
- package/dist/engine/steps/_database-clock.d.ts +2 -0
- package/dist/engine/steps/_database-clock.js +6 -0
- package/dist/engine/steps/compute.js +1 -1
- package/dist/engine/steps/retry.js +5 -1
- package/dist/engine/steps/return.js +0 -1
- package/dist/engine/steps/wait-for-event.js +2 -1
- package/dist/engine/steps/wait.js +2 -1
- package/dist/engine/system-user.d.ts +2 -2
- package/dist/engine/system-user.js +2 -2
- package/dist/engine/types/handlers.d.ts +1 -1
- package/dist/engine/types/handlers.js +1 -1
- package/dist/engine/types/screen.d.ts +1 -1
- package/dist/engine/types/screen.js +1 -1
- package/dist/engine/webhook-contracts.d.ts +2 -3
- package/dist/engine/webhook-contracts.js +2 -25
- package/dist/engine/webhook-events.js +48 -29
- package/dist/engine/webhook-payload-strictness.d.ts +7 -0
- package/dist/engine/webhook-payload-strictness.js +53 -0
- package/dist/env/_zod-introspect.d.ts +1 -0
- package/dist/env/dry-run.d.ts +1 -1
- package/dist/env/dry-run.js +1 -1
- package/dist/env/field-meta.d.ts +4 -0
- package/dist/env/field-meta.js +67 -0
- package/dist/env/field-rules.d.ts +9 -0
- package/dist/env/field-rules.js +46 -0
- package/dist/env/index.d.ts +3 -3
- package/dist/env/index.js +16 -71
- package/dist/env/internals.d.ts +3 -0
- package/dist/env/internals.js +1 -2
- package/dist/env/required-env.d.ts +3 -1
- package/dist/env/required-env.js +5 -2
- package/dist/errors/serialize.js +2 -2
- package/dist/errors/write-error-info.js +0 -2
- package/dist/es-ops/operations-schema.js +18 -7
- package/dist/event-store/admin-api.js +3 -3
- package/dist/event-store/event-store.js +0 -3
- package/dist/event-store/index.d.ts +1 -0
- package/dist/event-store/index.js +1 -0
- package/dist/event-store/transfer.js +1 -1
- package/dist/files/assert-file-refs-belong-to-tenant.d.ts +2 -1
- package/dist/files/assert-file-refs-belong-to-tenant.js +15 -13
- package/dist/files/bind-pending-file-refs.d.ts +3 -1
- package/dist/files/bind-pending-file-refs.js +54 -27
- package/dist/files/copy-pending-file-refs-to-tenant.js +7 -3
- package/dist/files/create-file-ref.d.ts +4 -1
- package/dist/files/create-file-ref.js +14 -3
- package/dist/files/default-file-guard.js +4 -1
- package/dist/files/feature.js +1 -0
- package/dist/files/file-claim.d.ts +6 -0
- package/dist/files/file-claim.js +17 -0
- package/dist/files/file-field-slots.d.ts +2 -0
- package/dist/files/file-field-slots.js +28 -0
- package/dist/files/file-ref-entity.d.ts +3 -0
- package/dist/files/file-ref-entity.js +2 -0
- package/dist/files/file-ref-table.d.ts +3 -0
- package/dist/files/file-routes.d.ts +4 -1
- package/dist/files/file-routes.js +80 -16
- package/dist/files/in-memory-provider.d.ts +1 -1
- package/dist/files/in-memory-provider.js +2 -1
- package/dist/files/index.d.ts +1 -1
- package/dist/files/index.js +1 -1
- package/dist/files/invalid-file-ref-error.d.ts +2 -0
- package/dist/files/invalid-file-ref-error.js +15 -0
- package/dist/files/local-provider.js +9 -2
- package/dist/files/provider-resolver.js +1 -1
- package/dist/files/rebind-file-ref.d.ts +3 -2
- package/dist/files/rebind-file-ref.js +24 -18
- package/dist/files/resolve-file-handles.d.ts +13 -0
- package/dist/files/resolve-file-handles.js +57 -0
- package/dist/files/storage-tracking.d.ts +1 -1
- package/dist/files/storage-tracking.js +5 -2
- package/dist/files/sweep-stale-pending-file-refs.js +10 -4
- package/dist/files/types.d.ts +4 -0
- package/dist/files/types.js +10 -0
- package/dist/files/upload-field-resolution.d.ts +1 -0
- package/dist/files/upload-field-resolution.js +16 -2
- package/dist/files/upload-ledger.js +1 -1
- package/dist/i18n/required-surface-guidance-keys.d.ts +3 -0
- package/dist/i18n/required-surface-guidance-keys.js +9 -0
- package/dist/i18n/required-surface-keys.js +19 -4
- package/dist/internal/boot-rule-table-expectations.d.ts +2 -0
- package/dist/internal/boot-rule-table-expectations.js +29 -0
- package/dist/internal/row-level-security.d.ts +1 -0
- package/dist/internal/row-level-security.js +1 -0
- package/dist/internal/testing.d.ts +1 -0
- package/dist/internal/testing.js +1 -0
- package/dist/jobs/index.d.ts +1 -0
- package/dist/jobs/index.js +1 -0
- package/dist/jobs/job-load-events.d.ts +10 -0
- package/dist/jobs/job-load-events.js +12 -0
- package/dist/jobs/job-runner-context.js +6 -158
- package/dist/jobs/job-runner-dispatch.d.ts +7 -0
- package/dist/jobs/job-runner-dispatch.js +57 -0
- package/dist/jobs/job-runner-event-triggers.js +18 -9
- package/dist/jobs/job-runner-execution.js +2 -2
- package/dist/jobs/job-runner-facets.d.ts +48 -0
- package/dist/jobs/job-runner-facets.js +156 -0
- package/dist/jobs/job-runner-gates.js +24 -12
- package/dist/jobs/job-runner-helpers.d.ts +5 -1
- package/dist/jobs/job-runner-helpers.js +18 -3
- package/dist/jobs/job-runner-scope.d.ts +1 -0
- package/dist/jobs/job-runner-scope.js +2 -0
- package/dist/jobs/job-runner-tenant-cap-lock.d.ts +2 -0
- package/dist/jobs/job-runner-tenant-cap-lock.js +30 -0
- package/dist/jobs/job-runner.js +31 -70
- package/dist/jobs/obliterate-job-queues.d.ts +6 -0
- package/dist/jobs/obliterate-job-queues.js +23 -0
- package/dist/lifecycle/lifecycle.js +1 -1
- package/dist/migrations/event-header-scrub.d.ts +11 -0
- package/dist/migrations/event-header-scrub.js +33 -0
- package/dist/migrations/event-payload-scrub.d.ts +1 -1
- package/dist/migrations/event-payload-scrub.js +36 -4
- package/dist/migrations/index.d.ts +1 -0
- package/dist/migrations/index.js +2 -0
- package/dist/migrations/kumiko-drift.d.ts +5 -2
- package/dist/migrations/kumiko-drift.js +51 -14
- package/dist/migrations/pending-rebuilds.js +4 -5
- package/dist/observability/sensitive-filter.js +0 -12
- package/dist/pipeline/aggregate-type-removal.js +17 -4
- package/dist/pipeline/context-services.d.ts +2 -0
- package/dist/pipeline/context-services.js +5 -2
- package/dist/pipeline/dispatch-batch.js +4 -3
- package/dist/pipeline/dispatch-context-helpers.d.ts +11 -0
- package/dist/pipeline/dispatch-context-helpers.js +58 -0
- package/dist/pipeline/dispatch-nested-write.d.ts +7 -0
- package/dist/pipeline/dispatch-nested-write.js +119 -0
- package/dist/pipeline/dispatch-query.js +10 -3
- package/dist/pipeline/dispatch-scope.js +4 -3
- package/dist/pipeline/dispatch-shared.d.ts +2 -6
- package/dist/pipeline/dispatch-shared.js +6 -38
- package/dist/pipeline/dispatch-write.d.ts +0 -1
- package/dist/pipeline/dispatch-write.js +3 -302
- package/dist/pipeline/dispatcher-utils.js +6 -0
- package/dist/pipeline/effective-system-scope.d.ts +3 -0
- package/dist/pipeline/effective-system-scope.js +22 -0
- package/dist/pipeline/event-dispatcher-delivery.d.ts +1 -0
- package/dist/pipeline/event-dispatcher-delivery.js +17 -9
- package/dist/pipeline/event-dispatcher.d.ts +4 -1
- package/dist/pipeline/event-dispatcher.js +6 -7
- package/dist/pipeline/handler-context-auth.d.ts +3 -2
- package/dist/pipeline/handler-context-auth.js +3 -4
- package/dist/pipeline/handler-context-db.js +11 -4
- package/dist/pipeline/handler-context-dispatch.js +2 -2
- package/dist/pipeline/handler-context-events.d.ts +8 -3
- package/dist/pipeline/handler-context-events.js +20 -65
- package/dist/pipeline/handler-context-member-resolution.js +16 -8
- package/dist/pipeline/handler-context-notify.d.ts +1 -0
- package/dist/pipeline/handler-context-notify.js +2 -0
- package/dist/pipeline/handler-context-phase-denials.js +3 -2
- package/dist/pipeline/handler-context-projection.d.ts +3 -0
- package/dist/pipeline/handler-context-projection.js +39 -0
- package/dist/pipeline/handler-context-scope.d.ts +1 -1
- package/dist/pipeline/handler-context-scope.js +14 -2
- package/dist/pipeline/index.d.ts +1 -1
- package/dist/pipeline/index.js +1 -1
- package/dist/pipeline/lifecycle-pipeline.d.ts +1 -0
- package/dist/pipeline/lifecycle-pipeline.js +7 -4
- package/dist/pipeline/member-reader.js +4 -2
- package/dist/pipeline/msp-rebuild.js +1 -1
- package/dist/pipeline/nested-write-parent-guard.d.ts +5 -0
- package/dist/pipeline/nested-write-parent-guard.js +81 -0
- package/dist/pipeline/projection-rebuild.d.ts +2 -0
- package/dist/pipeline/projection-rebuild.js +16 -7
- package/dist/pipeline/projection-state.js +4 -6
- package/dist/pipeline/system-hooks.js +36 -6
- package/dist/pipeline/write-result-masking.js +31 -3
- package/dist/pipeline/write-transition-guard.d.ts +7 -0
- package/dist/pipeline/write-transition-guard.js +95 -0
- package/dist/schema-cli/shared.d.ts +2 -0
- package/dist/schema-cli/shared.js +4 -2
- package/dist/schema-cli/validate-command.js +43 -28
- package/dist/search/meilisearch-adapter.js +14 -9
- package/dist/search/reindex-entity.d.ts +2 -0
- package/dist/search/reindex-entity.js +32 -4
- package/dist/search/reindex-tenants-search.js +20 -4
- package/dist/time/tz-context.js +1 -1
- package/dist/ui-types/card-column-roles.d.ts +4 -0
- package/dist/ui-types/card-column-roles.js +6 -3
- package/dist/ui-types/index.d.ts +2 -2
- package/dist/ui-types/index.js +1 -1
- package/dist/utils/ids.js +0 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/return-path-limit.d.ts +1 -0
- package/dist/utils/return-path-limit.js +1 -0
- package/package.json +5 -3
- package/presets/biome-app.json +39 -21
- package/presets/biome-plugins/admin-api.grit +10 -0
- package/presets/biome-plugins/error-reasons.grit +53 -0
- package/presets/biome-plugins/es-literal-writes-tests.grit +18 -0
- package/presets/biome-plugins/es-literal-writes.grit +22 -0
- package/presets/biome-plugins/i18n-locale-terminology-de.grit +15 -0
- package/presets/biome-plugins/i18n-locale-terminology-romance.grit +10 -0
- package/presets/biome-plugins/no-create-test-dispatcher.grit +5 -0
- package/presets/biome-plugins/no-css-properties-type.grit +7 -0
- package/presets/biome-plugins/no-date-api.grit +9 -0
- package/presets/biome-plugins/no-direct-fetch.grit +16 -0
- package/presets/biome-plugins/no-direct-fs.grit +16 -0
- package/presets/biome-plugins/no-external-font-cdn-css.grit +9 -0
- package/presets/biome-plugins/no-external-font-cdn.grit +12 -0
- package/presets/biome-plugins/no-raw-hooks.grit +10 -0
- package/presets/biome-plugins/no-same-folder-barrel-import.grit +11 -0
- package/presets/biome-plugins/no-screen-container-classes.grit +7 -0
- package/presets/biome-plugins/no-skipped-or-retried-tests.grit +34 -0
- package/presets/biome-plugins/no-temporal-polyfill-require.grit +10 -0
- package/presets/biome-plugins/raw-html-in-web.grit +40 -0
- package/presets/biome-plugins/raw-ui-in-app.grit +142 -0
- package/presets/biome-plugins/restricted-event-store-symbols.grit +18 -0
- package/presets/biome-plugins/test-title.grit +20 -0
- package/presets/biome-plugins/unsafe-json-parse.grit +6 -0
- package/presets/biome-rules.json +465 -0
- package/src/changes.json +309 -0
- package/dist/engine/minor-units.d.ts +0 -2
- package/dist/engine/minor-units.js +0 -8
package/src/changes.json
CHANGED
|
@@ -1,4 +1,313 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "0.414.0",
|
|
4
|
+
"type": "fix",
|
|
5
|
+
"title": "kumiko CLI commands keep the whole output of the processes they start",
|
|
6
|
+
"detail": "`run` and `runStreaming` in `bin/commands/_spawn.ts` settled on the child's `exit` event, which can fire before stdout and stderr are drained. Under load `kumiko status` then read an empty `git status` as a clean tree, and streamed commands such as `kumiko check` and `kumiko test` could drop their last lines. Both now settle on `close`; the timeout and SIGKILL handling is unchanged."
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"version": "0.414.0",
|
|
10
|
+
"type": "fix",
|
|
11
|
+
"title": "Agent tool calls can read global entities",
|
|
12
|
+
"detail": "The generated list and detail query of a system-scoped feature that serves an entity with tenancy `global` (a catalog or lookup table) was refused inside an agent tool call with `agent.tool_not_allowed`. Such a read now runs with the caller's tenant scope; the system-scope default rate limit still applies. This only holds for the entity convention handlers without an `escapeHatch`; hand-written queries, queries with an `escapeHatch` (e.g. `systemIdentity`), other entities and every write handler are still refused for agents."
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"version": "0.414.0",
|
|
16
|
+
"type": "breaking",
|
|
17
|
+
"title": "Biome preset biome-rules with GritQL plugins",
|
|
18
|
+
"detail": "`@cosmicdrift/kumiko-framework/biome-rules` bundles the linter rules and the GritQL plugins that replace the deleted guards, plus the new builtins noNestedComponentDefinitions, noMisusedPromises, useExhaustiveSwitchCases and noTsIgnore. `biome-app` now extends it. Suppress a plugin finding with `biome-ignore lint/plugin: <reason>`. `test-title` and the raw interactive element rule (`a`, `details`, `summary` in `raw-ui-in-app`) only warn, in the framework too, because the replaced guards only warned in repos without a baseline; every other plugin rule is an error. The screen container rule (`mx-auto` + `max-w-*`) is its own plugin `no-screen-container-classes` and does not apply under `public/`. `biome lint` takes about 3.2x as long with the plugins (every regex sits behind a cheap prefilter). The server-side plugins also scan `bin/` and `scripts/`. noImportCycles stays off (253 findings in the framework repo). noRestrictedImports flags type imports of temporal-polyfill too (the old guard allowed them); use `@cosmicdrift/kumiko-types/temporal`. The scaffold main.ts starts with `biome-ignore-all lint/style/noProcessEnv`, since it wires KMS from the environment before runProdApp parses the env contract.",
|
|
19
|
+
"migration": "Apps on `biome-app` get the preset automatically; fix new findings or suppress them with a reason. Repos with their own biome.json add `\"extends\": [\"@cosmicdrift/kumiko-framework/biome-rules\"]`."
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"version": "0.414.0",
|
|
23
|
+
"type": "fix",
|
|
24
|
+
"title": "systemScope queries under queryAsMember get a read-only systemDb",
|
|
25
|
+
"detail": "Since the member-resolution hardening, `applyMemberResolutionReadOnly` removed `ctx.systemDb`, so every `r.systemScope()` query reached via `ctx.dispatch.queryAsMember` failed (for example `user:me`). A resolved member principal now gets `createSystemDbView` instead: `acknowledgeCrossTenant` reads run in the READ ONLY transaction, `unsafeRaw` follows the `memberReadOnly` denial, and `outsideTransaction` has no source and throws. `crossTenantReads` and `db.outsideTransaction` stay removed. All other principals are unchanged."
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"version": "0.414.0",
|
|
29
|
+
"type": "fix",
|
|
30
|
+
"title": "parent-ref gate resolves global hosts in the system scope",
|
|
31
|
+
"detail": "The parent-ref gate checks a join row's host with an `EXISTS` inside the join table's statement, which runs in the caller's tenant scope. A `tenancy: \"global\"` host lives on the system tenant and its table is not `systemRowsReadable`, so since the narrowed `kumiko_system_tenant_read` the `EXISTS` found no row: `add-note` passed (the host executor reads a global table in the system scope), but the note list returned nothing, so the helpdesk detail never showed an internal note written from an operator's own tenant. The list, detail and row-readable checks of the event-store executor now resolve global hosts ahead of the statement: one system-scope statement runs the same host check (host tenant, soft delete, the host's `access.read`) for the caller's own join rows only, filtered explicitly to the session tenant and narrowed to the requested row or the host ids a list filter pins, and returns host ids. The gated statement keeps its tenant scope and row level security and matches those ids (`ParentVisibilityOption.globalHostIds`). Paths without that step (reference search and sort, eager loading, derived related fields, readGate links) leave the global host arm out, so they deny instead of widening."
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"version": "0.414.0",
|
|
35
|
+
"type": "fix",
|
|
36
|
+
"title": "reference-data RLS, search hold, scrub coverage, export paging, webhook strictness",
|
|
37
|
+
"detail": "Entities of a feature with `referenceData` now carry `systemRowsReadable` on the push path as well as the migration path, so `kumiko_system_tenant_read` applies to them (migration 0065 in `use-all-bundled` is regenerated). A search consumer batch that fails an update keeps the later delete of the same event batch held instead of dropping it. `scrubEventPayloadFields` rejects personal lifecycle fields it cannot scrub and replaces date, timestamp and reference values with a type-matching sentinel. Export paging skips rows that a shifting offset returns twice. The webhook payload strictness check descends into record, map, set, tuple, intersection and lazy schemas without looping on recursive ones."
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"version": "0.414.0",
|
|
41
|
+
"type": "fix",
|
|
42
|
+
"title": "consistent schema command names in validate output",
|
|
43
|
+
"detail": "`kumiko-schema validate` suggests `bun kumiko-schema generate <name>` like the drift report does; internal comments on the production path name `bun /app/kumiko.js schema apply`."
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"version": "0.414.0",
|
|
47
|
+
"type": "fix",
|
|
48
|
+
"title": "JobContext drops the unused _tenantId, ANONYMOUS_ROLE has one definition",
|
|
49
|
+
"detail": "The job runner never set `JobContext._tenantId`, so the `ctx.systemUser.tenantId ?? ctx._tenantId` fallbacks in the retention, soft-delete, workflow-resume and tenant-inactivity jobs were dead; they read `ctx.systemUser.tenantId` now and the field is gone from the type. `ANONYMOUS_ROLE` lives in `@cosmicdrift/kumiko-types` (the UI access predicates used a second copy) and the framework re-exports it. `JobContext.triggerName` is documented as the QN the `on` entry matched, a write/query-handler QN or an event QN."
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"version": "0.414.0",
|
|
53
|
+
"type": "breaking",
|
|
54
|
+
"title": "Review fixes in document-ingest, documents, feature-toggles, auth-mfa and auth-email-password",
|
|
55
|
+
"detail": "appendMissingDocumentExtractEvent returns already-terminal when a concurrent catch-up run wins the append and treats any non-null meta.error as a failure. The documents feature builds hook targets, live entities and the link-list and delete-handler names from its entity constants. createRedisToggleSyncSignal takes the channel prefix and subscribe pattern as one RedisNamespace-shaped argument so they cannot diverge. A test ties TENANT_KEEP_ACCOUNT_ROLES to the account-close roles. Static invite accept returns an unexpected-response failure unless the server answered with an MFA gate. The MFA verify screen reuses MfaCodeOrRecoveryField, trims pasted recovery codes and the preauth setup screen focuses the code field once the recovery codes are acknowledged. Both forgot-password and signup screens share resolveReturnTo. Price env validation uses startsWith instead of an unescaped regex. AppendMissingExtractEventDeps drops the redundant tenantId and relies on tenantDb.tenantId. The framework exports MAX_RETURN_PATH_LENGTH from utils as the single source for the returnTo limit, used by the auth routes and re-exported by the auth-email-password return-path module. Deleting a since-undeclared secret key under a mounted feature prefix works for SystemAdmin and stays unknown-key for tenant admins.",
|
|
56
|
+
"migration": "Callers of `createRedisToggleSyncSignal` that passed the channel prefix and subscribe pattern as third and fourth argument pass `{ channelPrefix, channelSubscribePattern }` as third argument instead. Callers of `appendMissingDocumentExtractEvent` stop passing `tenantId` in the deps."
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"version": "0.414.0",
|
|
60
|
+
"type": "fix",
|
|
61
|
+
"title": "Share duplicated helpers between bundled features",
|
|
62
|
+
"detail": "Behaviour is unchanged. The user-data bridge features, hard-delete user-data hooks, bootstrap-extension lookups, preference (un)subscribe handlers, tenant cross-tenant db lookups, string-value picking in the template resolver and the idempotent meta-table bootstrap (pushTableIfMissing) each use one shared helper instead of copies."
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"version": "0.414.0",
|
|
66
|
+
"type": "fix",
|
|
67
|
+
"title": "review round 2 engine fixes (wire names, export rate limit, isolated e2e, mail logo, relative links, api-docs, documents)",
|
|
68
|
+
"detail": "Two unreleased webhook events with the same default wire name no longer fail boot; `personal-access-tokens/released-wire-name-collision` rejects it only when both are released through PAT scopes. `createExportRoutes` takes an optional rate limit resolver (60 per minute per user). `isolatedSpecs` builds one serial twin per project with its own `use`, and rejects projects with their own `testMatch`. The unsubscribe page chrome inlines the uploaded branding logo as a raster data URI. Mail and PDF template bodies with a relative link are rejected on save (`relative_link_without_base`); snippets and managed pages keep them. api-docs reports `titleTranslationMissing` and `fieldLabelMissing` per non-en locale (field labels only when another locale has one). `documents:write:filed-document:create` defaults to the admin roles when no `access` option is given."
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"version": "0.414.0",
|
|
72
|
+
"type": "breaking",
|
|
73
|
+
"title": "Remove dead allowPerRequest config key option",
|
|
74
|
+
"detail": "Since resolveConfigOrParam is gone nothing reads `allowPerRequest`, yet the type, the create*Config options and three boot rules (config-key/per-request-text, config-key/per-request-encrypted, config-key/options-query-per-request) still guarded it, suggesting per-request overrides that never happen. The option and the rules are removed; passing `allowPerRequest` is now a type error.",
|
|
75
|
+
"migration": "Remove `allowPerRequest` from config key definitions (create*Config options); it had no runtime effect."
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"version": "0.414.0",
|
|
79
|
+
"type": "fix",
|
|
80
|
+
"title": "db layer review fixes (migration RLS ordering, sortNulls rule, derived money)",
|
|
81
|
+
"detail": "A generated migration now drops the previous row level security policies before an in-place `tenant_id` type change or drop, so Postgres no longer rejects the ALTER with a policy dependency (new section \"Row level security (pre)\"). The boot validator rejects `sortNulls` on a field without `sortable: true` (rule `entity/sort-nulls-needs-sortable`). A money derived field reads amount and currency in one jsonb_build_array subquery instead of two correlated subqueries per row. The unknown-field-type error names the type, reference sorts reuse the cached target table of the search path, `extractTableInfo` takes `unknown` (no more query.ts import cycle), and stale comments and a hand-rolled IN placeholder loop are fixed."
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"version": "0.414.0",
|
|
85
|
+
"type": "fix",
|
|
86
|
+
"title": "db, crypto and ingest-progress review fixes",
|
|
87
|
+
"detail": "A failing `pg_advisory_lock` call now still resets `statement_timeout` before the reserved connection returns to the pool. The migration replay recognizes `CREATE TABLE \"x\"AS SELECT ...` without whitespace after a closing quote. A wrong-sized DEK from the key store raises `EncryptionUnavailableError` instead of `PiiCiphertextCorruptError`, so scrub and export no longer treat intact values as corrupt. Update and delete check row readability before loading and decrypting the row. Aggregate-type removal looks up its auxiliary tables unqualified (search_path) instead of in `public`. The shared `SYSTEM_ROW_LEVEL_SECURITY_SCOPE` constant is gone; dispatch and the migrate runner name their own reason, and the `[fixed-system-scope]` guard rule is removed. `reportIngestProgress` appends and projects in one transaction and retries on a stream version conflict. Forget now has tests for the `access.read` check and the system-user exemption."
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"version": "0.414.0",
|
|
91
|
+
"type": "fix",
|
|
92
|
+
"title": "boot validator and schema CLI report crashes, unknown screen types and drift correctly",
|
|
93
|
+
"detail": "A runtime crash (TypeError and the like) inside `r.bootCheck` now surfaces as itself instead of a `boot-check/failed` finding, and a nested `BootValidationError` keeps its own violations. An unknown screen `type` is reported as such before the nav check can mask it. entityList rowActions share the list-action target validation, so navigate resolution lives in one place. Column `width` and `minWidth` above `LIST_COLUMN_MAX_WIDTH_PX` (2000, now in kumiko-types and shared with the renderer clamp) are rejected at boot. SQL derived fields reject `bigInt` fields, which a number valueType would round above 2^53. `kumiko-schema validate --json` adds a top-level `ok` plus `schemaDrift`, `migrations` and `rowLevelSecurity` results next to `boot`, and flags `boot.importAborted` when a runtime crash stopped the schema.ts import after violations were collected (human output warns too). The definition collector treats a crash as a follow-up only when the same feature already has a violation. `findEntity` ignores Object.prototype member names. `toEntityWebhookPayload` throws on a contract without a verb and covers all three verbs. `WEBHOOK_ENTITY_VERBS` is exported. The personal-access-token scope check names the actual reason (no opt-in, unknown entity, internal event) in its error."
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"version": "0.414.0",
|
|
97
|
+
"type": "fix",
|
|
98
|
+
"title": "Tighter tests; search/meilisearch needs meilisearch ^0.62.0",
|
|
99
|
+
"detail": "Tests only, no runtime change. The tests now assert the Postgres unique-violation and constraint name, run the custom projection on the pool path in the success case, check the schema command hints of the RLS boot check, cover sortNulls first and sortNulls on reference fields, cover the two fail-closed read-model conditions of readGate.fileOwner separately, and put purpose and addedAt into the sub-processor snapshot. As recorded for the Renovate bump, the optional peer dependency of search/meilisearch is meilisearch ^0.62.0 (was ^0.58.0); consumers on 0.58 fail the peer check."
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"version": "0.414.0",
|
|
103
|
+
"type": "fix",
|
|
104
|
+
"title": "pipeline review fixes (savepoint scope, member-read services, batch hooks, file splits)",
|
|
105
|
+
"detail": "A savepoint opened by a background task after its parent savepoint ended now queues on the transaction's root chain instead of the stale nested chain, so it can no longer overlap sibling savepoints (3B001). Queries running as a resolved member principal lose kms, masterKeyProvider and the escape-hatch audit sink, and secrets only allows get and has. Dispatcher batches skip building the batch-hook context when no postSaveBatch/postDeleteBatch hook is registered (new LifecycleHooks.hasBatchHooks). Invalid-datetime errors mapped to a 400 now leave a warn log. The Bun.SQL connection error codes are shared between the event dispatcher and wait-for-database. dispatch-write, handler-context-events, job-runner-context and server-routes were split into single-purpose files without behavior change."
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"version": "0.414.0",
|
|
109
|
+
"type": "fix",
|
|
110
|
+
"title": "pipeline, event-payload-scrub and job-runner review fixes",
|
|
111
|
+
"detail": "Projection rebuild only names the boot backfill as the expected column-drift cause when the sample covers every drifted row and is not empty. A batch consumer at the pending-gap limit no longer burns attempts on passes where all held events only wait out a backoff (`holdForRetry` takes an optional `{ stillBackingOff }`), and `lastError` carries the reason of the event `lastFailedEventId` points at. `scrubEventPayloadFields` logs real runs at info with migration id, reason and totals and documents that it belongs in a maintenance window. Job runner: the perTenant fan-out and the unknown-job path count attempts like every other pre-run path (`_priorAttempts`, `retryable`), a throwing `onJobFailed` hook no longer replaces the original pre-run error, `parseRedisOpts` strips IPv6 brackets and tolerates a credential with a stray percent sign, and one `isQueuedRun` predicate backs `ctx.defer`, `ctx.canDefer` and both defer paths. Tests added for the rate-limit cost floor and rounding, the scrub pagination, snapshot, non-lifecycle, corrupt-ciphertext and failed-rebuild paths."
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"version": "0.414.0",
|
|
115
|
+
"type": "fix",
|
|
116
|
+
"title": "Boot-rule table test helper, env field rules",
|
|
117
|
+
"detail": "@cosmicdrift/kumiko-framework/internal/testing exports bootRuleTableViolations for boot rule table tests (it returns the violations). An env field can carry a rule through .meta({ kumiko: { envRule } }) that sees the whole env being booted; parseEnv and the boot dry run apply it."
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"version": "0.414.0",
|
|
121
|
+
"type": "fix",
|
|
122
|
+
"title": "named filter id lists bind as one array parameter",
|
|
123
|
+
"detail": "A list filter with `op: \"in\"` on a plain column bound one placeholder per value, so an id list from an async named-filter resolver failed beyond 65535 values and bloated the SQL text. It now binds one typed array parameter (`col = ANY($n::type[])`). `MINOR_UNIT_SCALE`, `toMinorUnits` and `toMajorUnits` moved to `@cosmicdrift/kumiko-types/minor-units`; the renderer's range facets and money measures use them instead of their own `100`. Comments that pointed at deleted names (`OVERRIDABLE_PROFILE_KEYS`, `buildErrorLog`, `SelectQuery`) are corrected. `kumiko status` exits non-zero when `git status` fails, and the CI puppeteer cache key step fails on a version that is not pinned exactly."
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"version": "0.414.0",
|
|
127
|
+
"type": "fix",
|
|
128
|
+
"title": "dev-server watcher, reload and boot cleanup; feature-ast codemod coverage",
|
|
129
|
+
"detail": "The dev-server file watcher takes its restart baseline from a probe file's mtime instead of Date.now(), so coarse or skewed filesystem clocks no longer swallow real schema edits. A cancelled /_reload stream removes its own client from the hub. A failed createKumikoServer boot kills the Tailwind --watch child it already started. The feature-ast-package codemod reports `export *`, element-access and destructuring reads of the old engine namespace, and dynamic import or import-type of the old module as manual sites, and skips the source walk for packages that already declare feature-ast. The ctx-namespaces codemod reports a structural context type that other parameters, mocks or references also use instead of rewriting it half way, and caches the per-parameter analysis. collectSourceFiles keeps honouring .gitignore per file when a submodule path makes the batch `git check-ignore` fail. The probe file sits in the watched directory, and a failed dev-server boot after the stop function exists tears the server down through it."
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"version": "0.414.0",
|
|
133
|
+
"type": "breaking",
|
|
134
|
+
"title": "anonymous uploads are capped, rate limited and answer sign_in_required",
|
|
135
|
+
"detail": "An anonymous POST /files is limited to the largest opted-in `anonymousUpload` field (not the largest field of the app) and to 20 uploads per minute and client IP (bucket `files-upload-anon:<ip>`, 429 with Retry-After). A visitor who never had a session now gets 401 with code `sign_in_required`; `unauthenticated` (which shows the \"session ended\" banner) is kept for a visitor whose session cookie went stale. `FileRoutesOptions.metaBatchRateLimitResolver` is renamed to `rateLimitResolver` and gains a sibling `clientIpResolver`. `withUploadLedger` returns a new resolver instead of mutating the one passed in. The stale pending-upload sweep only reads uploads that name a target field. `rebindFileRef` answers \"not-found\" (instead of \"moved\" or \"rebound\", or an AccessDeniedError) for a file the caller may not read. `ctx.events.load` accepts `includeArchived`, which the documents import uses to recognise an archived document stream.",
|
|
136
|
+
"migration": "Apps calling createFileRoutes themselves rename `metaBatchRateLimitResolver` to `rateLimitResolver` and pass `clientIpResolver`. Clients that matched a 401 `unauthenticated` from anonymous uploads treat `sign_in_required` as a plain upload error. Callers of rebindFileRef that expected AccessDeniedError for an unreadable file handle \"not-found\"."
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"version": "0.414.0",
|
|
140
|
+
"type": "breaking",
|
|
141
|
+
"title": "Db and types review fixes",
|
|
142
|
+
"detail": "Eagerload of a reference to an entity with row-level read rules runs one SELECT with the access clause instead of a probe query followed by a lookup, so unreadable rows are never loaded. The rebuild guard now also compares the USING and WITH CHECK expressions of kumiko_tenant_isolation with the framework policy (deparsed the same way on a throwaway table) and refuses the rebuild when they differ. Statements on an enforced transaction handle send set_config and the statement back to back instead of waiting for the scope first. The search reindex fingerprint hashes the source of each search payload extension instead of only counting them, so changed extension code reindexes. physicalColumnName takes a SchemaTable (new guard isSchemaTable exported from the db barrel); the inbound-mail ownership rule narrows its context table with it. SensitiveFilterConfig loses redactedHeaders and redactedQueryParams, which nothing read. A group header text that still contains the removed {lastDate} placeholder renders without it and warns once per key. Eagerload of a reference to an entity with row-level read rules now runs the rows through the normal row coercion (camelCase keys, no blind-index columns) before decrypting. A plain statement issued inside a running unit queues behind sibling units pending in that unit's chain instead of landing in the open savepoint. The PII backfill treats a newer event that sets a field to null as a newer value, so the older owner's ciphertext is no longer re-keyed onto the new owner. `reindexEntity` takes `onlyEntityId` to reindex a single row. `isUnchangedValue` (key-order-stable comparison) is exported from the engine barrel. `seedRow` and `seedRows` now also refuse an event-sourced entity when handed its table meta instead of the table. POST /files answers an anonymous caller with 401, not 413, when no field allows anonymous upload.",
|
|
143
|
+
"migration": "Remove redactedHeaders and redactedQueryParams from any sensitiveFilter option and from DEFAULT_SENSITIVE_CONFIG overrides. Pass a SchemaTable (or narrow with isSchemaTable) to physicalColumnName instead of an unknown value. Replace {lastDate} in table.grouping label texts with a max measure in table.totals."
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"version": "0.414.0",
|
|
147
|
+
"type": "fix",
|
|
148
|
+
"title": "workflow wait, waitForEvent and retry compute their wake time from the database clock",
|
|
149
|
+
"detail": "`r.step.wait`, `r.step.waitForEvent` and `r.step.retry` took the wake time from the app clock while the resume scan compares it with Postgres `now()`, so a job host running ahead woke retries and waits late and one running behind fired `waitForEvent` timeouts early. The steps now read the database clock, in the trigger projection and in `resume-run` alike. `queryDatabaseNow` is exported from `@cosmicdrift/kumiko-framework/db` for that."
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"version": "0.414.0",
|
|
153
|
+
"type": "fix",
|
|
154
|
+
"title": "an explicit Meilisearch configure() is no longer widened by a later default",
|
|
155
|
+
"detail": "`configure()` now leaves an `_explicitConfig` marker in the index's filterable attributes. Before, an explicit configuration narrowed to a subset of the registry default could not be told apart from an older default and was widened again after the next restart. Indexes configured explicitly before this change carry no marker and keep the old behavior."
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"version": "0.414.0",
|
|
159
|
+
"type": "fix",
|
|
160
|
+
"title": "maxPerTenant skip cap holds under concurrent dispatch",
|
|
161
|
+
"detail": "`dispatch` and `handleEvent` for a job with `maxPerTenant` and `onLimit: \"skip\"` now hold a short Redis lock per job and tenant across the count and the enqueue, so simultaneous dispatches from api and worker processes can no longer all pass at `limit - 1`. A lock that stays contended for three seconds degrades to the earlier soft cap with a warning."
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"version": "0.414.0",
|
|
165
|
+
"type": "fix",
|
|
166
|
+
"title": "server wiring and middleware split into smaller files; event payload scrub documents its maintenance window",
|
|
167
|
+
"detail": "Rate-limit wiring and the PAT rate-limit guard moved out of `server-wiring.ts` and `server-middleware.ts` without behavior change. `scrubEventPayloadFields` must run in a maintenance window, because batches page by id over committed rows and an event that commits below the cursor during the run is not scrubbed."
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"version": "0.414.0",
|
|
171
|
+
"type": "breaking",
|
|
172
|
+
"title": "access.authenticated is renamed to access.builtinUserRoles",
|
|
173
|
+
"detail": "The preset only lists the built-in roles User, Admin and SystemAdmin, so a member who holds only an app-defined role was refused although signed in. The new name says what it covers; for \"any signed-in user\" use `anySignedIn: true` or `openToAll`.",
|
|
174
|
+
"migration": "Replace `access.authenticated` by `access.builtinUserRoles`; where every signed-in user must pass, use `anySignedIn: true` instead."
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
"version": "0.414.0",
|
|
178
|
+
"type": "fix",
|
|
179
|
+
"title": "file providers throw FileObjectMissingError for a missing object; header scrub for stored events",
|
|
180
|
+
"detail": "The in-memory, local and S3 file providers throw `FileObjectMissingError` (exported from `@cosmicdrift/kumiko-framework/files`) when the stored object is gone. New operator helper `scrubEventHeaderKeys` removes chosen keys (for example `rawPayload`) from the headers of stored events of given types, with a reason and a dry run; it is not run automatically."
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"version": "0.414.0",
|
|
184
|
+
"type": "breaking",
|
|
185
|
+
"title": "pool statements without a tenant scope run in an empty scope; seedRow refuses event-sourced entity tables; read_ tables are not writable from plain runners",
|
|
186
|
+
"detail": "On an RLS-enforced pool every statement now runs in a short scoped transaction, also when no scope is active (empty GUCs, so RLS policies match nothing); before, a scope-free statement went straight to the connection and could meet a connection polluted by an earlier scope. Non-transactional DDL (CREATE INDEX CONCURRENTLY, CREATE/DROP DATABASE) and session-level statements must be wrapped in `outsideRowLevelSecurityScope`. `table(\"read_...\")` from the db dialect now returns a plain `SchemaTable` without the `Writable` brand, so writing a projection table through a plain runner is a compile error; projection applies and `withExecutorManagedWrites` runners are unaffected. The testing helpers `seedRow` and `seedRows` throw for tables built by `buildEntityTable` or `r.entity`, because the projection row would exist without its event.",
|
|
187
|
+
"migration": "Wrap non-transactional DDL and session-state statements on a pool in `outsideRowLevelSecurityScope(() => ...)`. Replace `seedRow(db, entityTable, ...)` by `seedRowViaEventStore`, or pass `{ projectionOnly: \"<reason>\" }` as fourth argument for a deliberate event-less row. For a `read_*` table written outside a projection, wrap the runner in `withExecutorManagedWrites`."
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"version": "0.414.0",
|
|
191
|
+
"type": "fix",
|
|
192
|
+
"title": "PII backfill moves only the latest copy of a field to a changed owner; nested echoed events are stripped from write responses",
|
|
193
|
+
"detail": "The backfill rekey stage no longer re-keys older, superseded copies of a user-keyed field to the new owner when a newer event already carries the field, so forgetting the previous owner still erases the old value. The dispatcher also strips the echoed `event` from executor results that a handler nests in its own response data, not only from the top-level result."
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"version": "0.414.0",
|
|
197
|
+
"type": "fix",
|
|
198
|
+
"title": "plain statements wait for open savepoints; jsonb default changes rebuild the projection; trash list with search is rejected",
|
|
199
|
+
"detail": "A statement issued through the query helpers on a transaction now queues behind pending savepoints instead of racing them and failing with an aborted transaction after a savepoint rollback. A changed jsonb column default on a managed projection table now writes a rebuild marker, so existing rows get the new empty value. A list with `onlyDeleted` and a search term returns a validation error, because soft-deleted rows are not in the search index and the list would always be empty."
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
"version": "0.414.0",
|
|
203
|
+
"type": "fix",
|
|
204
|
+
"title": "authoritative tenant resolver ignores a disagreeing kumiko_tenant cookie",
|
|
205
|
+
"detail": "With `resolverTrust: \"authoritative\"`, only an `X-Tenant` header that disagrees with the resolver answers 400 tenant_mismatch. A `kumiko_tenant` cookie is ambient state, possibly apex-scoped and left over from another tenant's subdomain, so a disagreeing cookie is ignored and the resolver's tenant wins; before, such a visitor was locked out of every other tenant subdomain."
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
"version": "0.414.0",
|
|
209
|
+
"type": "fix",
|
|
210
|
+
"title": "insertMany takes the column list from all rows",
|
|
211
|
+
"detail": "`insertMany` built its column list from the first row only, so a field set by a later row (for example `isDeleted: true` through `seedRows`) was silently dropped or written as NULL. The column list is now the union over all rows; a row that omits a column gets DEFAULT, like a single `insertOne` without that key."
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
"version": "0.414.0",
|
|
215
|
+
"type": "fix",
|
|
216
|
+
"title": "schema-cli validate and scaffold check tests run without DATABASE_URL",
|
|
217
|
+
"detail": "`schema validate` checks the live row-level security state whenever DATABASE_URL is set. The validate-boot-options tests and the scaffolded `kumiko check boot` test inherited the host value and hit the shared local dev database, so they failed locally on its old policies while CI stayed green. They now run without DATABASE_URL, which makes local and CI runs equal."
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
"version": "0.414.0",
|
|
221
|
+
"type": "fix",
|
|
222
|
+
"title": "upgrade path test for the stale kumiko_system_tenant_read policy",
|
|
223
|
+
"detail": "A new integration test applies a table marked `systemRowsReadable`, regenerates the schema without the marker, and checks that the migration drops `kumiko_system_tenant_read` and that `schema apply` removes the policy from `pg_policies` while the isolation policy stays."
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
"version": "0.414.0",
|
|
227
|
+
"type": "improvement",
|
|
228
|
+
"title": "scrubEventPayloadFields needs a maintenance window",
|
|
229
|
+
"detail": "The JSDoc of `scrubEventPayloadFields` now states that it pages by bigserial id and that ids are handed out before commit, so an event appended in parallel with a lower id than the current cursor can be skipped. Run it in a maintenance window without running writes on the affected event types, or repeat the scrub afterwards; the header scrub (`scrubEventHeaderKeys`) is not affected because it is one statement."
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
"version": "0.414.0",
|
|
233
|
+
"type": "improvement",
|
|
234
|
+
"title": "requiredEnvFor takes an optional hint and replaces the test stack's copies",
|
|
235
|
+
"detail": "`requiredEnvFor(label, env, hint?)` appends the hint to the missing-variable error. The test stack (`TEST_DATABASE_URL`, `REDIS_URL`) and the S3 integration test use it instead of private `requireEnv` copies and keep their `.env.example` / `docker compose up -d` advice. server-runtime's `requireEnv` stays: its advice depends on the boot context."
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
"version": "0.414.0",
|
|
239
|
+
"type": "breaking",
|
|
240
|
+
"title": "Boot fails when the booted features declare tables the generated schema lacks",
|
|
241
|
+
"detail": "`detectKumikoDrift` / `assertKumikoSchemaCurrent` take the booted features and check, once a `.snapshot.json` exists, that every table from `collectTableMetas` of those features is in it. The schema tooling (`kumiko-schema.ts`) and the boot decide `includeBundled` separately, so a differing `kumiko.config.ts` previously left tables out of the generated schema without a message. The report has the new part `tablesMissingFromSnapshot`; `runProdApp` and the worker boot pass their features. A booted table that is not in the snapshot is drift, there is no exception list.",
|
|
242
|
+
"migration": "Run `kumiko schema generate` (check `includeBundled` and the feature list in `kumiko.config.ts` against what the app boots) and ship the migration. Code that builds a `KumikoDriftReport` by hand needs the new field `tablesMissingFromSnapshot`."
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
"version": "0.414.0",
|
|
246
|
+
"type": "improvement",
|
|
247
|
+
"title": "Generated column drops come with a commented not-empty guard",
|
|
248
|
+
"detail": "For a column that disappears from an in-place table, `schema generate` emits a commented `DO $$ ... RAISE EXCEPTION '<table>.<column> is not empty' ... $$;` line directly before the commented `DROP COLUMN`. Uncommenting both aborts the migration while the column still holds values and drops it once it is empty."
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
"version": "0.414.0",
|
|
252
|
+
"type": "improvement",
|
|
253
|
+
"title": "Jobs read event streams with ctx.events.load",
|
|
254
|
+
"detail": "`JobContext.events` gains `load(aggregateId, options?)` with the handler semantics (`asOf`, `atVersion`, `includeArchived`): scoped to the tenant of the job, payloads pass the upcaster chain. It shares its implementation with the handler `ctx.events.load`. Jobs no longer need a raw `selectMany` on `eventsTable` to read a stream."
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
"version": "0.414.0",
|
|
258
|
+
"type": "improvement",
|
|
259
|
+
"title": "outsideRowLevelSecurityScope is exported from the db barrel",
|
|
260
|
+
"detail": "`outsideRowLevelSecurityScope(fn)` runs non-transactional DDL (`CREATE INDEX CONCURRENTLY`) and session-level statements on a pool with row-level security enforced, where every statement otherwise runs in its own transaction. It sits next to `assertNoActiveRowLevelSecurityScope` in `@cosmicdrift/kumiko-framework/db`, so the migration advice from the R3 note can be followed without a deep import."
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
"version": "0.414.0",
|
|
264
|
+
"type": "fix",
|
|
265
|
+
"title": "agent tool calls lose unsafeRaw, globalWrites and system-scope handlers",
|
|
266
|
+
"detail": "Only `crossTenantReads` was withheld in the agent tool call scope, so a tool handler declaring `unsafeRaw` or `globalWrites` could still run raw or global SQL against the LLM context, and a `r.systemScope()` handler got the cross-tenant system db. `buildTenantScopedDb` now drops both grants in that scope, and resolving the handler context for a system-scope handler throws `access_denied` (reason `agent.tool_not_allowed`) while the scope is marked."
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
"version": "0.414.0",
|
|
270
|
+
"type": "fix",
|
|
271
|
+
"title": "list aggregates no longer bypass postQuery hooks and read filtering by shape",
|
|
272
|
+
"detail": "The dispatcher treated any `{ groups: [...] }` result as an aggregate and skipped postQuery hooks and `filterReadFields`. Aggregates are now recognised by a brand set in `answerListAggregate` (`isAnsweredListAggregate`), so a hand-written handler returning that shape runs through the hooks again. An aggregate query on an entity with handler or entity postQuery hooks fails with `access_denied` (`field_access_denied` reason), because the counts would include rows a hook hides."
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"version": "0.414.0",
|
|
276
|
+
"type": "fix",
|
|
277
|
+
"title": "boot guard covers update, delete and restore handlers of parentRef entities",
|
|
278
|
+
"detail": "The `parentRefHandWrittenQuery` guard only checked list and detail, so a hand-written write handler on a join-row entity could change rows whose host the caller cannot see. `defineEntityWriteHandler` now sets `ENTITY_CONVENTION_WRITE_BRAND` (kept through `r.writeHandler`), and the new rule `parent-ref/hand-written-write-handler` fails boot for an unbranded `update`, `delete` or `restore` handler on such an entity."
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
"version": "0.414.0",
|
|
282
|
+
"type": "fix",
|
|
283
|
+
"title": "derived values no longer follow liveEntities mentions",
|
|
284
|
+
"detail": "`derivedSql.canReadEntity` used `collectEntityReadAccess`, which also counts handlers that list an entity in `liveEntities`. Such a handler returns signals, not rows, so a role holding only that handler could read counts and first values over the entity. The check now uses the new `collectEntityQueryAccess`, which only counts query handlers whose own entity is the one asked about; live signals keep `collectEntityReadAccess`."
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
"version": "0.414.0",
|
|
288
|
+
"type": "fix",
|
|
289
|
+
"title": "review fixes for where operators, events prune, ES ops table, read-model access boot check and search reindex",
|
|
290
|
+
"detail": "An operator object whose operands are all undefined (`{ id: { in: undefined } }`) or a non-array `in`/`notIn` now throws instead of dropping the WHERE and turning `deleteMany` into a whole-table delete. `kumiko events prune` compares aggregate types and projection sources kebab-normalised, so `document-extract` matches a `documentExtract` source and is not reported unknown. `createEsOperationsTable` runs its re-check and DDL on a sibling pool, so a lock transaction no longer deadlocks at `DATABASE_POOL_MAX=1`. `validateOwnershipBoot` and `validateOwnershipRules` also validate the `access` of projection read-model entities. Search reindex reconcile removes unchanged rows whose subject key was erased after the batch read."
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
"version": "0.414.0",
|
|
294
|
+
"type": "fix",
|
|
295
|
+
"title": "embedded diff, webhook payload strictness, named filter columns, search tenant isolation",
|
|
296
|
+
"detail": "`isUnchangedValue` compares key-order-stable, so unchanged embedded lists no longer re-trigger `requiredWhen` or sub-field write checks. The nested-write parent ownership check skips embedded sub-field role checks. `defineWebhookEvent` now throws (`webhook-event/payload-open-shape`) for payload objects declared as looseObject, passthrough or catchall, which would let undeclared keys reach receivers. `validateBoot` no longer reports the preSave wiring violation twice. Named list filter conditions may target row-meta columns such as `insertedById`. The search consumer holds a tenant whose event read fails instead of failing the whole batch. The user-scope seed error message names the literal seed form."
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
"version": "0.414.0",
|
|
300
|
+
"type": "fix",
|
|
301
|
+
"title": "review fixes for upload sweep, search reindex, row-level security, payload scrub, schema hints, sub-processors and xlsx export",
|
|
302
|
+
"detail": "`executor.delete` accepts an `expect` precondition like update; the stale pending-upload sweep uses it so an upload bound after the page was read fails the delete instead of being soft-deleted. `reindexEntity` takes an `AbortSignal` and `reindexTenantsSearch` aborts a reindex that timed out. Every enforced transaction sets both row-level-security settings before its first statement, so a session-level `kumiko.scope` left on a pooled connection no longer leaks into scope-free transactions. The boot check at rowLevelSecurity \"on\" also fails when `kumiko_tenant_isolation` is not PERMISSIVE ALL for PUBLIC or a RESTRICTIVE policy exists, the same predicate the rebuild guard uses. `scrubEventPayloadFields` writes null instead of the text sentinel for non-string values, so typed projection columns still rebuild. Schema drift and row-level-security boot errors also name `bun /app/kumiko.js schema` for the production image. The sub-processor list has separate Scaleway Key Manager (active since 2026-07-04) and TEM entries. The xlsx export ends the list on an empty page instead of a short one, and a second export of the same user while one runs answers 429."
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
"version": "0.414.0",
|
|
306
|
+
"type": "breaking",
|
|
307
|
+
"title": "system tenant read policy only on tables marked systemRowsReadable",
|
|
308
|
+
"detail": "Since 0.390.0 users, MFA, API tokens, sessions and tenant secrets live on the system tenant, and `kumiko_system_tenant_read` (tenant_id = system tenant) sat on every table with a tenant_id column, so a tenant session could read them past a missing TenantDb filter. The policy is now a positive classification: `systemRowsReadable: true` on an entity (or `defineUnmanagedTable` input) renders it, entities targeted by `r.referenceData` are classified implicitly, and every other table gets only `kumiko_tenant_isolation`. Marked in the bundled features: `read_config_values`, `read_template_resources`, `read_custom_field_definitions`, `read_pages` (app-wide public pages on the system tenant). Paths that read system rows of an unmarked table use a narrow read path instead of the system scope: the new `systemTenantReadDb(db)` (internal/row-level-security) is a read-only TenantDb on the system tenant, so RLS passes exactly its rows and no other tenant's. `secrets:list` with scope system, `readFileRefContent` (system template files) and the SystemAdmin read of system files in the file routes use it; `secrets.get/has` read platform-wide secrets in the system tenant's own scope. `ctx.dispatch.queryAsMember` reads the stored user profile under the system scope, the reference check of eager-loading runs on the referenced table's scope, and the event-store executor runs its raw reads and writes on a `tenancy: \"global\"` table in the system scope, like the TenantDb's own statements on it. The boot check expects exactly the classified set and reports a system read policy on an unmarked table; `unsafePushTables` and `kumiko-schema apply` drop it from the framework tables (`kumiko_events`, `kumiko_snapshots`, `kumiko_archived_streams`). `KnownTables` has a new required member `readsSystemRows`.",
|
|
309
|
+
"migration": "Apps: bump, then run `bun kumiko-schema generate` and commit the new RLS migration; it drops `kumiko_system_tenant_read` on every table without the marker (credential and PII tables included). Set `systemRowsReadable: true` on an own entity only if tenant sessions read its SYSTEM_TENANT_ID rows (shared templates, defaults, catalogs); a table without it returns no system rows to a tenant session. Code that must read system rows of an unmarked table (credentials, PII) wraps its db in `systemTenantReadDb`. Hand-built `KnownTables` objects passed to the boot check need `readsSystemRows`."
|
|
310
|
+
},
|
|
2
311
|
{
|
|
3
312
|
"version": "0.413.0",
|
|
4
313
|
"type": "improvement",
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
// 2 decimal places (cents) — covers every currently-supported currency
|
|
2
|
-
// (EUR/USD/GBP/...). No ISO-4217 minor-unit table yet (JPY=0, BHD=3) —
|
|
3
|
-
// upgrade path once a currency needing a different scale actually lands.
|
|
4
|
-
// Client-safe on purpose: db/money.ts pulls in engine runtime values.
|
|
5
|
-
export const MINOR_UNIT_SCALE = 100;
|
|
6
|
-
export function toMinorUnits(amount) {
|
|
7
|
-
return Math.round(amount * MINOR_UNIT_SCALE);
|
|
8
|
-
}
|