§11 Lifecycle

Normative pack lifecycle (lint, install, activate, connect, exec), the four availability flags, and the store.

On this page

11.1 Stages#

StagePreconditionEffectCapability
lintDirectory readableValidates §2 to §5; no state changenone
installLint passesPack present in the runtime's catalog or storepack.install
activateInstalledPack's commands loadable for the session; Skill copied (§5.4)none
connectActivated; Binding not publicBinding established (§8.5)pack.connect
execActivated; connected if Binding requires; grantsCommand runs (§6)verb.exec.read / verb.exec.write
deactivatenoneRemoves activation and connection for the sessionnone
uninstallnoneRemoves from catalog or storepack.install
  1. A runtime MUST NOT execute a command of a pack that is not activated.
  2. A runtime MUST NOT skip lint on install. A pack that fails lint MUST NOT be installed.
  3. A runtime MAY treat install and activate as a single user action, but MUST expose both states in availability (§11.2).
  4. Deactivate MUST also drop connected for the session.
  5. A runtime MUST refuse to uninstall its own bootstrap pack, if it has one.
  6. Activation MUST NOT require an MCP configuration or new host tools (§12.2.1).

11.2 Availability#

For each pack a runtime MUST be able to report:

FlagMeaning
installedPresent in the store
activatedLoaded for the current session
connectedBinding established (always true for public)
executablePer command: activated ∧ (connected ∨ Binding public) ∧ Principal holds the required grant ∧ Adapter runnable in this runtime
  1. executable is computed per command, not per pack.
  2. A pack's status MUST be one of available, installed, activated, connected, executable, or unavailable, reflecting the highest reached stage. Runtimes MAY report more than one.
  3. A sense_only pack MUST report executable: false for Execute while still being valid; Sense activation is reported separately (§7.4).

11.3 Store#

Informative. The reference store is $HCP_HOME (default ~/.hcp):

~/.hcp/
  packs/<pack_id>/       installed pack directories
  skills/<pack_id>/      SKILL.md copies (§5.4)
  state.json             { activated: [], connected: [], grants? }

A conforming runtime MAY use any store, including a database. It MUST preserve the semantics of §11.1 and §11.2.

11.4 Bootstrap#

  1. A runtime MAY ship a bootstrap pack whose commands describe the runtime's own lifecycle (doctor, list, install, activate, connect, availability, exec, …).
  2. A bootstrap pack follows every rule of this specification. One that manages the runtime's local store is a runtime-plane pack with Binding local; one that acts on an operator's fleet is a control-plane pack (§2.5).
  3. The reference bootstrap pack is hcp-cli; it is installed automatically on first use and cannot be uninstalled.

11.5 Reference CLI (informative)#

The reference binary is hcpx, also installed as hcp.

hcpx lint <pack_dir>
hcpx install <pack_dir>
hcpx activate <pack_id> [pack_id…]
hcpx connect <pack_id>
hcpx exec <pack_id> <verb_key> [-- k=v …]
hcpx availability [pack_id]
hcpx deactivate <pack_id> [pack_id…]
hcpx uninstall <pack_id>

Every command accepts --json.