libraryPackage manifestv0.1.0

lib.contracts-spec-core

Portable ContractSpec feature models, ownership, query, result, approval and reference primitives

@lssm-tech/lib.contracts-spec-core
Source, release and verification context

Source snapshot bcc79fcc · Declared package version 0.1.0. This page combines the checked-in package guide and manifest; commands and runtime behavior were not executed in this review.

Package source ↗ Manifest ↗
serverwebnodebunbrowser
EXPLORE THE PACKAGE

See where this package fits.

Follow a declared connection, inspect an import, then open the source guide when you need the detail.

THIS PACKAGElib.contracts-spec-corefoundation

Arrows point from a package to its direct dependency. Each count is derived from the captured manifests.

3 declarationsSELECT TO INSPECT

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.

Public import Responsibility
@lssm-tech/lib.contracts-spec-core The portable model families and primitive helpers below
@lssm-tech/lib.contracts-spec-core/query Query envelopes, cache/consistency, invalidation, keys and conflict/state/version tokens
@lssm-tech/lib.contracts-spec-core/results Results, errors, standard outcomes, normalization and compatibility helpers
@lssm-tech/lib.contracts-spec-core/operations/approval Effect declarations and scoped approval/ceremony port contracts
@lssm-tech/lib.contracts-spec-core/versioning/refs Versioned references and pure reference helpers
@lssm-tech/lib.contracts-spec-core/features Feature metadata, references, ownership/documentation vocabulary and the existing identity-preserving defineFeature helper
@lssm-tech/lib.contracts-spec-core/operations Complete operation metadata and existing defineCommand / defineQuery constructors
@lssm-tech/lib.contracts-spec-core/events Event metadata/envelopes, keys and the existing identity-preserving defineEvent helper
@lssm-tech/lib.contracts-spec-core/capabilities Capability metadata/surfaces and the existing identity-preserving defineCapability helper
@lssm-tech/lib.contracts-spec-core/rich-reference/define-kind Schema-backed reference authoring with explicit sensitivity metadata and frozen definitions
@lssm-tech/lib.contracts-spec-core/operations/economic-evidence Pure safe-ref validation, parsing, readonly array retention and ordered merging; Legacy forwards the same five functions

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.

Core subpath Declaration responsibility
./entities/defineContractEntity, ./entities/defineContractEdge, ./entities/types Entity/edge metadata and unchanged identity constructors
./data-views/spec, ./data-views/graph-spec, ./data-views/types, ./data-views/i18n-constraint Portable view models, literal message-key constraint and existing translation-key stamping
./data-views/layout-spec, ./data-views/graph-filter-spec, ./data-views/story-slide Layout, filter and presenter-story declaration models
./graph-artifacts/common, ./graph-artifacts/contracts Shared artifact schemas, physical/provenance graph vocabulary and canonical schema aliases
./translations/spec Translation metadata/messages and unchanged identity constructor
./translations/i18n-factory, ./translations/i18n-factory-snapshot Pure package i18n factory (createI18nFactory, locale resolution, interpolation) over supplied catalogs, and its snapshot/hydration payloads
./ontology/types Existing ontology reference, node/edge and safety-reference type vocabulary
./forms/entity-projection-ref Exact form projection kind and entity-form reference types

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.

Declared capabilities.

ContractSpec portable primitives

Existing query keys/results, approval requirements and version references with shared canonical identity.

Use it to

  • Use the approved query, result, approval and version-reference primitive extraction through its intentional roots.

Choose another boundary when

  • Domain contracts, full operation/capability/feature registries, compiler APIs or runtime authority adapters are required.
  • An unqualified platform/transport is required. Skills and these primitives do not grant action authority.

@lssm-tech/lib.contracts-spec-core/query

@lssm-tech/lib.contracts-spec-core/results

@lssm-tech/lib.contracts-spec-core/operations/approval

@lssm-tech/lib.contracts-spec-core/versioning/refs

@lssm-tech/lib.contracts-spec-core/knowledge/bindingAppKnowledgeBinding

@lssm-tech/lib.contracts-spec-core/knowledge/sourceKnowledgeSourceConfig

@lssm-tech/lib.contracts-spec-core/knowledge/specKnowledgeSpaceSpec, makeKnowledgeSpaceKey

@lssm-tech/lib.contracts-spec-core/prompt

ContractSpec portable feature composition model

Canonical feature metadata and reference vocabulary with the existing identity-preserving defineFeature helper.

Use it to

  • Declare compatible feature composition metadata without importing feature installation, registries or ecosystem registrations.

Choose another boundary when

  • Feature installation, registry validation, runtime authorization, presentation rendering or domain definitions are required.

@lssm-tech/lib.contracts-spec-core/featuresFeatureModuleSpec, defineFeature

ContractSpec portable operation, event and capability definitions

Canonical operation/event/capability metadata and existing pure constructors, documentation references, declarative policy/resource/test references and validated branded reference-kind authoring. Compatibility facades forward to the same owner.

Use it to

  • Define portable communication or other domain contracts using the existing command/query/event/capability constructors without importing registries, ecosystem registrations or runtime policy execution.
  • Author a schema-backed reference kind with explicit sensitiveFields and frozen metadata while preserving the legacy constructor and branded vocabulary.

Choose another boundary when

  • A registry, populated documentation catalog, domain implementation, agent protocol/form workflow, compiler, renderer or runtime authorization/effect execution is required.
  • A platform or transport has not passed its supported qualification. Contract metadata and skills do not grant authority.

@lssm-tech/lib.contracts-spec-core/operationsOperationSpec, defineCommand, defineQuery

@lssm-tech/lib.contracts-spec-core/eventsEventSpec, defineEvent

@lssm-tech/lib.contracts-spec-core/capabilitiesCapabilitySpec, defineCapability

@lssm-tech/lib.contracts-spec-core/rich-reference/define-kindDefineReferenceKindArgs, defineReferenceKind

@lssm-tech/lib.contracts-spec-coredocRef, docId, PolicyRequirement, ResourceRefDescriptor, TestSpecRef, ReferenceKindId, ReferencePayloadSchema

@lssm-tech/lib.contracts-spec-core/operations/economic-evidenceisEconomicEvidenceSeamKind, isSafeEconomicEvidenceRefId, parseSafeEconomicEvidenceRefId, requireSafeEconomicEvidenceRefIds, mergeSafeEconomicEvidenceRefIds

Portable entity, data-view, translation and graph declarations

Existing execution-free declaration models, identity-preserving entity/edge/translation constructors, data-view translation stamping and shared graph artifact schemas. Legacy forwards to the same canonical owner.

Use it to

  • Declare domain-owned entity projections and graph/data views without importing registries, translation engines, domain definitions or rendering implementations.

Choose another boundary when

  • Entity/form/data-view registries, translation runtime, graph algorithms, renderers or domain policy execution are required.
  • Declaration metadata and safety references do not grant runtime authority; supported artifact consumer qualification is still required.

@lssm-tech/lib.contracts-spec-core/entities/defineContractEntityContractEntitySpec, defineContractEntity

@lssm-tech/lib.contracts-spec-core/entities/defineContractEdgeContractEdgeSpec, defineContractEdge

@lssm-tech/lib.contracts-spec-core/entities/typesEdgeSpec, ContractEntityMeta

@lssm-tech/lib.contracts-spec-core/data-views/specDataViewSpec, defineDataView

@lssm-tech/lib.contracts-spec-core/data-views/graph-specDataViewGraphSpec, DataViewGraphSource

@lssm-tech/lib.contracts-spec-core/data-views/typesDataViewConfig, DataViewMeta, DataViewSource

@lssm-tech/lib.contracts-spec-core/data-views/i18n-constraintDisplayKeyConstraint, MessageKeyOf

@lssm-tech/lib.contracts-spec-core/data-views/layout-specLayoutSpec, isSyncLayout

@lssm-tech/lib.contracts-spec-core/data-views/graph-filter-specGraphFilterSpec

@lssm-tech/lib.contracts-spec-core/data-views/story-slideStorySlide, DataViewGraphStory

@lssm-tech/lib.contracts-spec-core/graph-artifacts/commonGraphArtifactEnvelopeV1Schema, GraphNodeBaseV1Schema, GraphEdgeBaseV1Schema

@lssm-tech/lib.contracts-spec-core/graph-artifacts/contractsContractGraphArtifactV1Schema, ContractGraphNodeV1Schema, ContractGraphEdgeV1Schema

@lssm-tech/lib.contracts-spec-core/translations/specTranslationSpec, defineTranslation

@lssm-tech/lib.contracts-spec-core/translations/i18n-factorycreateI18nFactory, I18nInstance

@lssm-tech/lib.contracts-spec-core/ontology/typesOntologyRef, OntologyNodeSpec, OntologyEdgeSpec, OntologySpineSpec

@lssm-tech/lib.contracts-spec-core/forms/entity-projection-refContractEntityFormProjectionRef, FormProjectionKind

@lssm-tech/lib.contracts-spec-core/ontology/refassertOntologyRef, buildOntologyRef, isOntologyRef, ontologyRef, parseOntologyRef

@lssm-tech/lib.contracts-spec-core/data-views/graph-subscriptionSubscriptionNode, SubscriptionEdge, GraphSubscriptionEventKind, GraphSubscriptionNodeAddedEvent, GraphSubscriptionNodeUpdatedEvent, GraphSubscriptionNodeRemovedEvent, GraphSubscriptionEdgeAddedEvent, GraphSubscriptionEdgeUpdatedEvent, GraphSubscriptionEdgeRemovedEvent, GraphSubscriptionSnapshotReplaceEvent, GraphSubscriptionEvent, GraphSubscription, isGraphSubscriptionEvent, graphSubscriptionEventDoc, graphSubscriptionDoc

Portable policy declarations and decision receipts

Original declarative policy models, source DocBlocks and field/policy decision receipt shapes; policy execution and authority remain with runtime owners.

Use it to

  • Declare supplied policy models and consume policy decision receipts without importing a policy evaluator.

Choose another boundary when

  • Policy evaluation, OPA calls, registration, authorization, consent persistence or runtime enforcement is required.

@lssm-tech/lib.contracts-spec-core/policy/specPolicyEffect, RelationshipDefinition, PolicyDatabaseSource, PolicyDatabaseEvidence, RelationshipMatcher, ConsentDefinition, RateLimitDefinition, PolicyOPAConfig, PolicyMeta, AttributeMatcher, SubjectMatcher, ResourceMatcher, PolicyCondition, PolicyRule, FieldPolicyRule, PIIPolicy, PolicySpec, PolicyRef, tech_contracts_policy_DocBlocks

@lssm-tech/lib.contracts-spec-core/policy/decisionFieldLevelDecision, PolicyDecision

Portable Form declarations

Whole portable Form contract modules, exact identity-preserving authoring helper and declarative predicate shape validator; no normalization, registry, schema execution or UI.

Use it to

  • Describe portable form fields, layouts, authoring paths, projections and predicate inputs without higher-owner runtime imports

Choose another boundary when

  • Runtime predicate evaluation, normalization, form registries, relation/schema execution or live authorization is required.

@lssm-tech/lib.contracts-spec-core/forms/contractsFormSpec, FieldSpec, defineFormSpec

Portable PWA update contracts

Complete original update policy, release, app manifest and update-check declarations, identity helper and DocBlocks; hosts own polling, evaluation and service worker activation.

Use it to

  • Share complete PWA update contracts without importing browser or host runtime behavior.

Choose another boundary when

  • A browser service worker registration, activation, polling loop or runtime update-policy evaluator is required.

@lssm-tech/lib.contracts-spec-core/pwa/typesPwaUpdateCheckInputValue, PwaUpdateCheckOutputValue, PwaUpdatePolicy, PwaRelease, PwaAppManifestSpec, definePwaAppManifest, tech_contracts_pwa_updates_DocBlocks

Portable decision graph models

Complete original readonly graph, node, edge, policy, revision, recursive trace and evaluation declarations; runtime evaluation stays outside Core.

Use it to

  • Share decision graph, revision, trace and evaluation contracts without importing a decision runtime.

Choose another boundary when

  • A decision graph evaluator, policy runtime or persisted revision store is required.

@lssm-tech/lib.contracts-spec-core/decisioning/typesDecisionGraphRef, DecisionGraphDocument, DecisionGraphRevision, DecisionTrace, DecisionEvaluation

Portable reference-kind payload models

Six existing complete Zod payload models and frozen schema-backed definitions; no populated registry or live provider binding.

Use it to

  • Describe code-symbol, database-record, file, link, media and object reference payloads through portable canonical kinds

Choose another boundary when

  • Populated kind registries, entity/domain bindings, redaction decisions or provider execution are needed.

@lssm-tech/lib.contracts-spec-core/rich-reference/kinds/code-symbol

@lssm-tech/lib.contracts-spec-core/rich-reference/kinds/database-record

@lssm-tech/lib.contracts-spec-core/rich-reference/kinds/file

@lssm-tech/lib.contracts-spec-core/rich-reference/kinds/link

@lssm-tech/lib.contracts-spec-core/rich-reference/kinds/media

@lssm-tech/lib.contracts-spec-core/rich-reference/kinds/object

Imports and export paths.

74 entries

These are package-manifest entry points. Named symbols listed above come from the capability catalogue; this is not an exhaustive TypeScript symbol reference.

74 imports · showing 35

Dependencies and related packages.

Runtime dependencies 3
zod
catalog:
Development dependencies 3
@types/bun
catalog:types

Package scripts.

Commands declared by this package. Review its setup requirements before running them; no command here was executed by this review.

buildcontractspec-bun-build build
build:bundlecontractspec-bun-build transpile
build:typescontractspec-bun-build types
prebuildcontractspec-bun-build prebuild
devcontractspec-bun-build dev
lint:checknode ../../../scripts/biome.cjs check .
typechecktsgo --noEmit -p tsconfig.check.json
testbun test ./src
publish:pkgbun publish --tolerate-republish --ignore-scripts --verbose
publish:pkg:canarybun publish:pkg --tag canary
Your view

Make room for your context.

Shape the presentation around this moment. You can change it whenever you need.

Your context

The different parts of you

Choose a starting point

A useful mix of context, visuals and gentle guidance.

Tune each dimension
Each dimension can change independently. Product permissions and available actions stay unchanged.

Support the way you begin and return

Tune your support

Reading comfort

Choose your language

Interface language changes text only. Markets, prices and workflows keep their own settings.

Translation coverage

Original source

Navigation151
Graph616
Categories378
Portfolio833
Examples2,035
Source preview1,542

More translations will be added as content is reviewed.

This preference is saved on this browser.

Search the website

Useful starting points

No results. Try a shorter phrase, an operation name or another search area.

A LITTLE ROOM TO EXPLORE

Find something to explore.

Open a closer look on this page, try a different perspective, or follow the detail into its own page.

How previews and controls work
01

Look before you leave

Hover a link or focus it with Tab to see a preview. Clicking the original link or pressing Enter always opens its destination.

02

Stay with the context

Move into the preview to explore its sections. Use Alt + ↓ from a focused link to enter it with the keyboard. Escape closes it.

03

Open the possibilities

Disclosure rows, perspective choices and highlighted controls reveal more. Your view changes reading comfort and the context you explore.

A separate button for a closer look

Show small preview buttons beside links where there is room. Tap the eye to inspect, or tap the link to go straight there. This choice stays in this tab.

No browsing history is collected. Reduced motion follows your device and Your view.