Skip to content

[V2:15b] Fix Cross-Proposal Asset Links#33

Open
ritorhymes wants to merge 13 commits into
eips-wg:masterfrom
ritovision:v2/15b-cross-proposal-asset-links
Open

[V2:15b] Fix Cross-Proposal Asset Links#33
ritorhymes wants to merge 13 commits into
eips-wg:masterfrom
ritovision:v2/15b-cross-proposal-asset-links

Conversation

@ritorhymes

@ritorhymes ritorhymes commented May 6, 2026

Copy link
Copy Markdown
Contributor

Part of V2: Multi-repo local build system.

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 OnlyRenderPlan asset 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 HTML src/href and fragment-only links unchanged, treats _index.md as 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.md root handling, percent-decoding/filesystem safety, target validation, query/fragment preservation, and idempotency.

  • Add a proposal asset resolver for markdown/image links that resolve to <number>/assets/....
  • Add rendered path and relative URL helpers for proposal pages, static proposal assets, and proposal asset markdown pages.
  • Add percent-decoding safety for filesystem checks while preserving encoded URL output.
  • Inventory proposal assets in OnlyRenderPlan before targeted pruning.
  • Rewrite cross-proposal static asset links to rendered relative URLs when the target is local.
  • Rewrite omitted targeted proposal asset links to public eips.ethereum.org or ercs.ethereum.org asset URLs.
  • Keep selected/full asset markdown links on the existing Zola @/... markdown path.
  • Validate cross-proposal asset targets instead of silently emitting broken local links.
  • Preserve query strings and fragments on rewritten asset links.
  • Leave fragment-only links and raw HTML src/href references unchanged.
  • Skip preprocessing for already-generated Zola markdown files whose contents start with +++ .

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.

OnlyRenderPlan now 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.md as 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_eip and process_assets use that distinction to skip already-generated files during repeated preprocessing.

A corpus audit of EIPs/content and ERCs/content found 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

  • Review src/proposal.rs for OnlyRenderPlan proposal asset inventory, omitted-asset public URL policy, and selected/omitted asset validation behavior.
  • Review src/markdown.rs resolver helpers for resolve_proposal_asset_path, percent-decoding safety, raw asset-shape detection, rendered-path builders, and relative-URL builders.
  • Review src/markdown.rs fix_links integration for selected/full versus omitted asset policy, asset-markdown fall-through to existing @/... handling, and query/fragment preservation.
  • Review src/markdown.rs per-file generated-Zola idempotency in process_eip and process_assets.
  • Review src/markdown.rs cross-proposal asset, dirty targeted preprocessing, and idempotency tests.

Closes #6

@ritorhymes ritorhymes force-pushed the v2/15b-cross-proposal-asset-links branch 6 times, most recently from e957154 to 5d3844b Compare May 9, 2026 20:10
@ritorhymes ritorhymes force-pushed the v2/15b-cross-proposal-asset-links branch from 5d3844b to 9e42fa8 Compare May 26, 2026 01:02
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.
@ritorhymes ritorhymes force-pushed the v2/15b-cross-proposal-asset-links branch from 9e42fa8 to 22b7da2 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.

Cross-proposal asset links do not work

1 participant