Testing and debugging
A successful JavaScript evaluation is only the first evidence tier. An App must also prove routing, SQLite ownership, Projection refresh, restart restoration and update safety. When a path depends on hardware or live transport, also verify fresh physical behavior.
Use a fresh simulator workspace for clean-install tests
cargo xtask run esp32-sim \
--backend codex \
--workspace target/app-test-workspaceA separate path gives you a genuinely fresh App catalog without destroying another development workspace. Keep a second persistent path for update/migration testing.
Minimum App test matrix
| Case | What to verify |
|---|---|
| Package | Only expected files; credential ids and resources match manifest |
| Fresh install | Review → confirmation → Tool registration → App opens |
| UI Action | Tap routes to Action; transaction commits; visible Projection refreshes |
| Agent Tool | Agent sees namespaced Tool and receives the completed result |
| Headless schedule | Action runs with View closed; data appears when reopened |
| Restart | Installed source, SQLite and schedules restore; transient Guests do not matter |
| Code-only update | Source changes; schema/data and credentials remain |
| Schema update | Every migration runs; existing rows survive |
| Rejected update | Downgrade/missing/failing migration leaves installed release and data intact |
| Uninstall/reinstall | All App-owned state disappears, then fresh install starts clean |
Repository checks
cargo test --workspace
bun test apps/pi-agent/text.test.js
cargo clippy --workspace --all-targets -- -D warnings
cargo xtask build esp32-sim
cargo xtask build esp32-p4These cover Rust runtime contracts, Pi Agent text helpers, linting and both host builds. They do not automatically prove a specific App's real provider behavior or physical UI.
Inspect a package before upload
tar -tf target/pocketapps/example.pocketapp
tar -xOf target/pocketapps/example.pocketapp app.jsonCheck that updates omit credentials.json, resource paths match declarations and every intended migration file is present.
Localize by lifecycle stage
| Failure appears… | Inspect first |
|---|---|
| During packaging | Directory id, manifest identity, credential ids, asset/migration filenames |
| Before review | Archive shape, size, Framework API, capabilities and manifest policy |
| During candidate validation | schema.sql, missing Action names, View evaluation and Projection SQL |
| When Action runs | argument validation, remaining deadline, native policy, provider status and thrown error |
| After commit but View is stale | transaction usage, bounded Projection registration, foreground App and revision path |
| Only after restart | workspace path, installed release, SQLite file, update recovery and schedule store |
| Only on the board | PSRAM, LittleFS, Wi-Fi/NVS, TLS, response bounds, touch/display and UART state |
Evidence tiers
source inspection
< unit / contract tests
< simulator end-to-end
< ESP32 cross-build
< physical boot and UI
< fresh physical provider end-to-endReport the highest tier actually observed and name what remains. A green simulator does not prove Wi-Fi association; a boot does not prove a fresh provider response; an older physical result does not automatically validate a later Source App refactor.