Repository navigation
backend-go: specify finalization and batch parity contracts - #25802
Merged
Merged
Conversation
Git-on-my-level
marked this pull request as ready for review
November 19, 2026 22:12
Git-on-my-level
added a commit
that referenced
this pull request
Nov 19, 2026
## Summary Generate port task drafts when a merged Python PR changes finalization or batch behavior. The map covers all 34 finalization and 41 batch runtime Python sources cited by the [landed contracts](#25802), plus imported family policy and implementation. The [scope document](https://github.com/BasedHardware/omi/blob/9554967bf78fab4d18b1504a7ef19b31e46141af/backend-go/docs/port-map-scope.md) records the boundaries and exclusions. The PR branch includes `main` at contracts merge `97b4059861a7`. The batch map includes the projection kill-switch defaults introduced upstream in #25791. The Backend Go Checks workflow runs the Python suite when these files change in a PR. On each main push, it walks the pushed first-parent merge commits, looks up their merged main PRs, and checks the complete paginated file list against GitHub's `changed_files` count before drafting. The CLI also rejects duplicate filenames in a counted input and uses both sides of renames. The job prints JSON and uses read-only permissions. Tracker writes are outside this change. [Commit-to-PR API](https://docs.github.com/en/rest/commits/commits#list-pull-requests-associated-with-a-commit) · [PR files API](https://docs.github.com/en/rest/pulls/pulls#list-pull-requests-files) ## Verification - Nine focused tests exercise family matching, renames, duplicate or truncated file lists, malformed inputs, task text, existence of every mapped file, and coverage of the checked-in batch contract. Run `python3 -m unittest discover -s .github/scripts -p test_go_port_tasks.py -v`. - `actionlint .github/workflows/backend-go-checks.yml` passed. Ran the workflow's push steps locally over three real first-parent merges and verified Go test selection on Go and Python-only ranges. - `cd backend-go && TEST_FIRESTORE_REQUIRED=1 make check` passed with Postgres 16 and the Firestore emulator. - Compared both map families to every runtime Python citation in the landed contracts. Replaying merged PR #25791 also matched the new batch projection kill switch. - Repository preflight and `gh pr checks 25810 --watch` passed at head `9554967bf7`. Local preflight skipped the 90-day failure-class ratchet because the checkout is shallow. [Backend Go Checks](https://github.com/BasedHardware/omi/actions/runs/44627579785) ## Product invariants affected none ## Examples from merged PRs ```bash count=$(gh api "repos/BasedHardware/omi/pulls/$PR" --jq .changed_files) gh api --paginate --slurp "repos/BasedHardware/omi/pulls/$PR/files?per_page=100" | jq 'add' | python3 .github/scripts/go_port_tasks.py --pr "$PR" --changed-files "$count" ``` ### PR #25771 ```json [ { "family": "finalization", "title": "Port Python PR #25771 to Go finalization", "body": "Python PR [#25771](#25771) changed `backend/database/conversations.py`, `backend/models/conversation.py`, `backend/utils/conversations/process_conversation.py`, `backend/utils/conversations/render.py`, `backend/utils/conversations/v3/policy.py`. Review the merged diff and port any behavior changes to the Go finalization family under `backend-go/`. Add or update parity coverage for the changed behavior, or record why the Go port needs no change.", "matched_paths": [ "backend/database/conversations.py", "backend/models/conversation.py", "backend/utils/conversations/process_conversation.py", "backend/utils/conversations/render.py", "backend/utils/conversations/v3/policy.py" ] } ] ``` ### PR #25755 ```json [ { "family": "finalization", "title": "Port Python PR #25755 to Go finalization", "body": "Python PR [#25755](#25755) changed `backend/config/merge_before_processing.py`, `backend/models/conversation.py`, `backend/models/structured.py`, `backend/utils/conversations/deterministic_minimum.py`, `backend/utils/conversations/empty_structure_minimum.py`, `backend/utils/conversations/fragment_visibility.py`, `backend/utils/conversations/historical_minimum.py`, `backend/utils/conversations/home_titles.py`, `backend/utils/conversations/merge_conversations.py`, `backend/utils/conversations/process_conversation.py`, `backend/utils/conversations/processing_trigger.py`, `backend/utils/conversations/relevance_salience.py`, `backend/utils/conversations/summary_delivery.py`, `backend/utils/conversations/sync_hold_completion.py`, `backend/utils/episodes/member_notes.py`, `backend/utils/llm/notes_short_clip_policy.py`. Review the merged diff and port any behavior changes to the Go finalization family under `backend-go/`. Add or update parity coverage for the changed behavior, or record why the Go port needs no change.", "matched_paths": [ "backend/config/merge_before_processing.py", "backend/models/conversation.py", "backend/models/structured.py", "backend/utils/conversations/deterministic_minimum.py", "backend/utils/conversations/empty_structure_minimum.py", "backend/utils/conversations/fragment_visibility.py", "backend/utils/conversations/historical_minimum.py", "backend/utils/conversations/home_titles.py", "backend/utils/conversations/merge_conversations.py", "backend/utils/conversations/process_conversation.py", "backend/utils/conversations/processing_trigger.py", "backend/utils/conversations/relevance_salience.py", "backend/utils/conversations/summary_delivery.py", "backend/utils/conversations/sync_hold_completion.py", "backend/utils/episodes/member_notes.py", "backend/utils/llm/notes_short_clip_policy.py" ] } ] ``` ### PR #25686 ```json [ { "family": "finalization", "title": "Port Python PR #25686 to Go finalization", "body": "Python PR [#25686](#25686) changed `backend/utils/conversations/lifecycle.py`, `backend/utils/conversations/process_conversation.py`, `backend/utils/conversations/v3/policy.py`, `backend/utils/conversations/v3/service.py`, `backend/utils/conversations/v3/triggers.py`. Review the merged diff and port any behavior changes to the Go finalization family under `backend-go/`. Add or update parity coverage for the changed behavior, or record why the Go port needs no change.", "matched_paths": [ "backend/utils/conversations/lifecycle.py", "backend/utils/conversations/process_conversation.py", "backend/utils/conversations/v3/policy.py", "backend/utils/conversations/v3/service.py", "backend/utils/conversations/v3/triggers.py" ] } ] ```
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.
What changed and why
Document the Python behavior that the Go rewrite must preserve at admission, takeover, recovery, delivery and deletion. Each contract records Firestore field types and writers, known disagreements and limits of the source evidence. Python references are pinned to
66b026c19946.The review revision covers both settings of the shard-spread flag (B09), record-seal repair (B28), and original WAL custody before decoding (B29). It also corrects five source citations.
Product invariants affected
none
How it was verified
Ran
cd backend-go && make checkwith private Postgres 16 and a required Firestore emulator. The review revision passed the full check on M1 throughbin/omi-heavywith a 12-minute timeout. All 259 source references resolve at the pinned commit. The five corrected citations were checked against the cited code.Tests
The first combined run had two foundation test failures. The batchdocs erase test expected one matching Postgres guard session, and a concurrent queue test lost its connection. The test query at
backend-go/internal/adapters/batchdocs/batchdocs_test.go:172matches across databases on the private test server. An unchanged full rerun passed on a fresh private Postgres 16 server and Firestore emulator.Twelve Python lifecycle-reducer cases exercised F02. Seven retained-audio tail cases exercised B05. The table lists the replay assertions proposed for the Go implementation. These documents add no runtime tests.
Finalization rules and replay assertions
Batch rules and replay assertions
UI evidence
UI-Evidence: none -- documentation only
Failure-Class: none