Skip to content
ContractSpec
Start here

Package manual · domains

·Company, work and service operations

module.work-management

Reusable Work OS application services and web/native view models.

domainsmodulev2.0.5experimentalservernode
@lssm-tech/module.work-management
bun add @lssm-tech/module.work-management
Package source ↗Manifest ↗

Manifest declarations describe the current workspace; they do not verify registry publication or runtime execution.

Package guide

Reusable Work OS application services and view models.

The module composes @lssm-tech/lib.work-spec and @lssm-tech/lib.work-runtime without binding a database, provider, transport, or product shell. Consumers inject durable event/projection/idempotency ports.

./transports exposes REST, GraphQL, and MCP adapters over the same injected WorkMutationExecutor. Hosts bind authentication and tenant context before calling it; the module never creates a permissive or in-memory fallback. createAuthenticatedWorkTransportAdapters rejects any payload whose actor or tenant/organization/workspace scope differs from the verified host context.

Managed CompanyOS can compose this module with OPA, Knowledge, Workflow, and integration packages. Downstream products can consume it independently.

The current command surface covers object lifecycle and transitions, recurrence, time tracking, relationships, immutable comment creation, attachment linking, native custom-field values, and explicit Inbox Capture for source-provenanced inbox_item objects. Every command is authorized, idempotent, correlated, evidence-linked, and committed with at least one explicit transactional-outbox destination through an injected atomic port before its projection is published.

Durable 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.

Work 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.

Relationships

THIS PACKAGEmodule.work-management4 import paths

Arrows point from a package to its direct dependency. Counts are derived from captured workspace manifests.

2 declarations

Declared capabilities

Module Work Management

Reusable Work OS application services and web/native view models.

Scripts

  • publish:pkgbun publish --tolerate-republish --ignore-scripts --verbose
  • publish:pkg:canarybun publish:pkg --tag canary
  • buildcontractspec-bun-build build
  • build:bundlecontractspec-bun-build transpile
  • build:typescontractspec-bun-build types
  • devcontractspec-bun-build dev
  • cleanrimraf dist .turbo
  • lintbun lint:fix
  • lint:fixnode ../../../../scripts/biome.cjs check --write .
  • lint:checknode ../../../../scripts/biome.cjs check .
  • testbun test
  • prebuildcontractspec-bun-build prebuild
  • typechecktsgo --noEmit