feat(002): stagecraft crate scaffold, layered config, CI - #1
Merged
Conversation
The single `stagecraft` binary lands: a clap command tree whose stub verbs name their owning spec and exit 2, three working verbs (version, config show, completions), layered configuration (flags > env > file > default) with per-field source provenance, and a shared output layer (human text on TTY, stable JSON with --output json). JSON shapes are treated as API from the first verb, for the MCP face in spec 005. Exit-code contract: 0 ok, 1 operational, 2 usage / not-implemented; errors go to stderr only. CI (ci.yml) runs fmt, clippy -D warnings, test, and a release build on a SHA-pinned checkout; the spec-spine governance gate stays in its own workflow. Amends spec 002 to declare clap_complete (the completions verb's script generator) in the dependency list, and flips it to implementation: complete. No network I/O yet; auth and the API client arrive in 003.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Spec 002: crate scaffold, config, CI
Implements
specs/002-crate-scaffold/spec.md: the singlestagecraftbinary that every later verb hangs off. No network I/O yet (auth and the
API client arrive in 003).
What lands
login/whoami,tenants,stamp,fleet,mcp) whose--helpnames the owningspec and whose handlers exit 2; working
version,config show, andcompletions <shell>.flags > env (STAGECRAFT_*) > config file > default, resolved by a pure, unit-tested function.config showprints the effective value of each field with its source.
with
--output json. JSON shapes are treated as API from the firstverb (the MCP face in 005 reuses them).
0ok,1operational,2usage /not-implemented; errors go to stderr only.
ci.yml): fmt, clippy-D warnings, test, release build on aSHA-pinned
actions/checkout. The spec-spine governance gate stays inits own
spec-spine.ymlworkflow.Verification (local)
cargo build --releaseyieldstarget/release/stagecraft;--helpshows the full tree; stubs exit 2 naming their spec;
config showandcompletions zshwork.cargo test: 18 tests (config precedence per field/source, exitcodes, JSON shape, stdout hygiene).
compile,index,lint --fail-on-warn,index check, andcouple(11 paths, no drift).Spec change
Amended 002 (before coding, per the backlog protocol) to declare
clap_completein the dependency list: the spec required a workingcompletionsverb but omitted the crate that generates the scripts.Flipped
implementationtocomplete.Note
directoriesresolves the config path per platform (Linux~/.config/stagecraft/config.toml, macOS~/Library/Application Support/stagecraft/config.toml), consistent withthe spec's "via the directories crate" instruction.