fix: publish/sync merge generated files mechanically and carry non-overlapping uncommitted work through a rebase (#180)
CI / verify (push) Successful in 5m51s
CI / pwsh (push) Successful in 1m58s
Release / release (push) Successful in 35s

Overlap only in kb/index.md, kb/log.md, kb/provenance.md and kb/**/INDEX.md no longer
fails a reconcile or reaches the rebase-review gate: the log keeps both sides' entries,
the catalog and provenance are regenerated. Uncommitted work no incoming commit touches
rides through the rebase via --autostash; the working tree is backed up under
refs/wikitool/reconcile-backup first. is_generated is narrowed to kb/.

Files changed:
- CHANGES.md
- VERSION
- instructions/gates.md
- instructions/session-setup.md
- tools/CONTRACT.md
- tools/chemenu/commands/git_publish.py
- tools/chemenu/commands/index_build.py
- tools/chemenu/commands/provenance_cmd.py
- tools/chemenu/tests/test_git_publish.py

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SnAJ7Z3CpVD3PRbN73QtU2
This commit is contained in:
torbenandClaude Opus 5.5 committed 2026-10-06 08:41:29 +02:00
1 parent 40839d956d
commit d4638bacde
9 files changed
+907 -58

No files matched your search

+43 -1
View File
@@ -59,7 +59,7 @@ concern - readable here, never shipped as something to parse.
---
## 8.0.0-beta.45 - 2026-10-06 - kb/CONVENTIONS.md.template: the guideline filter is a default, not a setup question
## 8.0.0-beta.46 - 2026-10-06 - publish/sync merge generated files mechanically and carry non-overlapping uncommitted work through a rebase
**Author:** Torben Nehmer
@@ -111,6 +111,7 @@ concern - readable here, never shipped as something to parse.
- raw capture / raw status / --replaces-bundle: documentation from git repositories as a bundle, with drift reporting
- wiki-ingest: updating the captured repositories is a step-1 branch over raw status
- export guidelines: the guideline pages as a generated GUIDELINES.md, pushed into the captured repositories behind the Guideline Push Gate
- publish/sync merge generated files mechanically and carry non-overlapping uncommitted work through a rebase
**Low impact**
- version bump no longer points at version release in its output
@@ -158,6 +159,47 @@ concern - readable here, never shipped as something to parse.
- kb/CONVENTIONS.md.template: the guideline filter is a default, not a setup question
<!-- /wikitool:bumps -->
### publish/sync merge generated files mechanically and carry non-overlapping uncommitted work through a rebase
Every ingest touches `kb/index.md` and `kb/log.md`, so two ingests on two checkouts - or two
sessions - always "overlapped", in files that carry no decision. `reconcile` (behind `sync` and
both of `publish`'s reconciles) failed on all three shapes of that: an uncommitted ingest stopped
the fast-forward with exit 1; two committed ingests went to the rebase-review gate and, once
cleared, failed on the two appends at the end of the log; and any uncommitted file at all made
`git rebase` refuse, so a stranded commit plus a new ingest could not be published.
- **Generated files never count as an overlap.** The rebase-review gate, its token and its diff
leave out `kb/index.md`, `kb/log.md`, `kb/provenance.md` and every `kb/**/INDEX.md`; an
overlapping *non*-generated file still goes to review.
- **Where they are what stops git, they are merged mechanically.** Uncommitted generated files
are set aside (the log's appended bytes kept, the rest discarded); rebase conflicts in them are
resolved step by step - the catalog and provenance take the side being rebased onto, the log
takes that side plus what the replayed commit appended. Afterwards the log gets the set-aside
entries back at its end and the catalog and `kb/provenance.md` are regenerated in-process, left
as an uncommitted change. `index rebuild` and `sources rebuild-index` lend their writing half
for that as `index_build.write_index` and `provenance_cmd.write_provenance_index`.
- **Uncommitted work no incoming commit touches rides through a rebase** (`git rebase
--autostash`) and comes back byte-identical.
- **Before the first write, the working tree is stored** as a commit under
`refs/wikitool/reconcile-backup`; a success drops it, a failure restores the working tree and
names the ref.
- **`publish`'s retry after a rejected push** commits the regenerated files on their own before
the second push, since staging is long past by then.
- **Unchanged where git manages on its own:** a reconcile that succeeded before runs the same git
command and regenerates nothing - `index rebuild` stamps today's date into `kb/index.md`, and a
rebuild there would leave every `sync` with a modified file. A log edited rather than appended
to, or an uncommitted change on a path the incoming commits change, stops exactly as before.
- **`is_generated` is narrowed to `kb/`**, as AGENTS.md invariant 1 already defines it: an
`INDEX.md` in a captured repository under `raw/` is source material, counted by the Mass-Update
Gate and never discarded.
Drop-in: no command, flag, file format or state file changes, and the previous version ignores a
leftover backup ref. Cases that ended in exit 1 or 42 now go through. A `--confirm-rebase` token
issued before the update may read as stale afterwards, because the overlap it covers no longer
lists generated files - the gate then asks again, as for any stale token. `sync`'s and
`publish`'s records, `instructions/session-setup.md` and `instructions/gates.md` follow (Gitea
#180).
### kb/CONVENTIONS.md.template: the guideline filter is a default, not a setup question
The § Guidelines for other repositories section shipped with a `{...}` placeholder, and