[V2:15b] Fix Cross-Proposal Asset Links#33
Open
ritorhymes wants to merge 13 commits into
Open
Conversation
e957154 to
5d3844b
Compare
5d3844b to
9e42fa8
Compare
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.
Add build-eips preview for serving the existing resolved output directory without rebuilding or starting dirty sync. Reuse server binding resolution and preview-only host/port flags, and report missing output before binding the local server. Add a tiny_http static file server with safe path resolution, index-file fallback, basic content types, and preview path tests.
Add proposal number parsing, proposal path classification, and content-path helpers for flat and directory proposal layouts. Introduce the proposal-selection data needed by later editorial and targeted-rendering commands while leaving user-facing render selection, render-plan construction, and targeted rendering behavior to their owning later branches.
Add `build-eips editorial lint` and `build-eips editorial check` as the first user-facing proposal-selection commands. Keep eipw options scoped to editorial lint/check. Normal build, check, and serve prepare runtime sources, preprocess markdown, and run Zola without carrying eipw source-selection flags. Run editorial-selected eipw lint against the prepared merged source tree so cross-repo EIP/ERC references resolve through the same content layout used by local builds. Prepare runtime sources from the local active checkout, merge sibling repositories, and keep active-upstream fetches in changed-file comparison and editorial `--against-upstream` target selection.
Add targeted build rendering. Resolve `--only` and `[render].only` for local dirty builds, create an `OnlyRenderPlan`, rewrite links for omitted proposal content, and prune unselected content before Zola. Keep targeted mode restrictions enforced by execution policy.
Resolve cross-proposal asset links before Zola sees prepared markdown. Add proposal asset path resolution, rendered URL builders, and an OnlyRenderPlan asset inventory so links can be validated before targeted pruning removes omitted proposal content. Rewrite static asset links to rendered relative URLs when targets are available locally, and to public EIP/ERC asset URLs when targeted rendering omits the target proposal. Keep selected asset markdown links on the existing Zola @/... path, while omitted asset markdown links use public page URLs. Preserve query strings and fragments, leave fragment-only and raw HTML links untouched, and skip already-generated Zola markdown so repeated preprocessing remains idempotent.
9e42fa8 to
22b7da2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes cross-proposal asset links as a standalone V2:15b follow-up and makes targeted rendering safe after omitted proposal content is pruned. It adds proposal asset resolution, rendered-path helpers, and an
OnlyRenderPlanasset inventory built before pruning so full or selected-target renders rewrite static asset links to local relative rendered URLs, omitted targeted static assets become public EIP/ERC asset URLs in rendered-filename form (e.g./678/assets/foo.pdf), omitted asset markdown becomes public page URLs with a trailing slash (e.g./678/assets/guide/) to match Zola's canonical page form and avoid redirects, selected/full asset-markdown links stay on Zola's@/...path, and invalid cross-proposal asset targets are caught instead of becoming broken local links. It leaves raw HTMLsrc/hrefand fragment-only links unchanged, treats_index.mdas the root page, and skips already-generated Zola markdown during repeated preprocessing, so review should focus on static-versus-asset-markdown policy, selected-versus-omitted URL behavior, inventory-before-pruning ordering,_index.mdroot handling, percent-decoding/filesystem safety, target validation, query/fragment preservation, and idempotency.<number>/assets/....OnlyRenderPlanbefore targeted pruning.eips.ethereum.orgorercs.ethereum.orgasset URLs.@/...markdown path.src/hrefreferences unchanged.+++.Review Notes
This PR fixes cross-proposal asset links independently of targeted rendering, while also making targeted rendering safe after omitted proposal content is pruned.
In full renders and selected-target renders, static proposal assets rewrite to relative URLs between the rendered source page and the rendered target asset. In targeted renders where the target proposal is omitted, asset links rewrite to public EIP/ERC URLs based on the target proposal metadata.
Asset markdown keeps the existing behavior when the target is selected or when no targeted plan is active: links continue through Zola's
@/...markdown-link path. Omitted asset markdown links become public page URLs.Omitted asset markdown URLs include a trailing slash, such as
/678/assets/guide/, to match Zola's canonical page URL form and avoid a redirect. Static assets keep their rendered filename form, such as/678/assets/foo.pdf.OnlyRenderPlannow inventories proposal assets before pruning so dirty or targeted preprocessing can validate omitted targets even after the omitted proposal directory is no longer present in the prepared tree.The rendered-path helper treats
_index.mdas the root page/, so cross-proposal asset links from the top-level index page rewrite to the correct relative URL.Generated Zola markdown starts with
+++; source EIP/ERC markdown uses---preambles.process_eipandprocess_assetsuse that distinction to skip already-generated files during repeated preprocessing.A corpus audit of
EIPs/contentandERCs/contentfound three markdown-formatted cross-proposal asset links, all pointing to a single valid static PDF target, with no image or raw-HTML cross-proposal asset references. The new validation does not break any current proposal content.Verification
src/proposal.rsforOnlyRenderPlanproposal asset inventory, omitted-asset public URL policy, and selected/omitted asset validation behavior.src/markdown.rsresolver helpers forresolve_proposal_asset_path, percent-decoding safety, raw asset-shape detection, rendered-path builders, and relative-URL builders.src/markdown.rsfix_linksintegration for selected/full versus omitted asset policy, asset-markdown fall-through to existing@/...handling, and query/fragment preservation.src/markdown.rsper-file generated-Zola idempotency inprocess_eipandprocess_assets.src/markdown.rscross-proposal asset, dirty targeted preprocessing, and idempotency tests.Closes #6