Skip to main content

Crate lifeloop

Crate lifeloop 

Source
Expand description

Provider-neutral lifecycle contracts for AI harnesses.

docs/specs/lifecycle-contract/body.md is the normative target. This module implements the lifeloop.v0.2 slice of that contract: the wire enums, lifecycle receipt, payload envelope, and the callback request/response envelopes that clients implement.

Modules§

adapters
Built-in adapter registry and per-harness manifest constructors. Re-exports of canonical crate-root items.
capability
Capability vocabulary and negotiation entry point. Re-exports the canonical router items so consumers can use lifeloop::capability::* without taking a dependency on the router module path. The CapabilityKind / CapabilityRequest split is preserved deliberately — CapabilityKind is the identity used as a manifest lookup key, and CapabilityRequest adds policy (desired, level).
event
Lifecycle event vocabulary. Re-exports of canonical crate-root items.
host_assets
Host integration asset rendering and merge behavior.
manifest
Adapter manifest types and registry. Re-exports of canonical crate-root items.
protocol
Hook-protocol payload rendering for harness adapters.
router
Lifecycle router skeleton: pre-dispatch validation and adapter resolution.
telemetry
Lifecycle telemetry readers.

Structs§

AcceptablePlacement
AdapterManifest
Adapter manifest. Issue #6 lands the full shape; pre-issue-#6 drafts shipped a stub with only schema_version, adapter_id, adapter_version, display_name, roles, integration_modes, and lifecycle_events.
CallbackRequest
CallbackResponse
CapabilityDegradation
DispatchEnvelope
Wire shape carrying a CallbackRequest and the opaque PayloadEnvelope bodies a dispatch is delivering with.
FrameContext
LifecycleReceipt
ManifestApprovalSurface
Capability claim for operator approval/intervention surfaces. Optional; absent means “no operator surface.”
ManifestContextPressure
Capability claim describing how the adapter surfaces context.pressure_observed lifecycle evidence.
ManifestKnownDegradation
One pre-declared capability degradation the adapter ships with. Lets a manifest say “this build’s context_pressure was native upstream but is currently unavailable here” without firing a runtime capability.degraded event.
ManifestLifecycleEventSupport
Per-event capability claim inside a manifest.
ManifestPlacementSupport
Per-placement capability claim inside a manifest.
ManifestReceipts
Capability claim describing receipt emission and ledger support.
ManifestRenewal
Capability claim for reset/continuation renewal across a harness boundary. Lifeloop reports whether the adapter can prove the lifecycle path and delivery support; clients own renewal leases, continuation-token policy, and thread/session binding.
ManifestRenewalContinuation
Continuation-side renewal capability. Observation means the adapter can prove a continuation boundary happened; payload delivery means it can carry client-provided continuation facts across that boundary.
ManifestRenewalReset
Reset-side renewal capability. native, wrapper_mediated, and manual are separate so a manifest can distinguish a real harness reset surface, a launcher/wrapper path, an operator-only path, and the all-unavailable “no safe reset path” case.
ManifestSessionIdentity
Per-id support claims for harness identity correlation. Optional on the manifest because a telemetry-only adapter may not expose any of these.
ManifestSessionRename
Capability claim for the adapter’s session-rename surface. Optional on the manifest; absent means “no rename concept.”
ManifestTelemetrySource
One telemetry source the adapter exposes for lifecycle evidence.
PayloadEnvelope
PayloadReceipt
PayloadRef
RegisteredAdapter
Registry entry pairing an AdapterManifest with its ConformanceLevel.
Warning

Enums§

AdapterRole
ConformanceLevel
Conformance posture of a registered adapter.
FailureClass
FrameClass
IntegrationMode
LifecycleEventKind
ManifestPlacementClass
Manifest placement classes — the trust-neutral, lifecycle-timing vocabulary the adapter manifest uses to declare placement support.
NegotiationOutcome
PlacementClass
PlacementOutcome
ReceiptStatus
RequirementLevel
RetryClass
SupportState
Support states for adapter capability claims.
ValidationError
Reasons a Lifeloop envelope, payload, or receipt failed validation.

Constants§

SCHEMA_VERSION

Functions§

claude_manifest
Claude manifest. Native-hook integration via .claude/settings.json.
codex_manifest
Codex manifest. Native-hook integration covers Codex’s stable hook surface, including PreCompact in Codex CLI 0.129+. Capability claims here are paired with verification tests in tests/manifest_claims.rs.
gemini_manifest
Gemini pre-conformance manifest.
hermes_manifest
Hermes pre-conformance manifest. Reference-adapter integration supplied as a JSON descriptor at the path declared in crate::host_assets::HERMES_TARGET_ADAPTER.
lifecycle_event_kinds
lookup_manifest
Resolve a registered adapter by adapter_id. Returns None for unknown ids.
manifest_registry
Built-in adapter manifest registry. Order is stable so callers that render a lifeloop adapters listing get a predictable output without sorting client-side.
openclaw_manifest
OpenClaw pre-conformance manifest.
opencode_manifest
OpenCode pre-conformance manifest.