Skip to content

droidsaw/droidsaw-cli-contract

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

droidsaw-cli-contract

Types-only contract crate for the droidsaw top-binary CLI surface that sibling crates (notably droidsaw-bench) build subprocess invocations against.

Why this exists

Bench runs the top binary as a subprocess and parses its stdout. Today the invocation strings ("droidsaw", "decompile", "--all", …) are prose constants scattered across runner files. A rename in the top binary becomes a runtime surprise during a corpus run, not a compile-time error at review.

This crate pins the invocation surface into Rust types. Both the top binary and bench import the same constants and enums. Rename a variant, break both sides at compile time.

Scope

Types only. No runtime logic beyond a pure to_args() serializer that turns a DroidsawInvocation into the Vec<OsString> that Command::args wants. No parsers, decoders, I/O, or logging.

The workspace allows two types-only carve-outs from the bench-sibling-linkage rule:

  • droidsaw-common — generic algorithms shared across parse crates
  • droidsaw-cli-contract — CLI invocation shape shared between top binary and bench

Adding runtime logic to either is a protocol violation.

Contents

  • AuditFormat — enumerates every bulk-output shape bench scores against
  • DroidsawSubcommand — typed representation of the top-binary subcommand surface bench invokes
  • DroidsawInvocation + DroidsawFlags — full CLI call description + the to_args() serializer that feeds Command::args
  • DroidsawInvocationKind — sealed trait consumed by the downstream DroidsawRunner<Kind> wrapper (bench-runner-gauge)
  • TOP_BINARY_NAME + per-subcommand + per-flag const strings — the rename-to-compile-error hooks
  • STDOUT_TERMINATOR_SENTINEL per AuditFormat variant — bench asserts presence to detect mid-stream subprocess panics

License

BSD-3-Clause

About

Types-only CLI invocation contract for droidsaw. Rename a subcommand or flag, break every consumer at compile time. No runtime logic.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages