Skip to content

I2526 — The site generator's sections are nodes with inputs of their own, and the use-case scenarios run only when what they exercise changed

Split stage B into the nodes its real dependencies allow, starting with the execution of the use-case scenarios, so that an edit to one canonical file does not rerun every section of the site generator, and keep a coarser node wherever a finer one cannot be shown to be both correct and faster.

BLOCKED wave 5 · p2 · implementation profile · runs alone

Part of a-derive-does-only-the-work-its-inputs-changed — A derive does only the work its inputs changed, and can say why.

Blocked. This issue cannot start until I2525 is done. The status is derived from that, not declared.

Objective

Split stage B into the nodes its real dependencies allow, starting with the execution of the use-case scenarios, so that an edit to one canonical file does not rerun every section of the site generator, and keep a coarser node wherever a finer one cannot be shown to be both correct and faster.

Why

campaigns/majordomus-incremental-derive-prompt-pack/07_07_SITE_DOCS_GRANULARITY.md asks that a rule edit invalidate only the policies, registries, site data and pages that depend on it, with conservative fallbacks and with coarse nodes retained where they are faster. scripts/generate-site-data is 2622 lines that take one input list, stage every section into a temporary tree and publish it whole, and in the middle of it run majordomus usecase run for every scenario; scripts/derive records that this stage says nothing for minutes while it does so. Its one fingerprint covers milestones, issues, test cases, schemas and documents together, so adding one issue record moves the hash of everything.

Current state

Stage B is one unit with one input hash. It has two modes that bound the work: --no-scenarios, used by cases that test derivation, and --check, which stages a full generation and diffs it. The published trees under site/content are deleted and rewritten on every run (.gitattributes).

Desired state

The graph declares at least the scenario run and its evidence as a node keyed by the use cases, the fixtures under test/fixtures/commands, lib/usecase.sh and the generation of the executable, and declares the remaining sections either as nodes or as one node, as the measurements of I2521 justify. scripts/generate-site-data accepts the result of the scenario node as an input instead of running it when the planner says reuse. The composite source_hash in site/data/generated/source.json, the bytes GitHub Pages expects and the merge policy are unchanged. Amended on 2026-10-18 by the derive-performance plan: scenario reuse also applies on the generate-site-data --check path that scripts/derive-check runs, which today reruns every scenario; each scenario declares its input set, and the evidence value is unchanged.

Scope

  • scripts/generate-site-data
  • apps/majordomus-cli/src/derivation
  • apps/majordomus-cli/tests/derivation_graph.rs
  • test/cases/10_site_data.sh
  • test/cases/11_site_derivation.sh
  • test/cases/12b_site_data_transactional.sh
  • docs/GITHUB_PAGES_ARCHITECTURE.md
  • docs/DERIVE.md
  • .ai/repo/project/issues/I2526.yaml

Out of scope

  • One node per page. A page's front matter weight depends on the whole list of commands (.gitattributes), so per-page nodes would each depend on everything
  • Rewriting the site generator in Rust
  • Changing what site/data/generated or site/content contains
  • Inferring that a section is unaffected from a file name or extension

Dependencies

Acceptance criteria

  • After an edit to one document under docs that no scenario reads, an incremental derive does not start majordomus usecase run
  • After an edit to a use case, a command fixture or lib/usecase.sh, the scenario node runs
  • For each of: a CLI source edit, a schema edit, a rule edit, one document edit, a shared site template edit, an indexed document added and one deleted, the incremental result is byte-identical to a full derive
  • scripts/generate-site-data --check and --fingerprint print what they printed before on an unchanged tree
  • For every split made, the recorded duration of the split run is lower than the unsplit run on the same machine; a split that is not faster is not made
  • On an unchanged tree, the generate-site-data --check run of scripts/derive-check reruns no scenario whose declared inputs are unchanged, and the evidence it reports is the same

Validation

  • bin/majordomus plan validate
  • MJ_TEST_JOBS=2 bash test/run.sh 10_site_data 11_site_derivation 12b_site_data_transactional 51_derived_artifacts_committed
  • cargo test --manifest-path apps/majordomus-cli/Cargo.toml --test derivation_graph
  • scripts/derive-check

Evidence required

  • scenario_node_reused_on_unrelated_edit
  • site_split_equals_full
  • split_measured_faster

Evidence

None recorded. Every token above needs a command or an artifact behind it before this issue can be completed; narrative is refused.

Timeline

started
—
verified
—
completed
—

Those three fields, the evidence above and the state of the dependencies are all the status is made of. There is no status field to disagree with them.

Canonical record: .ai/repo/project/issues/I2526.yaml. Read it back with majordomus plan show I2526.

Searches the titles and descriptions of every page this site publishes.