Repository navigation
runtime-adapter: refresh, list, inspect, and remove template generations - #962
Open
Enrique Saurez (esaurez) wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Retirement cleanup skips unindexed tombstones left by interrupted retirement, allowing them to persist indefinitely instead of being retried during later evictions.
1 open issue
What changed in this PR
Adds template-generation management to the runtime adapter through NVX’s public template-store API, implementing the template operations portion of #847.
Changes:
- Adds
refresh,list,inspect, and lease-awareremovecommands. - Adds eviction of superseded generations and metadata-only listings without reading payloads or hashing.
- Documents the operations and adds command-line and VM-backed lifecycle tests.
| File | Description |
|---|---|
tests/runtime-adapter/tests/vm_template.rs |
Tests refresh, eviction, listings, and removal with retained leases. |
tests/runtime-adapter/tests/template_operations.rs |
Tests argument validation, missing stores, and empty stores without a hypervisor. |
tests/runtime-adapter/tests/common/mod.rs |
Adds a shared refresh-command helper. |
tests/runtime-adapter/src/lib.rs |
Exposes and documents the host-only generations module. |
tests/runtime-adapter/src/generations.rs |
Implements generation descriptions and eviction policy. |
tests/runtime-adapter/src/bin/runtime-adapter-host.rs |
Adds command parsing, dispatch, output, and busy status handling. |
tests/runtime-adapter/README.md |
Documents store behavior, commands, output, and test scenarios. |
Review effort: Balanced
Enrique Saurez (esaurez)
force-pushed
the
esaurez/847-pr1-template-operations-20261024
branch
from
October 29, 2026 08:01
747d4ad to
32942c3
Compare
Enrique Saurez (esaurez)
changed the base branch from
esaurez/847-pr1-base-snapshot-20261028
to
esaurez/846-pr2-network-templates-20261025
October 29, 2026 08:01
This was referenced Oct 29, 2026
Enrique Saurez (esaurez)
force-pushed
the
esaurez/846-pr2-network-templates-20261025
branch
from
October 29, 2026 14:56
e9e7fc6 to
2a777a3
Compare
Enrique Saurez (esaurez)
force-pushed
the
esaurez/847-pr1-template-operations-20261024
branch
from
October 29, 2026 15:06
32942c3 to
83fdc81
Compare
Enrique Saurez (esaurez)
force-pushed
the
esaurez/846-pr2-network-templates-20261025
branch
from
October 29, 2026 15:25
2a777a3 to
e19ceed
Compare
The runtime adapter's host program gets refresh, list, inspect and remove commands beside create, so that the template store that create fills can be refreshed, examined and emptied through the same program. Refresh captures a new generation of the class even when the store already serves one. Create and refresh print the key and generation only after the store commits them. Neither runs for a restore. The store is the directory that each command names: create and refresh create it, while the other commands only open it. A store keeps the latest generation of each capture class. After create or refresh serves a generation, the adapter retires every other generation of its class that the store published before it, and any tombstoned one. Retirement deletes an unleased generation at once and leaves a leased one in place until its leases end. A failed eviction only warns, because the served generation is already committed, and the next create or refresh of the class retries it. List and inspect read only the store's index, tombstones and leases. They never decode a key, load VM state or hash anything, since decoding a key hashes its kernel command line. Remove retires a generation and exits with the busy status, with the leases that keep it, while any remain. New tests check the commands' refusals without a hypervisor. VM tests refresh a template, check what each eviction retires, and remove a generation while leases keep it. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 7d3db585-441c-495b-901f-ab7203c0f36b
Enrique Saurez (esaurez)
force-pushed
the
esaurez/847-pr1-template-operations-20261024
branch
from
October 29, 2026 15:34
83fdc81 to
43879d7
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Part of #847 (PR 1 of 2: template operations).
Stacked on #958.
Chain: #951 → #954 → #957 → #959 → #960 → #955 → #958 → this PR → #963, on
dev; #879, #881, #885, #886, #877, #932, #884, #887, #933, #880, #936, #937, #939, #940, #941, #888, #949, and #950 have merged.What and why
The runtime adapter's host program creates templates with
create, but nothing refreshes, examines, or empties the template store thatcreatefills. This PR addsrefresh,list,inspect, andremove, as the operations table of #847 asks, through the public API ofnvx::host::templatealone.refreshcaptures a new generation of the class even when the store already serves one. Ascreatedoes, it prints the key and the generation only once the store committed them, and no restore triggers either command.listandinspectreport each generation from the store's index, its tombstones, and the records of its leases alone: its store generation, the identities of its compatibility key and of its capture class, its state,availableortombstoned, whether a clone may restore it at the host's time and why, and its leases.inspectadds each lease's sandbox and launch, and the metadata of the capture. They read no payload, neither the snapshot nor the key, whose decoding checks a digest, so they load no VM state and hash nothing.removeretires the generation that it names with NVX'sStore::retire, which tombstones it first, so that no new lease takes it, and deletes it once no lease remains. While leases keep it, the command exits with status 7, busy, and lists them. It never moves or deletes a leased generation.Where the store lives, and what it evicts
The store is the directory that each template command names, private to the current user and apart from every sandbox's store.
createandrefreshcreate it if needed, whilelist,inspect, andremoveonly open it.Of each capture class, the adapter keeps the generation that it served last. Once
createorrefreshserved a generation,generations::evictretires every other generation of the class that the store published before it, and any that a tombstone quarantines. A generation that leases keep stays tombstoned, with its payload, until a later retirement finds its leases gone. An eviction that fails only warns, since the store already committed what the command served, and the nextcreateorrefreshof the class retries it.Tests
template_operations, without a hypervisor: the command lines that the host program refuses, the operations on a directory that holds no template store, and a store without generations.vm_template, in VMs: a refresh that captures and retires the generations that it supersedes while a clone leases one of them, and a removal that reports busy while leases keep its generation, then deletes it once they end.Not in this PR
Validation
At this PR's head 43879d7, the same commit as the earlier head 32942c3, restacked onto #958's head e19ceed: its tree, 6da8527f, is the merge of 32942c3 into
devat fbeb563, which holds #951, #954 and #957, plus #955's fix that treats a path whose links loop as a changed object. That merge, without the fix, passed the documentation gates ofnvx-rsand of the test adapter, Clippy, validate-nvx on Linux and on Windows, and the Markdown link check; the fix has its own tests in #955. The rest of this section describes 32942c3, on #958's earlier head e9e7fc6.Pending at 32942c3.