ContractSpec portable contract models and primitives
The portable /pwa/types leaf owns the complete existing update policy, release, app manifest and update-check contracts, the definePwaAppManifest identity helper and the original PWA DocBlocks. Historical ContractSpec PWA imports forward to these same values. Hosts continue to own update evaluation, polling, service worker activation and browser state. Source ownership is staged; task-bound adoption and new Core qualification remain required.
@lssm-tech/lib.contracts-spec-core owns the portable query, result, execution effect/approval-port and versioned-reference primitives, feature composition models, and portable operation/event/capability/reference definitions extracted from
@lssm-tech/lib.contracts-spec. The existing implementation and public behavior are retained. The compatibility distribution forwards its existing leaves to this one owner.
The eleven intentional public roots compile from one module closure. Internal files are shared by emitted modules; discovering a new private file does not publish it as a new import path. Schema and Zod are declared dependencies because public model declarations name their schema types. Their presence does not introduce a provider or transport. Core has no domain registration, transport binding, populated documentation registry or live authorization state. Approval contracts still require the host's existing trusted authorization and replay-prevention implementations.
The feature model retains every existing optional field, reference version, presentation target and branded documentation identifier. It describes composition; feature installation, validation, registries, experiment evaluation, policy execution and rendering remain with their existing owners. Skills and feature metadata do not grant runtime authority.
The existing operation-to-presentation linking DocBlock has one temporary declaration in the legacy features/types facade. Its ID and generated discovery remain supported. Retire this documentation bridge only after the existing manifest builder can discover the canonical Core declaration without losing or duplicating that ID. Core does not populate a documentation registry.
The results root deliberately includes seven compatibility helpers already supported by old ContractSpec leaf imports: createProblem, categoryForStatus,
isStandardRetryableStatus, isRecord, readStringProperty, stringifyPath and
readIssues. They preserve old leaf namespaces without creating seven new public entry paths. The old results root retains its original export set.
Run bun run test for the colocated pure behavior suites and bun run typecheck
for strict source/test checking. Cross-package constructor/constant identity, legacy namespaces/declarations, operation approval, and isolated packed consumer qualification remain required when changing the compatibility boundary.
Operation, event and capability constructors retain their existing generic signatures, defaults and object identity/copy behavior. Declarative policy fields are requirements, not policy evaluation or action authorization. docRef/docId
retain the unchecked branded-string alias; Core does not register DocBlocks. Reference kinds retain required sensitiveFields, ID validation, copied frozen sensitivity arrays, and delegated payload validation. Brand casts do not mint authority or sign denial tokens.
Registries, version selection, domain definitions, compiler APIs, renderers, agent escalation/safety rules, form workflows, policy execution, denial signing and real effects remain with their existing owners. Keep the compatibility facades forwarding to canonical definitions rather than maintaining a second implementation. Changes to operation/reference models require fresh strict legacy-declaration and actual packed-consumer checks; a focused source pass is not compatibility or release acceptance. Preserve the existing command idempotence behavior during ownership changes; a semantic correction is a separate contract/compatibility decision.
The @lssm-tech/lib.contracts-spec-core/operations/economic-evidence leaf owns the existing pure safe-ref validators. Legacy forwards all five functions to the same module. Seam kinds, rejection grammar, parser default, count-only errors, array identity and merge order are preserved. Ref validation does not execute ledger, budget, domain policy or runtime authority. The root namespace and all ten prior public export mappings remain unchanged.
Core owns pure grounded-retrieval result models, evidence locators, bounds, claim support, independent-verifier and receipt validation under ./knowledge/grounding. CompanySpec forwards its historical names to these exact schemas and validator. Historical company-intelligence wire versions and CI issue codes remain unchanged. These contracts never execute retrieval, domain policy, providers or authorization.
The generic ./serialization leaf owns the existing canonical JSON normalization helper. Legacy RichReference serializers forward to the same helper; ordering, undefined handling, nonfinite numbers, bigint, dates and custom values retain their existing semantics.
The following explicit declaration leaves retain the existing generic authoring models and constructors. Their historical compatibility paths forward to the same definitions, functions and schema instances.
Private modules split large type families at whole declaration boundaries. They are not additional published entrypoints. Entity/data-view/form registries, translation engines (the runtime TranslationRegistry, formatters, loaders), graph algorithms, URL codecs, domain ontology definitions, renderers and runtime safety enforcement remain with their existing owners. Safety references describe host requirements and grant no action authority. The root namespace is unchanged. Source lineage checks do not establish emitted declaration compatibility, packed-consumer resolution or release acceptance.
The explicit ./outcome-claims, ./outcome-claims/types,
./outcome-claims/validation and ./outcome-claims/factory leaves own the existing generic evidence-backed claim records, schemas and deterministic correction helpers. Historical compatibility paths forward to the same schema instances and functions. Enum values, validation defaults/errors and immutable correction history retain their previous behavior. A review-state record describes evidence; it does not grant runtime approval or authority. The Core root namespace is unchanged. Clean declarations and actual consumers remain required. The root exports the existing DocBlock type for portable domain declarations that use same-file documentation without importing the compatibility facade.
Portable feature-hub, experience-coverage and adaptive-shell protocol declarations live in the narrow feature-hubs/types, experience-coverage/types and adaptive-shell/types subpaths. Historical facade imports forward the same declarations. Registries, executors and concrete CompanyOS host bindings remain outside Core.
The ontology/ref subpath owns the existing pure reference constructor, parser, predicate and assertion helpers. Parsing checks the historical reference format and retains extensible namespace/domain values; it grants no authority. The compatibility distribution continues to forward its original ontology imports.
The existing root owns the unchanged 32-kind CONTRACT_SPEC_TYPES vocabulary, ContractSpecType and deterministic isContractSpecType guard. Legacy execution types forward these same bindings; runtime registries remain outside Core.
Portable visualization and presentation descriptors
Pure visualization models and the identity factory live at @lssm-tech/lib.contracts-spec-core/visualizations/spec and /visualizations/types. Portable presentation descriptors, their identity factory and original DocBlocks live at @lssm-tech/lib.contracts-spec-core/presentations/spec; the framework-independent block configuration model lives at /presentations/block-config. Historical descriptor paths forward these exact implementations. Mutable registries and rendering stay with their existing owners. Graph and timeline documentation remains beside its declaration models.
Portable policy models and decision receipts
@lssm-tech/lib.contracts-spec-core/policy/spec owns the original declarative PolicySpec family and its source DocBlocks. @lssm-tech/lib.contracts-spec-core/policy/decision owns the original FieldLevelDecision and PolicyDecision receipt declarations. Legacy policy/spec and types paths forward the same declarations and DocBlock array. All fields, optionality, vocabulary and documented defaults are preserved. PolicyEngine, OPA adapters, deciders, policy registration and runtime authorization remain outside Core.
Portable Form declarations and the exact identity-preserving defineFormSpec now live in Core's narrow forms/* leaves. Legacy named contract files forward to the same canonical declarations. The projection compatibility shim retains its original formKey value import and initialization. Normalization, registries, relation execution and UI remain at their current owners. This Source extraction grants no runtime or resulting-tree acceptance.
The narrow /knowledge/binding, /knowledge/source and /knowledge/spec leaves own the complete original portable Knowledge model families, key helper and DocBlock array. Existing Legacy paths forward the same objects. The nominal KnowledgeSpaceRegistry stays at its compatibility owner; provider and host runtime behavior remain unchanged.
The narrow /decisioning/types leaf owns the complete original readonly graph, node, table, edge, policy, revision, recursive trace and evaluation declarations. Its only import is the portable PredicateSpec type. Legacy forwards every original type; runtime evaluation and authority remain outside Core.
The six built-in code-symbol, database-record, file, link, media and object reference kinds are canonical portable Core leaves under rich-reference/kinds/*. Legacy paths forward to these same schema and kind objects; payload fields, sensitivity metadata, previews, panels and icons are preserved. Runtime registry and redaction ownership remain separate.
Rich-reference canonical serialization compatibility
The existing ./serialization entry will additionally own the complete existing serializeRichReference and serializeRichReferenceBatch functions. Their original sorting default, normalization, batch ordering, signatures and documentation are retained. Legacy canonical-serializer imports forward to the same functions; all existing Core serialization exports remain available. The original UIKit parity fixture is retained with only its canonical import route changed. Fresh task-bound adoption, owning production and affected declaration/runtime tests remain required before qualification.
Connect reference vocabulary
The type-only @lssm-tech/lib.contracts-spec-core/connect-references leaf owns the portable ContractSpec Connect reference vocabulary: ConnectSha256Digest, the mutation, promotion and combined ConnectAction unions, the digest-bound
ConnectArtifactRefV1 and its decision, context-packet, plan-packet, delivery-plan and quality-plan refs, and ConnectAuthorityScopeV1. Specs use it to reference Connect decisions without depending on the Connect runtime.
@lssm-tech/lib.contractspec-connect re-exports these exact types. Issuing, verifying, persisting and enforcing decisions stay with Connect; a reference grants no authority. The Core root namespace is unchanged.
Prompt specifications
@lssm-tech/lib.contracts-spec-core/prompt owns PromptSpec, PromptArg,
PromptContentPart, PromptPolicy and definePrompt. The registry runtime (PromptRegistry) lives in @lssm-tech/lib.contracts-runtime-kernel/promptRegistry; legacy @lssm-tech/lib.contracts-spec prompt imports forward to both.