Files
devvm/internal/msg/docs.go
T
w3cjandClaude Opus 5.5 7cd15a0862 feat(retention): retention settings for what devvm keeps, all off by default
~/.config/devvm/retention holds key=value lines, written by devvm space
set KEY=VALUE... (KEY= turns one off; a bad key or value is refused
before the file is written; all off removes the file). Every setting
is off unless set:

- logs.runs: run logs kept (20 when off; ui.KeepRunLogs).
- exports.age, exports.count: exports that old deleted, then all but
  the newest count.
- tools.unused-age: current shared tool images no VM's state lists,
  counted from when retention first found them so (an <image>.idle
  record in the share, dropped when a VM lists it again).
- orphans.age: what devvm keeps for VMs their backend no longer has
  (vm.Leftovers, as gc --orphans), once their state hasn't changed for
  that long.

Ages as state.ParseAge (30d, 2w, 12h). Not the backends' caches (gc
--caches only), and never a VM, an image, or a tool any VM's state
lists. devvm's commands apply the settings at their start at most once
a day (data/retention.run; again at once after a clock that went
back), under a lock so two devvms never apply them at once (a dead
one's lock is taken over after 10 minutes), skipping the tools while a
build holds the share's lock; it says what it deleted in one line on
stderr (retention_deleted). orphans.age needs the backends asked, so
only devvm gc --retention applies it; gc --retention applies all of
them at once. space, gc, completion and devvm's internal commands
don't apply them on their own. A bad line names the file and the line,
and then none applies (retention_unreadable). devvm space shows each
setting beside its row (RETAIN), with what it would free now.

Not done here: logs.network.size and logs.network.files, which
override the proxy's log rotation defaults: rotation is another task's
(the proxy rotates its logs), not on this branch; space set refuses
them until it is.

Messages: retention_deleted, retention_off, retention_busy,
retention_unreadable, retention_failed, retention_bad,
retention_saved. Docs: using/settings.md (the file, each setting, all
off), the What devvm keeps page (what each setting does, RETAIN),
using/images.md's Cleaning up, the CLI reference.

Review (deletes only what it's told to): no file or an empty one
deletes nothing (txtar, unit); a VM, an image and a tool any VM's state
lists are never retention's (Idle builds on NoVM: a stopped VM's and a
leftover state's tools stay until orphans.age deletes that state); two
runs at once (lockRetention); a clock that jumps (retainDue, Idle and
the age checks skip a negative age); the one-line report on every
deletion. Tests: TestRetention (parser, set, off, bad lines),
TestIdle, TestExportsToRetire, TestRetainDueAndLock; retention.txtar
(refusals, space set and RETAIN, the automatic run once a day and
again after a day, gc --retention with tools, a VM's tool kept).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-31 13:29:49 -07:00

340 lines
24 KiB
Go

package msg
// docs links messages to the docs page that says more: message ID to
// "page#anchor", a page in docs/content/docs (a folder's _index.md for a
// section) and a heading on it. devvm
// prints the page's address on the line after the message's text.
// TestDocLinks checks every entry.
var docs = map[string]string{ //nolint:gosec // message IDs and pages, not credentials
"backend_lacks": "backends#when-a-backend-lacks-something",
"backend_unreviewed": "backends#when-a-backend-lacks-something",
"backend_unreviewed_used": "contributing/testing#unreviewed-emulations",
"backend_unknown": "backends#choosing-a-backend",
"backend_unknown_default": "backends#choosing-a-backend",
"backend_unknown_vm": "backends#choosing-a-backend",
"smolvm_missing": "backends/smolvm#requirements",
"smolvm_missing_fix": "backends/smolvm#requirements",
"smolvm_broken": "backends/smolvm#requirements",
"smolvm_broken_fix": "backends/smolvm#requirements",
"smolvm_old": "backends/smolvm#requirements",
"smolvm_old_fix": "backends/smolvm#requirements",
"smolvm_host_unsupported": "backends/smolvm#requirements",
"smolvm_machine_foreign": "backends/smolvm#whats-different",
"smolvm_from_registry_only": "using/from#backends",
"smolvm_mount_colon": "backends/smolvm#whats-different",
"smolvm_no_agent": "internals/smolvm#ssh-agent-forwarding",
"agent_fixed": "internals/smolvm#ssh-agent-forwarding",
"agent_unchosen_stop": "backends/smolvm#whats-different",
"ports_no_ssh": "using/ports-size#ports",
"ports_forward_failed": "using/ports-size#ports",
"vm_no_ssh": "using/ssh#ssh-access-by-name",
"vm_no_sshd": "using/ssh#ssh-access-by-name",
"smolvm_ssh_port_forwarded": "using/ports-size#ports",
"smolvm_script_failed": "using/troubleshooting#a-build-fails",
"docker_host_unsupported": "backends/docker#requirements",
"docker_not_installed": "backends/docker#requirements",
"docker_down": "backends/docker#requirements",
"docker_access": "backends/docker#requirements",
"docker_old": "backends/docker#requirements",
"docker_not_linux": "backends/docker#requirements",
"docker_arch": "backends/docker#requirements",
"docker_engine_other": "backends/docker#which-engine-devvm-uses",
"docker_not_shared": "backends/docker#docker-desktops-file-sharing",
"docker_mount_path": "backends/docker#what-docker-vms-cant-do",
"docker_ssh_path": "internals/docker#ssh-for-editors",
"docker_connect_failed": "internals/docker#ssh-for-editors",
"docker_container_foreign": "backends/docker#what-youll-see-in-docker",
"docker_volume_foreign": "backends/docker#what-youll-see-in-docker",
"docker_network_foreign": "backends/docker#what-youll-see-in-docker",
"docker_network_shared": "internals/docker#network-policy",
"docker_linux_build_missing": "backends/docker#requirements",
"docker_linux_build_other": "using/troubleshooting#docker-on-macos-cant-get-devvms-linux-build",
"docker_linux_build_fetch_failed": "using/troubleshooting#docker-on-macos-cant-get-devvms-linux-build",
"docker_linux_build_mismatch": "using/troubleshooting#docker-on-macos-cant-get-devvms-linux-build",
"docker_script_failed": "using/troubleshooting#a-build-fails",
"docker_remaking": "internals/docker#changing-what-docker-fixes",
"docker_sysbox": "backends/docker#the-docker-layer",
"docker_layer_no_sysbox": "backends/docker#the-docker-layer",
"docker_layer_needs_vm": "backends/docker#the-docker-layer",
"docker_layer_runtime": "backends/docker#the-docker-layer",
"docker_route_localnet": "backends/docker#the-docker-layer",
"net_docker_layer": "backends/docker#the-docker-layer",
"net_off_docker_layer": "backends/docker#the-docker-layer",
"net_off_backend": "backends#when-a-backend-lacks-something",
"net_about": "safety/network#turning-it-on-or-off",
"docker_tools_failed": "internals/docker#shared-tools",
"disk_over": "backends/docker#what-docker-vms-cant-do",
"size_disk_default_unused": "backends/docker#what-docker-vms-cant-do",
"disk_low": "using/troubleshooting#not-enough-free-space",
"disk_low_warning": "using/ports-size#free-space",
"disk_free_unknown": "using/troubleshooting#not-enough-free-space",
"lima_missing": "backends/lima#requirements",
"lima_broken": "backends/lima#requirements",
"lima_old": "backends/lima#requirements",
"lima_host_unsupported": "backends/lima#requirements",
"qemu_missing": "backends/lima#requirements",
"lima_missing_fix": "backends/lima#requirements",
"lima_broken_fix": "backends/lima#requirements",
"lima_old_fix": "backends/lima#requirements",
"qemu_missing_fix": "backends/lima#requirements",
"lima_arch_unsupported": "backends/lima#requirements",
"macos_old": "backends/lima#requirements",
"no_kvm": "backends/lima#requirements",
"kvm_access": "backends/lima#requirements",
"lima_global_config": "internals/lima#a-lima-home-of-its-own",
"vm_has_networks": "internals/lima#a-lima-home-of-its-own",
"lima_home_too_long": "backends/lima#limits",
"mount_comma": "backends/lima#limits",
"disk_shrink": "backends/lima#limits",
"image_in_use": "using/images#deleting-images",
"qemu_refused": "internals/lima#confinement",
"start_no_ssh": "using/troubleshooting#a-vm-wont-boot",
"no_ubuntu_image": "using/troubleshooting#base-cant-build-on-lima",
"ubuntu_bad_signature": "internals/images#ubuntus-cloud-image",
"ubuntu_checksum_unpinned": "internals/images#ubuntus-cloud-image",
"ubuntu_unsigned": "internals/images#ubuntus-cloud-image",
"unknown_layer": "using/images#layers",
"layer_name_invalid": "using/customizing#your-own-layers",
"layer_name_reserved": "using/customizing#your-own-layers",
"layer_created": "using/customizing#your-own-layers",
"base_features": "using/customizing#choosing-features",
"base_features_none": "using/customizing#choosing-features",
"unknown_feature": "using/customizing#choosing-features",
"feature_shadowed": "using/customizing#your-own-features",
"script_failed": "using/troubleshooting#a-build-fails",
"rebuild_replaces": "using/images#rebuilding",
"layer_exists": "using/customizing#your-own-layers",
"images_stale_note": "using/images#cleaning-up",
"images_unused": "using/images#cleaning-up",
"retention_busy": "using/settings#retention",
"retention_unreadable": "using/settings#retention",
"retention_failed": "using/settings#retention",
"retention_bad": "using/settings#retention",
"gc_caches_need_terminal": "using/space#the-backends-caches",
"gc_orphans_unknown": "using/space#leftovers-of-a-vm-deleted-outside-devvm",
"gc_orphan_elsewhere": "using/space#leftovers-of-a-vm-deleted-outside-devvm",
"gc_orphan_recent": "using/space#leftovers-of-a-vm-deleted-outside-devvm",
"gc_older_than_needs_exports": "using/images#cleaning-up",
"gc_bad_age": "using/images#cleaning-up",
"gc_names_need_tools": "using/images#cleaning-up",
"gc_unknown_tool": "using/images#cleaning-up",
"images_total": "using/space#devvm-space",
"space_backend_unknown": "using/space#devvm-space",
"space_stray": "using/space#vms-devvm-has-no-state-for",
"space_caches_note": "using/space#the-backends-caches",
"tools_not_images_rm": "using/images#deleting-images",
"tool_not_locked": "using/images#shared-tools",
"vm_outdated": "using/images#outdated-vms",
"bad_path": "backends/lima#limits",
"vm_name_no_room": "internals/backends#vm-names",
"vm_other_folder": "getting-started/commands#a-folder-made-again",
"vm_other_folder_rm": "getting-started/commands#a-folder-made-again",
"vm_other_folder_adopt": "getting-started/commands#a-folder-made-again",
"vm_unfinished": "internals/overview#an-existing-vm",
"use_parent_vm": "getting-started/commands#a-subfolder",
"using_parent_vm": "getting-started/commands#a-subfolder",
"rm_parent_vm": "getting-started/commands#a-subfolder",
"widen_parent_vm_refused": "getting-started/commands#a-subfolder",
"use_parent_vm_repo": "getting-started/commands#a-subfolder",
"no_terminal_confirm": "getting-started/commands#adding-to-a-vm",
"add_layer_failed": "getting-started/commands#adding-to-a-vm",
"size_next_start": "using/ports-size#size",
"rm_export_failed": "using/coding-agents#history",
"history_not_exported": "using/coding-agents#history",
"git_replaced": "safety/git-protection#not-covered",
"git_appeared": "internals/git-protection#on-each-launch",
"git_embedded_new": "safety/git-protection#strict",
"git_hooks_unlocked": "internals/git-protection#on-each-launch",
"unsafe_folder": "using/settings#project-folders-devvm-refuses",
"unsafe_folder_inside": "using/settings#project-folders-devvm-refuses",
"unsafe_folder_used": "using/settings#project-folders-devvm-refuses",
"cpus_not_number": "using/ports-size#size-and-ports",
"size_not_gib": "using/ports-size#size-and-ports",
"too_many_cpus": "using/ports-size#size-and-ports",
"too_much_memory": "using/ports-size#size-and-ports",
"port_invalid": "using/ports-size#size-and-ports",
"devvm_other_first": "getting-started/install#one-devvm",
"host_memory_low": "getting-started/install#requirements",
"host_cpus_few": "getting-started/install#requirements",
"base_fitted": "using/ports-size#size-and-ports",
"ports_list_needed": "using/ports-size#ports",
"ports_rm_all": "using/ports-size#ports",
"ports_taken": "using/troubleshooting#a-listed-port-isnt-forwarded",
"no_image_for": "using/images#which-image-a-new-vm-gets",
"ca_not_certificate": "using/settings#a-companys-ca",
"ca_not_ca": "using/settings#a-companys-ca",
"ca_invalid": "using/settings#a-companys-ca",
"ca_link": "using/settings#a-companys-ca",
"ca_folder_link": "using/settings#a-companys-ca",
"ca_unreadable": "using/settings#a-companys-ca",
"ca_folder_unreadable": "using/settings#a-companys-ca",
"doctor_proxy_ca": "using/troubleshooting#tls-errors-behind-a-company-proxy",
"net_direct_route": "safety/network#when-it-isnt-enforced",
"net_unenforced_stop": "using/troubleshooting#a-vm-shows-as-unenforced",
"net_unenforced": "using/troubleshooting#a-vm-shows-as-unenforced",
"net_off_log": "safety/network#turning-it-on-or-off",
"net_off_policy": "safety/network#turning-it-on-or-off",
"net_flag_ignored": "safety/network#turning-it-on-or-off",
"net_on_old_tokens": "safety/network#turning-it-on-or-off",
"net_off_next_start": "safety/network#turning-it-on-or-off",
"not_a_rule": "safety/network#rules",
"proxy_start_failed": "internals/network#the-proxy",
"proxy_port_taken": "internals/network#the-proxy",
"proxy_stop_failed": "internals/network#how-long-a-proxy-runs",
"upstream_proxy_scheme": "safety/network#behind-a-company-proxy",
"upstream_proxy_invalid": "safety/network#behind-a-company-proxy",
"net_proxy_down_stopped": "internals/network#the-proxy",
"no_secret": "safety/network#saving-and-binding-secrets",
"codex_login_kept": "internals/network#agents-logins-and-settings",
"opencode_login_kept": "internals/network#agents-logins-and-settings",
"setid_files": "using/troubleshooting#devvm-names-set-id-files",
"setid_root_files": "using/troubleshooting#devvm-names-set-id-files",
"home_not_absolute": "using/troubleshooting#home-isnt-an-absolute-path",
"secret_to_terminal": "internals/network#how-the-proxy-puts-them-in",
"net_unenforced_restart": "using/troubleshooting#a-vm-shows-as-unenforced",
"adopt_failed": "getting-started/commands#a-folder-made-again",
"clone_needs_git": "using/clone#requirements",
"uncommitted_not_copied": "using/clone#whats-copied",
"unfetched_commits": "using/clone#deleting-the-vm",
"branch_names_invalid": "using/clone#deleting-the-vm",
"git_protect_clone": "safety/git-protection#turning-it-on-or-off",
"git_protect_failed": "safety/git-protection#turning-it-on-or-off",
"devcontainer_using": "using/devcontainer",
"devcontainer_flag_wins": "using/devcontainer#when-its-read",
"devcontainer_ignored": "using/devcontainer#properties",
"devcontainer_unknown": "using/devcontainer#properties",
"devcontainer_initialize": "using/devcontainer#properties",
"devcontainer_feature_options": "using/devcontainer#properties",
"devcontainer_ports_ignored": "using/devcontainer#properties",
"git_protect_needs_macos_new": "safety/git-protection#linux-hosts",
"git_protect_on_needs_macos": "safety/git-protection#linux-hosts",
"git_protect_running": "safety/git-protection#turning-it-on-or-off",
"git_unlocked": "safety/git-protection#turning-it-on-or-off",
"git_protect_flag_ignored": "safety/git-protection#turning-it-on-or-off",
"git_locked_strict": "safety/git-protection#strict",
"git_config_failed": "safety/git-protection#strict",
"git_commondir": "safety/git-protection#not-covered",
"git_worktree_stray": "safety/git-protection#not-covered",
"git_not_locked": "internals/git-protection#whats-locked",
"git_lock_raced": "internals/git-protection#whats-locked",
"git_hooks_path": "safety/git-protection#not-covered",
"git_include_inside": "safety/git-protection#not-covered",
"git_hook_link_inside": "safety/git-protection#not-covered",
"git_gitdir_outside": "safety/git-protection#not-covered",
"ssh_remote_hint": "using/ssh#agent-forwarding",
"agent_on_risk": "using/ssh#agent-forwarding",
"agent_devvm_risk": "using/ssh#devvms-own-agent",
"agent_no_keys": "using/ssh#devvms-own-agent",
"agent_key_changed": "using/ssh#devvms-own-agent",
"agent_key_unpinned": "using/ssh#devvms-own-agent",
"agent_key_no_fingerprint": "using/ssh#devvms-own-agent",
"agent_key_mounted": "using/ssh#devvms-own-agent",
"agent_lifetime_invalid": "using/ssh#devvms-own-agent",
"agent_confirm_needs_askpass": "using/ssh#devvms-own-agent",
"ssh_include_yourself": "using/ssh#ssh-access-by-name",
"no_code_command": "using/ssh#devvm-ssh-and-devvm-code",
"desktop_no_feature": "using/desktop#adding-the-desktop",
"desktop_start_failed": "using/desktop#when-the-desktop-doesnt-open",
"desktop_open_failed": "using/desktop#when-the-desktop-doesnt-open",
"clone_not_top": "using/clone#requirements",
"clone_no_commits": "using/clone#requirements",
"clone_detached": "using/clone#requirements",
"clone_needs_new_vm": "using/clone#requirements",
"remotes_taken": "using/clone#the-remote",
"fetch_until": "using/clone#the-remote",
"no_terminal_fetch": "using/clone#deleting-the-vm",
"saved_names_taken": "using/clone#deleting-the-vm",
"remote_kept": "using/clone#deleting-the-vm",
"no_terminal_delete": "using/clone#deleting-the-vm",
"tools_need_resolve": "using/images#shared-tools",
"mise_checksum": "internals/images#versions",
"tool_stepped_back": "internals/images#versions",
"tool_no_download": "internals/images#versions",
"tools_check_failed": "using/images#shared-tools",
"newer_tools": "using/images#adding-and-removing-tools",
"tool_unbuilt": "internals/images#building-tools",
"tool_bad_output": "internals/images#building-tools",
"share_lock_held": "internals/images#building-tools",
"tools_not_images": "using/images#rebuilding",
"custom_layer_remove": "using/images#adding-and-removing-tools",
"agent_dir_comma": "backends/lima#limits",
"agent_dirs_added": "using/coding-agents#mounts",
"agent_dirs_removed": "using/coding-agents#mounts",
"no_claude_token": "using/coding-agents#claude-code-login",
"claude_token_invalid": "using/coding-agents#claude-code-login",
"no_github_token": "safety/network#saving-and-binding-secrets",
"not_setup_token": "using/coding-agents#claude-code-login",
"secret_unuse_copied": "safety/network#saving-and-binding-secrets",
"keychain_save_failed": "safety/network#saving-and-binding-secrets",
"login_copy_failed": "internals/network#agents-logins-and-settings",
"config_redacted": "using/coding-agents#copies",
"config_not_copied": "internals/network#keys-in-settings-files",
"claude_mcp_secrets_copied": "internals/network#mcp-servers",
"bad_from": "using/from#tags-and-digests",
"from_unreachable": "using/from#tags-and-digests",
"from_cached_unreachable": "using/from#tags-and-digests",
"from_not_found": "using/from#images-only-docker-has",
"from_cached_not_found": "using/from#images-only-docker-has",
"docker_only": "using/from#images-only-docker-has",
"docker_image_changed": "using/from#images-only-docker-has",
"convert_failed": "using/from#supported-images",
"convert_bad_output": "internals/images#the-image-is-untrusted",
"from_ignored": "using/from",
"devcontainer_invalid": "using/devcontainer#when-its-read",
"devcontainer_unreadable": "using/devcontainer#when-its-read",
"devcontainer_changed": "using/devcontainer#when-its-read",
"devcontainer_new": "using/devcontainer#when-its-read",
"devcontainer_bad_value": "using/devcontainer#properties",
"devcontainer_build": "using/devcontainer#properties",
"devcontainer_feature": "using/devcontainer#properties",
"devcontainer_docker_outside": "using/devcontainer#properties",
"devcontainer_env_name": "using/devcontainer#properties",
"devcontainer_image_not_public": "using/devcontainer#properties",
"devcontainer_local_env": "using/devcontainer#variables",
"devcontainer_variable": "using/devcontainer#variables",
"devcontainer_command_failed": "using/devcontainer#commands",
"no_devcontainer_flag_ignored": "using/devcontainer#when-its-read",
"no_ssh_agent": "using/ssh#agent-forwarding",
"ssh_agent_empty": "using/ssh#agent-forwarding",
"load_key_with": "using/ssh#agent-forwarding",
"no_vm_ssh_agent": "using/ssh#agent-forwarding",
"agent_key_not_found": "using/ssh#devvms-own-agent",
"agent_load_failed": "using/ssh#devvms-own-agent",
"agent_start_failed": "using/ssh#devvms-own-agent",
"mounts_next_start": "using/coding-agents#mounts",
"no_feature": "using/customizing#choosing-features",
"no_image_named": "using/images#listing-images",
"no_image_named_from": "using/images#listing-images",
"not_an_image": "using/images#deleting-images",
"no_vm": "getting-started/first-vm#making-the-vm",
"no_vm_size": "using/ports-size#size",
"no_vm_ports": "using/ports-size#ports",
"no_vm_git_protect": "safety/git-protection#turning-it-on-or-off",
"no_vm_policy": "safety/network#changing-rules",
"no_token": "safety/network#saving-and-binding-secrets",
"bad_secret_service": "using/settings#environment",
"start_failed": "using/troubleshooting#a-command-fails",
"stop_failed": "using/troubleshooting#a-command-fails",
"delete_failed": "using/troubleshooting#a-command-fails",
"vm_create_failed": "using/troubleshooting#a-command-fails",
"sync_failed": "using/troubleshooting#a-command-fails",
"tools_unmounted": "using/troubleshooting#a-shared-tool-doesnt-mount",
"pack_failed": "using/troubleshooting#a-build-fails",
"devcontainer_ports_not_forwarded": "using/devcontainer#properties",
"size_pending": "using/ports-size#size",
"size_flags_ignored": "using/ports-size#size",
"ports_flag_ignored": "using/ports-size#ports",
"port_not_listed": "using/ports-size#ports",
"agent_next_start": "using/ssh#agent-forwarding",
"ssh_agent_flag_ignored": "using/ssh#agent-forwarding",
"clone_seed_failed": "using/clone#whats-copied",
"remote_add_failed": "using/clone#the-remote",
"clone_check_failed": "using/clone#deleting-the-vm",
"fetch_failed": "using/clone#deleting-the-vm",
"mise_download_failed": "using/images#shared-tools",
"tools_resolve_failed": "using/images#shared-tools",
"tool_bad_version": "using/images#adding-and-removing-tools",
"vm_lacks": "using/images#adding-and-removing-tools",
"rule_missing": "safety/network#changing-rules",
}