feat(examples): add hello-world reference app#16
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
The smallest end-to-end Pilot app, sideload-safe by design. Single IPC
method, ~150 lines of Go, three-command build → install → call. Read
alongside the per-file comments — they're written as the reference for
the supervisor lifecycle contract (the six standard --flags), the
trust-regime split (catalogue vs sideload), and the manifest schema.
Layout:
examples/hello-world/
cmd/hello/main.go single binary, one IPC method (hello.echo)
manifest.json sideload-safe grants (audit.log + fs $APP/)
Makefile bundle / install-local / uninstall targets
README.md build steps, supervisor contract, trust regimes
The committed manifest.json has sha256: "REPLACE_WITH_BUILD_OUTPUT" as
a deliberate placeholder. `make bundle` copies the manifest into
bundle/ and pins the binary's real sha256 there, so re-builds never
rewrite the committed file. bundle/ and bin/ are gitignored.
`make install-local` uses the sideload path from
#15 (the --local flag landed in web4/pilotctl
PR #240). Without that pair this example would have to be a
publisher-signed catalogue entry just to be installable, which is the
opposite of "smallest possible app."
Companion to the README that walks new developers from this app
through how an app gets supervised, what an IPC dispatcher looks like,
and where the wallet sits on the same scaffolding.
eee302e to
32ab230
Compare
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.
Summary
The smallest end-to-end Pilot app — single IPC method (
hello.echo),sideload-safe manifest, three-command build → install → call.
Companion to #15
and TeoSlayer/pilotprotocol#240.
Why this matters: until today the wallet was the only
manifest.jsoninthe entire ecosystem. Anyone trying to build their first Pilot app had to
reverse-engineer the supervisor contract from a production payments app.
This is the reference for what a minimal app looks like, intentionally
sideload-safe so a developer can run
make install-localwithout goinganywhere near the catalogue / publisher-signing flow.
Layout
The committed
manifest.jsoncarriesbinary.sha256: "REPLACE_WITH_BUILD_OUTPUT".make bundlecopies it intobundle/and pins the real sha there, so re-buildsnever rewrite the committed file.
bundle/andbin/are gitignored.Test plan
make bundle && make install-localon the local daemon — installs cleanly,appstore listshows it with[sideloaded]badgepilotctl appstore call io.example.hello hello.echo '{"message":"hi"}'returns
{"echo":"hi","sideloaded":true}make uninstallremoves cleanlycontract table and the catalogue-vs-sideload comparison. If those read
wrong to a new developer, the rest of the example fails too.
Dependency note
make install-localuses the--localflag from web4 PR #240 + thesideload policy from #15. Without that pair this example would have to
be publisher-signed just to install, defeating the "smallest possible
app" premise. Land those two first; this PR can wait at the back of the
chain or merge alongside.