Skip to content

SCA-4262: Fence speaker evidence writes at account erasure - #26259

Merged
Git-on-my-level merged 2 commits into
mainfrom
agent/omi-control-release-sol/f39569167518
Nov 25, 2026
Merged

Git-on-my-level merged 2 commits into
mainfrom
agent/omi-control-release-sol/f39569167518

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

Release intake for SCA-4262. Publishes the supplied bundle unchanged at 0b8fb21.

The evidence-write transaction reads the account deletion marker. Account erasure repeats the conversation evidence sweep after deleting the user root to catch late children and evidence under missing parents.

Intake reports three Firestore emulator regressions and 64 focused unit tests passed on this commit. Independent review and required CI are pending.

View guided diff Turn on auto-fix

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-24T18:38:44.020500Z
We couldn’t complete this review. Comment @codex review to try again.
0b8fb21 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@Git-on-my-level
Git-on-my-level merged commit ac6f6ae into main Nov 25, 2026
66 checks passed
@Git-on-my-level
Git-on-my-level deleted the agent/omi-control-release-sol/f39569167518 branch November 25, 2026 04:59
Git-on-my-level added a commit that referenced this pull request Nov 25, 2026
…e (SCA-4276) (#26289)

## Root cause

#26259 (0b8fb21) added a customer data-plane sweep for late
speaker-evidence children to `purge_user_subtree`. The People generation
inventory hashes the function's full AST because the function calls
`generation_ref`. The existing fingerprint was still the exact digest of
the pre-#26259 body. Running the changed-file selector with the paths
from 0b8fb21 omitted `test_people_generation_inventory.py`. The
selector returns zero backend test files for this JSON-only refresh, so
the focused commands below explicitly include the People inventory
guard.

Refresh the single `purge_user_subtree` fingerprint in
`backend/docs/people-generation-writers.json`. The People subtree
deletion still batches People rows with a same-owner generation bump,
then drops the generation head after deleting those rows. The
speaker-evidence writer `store_evidence.persist` reads the account
deletion marker and the parent conversation in the write transaction.
The account purge sweeps its `speaker_evidence` child collection on the
same data plane, including when a parent is already missing on retry.
The audit found no writer without an erasure path.

## Verification

On rebased main (`f719b0564036`), `bash backend/test.sh
test_people_generation_inventory.py` reported 1 failure and 4 passes:

```text
tests/unit/test_people_generation_inventory.py::test_current_people_scopes_match_the_reviewed_writer_enumeration
AssertionError: People writer scope needs generation re-audit: {'new': [], 'removed': [], 'changed': ['backend/database/user_data_deletion.py:purge_user_subtree']}
```

The separate lifecycle inventory and its direct and transitive test
consumers passed on main (2,502 passed, 1 skipped, 86 expected
failures). After refreshing the People fingerprint, the following run
reported 3,278 passed, 1 skipped, and 86 expected failures, including
all 5 People inventory cases:

```sh
timeout -k 10s 300s /Users/david/workspace/omi-workspace/bin/omi-heavy run -- \
  env REDIS_DB_HOST=127.0.0.1 REDIS_DB_PORT=1 OMI_ENV_STAGE=offline \
  bash backend/test.sh \
    test_people_generation_inventory.py test_lifecycle_state_table_writers.py \
    test_batch_census_registry.py test_lifecycle_properties_wiring.py test_summary_refusal_writers.py \
    test_backfill_clear_refused_summary_due.py test_lifecycle_invariants.py test_batch_held_contract.py \
    test_fsr_people_generation.py test_speaker_evidence_storage.py test_retired_list_projection.py \
    test_batch_pipeline_privacy.py test_batch_account_authority_writers.py test_held_content_deletion.py \
    test_memory_retraction_source_index.py test_action_item_port_fence.py
```

With an owned loopback Firestore emulator, ran the following from
`backend/` inside `timeout -k 10s 180s
/Users/david/workspace/omi-workspace/bin/omi-heavy run --`:

- `PYTHONPATH=. .venv/bin/python
scripts/fsr_people_generation_emulator_test.py` passed all 31 People
generation checks.
- `BACKEND_PYTEST_MARK_EXPR=integration bash test.sh
tests/integration/test_speaker_evidence_erasure.py` passed all 3 cases.

`make preflight` passed 16 checks. `scripts/pr-preflight --pr-body-file
/tmp/sca-4276-pr.md` passed. Both ran through bounded `omi-heavy`
invocations.

Refs SCA-4276
Git-on-my-level added a commit that referenced this pull request Nov 26, 2026
…#26311)

## What changed and why

SCA-4262 adds the production readback for the speaker-evidence erasure
fence shipped in #26259. Every acknowledged write reports the marker bit
returned by its committing transaction. Marker refusals and other
terminal transaction failures are counted once after retries.

The post-root sweep retains its customer-plane evidence collection
references, including those under missing parents. It verifies them
after the last delete, exhausting one name-only list per reference. A
complete list with survivors increments checked and raises for erasure
retry. A later page failure preserves every survivor already observed
and increments failed. Setting
`SPEAKER_EVIDENCE_ERASURE_CHECK_ENABLED=false` skips the additional
reads and increments disabled after a successful sweep.

## Production readback

Filter the Backend counters to the instrumented `revision`
(`K_REVISION`). Record the SHA and a full UTC hour at 100% traffic.
Confirm instance scrape coverage and use reset-adjusted increases per
instance before summing. All nine series initialize at startup.

- `omi_speaker_evidence_fence_total` reports refusals, failures, and
acknowledged commits. Add `committed_marker_absent` and
`committed_marker_present` for the commit denominator. Require positive
`refused_marker_present` and zero `committed_marker_present`. Bypassed
writers and a process lost between commit acknowledgement and emission
fall outside this measurement.
- `omi_speaker_evidence_erasure_total` reports `started`, `checked`,
`failed`, and `disabled`. Reconcile started attempts with terminal
outcomes, accounting for attempts crossing the window boundary. Require
positive completed checks and zero
`omi_speaker_evidence_remaining_total` increase. Failed and disabled
attempts contribute no verified coverage. Report them explicitly.

## Product invariants affected

none

## How it was verified

On m1 through `bin/omi-heavy` with bounded timeouts:

- `bash backend/test.sh test_speaker_evidence_storage.py
test_speaker_evidence_sweep.py test_conversation_tombstones.py
test_batch_pipeline_privacy.py` passed 43 tests.
- `pytest -q tests/integration/test_speaker_evidence_erasure.py` passed
all three tests on a dedicated loopback Firestore emulator.
- A fresh Backend metrics registry with a synthetic revision exported
all nine expected series at zero before any write or sweep.
- The repository pre-push gate passed, including the local PR preflight.

## Tests

The regressions exercise a transaction expiry followed by marker
refusal, both commit classifications, empty and multi-reference sweeps,
partial page failure after a survivor, parent-list failure, disabled
verification, and erasure retry under missing parents.

UI-Evidence: none -- Backend instrumentation

Line-Count-Exception: backend/utils/metrics.py | 1832 -> 1835 | Import
the counter module alongside the existing eager metric registrations so
every instance exports zeros before its first transaction.


<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/26311?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="View guided diff"
src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a>
<a
href="https://www.cubic.dev/action/auto-fix/pr/BasedHardware/omi/26311?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F26311&source=description"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"><img
alt="Turn on auto-fix"
src="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant