Skip to content

feat(runtime): add format-aware WAPP artifacts - #535

Open
wolfy-j wants to merge 5 commits into
mainfrom
feat/generic-artifact-resources
Open

feat(runtime): add format-aware WAPP artifacts#535
wolfy-j wants to merge 5 commits into
mainfrom
feat/generic-artifact-resources

Conversation

@wolfy-j

@wolfy-j wolfy-j commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Use existing WAPP filesystem resources as format-aware artifacts through meta.artifact.format.
  • Validate declared artifacts during module publish and application pack.
  • Reconcile artifacts during CLI install/update, cold boot, and Hub-backed dynamic install/update/uninstall.
  • Register formats during core boot. The initial node-package adapter validates package.json, rejects install lifecycle scripts, and owns the npm output subtree.
  • Process workspace replacements through the same path as packed WAPP resources.

Design

  • The existing resolver and Hub client continue to own module selection, download, and integrity.
  • The artifact registry dispatches by format. Each adapter owns format-specific validation and a non-overlapping output root.
  • Full install and runtime reconciliation produce exact state. Targeted install updates only selected artifacts.
  • The application materialization root is configured through artifact.materialization_root; by default it is the parent of the dependency vendor directory.
  • Materialization uses staged root swaps, an OS process lock, rollback, and recovery. Unsafe or non-portable resource trees and output paths are rejected.
  • This adds no second resolver, package registry, archive format, module-lock schema, Hub API, module manifest, or format-specific dependency semantics.
  • Build-only dependency semantics, redistribution policy, and host ABI validation are outside this PR.

Verification

  • go test ./... -count=1
  • go test -race ./boot/deps/artifact/... ./boot/deps/hub ./boot/components/core ./cmd/internal/entries ./cmd/wippy/cmd -count=1
  • go vet ./boot/deps/artifact/... ./boot/deps/hub ./boot/components/core ./cmd/internal/entries ./cmd/wippy/cmd
  • golangci-lint run ./boot/deps/artifact/... ./boot/deps/hub/... ./boot/components/core/... ./cmd/internal/entries/... ./cmd/wippy/cmd/...
  • Windows test-binary cross-compilation

Copilot AI review requested due to automatic review settings July 29, 2026 22:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) and wippy 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/artifact registry/inspection/materialization plumbing plus a node-package adapter 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.

Comment thread boot/deps/artifact/registry.go
Comment thread cmd/wippy/cmd/artifacts.go
Copilot AI review requested due to automatic review settings July 29, 2026 22:48
@wolfy-j wolfy-j changed the title feat(cli): add format-aware WAPP artifacts feat(runtime): add format-aware WAPP artifacts Jul 29, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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])

Comment thread boot/deps/artifact/wapp.go
Copilot AI review requested due to automatic review settings July 30, 2026 00:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 37 out of 37 changed files in this pull request and generated 1 comment.

Comment thread cmd/wippy/cmd/update.go
Copilot AI review requested due to automatic review settings July 30, 2026 01:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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), --unpack installs 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).

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.

3 participants