Repository navigation
VALIDATION
Status: Implemented
Last Updated: 2026-11-13
Audience: Developers and coding agents
Last verified: 2026-11-13 against b1688a8de
Code: scripts/Test-Martlet.ps1, scripts/Invoke-MartletMcp.ps1, scripts/Smoke-Doctor.ps1
Code and behavior changes need local checks before they merge: their targeted tests (the tests it adds or changes and the suite directly covering the changed code, nothing broader), plus the actual behavior through Martlet's MCP server. No remote CI runs, ever (see the validation policy). This page is the flow for people and coding agents alike; AGENTS.md adds the agent-specific rules.
-
Branch from freshly fetched
origin/main(git fetch origin). -
Pick the targeted tests: the tests you added or changed, and the test project
or suite that directly covers the code you changed (usually
tests\<Project>.Tests, orpython:<worker>for a worker)..\scripts\Test-Martlet.ps1 -Listshows what the change touches without building anything: take the entries whose reason ischanged: ...and ignore the ones that onlydepend onthem. -
Run only those:
.\scripts\Test-Martlet.ps1 -Project <Project>.Tests -Filter 'FullyQualifiedName~<YourTests>'. They must pass. It builds the test project and what it references, runs it here or on your validation hosts, and writesartifacts\validation\summary.md. - Exercise the behavior through Martlet MCP for any feature or behavior change (below): drive the actual feature on a disposable data directory and check the outcome. Extend the MCP server in the same change so the feature can be reached and observed.
-
Run what the tests do not cover the way it is used: scripts, packaging,
installers, worker hosts, release workflow changes.
-Listnames changed files that no suite covers. -
Report it in the pull request: paste
summary.md, the MCP calls and what they showed, and every NOT RUN item with its reason (missing hardware, credentials, another OS, a locked desktop). Never present unrun or partial checks as passed. - Merge once steps 3 to 6 are done and green. Agents merge their own pull requests at that point without waiting for approval; see Publication and merge.
Documentation-only changes (Markdown) need none of this; the runner selects nothing for them.
Validation deliberately runs a small slice, never everything. Many suites have failures unrelated to any one change, and broad parallel runs add concurrency failures that say nothing about it, so wide runs cost a lot of time and produce noise rather than evidence about the change.
- Run the tests you wrote or changed, narrowed with
-Filter(adotnet testfilter such asFullyQualifiedName~ReplyLatencyTests). Widen to the whole directly related test project only when the change alters behavior that the project's other tests rely on. Several targeted projects or suites go in one run:-Project Martlet.Conversation.Tests, python:singing. - Name test projects exactly, with
.Tests.-Project Martlet.Conversationnames the product project and selects every suite that depends on it. - Without
-Projector-All, the runner selects suites affected by the working-tree diff. A Markdown-only change selects no tests. - Do not use
-Allunless the owner asks for a broad run. It selects every dependent suite; a change toMartlet.CoreorDirectory.Build.propsselects almost everything. - When a change alters an API other projects use, build those projects
(
dotnet build <project>.csproj -c Release) to catch compile breaks instead of running their tests. - Fix any failure your change causes. A failure it cannot cause (the test also fails
on
origin/main, or fails only under parallel load and passes when run alone with a narrower-Filter) does not block the merge: narrow the filter to your tests, note the failure in the pull request and do not chase it in this change. - Add tests for new behavior in the matching
tests\project, so the next change there has something targeted to run.
| Suites | Engine | Parallelism |
|---|---|---|
24 .NET test projects under tests\
|
xUnit 2.9 on VSTest (Microsoft.NET.Test.Sdk), dotnet test
|
One generated solution: MSBuild builds each project once and runs the test assemblies side by side; xUnit runs test classes in parallel inside an assembly unless it opts out (Desktop, Gateway, Gateway.Host, Gateway.Persistence and the Linux suites run serially inside) |
Linux-only .NET suites (MartletTestHosts = linux) |
the same, on a Linux validation host | Concurrently with everything else |
Python worker suites (workers\<name>\tests) |
unittest |
One job per worker, concurrently |
Avatar npm packages and node tests (src\Martlet.Avatar.Vrm, src\Martlet.Avatar.Live2D, *.test.mjs) |
node --test |
One job per package, concurrently |
The default selection can be broad when code or shared build files change.
-All always selects every suite. Routine validation names only the targeted
tests instead. Run time depends on the selected suites and the computer; this
page does not promise a fixed duration.
-Project runs exactly the named test projects or suites. Naming a product project
instead (no .Tests) also selects every project that depends on it, the same
expansion as the default mode.
Without -Project or -All (not used for routine validation; see
Targeted tests only), the runner compares the working tree
(commits, staged, unstaged and untracked files) with its merge-base on origin/main
(-Base changes that) and maps each changed file. -List prints this mapping and
why, which is how to find the test projects a change touches directly:
- A file inside a project directory selects that project. A file another project
links or reads (
Compile Include="..\...", embedded resources,MSBuild Projects=) selects that project too.MartletValidationInputsin a.csprojdeclares inputs MSBuild cannot see, such as the npm packagesMartlet.Avatar.RendererHostbundles. - Every project that references a selected project, directly or transitively, is selected as well. Selected test projects run; the rest are built so a compile break anywhere downstream is caught.
-
Directory.Build.props,Directory.Build.targets,Directory.Packages.props,global.json,NuGet.configand.editorconfigselect every .NET project. -
workers\<name>\...selects that worker's Python suite; an npm package with atestscript is selected by its own files;*.test.mjsfiles run with their project. - Markdown and
tests\known-failures.txtselect nothing. Anything else nothing covers (scripts, packaging, deploy files, workflows) is listed as not covered by automated tests: validate it by running it.
Options: -Base <ref> sets the diff base (default origin/main);
-Project <name> runs the named projects or suites instead of the diff (a
product project name also selects its dependents); -Filter passes a
dotnet test filter; -All selects every suite; -NoHosts disables configured
validation hosts, so Linux-only suites run locally only on Linux and are otherwise
NOT RUN; -RequireAll fails the run when anything is NOT RUN; -InitProfile
creates the local developer profile; -Configuration sets the build
configuration (default Release);
-MaxParallel sets a positive MSBuild parallelism limit (default 0 leaves it
to MSBuild); -Retries (default 2) sets how often a new failure is retried;
-TimeoutMinutes (default 30) sets the job timeout.
Get-Help .\scripts\Test-Martlet.ps1 -Full lists them all.
| Result | Meaning | Blocks the merge |
|---|---|---|
| Passed | Everything selected passed | No |
| Failed | A test failed that is not a known failure, or a project did not build | Yes, unless your change cannot cause it (Targeted tests only) |
| Flaky | A test failed, then passed when retried (up to twice) with the machine quieter | No; fix it only when it is one of your targeted tests |
| Known failures | Only tests listed in tests\known-failures.txt failed |
No |
| NOT RUN | This environment cannot run it (no Linux host, missing Python module, another OS) | Report it; -RequireAll makes it fail |
tests\known-failures.txt lists tests that already fail on main. Fixing one means
deleting its line (the runner reports known failures that pass again). A line may be
added only for a test you have shown failing on origin/main without your change
(run it on a clean export of origin/main), with a note in the pull request and in
the burn-down issue (#332); never
for a failure your change causes. Entries tagged env: fail only on some machines
(for example, symlink tests without Windows Developer Mode) and are not reported as
fixed.
If main moves while your pull request is open, merge it and rerun your targeted
tests before merging when the merge touched the code they cover: someone else's
change can break a test your change relies on.
Full logs and TRX files are in artifacts\validation\. Processes a suite leaves
running (a worker host a failed test never stopped, for example) are stopped and
noted, so they cannot hold the run open or linger on the machine; build servers
shared with other builds are left alone.
Some suites need another machine: the Linux gateway tests need Linux with ext4 and a
non-root user, and features may need a GPU box or a second PC. The runner uses the
hosts you have set up, from a developer profile that is local to you and shared
by all your Martlet checkouts and worktrees: ~\.martlet-dev\validation.json
($env:MARTLET_DEV_HOME moves it). It is never committed. Create it with:
.\scripts\Test-Martlet.ps1 -InitProfile{
"schemaVersion": 1,
"dotnet": null,
"python": null,
"hosts": [
{ "name": "docker", "kind": "docker", "enabled": true, "image": null, "allowPull": false },
{
"name": "linux-box", "kind": "ssh", "enabled": true, "target": "me@linux-box.lan", "port": 22,
"workDirectory": "~/.cache/martlet-validation", "dotnet": "~/.dotnet/dotnet",
"linuxTestParent": "/home/me/martlet-validation-ext4", "sshOptions": ["-i", "~/.ssh/martlet_validation"],
"capabilities": ["linux-x64", "ext4", "nvidia-gpu"],
"notes": "Key-based SSH. SDK 10.0.401 installed by hand."
}
]
}-
dotnetandpythonpoint at the .NET SDK pinned inglobal.jsonand the Python for worker tests when they are not found automatically. The runner already looks onPATH, in%LOCALAPPDATA%\Microsoft\dotnet,~\.dotnetandDOTNET_ROOT, and preferspy -3.12for workers. -
docker: Docker on this PC in Linux container mode. Linux suites run in the
.NET SDK image pinned by
global.json(mcr.microsoft.com/dotnet/sdk:<version>) as the non-rootappuser, on a disposable ext4 volume, with a NuGet cache in themartlet-validation-nugetvolume. It is used without a profile entry when the image is already on the PC; it is never pulled unlessallowPullis set. Add an entry with"enabled": falseto turn it off. -
ssh: a Linux machine reached with key-based SSH (
BatchMode; never a password). It needs the pinned SDK atdotnetand an existing private (0700) ext4 directory owned by the SSH user atlinuxTestParent.sshOptionsadds options to bothsshandscp(a specific key with-i, a known-hosts file with-o UserKnownHostsFile=...). Each run copies the working tree to a fresh directory underworkDirectory, runs there, brings the results back and deletes it. - Hosts are tried in profile order; the first that is ready runs the Linux suites, and the reasons the others were skipped are reported.
-
~\.martlet-dev\NOTES.mdholds free-form facts that help the next validation run: which host has a GPU, where an SDK lives, why a host is disabled.
Rules: only hosts listed in the profile are used (plus Docker on this PC). People and agents may record facts about listed hosts, but adding a host is the developer's decision, because it runs code on that machine. Never use shared or production machines, never store passwords, keys or tokens in the profile, and never install SDKs, services or drivers on a host without its owner's go-ahead.
A test project that must run on Linux sets <MartletTestHosts>linux</MartletTestHosts>
(windows;linux runs it on both). Without it, projects targeting -windows
frameworks run on Windows and the rest run on this PC.
Tests prove the pieces; the MCP check proves the feature works in the actual app.
src\Martlet.Mcp is a local MCP server over stdio, and
scripts\Invoke-MartletMcp.ps1 drives it from this checkout's build with a list of
tool calls, on a disposable data directory that is deleted afterwards:
# Headless: Doctor and status tools
.\scripts\Invoke-MartletMcp.ps1 -Build -Calls '[{"name":"doctor_status"}]'
# UI: launch a disposable desktop, connect, click and poll until a control shows
.\scripts\Invoke-MartletMcp.ps1 -Build -Desktop -Calls '[
{"name":"ui_click","arguments":{"id":"TourSkip"}},
{"name":"ui_click","arguments":{"id":"NavSettings"}},
{"name":"ui_snapshot","until":"AutomaticUpdateCheck"}]'The controls it offers:
-
Doctor (
doctor_status,doctor_list,doctor_run): the diagnostic probes and their report, headless. -
Status and checks for the subsystems:
voices_status,cluster_status,network_status,nearby_status,logs_tail,logs_timeline,logs_export,latency_report,api_keys_status,smart_home_status,prompts_status,character_status,hearing_check,echo_check,pc_audio_check,pc_activity_check,discord_call_check,chattiness_status,context_check,thinking_steps_checkand more. They read the same disposable data directory the desktop uses. -
Desktop UI automation (
ui_connect,ui_snapshot,ui_click,ui_select,ui_set_text,ui_toggle,ui_set_range,ui_move,ui_scroll,ui_tray): find controls by automation ID, read status text, and click passive navigation. Anything that sends, records, plays, spends, writes files or handles credentials needs-AllowUiEffects(--allow-ui-effects), which is allowed only with a disposable data directory and no real credentials, and still never authorizes spending, real provider requests, audio capture or playback, or disclosing data.
Check the outcome the change should produce (status values, control state, the Doctor report), not just that the calls returned. UI automation needs an unlocked interactive desktop; on a locked or headless session, verify headlessly and report the UI part as NOT RUN.
Extend MCP with every feature: stable AutomationProperties.AutomationId on new
controls, passive navigation in SafeClicks, non-secret status fields in
SafeValues, new tools or Doctor probes for new headless capabilities, and
the MCP page of its area updated to match. A feature MCP cannot reach or observe is not
finished. MCP and its pages document every tool and
Extending the server the conventions.
- Put tests in the project's test project under
tests\(createtests\<Project>.Testswith xUnit for a new library) so the runner finds them. - Use temporary directories and fakes; never real credentials, paid services, the network, microphones or speakers, or the real Martlet profile.
- Avoid tight timing: suites run side by side and a test that only passes on an idle machine will show up as flaky. Wait for events with generous upper bounds rather than fixed sleeps.
- A worker suite that imports modules beyond the standard library lists them in
workers\<name>\tests\requirements.txt; the runner picks a Python that has them. - Mark Linux-only suites with
MartletTestHosts, and declare build inputs MSBuild cannot see withMartletValidationInputs.
Martlet: download · repository · changelog · issues
These pages come from docs/wiki in the repository. To suggest a change, open an issue or a pull request there.
- Home
- Accounts and households
- Accounts and Household
- Android phones and tablets: what it takes, and the plan
- Martlet's API for other apps and scripts
- App Guides
- App Settings and Updates
- App guides: game and app knowledge from the web
- Architecture
- Bounded PCM playback
- Audio dependency inventory and notices
- Avatar guide: Live2D, VRM and speech animation
- V01a explicit microphone capture
- Chatterbox voice engines
- Cleaning up disk space
- One Martlet on all your computers
- Companion controls and behavior requirements
- Components, jobs and placement (design)
- Live conversation
- Creations
- Decision map: which file owns each decision
- Deep research: web search and long research jobs
- The desktop app: updates, notification area, exiting and appearance
- Linux and macOS desktop companion: research, decision and plan
- Developer Guide
- Dia voice engine
- Diagnostics
- Discord
- Architecture and provider contracts
- Discord
- Memory (P03a/P03b/P03c)
- Singing
- Desktop troubleshooting and local support
- Recognizing people by voice, and Parakeet
- Echo cancellation
- ElevenLabs voice: your cloned voice with tones
- F5 worker and reference-voice foundation
- FAQ
- First Steps
- Game state plan: implementation history
- Glossary: one name for each concept
- GPT-SoVITS voice
- Hosted Thinking: cloud models when Thinking can't run on this PC
- Installation and support
- Installing Martlet
- iOS and iPadOS: what it takes, and the plan
- Repository instructions for coding agents
- Repository knowledge base
- Knowledge base maintenance
- GitHub Wiki mirror
- Linux and Mac
- Listening and Voice ID
- Local model apps
- Lorebooks
- macOS: what it takes, and the plan
- Martlet MCP Server
- MCP in Martlet
- MCP: The app's window
- MCP: Apps, home and memory
- MCP: Characters
- MCP: Diagnostics and logs
- MCP: Computers, network and accounts
- MCP: Other
- MCP: Tool permissions
- MCP pages
- MCP: Server and protocol internals
- MCP: Settings
- MCP: Start here
- MCP: Thinking and models
- MCP: Voice and listening
- Memory
- Messaging apps
- Model catalog: sources, conflicts and design
- Motion host role
- Multiple Computers
- Your Martlet network
- OCR host role
- Share your language models: the OpenAI-compatible endpoint
- Packaging
- Perception worker contracts
- Personality and Characters
- Picture making
- Pictures and Creations
- Picture making host role
- Platforms: what each device can do
- Prerequisites: what Martlet bundles, installs for you, or needs from you
- Privacy and Safety
- Reading the text on your screen
- Wiki source
- Recommendation design: ask three questions, plan for three situations
- Recommended setups: one machine to unlimited budget
- Releasing
- Repository Layout
- Research and provenance ledger
- Resource footprints
- Roadmap
- Watch my screen: screen-aware commentary
- Search engine
- Image and audio models: who sees, who hears, who answers
- Setting Up a Host
- Setup, Windows credentials and local audio
- Sharing with Friends
- Singing
- Smart Home
- Smart home and cameras
- Source Projects
- Talking to Martlet
- Telegram and WhatsApp
- The Character
- Thinking
- Tools and MCP
- Troubleshooting
- Martlet desktop UI design
- User stories and target flows
- Voice activity detection
- Validating changes
- Validation and Testing
- Vision
- Voice latency: from you stopping talking to Martlet's voice
- Voice recognition host role
- Multi-engine voice setup and comparison
- Voices
- The welcome wizard
- XTTS-v2 voice engine