Deterministic Core and Soak Tests
The deterministic core tests ensure that the daemon’s internal state transitions, particularly those involving session management and authentication, remain predictable. These tests are orchestrated viascripts/test/run-deterministic-core.ps1 and its shell counterpart.
Core Test Execution
The suite executes a specific subset of tests that target high-risk state transitions:- Tauri Initialization: Validates
state_file_initialization_seeds_onboarding_defaultsscripts/test/run-deterministic-core.ps1#17-17. - Auth Surface: Validates OpenAI API key and OAuth flows, ensuring session reuse and payload integrity scripts/test/run-deterministic-core.ps1#18-21.
- Daemon Admin & gRPC: Tests the
admin_surfacefor deterministic support bundle completion and thegateway_grpcfor message routing and attachment preservation scripts/test/run-deterministic-core.ps1#24-28. - Web Console: Runs Vitest suites for
consoleApiand runtime operations scripts/test/run-deterministic-core.ps1#30-35.
Fixture Management
Deterministic tests often rely on JSON fixtures to compare expected vs. actual output. The system enforces fixture synchronization throughscripts/test/check-deterministic-fixtures.ps1, which hashes crates/palyra-connector-core/tests/fixtures/channel_simulator_expected.json before and after a run to detect drift scripts/test/check-deterministic-fixtures.ps1#6-21.
Sources: scripts/test/run-deterministic-core.ps1, scripts/test/check-deterministic-fixtures.ps1, scripts/test/run-deterministic-core.sh.
Workflow Regression Matrix
The workflow regression matrix ensures that complex multi-step operations (like the setup wizard or ACP shim) do not regress. These are typically executed viascripts/test/run-workflow-regression.sh.
Implementation Space Mapping
The following diagram maps the regression script components to the underlying test files they execute. Workflow Regression Mapping Sources:scripts/test/run-workflow-regression.sh:42-48](), scripts/test/run-workflow-regression.ps1:9-15]().
CLI Install Smoke Tests
The CLI smoke harness validates the behavior of thepalyra binary in a post-install state. It uses a specialized harness to simulate a clean environment, overriding environment variables to point to temporary directories.
Smoke Harness Logic
The harness, implemented inscripts/test/run-cli-install-smoke.ps1, creates a ScenarioContext that isolates:
PALYRA_CONFIGscripts/test/run-cli-install-smoke.ps1#92-92PALYRA_STATE_ROOTscripts/test/run-cli-install-smoke.ps1#93-93PALYRA_VAULT_DIRscripts/test/run-cli-install-smoke.ps1#94-94HOME,LOCALAPPDATA, andXDG_STATE_HOMEscripts/test/run-cli-install-smoke.ps1#96-99
crates/palyra-cli/tests/installed_smoke.rs then executes baseline commands like version, doctor --json, and config validate against the binary crates/palyra-cli/tests/installed_smoke.rs#69-92.
Help Snapshot Verification
A key part of the smoke test is ensuring CLI parity. The exampleemit_cli_install_smoke_inventory.rs parses the CliParityMatrix to generate an inventory of all help commands and their expected snapshots crates/palyra-cli/examples/emit_cli_install_smoke_inventory.rs#35-58.
Sources: scripts/test/run-cli-install-smoke.ps1, crates/palyra-cli/tests/installed_smoke.rs, crates/palyra-cli/examples/emit_cli_install_smoke_inventory.rs.
Fuzz Testing Harness
Palyra usescargo-fuzz to find edge cases in critical parsing logic, particularly for inputs coming from untrusted sources or complex protocols.
Fuzz Targets
The fuzzing infrastructure is located in thefuzz/ directory and includes:
workspace_patch_parser: Fuzzes the parser responsible for handling file patches within the agent workspace fuzz/fuzz_targets/workspace_patch_parser.rs.process_runner_input_parser: Targets theProcessRunnerInputstruct inpalyra-common, ensuring that command-line argument serialization and input piping are robust against malformed data fuzz/fuzz_targets/process_runner_input_parser.rs.
Data Flow for Fuzzing
Sources:fuzz/fuzz_targets/process_runner_input_parser.rs:1-10](), crates/palyra-common/src/process_runner_input.rs:1-20]().
CI Integration
The smoke and regression tests are integrated into GitHub Actions to gate releases.| Workflow | Script / Command | Purpose |
|---|---|---|
CLI install smoke | run-cli-install-smoke.ps1 | Validates binary on Ubuntu, macOS, Windows .github/workflows/cli-install-smoke.yml#27-46 |
CLI full regression | run-workflow-regression.sh | Comprehensive matrix of wizard and ACP flows |
CI | run-deterministic-core.sh | Core logic and fixture verification |
.github/workflows/cli-install-smoke.yml, .github/workflows/cli-full-regression.yml.