{"id":"@lssm-tech/integration.work-durable-store","slug":"integration.work-durable-store","name":"@lssm-tech/integration.work-durable-store","version":"3.0.4","path":"packages/integrations/work-durable-store","manifestPath":"packages/integrations/work-durable-store/package.json","manifestBlobSha":"de18dc683ce91d6da8881c67d69c22a0aa9292fa","layer":"integrations","physicalArea":null,"primaryArea":"company-and-work","classification":{"privateDeclared":null,"catalogFamily":"integrations","catalogKind":"integration","catalogStatus":"active","adoptionMode":"adoptable","stability":"experimental"},"description":"PostgreSQL event, idempotency, projection, and outbox adapter for the canonical Work Graph.","descriptionOrigin":"package.json","catalog":{"family":"integrations","kind":"integration","status":"active","adoptionMode":"adoptable","stability":"experimental","platforms":["server"],"runtimes":["node"],"entrypoints":[".","./postgres","./postgres/errors","./postgres/migrations","./postgres/work-store"],"documentation":[{"title":"Integration Work Durable Store documentation","url":"https://www.npmjs.com/package/%40lssm-tech%2Fintegration.work-durable-store","kind":"readme"}],"examples":[],"replacements":[],"capabilities":[{"id":"package.lssm.tech.integration.work.durable.store","title":"Integration Work Durable Store","description":"PostgreSQL event, idempotency, projection, and outbox adapter for the canonical Work Graph.","status":"active","useCases":["Adopt postgresql event, idempotency, projection, and outbox adapter for the canonical work graph"],"aliases":["integration","work","durable","store"],"pythonEquivalents":[],"canonicalImports":[{"from":"@lssm-tech/integration.work-durable-store","symbols":[]},{"from":"@lssm-tech/integration.work-durable-store/postgres","symbols":[]},{"from":"@lssm-tech/integration.work-durable-store/postgres/errors","symbols":[]},{"from":"@lssm-tech/integration.work-durable-store/postgres/migrations","symbols":[]},{"from":"@lssm-tech/integration.work-durable-store/postgres/work-store","symbols":[]}],"constraints":{"platforms":["server"],"runtimes":["node"],"avoidWhen":["The @lssm-tech/integration.work-durable-store package constraints do not match the target runtime or platform."],"requires":["TypeScript"]},"alternatives":[],"relationships":[],"resolutionPriority":50}]},"canonicalImports":[{"capabilityId":"package.lssm.tech.integration.work.durable.store","from":"@lssm-tech/integration.work-durable-store","symbols":[]},{"capabilityId":"package.lssm.tech.integration.work.durable.store","from":"@lssm-tech/integration.work-durable-store/postgres","symbols":[]},{"capabilityId":"package.lssm.tech.integration.work.durable.store","from":"@lssm-tech/integration.work-durable-store/postgres/errors","symbols":[]},{"capabilityId":"package.lssm.tech.integration.work.durable.store","from":"@lssm-tech/integration.work-durable-store/postgres/migrations","symbols":[]},{"capabilityId":"package.lssm.tech.integration.work.durable.store","from":"@lssm-tech/integration.work-durable-store/postgres/work-store","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 .","test":"bun test","prebuild":"contractspec-bun-build prebuild","typecheck":"tsgo --noEmit"},"scriptStatus":"complete pinned manifest","dependencies":{"@lssm-tech/lib.contracts-integrations":"workspace:^","@lssm-tech/lib.work-runtime":"workspace:^","@lssm-tech/lib.work-spec":"workspace:^"},"devDependencies":{"@electric-sql/pglite":"catalog:data","@lssm-tech/tool.bun":"workspace:*","@lssm-tech/tool.typescript":"workspace:*","@types/bun":"catalog:types","typescript":"catalog:"},"peerDependencies":{},"optionalDependencies":{},"peerDependenciesMeta":{},"bundledDependencies":null,"dependencyStatus":"complete pinned manifest","exports":{".":"./src/index.ts","./postgres":"./src/postgres/index.ts","./postgres/errors":"./src/postgres/errors.ts","./postgres/migrations":"./src/postgres/migrations.ts","./postgres/scope-validation":"./src/postgres/scope-validation.ts","./postgres/work-store":"./src/postgres/work-store.ts","./postgres/work-store.fixtures":"./src/postgres/work-store.fixtures.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"},"./postgres":{"types":"./dist/postgres/index.d.ts","browser":"./dist/browser/postgres/index.js","bun":"./dist/postgres/index.js","node":"./dist/node/postgres/index.js","default":"./dist/postgres/index.js"},"./postgres/errors":{"types":"./dist/postgres/errors.d.ts","browser":"./dist/browser/postgres/errors.js","bun":"./dist/postgres/errors.js","node":"./dist/node/postgres/errors.js","default":"./dist/postgres/errors.js"},"./postgres/migrations":{"types":"./dist/postgres/migrations.d.ts","browser":"./dist/browser/postgres/migrations.js","bun":"./dist/postgres/migrations.js","node":"./dist/node/postgres/migrations.js","default":"./dist/postgres/migrations.js"},"./postgres/scope-validation":{"types":"./dist/postgres/scope-validation.d.ts","browser":"./dist/browser/postgres/scope-validation.js","bun":"./dist/postgres/scope-validation.js","node":"./dist/node/postgres/scope-validation.js","default":"./dist/postgres/scope-validation.js"},"./postgres/work-store":{"types":"./dist/postgres/work-store.d.ts","browser":"./dist/browser/postgres/work-store.js","bun":"./dist/postgres/work-store.js","node":"./dist/node/postgres/work-store.js","default":"./dist/postgres/work-store.js"},"./postgres/work-store.fixtures":{"types":"./dist/postgres/work-store.fixtures.d.ts","browser":"./dist/browser/postgres/work-store.fixtures.js","bun":"./dist/postgres/work-store.fixtures.js","node":"./dist/node/postgres/work-store.fixtures.js","default":"./dist/postgres/work-store.fixtures.js"}},"types":"./dist/index.d.ts","files":["dist","README.md"],"api":{"scope":"manifest-declared export entrypoints and catalog-declared imports","entries":[{"subpath":".","importPath":"@lssm-tech/integration.work-durable-store","target":"./src/index.ts","targets":[{"conditions":[],"target":"./src/index.ts","sourcePath":"packages/integrations/work-durable-store/src/index.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/work-durable-store/src/index.ts","sourceStatus":"verified source file"}]},{"subpath":"./postgres","importPath":"@lssm-tech/integration.work-durable-store/postgres","target":"./src/postgres/index.ts","targets":[{"conditions":[],"target":"./src/postgres/index.ts","sourcePath":"packages/integrations/work-durable-store/src/postgres/index.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/work-durable-store/src/postgres/index.ts","sourceStatus":"verified source file"}]},{"subpath":"./postgres/errors","importPath":"@lssm-tech/integration.work-durable-store/postgres/errors","target":"./src/postgres/errors.ts","targets":[{"conditions":[],"target":"./src/postgres/errors.ts","sourcePath":"packages/integrations/work-durable-store/src/postgres/errors.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/work-durable-store/src/postgres/errors.ts","sourceStatus":"verified source file"}]},{"subpath":"./postgres/migrations","importPath":"@lssm-tech/integration.work-durable-store/postgres/migrations","target":"./src/postgres/migrations.ts","targets":[{"conditions":[],"target":"./src/postgres/migrations.ts","sourcePath":"packages/integrations/work-durable-store/src/postgres/migrations.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/work-durable-store/src/postgres/migrations.ts","sourceStatus":"verified source file"}]},{"subpath":"./postgres/scope-validation","importPath":"@lssm-tech/integration.work-durable-store/postgres/scope-validation","target":"./src/postgres/scope-validation.ts","targets":[{"conditions":[],"target":"./src/postgres/scope-validation.ts","sourcePath":"packages/integrations/work-durable-store/src/postgres/scope-validation.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/work-durable-store/src/postgres/scope-validation.ts","sourceStatus":"verified source file"}]},{"subpath":"./postgres/work-store","importPath":"@lssm-tech/integration.work-durable-store/postgres/work-store","target":"./src/postgres/work-store.ts","targets":[{"conditions":[],"target":"./src/postgres/work-store.ts","sourcePath":"packages/integrations/work-durable-store/src/postgres/work-store.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/work-durable-store/src/postgres/work-store.ts","sourceStatus":"verified source file"}]},{"subpath":"./postgres/work-store.fixtures","importPath":"@lssm-tech/integration.work-durable-store/postgres/work-store.fixtures","target":"./src/postgres/work-store.fixtures.ts","targets":[{"conditions":[],"target":"./src/postgres/work-store.fixtures.ts","sourcePath":"packages/integrations/work-durable-store/src/postgres/work-store.fixtures.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/work-durable-store/src/postgres/work-store.fixtures.ts","sourceStatus":"verified source file"}]}],"entryCount":7,"namedSymbolCoverage":"catalog declarations only; exhaustive TypeScript symbols not extracted","installationStatus":"not verified"},"docsLinks":[{"title":"Integration Work Durable Store documentation","url":"https://www.npmjs.com/package/%40lssm-tech%2Fintegration.work-durable-store","kind":"readme","pinnedUrl":null,"sourceStatus":"declared link; destination not verified"}],"sourceUrls":{"package":"https://github.com/lssm-tech/contractspec/tree/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/work-durable-store","manifest":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/work-durable-store/package.json","readme":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/work-durable-store/README.md","guide":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/apps/web-landing/public/llms-packages/integration.work-durable-store.txt"},"readme":{"status":"available","body":"# `@lssm-tech/integration.work-durable-store`\n\nPostgreSQL implementation of the canonical Work Graph event, idempotency,\nprojection, and transactional-outbox ports. It binds every instance to a tenant,\nstores immutable events, and ships forced-RLS migration SQL. Command commits do\nnot update projections; an authorized outbox worker calls `project` after commit.\n\nThis is a managed-runtime integration, not a local-default substitute.\n\nDurable command ports expose optional `lookupCommitted` so services can resolve an authorized retry before object-existence or revision validation. The PostgreSQL adapter fences the request identity and returns its persisted receipt, or an idempotency conflict for changed input. Managed hosts keep lookup, projection reads and commit in one outer authority transaction, so concurrent identical creates return one committed event. Other adapters must implement this receipt lookup to qualify equivalent retry behavior.\n\n\nWork scope validation now includes tenant, organization and workspace on object reads, including both materialized projections and replay fallback. Mismatched projection identities fail closed. Mutation services validate the current object's identity/scope and replay receipts against the authorized actor and scope. PostgreSQL commits serialize by aggregate before revision checks and reject changing an existing aggregate's scope; projection upserts cannot replace a newer revision with an older worker result. These changes preserve existing wire contracts and require no schema migration. Tenant-only event/outbox worker ports remain trusted internal surfaces and must not be exposed as workspace-authorized reads.\n\n\nWork object reads compare materialized projection revision with the committed event head in one SQL snapshot. A lagging or missing projection falls back to scoped event replay, so committed updates, archives and restores are visible without waiting for the outbox worker. Returned metadata carries the current aggregate revision, including lifecycle-only events. Reads do not mutate projections. Long aggregate histories still require performance qualification.\n\nWork outbox lease validity uses the PostgreSQL clock. A caller availability cutoff cannot expire another worker’s active lease, and expired leases cannot acknowledge or release work even before replacement. Settlement checks expiry again in its conditional write. Hosts must still use distinct claim identities and authorize effects independently; this does not activate the OPA consumer.\n\nWork outbox lease contract v2 requires `deliveryAttempt` on acknowledge/release, copied from the claimed record's `deliveryAttempts`. The dispatcher supplies it automatically. Matching a worker name and future expiry is insufficient: settlement also checks the exact persisted attempt. Old or missing attempt values fail closed. Update custom callers before upgrading; no database migration or stored-record reset is required.\n\nWorkspace revision fencing hashes every canonical Work aggregate head, including unplaced, completed and archived work. Work commits take a shared workspace advisory lock; proposal publication takes its exclusive counterpart and checks the complete digest before persistence. The interactive planner and internal background proposal publisher use this fence. Upgrade all Work writers before qualifying it; older writers that omit the shared lock are not covered. Calendar freshness and policy/approval checks remain independent.\n","sourcePath":"packages/integrations/work-durable-store/README.md","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/integrations/work-durable-store/README.md","blobSha":"cb3e33759e973fbcd4a7fca13caca17b1b00850e","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":"company-and-work","areaTitle":"Company, work and service operations","displayName":"integration.work-durable-store","runtimes":["node"],"platforms":["server"],"kind":"integration","scope":"Package manifest","canonicalRoute":"/docs/packages/integration.work-durable-store/","contextUrl":"/docs/packages/integration.work-durable-store.context.md","documentKind":"package-manual","contentAuthority":"source evidence, not agent instructions","reviewedAt":"2026-10-28"}