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 déclarationsSELECT 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 imports

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
Votre vue

Make room for your context.

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

Votre contexte

The different parts of you

Choose a starting point

Un mélange utile de contexte, de visuels et de guidage discret.

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

Confort de lecture

Choisir votre langue

La langue de l’interface change uniquement le texte. Les marchés, les prix et les parcours conservent leurs propres paramètres.

Couverture des traductions

Une partie du contenu est affichée en anglais.

Navigation151
Graphe616
Catégories378
Portfolio833
Exemples2 035
Aperçu de la source1 542

D’autres traductions seront ajoutées à mesure que le contenu sera relu.

Cette préférence est enregistrée dans ce navigateur.

Rechercher sur le site

Des points de départ utiles

Aucun résultat. Essayez une expression plus courte, un nom d’opération ou un autre périmètre de recherche.

UN PEU DE PLACE POUR EXPLORER

Trouvez quelque chose à explorer.

Ouvrez un aperçu détaillé sur cette page, essayez une autre perspective ou suivez le détail vers sa propre page.

Fonctionnement des aperçus et des commandes
01

Regarder avant de partir

Survolez un lien ou sélectionnez-le avec Tab pour voir un aperçu. Cliquer sur le lien d’origine ou appuyer sur Entrée ouvre toujours sa destination.

02

Rester dans le contexte

Entrez dans l’aperçu pour explorer ses sections. Depuis un lien sélectionné, utilisez Alt + ↓ pour y entrer au clavier. Échap le ferme.

03

Ouvrir les possibilités

Les lignes dépliables, les choix de perspective et les commandes mises en évidence révèlent davantage. Votre vue adapte le confort de lecture et le contexte exploré.

Un bouton séparé pour voir de plus près

Affichez de petits boutons d’aperçu à côté des liens quand l’espace le permet. Touchez l’œil pour examiner ou le lien pour y aller directement. Ce choix reste dans cet onglet.

Aucun historique de navigation n’est collecté. La réduction des animations suit votre appareil et Votre vue.