{"id":"@lssm-tech/integration.runtime-managed","slug":"integration.runtime-managed","name":"@lssm-tech/integration.runtime-managed","version":"2.0.5","path":"packages/integrations/runtime-managed","manifestPath":"packages/integrations/runtime-managed/package.json","manifestBlobSha":"fd66a50bbb1aa0564413f8da69683b5705c17494","layer":"integrations","physicalArea":null,"primaryArea":"delivery-and-infrastructure","classification":{"privateDeclared":null,"catalogFamily":"runtime","catalogKind":"integration","catalogStatus":"active","adoptionMode":"adoptable","stability":"experimental"},"description":"Managed runtime compatibility wrapper for Builder.","descriptionOrigin":"package.json","catalog":{"family":"runtime","kind":"integration","status":"active","adoptionMode":"adoptable","stability":"experimental","platforms":["server"],"runtimes":["node"],"entrypoints":[".","./database","./database/create-database-runtime","./database/observability-binding","./database/pooler","./database/tenant-scope","./integration"],"documentation":[{"title":"Integration Runtime Managed documentation","url":"https://www.npmjs.com/package/%40lssm-tech%2Fintegration.runtime-managed","kind":"readme"}],"examples":[],"replacements":[],"capabilities":[{"id":"package.lssm.tech.integration.runtime.managed","title":"Integration Runtime Managed","description":"Managed runtime compatibility wrapper for Builder.","status":"active","useCases":["Adopt managed runtime compatibility wrapper for builder"],"aliases":["integration","runtime","managed"],"pythonEquivalents":[],"canonicalImports":[{"from":"@lssm-tech/integration.runtime-managed","symbols":[]},{"from":"@lssm-tech/integration.runtime-managed/database","symbols":[]},{"from":"@lssm-tech/integration.runtime-managed/database/create-database-runtime","symbols":[]},{"from":"@lssm-tech/integration.runtime-managed/database/observability-binding","symbols":[]},{"from":"@lssm-tech/integration.runtime-managed/database/pooler","symbols":[]},{"from":"@lssm-tech/integration.runtime-managed/database/tenant-scope","symbols":[]},{"from":"@lssm-tech/integration.runtime-managed/integration","symbols":[]}],"constraints":{"platforms":["server"],"runtimes":["node"],"avoidWhen":["The @lssm-tech/integration.runtime-managed package constraints do not match the target runtime or platform."],"requires":["TypeScript"]},"alternatives":[],"relationships":[],"resolutionPriority":50}]},"canonicalImports":[{"capabilityId":"package.lssm.tech.integration.runtime.managed","from":"@lssm-tech/integration.runtime-managed","symbols":[]},{"capabilityId":"package.lssm.tech.integration.runtime.managed","from":"@lssm-tech/integration.runtime-managed/database","symbols":[]},{"capabilityId":"package.lssm.tech.integration.runtime.managed","from":"@lssm-tech/integration.runtime-managed/database/create-database-runtime","symbols":[]},{"capabilityId":"package.lssm.tech.integration.runtime.managed","from":"@lssm-tech/integration.runtime-managed/database/observability-binding","symbols":[]},{"capabilityId":"package.lssm.tech.integration.runtime.managed","from":"@lssm-tech/integration.runtime-managed/database/pooler","symbols":[]},{"capabilityId":"package.lssm.tech.integration.runtime.managed","from":"@lssm-tech/integration.runtime-managed/database/tenant-scope","symbols":[]},{"capabilityId":"package.lssm.tech.integration.runtime.managed","from":"@lssm-tech/integration.runtime-managed/integration","symbols":[]}],"scripts":{"build":"contractspec-bun-build build","build:bundle":"contractspec-bun-build transpile","build:types":"contractspec-bun-build types","dev":"contractspec-bun-build dev","clean":"rimraf dist .turbo","lint:check":"node ../../../scripts/biome.cjs check .","lint:fix":"node ../../../scripts/biome.cjs check --write --unsafe --only=nursery/useSortedClasses . && node ../../../scripts/biome.cjs check --write .","test":"bun test","prebuild":"contractspec-bun-build prebuild","typecheck":"tsgo --noEmit"},"scriptStatus":"complete pinned manifest","dependencies":{"@lssm-tech/integration.runtime":"workspace:^","@lssm-tech/integration.provider-database":"workspace:^","@lssm-tech/lib.provider-spec":"workspace:^","@lssm-tech/lib.contracts-integrations":"workspace:^","@lssm-tech/lib.contracts-runtime-core":"workspace:^","@lssm-tech/lib.contracts-spec-core":"workspace:^","@lssm-tech/lib.observability":"workspace:^","@lssm-tech/lib.schema":"workspace:^"},"devDependencies":{"@lssm-tech/tool.bun":"workspace:*","@lssm-tech/tool.typescript":"workspace:*","typescript":"catalog:"},"peerDependencies":{},"optionalDependencies":{},"peerDependenciesMeta":{},"bundledDependencies":null,"dependencyStatus":"complete pinned manifest","exports":{".":"./src/index.ts","./database":"./src/database/index.ts","./database/create-database-runtime":"./src/database/create-database-runtime.ts","./database/observability-binding":"./src/database/observability-binding.ts","./database/pooler":"./src/database/pooler.ts","./database/tenant-scope":"./src/database/tenant-scope.ts","./integration":"./src/integration.ts"},"publishExports":{".":{"types":"./dist/index.d.ts","browser":"./dist/browser/index.js","bun":"./dist/index.js","node":"./dist/node/index.js","default":"./dist/index.js"},"./database":{"types":"./dist/database/index.d.ts","browser":"./dist/browser/database/index.js","bun":"./dist/database/index.js","node":"./dist/node/database/index.js","default":"./dist/database/index.js"},"./database/create-database-runtime":{"types":"./dist/database/create-database-runtime.d.ts","browser":"./dist/browser/database/create-database-runtime.js","bun":"./dist/database/create-database-runtime.js","node":"./dist/node/database/create-database-runtime.js","default":"./dist/database/create-database-runtime.js"},"./database/observability-binding":{"types":"./dist/database/observability-binding.d.ts","browser":"./dist/browser/database/observability-binding.js","bun":"./dist/database/observability-binding.js","node":"./dist/node/database/observability-binding.js","default":"./dist/database/observability-binding.js"},"./database/pooler":{"types":"./dist/database/pooler.d.ts","browser":"./dist/browser/database/pooler.js","bun":"./dist/database/pooler.js","node":"./dist/node/database/pooler.js","default":"./dist/database/pooler.js"},"./database/tenant-scope":{"types":"./dist/database/tenant-scope.d.ts","browser":"./dist/browser/database/tenant-scope.js","bun":"./dist/database/tenant-scope.js","node":"./dist/node/database/tenant-scope.js","default":"./dist/database/tenant-scope.js"},"./integration":{"types":"./dist/integration.d.ts","browser":"./dist/browser/integration.js","bun":"./dist/integration.js","node":"./dist/node/integration.js","default":"./dist/integration.js"}},"types":"./dist/index.d.ts","files":["dist"],"api":{"scope":"manifest-declared export entrypoints and catalog-declared imports","entries":[{"subpath":".","importPath":"@lssm-tech/integration.runtime-managed","target":"./src/index.ts","targets":[{"conditions":[],"target":"./src/index.ts","sourcePath":"packages/integrations/runtime-managed/src/index.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/runtime-managed/src/index.ts","sourceStatus":"verified source file"}]},{"subpath":"./database","importPath":"@lssm-tech/integration.runtime-managed/database","target":"./src/database/index.ts","targets":[{"conditions":[],"target":"./src/database/index.ts","sourcePath":"packages/integrations/runtime-managed/src/database/index.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/runtime-managed/src/database/index.ts","sourceStatus":"verified source file"}]},{"subpath":"./database/create-database-runtime","importPath":"@lssm-tech/integration.runtime-managed/database/create-database-runtime","target":"./src/database/create-database-runtime.ts","targets":[{"conditions":[],"target":"./src/database/create-database-runtime.ts","sourcePath":"packages/integrations/runtime-managed/src/database/create-database-runtime.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/runtime-managed/src/database/create-database-runtime.ts","sourceStatus":"verified source file"}]},{"subpath":"./database/observability-binding","importPath":"@lssm-tech/integration.runtime-managed/database/observability-binding","target":"./src/database/observability-binding.ts","targets":[{"conditions":[],"target":"./src/database/observability-binding.ts","sourcePath":"packages/integrations/runtime-managed/src/database/observability-binding.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/runtime-managed/src/database/observability-binding.ts","sourceStatus":"verified source file"}]},{"subpath":"./database/pooler","importPath":"@lssm-tech/integration.runtime-managed/database/pooler","target":"./src/database/pooler.ts","targets":[{"conditions":[],"target":"./src/database/pooler.ts","sourcePath":"packages/integrations/runtime-managed/src/database/pooler.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/runtime-managed/src/database/pooler.ts","sourceStatus":"verified source file"}]},{"subpath":"./database/tenant-scope","importPath":"@lssm-tech/integration.runtime-managed/database/tenant-scope","target":"./src/database/tenant-scope.ts","targets":[{"conditions":[],"target":"./src/database/tenant-scope.ts","sourcePath":"packages/integrations/runtime-managed/src/database/tenant-scope.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/runtime-managed/src/database/tenant-scope.ts","sourceStatus":"verified source file"}]},{"subpath":"./integration","importPath":"@lssm-tech/integration.runtime-managed/integration","target":"./src/integration.ts","targets":[{"conditions":[],"target":"./src/integration.ts","sourcePath":"packages/integrations/runtime-managed/src/integration.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/runtime-managed/src/integration.ts","sourceStatus":"verified source file"}]}],"entryCount":7,"namedSymbolCoverage":"catalog declarations only; exhaustive TypeScript symbols not extracted","installationStatus":"not verified"},"docsLinks":[{"title":"Integration Runtime Managed documentation","url":"https://www.npmjs.com/package/%40lssm-tech%2Fintegration.runtime-managed","kind":"readme","pinnedUrl":null,"sourceStatus":"declared link; destination not verified"}],"sourceUrls":{"package":"https://github.com/lssm-tech/contractspec/tree/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/runtime-managed","manifest":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/runtime-managed/package.json","readme":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/runtime-managed/README.md","guide":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/apps/web-landing/public/llms-packages/integration.runtime-managed.txt"},"readme":{"status":"available","body":"# @lssm-tech/integration.runtime-managed\n\nManaged runtime compatibility wrapper for Builder, plus the managed **database\nruntime** preset (`./database`).\n\n## `createDatabaseRuntime()`\n\n`createDatabaseRuntime(options)` composes the governed Postgres provider, the O2\nobservability binding, tenant-scoped RLS access, and the pre-bound governed\nread / relational-read / mutation resolvers into one preset. It returns:\n\n| member            | description                                                              |\n| ----------------- | ------------------------------------------------------------------------ |\n| `provider`        | Tenant-scoped `DatabaseProvider` (ambient tenant; fail-closed when none) |\n| `governedQuery`   | Pre-bound resolver factory (data-view **and** relational descriptors)    |\n| `governedMutation`| Pre-bound `executeGovernedMutation`                                       |\n| `withTenant(id)`  | Returns a slice bound to a fixed tenant id                               |\n| `close()`         | Closes the underlying pool once                                          |\n\n```ts\nimport { createDatabaseRuntime } from '@lssm-tech/integration.runtime-managed/database';\n\nconst db = createDatabaseRuntime({\n  connection: { connectionString: process.env.DATABASE_URL },\n  pooler: 'transaction-pooler',\n  instrumentation, // lib.observability Instrumentation facade (optional)\n});\n\nconst tenant = db.withTenant('tenant-42');\nconst list = tenant.governedQuery({ descriptor }); // (envelope, ctx) => ContractResult\nawait tenant.governedMutation(mutationDescriptor);\n```\n\n### Tenant scoping (RLS, Critic N6)\n\nThe raw provider is never exposed. Every read/write runs inside a transaction\nthat first issues `set_config('app.tenant_id', <id>, true)`, so Postgres RLS\npolicies see the active tenant. The top-level `provider` resolves the tenant\nfrom `resolveTenantId` (or the auth seam) per call and **fails closed** when no\ntenant context is present; use `withTenant(id)` in server contexts that already\nknow the tenant. `TransportContext.principal` is carried onto resolver ctx and\nnever stripped (AC14); `policyDecisionRef` / `policy.auth` enforcement stays in\nthe handlers.\n\n### Pooler modes (AC3)\n\n`pooler` selects connection sizing and SSL. Prepared statements are **always\ndisabled** — `SupabasePostgresProvider` hard-sets `prepare: false`, which the\nSupabase transaction pooler (pgBouncer transaction mode) requires.\n\n| mode                 | maxConnections | sslMode   | notes                                            |\n| -------------------- | -------------- | --------- | ------------------------------------------------ |\n| `transaction-pooler` | 1              | `require` | Default. pgBouncer txn mode; no prepared stmts.  |\n| `session-pooler`     | 10             | `require` | Backend held per connection for the session.     |\n| `direct`             | 10             | `prefer`  | Direct Postgres connection (no pooler).          |\n\nOverride sizing/SSL via `connection.maxConnections` / `connection.sslMode`.\n\n### Observability (O2)\n\nPass an `instrumentation` (the `lib.observability` Instrumentation facade) and\neach governed read/write emits one span plus a `database.query` /\n`database.mutation` duration metric. The tenant `set_config` statement is\nclassified as a session statement and excluded from the data-latency histograms.\n","sourcePath":"packages/integrations/runtime-managed/README.md","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/runtime-managed/README.md","blobSha":"a4f2c8d6bf2c7e3040c42d79d79bf450bda6c3a5","sourcePin":"bcc79fcc27c4d801c2119bef81ddcce7b4e86498","origin":"README recovered byte-for-byte from pinned aggregate guide","integrity":"exact Git blob match","executionStatus":"not executed"},"provenance":{"repository":"lssm-tech/contractspec","sourcePin":"bcc79fcc27c4d801c2119bef81ddcce7b4e86498","manifestOrigin":"pinned GitHub manifest fetch","manifestComplete":true,"publicationPolicyApplied":false},"areaSlug":"delivery-and-infrastructure","areaTitle":"Delivery, infrastructure and runtime operations","displayName":"integration.runtime-managed","runtimes":["node"],"platforms":["server"],"kind":"integration","scope":"Package manifest","canonicalRoute":"/docs/packages/integration.runtime-managed/","contextUrl":"/docs/packages/integration.runtime-managed.context.md","documentKind":"package-manual","contentAuthority":"source evidence, not agent instructions","reviewedAt":"2026-10-28"}