feat(runtime): add format-aware WAPP artifacts - #535
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces format-aware artifact resources for WAPP packs in the wippy CLI: resources can opt into artifact validation/materialization via meta.artifact.format, with a CLI-local registry (initially supporting a node-package format) and a new command to safely materialize artifacts to a stable path.
Changes:
- Validate declared artifact resources during
wippy publish(module pack) andwippy pack(application pack). - Add
wippy artifacts materialize <pack.wapp> <namespace:name>to validate + transactionally mirror a specific embedded resource under a format-derived path. - Add
cmd/internal/artifactregistry/inspection/materialization plumbing plus anode-packageadapter and tests.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| cmd/wippy/cmd/publish.go | Adds artifact resource validation during module packaging. |
| cmd/wippy/cmd/pack.go | Adds artifact resource validation during application packing. |
| cmd/wippy/cmd/artifacts.go | Introduces wippy artifacts materialize command for validating/materializing one embedded artifact. |
| cmd/wippy/cmd/artifacts_test.go | Tests end-to-end materialization from a synthetic .wapp containing a node-package artifact. |
| cmd/wippy/cmd/artifact_formats.go | Adds CLI-local artifact registry wiring + shared validation helper. |
| cmd/internal/artifact/resources.go | Implements resource scanning/inspection and destination collision detection across artifacts. |
| cmd/internal/artifact/registry.go | Adds declaration parsing, format registry/dispatch, and portable path validation. |
| cmd/internal/artifact/registry_test.go | Tests declaration parsing, explicit registration, and destination collision behavior. |
| cmd/internal/artifact/nodepackage/format.go | Implements node-package inspection: identity/version derivation, semver checks, lifecycle script rejection, stable path. |
| cmd/internal/artifact/nodepackage/format_test.go | Tests node-package inspection success + rejection cases. |
| cmd/internal/artifact/materialize.go | Implements rollback-safe exact mirroring (staging + rename + backup) and portable path enforcement for file trees. |
| cmd/internal/artifact/materialize_test.go | Tests exact mirroring semantics and rejection of non-portable/escaping paths. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 28 out of 28 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
cmd/wippy/cmd/artifacts.go:40
- The error return from
cmd.Flags().GetString("root")is ignored. If this helper is called outside the Cobra wiring (e.g. tests/other callers) and the flag is missing or misconfigured, this will silently materialize into the default "" root and produce confusing filesystem writes/errors.
func runArtifactsMaterialize(cmd *cobra.Command, args []string) error {
root, _ := cmd.Flags().GetString("root")
resourceID, err := parseArtifactResourceID(args[1])
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 39 out of 39 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
cmd/wippy/cmd/install.go:224
- When an extracted module directory already exists (
resolved.Path), the cache-hit path only verifies that the canonical WAPP exists and matches the expected digest, then skips both download and extraction. If the directory is stale (e.g. lock version changed but the old directory is still present, or a previous install downloaded the new WAPP but failed before extraction),--unpackinstalls can leave the on-disk directory out of sync with the selected version.
To ensure convergence when shouldUnpack is true, schedule an extraction from the verified canonical WAPP before continuing (or otherwise verify the extracted directory matches the expected artifact).
Summary
meta.artifact.format.node-packageadapter validatespackage.json, rejects install lifecycle scripts, and owns thenpmoutput subtree.Design
artifact.materialization_root; by default it is the parent of the dependency vendor directory.Verification
go test ./... -count=1go test -race ./boot/deps/artifact/... ./boot/deps/hub ./boot/components/core ./cmd/internal/entries ./cmd/wippy/cmd -count=1go vet ./boot/deps/artifact/... ./boot/deps/hub ./boot/components/core ./cmd/internal/entries ./cmd/wippy/cmdgolangci-lint run ./boot/deps/artifact/... ./boot/deps/hub/... ./boot/components/core/... ./cmd/internal/entries/... ./cmd/wippy/cmd/...