appstore install: render the product demo at the last step#395
Open
Alexgodoroja wants to merge 1 commit into
Open
appstore install: render the product demo at the last step#395Alexgodoroja wants to merge 1 commit into
Alexgodoroja wants to merge 1 commit into
Conversation
When an installed app's (already sha-verified) catalogue metadata.json carries a `product_demo` — a compact, example-driven usage guide authored at submit time — print it as the final step of `pilotctl appstore install`, so the agent that just installed the app can drive it right away. Additive and best-effort: absent or malformed demos change nothing, and it is guarded so a demo can never turn a finished install into a failure. The demo DATA lives entirely in metadata.json (reaching the catalogue via the app-template publish pipeline); this change is only the INSERTION mechanism — a single pure renderer (RenderInstallDemo) plus the last-step hook. The two are decoupled: the renderer is a pure function of its argument and embeds no app-specific content. - appMetadata gains an optional ProductDemo field (omitempty; older clients ignore it — no new trust surface, it rides inside the sha-verified metadata). - appstore_demo.go: the ProductDemo wire types + RenderInstallDemo. - 8 lines in appstore.go call the hook only for a successful catalogue install, human-output path only (never corrupts --json). - Tests: unmarshal, nil-safety, metered vs local render, render purity, plus an end-to-end test that drives REAL metadata.json (produced by app-template's BuildMetadata from the merged duckdb + agentphone submissions) through the exact install render path and budget-checks the worked flow.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
When an installed app's catalogue
metadata.jsoncarries an optionalproduct_demo— a compact, example-driven usage guide authored once at submit time (see app-template#88) — print it as the last step ofpilotctl appstore install, so the agent that just installed the app can drive it right away instead of installing and never using it.Design: data ↔ mechanism are decoupled
metadata.json, which reaches the catalogue through the app-template publish pipeline. This PR adds no demo content.RenderInstallDemo) plus the last-step hook. A test asserts the renderer's purity and that it leaks no content across demos.Safety / non-breaking
appMetadatagains an optionalProductDemofield (omitempty) — older clients ignore it. It rides inside the already-sha-verifiedmetadata.json, so no new trust surface and no change to catalogue signing.--json), and isrecover-guarded so a malformed/offline demo can never fail a finished install.product_demo(every app until metadata is backfilled) ⇒ install behaves exactly as before. Inert until the data arrives.Tests
metadata.json(produced by app-templateBuildMetadatafrom the merged duckdb + agentphone submissions) through the exact install render path, budget-checking the metered worked flow ≤ $5.00.go build ./...+go test ./cmd/pilotctl/ ./internal/catalogue/green;gofmtclean.Follow-up (not here)
Demo content reaches
metadata.jsonvia the app-template publish pipeline (publish-rich-from-r2.sh, updated in app-template#88, carriesproduct_demo+ recomputesmetadata_sha256so the signed-catalogue flow handles it). This PR is the consumer side, safe to merge independently.