Packs
A pack is a portable, hash-verified bundle of artifacts plus their provenance/risk/drift/compatibility metadata. Pack operations are preview-first; materialization is opt-in and root-confined.
Building a pack
Section titled “Building a pack”export_pack({ name, artifacts })— build a v1 manifest from supplied artifact bodies. Each artifact records asha256.export_pack({ name, version: 2, itemIds: [...], includeRisk?, includeDrift?, includeCompatibility?, targetTool? })— build a v2 manifest from registry items, populating real sections:provenance— each item’s upstream links (+ resolved source)risk— persisted risk findings (whenincludeRisk)drift— the latest persisted drift report (whenincludeDrift)compatibility—assess_compatibilitytotargetTool(or the item’s own tool) whenincludeCompatibilitypolicies— policy findings for the bundled artifacts
Both forms are previews (dryRun: true, writes: []). Manifests are
deterministic JSON — the same inputs produce the same bytes.
Verifying & importing
Section titled “Verifying & importing”verify_pack({ pack })— recompute and check every artifact hash; returnsok: falsewith errors when any hash has changed.import_pack({ pack })— preview an import; every artifact is markedtrustState: "untrusted"and nothing is hydrated or applied. Review withscan_riskandset_trust_statebefore any apply.
Materializing (opt-in, approval-gated)
Section titled “Materializing (opt-in, approval-gated)”materialize_pack({ outputPath, pack, approval }) writes a v1 manifest +
artifact files under an allowed directory.
- Preview by default; requires
approval: "approve"to write. outputPathmust be inside a configuredPACK_OUTPUT_ROOTSdirectory (env, comma-separated,~expanded). With none configured, materialization is refused — the safe default.- Returns a rollback handle — the run can be reversed, removing the written files and directories.
- After materialization,
verify_packon the written manifest passes.
PACK_OUTPUT_ROOTS="$HOME/quartermaster-packs" npm start# then: materialize_pack({ approval: "approve", outputPath: "~/quartermaster-packs/core", pack })See the security model for the write-safety guarantees.