Skip to content

Carry scaffold display names into Store metadata - #25

Open
Prophet60191 wants to merge 24 commits into
CardputerZero:mainfrom
Prophet60191:fix/scaffold-store-display-name
Open

Prophet60191 wants to merge 24 commits into
CardputerZero:mainfrom
Prophet60191:fix/scaffold-store-display-name

Conversation

@Prophet60191

Copy link
Copy Markdown

Carry scaffold display names into Store metadata

czdev new contribution-sample --display-name 'A Different Display Title'
sets the launcher display name, but leaves the official Template's
app-builder.json with "app_name": "Template". The publish command
reads that field for the Store listing title. This was also noted in
CardputerZero/Template#6.

Set the generated manifest's app_name to the explicit or derived
display name, preserving the existing package slug and other metadata
substitutions. Use JSON encoding for inserted strings and leave custom
templates that don't have a manifest unchanged.

Verification

  • Reproduced against AppBuilder 042356c and official Template
    477fa6d using a local Template mirror. With the fix, the publish
    metadata reader returns the chosen title; with no --display-name
    it returns the title derived from the slug. Both keep
    contribution-sample as the manifest package name.
  • python3 -m unittest discover -s tests -v: 8 passed. New tests
    exercise the CLI and the Store metadata path without a live publish.
  • No Store upload or device changes.

This change does not alter the Template's separate CPack logic for the
Debian control name or how CMake handles arbitrary display punctuation.

eggfly and others added 24 commits June 30, 2026 19:38
…rZero#4)

* czdev: publish/unpublish via Release manifests instead of Git LFS

The packages repo no longer stores .deb in git/LFS (LFS budget exhausted).
Adapt the publish flow to the new manifest model:

- publish: upload the .deb to a "czdev-buffer" Release on the push target
  (the contributor's own fork for non-maintainers — their free Release quota),
  then open a PR carrying only meta.json/screenshots/icon and a
  <pkg>_<ver>_<arch>.deb.release.json manifest (url + sha256 + size). No .deb,
  no LFS. Raises the size cap to the 2 GiB release-asset limit.
- unpublish: read the manifest, download the .deb from its url to verify the
  Maintainer, and remove the manifest from git.
- github_client: add ensure_release / upload_release_asset / find/delete asset.
- Drop the git-lfs requirement.

Co-authored-by: Cursor <cursoragent@cursor.com>

* ci: remove dead desktop-smoke workflow

czdev was rewritten from Rust to Python and the crates/czdev Rust crate was
removed, so 'cargo run -p czdev' (and the crates/czdev path filter) no longer
resolve — this workflow has failed on every main push and PR since then.
Remove it; the Python czdev has no Rust/emulator smoke harness.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Port of the Phoebe LVGL app_clock to a standalone 320x170 SDL2 program.
Six switchable faces: analog (trig hands), digital, animated (spinning
arc), 7-segment and VFD dot-matrix (glyph tables from Phoebe ui_common.h),
and flip. Local time only, no network.

Keys: SPACE / RIGHT next face, LEFT prev, ESC / Q quit. Optional
CLOCK_FACE env selects the starting face.
Port of the Phoebe LVGL app_life to a standalone 320x170 SDL2 program.
Toroidal cellular automaton on an 80x42 grid that auto-reseeds on
extinction, population stall, or after 600 generations. No network or
sensors -- cells drawn as filled rects.

Keys: SPACE reseed, P pause, ESC / Q quit.
Port of the Phoebe LVGL app_matrix to a standalone 320x170 SDL2 program.
Falling green glyph columns with bright heads and fading trails on a dark
green base. No network or sensors. Renders in the desktop emulator (X11)
and on-device via the Wayland/KMSDRM launcher wrapper.

Keys: ESC / Q to quit.
Port of the Phoebe LVGL app_weather to a standalone 320x170 SDL2 program.
Fetches current conditions from the keyless Open-Meteo API on a background
libcurl thread, parses the small flat JSON by hand (no JSON lib), and draws
a procedurally animated icon (breathing sun / cloud / falling rain) chosen
by WMO weather code. Code->category/text tables from Phoebe ui_common.h.

Config via env: WEATHER_LAT, WEATHER_LON, WEATHER_CITY (default Colombo).
Keys: ESC / Q quit.
Press L (or M) in the weather view to open a keyboard-navigable list of
preset cities (Colombo, London, New York, ... 15 total). Arrows move, ENTER
selects, ESC cancels. Selecting a city updates the location under a mutex and
signals the fetch thread to refetch immediately (shows 'fetching...' then the
new city's conditions). WEATHER_LAT/LON/CITY env still seed the initial
location. Top-left 'L:loc' hint advertises the picker.

Verified in the emulator: picker lists cities, selecting London refetches and
renders London weather live.
A real working editor for 320x170: line-array text buffer with insert/
delete/newline, vertical + horizontal scrolling with a line-number gutter,
blinking cursor, selection with on-screen highlight, cut/copy/paste through
the SDL system clipboard, and file open/save/save-as with a dirty flag and
save-on-quit prompt. nano-style Ctrl command set and status bar.

Keys: arrows/PgUp/PgDn move, Shift+move select, ^S save, ^O save-as, ^K cut,
^C copy, ^U/^V paste, ^G select-all, ^A/^E line start/end, ^Q/^X quit.

Verified in the emulator: open file, type (dirty *), scroll, select+
highlight, clipboard paste, ^S writes to disk. arm64 .deb packages clean.
Includes a 48x48 app icon.
publish copies the icon and screenshots into pool/main/<pkg>/ flat
(icon at <basename>, screenshots under screenshots/<basename>) but
meta.json kept the app-builder.json source-repo paths (e.g.
share/images/foo.png, store/screenshots/a.png), so the store registry
generator resolved them to 404s and every czdev-submitted app rendered
without an icon. Rewrite both fields to the layout the files were
actually copied into.

meta.json also carried no author, which the store showed as
'@undefined'. Emit an author object from the authenticated GitHub login
plus the Maintainer display name, letting an explicit store.author in
app-builder.json take precedence.

(The store's registry generator now also normalizes legacy meta.json on
its side, so previously published packages are already fixed; this
makes new submissions correct at the source.)
- check_permission: query `GET /repos/{owner}/{repo}` permissions instead of
  the collaborators/{user}/permission endpoint, which requires push access and
  returned 403 Forbidden for external contributors — breaking the intended
  fork+PR fallback (the "Error: permission status" failure).
- publish: stop requiring the deb Maintainer email to match the uploader's
  GitHub verified emails. Record the uploader (`uploaded_by` login +
  `uploader_email`) in the release manifest instead.
- unpublish: enforce ownership by the recorded uploader login (with a legacy
  fallback deriving the login from the binary's Maintainer noreply address)
  rather than email matching.
- remove the Rust czdev release workflow; publishing is Python-only now.

Co-authored-by: Cursor <cursoragent@cursor.com>
Apps must not run as root. A third-party package's realistic root vector
is a bundled systemd *system* service (dpkg runs it as root by default),
so:

- pack_deb.py now pins the generated service to a non-root user
  (User=/Group=, default `pi`, overridable via --service-user). Packages
  built by the toolkit are non-root out of the box.
- czdev publish now scans the .deb and refuses to publish if any bundled
  systemd system .service would run as root (no User=, User=root/0, and no
  DynamicUser=yes). DynamicUser=yes and User=<non-root> pass.

Mirrors the same gate added to the packages CI (process-web-submission
and validate-pr), so web, czdev, and PR review all reject root apps.

Co-authored-by: Cursor <cursoragent@cursor.com>
… docs (CardputerZero#16)

The Rust czdev CLI and the desktop emulator (crates/, sdk/, emulator submodule)
are already gone from the repo, but README and docs still documented a
`cargo run -p czdev -- run/watch/deploy/doctor` flow that no longer exists.
czdev is now the pure-Python publish CLI in scripts/czdev.

- Add an executable ./czdev wrapper (chmod +x) that runs `python3 -m czdev`
  with scripts/ on PYTHONPATH, so `./czdev …` (as the docs say) actually works.
- Rewrite README.md around the Python czdev CLI (login/logout/bump/publish/
  unpublish), the online CI build, ownership model, and the no-root policy;
  remove all cargo/emulator content.
- Rewrite QUICKSTART.md / _ZH / _JA into a Python czdev publish quickstart.
- Delete dead docs describing removed subsystems: EMULATOR.md, architecture.md
  (Tauri IDE that was never built), DESKTOP_DEV.md, and the orphaned emulator
  screenshots.
- APP_BUILDER_JSON.md: document the `store` listing section used by
  `czdev publish`/portal; mark the old emulator fields (runtime/entry/…) as
  legacy/no-longer-consumed (kept for back-compat).

The Rust example app under examples/ is intentionally kept, so the Rust
toolchain stays in the Dockerfile/CI to build it.

Co-authored-by: Cursor <cursoragent@cursor.com>
A git submodule cannot float: it stores a gitlink (an exact commit SHA) in
the parent tree, so vendoring CardputerZero/Template as a submodule would
freeze every developer on one template commit and require a commit here for
every template update. Copy the branch tip at scaffold time instead, so no
template commit is recorded anywhere.

`czdev new <name>` shallow-clones the template's default branch, drops its
history (scaffold, not fork) and renames the per-app placeholders: the CMake
project name, the compiled-in APP_NAME, the launcher display name and the
icon files. The icons matter beyond cosmetics — they install into the shared
/usr/share/APPLaunch/share/images/, so two packages both shipping
template.png conflict at dpkg level.

The upstream template is now also marked as a GitHub template repository,
so `gh repo create --template CardputerZero/Template` is an equivalent
route; both are documented in the README and all three quickstarts.

Co-authored-by: Cursor <cursoragent@cursor.com>
…deError (CardputerZero#18)

`czdev login` polled the token endpoint and fed the body straight to
json.loads() with no error handling, so any non-JSON reply surfaced as a bare
`JSONDecodeError: Expecting value: line 1 column 1 (char 0)` traceback that
hid the actual cause. These endpoints are on github.com, not api.github.com,
so a rate-limit page, a proxy/captive-portal interception, or a redirect to an
HTML page all arrive as HTTP 200 with HTML — and urllib follows redirects
silently, so the landing URL was invisible too.

post_form() now decodes the reply defensively and raises an AuthError naming
the status, content-type, post-redirect URL and a body snippet. It also reads
the body of 4xx responses (GitHub returns JSON errors there) and accepts the
endpoint's default form-urlencoded encoding, which is what we'd get if
anything stripped the Accept header.

The poll loop retries transient failures instead of aborting a login the user
may already be authorizing, prints the diagnostic on the first failure, and
gives up after MAX_SOFT_FAILURES with a hint. Also: honor expires_in so it
can't spin forever, grow the interval on slow_down as the spec requires,
handle access_denied, add request timeouts, send a real User-Agent (github.com
is more likely to throttle the default Python-urllib one), and turn Ctrl-C
into "Cancelled." rather than a KeyboardInterrupt traceback.

Co-authored-by: Cursor <cursoragent@cursor.com>
…ssthrough (CardputerZero#20)

- publish now builds meta.json by merging the store section INTO the
  already-published metadata (fetched from the packages repo), so fields
  the manifest does not carry — the registry-pinned uuid, a backfilled
  share_code — survive updates instead of being wiped
- pass store.share_code through to meta.json
- pre-check the merged metadata locally with the exact policy script CI
  runs (fetched from packages@main) before uploading anything; failures
  print the same wording the PR would get and nothing is uploaded
- warn about the first-release human review (demo video) up front
- document the enforced store schema in APP_BUILDER_JSON.md

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…ent placeholder auto-rejection

Co-authored-by: Cursor <cursoragent@cursor.com>
…ly (CardputerZero#21)

- publish/unpublish create the PR branch at upstream main's commit, so an
  out-of-date fork no longer causes conflicts
- versions.py: dpkg --compare-versions semantics (1.0~rc1 < 1.0), and
  '~'/':'-safe branch and asset names
- czdev publish --meta-only updates the store listing without a new .deb

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…erseded-versions

Replace older store versions automatically in czdev publish
@Prophet60191
Prophet60191 force-pushed the fix/scaffold-store-display-name branch from f4c9fad to 3b5cd19 Compare November 30, 2026 21:01
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.

4 participants