Repository navigation
Nightly: refuse curated inputs changed before the run; policy v2 - #83
Merged
Merged
Conversation
brain-nightly.sh builds the Brain from its working tree, and its uncommitted-source check named only code. A local edit to a curated reducer input (bot/state/*.json, catalog/data/*, brain/data/*) or an ignored file the reducer reads (bot/state/pool_candidates.json) was frozen into a release whose Git authority lacked those bytes. A new section 0 records, before ingest and the proposal fold, every curated_git_input in reducer-inputs-v1.json that differs from HEAD or exists while ignored (git status --ignored=matching); section 4 then refuses to publish and lists them. The check runs before the run because fold_proposals.py itself writes several curated inputs; those writes are not flagged. The source check also stops naming site/ops/brain-canary.py, which the nightly has not run since afdf3a6; the promoter runs it. The policy test now expects no neutral file among the nightly's explicit names. POLICY becomes wikilean.release-neutral-paths/v2, for the rule changes in #68 and #75. The ID is not persisted: the promoter keeps it in memory and records only neutral_changes.
Review fixes for the curated-input gate: - brain/fold_proposals.py rewrites several curated inputs on every run, and the nightly never commits or reverts them, so a check at the start of the next run flagged the previous night's fold output and would block every publish once the fold drifted from HEAD. The check moves to section 4, next to the uncommitted-source check, and exempts the fold's outputs (FOLD_OUTPUTS plus catalog/data/*_links.jsonl). Nothing in the run writes the remaining curated inputs, so checking late also catches edits made during the run. - git status gets --untracked-files=all: with status.showUntrackedFiles=no in the repository config, --ignored=matching alone fails. - Failures abort with their own messages, as the source check does. - A test pins FOLD_OUTPUTS to the curated .jsonl files fold_proposals.py names; the behavioural test covers fold outputs, showUntrackedFiles=no and the fail-closed path. - The canary removal is cited as 81c33d4, its SHA on the current history. - site/ops/README.md says what the gate refuses and how to clear it.
Owner
Author
|
Recommendation: merge, but only after the release being built now is promoted (
|
Owner
Author
|
Re-review on main ( Verified:
Release B: whoever builds or promotes it should read this.
Follow-ups:
Your call:
|
This was referenced Oct 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
brain-nightly.shbuilds the Brain from its working tree. Its uncommitted-source check (section 4) names code only. It never looks at the reducer's curated inputs:bot/state/*.json,catalog/data/*,brain/data/*, allcurated_git_inputinbrain/authority/reducer-inputs-v1.json. So two kinds of local state were frozen into a release whose Git authority lacked those bytes:python3 bot/brain_queue.py, whichbot/README.mddocuments;bot/state/pool_candidates.jsonis gitignored, andbrain/build_cells.pyreads it when present.Change
curated_git_inputpaths and runsgit status --ignored=matching --untracked-files=all --porcelainon them. It reports tracked inputs that differ from HEAD (M,D, staged) and ignored or untracked ones that exist (!!,??).curated reducer inputs differ from HEAD; the Git authority would be falseand the paths.git statusaborts with its own message, the same way the source check fails closed.--untracked-files=allkeeps it working when the host repo setsstatus.showUntrackedFiles=no.brain/fold_proposals.pyrewrites these curated inputs on every run:brain/data/{container_links,discovery_proposals,discovery_rejected,ext_anchor_links,fc_links}.jsonlandcatalog/data/<key>_links.jsonl(todaytauceti_links.jsonl), and it appends tocatalog/data/{grounding_overrides,universe_extension}.jsonl.bot/statefiles,source_registry,rebuild_grounding,decl_renames,community_edges,frontier_suitability_overrides), so checking them at release time also catches edits made during the run.site/ops/brain-canary.py. The nightly hasn't run it since81c33d4d; the promoter and.github/workflows/brain-canary.ymldo.POLICYis nowwikilean.release-neutral-paths/v2, for the rule changes in Release policy: AGENTS.md and CONTRIBUTING.md are release-neutral #68 (AGENTS.mdandCONTRIBUTING.mdneutral) and site/ops: the reducer's bot/state inputs are release-affecting #75 (thebot/stateinputs release-affecting). The ID isn't persisted: the promoter keeps it in memory and records onlyneutral_changes.site/ops/README.mdsays what the gate refuses and how to clear it.Operator notes
bot/state/pool_candidates.json, or uncommitted edits to the checked curated inputs, stops publishing shadow releases until those are committed, reverted or removed. The log lists the paths. The operator checkout ran the laptop poller until 2026-08-23, which wrotepool_candidates.json, so check for it.WIKILEAN_COMMUNITY_HARVEST=1(default 0),nightly-moderate.shrewritesbrain/data/community_edges.jsonl. That now blocks the next Brain publish until the harvest output is committed.Not changed, and worth a decision
The fold's own output still reaches the release uncommitted. The release records those bytes (the legacy declared-input root hashes the working tree), but its authority commit doesn't hold them. Hand edits to those seven fold-written files are also not flagged. Whether fold output must be committed before a release is frozen is left open.
Tests (
site/ops/test_brain_nightly.py)test_changed_curated_inputs_block_the_release_except_fold_outputsextracts the check from the script, runs it under bash against a temporary git repo, and checks that the check sits after the fold and before the abortelif. Cases:M …and!! …;status.showUntrackedFiles=no;test_curated_check_exempts_exactly_the_fold_outputspins the exemption list to the curated.jsonlfilesfold_proposals.pynames, plus the<key>_linkspattern.brain-canary.py.site/ops/test_brain_release_authority.py, the canary test becomestest_every_file_the_nightly_names_is_release_affecting.I didn't run these locally because machine load was above the agreed limit; CI runs them.
bash -npasses under bash and/bin/bash3.2, and the exemption pin was checked by hand against the current files.This PR's commits sit directly on
main(43d3ed74).