google/capsem/dev-testing
Claude Code and agent skill by google/capsem
- vendor
Checking that the SKILL.md file is still in the repository.
Capsem testing policy and workflow. Use whenever running or writing tests. For VM, hypervisor, frontend, or Python specifics see the dev-testing-* skills.
Install
npx vskill@latest install google/capsem/dev-testingSKILL.md
The same SKILL.md was published earlier as google/capsem/dev-testing.
Testing
Read tests/README.md before adding or moving test fixtures. Test-only config belongs under tests/fixtures/, not root config/.
Where a new guard belongs
A test that records an architectural mistake -- something that must not be repeated, checkable from source -- is a Citadel guard, in tests/citadel/, not another file at tests/ root. It runs in the fast phase, so it costs seconds rather than waiting on an asset build.
Two rules the existing guards follow:
State the reason in a named *_RATIONALE appended to the assertion, so a violation teaches. test_db_boundary.py is the model. Where the reason is already stated canonically -- config/gate.toml [boundary], AGENTS.md, a skill -- cite it instead of restating it.
Write the adversarial case, not just the conformance case. A guard proved only by inputs it was built for is not proved. test_workflow_enforcement.py carries fourteen evasions and four legitimate shapes because enumerating bad spellings let five through; the rule is now a whitelist for that reason.
Test execution
Write code first with TDD and minimal focused feedback. During routine edits run the regression being changed and only necessary file/behavior checks. Broad workspace, contract, Citadel, VM, installed-package and performance runs belong at major phase boundaries, not after every edit or commit. Pending full proof must not block independent implementation. Qualify the complete phase before calling it qualified, and retain the exact-source merge/release gates. The bounded wrapper provides timeout and cleanup without a default machine lease; reserve --machine-lease for explicitly isolated qualification work.
Finish a focused build/test command before editing its inputs. Cargo may have already compiled a test when a later edit lands, so its green result can cover older bytes. If inputs changed during compilation or execution, that result does not verify the final source; rerun the focused regression after the edit.
SDK acceptance launchers use uv run --frozen --no-sync against the environment prepared by the gate. Snapshot refresh changes source mtimes; an implicit sync can rebuild the editable SDK and fetch its backend inside the sealed namespace. Dependency preparation belongs to the earlier environment owner.
Linux managed-supervisor acceptance hands the private manager's runtime and PID explicitly through the privilege transition. The worker checks its socket peer, native owner and network namespace before restoring the manager environment. Never adopt an ambient user manager outside the sealed worker's namespace: its service can be healthy while localhost is unreachable from the test. Pass that authenticated manager's runtime and bus address explicitly into the service unit too. A user manager's default unit environment can point at a different session; worker-only binding leaves a healthy service unable to verify its own restart policy.
Focused Ruff commands must select --config build_system/pyproject.toml, as the gate does. Auto-discovery from a root-level test used a different Python version and reversed tomllib import grouping, passing locally then failing the canonical source phase.
| Command | What | VM? | |
|---|---|---|---|
just fast-test | Incomplete source feedback only | No | |
just focus-test <group> | One existing owner; rust selects changed crates and reverse dependents | Depends on group | |
just install | Complete local macOS package build and native install for hands-on testing | Yes | |
just test | Complete local verification; required, passing, before a release | Yes |
A release normally needs passing just test; explicitly approved release force may follow focused test-only fixes. Source guards, audits and hosted proof remain. just fast-test and just focus-test <group> are broader feedback tools for a phase boundary or a failure that needs their scope. During TDD use the smallest native test directly; use complete verification at major phase boundaries.
Pick the narrowest lens, in this order: one test file run directly with pytest in the latest cache/worktrees/<run> (it reuses that run's built assets; rebuild and re-sign only what changed), then focus-test <owner> (kingslanding for containers, assets to rebuild the guest), then functional --slow once on the final head. Ask the user before adding a new owner.
The full gate is a construction boundary, not the edit loop. During TDD, reproduce the failure with the smallest focused test, run that test red/green, and batch adjacent parity fixes before paying for the complete gate. Run it only when explicitly requested. Later fixes use focused owners; a gate-policy edit is not permission for another full run. The one full run a change always needs by default is the passing just test a release of it requires. Use the documented operator-approved release override only when explicitly authorized.
just test deliberately accepts committed or uncommitted developer work. It records HEAD plus a digest of every tracked and untracked non-ignored source byte, then fails if either changes while the gate runs. Generated output stays under ignored build directories. The local proof therefore covers the exact source state the developer asked to test without forcing commit choreography. Automatic gate benchmark output belongs under ignored cache/target/tests/benchmarks/. Historical benchmark publication uses the owning pytest/benchmark command and an explicit review; it is not a Just convenience recipe.
Release CI invariant
Release CI reuses the same checked-in private modules as local just test:
_test-fast_test-static_test-artifacts_test-functional_test-glowup_test-release-contracts
The build scope is selective; the quality scope is not. Binary CI builds only packages and resolves the channel's runtime by recorded digest. Runtime CI builds the runtime for one channel and resolves the current package by recorded digest. The resolved complementary artifacts are staged into the production test harness, not replaced by source-built substitutes.
Every activated pairing must pass artifact validation, all VM suites, Winterfell/MCP lifecycle, IronBank, injection, integration, benchmarks, full capsem-doctor, exact native install, and update glow-up. A staged runtime whose minimum package is not yet satisfied may run only the self-consistency, integrity, isolation, and boot proof; the following binary lane must run the complete functional and glow-up modules before activation.
Both macOS and Linux must install their exact publishable native packages, including their real post-install scripts, before publication. Notarization and the public stable-to-nightly switch/upgrade glow-up remain mandatory end-to-end proof.
On Apple Silicon macOS, just test owns the pre-publication macOS package boundary through build_system/packaging/macos/macos_release_glowup.py: it builds the package with the production assembler, installs that exact file in a disposable headless Tart guest, verifies the receipt, app bundle, complete binary cohort, service and gateway health, then extracts the same package on the physical Mac and boots a real Capsem guest VM from its exact binary/runtime payload to a shell marker. The local package is unsigned; its postinstall ad-hoc signs the installed Mach-O payload with the required entitlements. Local qualification must not load Developer ID material or create a signing keychain. The tagged publication workflow alone signs, notarizes, staples, and installs the final publishable package. Tart macOS guests do not support nested virtualization, so these are two explicit halves of one script rather than a claimed nested proof. just fast-test deliberately excludes Tart and therefore cannot be used for release.
Rust is pinned to 1.97.1 across the workspace file, workflow steps, host-builder, and bootstrap. Change all pin surfaces together in a deliberate toolchain-bump PR. RustSec and JavaScript bulk advisories are blocking in just fast-test, local just test, ordinary CI, and both release lanes, as well as the scheduled/manual audit. A new advisory fails the candidate until it is remediated or explicitly reviewed in checked-in scanner policy.
Linux proof is host-aware: a cross-built non-host package receives structural validation in qualification and exact native installation in its tagged release job. CAPSEM_REQUIRE_LINUX_DEB_PROOF=1 must not reject that non-host package before the host package reaches its mandatory KVM proof. The hosted arm64 runner does not expose /dev/kvm, so it proves exact package/service operation while the x86_64 runner additionally owns the guest-shell marker.
Expensive harnesses need a cheap clean-environment bootstrap proof at the start of just test, before Docker/Colima or artifact preparation. The one private _test-fast module is also called by just fast-test, ordinary CI, and both release lanes. It owns YAML/workflow and source syntax, source contracts, dependency audits, Clippy, Python lint/type checks, and JavaScript/frontend checks; no caller may reproduce a subset inline. Only a green fast gate may build the Linux install-test image. That preflight must use a container-owned UV_PROJECT_ENVIRONMENT and prove python -m pytest launches before VM, package, or asset work consumes hours. Keep an ordering contract. It is fail-fast infrastructure validation only: the later Docker/systemd install E2E remains mandatory and must still exercise the installed package and post-install behavior. Use the configured localhost hostname for sealed install probes: Docker's random hostname is absent from /etc/hosts with network=none, so sudo warns.
Copied macOS system executables need sign_binary(path, relocated=True) from tests/helpers/sign.py. Their original Apple signature may verify strictly yet still carry launch constraints that cause SIGKILL after relocation. This mode replaces only ordinary fixture signatures; selected runtime, release, and frozen-cohort artifacts must remain immutable consumers.
Seatbelt can silently strip set-id bits even when chmod succeeds. Verify a fixture's real mode before blaming admission. Test mode decisions with concrete inputs through the shared production predicate, keeping real filesystem tests for both consumers; do not mock Path.stat or relax the sandbox to set a bit.
Local/CI execution parity
Read references/local-ci-parity.md before editing any release workflow, gate recipe, or CI job. It holds the Ironbank parity rule (every portable release gate must be owned by just test), scanner/tool pinning, Docker platform and prune discipline, common cache contracts, and the source-guard contracts.
TDD workflow
Focused Ruff checks must include --config build_system/pyproject.toml, as the canonical source gate does. Implicit configuration can classify imports differently and produce changes that fail the actual repository policy.
Write tests first:
- Write failing tests that capture expected behavior
- Verify they fail for the right reason
- Write minimal implementation to pass them
- Refactor
Without a failing test first, tests can pass by accident. Cargo fixtures, including tiny probes, use tests/helpers/bounded.py: its env argument applies explicit probe compiler and target overrides after containment; never serialize inherited secrets. The wrapper owns the finite child timeout and cleanup; routine probes do not acquire a machine lease. Do not add an outer subprocess timeout.
Functional slice proof matrix
Use the matrix below for qualification at each major phase boundary. During implementation run only the focused checks needed for the changed behavior and record outstanding phase proof. A green unit suite or a benchmark is not a substitute for complete phase qualification.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files. Certified 18 Jul 2026.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/dev-testing/SKILL.md
Popularity
- Repository stars
- 68
- Repository forks
- 9
- 7-day trend score
- 21
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 27 Jul 2026, 4 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/google/capsem/dev-testing)