Skip to content

Allow packages without binaries or apps when they provide trigger actions or env vars - #598

Open
joahg wants to merge 2 commits into
cashapp:masterfrom
joahg:joah/content-only-packages
Open

Allow packages without binaries or apps when they provide trigger actions or env vars#598
joahg wants to merge 2 commits into
cashapp:masterfrom
joahg:joah/content-only-packages

Conversation

@joahg

@joahg joahg commented Aug 5, 2026

Copy link
Copy Markdown

Context: #597 — composing agent-skills-style content packages from existing Hermit primitives.

Hermit currently rejects any package manifest that does not declare at least one binary or app. This prevents composing content-only packages (e.g. a git-sourced payload that is materialised into the environment via on unpack/on activate actions) without adding a dummy no-op binary that pollutes bin/ and PATH.

This relaxes the validation so a package with no binaries and no apps is still valid when it declares at least one resolved lifecycle trigger action or environment variable. Empty trigger blocks such as on unpack {} do not count, and manifests that provide none of these remain rejected with the existing ErrNoBinaries error.

Tested with go test ./... and golangci-lint run.

joahg and others added 2 commits August 4, 2026 21:49
… env

Hermit currently rejects any package manifest that does not declare at
least one binary or app. This prevents composing content-only packages
(e.g. a git-sourced payload that is materialised into the environment
via "on unpack"/"on activate" actions) without adding a dummy no-op
binary as a workaround.

Relax the validation so a package with no binaries and no apps is still
valid when it declares lifecycle triggers or environment variables.
Manifests that provide none of these remain rejected with the existing
ErrNoBinaries error.

Buzz-Message: buzz://message?channel=573ff355-6c19-422d-b425-112853d0ec7e&id=16f5b666c0976829a1985868753407c7b20b393d89f99a8b39106be9fe6a1514
Amp-Thread-ID: https://ampcode.com/threads/T-019fce27-e59e-727c-b6d3-cdeeba894a4e
Co-authored-by: Amp <amp@ampcode.com>
An empty trigger block such as 'on unpack {}' creates a trigger map
entry with no actions, so checking the number of trigger events alone
would accept packages that contribute nothing to the environment.
Count resolved trigger actions instead.

Buzz-Message: buzz://message?channel=573ff355-6c19-422d-b425-112853d0ec7e&id=37a4a83af83ddcf40f55a799a2d7e52e69f2908db5098993c82d4a96727015a6
Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019fce44-560f-770d-bacb-fba12dd9ae31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant