Local precheck for the hardware gates (.glb + 16:10 hero) before upload
Server contract shipped to prod 2026-09-25 (git-wiki 658d9f0). The CLI needs nothing for correctness: every refusal is a 400 with code, data and hints[], which the CLI already prints. This issue is the local precheck so a user fails in 0 ms instead of after uploading a tarball.
The rule
A PUBLIC page of type component (manifest type: hardware or component) with kind component, molecule, board or unset must have:
- a
.glbin its repo (anywhere in the tree, any name); - a hero that is a PNG, 16:10 (tolerance 0.03), at least 1600 px wide. No Hero Studio provenance is needed on hardware pages.
Private pages get the same findings as level: warning hints and the write lands; a page cannot go public until both hold.
Codes (400)
| code | where | data |
|---|---|---|
HARDWARE_3D_MODEL_REQUIRED |
repo push to a public page with no .glb after the push; page visibility public; pkg publish of a public package with no .glb in the tarball or the existing repo |
{ ref, kind, accepted: [".glb"] } |
HARDWARE_HERO_INVALID |
repo push that sets or replaces the hero; page hero --image / --screenshot; visibility -> public; publish with a declared hero |
{ ref, path, reason: "not_png" | "bad_dimensions", width?, height?, aspect?, required: { min_width: 1600, aspect: 1.6, tolerance: 0.03, format: "png" } } |
HARDWARE_HERO_REQUIRED |
visibility -> public with no hero declared | { ref } |
Valves on the server: ADOMPKG_REQUIRE_3D_MODEL=0, ADOMPKG_REQUIRE_HARDWARE_HERO=0. Reference: docs/git-wiki-api-reference.md "Hardware gates", docs/hint-codes.md.
Asks (CLI side)
pkg publishandrepo pushon a hardware page that is or will be public: before upload, check the package dir / pushed file set for a.glb; when the page exists,GET /api/v1/pages/<ref>/files?recursive=1tells whether the repo already has one. Refuse locally with the same code and the same hint text the server would send (the server'shints[0].messageis the canonical wording; copy it).page hero --image <path>and--screenshot <path>on a hardware page: read the PNG header (IHDR width/height, 8 bytes at offset 16) and refuse locally on the same rule. No image library needed.pkg lintfor hardware packages: the same two checks as warnings.- When the page is private, print the server's warning hints as-is (they already say "making it public will refuse until this is fixed").
Whether the local checks read the kind from page.json/package.json (kind) or just from type, treat a missing kind as gated (the server does).
Server-side tests for the exact responses: test/pages/hardware-gates.test.mjs in git-wiki.