Skip to content

[V2:08] Resolve Workspace Execution Policy#22

Open
ritorhymes wants to merge 5 commits into
eips-wg:masterfrom
ritovision:v2/08-execution-policy-resolution
Open

[V2:08] Resolve Workspace Execution Policy#22
ritorhymes wants to merge 5 commits into
eips-wg:masterfrom
ritovision:v2/08-execution-policy-resolution

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 the execution-policy layer that centralizes how runtime commands resolve the active repository, source materialization, sibling sources, build roots, and base URLs.

Default build, serve, and check runs use the tracked active local working tree with editable local workspace sources. --clean switches only the active repository to clean materialization. --remote-siblings switches sibling repositories to their configured remote sources while retaining the active local source. --build-root selects the prepared output root, and --base-url provides a build/serve rendering override.

It does not add the prepared runtime pipeline, static preview serving, or targeted rendering. Review should focus on default-local policy, clean active-source handling, remote-sibling selection, build-root/base-URL resolution, and command/flag applicability.

  • Add execution.rs with ResolvedExecution, ExecutionSettings, and runtime source-selection policy.
  • Resolve the active repository through its required Build.toml configuration.
  • Make default build, serve, and check runs use the tracked active local source plus editable local workspace sources.
  • Add --clean to materialize a clean active source without changing local-theme or sibling-source policy.
  • Add --remote-siblings to use configured remote sibling sources without forcing clean active-repository materialization.
  • Add centralized --build-root and --base-url resolution for runtime callers.
  • Route runtime commands through the resolved execution policy.
  • Reject execution-only overrides on non-runtime commands such as print, init, and doctor.
  • Add CLI and execution-policy tests.

Review Notes

This PR is the policy layer between workspace setup and the runtime pipeline. Later runtime PRs consume ResolvedExecution instead of independently deciding where sources, output, and rendering settings come from.

The default runtime contract is local-first: the active proposal repository comes from the tracked local working tree, and workspace-local sources remain editable for normal development. A valid active-repository Build.toml is required.

--clean changes active-source materialization only. It validates and materializes a clean active source while preserving the local development workspace model, including the editable local theme.

--remote-siblings changes sibling-source selection only. It uses the active repository locally while obtaining declared sibling repositories from their configured remote URLs. It does not imply --clean.

Build-root resolution is centralized so later build, serve, and preview callers use the same prepared output location. An explicit --build-root overrides the workspace default.

Base-URL resolution is centralized for rendering callers. An explicit --base-url wins over the configured default where the command supports it.

Targeted selection remains intentionally out of scope. V2:15 adds targeted build rendering, and V2:16 extends that behavior to serve.

Verification

  • Review src/execution.rs for active-repository configuration, local-first source selection, clean active-source materialization, remote-sibling selection, build-root resolution, base-URL resolution, and command applicability.
  • Review src/cli.rs for runtime-only execution flags and rejected non-runtime command forms.
  • Review src/main.rs for runtime dispatch through resolve_execution.
  • Review src/changed.rs for changed-file listing using the resolved source policy.
  • Review CLI and execution-policy tests for default local behavior, --clean, --remote-siblings, build-root/base-URL handling, invalid command forms, and missing or invalid active-repository configuration.

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.
Resolve build, check, and serve source policy around local active sources, clean mode, remote siblings, build roots, and base URL precedence. Keep `--clean` and `--remote-siblings` as source controls and limit `--only` to supported local dirty modes. Route runtime commands through one resolved execution policy.
@ritorhymes ritorhymes force-pushed the v2/08-execution-policy-resolution branch from c63d888 to 99db568 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