Publish a preset template

This how-to walks through pushing a preset template you've authored out to the swarm so other agents discover it on Page 2 of their Set up Fixo wizard. The result is a row that shows up under the Vetted, Popular, or Unbadged filter, depending on the evidence the network has gathered.

Implementation status

The publishing pipeline rides on libswarm, which is being built in a parallel session and has not yet landed in this repository. The wizard already understands community-sourced rows (Page 2 reference) — when libswarm imports, the OPAL task and CLI described below light up automatically. This how-to documents the contract so authors can prepare templates today.


Before you start

  1. Author the template. Use Author a preset template to produce a valid fixo.json of type preset-template. The wizard accepts the same shape from the swarm that it does from a bundled book.
  2. Pick an id. Templates are keyed by <author-sid>/<template-id>. The author SID is your agent's identity; the template id is a kebab-case string unique within your slot (e.g. quadruped-walker).
  3. Decide on a version. Templates are content-addressable per version. Bumping the version field publishes a new revision; the wizard surfaces the highest-numbered version per (author-sid, template-id).

Path 1: Publish via the wizard's OPAL task

When libswarm imports, the OPAL task fixo.template.publish becomes available:

octomy opal fixo.template.publish \
  --template ~/projects/quadruped/fixo.json \
  --version 1

Behaviour:

  1. Reads the file, validates it through PresetTemplate::fromJson, then re-emits canonical JSON. The on-disk bytes the swarm receives are PresetTemplate::toJson(parsed) — never your raw bytes, so whitespace, key order, and comment idiosyncrasies are normalised.
  2. Calls the swarm publish endpoint with the path .swarm/fixo/preset-templates/<your-sid>/<template-id>/v<version>/template.json.
  3. Writes a sibling metadata.json with the author-attested fields (description, tags, license).
  4. Prints the published path and a swarm-side hash you can share with a maintainer to request a Vetted signature.

The task fails loudly if template.json doesn't round-trip cleanly through PresetTemplate::fromJson / toJson — that catches invalid templates before they reach the swarm.


Path 2: Publish from Fixo Studio → Preset Template Manager

The same publish step is exposed in the UI for templates you've duplicated and edited inside the studio. Open Fixo Studio → Preset Template Manager, select your template, click Publish to swarm. A confirmation panel shows the destination path and the canonical JSON; click Publish to push.

Behind the scenes the panel calls the same OPAL task; the UI path is a thin convenience over the CLI.


Step 3: Earn a badge

The wizard surfaces three community badges per §FW-6.1. Whether your template carries one depends on observable evidence the network can verify, not on what you claim in the manifest.

Badge What earns it How to pursue it
Vetted A trusted maintainer's Ed25519 signature over your template.json Share your published path with a maintainer; if they sign, the wizard sees a .sig next to your template and renders the badge. The maintainer key set ships with the application's supply chain and rotates per release.
Popular Aggregated install count exceeds the network's threshold Time + adoption. The swarm aggregator tracks installs across agents that pulled the template into a preset; once the count clears the threshold the badge surfaces automatically.
Unbadged Neither of the above Default state. Still visible to users who toggle Unbadged on Page 2's filter bar; hidden by default.

You cannot set badges in the manifest. The SwarmPresetTemplateCommunitySource::decodeOne step locally re-applies badge assignment from the swarm-attested fields, ignoring any author-claimed value (§TS-6 of the internal templates-from-swarm spec).


Step 4: Verify visibility

After publishing, an agent on the same swarm — including your own — sees your template on Page 2 within a few minutes:

  1. Open the Set up Fixo wizard.
  2. Advance to Page 2 — Pick template.
  3. Toggle the Unbadged filter on. Your template appears in the list with the Unbadged chip (or Vetted / Popular when the appropriate evidence has accumulated).
  4. Selecting it advances the wizard exactly like a bundled template.

If your template does not appear:


Step 5: Update or unpublish

To update: bump version and publish again. The wizard surfaces only the highest version per (author-sid, template-id); older versions remain reachable for reproducibility but don't pollute the picker.

To unpublish: there is no removal endpoint by design — the swarm is an append-only store. Publishing a higher-versioned template with the field "deprecated": true causes the wizard to hide the slot entirely once the new version propagates.