Skip to content

1/3 Add network upgrade core model#36

Open
ritorhymes wants to merge 20 commits into
eips-wg:masterfrom
ritovision:feature/network-upgrades-core
Open

1/3 Add network upgrade core model#36
ritorhymes wants to merge 20 commits into
eips-wg:masterfrom
ritovision:feature/network-upgrades-core

Conversation

@ritorhymes

@ritorhymes ritorhymes commented May 10, 2026

Copy link
Copy Markdown
Contributor

Built on top of the V2 multi-repo local build system tracked in #15.
Stack: #34 → this PR.

Summary

This PR is 1/3 in the preprocessor stack for the hardfork/network-upgrade rollout tracked in #35.

It adds the in-memory network-upgrade index, source-selection rules, marker validation, modern stage parsing, and initial modern registry entries.

The consumer code lands in #37, which uses this index to generate content/hardforks/_index.md and proposal-page metadata. Historical registry coverage lands in #38.

Model shape

The index records hardfork sources, stages, member rows, per-proposal memberships, and source-selection diagnostics as an in-memory contract for prepared-runtime data generation.

Modern sources here are hardfork Meta EIPs that expose membership through staged sections, rather than legacy Included EIPs lists or curated historical backfill data.

The source-selection model supports marked sources, transitional registry entries, and permanent registry entries so the rollout can ship before EIPs source markers are backfilled.

Changes

  • Add network_upgrades collection and model types.
  • Add source selection for marked modern sources, transitional registry sources, and permanent registry sources.
  • Add marker validation for network-upgrade on EIP Meta proposals.
  • Parse modern hardfork stage sections into stable stage keys, display labels, member rows, and optional subgroups.
  • Resolve member row metadata and URLs through the shared proposal catalog.
  • Use catalog-provided URLs so full builds use local proposal links while partial --only builds can link omitted proposals to their published pages.

Test coverage

This PR has no live runtime writer yet, so tests are the main review surface for the model contract.

Tests cover:

  • marker validation on EIP Meta proposals
  • rejection of network-upgrade markers outside EIP Meta proposals
  • modern stage parsing into stable keys, labels, rows, and subgroups
  • duplicate detection
  • slug generation and slug collision handling
  • source selection across marked, transitional, and permanent sources
  • missing member/reference errors
  • prepared-source catalog use

Out of scope

This PR only adds the reusable in-memory model and collection logic. Runtime generation of content/hardforks/_index.md, proposal-page metadata injection, theme rendering, historical backfill entries, eipw support, and EIPs marker backfill are handled by follow-up PRs in the rollout.

ritorhymes added 20 commits May 25, 2026 20:43
Add the .build-eips.repo.toml schema, loader, validation rules, and
manifest tests for active proposal repositories and declared sibling
repositories.

Introduce ActiveRepoIdentity so later workspace lifecycle and execution
layers can select manifest-backed repository metadata while the legacy
EIPs/ERCs fallback continues to operate.
Add the .build-eips.toml schema, starter config text, upward
discovery, and loaded workspace config accessors.

Define server/site defaults, workspace build-root paths, local theme
and repo paths, and strict parsing for unsupported config fields.

Leave init, doctor, runtime consumption, and render-only filtering to
the later workspace, execution, and targeted rendering PRs.
Add source materialization modes, reshape RepositoryUse around resolved
repository endpoints, and pass source mode explicitly into Fresh.

Add dirty working-tree copying, tracked-path sync, dirty rejection
errors, and sibling merge behavior that follows local file sibling
HEADs.

Route existing build and changed-file flows through clean source
materialization so current behavior stays unchanged.
Add build-eips init to create a workspace root, clone declared sibling
repos and the shared theme, optionally clone template, and create the
local build root.

Write starter .build-eips.toml only when missing and regenerate a base
WORKSPACE.md guide for the initialized workspace.

Use active repository identity and staging repo metadata for workspace
bootstrap while leaving doctor, platform-dev repos, and runtime behavior
to later PRs.
Add build-eips doctor for checking workspace config discovery, active
repo identity, repository layout, sibling manifests, theme checkout, and
required local tools.

Report ok/warn/fail diagnostics and fail the command when any check
records a failure.

Keep this focused on workspace diagnostics; execution policy, runtime
commands, and platform-dev setup land in later PRs.
Add ResolvedExecution for command source policy, build roots, base URL
overrides, staging/production selection, and clean versus dirty source
materialization.

Add CLI execution controls for production, remote siblings, build roots,
build/serve base URL resolution, plain build/serve/check clean mode, and
parity commands, with tests for the command matrix.

Route build, check, serve, clean, and changed-file listing through the
resolved policy while leaving targeted --only behavior to later PRs.
Resolve a workspace-local theme for Zola runtime commands and remove
the remote theme cache path.

Mount the selected theme under repo/themes/eips-theme for Zola, load
Zola config from the mounted theme, and load eipw config from the local
theme checkout.

Require workspace theme setup for build, check, serve, and parity
commands while leaving the prepared runtime pipeline to the next PR.
Move the Prepared runtime pipeline out of main.rs into pipeline.rs and
keep main.rs focused on dispatching resolved runtime operations.

Prepare runtime inputs from ResolvedExecution by cloning and fetching
sources, force-refreshing prepared git scratch refs, merging sibling
proposal content while keeping the active homepage, running eipw lint,
preprocessing markdown, and materializing the local theme for Zola.

Keep the existing minimal Prepared::serve method with the type, while
leaving serve watcher and sync behavior to the serve runtime PR.
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, editorial selector classification, and
content-path helpers for flat and directory proposal layouts.

Add OnlyRenderPlan to index proposal content for selected rendering,
derive EIP/ERC public URLs, choose internal versus external required
references, filter/prune content, and gate dirty path sync.

Keep this as internal foundation for editorial integration and targeted
build/serve rendering; no user-facing --only config lands here.
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 build-only render selection from --only and workspace
[render].only, deduping proposal numbers into ResolvedExecution.

Build OnlyRenderPlan during prepared runtime setup, rewrite omitted
proposal links and requires entries to public URLs, and prune unselected
proposal content before Zola runs.

Restrict targeted rendering to local dirty build mode for now, leaving
targeted serve sync to the next PR. Remove the eipw lint step from the
prepared runtime pipeline so linting is reached only through editorial
commands.
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.
Extend targeted rendering to local dirty serve by accepting --only on
serve and applying workspace [render].only to local serve runs.

Pass OnlyRenderPlan into dirty serve sync and filter active-repo dirty
paths to selected proposal content. Avoid reintroducing omitted proposal
markdown or assets into the materialized repo.

Add incremental targeted markdown preprocessing for dirty serve updates,
including selected asset markdown, retained non-proposal pages, selected
deletions, and filesystem timestamp fallback for new dirty files.
Add --platform-dev workspace initialization for cloning optional
preprocessor and eipw repos alongside proposal repos and theme.

Add POSIX and PowerShell dev-setup scripts that build the local
build-eips binary, ensure a supported Zola is available, and install
0.22.1 when needed while reusing existing 0.22.1-or-newer installs.

Add setup documentation, release archive checksum sidecars, doctor
helper checks, and focused setup tests for contributor workspace setup.
Finalize the preprocessor integration docs and command help.

Describe staging, production, and parity as clean local-active runtime
modes that use remote sibling sources and selected environment metadata.

Keep CLI help, workspace guide, and architecture source-policy wording
aligned around the local active checkout source model.
Parse section index front matter directly as YAML before writing the
generated Zola TOML front matter. This preserves structured section
metadata such as extra.homepage_badges instead of flattening nested YAML
through the proposal preamble parser.

Keep proposal markdown on the existing proposal preamble path, and keep
body link rewriting active for section index pages.
Generate static/assets/data/proposals.json from prepared proposal
sources during the runtime build pipeline.

Collect proposal metadata through a shared catalog so JSON writing and
future prepared-runtime data passes use the same path validation,
preamble parsing, duplicate detection, targeted URL policy, and stable
proposal ordering.

Preserve the existing JSON shape, active repository prefix selection,
pretty formatting, omitted optional fields, and output-collision
protection.
Add the in-memory network-upgrade index, source-selection rules,
marker validation, modern stage parsing, and initial modern registry
entries.

The index records hardfork sources, stages, member rows, per-proposal
memberships, and source-selection diagnostics as an in-memory contract
for prepared-runtime data generation.
@ritorhymes ritorhymes force-pushed the feature/network-upgrades-core branch from f7e0de6 to f1ad2a4 Compare May 26, 2026 01:02
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