Skip to content

Restore sorted manifests/evidence.json files[] after two adjacent custody merges - #666

Closed
seathatflowsinourveins wants to merge 1 commit into
mainfrom
foundation/evidence-sort-fix-20261003
Closed

seathatflowsinourveins wants to merge 1 commit into
mainfrom
foundation/evidence-sort-fix-20261003

Conversation

@seathatflowsinourveins

Copy link
Copy Markdown
Owner

Scope

  • What this PR changes: it restores the sorted order of manifests/evidence.json files[] on main, which scripts/validate.py requires. Two rows are out of order, and this PR swaps them.
  • Base commit: ecea28654a835fff2cc3651bab77ca0e46b9bec5 (main, after OmniRoute Codex SDK worker harness at Codex 0.160.0 (supersedes #551) #628).
  • Lane: lane:foundation.
  • Owned paths touched: manifests/evidence.json (order only).

Cause. #651 (75780ee5) and #628 (ecea2865) each added a docs/decisions/2026-10-03-* row at the same position. Both were landed back to back by session 0c under the root lane's disjoint-drift rule, without a refresh. Git's three-way text merge placed docs/decisions/2026-10-03-omniroute-sdk-worker-0160.md after docs/decisions/2026-10-03-retire-pr320-loki-denominator-host-receipts.md. The landing check verified that foreign rows were equal and in order, but not the global sort order of the merged files[], so it did not catch an owned row landing next to a newly arrived foreign row.

Effect without this fix:

  • validate.py fails on main: "files[] must be sorted by path".
  • Every PR that takes main's registry and bisect-inserts its own rows stays unsorted, and fails too.

SOTA sources

  • This repository's own normalizer, scripts/evidence_manifest.py (normalize() and is_sorted(), L30-L39 at ecea2865), whose docstring requires files[] sorted by path so that parallel PRs' additions merge cleanly. The fix is that tool's own --write mode, unmodified.
  • The hot-file protocol in docs/lanes.md.
  • Git's three-way content merge, which joins two insertions at the same hunk position in either order: git-merge-tree at the Git 2.43.0 pin.

Evidence-class table

Claim Evidence class Command / receipt
main's files[] has exactly one unsorted pair local_integration a read-only scan of git show origin/main:manifests/evidence.json: 9,497 rows, 1 pair (index 2384)
this PR changes only the order of those two rows local_integration the row set is equal to main's (each row compared as sorted-key JSON), and every non-files key is equal
validation passes after the fix local_integration the commands below

Local commands run

$ python3 scripts/evidence_manifest.py --write
{"files": 9497, "status": "written"}
$ python3 scripts/evidence_manifest.py --check
{"files": 9497, "status": "passed"}
$ python3 scripts/validate.py
exit 0; {"components": 69, "hashed_files": 9497, "profiles": 4, "receipts": 191, "status": "passed"}
$ python3 -B -m unittest <the three pre-push registry tests>
exit 0

Decision record

None needed: this restores an invariant that the repository's own tool already enforces. The follow-up is to add a global files[] sortedness condition to the landing check (coordination/merge_tree_landing_check.py), and to run evidence_manifest.py --check on the merged tree before each no-refresh landing. That is requested on #608.

🤖 Generated with Claude Code

… adjacent squash merges

#651 and #628 each added a docs/decisions row at the same position. Landing them back to back without a refresh
(the disjoint-drift rule) left 'docs/decisions/2026-10-03-omniroute-sdk-worker-0160.md' after
'docs/decisions/2026-10-03-retire-pr320-loki-denominator-host-receipts.md'. scripts/evidence_manifest.py --write
restores sorted order. Only the order of those two rows changes: the row set, every hash and every other key are
unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@seathatflowsinourveins

Copy link
Copy Markdown
Owner Author

Exact-head SOURCE ACCEPT on 494267546c14144c14d9dbf67cf3664e48a58878, against actual main/base ecea28654a835fff2cc3651bab77ca0e46b9bec5.

The literal 1,114-byte diff swaps two adjacent decision rows into path order. I independently checked that all 9,497 complete row payloads are preserved exactly, with no duplicate paths, and that the result equals the sorted base files[]. Every other top-level value is unchanged, including all 191 receipts and 29 convergence records. This explicitly accepts the identified order normalization; it does not permit changes to foreign row payloads.

The operation matches the maintained normalizer. The file registrar inserts using the existing path list, so future landing checks should verify whole-result sortedness as well as row identities and unowned metadata against then-current main.

Custody: the review packet's 73 artifact bindings, 13 repository originals, three CPython originals used by the companion #665 read, and 25 native stdout/stderr pairs were independently verified; all 25 exits were 0. This verdict uses the complete registry originals and literal diff. No repository test, model, provider, merge or runtime action was run for this source review. Required current-head CI and owner-controlled landing remain separate gates; recheck the head and actual main when landing.

@seathatflowsinourveins

Copy link
Copy Markdown
Owner Author

Superseded: main 54a96ff3d (#647, merged 18:12:43Z) carries this same normalization; its registry is sorted with unique paths (9,541 rows), so this PR's diff against main is empty. Closed by session native-agent-stack-0c.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lane:foundation Foundation lane: Claude/Codex setup, hosts, memory, RAG, research, workers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant