Skip to content

Harden RRI handoff app-status invariants - #519

Merged
100yenadmin merged 1 commit into
mainfrom
codex/worldos-rri-handoff-invariants
Jun 1, 2026
Merged

Harden RRI handoff app-status invariants#519
100yenadmin merged 1 commit into
mainfrom
codex/worldos-rri-handoff-invariants

Conversation

@100yenadmin

@100yenadmin 100yenadmin commented Jun 1, 2026

Copy link
Copy Markdown
Member

Summary

  • Harden RRI handoff validation so Mac app handoff evidence must prove the captured /app-status contract, not just the manifest summary.
  • Require app-status snapshots to show worldos.app-status.v1, state_authority=engine, write_lane=/move, and matching build SHA.
  • Add regression coverage for forged viewer-owned state, non-/move write lane, and app-status build mismatch.

Why

The release objective depends on the engine remaining the sole campaign-state writer while the GUI/native app only reads state and submits /move intents. RRI should not accept split Mac handoff evidence unless the captured app-status snapshots prove that invariant directly.

Validation

  • python3 -m pytest qa/test_release_readiness.py -q
  • python3 -m pytest qa/test_release_readiness.py qa/test_app_handoff_gate.py qa/test_export_app_evidence.py -q
  • python3 -m py_compile qa/release_readiness.py
  • git diff --check
  • Local validation of the current 9140cc4 handoff bundle still reports valid=True, gaps=0.

Release note

This is release-gate hardening only. It is not a release verdict.

Summary by CodeRabbit

  • Tests
    • Strengthened release readiness validation with enhanced checks for application status snapshot integrity, state authority verification, and write lane requirements.
    • Added contract test cases to verify handoff bundles properly prove engine authority, move-intent writes, and build SHA validation.

@coderabbitai

coderabbitai Bot commented Jun 1, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: fd7ba6f1-a433-4d18-bcf2-5cf8e70366c3

📥 Commits

Reviewing files that changed from the base of the PR and between 9140cc4 and 88b4ccb.

📒 Files selected for processing (2)
  • qa/release_readiness.py
  • qa/test_release_readiness.py

📝 Walkthrough

Walkthrough

This PR hardens release-readiness validation by adding per-evidence checks for app-status snapshots within handoff JSON. The validation enforces schema compliance, engine state authority, /move write intent, and optional build SHA matching, with supporting test infrastructure updates and three new contract test cases.

Changes

App-status handoff validation

Layer / File(s) Summary
App-status snapshot validation
qa/release_readiness.py
Within validate_handoff_json, added conditional handling for evidence_kind == "app_status_snapshots" that reads snapshot JSON, enforces worldos.app-status.v1 schema, validates state_authority == "engine", ensures write_lane == "/move", and (when --build-sha is set) verifies build.sha matches the expected value, appending evidence gaps on any mismatch.
Test helper infrastructure and payload construction
qa/test_release_readiness.py
Updated write_handoff_bundle method signature to accept optional app_status_overrides parameter, removed app-status.final.json from placeholder generation (now explicitly written), and introduced structured app-status.final.json construction with full payload including state_authority, write_lane, build.sha, and live/action fields.
Validation failure contract tests
qa/test_release_readiness.py
Added three new release-readiness contract test cases validating that native-gate proof fails when handoff app-status does not prove engine authority via state_authority, does not prove /move write intent via write_lane, or contains build.sha mismatch against --build-sha.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • electricsheephq/WorldOS#505: Introduced initial handoff evidence bridge and native-gate validation requirements that this PR builds upon with stricter per-evidence app-status checks.

Poem

🐇 A snapshot truth, engine-bound and true,
The rabbit validates each proof with care—
State authority, write lanes that move,
Build SHAs matched, no tricks in the air,
Release readiness wears its finest share! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Harden RRI handoff app-status invariants' directly describes the main change: strengthening RRI handoff validation by adding app-status invariant checks.
Description check ✅ Passed The description includes a comprehensive Summary section explaining the changes, a Why section providing context, and a Validation section with specific test commands and results. However, the Licensing/CLA section is not addressed.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands and usage tips.

@100yenadmin
100yenadmin marked this pull request as ready for review June 1, 2026 13:08
@100yenadmin

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 1, 2026

Copy link
Copy Markdown
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@100yenadmin
100yenadmin merged commit 7a373cf into main Jun 1, 2026
14 checks passed
@100yenadmin
100yenadmin deleted the codex/worldos-rri-handoff-invariants branch June 1, 2026 13:26
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