Skip to content

doc: describe the managed layered root and platform-clone activation - #591

Draft
Enrique Saurez (esaurez) wants to merge 9 commits into
devfrom
esaurez/guide-image-backed-platform-clones-20261016
Draft

Enrique Saurez (esaurez) wants to merge 9 commits into
devfrom
esaurez/guide-image-backed-platform-clones-20261016

Conversation

@esaurez

@esaurez Enrique Saurez (esaurez) commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

This updates the architecture guide with the target design for the shared image-backed sandbox runtime tracked by #535 and its current sub-issues. It defines the cold image-backed path and the common host and guest library contracts, and it also records the platform-clone design that will move to a separate platform-clone meta issue when that issue is filed. The guide describes the target rather than the current implementation. Refs #535.

Changes

Change Sections Issues
Shared host and guest libraries and compatibility contracts. External orchestrators and external guest agents use adapters around shared libraries instead of reimplementing root planning, mappings, execution, and supervision. The nvx-rs adapter API is guarded by a public-API check, and the guide defines the runtime-store format, runtime identity, live-upgrade boundary, and same-host-boot reattach rule. 1.3, 1.5, 5.2.4 #619, #620
Managed layered root. The layered root becomes a managed root assembled before readiness. It accepts host mapping tables, gives each execution a child cgroup, and uses shared host and guest libraries. NVX speaks NVXC v2 over NVXS; other adapters may use their own application framing and admission policy. The layered root never creates workload accounts. 4.1.2–4.1.4, 4.2.2, 4.3.3, 5.1.3, 5.2, 5.2.4 #621, #622, #558, #566
Image verification and root assembly. distro is either EROFS or a primary-GPT image with opaque metadata in partition 1, which the adapter parses, and ordered read-only ext4 lowers in later partitions. Validation is bounded, expected identities are optional, kernel partitions must match validated entries, and the overlay uses one explicit option set with a safe choice for untrusted lower attributes. The RAM upper is selected by exactly one nvx_overlay_upper=ramfs token: a tmpfs at the kernel's default size, with no scratch block. 2.1.3, 3.4, 4.1, 4.1.1, 5.1.2 #621, #622, #556, #558
Cold launch planning. Image-format tokens remove probing fallback, nested mapping access is checked consistently, and the effective kernel command line is limited to 2,048 bytes including NUL, with a 1,024-byte caller budget. Cold mappings retain provisioned identities and recheck them at start; opened-object receipts remain restore-only. 3.6.5, 4.1.3, 5.1.2 #622, #552, #570
Workload identity and layered-root isolation. Adapters select UID, GID, groups, account mode, machine-ID mode, hostname, and capabilities within library rules. Capabilities use a fixed allowlist, non-root gets none, and no_new_privs is mandatory. Layered-root executions move the root over /, receive private mount, PID, and UTS namespaces, and get restricted /dev and /proc views. Listener-announcement authenticity now follows from the capability, sysctl, and read-only /proc/sys rules. 3.5.4, 4.3.1–4.3.2, 5.5.8 #619, #621, #566
NVXC v2 execution and admission. READY reports the application version, build ID, root profile, and layered-root activation identity. Hosts validate it before mappings or execution. NVXC streams stdin, stdout, and stderr with separate bounded credits and no total output cap, defines bounded output draining and settlement, and runs one execution at a time. NVX adds a FIFO of eight waiters, a 60-second default wait, stable queue errors, and a non-escalating CLI Stop policy. 1.5, 4.4, 5.2.4 #623, #581
Platform-clone activation. A platform template may leave the image unbound, use a shorter placeholder layer, capture the RAM-backed layout before root assembly, and bind an aggregate to a dormant filesystem slot at restore. Restore packet v5 carries a bounded activation record. Guest repair validates it before acknowledgement, then assembles the root, applies restore-time settings, reports readiness, and fails closed before any workload runs. Generated machine IDs are recreated with getrandom after reseeding; image machine IDs remain unchanged. 1.5.2, 2.1.2–2.1.4, 3.1, 3.2.10, 3.4.4–3.4.5, 3.6.10, 5.2.2, 5.3.2, 5.4.4, 5.4.7, 5.5, 5.6.2 #540, #542, #543, #544, #545, #556, #557
Network policy for platform clones. Only a platform template captured with a deny-all policy may receive a new policy. The endpoint installs it before a restored processor runs, while the activation record supplies guest DNS and ingress settings. Other snapshots retain the same-policy rule. 1.5.2, 2.1.2, 2.1.4, 3.5.4–3.5.6, 5.4.7, 5.5.9 #536, #543, #551, #553
Restore attachment identity. Restore may verify expected identities for read-only layers, filesystem roots, and pinned file children before processors run. Receipts report the objects actually opened. File children may follow their names or remain pinned, and a dormant filesystem slot may restore an aggregate. 1.4, 3.6.2, 3.6.5, 3.6.8–3.6.10, 5.4.7, 5.5.1 #548

Open points for review

Unchanged on purpose:

  • The blockless managed root still has no private mount, PID, UTS, or device view; it remains contained by credentials and a cgroup.
  • The fixed device slots in 2.5 and the reserved host-filesystem slot on cold boot remain unchanged.
  • Image layers remain trusted inputs. UUID and GUID checks detect attachment mistakes but do not prove content integrity.
  • doc/run.md and doc/usage.md continue to describe current CLI behavior. This PR changes only the target architecture guide.

Validation

  • python scripts/check_markdown_links.py passes.
  • git diff --check passes for the full PR diff.
  • Documentation only.

State in the architecture guide the design that the image-backed runtime
roadmap needs, so that its differences from the guide can be reviewed
before implementation:

- a managed layered root with every control feature, readiness after root
  assembly from boot tokens, and shared host and guest libraries;
- a distro image that is one EROFS filesystem or a GPT disk of ordered
  layers;
- control protocol version 2 with standard input, per-execution credits,
  and no total output limit;
- platform-clone inputs: zero-filled shorter layers, a RAM-layout platform
  capture, an aggregate on a dormant filesystem slot, and an activation
  record in restore packet version 5;
- a new network policy at restore for platform templates captured with a
  deny-all policy;
- expected attachment identities, receipts, and pinned file children.

Section numbers, tables, figures, and anchors are unchanged.

Refs #535

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 16, 2026 20:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The proposed image contract conflicts with tracked requirements, and restore extensions need explicit compatibility gates.

4 open issues
What changed in this PR

Updates the architecture guide with the proposed shared image-backed runtime design tracked by #535, without changing implementation behavior.

Changes:

  • Defines managed layered roots, shared libraries, and version-2 streaming execution.
  • Specifies platform-clone activation and restore-time storage, filesystem, and network inputs.
  • Documents attachment identity checks and pinned file children.
File Description
doc/​design/​5.6-shutdown-and-failure-semantics.md Adds activation failure handling.
doc/​design/​5.5-restore-protocol.md Defines activation records and clone activation ordering.
doc/​design/​5.4-snapshot-artifact-and-attachment-model.md Extends restore attachments and identity receipts.
doc/​design/​5.3-snapshot-protocol.md Requires capture before image and overlay mounts.
doc/​design/​5.2-readiness-and-runtime-control.md Clarifies readiness, execution queues, and shared backends.
doc/​design/​5.1-boot-protocol.md Adds activation tokens and root preparation ordering.
doc/​design/​4.4-host-guest-control-interface.md Defines protocol version 2 and matched bundles.
doc/​design/​4.3-isolation-and-resource-model.md Places execution cgroups beneath workload limits.
doc/​design/​4.2-guest-agents-and-workload-model.md Extends execution containment to managed layered roots.
doc/​design/​4.1-guest-filesystem-and-image-model.md Defines layered images, writable uppers, and managed roots.
doc/​design/​3.6-host-filesystem.md Adds pinned children and dormant aggregate attachment.
doc/​design/​3.5-network.md Describes platform restore policy replacement.
doc/​design/​3.4-block-storage.md Defines padded platform image capacity.
doc/​design/​3.1-platform-control-device.md Connects restore packets to activation.
doc/​design/​2.1-machine-model-and-configuration.md Extends storage and restore configuration rules.
doc/​design/​1.5-compatibility-and-versioning-model.md Updates activation and template compatibility contracts.
doc/​design/​1.4-trust-boundaries.md Documents opened-object identity verification.
doc/​design/​1.3-system-components-and-responsibilities.md Assigns shared-library and adapter responsibilities.

Review effort: Balanced

Comment on lines +80 to +84
device presents. A launch that declares a `platform` capture may give the
`distro` layer a logical length larger than its file, typically a small
placeholder, and the snapshot records that length. A restore may then supply
any layer file that is a whole number of logical blocks long and no longer
than the recorded length; a longer file is rejected. The device presents the
Comment thread doc/design/3.5-network.md Outdated
Comment on lines +256 to +260
The exception is a `platform` snapshot captured with a deny-all policy, which
denies egress by default without allow rules, denies host loopback without a
proxy endpoint, and grants no inbound access. Its guest has no DNS server and
announces no listeners, and its endpoint holds no flows, listeners, or
forwards, so a restore of it may supply a new policy, including
Comment on lines 422 to +424
session. A dormant snapshot may restore with no export or bind one new
directory export, but not an aggregate. The resumed guest then mounts the tag
explicitly, because its boot-time mount step has already run. A snapshot
without this capability cannot add an export, and active state cannot restore
into a dormant slot.
directory export or aggregate, whose children are then fixed for the restored
process. The resumed guest then mounts the tag explicitly, because its
Comment on lines +179 to +181
root, creating targets under the rules of
[Live Host Shares](#412-live-host-shares), with `nosuid,nodev`, and
read-only when requested. An announced count of zero mounts nothing.
Make the guide changes consistent with the rest of the guide and tighten
their wording:

- run the boot conformance checks before a managed template's platform
  capture, which precedes readiness;
- end platform-clone activation at readiness, so a host mapping failure
  keeps refusing executions as after a cold boot;
- send the version-2 exit report after the last output of both streams;
- carry the workload-account request and the image's UUID or GUID in the
  activation record;
- let hosts offer a new network policy only to clones of a managed layered
  root, which learn their DNS server and ingress mode from the record;
- make scratch optional in restore reconstruction for the RAM-backed layout;
- complete Start once every announced mapping is mounted, and qualify the
  failure summary for guest-validated activation records.

Refs #535

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 16, 2026 21:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The coordinated changes to security-sensitive restore, isolation, and protocol contracts require final human design review.

4 open issues

Review effort: Balanced

Replace "embedding host adapters" with external orchestrators, which drive
the host control library through their own adapters, and describe an
external guest agent that runs as the guest's init process and embeds the
guest runtime library. The guide already uses "orchestrator" for the
software that drives NVX and "guest agents" for its guest software.

Refs #535

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 17, 2026 20:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Dormant aggregate binding needs an explicit versioned platform-template restriction consistent across the guide.

4 open issues
1 previously missed issue

In code that hasn't changed since last review

Medium severity Require explicit aggregate-binding capability for platform snapshots

doc/​design/​2.1-machine-model-and-configuration.md:114

The existing dormant-slot capability permits directory binding, but this wording also permits aggregate binding without a new platform-template capability. Sections 3.6.10 and 5.4.7 repeat that unrestricted permission. Linked #540 requires a newly versioned platform-template contract and preserves older/workload snapshot behavior; an old dormant slot does not establish that its guest supports aggregates. Require an explicitly recorded aggregate-binding capability on platform snapshots, and state the same restriction in all three sections.

Review effort: Balanced

Define bounded primary-GPT validation, explicit image formats, overlay option sets, nested mapping rules, and the layered-root account policy. Align the effective command-line limit and RAM-backed upper token with the guest kernel contract.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Make credentials, account mode, machine identity, namespaces, mounts, and device visibility adapter-selected within library rules. Explain why listener announcements remain authentic while publication is active and align the surrounding guest-runtime text.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Specify the nvx-rs adapter contract, runtime-store and runtime-identity rules, and NVXC v2 readiness validation. Define execution streaming, NVX queueing and Stop policy, and same-boot reattach behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep cold mapping identity checks at provision and start. Reserve opened-object receipts for platform-clone restore.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep private namespaces and the restricted device view specific to the layered root. Scope single-execution framing to NVXC, clarify adapter framing over NVXS, and tighten runtime identity, GPT, machine-ID, and execution-settlement details.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Comment on lines +264 to +267
Cold mappings record these identities at provision and recheck them at start;
a mismatch refuses the export. Opened-object
[attachment receipts](5.4-snapshot-artifact-and-attachment-model.md#547-host-attachments)
belong to platform-clone restore and are not part of the cold mapping path.
Comment on lines +10 to +14
at initial boot. Capabilities come only from this allowlist: `CHOWN`,
`DAC_OVERRIDE`, `FOWNER`, `FSETID`, `KILL`, `SETGID`, `SETUID`, `SETPCAP`,
`SETFCAP`, `NET_BIND_SERVICE`, `NET_RAW`, `SYS_CHROOT`, and `AUDIT_WRITE`.
The library refuses every other capability and gives a non-root identity no
capabilities. It always sets `no_new_privs`. The allowlist excludes
Comment on lines +13 to +14
The library refuses every other capability and gives a non-root identity no
capabilities. It always sets `no_new_privs`. The allowlist excludes
Comment on lines +80 to +83
graceful shutdown. If that sequence does not complete in time, NVX's CLI
reports the timeout and leaves the VM running; it never escalates. The
library's identity-verified forced termination remains available to other
callers.
The RAM-backed overlay layout mounts its tmpfs upper at the kernel's default
size, half of guest memory, and adds no size token.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 20, 2026 04:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants