Add a root whitaker binary behind an internal library boundary (3.5.1) - #356
Draft
leynos wants to merge 5 commits into
Draft
Add a root whitaker binary behind an internal library boundary (3.5.1)#356leynos wants to merge 5 commits into
whitaker binary behind an internal library boundary (3.5.1)#356leynos wants to merge 5 commits into
Conversation
Draft the execution plan for roadmap item 3.5.1: add a real `whitaker` binary at the root package and move the current installer orchestration behind an internal library boundary. The plan places the CLI domain, ports, and adapters in a new `crates/whitaker_cli` crate rather than in the root package, because the root package's library requires `feature(rustc_private)` and is excluded from `make test` by `TEST_EXCLUDES`. The root `src/main.rs` becomes a thin composition root. Scope is limited to `install` and `ls`; `check` and `doctor`, the configuration model, and the deprecation shim remain with their own roadmap items. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
A six-perspective review invalidated the first draft's structural bet. `cargo package -p whitaker` fails: the root package depends on four `publish = false` rustc shim crates and lacks crates.io metadata, so `cargo install whitaker` was unreachable. Extracting the Dylint driver library into `crates/whitaker_lint_core` is therefore a precondition, not a contingency, and it is now milestone EP-M0. That removes the need for a separate CLI crate, makes `CARGO_BIN_EXE_whitaker` available to the end-to-end tests, and confines `ortho_config` to the CLI binary. Record the `whitaker` name collision the first draft missed: the installer generates an executable named `whitaker` that a `cargo install`ed binary deterministically shadows, breaking `whitaker --all` and this repository's own `make lint`. The binary now forwards unrecognized arguments to `cargo dylint`. Cut both original verification obligations as vacuous. Nothing inverts a release-asset name, and clap rejects the flag conflicts before any repository-owned routing code runs. Verify argv classification totality and disjointness instead, bounded by Kani and closed unbounded by Verus. Settle exit codes at 0, 2, and 1. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Warning Your free Security trial is over. An organization admin can activate billing to continue. |
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueWarning Your free Security trial is over. An organization admin can activate billing to continue. Comment |
whitaker binary behind an internal library boundary (3.5.1)whitaker binary behind an internal library boundary (3.5.1)
Move compiler-private driver code and its tests into the non-publishable `whitaker_lint_core` package so the root package can become a normal, publishable CLI package. Migrate all in-tree lint consumers and templates to the internal package, and retain the moved tests through a dedicated feature-free core pass. This avoids Cargo feature-unification linkage failures without weakening the all-feature Dylint validation.
Move command routing and installation flow behind `whitaker_installer::orchestration` while keeping the legacy binary as a small composition root. Add a normalized `--dry-run` output snapshot to preserve the existing installer contract through the relocation.
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.
Execution plan for roadmap item 3.5.1 — add a root
whitakerbinary and movethe current installer behaviour behind an internal library boundary.
Plan document:
docs/execplans/3-5-1-root-whitaker-binary.mdNo production code changes. This PR is the plan only, and needs approval
before implementation begins.
What the plan delivers
A real
whitakerbinary withinstallandls, doing whatwhitaker-installerandwhitaker-installer listdo today — whilewhitaker --allkeeps working by forwarding tocargo dylint.whitaker checkandwhitaker doctorremain with their own roadmap items.Five milestones: extract the Dylint driver library (
EP-M0), promote theinstaller orchestration into its library (
EP-M1), build the binary(
EP-M2), add binstall metadata and reserve the crates.io name (EP-M3),then the ADR and documentation (
EP-M4).Why revision 2 looks different from a first draft
The plan was stress-tested by a six-perspective design review before
submission. Three findings changed the architecture, and the review is worth
knowing about when reading the Decision log.
The root package cannot be published. Verified directly:
It depends on four
publish = falsecompiler-shim crates. Socargo install whitaker— the plan's headline outcome — was unreachable.Extracting the Dylint driver library into
crates/whitaker_lint_coreistherefore a precondition rather than a contingency, and it is now
EP-M0.That also makes the root package testable, so
CARGO_BIN_EXE_whitakerbecomes available to the end-to-end tests, and it stops
ortho_configpropagating into eleven lint crates.
The
whitakername is already taken.installer/src/wrapper.rs:105writes an executable named
whitakerinto the user's bin directory, andMakefile:9prepends~/.cargo/binwhileMakefile:6appends~/.local/bin— so acargo installed binary deterministically shadows it.That would break
whitaker --all, whichdocs/users-guide.mddocuments asthe primary workflow and which this repository's own
make lintruns, withno replacement until 3.5.2. The binary now forwards unrecognized arguments to
cargo dylint.Both original verification obligations were vacuous. Nothing in the
repository ever inverts a release-asset name, and both documented flag
conflicts are enforced by clap before any repository-owned routing code runs.
Proving properties of an unreachable branch is not evidence, so both were cut
and recorded as such. They are replaced by argv-classification totality and
disjointness — genuinely new logic introduced by the forwarding behaviour —
bounded by Kani and closed unbounded by Verus, each with a required negative
control.
Open questions for the reviewer
Three items are flagged in the Decision log rather than settled:
ortho_configearns its place at this milestone, giventhat
NoOpLocalizerdoes not translate, so the dependency buys a one-linecall-site difference until 3.6.4.
googletestandpretty_assertionsare authorized by the taskbrief but the sibling plan for 7.3.1 ruled the other way, and neither crate
is used anywhere in the workspace today.
is_display_request's exact signature needs confirming before Stage Bwrites red tests against it.
Validation
make markdownlintandmake nixiepass.make check-fmt,make typecheckand
make lintare unaffected — this change is documentation only.References
docs/roadmap.mddocs/whitaker-cli-design.md§Public CLI surface, §Compatibility and migration🤖 Generated with Claude Code