Skip to content

feat(capy): add capy secrets-manager package#1

Draft
cvince wants to merge 5 commits into
mainfrom
add-capy-package
Draft

feat(capy): add capy secrets-manager package#1
cvince wants to merge 5 commits into
mainfrom
add-capy-package

Conversation

@cvince

@cvince cvince commented Jun 8, 2026

Copy link
Copy Markdown

What

Adds the capy package: the Capy CLI (@capysc/cli@0.6.1) installed into a Minimal environment.

A task that includes packages = ["capy"] gets the capy binary plus a ~/.capy pinhole — the developer's host Capy session is mapped into the box, so in-box capy run -- <cmd> injects branch-scoped secrets with no key material transported in (the shared-session model; trusted dev shells only — not for untrusted agent tasks).

Contents

  • build.ncl — installs @capysc/cli, runtime deps (node-lts, git, ca-certificates, coreutils, glibc, base), usr/lib/node_modules/** output, and env_dir_mappings for ~/.capy (class = 'Credential, read-write).
  • build.sh — npm global install into the output prefix.
  • self-testcapy --version runs in a clean room and matches the pinned version.

Verification

  • minimal package capy → exit 0
  • minimal check capy → all checks pass (incl. standalone tests, fmt, imports)
  • capy --version confirmed running live in a box → 0.6.1

Notes

  • @capysc/cli is public on npm; the build fetches it at build time. Follow-up: vendor the tarball + transitive deps as hash-pinned Sources for a fully hermetic / SLSA build.
  • No secrets in the spec — the session is pinholed at runtime, never embedded.

norrietaylor and others added 4 commits June 8, 2026 00:08
* virtio-kernel-raw: decompress the virtio-linux kernel to a raw Image

Gunzip the virtio-linux Image.gz to an uncompressed aarch64 Image so
consumers (minvmd) can load it with KRUN_KERNEL_FORMAT_RAW, skipping
libkrun's in-VMM gzip decompress (~77 ms, over half of microVM
boot-to-READY).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* minvmd-rootfs: package the minvmd guest rootfs as an ext4 image

Assemble the minvmd microVM guest rootfs (socat + bash + coreutils
closure, bring-up init, /etc/minvmd/manifest boot contract) into a
read-only ext4 image via mke2fs. minvmd loads it as a block device
(krun_add_disk2 -> /dev/vda).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* genericize: rename minvmd-rootfs -> microvm-rootfs, drop product references

Make the packages product-agnostic: microvm-rootfs with /sbin/microvm-init
and /etc/microvm/manifest, and scrub internal references from comments.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* virtio-kernel-raw: handle x86_64 bzImage (not just aarch64 Image.gz)

The kernel is only gzip-compressed on aarch64 (Image.gz); on x86_64
virtio-linux ships a bzImage, so the unconditional gunzip failed the
build there. gzip-test first: decompress when gzip, else pass through.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* microvm-rootfs: ship runtime closure only; harden init + prune

Address review feedback:
- Declare base + socat as runtime_deps and e2fsprogs as a build-only dep
  (mke2fs packs the image), instead of lumping everything in build_deps.
- Remove the build-only e2fsprogs files from the staged tree before packing,
  so the runtime image carries only the runtime closure (mke2fs runs from the
  build sandbox PATH, not from $STAGE). Verified absent from rootfs.img.
- Fail the bring-up init if the READY handshake never succeeds, rather than
  starting the listener and turning a boot failure into a downstream timeout.
- Scope `|| true` to the find invocation so a cd/rm failure still fails the build.

* virtio-kernel-raw: add version plumbing; depend on base

Add the version binding, attrs.upstream_version, and build_args forwarding the
repo's build.ncl contract expects. Depend on base (provides gzip + sh at build)
instead of listing gzip/bash/coreutils individually.

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Installs the Capy CLI (@capysc/cli@0.6.1) into a Minimal environment and
pinholes the developer's ~/.capy session into the box, so in-box
`capy run -- <cmd>` injects branch-scoped secrets without transporting any
key material (shared-session model).

- build.ncl: @capysc/cli install, runtime deps (node-lts, git,
  ca-certificates, coreutils, glibc, base), node_modules output, and a
  ~/.capy Credential pinhole (read-write; trusted dev shells only).
- build.sh: npm global install into the output prefix.
- self-test: capy --version runs in a clean room and matches the pin.

Verified: minimal package capy + minimal check capy pass; capy runs in a box.
The previous `export npm_config_cache="$(pwd)/.npm-cache"` was redundant and
non-deterministic: node/node-lts already wire NPM_CONFIG_CACHE to a Minimal-
managed state dir via env_state_wiring. Simplify build.sh to match the other
npm-CLI packages (pyright, typescript-language-server, mermaid-cli).

Verified: minimal package capy + minimal check capy still pass (incl. self-test).
@cvince cvince marked this pull request as draft June 8, 2026 01:24
Declares capysc/capy-cli as the source of record per the new-package
checklist. (Building from source vs the npm prebuilt is deferred — still
npm-install for now.)
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.

2 participants