libraryPackage manifestv0.1.5

lib.contractspec-connect

Provider-neutral packet authority and durable decision receipts for ContractSpec Connect.

@lssm-tech/lib.contractspec-connect
Source, release and verification context

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

Package source ↗ Manifest ↗
webserverbrowserbunnode
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.contractspec-connectplatform

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

6 declaracionesSELECT TO INSPECT

@lssm-tech/lib.contractspec-connect

Provider-neutral packet authority for ContractSpec Connect.

The ./operations/review/* and ./operations/governance/* subpaths own the existing review decision, assignment, escalation, policy and constraint operation declarations. Their schemas, error contracts, policy references and approval requirements are unchanged. These declarations do not issue approval or execute policy changes; existing compatibility paths forward to the same canonical objects. The root trust-kernel entry remains unchanged.

The package exposes digest-bound context, plan, pre-mutation, post-diff, and promotion decisions without depending on the workspace bundle or a concrete CI, storage, identity, cloud, or analytics provider.

Production hosts use durable_required mode. A permit is usable only when its receipt was appended to the injected durable store and exact read-back matches the issued digest. Durable decisions also require a host-injected Ed25519 signature port; private keys never enter semantic requests. Consumers can use checkConnectPermitFromStore to re-read and verify the signed receipt at the point of use. Missing storage or signing, persistence errors, stale or expired receipts, scope drift, and substituted read-back all fail closed.

ts
import {
  assertConnectPermit,
  createConnectDecisionRequest,
  createConnectPacketAuthority,
} from "@lssm-tech/lib.contractspec-connect";

const authority = createConnectPacketAuthority({
  durabilityMode: "durable_required",
  policy,
  receiptStore,
  signaturePort,
  clock,
  idFactory,
});

const request = createConnectDecisionRequest({
  id: "connect.request.patch-1",
  phase: "pre_mutation",
  scope,
  actorRef: "agent:builder",
  requestedAt: clock.now(),
  contextPacketRef,
  planPacketRef,
  deliveryPlanRef,
  qualityPlanRef,
  target: {
    action: "apply_patch",
    pathPrefixes: ["packages/contracts"],
  },
  predecessorDecisionRefs: [],
});

const receipt = await authority.decide(request);
assertConnectPermit(receipt, {
  phase: "pre_mutation",
  request,
  now: clock.now(),
  requireDurable: true,
});

Connect decides policy. Builder produces candidate code. CI executes approved quality plans. Runtime Nodes execute the separately governed work orders issued through the V3 bridge below. This package does not merge, release, deploy, or execute provider effects.

Reference vocabulary

The Connect reference types (ConnectSha256Digest, ConnectMutationAction, ConnectPromotionAction, ConnectAction, ConnectArtifactRefV1, the decision, context-packet, plan-packet, delivery-plan and quality-plan refs, and ConnectAuthorityScopeV1) are owned by Core at @lssm-tech/lib.contracts-spec-core/connect-references. This package re-exports the same types from ./contracts and the root, so existing imports keep working. Specs that only reference Connect decisions, such as Builder delivery authority, import the Core vocabulary and do not depend on this runtime.

Lifecycle authority for host hooks

@lssm-tech/lib.contractspec-connect/lifecycle-authority decides how an operator's durable hook grant governs host lifecycle hooks and follows the agent's own commits. It is pure: hosts supply a read-only git port (ConnectRepositoryLineagePort) and their governed and operator-only path classification (ConnectPathClassifierPort).

  • CONNECT_LIFECYCLE_SEMANTICS: session start and stop are read-only grant checks, a handoff records a non-terminal checkpoint, no lifecycle hook terminalizes the grant, and merge is a promotion that is never delegated to a local grant.
  • evaluateConnectGrantLineage: an exact grant applies only at its anchor commit; a lineage grant follows HEAD on the same branch through at most CONNECT_GRANT_LINEAGE_MAX_COMMITS descendant commits whose changes stay inside the signed path prefixes and never touch operator-only files. It never widens the signed scope, and repository failures refuse.
  • evaluateConnectLifecycleAuthority: ordered refusals (promotion_not_delegated, no_grant, revoked, expired, workspace_mismatch, actor_mismatch, event_not_granted, scope_mismatch, then the lineage refusals).
  • shellWordsTargetOperatorGrant and isConnectOperatorGrantStorePath name the operator-only grant command and store, so hosts can deny agent self-grants.

The workspace bundle's connect hook commands implement the ports; see docs/refactoring/lssm-ecosystem/HOOK-AUTHORITY-DESIGN.md for the wiring.

Connect-owned Runtime Node V3 issuance

@lssm-tech/lib.contractspec-connect/runtime-v3 exports createConnectRuntimeV3Authority and createConnectEd25519SignaturePort. The issuer runs the existing packet authority in durable_required mode. Hosts supply current policy, append-only receipt storage, a real signature port, a scoped issuance-evidence store, current revocation lookup, trusted clock, ID factory and issuer reference. Missing, unavailable or inconsistent ports fail closed.

issueLifecycle accepts a pre-mutation request plus canonical unsigned standard and mandatory cleanup drafts, two pristine budget reservations and the accepted operation. Caller drafts cannot supply issuer, signature, authorization or issuance time fields. The request actor/scope and the exact draft, plan, source and budget digests are bound into the signed decision request. Connect derives both signed orders and pending cleanup authority from that durable decision, rechecks current policy/revocation, and returns only after exact issuance-evidence read-back. Concurrent exact retries return the same persisted lifecycle; conflicting requests for the same scoped operation cannot replace it.

The standard order expires no later than the policy receipt. The cleanup order has no expiresAt; its review time and execution deadline never erase custody. verifyCleanupCustody verifies retained signed issuance evidence even after normal expiry or revocation. It is historical verification, not permission to execute a cleanup effect. Runtime Node still requires independent current cleanup observation, nonce, scope and custody checks for provider execution.

verifyAdmission checks accepted, authorizing or queued operations with no execution tuple. verifyDispatch remains queued-only. Both reread exact issuance and receipt evidence, recompute the signed payload, verify its Ed25519 signature, reevaluate current policy, check revocation before and after policy work, and reject clock regression or expiry. They implement the canonical runtime verification boundary; SQLite/PostgreSQL still own atomic budget reservation, order registration, claims, queue transport and terminal receipts.

The issuance store is Connect authorization evidence, not another runtime owner. Its append must be atomic first-write-wins for the full tenant/workspace/ environment/operation tuple; immutable records retain the exact draft, request, receipt and resulting lifecycle. Normal revocation is a separate authoritative lookup and must never delete cleanup liability or historical decision evidence.

The WebCrypto adapter signs with host-injected Ed25519 CryptoKey objects and verifies against the configured public key/reference. It does not load keys, generate production identities or fall back to a fixture signer. Tests use real nonextractable ephemeral keys, file-backed SQLite receipt/issuance/revocation state, close/reopen and the actual SQLite Runtime Node issuance/dispatch adapters. Live policy, identity provisioning and key custody remain host configuration.

Concrete adapter qualification

The real local Ed25519/durable-authority SQLite composition test belongs to the SQLite integration†, which injects Connect into its issuance and dispatch adapters. From repository root, run bun test ./packages/integrations/lssm-os-state-sqlite/src/connect-runtime-v3.test.ts. The Connect package's own bun test remains provider-neutral.

Canonical compatibility leaves: ./operations/registry.governance, ./operations/registry.review. These leaves preserve the original implementations and object/class identity; legacy ContractSpec imports forward to these owners.

Declared capabilities.

ContractSpec Connect packet authority

Issue and verify digest-bound context, plan, mutation, diff, and promotion decisions.

Use it to

  • Gate Builder mutations and delivery promotions through durable packet-level authority

Requires

  • TypeScript

Choose another boundary when

  • The host cannot provide durable receipt storage for production authority.

@lssm-tech/lib.contractspec-connectcreateConnectPacketAuthority

Imports and export paths.

34 entries

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

34 importaciones

Dependencies and related packages.

Runtime dependencies 6
zod
catalog:
Development dependencies 3
typescript
catalog:

Package scripts.

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

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
cleanrimraf dist .turbo
devcontractspec-bun-build dev
lintbun run lint:fix
lint:fixnode ../../../../scripts/biome.cjs check --write .
lint:checknode ../../../../scripts/biome.cjs check .
prebuildcontractspec-bun-build prebuild
testbun test
typechecktsgo --noEmit
Tu vista

Make room for your context.

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

Tu contexto

The different parts of you

Choose a starting point

Una mezcla útil de contexto, imágenes y orientación discreta.

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

Comodidad de lectura

Elige tu idioma

El idioma de la interfaz solo cambia el texto. Los mercados, precios y flujos de trabajo conservan sus propios ajustes.

Cobertura de traducción

Parte del contenido se muestra en inglés.

Navegación151
Grafo616
Categorías188
Portafolio332
Ejemplos2035
Vista previa de la fuente41

Se añadirán más traducciones a medida que se revise el contenido.

Esta preferencia se guarda en este navegador.

Buscar en el sitio web

Puntos de partida útiles

Sin resultados. Prueba una frase más corta, un nombre de operación u otro ámbito de búsqueda.

UN POCO DE ESPACIO PARA EXPLORAR

Encuentra algo que explorar.

Abre una vista detallada en esta página, prueba otra perspectiva o sigue el detalle a su propia página.

Cómo funcionan las vistas previas y los controles
01

Mirar antes de salir

Pasa el cursor por un enlace o enfócalo con Tab para ver una vista previa. Hacer clic en el enlace original o pulsar Intro siempre abre su destino.

02

Mantener el contexto

Entra en la vista previa para explorar sus secciones. Usa Alt + ↓ desde un enlace enfocado para entrar con el teclado. Escape la cierra.

03

Abrir las posibilidades

Las filas desplegables, las perspectivas y los controles destacados revelan más. Tu vista cambia la comodidad de lectura y el contexto que exploras.

Un botón separado para mirar más de cerca

Muestra pequeños botones de vista previa junto a los enlaces donde haya espacio. Toca el ojo para inspeccionar o el enlace para ir directamente. Esta elección permanece en esta pestaña.

No se recoge historial de navegación. El movimiento reducido sigue tu dispositivo y Tu vista.