Skip to content
ContractSpec
Start here

Package manual · domains

·Content, growth and creator operations

module.editorial

Versioned editorial review and publication workflows.

domainsmodulev0.2.4experimentalserverbunnode
@lssm-tech/module.editorial
bun add @lssm-tech/module.editorial
Package source ↗Manifest ↗

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

Package guide

Bind ten standard editorial operations (plus optional listing, recovery discovery and reviewed preparation resume) into an existing ContractSpec registry with registerEditorialOperations. The module composes only library contracts and runtimes; publishers and storage are supplied by the host bundle.

Create → revise → submit → review → schedule → publish. Every accepted revision has immutable history. Edits invalidate review and scheduling. Publication claims the record with CAS before calling an injected CMS or social publisher; unknown outcomes are reconciled without re-dispatch. Published items require a separate withdrawal workflow before removal.

The authority port verifies current actor rights, review evidence, brand claims, asset rights and destination access. The host supplies HandlerCtx authentication and scoped approval receipts for publication. No default permitting authority or publication provider is supplied. The SQL store lives in growth-persistence/marketing.

/marketing/editorial/due lists bounded scheduled work due at the server clock. Discovery and individual records require read authorization; invalid scope/schedule output is rejected. It does not invoke publication or imply publication approval.

The optional /marketing/editorial/recovery REST/MCP operation is registered only when the injected store implements listRecovery. It discovers unsettled claims for the existing reconcile operation; minimum age defaults to 60 seconds.

The optional /marketing/editorial/resume-preparation command is registered only for publishers advertising preparation recovery. Fresh exact-input approval is mandatory; it does not change ordinary reconciliation into a write-capable action.

/marketing/editorial/list and editorial_list are available when the store implements listPage. Discovery is read-only and supports agent/workspace browsing without a known record ID.

The revise handler maps a runtime revision conflict to the canonical REVISION_CONFLICT response (409), including conflicts at the compare-and-swap write.

Submission revision conflicts now use canonical HTTP 409 responses, matching revision-save conflict behavior.

Review decision revision conflicts are mapped to canonical HTTP 409 without weakening reviewer/current-authority checks.

Scheduling revision conflicts return canonical HTTP 409 responses.

Existing editorial creation IDs now return canonical ALREADY_EXISTS / HTTP 409 without changing the stored record.

Archival revision conflicts use canonical HTTP 409. Provider withdrawal remains a separate workflow for published or uncertain content.

History REST/MCP registration is conditional on store.listHistory. Missing support remains unavailable.

Relationships

THIS PACKAGEmodule.editorial1 import paths

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

4 declarations

Declared capabilities

Editorial module

Reusable editorial workflow module.

Scripts

  • buildcontractspec-bun-build build
  • build:bundlecontractspec-bun-build transpile
  • build:typescontractspec-bun-build types
  • lint:checknode ../../../../scripts/biome.cjs check .
  • prebuildcontractspec-bun-build prebuild
  • testbun test
  • typechecktsgo --noEmit
  • publish:pkgbun publish --tolerate-republish --ignore-scripts --verbose