§11 Lifecycle
Normative pack lifecycle (lint, install, activate, connect, exec), the four availability flags, and the store.
11.1 Stages#
| Stage | Precondition | Effect | Capability |
|---|---|---|---|
| lint | Directory readable | Validates §2 to §5; no state change | none |
| install | Lint passes | Pack present in the runtime's catalog or store | pack.install |
| activate | Installed | Pack's commands loadable for the session; Skill copied (§5.4) | none |
| connect | Activated; Binding not public | Binding established (§8.5) | pack.connect |
| exec | Activated; connected if Binding requires; grants | Command runs (§6) | verb.exec.read / verb.exec.write |
| deactivate | none | Removes activation and connection for the session | none |
| uninstall | none | Removes from catalog or store | pack.install |
- A runtime MUST NOT execute a command of a pack that is not activated.
- A runtime MUST NOT skip lint on install. A pack that fails lint MUST NOT be installed.
- A runtime MAY treat
installandactivateas a single user action, but MUST expose both states in availability (§11.2). - Deactivate MUST also drop
connectedfor the session. - A runtime MUST refuse to uninstall its own bootstrap pack, if it has one.
- 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:
| Flag | Meaning |
|---|---|
installed | Present in the store |
activated | Loaded for the current session |
connected | Binding established (always true for public) |
executable | Per command: activated ∧ (connected ∨ Binding public) ∧ Principal holds the required grant ∧ Adapter runnable in this runtime |
executableis computed per command, not per pack.- A pack's
statusMUST be one ofavailable,installed,activated,connected,executable, orunavailable, reflecting the highest reached stage. Runtimes MAY report more than one. - A
sense_onlypack MUST reportexecutable: falsefor 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#
- A runtime MAY ship a bootstrap pack whose commands describe the runtime's own
lifecycle (
doctor,list,install,activate,connect,availability,exec, …). - A bootstrap pack follows every rule of this specification. One that manages
the runtime's local store is a
runtime-plane pack with Bindinglocal; one that acts on an operator's fleet is acontrol-plane pack (§2.5). - 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.