Hello NPK
Build, prove, publish locally, and install a native NPK with the checked-in nexus and nip CLIs.
This proof is the first local Forge package pipeline: nexus orchestrates the proof, nip builds and installs the deterministic package, and BKDL evidence is the package artifact sidecar.
Run the proof
cd nexus-forge/core/nip
./build.sh
cd ../../..
NEXUS_ROOT="$PWD"
export HOME=/tmp/nexus-npk-proof-home
export XDG_DATA_HOME=/tmp/nexus-npk-proof-home/.local/share
export XDG_CONFIG_HOME=/tmp/nexus-npk-proof-home/.config
export XDG_CACHE_HOME=/tmp/nexus-npk-proof-home/.cache
export NEXUS_HOME=/tmp/nexus-npk-proof-home/.nexus
rm -rf "$HOME"
mkdir -p "$HOME/work"
cd "$HOME/work"
"$NEXUS_ROOT/nexus-forge/core/nip/nip" init hello-npk
"$NEXUS_ROOT/nexus-forge/scripts/nexus" forge npk-proof hello-npk
"$NEXUS_ROOT/nexus-forge/scripts/nexus" bazaar validate --local
"$NEXUS_ROOT/nexus-forge/scripts/nexus" bazaar verify-cids --local
"$NEXUS_ROOT/nexus-forge/scripts/nexus" forge export-bundle hello-npk
"$NEXUS_ROOT/nexus-forge/scripts/nexus" forge validate-bundle "$NEXUS_HOME"/bundles/npk/hello-npk/*/*.npk-bundle.tar.gz
"$NEXUS_ROOT/nexus-forge/scripts/nexus" forge import-bundle "$NEXUS_HOME"/bundles/npk/hello-npk/*/*.npk-bundle.tar.gz
"$NEXUS_ROOT/nexus-forge/scripts/nexus" bazaar install --local hello-npk
"$XDG_DATA_HOME/nip/Links/Executables/hello-npk"Expected final output:
hello from hello-npkWhat the commands do
nip init hello-npkcreatespackage.kdlandsrc/main.sh.nexus forge npk-proof hello-npkcallsnip build, emitshello-npk.npk.bkdl.json, signs that BKDL evidence with a local Ed25519 key, embeds the public key PEM in the.sigsidecar, verifies the artifact, publishes the proof into$NEXUS_HOME/artifacts/npk, and writes a local Bazaar registry entry whoseartifactsblock points at the stored NPK, BKDL evidence, and signature sidecar.nexus bazaar validate --localchecks the local trust badge metadata.nexus bazaar verify-cids --localrecomputes the artifact-backed Variant-CID from the BKDL evidence inputs.nexus forge export-bundle hello-npkwrites a portable.npk-bundle.tar.gzwith the stored NPK, BKDL evidence, signature sidecar, and bundle manifest.nexus forge validate-bundle <bundle>verifies the bundle checksum, manifest digests, BKDL evidence, signature sidecar, and bundled NPK.nexus forge validate-bundle-manifest <manifest>checks an extracted bundle manifest against the checked-in Forge bundle schema.nexus forge import-bundle <bundle>checks bundle provenance, publisher identity, local trust roots, and revocation policy before copying the bundle into the local Forge store and publishing a local Bazaar entry for this machine.nexus bazaar install --local hello-npkvalidates local trust, verifies the stored artifact, delegates installation tonip, and registers the package in the local JSON database.
Runtime proof image
After the local package proof exists, project the package evidence into a bootable Micro runtime proof image:
"$NEXUS_ROOT/nexus-forge/scripts/nexus" build --edition=micro --arch=x86_64 --local-proof
"$NEXUS_ROOT/nexus-forge/scripts/nexus" runtime install-proof \
--local hello-npk \
--image "$NEXUS_HOME/artifacts/nexus-micro-x86_64.img" \
--output "$HOME/work/nexus-micro-runtime-hello.img"
"$NEXUS_ROOT/nexus-forge/scripts/nexus" verify "$HOME/work/nexus-micro-runtime-hello.img"The output image has a nexus-runtime-package-proof/v1 manifest, BKDL evidence, and Ed25519 signature. Its runtime manifest records the package Variant-CID, NRP path, read-only NexFS /sysro projection, capability policy, and embedded runtime ledger sector. The QEMU regression verifies the ledger sector digest, boots the image, and checks that the serial output exposes the runtime ledger read from the image:
nexus-forge/tests/test-runtime-package-proof.shThis proves a development bridge from host package identity into boot-visible runtime evidence. The production nxs generation composer remains separate future work.