Skip to content

docs(sandbox): a first template from a container image, and offering templates to every user - #930

Merged
pdettori merged 1 commit into
rossoctl:mainfrom
pdettori:docs/template-howtos
Nov 19, 2026
Merged

pdettori merged 1 commit into
rossoctl:mainfrom
pdettori:docs/template-howtos

Conversation

@pdettori

Copy link
Copy Markdown
Member

Summary

Two new how-to pages close the template gaps on the docs site:

  • docs/sandbox/how-to/template-from-image.md: Make a template from a container image. A user goes from an image to a working template in eight steps, with one worked example (python:3.12-slim):

    1. registry and quota checks (mocactl sbx policy, mocactl sbx quota);
    2. picking a profile;
    3. the moca-ready layer (/etc/hosts, the guest agent's tools, linux/amd64);
    4. the spec, field by field;
    5. dry-run, create and follow;
    6. activate and try it;
    7. visibility;
    8. the common refusals.

    Rewritten from the onboarding guide's §4b, which it links for the long form.

  • docs/operate/sandbox-service/offer-templates.md: Offer templates to every user. For operators:

    • when to declare a template (SBX_TEMPLATES_FILE / SBX_WORKERS) and when to use a deployment-visible template in the store;
    • that each host-built build's worker is installed once;
    • activation leases (there is no always-on setting);
    • what the policy controls: profiles, registries, quotas, trusted gate records, withdrawing a template.

    It links runbook §5 and the host-agent section for the full procedures.

  • A pointer from templates.md, a row in the user guide's Tasks table, and a bullet in operate/index.md.

Where the onboarding guide differs from the code

The pages follow the code:

  • Default visibility. A new template defaults to deployment visibility (sandbox-handlers.ts), not "only you". Only self-attested templates are stored private.
  • skip_git_identity_check. The guide's base example sets it, but rule X12 now refuses it without a gate record. The example leaves it out.
  • Registries. The default policy allows only <default>, so a Docker Hub image is refused until an admin adds docker.io.
  • The templates file with a store. With SBX_TEMPLATE_STORE=1, SBX_TEMPLATES_FILE is imported once, and later changes are only warned about. The operator page says to add new templates through the store.

The guide and the runbook's host-agent paragraph could get a follow-up so they match.

Checks

  • check-doc-links.py, check-docs-publish.sh and prettier pass, from a clean clone of the branch.
  • check-docs-site.sh: 67 pages, no broken links.
  • No live run: the podman build/push commands are standard podman flags, not taken from this repo.

Assisted-By: Claude Code

…templates to every user

Make a template from a container image walks a user from an image to a
working template in eight steps, with python:3.12-slim: the registry and
quota checks, the profile, the moca-ready layer, the spec field by field,
dry-run/create/follow, activate and try, visibility, and the common
refusals. Offer templates to every user tells an operator when to declare
a template and when to use a deployment-visible template in the store,
what installing each build's worker means, and what the policy controls.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
@pdettori pdettori added the ready-for-ai-review Request automated AI code review from clawgenti label Nov 19, 2026

@ingpaolodettori-dev ingpaolodettori-dev left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review — docs(sandbox): a first template from a container image, and offering templates to every user

Both pages fill the gap the template docs had between "here is the model" and "here is every flag", and the commands and outputs they show are the CLI's own. One nit inline.

The user page

  • Every command exists with the flags shown: templates create --spec/--profile/--dry-run, templates follow, templates activate --wait, create --template/--seed, up --template, run --sandbox, templates edit --visibility, templates tag … --build (sbx/cli.ts). The printed results match the code's text — the dry run's … passes the local checks (base) (templates.ts:490-505), the queued line's handle, follow's 0/1/5 with the 3600 s default (FOLLOW_TIMEOUT_S), and active, leased until … (:767).
  • The spec guidance is the build's actual checks: id grammar (TEMPLATE_ID_RE, 31 chars), pinned image, guest_ram_mb ≥ 128, vcpus 1-32, expect as extended regexes each of which must match, expect_rc, timeout_s 1-86400 (template-build.sh:128-252). The moca-ready list is the build's required-tools list (bash ls cat base64 file, :351-353) plus the /etc/hosts and linux/amd64 requirements from the onboarding guide.
  • The policy refusals, probe_failed, 409 template_exists and the quota notes match template-policy.ts, the host agent's failure codes, and the quota table.

The operator page

  • The two ways are the two the control plane has: a declared entry (owner null, no activation, hostManaged false) or a stored template with deployment visibility.
  • Import-once is exact: FileTemplateCatalog.importOnce imports SH_SANDBOX_TEMPLATES into an empty store and later only warns that the list differs (template-catalog.ts:278-300).
  • The declared-template steps match the scripts: template-build.sh SPEC --kernel, template-register.sh --env-file, install-host.sh BUNDLE --snapshot … [--budget-mb|--no-egress], templates-check.sh; the worker id is sbx_<id with - as _>_<first 12 hex> (template-build.sh:70-71, :219); setup.sh rolls the control plane and not the relay, as the guide's own evidence says.
  • The store path's "install each build's worker once" is the host agent's worker not installed on this host refusal, and the lease/quota/trust rules match sandbox-handlers.ts and the default policy (base 16384 MiB/8 vCPUs, registries <default>, quotas 100/10/8/200).

Checks — check-links 242 files/0 broken, publish hygiene 89 files clean, CI green (17/17).

One nit inline on the operator page's first sentence.

> declared Stable; interfaces and limits may change. Known limits:
> [Limits operators must know](runbook.md#9-limits-operators-must-know).

A template every user of the sandbox service can create sandboxes from comes one of two ways: the

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: the sentence is missing a word and reads awkwardly: "A template every user … can create sandboxes from comes one of two ways". "comes in one of two ways" (and "A template that every user …" if you want the relative clause signposted) would read cleanly.

@pdettori
pdettori merged commit 805b9c8 into rossoctl:main Nov 19, 2026
17 checks passed
@pdettori pdettori added this to the v0.11.0 milestone Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-ai-review Request automated AI code review from clawgenti

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants