Skip to content

[V2:07] Add Workspace Doctor#21

Open
ritorhymes wants to merge 4 commits into
eips-wg:masterfrom
ritovision:v2/07-workspace-doctor
Open

[V2:07] Add Workspace Doctor#21
ritorhymes wants to merge 4 commits into
eips-wg:masterfrom
ritovision:v2/07-workspace-doctor

Conversation

@ritorhymes

@ritorhymes ritorhymes commented May 5, 2026

Copy link
Copy Markdown
Contributor

Part of V2: Multi-repo local build system.

Summary

This PR adds build-eips doctor, the diagnostic companion to build-eips init. It validates the post-manifest local workspace contract: the configured active proposal repository must load through config::ActiveRepo with a valid Build.toml; declared workspace sources, sibling repositories, and required local tools are then checked against that active configuration.

Doctor reports diagnostics without changing build, check, or serve policy. It must validate the active proposal workspace without treating theme/ as an active proposal repository, so local theme development remains usable.

  • Add build-eips doctor for workspace diagnostics.
  • Load the active proposal repository through config::ActiveRepo.
  • Fail when the active repository is missing or has an invalid Build.toml.
  • Validate declared sibling repositories and workspace source locations from the active configuration.
  • Validate the local theme checkout as a workspace development source without requiring it to be an active proposal repository.
  • Check configured local workspace state, including declared source locations and workspace build paths.
  • Check required local tools on PATH: build-eips, git, and zola.
  • Keep the Windows user-local build-eips.exe PATH hint as a warning.
  • Add doctor command parsing and post-manifest workspace-doctor tests.

Review Notes

This is the diagnostic companion to V2:06. Init establishes a workspace around an existing active proposal checkout; doctor validates that workspace from the active repository's Build.toml contract.

The active repository is authoritative. Doctor loads it through config::ActiveRepo and treats a missing or invalid active Build.toml as a failure. It does not infer repository identity through a fallback identity layer or require the active checkout to occupy a hard-coded workspace path.

Doctor validates declared sibling and theme sources in the local workspace. The theme checkout is a local development dependency, not a proposal repository, so doctor must not require it to carry active-repository configuration.

Doctor returns a nonzero result when it records a failure. Warnings, including the Windows PATH hint, do not fail the command.

This PR reports workspace state only. V2:08 consumes the validated local-first workspace model for runtime execution policy. Optional platform-development repositories remain scoped to V2:17.

Verification

  • Review src/cli.rs and src/main.rs for the doctor command surface and dispatch.
  • Review doctor configuration loading through config::ActiveRepo, including failure behavior for missing or invalid active Build.toml.
  • Review src/workspace.rs for diagnostic reporting, declared sibling and theme checks, workspace-state checks, tool checks, and exit behavior.
  • Review doctor tests for valid active configuration, missing or invalid Build.toml, sibling and theme workspace states, local-theme development behavior, tool warnings/failures, and nonzero failure exit behavior.

Add workspace-local `.build-eips.toml` loading and starter configuration. Introduce `config::ActiveRepo` to load the selected checkout’s `Build.toml`, validate explicit `-C` roots, and expose active repository context to later commands. Keep source materialization, initialization, and diagnostics in their owning later branches.
Add clean and dirty source materialization for the active repository and sibling content. Use `config::RepositoryUse` throughout the runtime path, preserve tracked working-tree materialization and `index_path`, and reject dirty active manifests in clean modes. Build, check, and serve prepare sources without fetching the active upstream; `changed` retains upstream fetching for comparison.
Add workspace initialization from the selected active `Build.toml`. Clone missing sibling repositories from declared locations and initialize a missing theme checkout from the manifest repository and pin. Preserve existing usable checkouts and fail without deleting unusable paths. Write `.build-eips.toml` only when absent and generate `WORKSPACE.md` for the initialized workspace.
Add `build-eips doctor` for validating workspace configuration, active `Build.toml`, managed sibling repositories, the local theme checkout, and required tools. Report ok/warn/fail diagnostics; invalid active manifests and unusable theme configuration fail, while expected sibling and theme-pin conditions can warn. Keep diagnostics read-only and leave execution and runtime behavior to later branches.
@ritorhymes ritorhymes force-pushed the v2/07-workspace-doctor branch from 3e4c507 to 05b0241 Compare June 21, 2026 22:41
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