by adom
How the Adom Wiki (wiki.adom.inc) works and how to drive it with the adom-wiki CLI: the two storage layers (git page repo vs package registry), hosting source by pushing files (not a tarball), making packages, cutting per-platform releases, and the three-tier skill layout (user skills ship, dev-skills/ and publish-skills/ stay source-only). adom-wiki is the current tool; adompkg is deprecated.
Layouts as a facet on hardware pages (projects lean on it)
Make layouts a facet that a hardware page carries, not a page type. Project pages stay the main home for layouts, and they get the full treatment. A page has the Layout facet when its repo holds at least one valid layout.json, and the facet is what drives the Layout sidebar row, a Layouts section, "Open in 3D Editor", "Used in" lists on molecule pages and a browse filter.
From the Hydrogen Cloud lane, 2026-12-03. Colby asked for this write-up ("lean on project pages, but I like the facet idea"); his decisions are listed at the end.
Why a facet, not a type
- Most project pages are not workcell builds. Of the 25
kind: projectpages today, few are layouts: ghost-hand, esc-am32-comparison, wolfgang-kicad-library, modular-bms, cosmiic-implantables and others are general hardware projects.PROJECT_MISSING_LAYOUTand the sidebar's "none yet (projects need at least one)" fire on all of them, though most will never have a layout. - The name "scaffold" is taken.
classifyHardwareKind(lib/index.js) treats scaffold boards as molecules (Colby, 2026-08-05: "Scaffolds are molecules"), for exampleadom/scaffold-lrglrg-576x576. A "scaffold" page type would mean two different things. The sidebar already says Layout, so this issue uses that word. - A layout is content a page carries, like a 3D model or a datasheet. A facet is computed from what the repo holds, so any page that has a layout gets the same features without becoming a different kind.
What exists today (git-wiki main)
| Where | What it does |
|---|---|
lib/index.js analyzeLayoutJson |
Shape check only: a molecules object and a wires array. Returns counts. |
server.js ~19630, PROJECT_MISSING_LAYOUT |
On publish of a project, scans every JSON in the repo (up to MAX_LAYOUT_SCAN) and warns when none passes the shape check. |
server.js ~25159, project-layouts memo |
The same scan on page view, for the sidebar stats. Projects only. |
lib/templates.js ~5419 |
The Layout sidebar rows: name, molecule and type counts, wires; or the "none yet" placeholder. |
The two layouts on the wiki today are both in the old pre-v1 format: molecules are Curium sku strings (for example adom/Combiner Molecule/v1) with no wiki page id.
adom/drone-layout-dc-00:layouts/drone-layout-DC_00.json, 12 molecules, 111 wires.adom/led-grid-wall:layout.json, 10 molecules, 52 wires.
The format: layout.json v1
The spec is in adom-inc/hydrogen docs/layout-json/v1.md, with v1.schema.json and v1.example.json beside it. The parts that matter here:
formatVersion: 1andeditorVersion: "v2"at the top.- Each molecule names its wiki page by permanent id (
id: "pg_..."), withref(owner/slug) as a readable label. It pins its footprint and model by sha256:models.footprint.sha256andmodels.model.sha256, served byGET /api/pages/<id>/models/<sha256>. - Wires join molecule contacts, corner pins, base scaffold contacts or control panel contacts.
Molecules come only from the wiki now. Hydrogen PR adom-inc/hydrogen#428 removes Curium loading from the 3D editor. A molecule without a wiki id is reported and not loaded, so an old-format layout no longer opens.
The facet
1. When a page has it
A page has the Layout facet when it ships at least one valid v1 layout. The wiki finds them two ways:
- Declared (preferred):
page.jsongets"layouts": ["layouts/main.json", ...]. The order sets which one is primary (the first) and the order they're shown in. - Found: with no declaration, files under
layouts/, any*.layout.json, or a rootlayout.json. That replaces "scan every JSON in the repo", which is slower and finds false positives (viewer/layout-scene.jsonon drone-layout-dc-00).
Any hardware kind can carry the facet. Projects are where it is expected.
2. Validation: three levels, shown on the page
- Structure: passes
v1.schema.json. Vendor the schema into git-wiki. - Consistency, checked by the wiki:
- every molecule
idis a page of kindmolecule; - its pinned footprint and model hashes are in that page's models manifest;
- molecule keys match
name, and wire names are unique. - Checking wire endpoints against footprints can come later.
- every molecule
- Manufacturing rules (DRC): a separate service that is being built (layout DRC, Rust). When it exists, the wiki calls it on publish and shows pass or fail. Until then, the page shows "DRC: not checked yet".
The wiki reports one status per layout:
- valid;
- warnings, such as a
refthat no longer matches the page's current owner/slug; - invalid, with the reason;
- old format: pre-v1,
skumolecules, "open in the 3D editor and save again once migrated".
3. What the facet gives a page
- Sidebar Layout row (exists): add the status, a link to the file, and an Open in 3D Editor button (see phase 2 for where it goes).
- A Layouts section on the overview, one card per layout:
- name and status;
- molecule and wire counts;
- the bill of molecules, each linked to its molecule page with a count, for example "AM32 ESC v1 x2".
- Molecule pages get "Used in": the pages whose layouts place this molecule. That needs a small reverse index,
layout_molecules(page_id, layout_path, molecule_page_id, count), refreshed on publish. - Browse: a "Has layout" filter on /hardware.
4. Access and private molecules
Each molecule in a layout is checked with the access of the person loading it:
- On publish: the publisher's.
- On view: the viewer's, so the bill of molecules shows "a molecule you don't have access to" in place of a link they can't open. Never leak the private page's title.
- In the editor: a molecule the user can't see fails with the wiki's 404 ("not on the wiki, or you don't have access to it"). That is how Hydrogen behaves after #428.
New publish hint LAYOUT_PRIVATE_MOLECULE (warn): the page is public, but one of its layouts places a molecule that isn't. Anyone without access to that molecule can't open the layout.
5. API
GET /api/pages/<owner>/<slug>/layouts returns one entry per layout, with:
path,name,primary,formatVersion,statusandissues[];- counts;
molecules[] { name, id, ref, count }, each filtered by the caller's access the same way as above.
The 3D editor and the DRC use this list instead of walking the repo.
Saving needs no new endpoint. The editor's Save commits layout.json through the existing repo write path with the user's token, and the push response carries the validation hints. Colby's decision of 2026-12-01: autosave stays local, and Save commits to the wiki.
6. Project pages
Projects lean on the facet:
- the Layout row and Layouts section show first on a project that has layouts;
- the placeholder and
PROJECT_MISSING_LAYOUTchange as Colby decides (decision 2 below).
Migration of the two old layouts
A one-time conversion rewrites each sku molecule to id / ref / models, using Hydrogen's resolver rules (moleculeLookupCandidates: owner/slug, then the slugified name). It runs once as a script that rewrites the files on the page; it does not put Curium support back into anything at runtime. A sku that matches no molecule page is listed for a person to fix, never guessed. The Hydrogen Cloud lane can write the script if the wiki thread prefers.
Phases
- Wiki only:
- v1 recognition, using the declared list or the folder rules;
- schema and consistency checks, with a status per layout;
- the Layouts section and the richer sidebar row;
/layoutsAPI, "Used in", andLAYOUT_PRIVATE_MOLECULE;- the new placeholder rule.
- Editor link: "Open in 3D Editor" for that page and layout, and Save from the editor through the repo write path. The target depends on where the editor lives then: HC's 3D Editor V2 today, or the
adom/adom-3d-editorapp later. - DRC: call the layout DRC service on publish and show its result.
Decisions for Colby
- Name: "Layout", as the sidebar says now (recommended, since "scaffold" already means the scaffold board molecules), or "Scaffold"?
- Projects without a layout:
- (a) keep warning every project;
- (b) show "none yet" only to people who can edit the page, and make the hint
info(recommended); - (c) warn only projects tagged as workcell builds.
- Any kind or projects only: can a molecule or equipment page carry a layout (for example a demo layout on a workcell equipment page), or only projects? Recommended: any kind.
- Valid to publish: an invalid or old-format layout warns, as today (recommended until the DRC exists), or blocks the publish?
- Public page, private molecule: warn (recommended) or block?
- Folder convention:
layouts/(recommended, drone-layout-dc-00 already uses it) or the olderproject-content/layouts/the current hint suggests?
0 Replies
Log in to reply.