feat: wikitool upstream merge/verify - code procedure for taking a stack update (4.5.0-beta.1, #30)
CI / verify (push) Successful in 57s
Release / release (push) Successful in 35s

Files changed:
- AGENTS.md
- CHANGES.md
- VERSION
- instructions/gates.md
- instructions/private-instance.md
- tools/CONTRACT.md
- tools/README.md
- tools/chemenu/cli.py
- tools/chemenu/commands/dist_cmd.py
- tools/chemenu/commands/run_budget.py
- tools/chemenu/commands/upstream_cmd.py
- tools/chemenu/ownership.py
- tools/chemenu/tests/test_upstream_cmd.py
This commit is contained in:
2026-09-04 07:08:49 +02:00
parent abe5497cda
commit 686c08bb14
13 changed files with 880 additions and 80 deletions
+18
View File
@@ -103,6 +103,24 @@ The setup this gate exists for - a private instance that takes stack updates fro
upstream - is [private-instance.md](private-instance.md). Step 4 there arms it, deliberately
*before* the first `publish`: added afterwards it leaves open exactly the window it closes.
### Mass-Update Gate blind spot: `upstream merge`
`upstream merge` (a private instance taking a stack update - see
[private-instance.md](private-instance.md)) can update or delete dozens of stack-owned paths in
one commit, and the Mass-Update Gate does not see any of it. The gate counts *working-tree*
changes before `publish` stages them; by the time `upstream merge` commits, the change is
already history, and the commit it made is not what a later `publish` would be staging - that
publish sees only whatever this session adds on top. A merge touching 200 files therefore goes
out ungated the moment it is pushed.
This is not a hole to patch by making `upstream merge` route through the gate: the gate's
question ("is this too much to publish?") does not apply to a change that only ever touches
stack-owned paths that are, by definition, not this instance's own content. The check that
actually matters here is `upstream merge`'s own postcheck - it re-verifies the merge commit
against `upstream verify`'s logic immediately after committing, and refuses loudly (uncommitted
state is not rolled back; the commit is left for a human to look at) if anything landed outside
a stack-owned path. That is the safeguard for this command, not the Mass-Update Gate.
## Iteration Budget Gate and loop-breaker
Every `wikitool` call is counted per session. Calls are refused past **60 in a session**, or