Skip to content

test(backend): distinguish live custody from orphan recovery - #24629

Merged
Git-on-my-level merged 4 commits into
mainfrom
lane/lcinv-b2
Nov 4, 2026
Merged

Git-on-my-level merged 4 commits into
mainfrom
lane/lcinv-b2

Conversation

@Git-on-my-level

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

Copy link
Copy Markdown
Member

What changed and why

Exercise lifecycle transitions through the shared Firestore simulator: expired admission schedules must reach a durable transcript and summary, and stored facts must derive the intended capturing/sealed/settled shadows. A late worker result after early finalization must increment a pending durable enrichment outbox with a token and finite due time. The negative control rejects an unchanged outbox.

Generated fair-use escalation/read schedules reach the base after #24531. Producer-custody controls follow the owner-confirmed no-TTL contract: old live tokens survive recovery, another session cannot clear them, exact finish can, and proven-dead repair requires retained-tail evidence. The table keeps separate live/orphan rows and documented exemptions, with monitoring obligations preserved and negative controls preventing other automatic states from borrowing exemptions.

Add a scoped extra-test-module argument and explicitly pass it from the existing listen/pusher CI tail. The default target list remains the original WP-A module. Released WP-A owner uicleanup authorized this seam and the assertion-only correction of its obsolete job-generation xfail; it now accepts the actual outbox rearm. Fixture implementations are unchanged. The conservative inventory also registers seven new upstream evaluation-response payloads.

Product invariants affected

none

How it was verified

The canonical seven-file backend unit gate passed 998 tests with 68 clause-specific strict xfails. The final combined Firestore simulator passed 10 tests with 3 strict xfails. With xfail disabled, exactly the same three final LifecycleInvariantError cases failed, all ten controls passed, and there were no setup errors or skips. Timing/slot limits stayed unchanged.

The three runtime gaps still wait on no-job-after-seal recovery, failed-upload re-entry, and completing a conversation while audio custody is open. Reasons retain their repair owners. Producer age is not a failing clause: live/orphan custody exemptions are explicit and monitoring gaps remain strict.

All local checks use the workspace heavy wrapper, nice -n 19, serial execution and isolated emulator authority. Credential/project variables are unset. Pure unit file-list input: data/run-2026-11-04-lifecycle-invariants/evidence/backend-b2-unit-files.txt in omi-workspace.

bash backend/testing/lifecycle_sim/run.sh --keep --extra-test-module testing/lifecycle_properties/test_properties.py

Run through bin/omi-heavy run -- nice -n 19 from the workspace, with the simulator's private HOME/config/cache. The final combined scenario-runner wall time was 116.667s and B2 case/setup time was 11.196s. An initial same-source comparison measured 69.072s without B2 versus 74.999s with B2 (+5.927s), before the final custody refinement. Host load and upstream source changed afterward; a final paired baseline refresh is tracked before merge. The added-time budget is approximately 60s (owner ruling 1994ce).

Tests

Real admission/result/projection/outbox transactions; derived phase shadows; generated quiet-read ladders; exact-token and proven-dead custody; unchanged-outbox negative case; no-argument and explicit CLI collection; scoped target refusal; selector coverage; four-clause table and exemption guards.

UI evidence

UI-Evidence: none -- test infrastructure only

Failure class (fixes)

Failure-Class: none

New guards

The existing PR-gated lifecycle tail collects the new property module. Strict legacy failures accept only their final LifecycleInvariantError. Source/table monitoring gaps remain clause-specific strict xfails. An early completion bit alone is permitted; the checked temporal obligation is durable titling rearm when late results commit.

Tracking

Owner: lcinv. ANX card:lcinv-lifecycle-invariants, capture initiative; remote updates remain assigned to uicleanup's pending queue while ANX is unavailable. Dated evidence: data/run-2026-11-04-lifecycle-invariants/README.md in omi-workspace. B2 go 006899; shared seam 4ac9fd/1994ce; WP-A assertion 3fe98b; producer custody 7a6181/4bf62d. No product/workflow/flag/cloud changes. Deploy needed: none. Normal Luna review and exact-head green/CLEAN are required before canonical merge.

View guided diff Turn on auto-fix

…rties

Reuse the lifecycle simulator through an explicit hermetic test target.
Cover real capture transitions, persisted phase shadows, durable late-result
outbox rearm, generated fair-use downward schedules and producer custody.

Correct the earlier synthetic ordering premise at result commit and accept
actual outbox rearm in the released WP-A assertion. Shared test-runner and
assertion edits are authorized by owner rulings 4ac9fd, 1994ce and 3fe98b.
Producer safety follows the no-TTL owner contract in 7a6181.
Keep upstream integration separate from the B2 custody-model follow-up.
No task-authored product or workflow changes are included.
Apply owner ruling 4bf62d: producer custody has no TTL. Retain the live
capture row with exact-token finish and documented scoped exemptions; add
a proven-dead orphan view with the automatic full-tail proof-repair exit.
Both keep their monitoring obligations and clause-specific expected gaps.

Reject exemption borrowing by automatic states. Register seven reviewed
upstream evaluation-response payloads after main integration.

Validation: canonical targeted unit gate998 passed/68 strict xfails;
combined emulator10 passed/3 strict xfails. Unmasked run has exactly the
same three final LifecycleInvariantErrors and ten green controls.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-04T19:34:14.560497Z e015bf1 New commits
ℹ️ 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.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 13 files

Confidence score: 4/5

  • The README link in backend/testing/lifecycle_properties/README.md points to an artifact that isn’t in the repository, so readers can’t verify the documented timing and ownership. Add the artifact or update/remove the link.
  • pytest_entry.py consumes --help and -h, preventing pytest’s help from reaching users. Disable argparse’s help so those flags pass through.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="backend/testing/lifecycle_properties/README.md">

<violation number="1" location="backend/testing/lifecycle_properties/README.md:42">
P3: This README links to `data/run-2026-11-04-lifecycle-invariants/README.md`, but that file is not included in the repository. Add the referenced artifact or remove/update the link so the documented timing and ownership evidence is accessible.</violation>
</file>

<file name="backend/testing/lifecycle_sim/pytest_entry.py">

<violation number="1" location="backend/testing/lifecycle_sim/pytest_entry.py:23">
P3: The new parser consumes `--help`/`-h` and exits with its own usage, so pytest's help no longer reaches the user. Disable argparse's help so these flags pass through to pytest.</violation>
</file>

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

the default target, explicit forwarding, scoped path refusal and selector.

Local timing evidence and remaining fix ownership are recorded in the workspace
`data/run-2026-11-04-lifecycle-invariants/README.md`. The added module must stay

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: This README links to data/run-2026-11-04-lifecycle-invariants/README.md, but that file is not included in the repository. Add the referenced artifact or remove/update the link so the documented timing and ownership evidence is accessible.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At backend/testing/lifecycle_properties/README.md, line 42:

<comment>This README links to `data/run-2026-11-04-lifecycle-invariants/README.md`, but that file is not included in the repository. Add the referenced artifact or remove/update the link so the documented timing and ownership evidence is accessible.</comment>

<file context>
@@ -0,0 +1,44 @@
+the default target, explicit forwarding, scoped path refusal and selector.
+
+Local timing evidence and remaining fix ownership are recorded in the workspace
+`data/run-2026-11-04-lifecycle-invariants/README.md`. The added module must stay
+within the lead's approximately 60-second PR-tail budget. `--runxfail` is for a
+local red-reason audit and is not added to the CI invocation.
</file context>



def main(argv=None):
parser = argparse.ArgumentParser()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: The new parser consumes --help/-h and exits with its own usage, so pytest's help no longer reaches the user. Disable argparse's help so these flags pass through to pytest.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At backend/testing/lifecycle_sim/pytest_entry.py, line 23:

<comment>The new parser consumes `--help`/`-h` and exits with its own usage, so pytest's help no longer reaches the user. Disable argparse's help so these flags pass through to pytest.</comment>

<file context>
@@ -10,7 +11,18 @@
+
+
+def main(argv=None):
+    parser = argparse.ArgumentParser()
+    parser.add_argument('--extra-test-module', action='append', type=extra_test_module_path, default=[])
+    args, pytest_args = parser.parse_known_args(sys.argv[1:] if argv is None else argv)
</file context>
Suggested change
parser = argparse.ArgumentParser()
parser = argparse.ArgumentParser(add_help=False)

Resolve the evaluation-response inventory tuple with main's formatting.
Both sides declare the same site; the resulting inventory equals main.
@Git-on-my-level
Git-on-my-level merged commit e1d80bf into main Nov 4, 2026
58 checks passed
@Git-on-my-level
Git-on-my-level deleted the lane/lcinv-b2 branch November 4, 2026 19:56
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