Skip to content

Prove query recovery, observer safety and relative residue sufficiency - #51

Merged
hyperpolymath merged 1 commit into
mainfrom
codex/query-observer-residue
Nov 7, 2026
Merged

hyperpolymath merged 1 commit into
mainfrom
codex/query-observer-residue

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Source recovery was the only partial-decoder contract. A retained pair can answer a query while losing source distinctions, so this change adds query-relative recovery and states the additional success-to-image obligation separately. Query agreement with any compatible source follows from adequacy; unrestricted image-decision extraction would decide every small type.

The observer laws characterize release invariance on generated pairs under an explicit result observer and source relation. Examples separate redacted and transparent results, and distinguish arbitrary-request status differences from private-source leakage. Residue sufficiency uses total simulation relative to already visible information: retaining the query is least sufficient in that semantic preorder. This makes no bit-cost, runtime, cryptographic or new-type-primitive claim.

Validation:

  • Agda 2.6.4.3: all 31 source modules, 24 intended semantic rejections, five new valid-prefix controls and four mutation controls passed locally.
  • The exact 23-span warning allowance and canonical Echo pins are unchanged. Checked native source/script hashes match the published worktree.
  • Hosted Proof Safety run 42394791959 passed both core/rejection and canonical Echo correspondence jobs on signed head 0a2005007f45b347b9aa102a3f99243265527c1e before this PR was opened.
  • An independent source review removed a redundant success premise and narrowed the arbitrary-request example's interpretation. It is separate from kernel validation.

Full scope and proof ledger: docs/query-recovery.adoc and PROOF-STATUS.adoc. Ordinal work is excluded.

Copilot AI balanced review requested due to automatic review settings November 7, 2026 17:12
@linear-code
linear-code Bot marked this pull request as ready for review November 7, 2026 17:12

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@coderabbitai

coderabbitai Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • New Features
    • Added formal support for query-relative recovery, observer safety and the sufficiency of retained information, with examples covering their guarantees and limitations.
  • Documentation
    • Added an overview of the new concepts and updated verification totals to 31 modules and 24 expected rejections.
  • Tests
    • Expanded checks to cover five additional invalid constructions and confirm that valid prefixes compile.

The change adds Agda definitions and examples for query recovery, observer safety and residue sufficiency. It adds expected-rejection fixtures and updates module inventories, validation checks, documentation and proof-status records.

Changes: Recovery and sufficiency extensions

Layer / File(s) Summary
Query recovery
src/EpistemicTypes/QueryRecovery.agda, src/EpistemicTypes/QueryRecoveryExamples.agda, tests/reject/QueryIgnoresCollision.agda, tests/reject/QuerySuccessInventsSource.agda, docs/query-recovery.adoc
Defines query recovery using retained observation and residue, then relates it to query constancy, image decisions, partial recovery and migration. Examples cover recoverable queries, constant queries and the limits of successful-answer soundness.
Observer safety
src/EpistemicTypes/ObserverSafety.agda, src/EpistemicTypes/ObserverSafetyExamples.agda, tests/reject/ObserverRevealsSecret.agda, tests/reject/OffImageStatusHidden.agda, docs/query-recovery.adoc
Defines observational non-interference and release invariance, with proofs connecting them. Examples distinguish redacted and transparent results, generated-input properties and caller-selected request statuses.
Residue sufficiency
src/EpistemicTypes/ResidueSufficiency.agda, src/EpistemicTypes/ResidueSufficiencyExamples.agda, tests/reject/ForgetfulResidueSufficient.agda, docs/query-recovery.adoc
Defines relative residue reduction, its reflexive and transitive constructions, and its relationships to migration. Examples compare Boolean representations and show that silent visibility cannot supply a Boolean bit.
Corpus integration and receipts
src/EpistemicTypes/All.agda, tests/check-policy.sh, tests/check-rejections.sh, README.adoc, PROOF-STATUS.adoc, docs/query-recovery.adoc
Adds the six modules and five fixtures to the inventories. The rejection check validates each new fixture’s prefix before its expected-rejection marker. The README and proof-status records report the expanded counts and local verification details.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Possibly related PRs

Merge Risk: Minimal · up to 0a200

No concrete issue remains that would prevent merging after normal checks.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title identifies the three main additions: query recovery, observer safety, and relative residue sufficiency.
Description check Passed The description accurately covers the main additions, examples, tests, and stated scope.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
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.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 2 files. (15 skipped: 15 unsupported.)

Finishing Touches

Generate docstrings

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: a1fc37d3-9958-45bc-beaa-0a301362435d
Commits

Reviewing files that changed from the base of the PR and between 6ce8c74 and 0a20050.

Files selected for processing: 17

  • PROOF-STATUS.adoc
  • README.adoc
  • docs/query-recovery.adoc
  • src/EpistemicTypes/All.agda
  • src/EpistemicTypes/ObserverSafety.agda
  • src/EpistemicTypes/ObserverSafetyExamples.agda
  • src/EpistemicTypes/QueryRecovery.agda
  • src/EpistemicTypes/QueryRecoveryExamples.agda
  • src/EpistemicTypes/ResidueSufficiency.agda
  • src/EpistemicTypes/ResidueSufficiencyExamples.agda
  • tests/check-policy.sh
  • tests/check-rejections.sh
  • tests/reject/ForgetfulResidueSufficient.agda
  • tests/reject/ObserverRevealsSecret.agda
  • tests/reject/OffImageStatusHidden.agda
  • tests/reject/QueryIgnoresCollision.agda
  • tests/reject/QuerySuccessInventsSource.agda

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Recent review details

Context from checks skipped due to timeout: 1

  • GitHub Check: CodeRabbit
Additional comments: 13

src/EpistemicTypes/QueryRecovery.agda: 1

1-128: LGTM!

src/EpistemicTypes/QueryRecoveryExamples.agda: 1

1-87: LGTM!

tests/reject/QueryIgnoresCollision.agda: 1

1-23: LGTM!

tests/reject/QuerySuccessInventsSource.agda: 1

1-23: LGTM!

docs/query-recovery.adoc: 1

1-124: LGTM!

README.adoc: 1

12-14: LGTM!

Also applies to: 235-235

src/EpistemicTypes/ObserverSafety.agda: 1

1-71: LGTM!

src/EpistemicTypes/ObserverSafetyExamples.agda: 1

1-73: LGTM!

tests/reject/ObserverRevealsSecret.agda: 1

1-19: LGTM!

tests/reject/OffImageStatusHidden.agda: 1

1-22: LGTM!

src/EpistemicTypes/ResidueSufficiency.agda: 1

21-25: LGTM!

Also applies to: 27-29, 31-37, 41-45, 47-50, 54-57, 59-62, 65-72

src/EpistemicTypes/ResidueSufficiencyExamples.agda: 1

21-22: LGTM!

Also applies to: 24-28, 30-36, 40-41, 45-47, 49-52

tests/reject/ForgetfulResidueSufficient.agda: 1

12-13: LGTM!

Also applies to: 15-19

@hyperpolymath
hyperpolymath merged commit dcd4648 into main Nov 7, 2026
33 checks passed
@hyperpolymath
hyperpolymath deleted the codex/query-observer-residue branch November 7, 2026 17:20
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.

3 participants