Add Rust-first Spec API - #334
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
secretspec | 6e6ab4c | Commit Preview URL Branch Preview URL |
Aug 15 2026, 05:21 PM |
e991bb3 to
b0a748e
Compare
b0a748e to
6e6ab4c
Compare
|
Heads-up: this now fails to compile against current #355 added a test that calls the old signature: // secretspec/src/codegen.rs, on main
let ir = build_ir(&config_with(vec![( /* ... */ )]));This PR re-signatures Reproduced locally by merging Exactly one error; nothing else in the crate breaks. The fix is the same migration applied to the other tests — at - let ir = build_ir(&config_with(vec![(
+ let ir = build_ir_from_config(&config_with(vec![(I verified that compiles and that Posting rather than opening a PR since it's a one-liner on your branch, but happy to send it if that's easier. |
What changed
SpecAPI with builders for profiles, secrets, typed generation, and password character sets.CompiledSpecmodel.Secrets::from_specwhile keepingConfigas an internal TOML wire format.Why
Rust callers should be able to describe secrets directly without constructing a TOML-shaped configuration type or serializing and reparsing TOML. Making every frontend lower through
Specgives Rust-first and file-backed projects identical validation, inheritance, generation, and provider behavior.Developer impact
New integrations can build a
Specand pass it directly toSecrets::from_spec. Existing TOML projects continue to use the same syntax, but parsing now crosses the publicSpecabstraction. The old crate-rootConfigexport is removed because it represented the storage format rather than the supported semantic API.Validation
devenv shell cargo check --workspace --all-targetsdevenv shell cargo test -p secretspec spec::(6 passed)devenv shell cargo test -p secretspec cli::completion::tests(12 passed)devenv shell cargo test -p secretspec --lib(1,223 passed, 4 ignored)devenv shell cargo test -p secretspec-derive --test compile_testsdevenv shell npm --prefix docs run build