Skip to content

Nightly: watch every module the reducer imports - #106

Open
Deicyde wants to merge 1 commit into
mainfrom
claude/nightly-reducer-imports
Open

Deicyde wants to merge 1 commit into
mainfrom
claude/nightly-reducer-imports

Conversation

@Deicyde

@Deicyde Deicyde commented Oct 19, 2026

Copy link
Copy Markdown
Owner

Hold until release B is promoted. site/ops/brain-nightly.sh is release-affecting. Merging this while B is being built at the main you're preparing (after #102, #92 and #93) would force a rebuild. It goes into the next release cycle.

Problem

brain-nightly.sh refuses to publish while release-affecting source is uncommitted. Its pathspec list misses four modules that the reducer and the release tools import, so a local edit to one of them was frozen under a Git authority that lacked it:

  • brain/install_wikidata_observation.py and brain/wikidata_observation.py, imported by brain/build_common.py
  • catalog/huggingface_download.py, imported by brain/build_common.py
  • brain/tools/execution_environment.py, imported by the release tools

site/ops/brain_release_authority.py already treats all four as release-affecting. Only the nightly's source check missed them. Found in #75's re-review.

Change

  • The four paths join the uncommitted-source check.
  • New test, test_release_cleanliness_gate_covers_every_module_the_reducer_imports (site/ops/test_brain_nightly.py):
    • It computes the local-import closure of the reducer scope (reducer-inputs-v1.json) and the release tools (build_release, verify_release, measure_store, authority_contracts, fold_proposals, the Wikidata bundle modules and ingest/common). Lazy imports inside functions count, and imports resolve along the scripts' sys.path (brain, brain/tools, site, catalog, site/ops).
    • It then requires every module in that closure to be covered by the nightly's pathspecs, so a future import can't slip past.
    • Today the closure has 24 modules; on main the test would fail on exactly these four.

bash -n passes under bash and /bin/bash 3.2. I didn't run the suite locally because machine load was above the agreed limit; CI runs it.

brain-nightly.sh refuses to publish while release-affecting source is
uncommitted, but its pathspec list missed four modules the reducer and the
release tools import, so a local edit to one was frozen under a Git
authority that lacked it:
- brain/install_wikidata_observation.py, brain/wikidata_observation.py
  (brain/build_common.py)
- catalog/huggingface_download.py (brain/build_common.py)
- brain/tools/execution_environment.py (the release tools)
The policy already treats all four as release-affecting.

A new test computes the local-import closure of the reducer scope and the
release tools (lazy imports included) and requires the nightly's
uncommitted-source check to cover every module in it, so a future import
cannot slip past.
@Deicyde

Deicyde commented Oct 20, 2026

Copy link
Copy Markdown
Owner Author

Verdict: merge after release B is promoted, as the description says. Nothing blocks merge.

  • The import closure: I re-ran the new test's import walk against both checkouts.
    • At this head the reducer's closure has 24 modules, all watched.
    • At main 3c1139f exactly four are unwatched, the four the description names: brain/install_wikidata_observation.py, brain/wikidata_observation.py, brain/tools/execution_environment.py and catalog/huggingface_download.py.
    • The walk resolves the one relative import (from . import execution_environment in authority_contracts.py) through its level-0 fallback.
  • The effect: a dirty file among those modules now sets DIRTY, and the existing check aborts the release. None of the four is release-neutral in brain_release_authority.py, so the claim that they already counted as release-affecting holds.
  • Release impact: site/ops/brain-nightly.sh is in AFFECTING_EXCEPTIONS, so merging forces a rebuild of release B. It has to wait for promotion.
  • CI: the python job ran site/ops/test_brain_nightly.py with 26 tests (25 on main), and the browser, worker and required jobs passed. The PR merges cleanly into main 3c1139f.

Posted by Claude Code (AutoformBot "Merge Currently Open PRs 4" session).

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