@cosmicdrift/kumiko-framework 0.280.0 → 0.281.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosmicdrift/kumiko-framework",
3
- "version": "0.280.0",
3
+ "version": "0.281.0",
4
4
  "description": "Framework core — engine, pipeline, API, DB, and every other bit that makes Kumiko go.",
5
5
  "license": "BUSL-1.1",
6
6
  "author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
@@ -198,7 +198,7 @@
198
198
  "./package.json": "./package.json"
199
199
  },
200
200
  "dependencies": {
201
- "@cosmicdrift/kumiko-types": "0.280.0",
201
+ "@cosmicdrift/kumiko-types": "0.281.0",
202
202
  "bullmq": "^5.76.7",
203
203
  "bun-types": "^1.3.13",
204
204
  "hono": "^4.13.1",
@@ -214,7 +214,7 @@
214
214
  "zod": "^4.4.3"
215
215
  },
216
216
  "devDependencies": {
217
- "@cosmicdrift/kumiko-dispatcher-live": "0.280.0",
217
+ "@cosmicdrift/kumiko-dispatcher-live": "0.281.0",
218
218
  "bun-types": "^1.3.13",
219
219
  "pino-pretty": "^13.1.3"
220
220
  },
package/src/changes.json CHANGED
@@ -1,4 +1,28 @@
1
1
  [
2
+ {
3
+ "version": "0.281.0",
4
+ "type": "breaking",
5
+ "title": "declareEscapeHatch is a new export from @cosmicdrift/kumiko-framework/engine",
6
+ "migration": "A standalone helper that escalates (`unsafeRaw`, or `queryAs`/`writeAs` with a\nsystem identity) on a `HandlerContext` handed to it by its caller — rather than\nbaselining the Escape-Hatch-Declared Guard finding — declares it at the call\nsite instead: `declareEscapeHatch({ reason: \"...\" })` as the first statement of\nthe helper's body, describing what is escalated and on whose right (the caller's\nhandler still carries its own `escapeHatch` declaration). The reason must be a\nstring literal and not a placeholder (see the guard's generic-reason check) —\nthere is no boot validator behind this form to catch an empty or vague one."
7
+ },
8
+ {
9
+ "version": "0.281.0",
10
+ "type": "breaking",
11
+ "title": "withUnsafeRawGrant is no longer exported from @cosmicdrift/kumiko-framework/db",
12
+ "migration": "A consumer that imported `withUnsafeRawGrant` from `@cosmicdrift/kumiko-framework/db` to grant itself `unsafeRaw` access declares `escapeHatch: { reason: \"<why>\" }` on the relevant registration (handler, hook, or `r.useExtension(...)`) instead, then fetches the runner with `ctx.db.unsafeRaw(\"<same reason>\")`. No blast radius found outside the framework itself: no app repo, kumiko-platform, kumiko-studio, or kumiko-enterprise code used this symbol."
13
+ },
14
+ {
15
+ "version": "0.281.0",
16
+ "type": "improvement",
17
+ "title": "Move escape-hatch reporting from pipeline to observability",
18
+ "detail": "escape-hatch-report.ts now lives in observability/ instead of pipeline/, removing a runtime layering violation where the db layer imported from pipeline; the public API (@cosmicdrift/kumiko-framework/pipeline exports) is unchanged."
19
+ },
20
+ {
21
+ "version": "0.281.0",
22
+ "type": "improvement",
23
+ "title": "Unify all framework packages into one version group",
24
+ "detail": "kumiko-cli, create-kumiko-app, kumiko-guards, and kumiko-repo-manifest join the existing fixed version group; all 15 non-private packages now share one version number."
25
+ },
2
26
  {
3
27
  "version": "0.280.0",
4
28
  "type": "breaking",
package/src/db/index.ts CHANGED
@@ -157,5 +157,4 @@ export {
157
157
  createTenantDb,
158
158
  createUncheckedSystemDb,
159
159
  SYSTEM_SCOPE_CHECK_BRAND,
160
- withUnsafeRawGrant,
161
160
  } from "./tenant-db";
@@ -27,7 +27,7 @@ import {
27
27
  import { SYSTEM_TENANT_ID, type TenantId } from "../engine/types/identifiers";
28
28
  import { AccessDeniedError, InternalError } from "../errors";
29
29
  import { emitDbQuery, type Meter, registerStandardMetrics, type Tracer } from "../observability";
30
- import { fallbackEscapeHatchReporter } from "../pipeline/escape-hatch-report";
30
+ import { fallbackEscapeHatchReporter } from "../observability/escape-hatch-report";
31
31
  import type { DbRunner } from "./connection";
32
32
  import { bindTenantDbRunner, tenantDbRunner } from "./tenant-db-runner";
33
33
 
@@ -0,0 +1,7 @@
1
+ import type { EscapeHatchDeclaration } from "@cosmicdrift/kumiko-types/handlers";
2
+
3
+ // Marks a standalone helper that escalates on a HandlerContext handed to it
4
+ // by its caller. The caller's registration carries the escapeHatch that
5
+ // authorizes it; this call makes the escalation visible at the site where it
6
+ // happens, where the guard and a reviewer both see it.
7
+ export function declareEscapeHatch(_declaration: EscapeHatchDeclaration): void {}
@@ -93,6 +93,7 @@ export {
93
93
  type RegisterEntityCrudOptions,
94
94
  registerEntityCrud,
95
95
  } from "./entity-handlers";
96
+ export { declareEscapeHatch } from "./escape-hatch-declaration";
96
97
  export type { EmitCtx } from "./event-helpers";
97
98
  export { emitEvent, typedPayload } from "./event-helpers";
98
99
  export type { KumikoExtensionName } from "./extension-names";
@@ -27,8 +27,8 @@ import {
27
27
  type SerializedTraceContext,
28
28
  type Tracer,
29
29
  } from "../observability";
30
+ import { createEscapeHatchReporter } from "../observability/escape-hatch-report";
30
31
  import { createDistributedLock, type DistributedLock } from "../pipeline/distributed-lock";
31
- import { createEscapeHatchReporter } from "../pipeline/escape-hatch-report";
32
32
  import { RedisKeys } from "../pipeline/redis-keys";
33
33
  import { bridgeStub } from "../testing/handler-context";
34
34
 
@@ -10,8 +10,8 @@ import { executeRawQuery } from "../../db/queries/raw-sql";
10
10
  import { createSystemUser, defineFeature } from "../../engine";
11
11
  import type { EscapeHatchUseEvent } from "../../engine/types";
12
12
  import type { Logger } from "../../logging/types";
13
+ import { ESCAPE_HATCH_USED_SIGNAL } from "../../observability/escape-hatch-report";
13
14
  import { createTestUser, setupTestStack, type TestStack } from "../../stack";
14
- import { ESCAPE_HATCH_USED_SIGNAL } from "../escape-hatch-report";
15
15
 
16
16
  const globalStoreTable = defineUnmanagedTable({
17
17
  tableName: "store_fw2861_escape_hatch_audit_items",
@@ -73,6 +73,10 @@ import {
73
73
  getFallbackTracer,
74
74
  observabilityContext,
75
75
  } from "../observability";
76
+ import {
77
+ createEscapeHatchReporter,
78
+ type EscapeHatchReportWindow,
79
+ } from "../observability/escape-hatch-report";
76
80
  import { buildBucketKey } from "../rate-limit";
77
81
  import { createTzContext, isValidIanaTimeZone } from "../time";
78
82
  import { INTERACTIVE_SIGN_IN_POLICY, resolveActiveMembershipFn } from "./active-membership";
@@ -85,7 +89,6 @@ import {
85
89
  dispatcherSpanAttributes,
86
90
  isFailedWriteResult,
87
91
  } from "./dispatcher-utils";
88
- import { createEscapeHatchReporter, type EscapeHatchReportWindow } from "./escape-hatch-report";
89
92
  import type { IdempotencyGuard } from "./idempotency";
90
93
  import type { LifecycleHooks } from "./lifecycle-pipeline";
91
94
  import { createMemberReaderFn } from "./member-reader";
@@ -20,6 +20,7 @@ import type {
20
20
  import type { TenantId } from "../engine/types/identifiers";
21
21
  import { reraiseAsKumikoError } from "../errors";
22
22
  import { getFallbackMeter, getFallbackTracer, registerStandardMetrics } from "../observability";
23
+ import { createEscapeHatchReportWindow } from "../observability/escape-hatch-report";
23
24
  import { INTERACTIVE_SIGN_IN_POLICY, resolveActiveMembershipFn } from "./active-membership";
24
25
  import { runBatch, unwrapSingle } from "./dispatch-batch";
25
26
  import { executeQuery } from "./dispatch-query";
@@ -27,7 +28,6 @@ import type { BatchCommand, BatchResult, DispatchContext } from "./dispatch-shar
27
28
  import { resolveAuthClaimsFn } from "./dispatch-shared";
28
29
  import { executeStream } from "./dispatch-stream";
29
30
  import { type HandlerType, resolveType } from "./dispatcher-utils";
30
- import { createEscapeHatchReportWindow } from "./escape-hatch-report";
31
31
  import type { IdempotencyGuard } from "./idempotency";
32
32
  import type { LifecycleHooks } from "./lifecycle-pipeline";
33
33
  import { createMemberReaderFn } from "./member-reader";
@@ -1,3 +1,11 @@
1
+ export type { EscapeHatchReportWindow } from "../observability/escape-hatch-report";
2
+ export {
3
+ createEscapeHatchReporter,
4
+ createEscapeHatchReportWindow,
5
+ ESCAPE_HATCH_USED_SIGNAL,
6
+ fallbackEscapeHatchReporter,
7
+ reportEscapeHatchUse,
8
+ } from "../observability/escape-hatch-report";
1
9
  export type { ResolveAuthClaimsArgs } from "./auth-claims-resolver";
2
10
  export { resolveAuthClaims } from "./auth-claims-resolver";
3
11
  export { createCascadeDeleteHook } from "./cascade-handler";
@@ -7,14 +15,6 @@ export type { DistributedLock } from "./distributed-lock";
7
15
  export { createDistributedLock } from "./distributed-lock";
8
16
  export type { EntityCache, EntityCacheOptions } from "./entity-cache";
9
17
  export { createEntityCache } from "./entity-cache";
10
- export type { EscapeHatchReportWindow } from "./escape-hatch-report";
11
- export {
12
- createEscapeHatchReporter,
13
- createEscapeHatchReportWindow,
14
- ESCAPE_HATCH_USED_SIGNAL,
15
- fallbackEscapeHatchReporter,
16
- reportEscapeHatchUse,
17
- } from "./escape-hatch-report";
18
18
  export type { ConsumerStatus } from "./event-consumer-state";
19
19
  export {
20
20
  ConsumerStatuses,