dev-testing-vm
Skill79 starsChanged 2 months agoApache-2.0View on GitHub
In-VM diagnostics and test fixtures. Use when adding in-VM tests, debugging failures inside the guest, or updating the test fixture.
- Installs packages
In this repository37 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- asset-pipelineSkill
- build-imagesSkill
- build-initrdSkill
- citadelSkill
- dev-benchmarkSkill
- dev-bug-reviewSkill
- dev-cacheSkill
- dev-capsem-doctorSkill
- dev-capsemSkill
- dev-ciSkill
- dev-debuggingSkill
- dev-gateSkill
- dev-installationSkill
- dev-justSkill
- dev-mcpSkill
- dev-mitm-proxySkill
- dev-rust-patternsSkill
- dev-session-debugSkill
- dev-setupSkill
- dev-skillsSkill
- dev-sprintSkill
- dev-startSkill
- dev-testing-frontendSkill
- dev-testing-hypervisorSkill
- dev-testing-pythonSkill
- dev-testingSkill
- frontend-designSkill
- ironbankSkill
- meta-find-skillsSkill
- meta-organize-skillsSkill
- meta-skill-creationSkill
- release-processSkill
- site-architectureSkill
- site-infraSkill
- site-marketingSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 36
Add test functions to the appropriate guest/artifacts/diagnostics/test_*.py or create test_<category>.py
- Very specific: line 37
Use from conftest import run for shell commands, output_dir fixture for temp files
- Distinctive: line 45
After running a VM session, inspect the telemetry database:
- Very specific: line 65
If events are missing: check boot logs for daemon startup, vsock connection acceptance, and whether the VM lived long enough for the …
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
In-VM Testing
capsem-doctor
The diagnostic suite runs inside the guest VM via pytest. Tests live in guest/artifacts/diagnostics/ and are baked into the rootfs.
Running diagnostics
just exec "capsem-doctor" # Full suite (~10s total)
just exec "capsem-doctor -k sandbox" # Only sandbox tests
just exec "capsem-doctor -k network" # Only network tests
just exec "capsem-doctor -x" # Stop on first failureTest categories
| File | What it verifies |
test_sandbox.py | Read-only rootfs, binary permissions, setuid/setgid, kernel hardening (no modules, no debugfs, no IPv6, no swap), process integrity, network isolation (dummy0, fake DNS, iptables) |
test_network.py | MITM CA in system store + certifi, curl without -k, Python urllib HTTPS, CA env vars, HTTP/80 blocked, non-443 blocked, direct IP blocked, multi-domain DNS, AI provider domains |
test_environment.py | TERM/HOME/PATH env vars, bash shell, kernel version, aarch64 arch, mount points, tmpfs |
test_runtimes.py | Python3, Node.js, npm, pip3, git version checks, Python/Node file I/O, git workflow |
test_utilities.py | ~36 unix utilities (coreutils, text processing, network, system tools) |
test_workflows.py | Text write/read, JSON roundtrip, shell pipes, large file (10MB) |
test_ai_cli.py | claude/gemini/codex installed and executable |
test_virtiofs.py | VirtioFS mount, ext4 loopback, workspace I/O, pip install, file delete+recreate |
Adding new in-VM tests
- Add test functions to the appropriate
guest/artifacts/diagnostics/test_*.pyor createtest_<category>.py - Use
from conftest import runfor shell commands,output_dirfixture for temp files - Tests auto-skip outside the capsem VM (conftest checks for root + writable /root)
- Rebuild rootfs with
just _build-assetsto bake new test files into the image - For fast iteration during development, tests in
diagnostics/are also repacked into the initrd byjust exec, sojust exec "capsem-doctor"picks up changes without a full rootfs rebuild - Verify:
just exec "capsem-doctor -k <your_test>"
Session inspection
After running a VM session, inspect the telemetry database:
python3 build_system/scripts/doctor/check_session.py # Latest session
python3 build_system/scripts/doctor/check_session.py <session-id> # Specific session
python3 build_system/scripts/doctor/check_session.py --list # List recent sessions
python3 build_system/scripts/doctor/check_session.py -n 10 # Show 10 preview rows per tableChecks: session ledgers exist (net_events, model_calls, tool_calls, tool_responses, fs_events, dns_events, security_rule_events), row counts, orphaned tool_calls, AI-provider consistency.
Verifying telemetry pipelines
Each pipeline can be tested with a targeted VM command:
- fs_events:
just exec 'touch /root/test.txt && sleep 1'thenpython3 build_system/scripts/doctor/check_session.py - net_events:
just exec 'curl -s https://api.anthropic.com/ && sleep 1' - model_calls/tool_calls: boot interactively, run
claude -p "what is 2+2" - MCP-origin tool_calls: boot interactively, run
claude -p "use fetch to get https://example.com"and querytool_calls WHERE origin = 'mcp'
If events are missing: check boot logs for daemon startup, vsock connection acceptance, and whether the VM lived long enough for the debouncer to flush (add sleep 1).
Test fixture
The fixture (tests/fixtures/session/test.db) is a real session DB shared by frontend mock mode and Rust roundtrip tests. No synthetic data.
Updating the fixture
# 1. Run integration test to generate a rich session
python3 build_system/scripts/test/integration_test.py --binary cache/target/cargo/debug/capsem --assets assets
# 2. Inspect completeness
python3 build_system/scripts/doctor/check_session.py <session-id>
# 3. Fixture refresh has no Just convenience command. Copy, checkpoint, and
# scrub the selected DB using the procedure in /dev-session-debug.
# 4. Verify
cargo test --workspaceThe fixture must contain: both allowed and denied net_events, created/modified/deleted fs_events, model_calls with cost > 0, tool_calls with origin populated.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

