Skip to content

refactor(cli): expose the CLI product plan in doctor - #1551

Merged
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/cli-product-assembly-pr1
Jul 14, 2026
Merged

refactor(cli): expose the CLI product plan in doctor#1551
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/cli-product-assembly-pr1

Conversation

@limityan

@limityan limityan commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • make bitfun doctor the first production CLI path to select DeliveryProfile::Cli and consume its static ProductAssemblyPlan
  • expose only the selected cli profile and state that runtime readiness is not evaluated; do not project static requirements or extension enums as live availability
  • reuse the shared PathManager for guarded CLI config isolation and fail closed unless both E2E user and home roots are present
  • explicitly generate the repository-ignored dependency lockfile on clean runners, then run an independent locked CLI test job on Ubuntu and locked three-platform workspace compilation
  • align the architecture documents with this deliberately limited current baseline

Why

The CLI already had profile and capability contracts, but no production entrypoint consumed DeliveryProfile::Cli. The safe first slice is a read-only plan selection with an entrypoint test. Runtime availability remains unknown until real owner-provided services and policy paths are connected.

The CI shape keeps an early CLI-specific test result without maintaining a second three-platform Rust matrix. Cross-platform compilation is handled by the existing workspace jobs.

Scope and non-goals

This PR includes only static plan selection, focused diagnostics/tests, guarded test storage, CI coverage, and current-state documentation.

It intentionally does not:

  • call ProductAssembler or construct ProductRuntimeParts
  • register placeholder FileSystem, Workspace, Session, Permission, Event, or other Runtime Service providers
  • migrate Chat, Exec, ACP, Peer Host, or management commands away from bitfun-core/product-full
  • infer runtime health from static service requirements
  • change approval policy, automation output schemas, TUI behavior, plugin execution, branding, packaging, or product customization

Follow-up work remains independently scoped: Runtime Services and the first behavior-equivalent execution slice; invocation-scoped approval; and versioned automation output/exit contracts. None is claimed complete by this PR.

User-visible behavior

bitfun doctor now reports:

[info] Product profile: cli (static plan only; runtime readiness not evaluated)

It no longer exposes requirement-edge counts or internal extension states such as not_built. Existing doctor checks and exit behavior are unchanged.

Architecture and risk controls

  • ProductAssemblyPlan remains a static eligibility/dependency contract, not a health source.
  • PathManager remains the owner of storage-root resolution and the two-root E2E guard; CLI still owns its config.toml path.
  • Missing either guarded user or home root exits non-zero before writing CLI config.
  • Peer Host routing and the new CLI installer path from current main are unchanged.

Validation

  • cargo +nightly test --locked -p bitfun-cli — 46 unit tests, 4 plugin-source integration tests, and 2 product-plan/storage-guard tests passed
  • cargo +nightly clippy -p bitfun-cli --all-targets — passed; existing repository warnings remain
  • cargo +nightly check --locked --workspace — passed after the same src/mobile-web/dist preparation used by CI
  • cargo +nightly test --locked --workspace — all affected CLI/core/desktop suites passed; one existing timing-sensitive terminal-core test failed once, then its focused rerun and the complete 80-test terminal-core suite passed
  • node scripts/check-core-boundaries.mjs
  • pnpm run check:github-config — YAML parse and 7 contract tests passed
  • cargo +nightly metadata --locked --no-deps --format-version 1
  • clean-checkout lockfile simulation: cargo generate-lockfile followed by cargo test --locked -p bitfun-cli --no-run
  • targeted nightly rustfmt --check
  • git diff --check gcwing/main...HEAD
  • rebased without conflicts onto gcwing/main at feb8cb2a3
  • independent adversarial architecture, product-design, and quality/CI reviews completed; all P1 findings were fixed and the final rebased commit was re-reviewed

Local stable Rust 1.94.1 is below the current locked dependency requirement, so local Rust validation used the installed nightly 1.96 toolchain. GitHub uses the latest stable toolchain.

Implementation was AI-assisted. Testing level: fully tested for the affected local paths; cross-platform compilation and the Ubuntu CLI test suite are enforced by CI.

@limityan
limityan force-pushed the yanzhn/cli-product-assembly-pr1 branch from 93b5b85 to 201e50b Compare July 14, 2026 12:13
Select DeliveryProfile::Cli for doctor without treating static requirements as runtime availability. Add isolated binary tests and efficient CLI CI coverage.
@limityan
limityan force-pushed the yanzhn/cli-product-assembly-pr1 branch from 201e50b to 7cd2567 Compare July 14, 2026 12:21
@limityan
limityan marked this pull request as ready for review July 14, 2026 12:28
@limityan
limityan merged commit 1801ac0 into GCWing:main Jul 14, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant