Skip to content

0004 — Generated files are written on main only

  • Status: ratified
  • Number: 0004
  • Date: 2026-10-29
  • Proposed by: agent (Grok Bot, on a branch opened for bamr87)
  • Ratified by: https://github.com/bamr87/bamr87/pull/442 (merged 2026-10-30 by @bamr87)
  • Affects: constitution §2 (invariants); feature HUB-035
  • Supersedes: none (refines the second §2 invariant added by amendment 0002)
  • Related: docs/JEV.md ("Main-only generated files"), tools/jev/README.md, tools/jev/generated.py, amendment 0002 (docs/amendments/0002-conflict-free-numbering.md)

Context

Amendment 0002 keeps generated files from being hand-merged with a custom merge driver (merge=jev-regen) and a CI drift check. That works on a clone that installs the driver, but GitHub's mergeability check ignores custom merge drivers: two pull requests that both regenerate CATALOG.md or docs/README.md are still reported This branch has conflicts, and the PR-side drift check forces every branch to commit a fresh copy of the very file they conflict on. The rule that "CI fails on drift" is what keeps the conflict alive.

Amendment

Replace the second invariant in constitution §2:

  • A generated file is never hand-merged. Its conflicts are resolved by regenerating it, and CI fails on drift rather than trusting the resolution. (amendment 0002)

with:

  • A generated file is never hand-merged. A file generated end to end that is marked jev-main-only in .gitattributes is regenerated and committed only on the default branch, by the post-merge job, and CI fails a pull request that edits it. A generated span in a hand-written file is regenerated by the same job, and a pull request's drift check on it is advisory. Every other generated file is resolved by regenerating it, and CI fails on drift rather than trusting the resolution. (amendments 0002, 0004)

Consequences

  • CATALOG.md and docs/README.md are jev-main-only. They stay committed (links and GitHub browsing keep working); .github/workflows/jev-number.yml regenerates them after every push to main and publishes through publish-data. drift-check.yml runs python3 -m tools.jev generated guard on every pull request and fails, with the fix, on an edit to one.
  • The PRD feature block, README AUTO:projects and the docs/DASH.md CLI reference are regenerated by the same job; JEV_SPANS_ADVISORY=1 turns their PR-side drift checks into warnings.
  • projects/SCHEMA.md, _data/specs.yml, _data/features_index.yml, _data/cv_portfolio.json and _data/deep_dive.json are unchanged: their own loops or the registry flow write them, and their drift checks still gate.
  • The JEV conflict engine takes main's copy of a main-only file and does not regenerate or --check it on a branch. It runs tier 0 only (jev.auto_tiers) until a human lists the model tiers.