Skip to content

docs(operate): the single-VM page moves to the docs, with a teardown - #911

Merged
pdettori merged 2 commits into
rossoctl:mainfrom
pdettori:docs/operate-vm
Nov 19, 2026
Merged

pdettori merged 2 commits into
rossoctl:mainfrom
pdettori:docs/operate-vm

Conversation

@pdettori

Copy link
Copy Markdown
Member

Summary

This is step 5 of the docs migration, second path: the single VM, following #910 (Compose). deploy/vm/README.md becomes docs/operate/harness/single-vm.md under Deploy and operate › Harness. The README keeps its title, banner and a pointer, which is the convention CONTRIBUTING-DOCS.md now states.

  • New "Tear it down" section. There is no uninstall script, and no teardown was documented anywhere (docs audit). The steps reverse what setup-vm.sh installs, each taken from the script:
    1. systemctl disable --now for the four units (sh-supervisor, sh-control-plane, sh-relay, moca-sandbox-firewall), then remove the unit files and sh-control-plane.service.d (the credential drop-ins), and daemon-reload.
    2. nft delete table inet moca_sandbox. The firewall unit is a oneshot with no stop action, so disabling it leaves the table in place.
    3. podman rm -f sh-redis sh-sandbox-0 … sh-sandbox-<SH_SANDBOX_COUNT-1>, then podman network rm moca-sandbox.
    4. Data, with a back-up warning: the moca-redis volume (sessions) and the file credential store (SH_CREDENTIAL_DIR, by default /var/lib/moca-control-plane).
    5. /etc/serverless-harness: env files, relay token, control-plane keys and moca-sandbox.nft.
    6. Optionally, the harness user (which the operator created), the checkout and the images. podman-restart.service is left enabled, since other containers may rely on it.
  • Banner. It now uses the Preview template, with "Known limits" pointing at "What round one does not claim". The old banner's "no upgrade or backup guide" was stale: the page has "Upgrading an existing VM". P6 is glossed on first use.
  • Operator messages. setup-vm.sh's runtime messages ("Redis persistence", "The control plane"), control-plane.env.example and research-smoke.sh now name the docs page instead of the README.
  • Tests. research-smoke.test.sh (the research-prompt block) and setup-vm.test.sh (Redis persistence documented) used to read the README's text; they now read the page.
  • Links. Links from docs/, and anchors into moved sections, follow the move.

Content check. Every line of the old README is on the page, except the stale banner and the reworded first sentence.

Not verified: I haven't run the teardown on a VM. It's derived from reading setup-vm.sh. It would be worth one pass on a scratch host before relying on it, and I'd fold any correction into the page.

Testing

  • deploy/vm/tests/setup-vm.test.sh: all tests passed.
  • deploy/vm/tests/research-smoke.test.sh: all tests passed, also under macOS bash 3.2.
  • From a clean clone of the branch:
    • make check-links: 232 files, 0 broken links;
    • scripts/check-docs-publish.sh: 79 files;
    • scripts/check-docs-site.sh: 57 pages, no broken links or anchors.
  • Prettier 3.10.1 is clean; bash -n passes on the edited scripts.

Assisted-By: Claude Code

Step 5 of the docs migration, second path: deploy/vm/README.md becomes
docs/operate/harness/single-vm.md; the README keeps its title, banner and
a pointer.

- New "Tear it down" section: there is no uninstall script, so it
  reverses what setup-vm.sh installs -- the four units and the control
  plane's credential drop-ins, the inet moca_sandbox nftables table (the
  firewall unit has no stop action), the sh-redis and sh-sandbox-N
  containers and the moca-sandbox network, the moca-redis volume and the
  file credential store (the data, with a back-up warning), and
  /etc/serverless-harness; optionally the harness user, the checkout and
  the images. podman-restart.service stays enabled, as other containers
  may need it.
- The banner uses the Preview template, its known limits pointing at
  "What round one does not claim"; its old "no upgrade or backup guide"
  was stale (the page has "Upgrading an existing VM"). P6 is glossed on
  first use.
- setup-vm.sh's operator messages, the env example and research-smoke.sh
  name the docs page instead of the README, and the two deploy tests that
  read the README's text (the research prompt block, Redis persistence)
  read the page.

Every line of the old README is on the page but the stale banner and
the reworded first sentence.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
@pdettori
pdettori marked this pull request as ready for review November 19, 2026 03:45
@pdettori
pdettori requested a review from cwiklik as a code owner November 19, 2026 03:45
@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: the single-VM page moves to the docs, with a teardown

Docs move of deploy/vm/README.md into docs/operate/harness/single-vm.md (step 2 of the path series, on top of #910), plus a new Tear it down section and the comment/link updates in deploy/vm/ and the docs that pointed at the README's sections.

Verified

  • Nothing lost: all 728 non-blank lines of the old README appear in the new page or the 8-line README, apart from 4 lines that changed deliberately (the Preview banner now links What round one does not claim; the P6/P4 glosses; two P4 link paths). Every old ## section is in the page, in the same order.
  • Teardown checked against the scripts (new content, so worth checking): four unit names match deploy/vm/systemd/, /etc/systemd/system/sh-control-plane.service.d is the drop-in dir setup-vm.sh writes (:876), nft delete table inet moca_sandbox matches the table setup-vm.sh creates, sh-redis / moca-redis / moca-sandbox / docker.io/valkey/valkey:9-alpine are the names and image it uses, two sandboxes is SH_SANDBOX_COUNT's default (:70), /var/lib/moca-control-plane is SH_CREDENTIAL_DIR's default (:775), /etc/serverless-harness is SH_ENV_DIR (:68), and podman-restart.service is enabled at :517.
  • The two updated shell suites pass locally at this head: deploy/vm/tests/research-smoke.test.sh (reads the prompt from the page now: "the single-VM docs page holds exactly one text block", and the prompt matches research_prompt) and deploy/vm/tests/setup-vm.test.sh (Redis-persistence grep now targets the page).
  • Checks: make check-links → 232 files, 0 broken; scripts/check-docs-publish.sh → 79 published files, clean. CI: 14 green, 2 pending (check, deploy-scripts); docs, lint and the site build are green.
  • Base: 3e7065c9 is current main (the #910 merge), so the compose.md / operate/index.md edits land on the moved pages correctly.

One record-keeping point (not blocking). docs/REORG-PLAN.md:426 still says deploy/vm/README.md "keep; extract config/ops content", where #910's follow-up updated the compose row to record its move; and :457 still names the README's "Configuration not in shipped env files" as a source for reference/configuration.md, which is now § Configuration not in the shipped env files on the new page.

Author: pdettori (MEMBER — maintainer). Agent/IDE config: none. Commits: 1, signed off. CI: 14 passing, 2 pending.

Comment thread deploy/vm/README.md
Its index is in Redis on `127.0.0.1:6379`, unauthenticated, so anyone with a shell or an
unrestricted SSH forward on the VM can rewrite it. Restrict non-operator SSH accounts ("Reaching
it").
**How to install, run, upgrade and tear down a single-VM deployment** is on the documentation site:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

suggestion: the sections this file used to hold are now only on the new page, but several plain-text references elsewhere still send readers to deploy/vm/README.md for them (they are not links, so check-links cannot see them):

  • deploy/k8s/README.md:118 — "The GitHub OAuth app"
  • deploy/microvm/P4-ON-P6.md:764 — "Redis persistence" (and :90/:92 send readers to the README as the install path)
  • docs/demos/vm-two-user-acceptance.md:49 — "The GitHub OAuth app"
  • docs/demos/vm-multi-user-demo.md:76 — "Bring it up" and "The GitHub OAuth app"; :170 — "A research turn"; :356 — "The prompt is deploy/vm/README.md's"
  • docs/harness/how-to/use-mocactl.md:349 — "The control plane"

This PR already fixed the same class of reference in deploy/vm/env/*.example, setup-vm.sh and research-smoke.sh, so these look like the remaining set. Pointing them at docs/operate/harness/single-vm.md keeps the pointer page from being a dead end.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 2870260, all six:

  • deploy/k8s/README.md:118 now links Single VM.
  • deploy/microvm/P4-ON-P6.md :90, :92 and :764 now name docs/operate/harness/single-vm.md (the install path, and "Redis persistence").
  • docs/demos/vm-two-user-acceptance.md:49 and docs/demos/vm-multi-user-demo.md (:25, :76, :170, :356) now link the page, with #a-research-turn-curl-and-git-in-the-sandbox / #the-github-oauth-app where they name a section.
  • docs/harness/how-to/use-mocactl.md:349 now links Single VM.

I also pointed the root README's Status table at the Compose and Single VM pages. After this, git grep deploy/vm/README outside the design records finds only the REORG-PLAN history.

Comment thread docs/operate/harness/single-vm.md Outdated
`v0.5.1` (`docs/demos/vm-two-user-acceptance.md`, #407). On the credential side `multi` no longer
refuses async turns from this release, provided the control plane carries the grant ring and the
inference listener; `setup-vm.sh` configures neither, so enabling `multi` is three deliberate
edits to `/etc/moca/control-plane.env` and a `systemctl restart moca-control-plane`:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

suggestion (pre-existing, but this is the page's home now): this line names /etc/moca/control-plane.env and systemctl restart moca-control-plane, while the page's own The control plane section and deploy/vm/setup-vm.sh use /etc/serverless-harness/control-plane.env (SH_ENV_DIR, setup-vm.sh:68) and sh-control-plane.service (the unit in deploy/vm/systemd/, enabled at :1229). An operator following this bullet edits a file that does not exist and restarts a unit that does not exist. Worth correcting in this move.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 2870260: "three deliberate edits to /etc/serverless-harness/control-plane.env and a systemctl restart sh-control-plane.service". That matches SH_ENV_DIR (setup-vm.sh:68), the unit in deploy/vm/systemd/ and the rest of the page. It's the contradiction the docs audit listed as #11, so it's good to have it gone.

…file and unit, REORG-PLAN)

- The plain-text pointers to deploy/vm/README.md's sections, which
  check-links cannot see, now name the Single VM page (linked, with the
  section's anchor where it is a link): deploy/k8s/README.md ("The
  GitHub OAuth app"), deploy/microvm/P4-ON-P6.md (the install path and
  "Redis persistence"), the two VM demos ("Bring it up", "The GitHub
  OAuth app", "A research turn", the prompt), and Use mocactl ("The
  control plane"). The root README's Status table links the Compose and
  Single VM pages too.
- single-vm.md: enabling MOCA_TENANCY=multi named /etc/moca/control-
  plane.env and moca-control-plane, neither of which exists; it is
  /etc/serverless-harness/control-plane.env (SH_ENV_DIR) and
  sh-control-plane.service, as the rest of the page and setup-vm.sh say.
- REORG-PLAN.md: the deploy/vm row records the move, and the
  configuration reference's source names the page's section.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
@pdettori

Copy link
Copy Markdown
Member Author

On the record-keeping point: done in 2870260.

Both are same-width cells, so it's a two-line diff with no table reflow. From a clean clone: 232 files, 0 broken links; publish check 79 files; site build 57 pages.

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