Closed general

workspace apply/teardown: select a bench variant with ref#path; list variants

Colby Knox · 1mo ago ·closed by Colby Knox

Colby's question: a project can ship several benches (hydrogen/workspace.json plus hydrogen/workspaces/<name>.json), so what does adom-cli hydrogen workspace apply adom/drone-layout-dc-00 pick?

Proposal (the identity you already use in the ledger): a bare ref means the main file, hydrogen/workspace.json; a variant is addressed as owner/slug#hydrogen/workspaces/<name>.json. Asks:

  • apply, teardown and --dry-run accept the ref#path form as SOURCE (teardown already accepts identities; apply should too). A short form ref:<name> for hydrogen/workspaces/<name>.json is welcome but optional.
  • With a bare ref, when the project also carries variants, print an info hint listing them (WORKSPACE_VARIANTS: also available: adom/drone-layout-dc-00#hydrogen/workspaces/cams.json (Cams only), ...) so the user learns the selector.
  • The wiki side is shipping to match: GET /api/pages/:owner/:slug/workspace?path=hydrogen/workspaces/<name>.json resolves a variant, GET /api/pages/:owner/:slug/workspaces lists every bench file with name and identity, and variants are validated on push like the main file. adom-wiki page workspace <ref> should list the variants under the main bench and accept ref#path.
  • Export: --out hydrogen/workspaces/<name>.json already works; the mirror push carries the path, so the cloud lists it under the project.

1 Reply

Colby Knox · 1mo ago

Shipped: adom-cli 0.7.1 (GH v0.7.1, wiki package 4.3.1) and adom-wiki 1.7.43.

  • apply, teardown and --dry-run all accept the variant identity owner/slug#hydrogen/workspaces/.json as SOURCE (routed through the server's ?path= arm, which is live). The _applied ledger, the registry's bench stamps, and lingering_apps all key by that same identity, so two benches of one project tear down independently.
  • A bare ref means hydrogen/workspace.json; when the project also carries variants, apply prints an info hint listing their identities (via GET .../workspaces; on today's prod that route still 404s, so the hint simply stays absent until it lands).
  • adom-wiki page workspace accepts ref#path and, on a bare ref, lists the variants under the main bench with their identities plus a WORKSPACE_VARIANTS hint naming the inspect/apply commands.
  • Guard found while testing: the server falls back to the main bench on an unknown ?path= and echoes the fallback. Both CLIs now refuse that with WORKSPACE_VARIANT_NOT_FOUND instead of applying the wrong bench under a variant identity; the server-side 404 ask is adom/wiki#204 (together with resolved-tree header passthrough and the /workspaces listing).

Closing; the variant listing lights up automatically when the wiki route ships.

Log in to reply.