Skip to content

[V2:11] Add Serve Runtime#25

Open
ritorhymes wants to merge 8 commits into
eips-wg:masterfrom
ritovision:v2/11-serve-runtime
Open

[V2:11] Add Serve Runtime#25
ritorhymes wants to merge 8 commits into
eips-wg:masterfrom
ritovision:v2/11-serve-runtime

Conversation

@ritorhymes

@ritorhymes ritorhymes commented May 5, 2026

Copy link
Copy Markdown
Contributor

Part of V2: Multi-repo local build system.

Summary

This PR completes the V2 serve runtime on top of the prepared pipeline, adding serve-specific server binding and live synchronization while Zola is running. serve accepts --host/--port, consumes the resolved --base-url from V2:08, passes binding/output args to Zola, and runs a watcher that syncs dirty active-repo paths into the materialized repo (rerunning markdown preprocessing) and tracked local-theme changes into repo/themes/eips-theme; --clean disables the active-repo half but leaves theme sync on. It does not add targeted serve --only, so review should focus on server-binding precedence, Zola serve args, the two-target watcher behavior, and markdown reprocessing on active-source change.

  • Add serve-only --host and --port CLI flags.
  • Resolve server binding from CLI flags, workspace [server] config, or defaults.
  • Pass resolved server binding and optional base URL override into Zola serve.
  • Run Zola serve with --fast, --force, --interface, --port, and generated output args.
  • Add serve.rs for dirty active-repo and local-theme synchronization while Zola is running.
  • Watch dirty active-repo paths in dirty mode and sync them into the materialized repo.
  • Watch local theme changes and Git index changes, then sync tracked theme paths into the mounted theme.
  • Add the notify dependency and serve/runtime tests.

Review Notes

This PR completes the serve runtime on top of the prepared pipeline from V2:10. Earlier PRs establish execution policy and prepared inputs; this PR makes Prepared::serve manage live synchronization and pass serve-specific settings to Zola.

Server binding is resolved centrally in execution policy. CLI --host/--port values override workspace [server] settings, which fall back to the default 127.0.0.1:1111 binding from the workspace config schema.

--base-url was accepted and resolved for serve in V2:08. This PR is where Zola serve consumes it, adding -u <base-url> and --no-port-append when an override is present.

Dirty serve sync has two separate targets. Dirty active-repo sync is enabled only when source materialization is dirty; --clean disables that active-repo sync. Local theme sync remains active even under --clean so theme edits can still update the mounted repo/themes/eips-theme copy while serving.

The watcher syncs dirty active-repo paths and tracked local theme paths. Active repo markdown sync reruns markdown preprocessing after copying changed paths into the materialized repo.

This PR does not add targeted serve --only behavior. Targeted serve filtering and selected-path sync land in V2:16.

Verification

  • Review src/cli.rs for serve-only --host/--port parsing.
  • Review src/execution.rs for server binding resolution from CLI, workspace config, and defaults.
  • Review src/pipeline.rs for Prepared::serve, watcher startup/shutdown, active-repo sync configuration, local theme sync configuration, and Zola serve invocation.
  • Review src/serve.rs for dirty active-repo watching, local theme watching, Git index event handling, path sync, and markdown preprocessing after active-repo sync.
  • Review src/zola.rs for serve argument construction, server binding args, base URL override args, and output directory handling.
  • Review Cargo.toml and Cargo.lock for the notify dependency.
  • Review tests for server flag parsing, server binding resolution, Zola serve args, local theme index events, dirty active-repo sync enablement, and clean-mode sync 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.
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.
Run Zola with the editable `workspace/theme` checkout. Materialize tracked local theme files into prepared `themes/eips-theme`, load Zola and eipw configuration from that local checkout, and keep runtime commands independent of manifest network access.
Add prepared runtime build pipeline. Materialize active and sibling sources according to resolved execution policy, preprocess merged proposal content, prepare the local theme mount, and invoke runtime checks and rendering from `pipeline.rs`. Keep serve watch and sync behavior in the serve runtime branch.
Add server binding resolution and serve-only host/port flags for local Zola serve commands.

Run Zola serve with the resolved server binding, optional base URL override, fast/force serve flags, and generated output directory.

Add dirty serve watching for dirty active-repo paths and local theme changes. Clean mode disables active-repo sync but keeps theme sync.
@ritorhymes ritorhymes force-pushed the v2/11-serve-runtime branch from fcfad99 to 53015fa 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