Skip to content

appstore install: render the product demo at the last step#395

Open
Alexgodoroja wants to merge 1 commit into
mainfrom
feat/product-demos-install
Open

appstore install: render the product demo at the last step#395
Alexgodoroja wants to merge 1 commit into
mainfrom
feat/product-demos-install

Conversation

@Alexgodoroja

Copy link
Copy Markdown
Collaborator

What

When an installed app's catalogue metadata.json carries an optional product_demo — a compact, example-driven usage guide authored once at submit time (see app-template#88) — print it as the last step of pilotctl 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

  • The data (the demo) lives entirely in metadata.json, which reaches the catalogue through the app-template publish pipeline. This PR adds no demo content.
  • This PR is only the insertion mechanism: one pure renderer (RenderInstallDemo) plus the last-step hook. A test asserts the renderer's purity and that it leaks no content across demos.

Safety / non-breaking

  • appMetadata gains an optional ProductDemo field (omitempty) — older clients ignore it. It rides inside the already-sha-verified metadata.json, so no new trust surface and no change to catalogue signing.
  • The hook fires only on a successful catalogue install, human-output path only (never corrupts --json), and is recover-guarded so a malformed/offline demo can never fail a finished install.
  • Absent product_demo (every app until metadata is backfilled) ⇒ install behaves exactly as before. Inert until the data arrives.

Tests

  • Unmarshal, nil-safety, metered-vs-local render, render purity.
  • An end-to-end test driving REAL metadata.json (produced by app-template BuildMetadata from 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; gofmt clean.

Follow-up (not here)

Demo content reaches metadata.json via the app-template publish pipeline (publish-rich-from-r2.sh, updated in app-template#88, carries product_demo + recomputes metadata_sha256 so the signed-catalogue flow handles it). This PR is the consumer side, safe to merge independently.

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.
@Alexgodoroja Alexgodoroja requested a review from TeoSlayer as a code owner July 15, 2026 20:31
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.

1 participant