Skip to content

fix(cli): bundle every render the depot manifest names - #2466

Open
AprilNEA wants to merge 3 commits into
fix/asset-sub-path-resourcesfrom
fix/bundle-manifest-renders
Open

AprilNEA wants to merge 3 commits into
fix/asset-sub-path-resourcesfrom
fix/bundle-manifest-renders

Conversation

@AprilNEA

@AprilNEA AprilNEA commented Nov 8, 2026

Copy link
Copy Markdown
Owner

Summary

openlogi assets sync builds the offline asset bundle (OPENLOGI_BUNDLE_ASSETS=1). It picked each depot's optional files by Options+ name pattern (side_core.png, front_ext*, metadata_*), so the bundle left out every render the depot manifest names some other way:

  • images/device/<uuid> paths: 45 G HUB depots, 98 files, 88.0 MiB (the G502 X PLUS is one of them);
  • other flat names the patterns miss, in 54 depots: G HUB colour names (front_white.png, front_lol.png, …), WebP renders, Front.png, k380_front.png, config_core.png.

A bundled build turns its runtime sync off (should_run(has_bundle)), so those devices stay on the base render with no side view.

Scope: the official release builds do not bundle. Both v0.9.0 macOS jobs log device assets: on-demand (not bundled; fetched at first launch) because vars.OPENLOGI_BUNDLE_ASSETS is unset. Only self-built offline bundles are affected.

Stacked on #2461, which adds the safe_relative_path join that lets sub-path names be fetched. Merge #2461 first; this branch then rebases onto master.

Changes

  • openlogi-assets: the list of manifest keys OpenLogi consumes (device_image, device_buttons_image, device_side, device_camera_image, image_metadata) is now private in manifest.rs, behind two decisions: DepotManifest::consumed_srcs_for(bases, ext) names one variant's files, DepotManifest::consumed_srcs() names every variant's. New ast-grep guard assets-consumed-resources-owner (ruleDir added to sgconfig.yml) rejects a key list or key match anywhere else.
  • openlogi-desktop: sync_depot asks consumed_srcs_for instead of listing keys inline, and parses the manifest once instead of once per key. Same selection as before.
  • openlogi-cli: assets sync fetches the manifest first; bundle_files then selects the baseline, the flat-named optional files, and every registry-listed src under a consumed key, across all variants. Names the registry does not list are not selected, so every bundled file still carries a registry hash. The size summary is the sum of what was selected.

Effect on the current catalog (v0-1, 2026-11-08): bundle 1146 files / 395.0 MiB → 1352 files / 625.2 MiB (+206 files, +230.2 MiB). Four consumed src values are missing from the index and stay out.

Not done: letting a bundled build fetch missing files at runtime (option 3 in #2459). That changes when a bundled build goes online, and the official builds do not bundle in the first place.

Testing

  • openlogi-cli bundle_files_tests::a_g_hub_depot_bundles_the_renders_its_manifest_names: fails when the selection ignores the manifest (checked by disabling that branch). Also a_manifest_src_the_registry_does_not_list_is_not_bundled and without_a_manifest_only_the_flat_names_are_bundled.
  • openlogi-assets manifest::tests (4): every-variant selection with dedup and unconsumed keys skipped, one-variant selection, first base wins per resource, unknown variant.
  • g512_photo_and_metadata_are_selected_for_download now goes through variant_filenames.
  • Guard: passes on this tree; fails on fix(assets): fetch and draw depot renders stored under sub-directories #2461's sync.rs key array and on a CLI probe with a key array and a key match; unrelated arrays such as KEY_MARKER_IMAGES pass.
  • End to end: local HTTP mirror holding only g502x_plus (files copied from Pages), openlogi assets sync --base http://127.0.0.1:18765: 9 files including the 6 images/device/* renders, none of promotion/*, battery*, splash*; a second run reports 9 cache hits.
  • Local gate on Linux, full tier because sgconfig.yml changed: cargo fmt --check, cargo clippy --workspace --all-targets -D warnings, cargo test --workspace, rustdoc, ast-grep scan and ast-grep scan .github, typos.

Not run locally: macOS and Windows clippy/tests (left to CI). Not tested: a real cargo xtask macos package with OPENLOGI_BUNDLE_ASSETS=1.

Fixes #2459

G HUB depots name their renders by a path inside the depot
(`images/device/<uuid>`). The fetch and the resolver joined every file
name with `safe_component_path`, which accepts a single component only,
so a G502 X PLUS colour variant never downloaded its front and side
renders and could not have drawn them.

Join depot files with the new `safe_relative_path`, which checks every
`/`-separated segment with the same rules, and create the parent
directory on write.

The side view also looked its variant up by registry model id only,
while the sync downloads by the manifest bases that include the depot
name, which G HUB manifests key on. Resolve it through
`find_variant_in_manifest` like the other variant renders.

Fixes #2457
The per-device sync listed the five manifest keys it downloads inline.
The offline bundle needs the same answer for every variant, so the list
moves to openlogi_assets::manifest, private, behind two decisions:
DepotManifest::consumed_srcs_for names one variant's files and
DepotManifest::consumed_srcs names every variant's. The sync now asks
consumed_srcs_for, which also parses the manifest once instead of once
per key.

The assets-consumed-resources-owner ast-grep guard rejects a key list
or key match anywhere else.
`openlogi assets sync` chose a depot's optional files by Options+ name
pattern (`side_core.png`, `front_ext*`, `metadata_*`), so the offline
bundle never carried a render the manifest names any other way: the
`images/device/<uuid>` paths of the 45 G HUB depots, G HUB colour names
such as `front_white.png`, and WebP renders. A bundled build then drew
those devices on the base render with no side view, and its runtime sync
stays off, so nothing filled the gap.

The manifest now lands first and bundle_files adds every file it names
for a consumed resource, across all variants
(DepotManifest::consumed_srcs). Only registry-listed names are selected,
so every bundled file still carries a registry hash. The summary counts
the manifest fetch once and sums the selection it actually bundled.

Fixes #2459
@AprilNEA AprilNEA added type: bug Something is broken or behaves incorrectly area: cli Command-line interface area: assets Icons, images, and bundled assets platform: macos macOS-specific issue labels Nov 8, 2026
@AprilNEA AprilNEA added the needs: decision Needs a maintainer/product decision label Nov 8, 2026 — with Manus Connector
@greptile-apps

greptile-apps Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] This PR appears safe to merge; no actionable issues were found.

Summary

The CLI now bundles registry-listed files named by consumed manifest resources across every device variant.

  • Offline bundles include the renders named by every depot variant.
  • Desktop sync and bundles share one list of manifest resources.

AprilNEA explicitly deferred runtime downloads for missing bundled files. This review does not treat that known limitation as a new issue.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  Manifest[DepotManifest] --> All[consumed_srcs: every variant]
  Manifest --> One[consumed_srcs_for: connected variant]
  All --> CLI[CLI: select matching registry files]
  One --> Desktop[Desktop: select matching registry files]
  CLI --> Fetch[Check path and hash before writing]
  Desktop --> Fetch
  Fetch --> Bundle[Offline bundle or user cache]
Loading

Reviews (1) · Last reviewed commit: "fix(cli): bundle every render the depot ..." · Reviewed by Greptile

@AprilNEA
AprilNEA force-pushed the fix/asset-sub-path-resources branch from c34f7ac to ee9d52c Compare November 8, 2026 13:30

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: assets Icons, images, and bundled assets area: cli Command-line interface needs: decision Needs a maintainer/product decision platform: macos macOS-specific issue type: bug Something is broken or behaves incorrectly

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant