Joseph M OBrien joe
  • Joined on 2026-03-15

slash-testing (0.1.0)

Published 2026-05-31 14:31:41 -05:00 by joe

Installation

[registry]
default = "gitea"

[registries.gitea]
index = "sparse+" # Sparse index
# index = "" # Git

[net]
git-fetch-with-cli = true
cargo add slash-testing@0.1.0

About this package

Proptest strategies and harness configuration for testing slash-command language parsers

slash

An AI agent tool orchestration language designed to be embedded in configuration files (e.g., settings.json) and evaluated by a Rust hook orchestration module.

Crates

Crate Description
slash-lang Lexer, parser, and AST
slash-lib SlashCommand trait, CommandRegistry, 6 builtins, executor
slash-core ExecutionPlan compiler, orchestration layer
slash-cmd CLI binary (slash)
slash-testing Proptest strategies and harness

Shared vocabulary types (ExecutionContext, Priority, Urgency, StepStatus) live in the slashcrux crate.

Language Overview

Commands are whitespace-tokenized with no quoting, escaping, or variable expansion. Priority is inferred from the shape of the command token. Urgency is a trailing suffix.

Priority (inferred from casing)

Token shape Priority
ALL_CAPS Max
TitleCase High
camelCase Medium
kebab-case / plain lowercase Low
snake_case Lowest

Urgency (trailing ! suffix)

/build!    # Low urgency
/build!!   # Medium urgency
/build!!!  # High urgency

Builder-chain arguments

/deploy.env(prod).region(us-east-1)

Optional commands and pipe context

/cmd? marks a command optional. When optional commands are piped together, their outputs accumulate into a Context object (key = command name, value = Option<String>) passed as JSON to the first non-optional command.

/fetch? | /validate? | /deploy

Operators

/build && /test          # run /test only if /build succeeds
/build || /fallback      # run /fallback only if /build fails
/generate | /format      # pipe stdout
/build |& /log           # pipe stdout + stderr
/build > out.txt         # redirect output (overwrite)
/build >> out.txt        # redirect output (append)

Builtins

Command Feature Description
/echo always Produce text output
/read always Read file contents
/write always Write piped input to file
/exec always Run shell command
/find always Glob-based file search
/obfsck obfsck (default) Redact secrets/PII

Build without obfsck: cargo build -p slash-lib --no-default-features

Usage

use slash_lang::parser::parse;

let program = parse("/Build.target(release) && /test!!")?;
println!("{program:#?}");

Building

cargo build --all-targets
cargo nextest run
cargo clippy --all-targets -- -D warnings

License

Licensed under either of MIT or Apache-2.0 at your option.

Dependencies

ID Version
proptest ^1
slash-lang ^0.1.0
serde_json ^1.0
slash-lib ^0.1.0

Keywords

testing proptest slash command
Details
Cargo
2026-05-31 14:31:41 -05:00
2
MIT OR Apache-2.0
14 KiB
Assets (1)
Versions (1) View all
0.1.0 2026-05-31