Skip to content

scaffold: add json tags to ChangelogRel (metadata.json was Go-cased)#41

Merged
Alexgodoroja merged 2 commits into
mainfrom
fix/changelog-json-tags
Jun 24, 2026
Merged

scaffold: add json tags to ChangelogRel (metadata.json was Go-cased)#41
Alexgodoroja merged 2 commits into
mainfrom
fix/changelog-json-tags

Conversation

@Alexgodoroja

Copy link
Copy Markdown
Collaborator

ChangelogRel had only yaml tags, so json.Marshal emitted Version/Date/Notes into the generated metadata.json changelog instead of version/date/notes — wrong for every app's store page. One-line fix: add json tags (date/notes omitempty). Adds a guard test.

Alex Godoroja added 2 commits June 24, 2026 14:10
The struct had only yaml tags, so the generated metadata.json emitted Go-cased
keys (Version/Date/Notes) instead of version/date/notes — wrong for every app's
store-page changelog. Add json tags (date/notes omitempty). Guard test.
@Alexgodoroja Alexgodoroja merged commit e60819f into main Jun 24, 2026
6 checks passed
Alexgodoroja added a commit that referenced this pull request Jun 24, 2026
So the staging PR doesn't reintroduce Go-cased changelog keys in metadata.json
regardless of merge order with #41.
Alexgodoroja added a commit that referenced this pull request Jun 24, 2026
… verify false-pass (#42)

* scaffold: deliver cli binaries from the R2 artifact registry

Add native-binary delivery for cli backends. A cli app may now declare
`assets` (per-OS/arch url + sha256 + exec_path, with install order/deps/args);
the generator emits:

  - install.json — the staging spec the adapter reads at startup
  - install.sh   — a transparent direct-install path (0o755)
  - internal/backend/stage.go (StageAssets) — at install the adapter selects
    the host os/arch asset, fetches it, sha256-verifies it, stages a single
    file or a tar.gz (extracted via host `tar` with a zip-slip name scan),
    runs any ordered install args, and is idempotent via a .staged/<sha>
    marker. main rewrites the runner's base command to the staged path, so
    the host need not have the CLI pre-installed.

config.go gains the Asset struct, HasAssets/AssetName/AssetHosts/PrimaryExecPath,
ResolveAssets (Kahn topo-sort over deps with order+name tiebreak), and
validateAssets (cli-only; known os/arch; https url; 64-hex sha; relative
exec_path under $APP; unique order per platform). The manifest emits the
fs.read $APP/install.json, fs.write $APP, and per-host net.dial grants only
when assets are present. No-asset cli apps are unchanged.

* publish: map submission artifacts into the built bundle

Submission gains an `artifacts` array (SubArtifact, mirroring scaffold.Asset)
with validateArtifacts() wired into Validate() — cli-only, known os/arch,
https R2 url, 64-hex sha, relative exec_path, unique install order per
platform — so a publisher gets server-authoritative errors before any build.
ToConfig now maps artifacts → scaffold.Config.Assets.

BuildBundle copies the generated install.json (and install.sh) into the shared
bundle dir before the per-platform tar loop, so every platform tarball ships
the staging spec. This is the root-cause fix for published cli bundles that
silently lacked install.json: main's BuildBundle dropped the submission's
artifacts entirely.

* verify-submission: fail a cli submission that declares artifacts but ships no install.json

Close the false-pass gap: the catalogue review gate only checks the binary
sha/signature and is blind to install.json, so a submission that declared
`artifacts` but whose build dropped them still passed verify-submission — and
published a bundle with no binary to run.

After BuildBundle, when the submission has artifacts, verify-submission now
asserts per platform that the built tarball contains install.json (with at
least one asset) AND a manifest carrying the fs.write $APP staging grant —
proof the adapter is actually wired for delivery, not just that the spec file
rode along. Missing either fails the build.

Tests:
  - cmd/pilot-app: a miren-shaped cli+artifacts submission builds a bundle
    that passes checkStaging on every platform; a bundle with install.json
    stripped FAILS (regression guard against reopening the gap).
  - publish: TestCLIAssetsSubmissionBuildsAndVerifies — full pipeline build
    ships install.json + the delivery grants.
  - scaffold: install_test.go (install.json/install.sh rendering),
    TestGeneratedCLIWithAssetsCompiles (asset-aware main + stage.go type-check),
    r2_e2e_test.go (env-gated live R2 delivery e2e).

* docs: document the R2 artifact registry delivery model

Add docs/R2-ARTIFACT-REGISTRY.md (the canonical, implemented design the code
comments reference) and mark docs/NATIVE-APPS.md as superseded for the delivery
model (by-reference URL → Pilot-hosted R2 bytes). Add scripts/e2e-smolvm.sh,
which uploads a real artifact and sets the PILOT_E2E_ASSET_* env vars that the
env-gated scaffold r2_e2e_test.go consumes.

* scaffold: add json tags to ChangelogRel (self-consistent with #41)

So the staging PR doesn't reintroduce Go-cased changelog keys in metadata.json
regardless of merge order with #41.
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