[V2:05] Add Source Materialization Layer - #19
Conversation
9d809a2 to
34531df
Compare
5d204fb to
65a9b3c
Compare
65a9b3c to
4b52595
Compare
4b52595 to
75f58c8
Compare
SamWilsn
left a comment
There was a problem hiding this comment.
This'll be an incredibly useful feature!
It'll have to wait until after we get this renderer running in CI though. No point in improving DevEX for a tool that can't be used 😅
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.
75f58c8 to
c66646b
Compare
That sequencing logic collapses under its own premise. The WG EIPs system is not currently in use either, so by the same reasoning there would be no point improving the renderer, the preprocessor, or any other part of V2 until the completed system were already deployed. But the completed system cannot become usable until its constituent parts are designed and implemented. Whether a particular capability belongs in the final architecture is a legitimate question. “The tool is not in use yet” is not. This source-materialization layer belongs in the intended end state and is already integrated into the downstream build, check, and serve paths. This is also not merely a DevEX improvement. Source materialization defines what source the system actually builds:
Those semantics apply to CI as well as local development. A renderer running in CI still needs a deterministic definition of which repository state it is rendering and how that state is prepared. This branch establishes that layer; the later runtime branches consume it. I also want to avoid unnecessary churn across this stack. There are fourteen downstream preprocessor branches after this one, in addition to the coordinated work in the other repositories. When you overhauled the manifest branch, I spent an entire weekend reworking downstream consumption to fit the new design. That was substantial churn, but it produced a meaningful architectural improvement, so it was worth doing. I am willing to absorb that kind of churn for changes that materially improve correctness, architecture, or the final system. I do not think we should create comparable churn by removing or postponing valid foundational work merely because a later CI integration slice has not landed yet. At the current review rate, this process is likely to take another six to eight months. We do not need to add avoidable rework to that timeline when the implementation is valid, belongs in the final system, and is already consumed downstream. |
Summary
This PR adds the source-materialization boundary that later workspace, runtime, and serve/watch PRs use to choose between clean cloned sources and dirty local working trees. It introduces
SourceMaterialization::{Clean, Dirty}plus git helpers for availability, clone/fetch, dirty working-tree copying, tracked-path sync, and sibling merge behavior. Existing build and changed-file flows still useClean, so review should focus on thegit.rssource-state contract, not on a switch to dirty as the default.SourceMaterialization::{Clean, Dirty}and use manifest-derivedRepositoryUsevalues to carry resolved repository endpoints intogit::Fresh::new.git.rs.HEAD, while remote sibling sources continue fetchingmaster.Review Notes
This is the git/source foundation for later workspace and runtime behavior. It does not make dirty local workspaces the default yet; existing build and changed flows continue using clean cloned sources.
Workspace init uses the clone/repo availability pieces in V2:06. Execution policy starts selecting clean versus dirty source modes in V2:08. The prepared runtime pipeline consumes materialized active and sibling sources in V2:10, and serve/watch behavior consumes the dirty sync helpers in V2:11.
Review this as the source-materialization boundary:
git.rsowns repository availability, cloned source setup, dirty working-tree copying, tracked path sync, and sibling merge behavior. Later PRs decide when those paths are used.Dirty materialization rejects conflicted index entries before copying and fails explicitly on unsupported dirty paths, so later runtime PRs can fail with an explicit source state error instead of silently building from an ambiguous tree.
RepositoryUsecarries the activeBuild.tomllocation and declared sibling repository endpoints into source materialization, keeping repository resolution explicit at the git boundary.Verification
src/git.rsforSourceMaterialization,RepositoryUse, clone/fetch setup, dirty materialization, tracked path sync, dirty rejection errors, and sibling merge behavior.src/changed.rsandsrc/main.rsfor the clean materialization wiring used by existing behavior.src/config.rsfor manifest-derived repository locations andRepositoryUseconstruction used by source materialization.