Skip to content

proofs: make all modules pass the strict flag set - #45

Merged
hyperpolymath merged 1 commit into
mainfrom
proofs/strict-flag-fixes
Oct 27, 2026
Merged

hyperpolymath merged 1 commit into
mainfrom
proofs/strict-flag-fixes

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Summary

This PR fixes the three --exact-split sites that failed the strict Agda flag set. These are clause splits and reorderings only. No theorem statements change.

The strict set:

  • In each file's OPTIONS pragma: --safe --without-K --cubical-compatible --exact-split --no-sized-types --no-guardedness.
  • On the command line: --double-check -W error -W noUnsupportedIndexedMatch.
File Fix
Kripke/Residual.agda (Is) List all 9 constructor pairs instead of Is b b = ⊤; Is _ _ = ⊥.
EchoBridge.agda (≤G-trans) Put the _ top≤ clause first.
ProofTransportExample.agda (checkPayload) Put the _ ImpossibleClaim _ clause first.

Verification

  • Checked locally on Agda 2.6.3 with stdlib from source, the only version this sandbox has.
  • agda --no-libraries -i src src/EpistemicTypes/All.agda exits 0.
  • Strict sweep, every module compiled on its own with the strict set: 22/22 modules, 0 failing sites.

The repo pins Agda 2.6.4.3, so this PR's CI run is the check on the real toolchain. The clause shapes involved behave the same way under --exact-split in both versions.


Generated by Claude Code

Fixes the sites the strict-flag survey found:

- Kripke.Residual.Is: list all nine constructor pairs instead of ending
  in a catch-all. The values are unchanged.
- EchoBridge.≤G-trans: put the top≤ clause first, so the case tree
  splits on the second argument before the first.
- ProofTransportExample.checkPayload: put the ImpossibleClaim clause
  first, for the same reason.

Each function computes the same values on constructor arguments; the
changes only make every clause hold definitionally.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MF5GeeBBDF6sUzr6pZTjWV
@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

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: a925d173-e74d-49a3-951d-fa05eddd9d42
Commits

Reviewing files that changed from the base of the PR and between 9a7d21d and 039c000.

Files selected for processing: 3
  • src/EpistemicTypes/EchoBridge.agda
  • src/EpistemicTypes/Kripke/Residual.agda
  • src/EpistemicTypes/ProofTransportExample.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: 3
  • GitHub Check: Canonical Echo correspondence
  • GitHub Check: Proof core and rejection controls
  • GitHub Check: analyze (actions, none)
Additional comments: 3
src/EpistemicTypes/EchoBridge.agda: 1

168-168: LGTM!

src/EpistemicTypes/Kripke/Residual.agda: 1

48-50: LGTM!

Also applies to: 52-55

src/EpistemicTypes/ProofTransportExample.agda: 1

31-31: LGTM!

📝 Summary

Summary by CodeRabbit

Refactor

  • Updated internal proof-case handling, making certain cases explicit and adjusting their order. Existing outcomes are preserved, including the treatment of false cases. These changes are limited to internal verification logic and do not alter functionality visible to users.

The pull request adjusts pattern clauses in three Agda definitions. The stated truth values and returned results remain unchanged.

Changes: Agda clause updates

Layer / File(s) Summary
Pattern clause adjustments
src/EpistemicTypes/EchoBridge.agda, src/EpistemicTypes/Kripke/Residual.agda, src/EpistemicTypes/ProofTransportExample.agda
≤G-trans uses a catch-all clause for a second proof of top≤. Is uses explicit clauses for false cases. checkPayload places ImpossibleClaim before the ArtifactIsTrue cases. The described results remain unchanged.

Priority: Low

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Refactor

Merge Risk: Minimal · up to 039c0

The clause changes preserve the inspected behavior, with no actionable merge-blocking risk identified.

Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title clearly identifies the main change: updating proofs so all modules pass the strict flag set.
Description check Passed The description directly explains the three clause changes, the strict Agda flags, and the reported verification results.
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.
  • 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

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

@linear-code
linear-code Bot marked this pull request as ready for review October 26, 2026 22:20
@hyperpolymath
hyperpolymath enabled auto-merge (squash) October 26, 2026 22:27
@coderabbitai

coderabbitai Bot commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Add Carrot credits or activate Agent usage billing to use Autofix

@hyperpolymath
hyperpolymath merged commit 55815f3 into main Oct 27, 2026
7 checks passed
@hyperpolymath
hyperpolymath deleted the proofs/strict-flag-fixes branch October 27, 2026 00:10
hyperpolymath added a commit that referenced this pull request Oct 27, 2026
## Summary

#45 made the code compatible with the strict Agda flag set. This PR
declares the flags in the files. `--cubical-compatible` is coinfective:
a module that declares it may only import modules that also declare it.
So choreographic-types cannot adopt the strict set while the
epistemic-types modules it imports lack the flag.

- **All 22 source modules and all 13 rejection fixtures:** the `OPTIONS`
pragma gains `--cubical-compatible --exact-split --no-sized-types
--no-guardedness`, keeping `--safe --without-K`.
- **`tests/check-proofs.sh` and `tests/check-rejections.sh`:** both now
also pass `-W noUnsupportedIndexedMatch`.
- Under `--cubical-compatible`, Agda emits an `UnsupportedIndexedMatch`
warning at 23 clauses that match on indexed constructors. It means those
functions would not compute on Cubical transports.
- That is irrelevant under `--without-K`. The estate strict set silences
it, as agda-stdlib's own library file does.
- Both scripts run with `-W error`, so without the flag the warning
would be fatal.
  - Sites:
    - `Applications/IntegerModel`: 3
    - `Applications/SortedRow`: 2
    - `ContinuityExamples`: 1
    - `EchoBridge`: 2
    - `Examples`: 1
    - `Kripke/Belief`: 1
    - `Kripke/Dependence`: 1
    - `Kripke/Residual`: 1
    - `ProofTransport`: 6
    - `ReadConsistency`: 2
    - `SurrealBridge`: 3
- **`tests/integration/CanonicalEcho.agda` is unchanged.** It imports
echo-types at pin `46cd1a3`, whose modules do not yet declare the flag.
A file without the flag may still import ones that have it, so it keeps
building. Add the flag after the pin moves to an echo-types commit that
carries hyperpolymath/echo-types#357's change.

## Verification (Agda 2.6.3 locally; CI checks the pinned 2.6.4.3)

- `tests/check-proofs.sh`: PASS, 22 source modules.
- `tests/check-rejections.sh`: PASS, all 13 rejected for the expected
type mismatch.
- `CanonicalEcho.agda`, built against echo-types `46cd1a3` exactly as
the workflow does: compiles.

---
_Generated by [Claude
Code](https://claude.ai/code/session_01MF5GeeBBDF6sUzr6pZTjWV)_

Co-authored-by: Claude <noreply@anthropic.com>
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.

2 participants