Skip to content

proofs: declare the strict flag set in every module that can take it - #357

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

hyperpolymath merged 1 commit into
mainfrom
proofs/strict-pragmas

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Summary

#355 made the code compatible with the strict Agda flag set. This PR declares the flags in the files, which is what downstream repos need.

--cubical-compatible is coinfective: a module that declares it may only import modules that also declare it. choreographic-types imports experimental/echo-additive/Grade.agda, and through it EchoGraded, Echo, EchoCharacteristic and EchoResidue. It cannot adopt the strict set until these modules declare the flag.

  • 141 modules: the OPTIONS pragma gains --cubical-compatible --exact-split --no-sized-types --no-guardedness, keeping --safe --without-K.

  • 6 modules left unchanged:

    Module Why
    EchoCNOBridge, EchoThermodynamicsArbitrary Import absolute-zero's CNO, which does not declare --cubical-compatible yet
    All, Smoke Import those two
    EchoImageFactorizationPropCubical The --cubical island
    EchoImageFactorizationPropPostulated The quarantined postulate block

    A module without the flag may still import modules that have it, so these all keep building. Once absolute-zero lands the flag, a follow-up adds it to the first four.

  • scripts/kernel-guard.sh: the safety-relaxing-flag check matched the substring --cubical inside --cubical-compatible, which strengthens safety rather than relaxing it. It now matches whole flags only.

Verification (Agda 2.6.3, stdlib 2.3)

  • Every CI root compiles with --ignore-interfaces:
    • All
    • Smoke
    • characteristic/All
    • examples/All
    • experimental/echo-additive/All
  • tutorial/All compiles.
  • scripts/kernel-guard.sh: PASS. Negative controls: planting --cubical, --sized-types or --guardedness in Echo.agda still fails the guard.
  • tools/check-guardrails.sh: OK (137 modules).
  • A trial build of choreographic-types with these pragmas, plus strict pragmas on resource-algebra and epistemic-types, passes all of its gates: 17 modules, 5 rejections, and the minimal-laws certificate.

Companion PR: epistemic-types (same change).


Generated by Claude Code

Adds --cubical-compatible --exact-split --no-sized-types --no-guardedness
to the OPTIONS pragma of 141 modules, keeping --safe --without-K. #355
made the code compatible; this declares it, so downstream repos that
adopt the strict set (choreographic-types, through
experimental/echo-additive/Grade.agda) can import these modules:
--cubical-compatible is coinfective.

Left unchanged, for these reasons:
- EchoCNOBridge, EchoThermodynamicsArbitrary: import absolute-zero's CNO,
  which does not declare --cubical-compatible yet.
- All, Smoke: import those two.
- EchoImageFactorizationPropCubical (--cubical island) and
  EchoImageFactorizationPropPostulated (quarantined postulate): exempt.

scripts/kernel-guard.sh: the safety-relaxing-flag check matched
`--cubical` inside `--cubical-compatible`. It now matches whole flags
only. Planting --cubical, --sized-types or --guardedness in Echo.agda
still fails it.

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

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Too many files!

This PR contains 142 files, which is 42 over the limit of 100.

To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch.

Upgrade to a paid plan to raise the limit.

This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry.

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: 74a8d26a-6738-4876-8f54-151b35bea103
Commits

Reviewing files that changed from the base of the PR and between 1939e7e and f4600da.

Files selected for processing: 142
  • proofs/agda/AntiEcho.agda
  • proofs/agda/AntiEchoTropical.agda
  • proofs/agda/AntiEchoTropicalGeneric.agda
  • proofs/agda/Dyadic.agda
  • proofs/agda/DyadicEchoBridge.agda
  • proofs/agda/Echo.agda
  • proofs/agda/Echo/Index/ThinPoset.agda
  • proofs/agda/Echo/Measure/Examples.agda
  • proofs/agda/Echo/Measure/Interface.agda
  • proofs/agda/Echo/Modality/Core.agda
  • proofs/agda/Echo/Modality/Interface.agda
  • proofs/agda/Echo/Separation/NotResourceInstance.agda
  • proofs/agda/EchoAbstractionBarrier.agda
  • proofs/agda/EchoAccess.agda
  • proofs/agda/EchoAggregation.agda
  • proofs/agda/EchoApprox.agda
  • proofs/agda/EchoApproxInstance.agda
  • proofs/agda/EchoBitNarrowingNumeric.agda
  • proofs/agda/EchoCanonicalIdentitySuite.agda
  • proofs/agda/EchoCategorical.agda
  • proofs/agda/EchoCharacteristic.agda
  • proofs/agda/EchoChoreo.agda
  • proofs/agda/EchoCost.agda
  • proofs/agda/EchoCostInstance.agda
  • proofs/agda/EchoDecidable.agda
  • proofs/agda/EchoDecorationBridge.agda
  • proofs/agda/EchoDecorationStructure.agda
  • proofs/agda/EchoDeniability.agda
  • proofs/agda/EchoDifferential.agda
  • proofs/agda/EchoDisplayed.agda
  • proofs/agda/EchoEntropy.agda
  • proofs/agda/EchoEphapaxBridge.agda
  • proofs/agda/EchoEpistemic.agda
  • proofs/agda/EchoEpistemicResidue.agda
  • proofs/agda/EchoExampleAbsInt.agda
  • proofs/agda/EchoExampleBitNarrowing.agda
  • proofs/agda/EchoExampleParser.agda
  • proofs/agda/EchoExampleProvenance.agda
  • proofs/agda/EchoExampleSignAnalysis.agda
  • proofs/agda/EchoExampleTruncation.agda
  • proofs/agda/EchoExamples.agda
  • proofs/agda/EchoFiberBridge.agda
  • proofs/agda/EchoFiberCount.agda
  • proofs/agda/EchoFiberTriangulation.agda
  • proofs/agda/EchoFidelity.agda
  • proofs/agda/EchoGraded.agda
  • proofs/agda/EchoGradedComonad.agda
  • proofs/agda/EchoGradedComonadF1.agda
  • proofs/agda/EchoGradedComonadInstance1.agda
  • proofs/agda/EchoGradedComonadInstance2.agda
  • proofs/agda/EchoGradedComonadInterface.agda
  • proofs/agda/EchoHaplotypeCollapsing.agda
  • proofs/agda/EchoImageFactorization.agda
  • proofs/agda/EchoImageFactorizationProp.agda
  • proofs/agda/EchoIndexed.agda
  • proofs/agda/EchoIntegration.agda
  • proofs/agda/EchoJanusBridge.agda
  • proofs/agda/EchoKernel.agda
  • proofs/agda/EchoLLEncoding.agda
  • proofs/agda/EchoLinear.agda
  • proofs/agda/EchoLossTaxonomy.agda
  • proofs/agda/EchoNoSectionGeneric.agda
  • proofs/agda/EchoOFSUnivF5.agda
  • proofs/agda/EchoOFSUnivF5Diag.agda
  • proofs/agda/EchoOFSUnivF5Iso.agda
  • proofs/agda/EchoObservationalEquivalence.agda
  • proofs/agda/EchoOrdinal.agda
  • proofs/agda/EchoOrthogonalFactorizationSystem.agda
  • proofs/agda/EchoProbabilisticSupport.agda
  • proofs/agda/EchoProvenance.agda
  • proofs/agda/EchoPullback.agda
  • proofs/agda/EchoPullbackUnivF4.agda
  • proofs/agda/EchoRelModel.agda
  • proofs/agda/EchoRelational.agda
  • proofs/agda/EchoResidue.agda
  • proofs/agda/EchoResidueCell.agda
  • proofs/agda/EchoResidueTaxonomy.agda
  • proofs/agda/EchoReversibilityBridge.agda
  • proofs/agda/EchoScope.agda
  • proofs/agda/EchoSearch.agda
  • proofs/agda/EchoSearchExample.agda
  • proofs/agda/EchoSearchInstance.agda
  • proofs/agda/EchoSecurity.agda
  • proofs/agda/EchoSelectiveProjection.agda
  • proofs/agda/EchoSeparating.agda
  • proofs/agda/EchoStabilityTests.agda
  • proofs/agda/EchoStepNDModelF2.agda
  • proofs/agda/EchoThermoCollapseImpossible.agda
  • proofs/agda/EchoThermodynamics.agda
  • proofs/agda/EchoThermodynamicsFinite.agda
  • proofs/agda/EchoTotalCompletion.agda
  • proofs/agda/EchoTransaction.agda
  • proofs/agda/EchoTropical.agda
  • proofs/agda/EchoTruncation.agda
  • proofs/agda/EchoVariance.agda
  • proofs/agda/MinimalCNO.agda
  • proofs/agda/NarrowingSmoke.agda
  • proofs/agda/Ordinal/Buchholz/Syntax.agda
  • proofs/agda/Ordinal/OmegaMarkers.agda
  • proofs/agda/SimpleTest.agda
  • proofs/agda/VecRotation.agda
  • proofs/agda/WorkingCNO.agda
  • proofs/agda/characteristic/All.agda
  • proofs/agda/characteristic/ChoreoInjective.agda
  • proofs/agda/characteristic/IntegrationAudit.agda
  • proofs/agda/characteristic/InteractionTest.agda
  • proofs/agda/characteristic/ModeGraded.agda
  • proofs/agda/characteristic/N5Falsifier.agda
  • proofs/agda/characteristic/NonTruncatable.agda
  • proofs/agda/characteristic/RecipeNonTriviality.agda
  • proofs/agda/characteristic/RecipeSpec.agda
  • proofs/agda/characteristic/RecipeTheorem.agda
  • proofs/agda/characteristic/RoleGraded.agda
  • proofs/agda/characteristic/RoleMode.agda
  • proofs/agda/characteristic/RoleModeGrade.agda
  • proofs/agda/characteristic/RoleRole.agda
  • proofs/agda/characteristic/VisibleConstraintAudit.agda
  • proofs/agda/examples/All.agda
  • proofs/agda/examples/EchoVsSigma.agda
  • proofs/agda/examples/EpistemicUpdate.agda
  • proofs/agda/examples/LinearErasure.agda
  • proofs/agda/examples/Transport.agda
  • proofs/agda/examples/TropicalArgmin.agda
  • proofs/agda/experimental/echo-additive/All.agda
  • proofs/agda/experimental/echo-additive/Grade.agda
  • proofs/agda/experimental/echo-additive/GradedAdjunction.agda
  • proofs/agda/experimental/echo-additive/GradedCarrier.agda
  • proofs/agda/experimental/echo-additive/GradedCarrierFaithful.agda
  • proofs/agda/experimental/echo-additive/GradedComonad.agda
  • proofs/agda/experimental/echo-additive/GradedMonad.agda
  • proofs/agda/experimental/echo-additive/VarianceGate.agda
  • scripts/kernel-guard.sh
  • tutorial/All.agda
  • tutorial/epistemic_erasure/All.agda
  • tutorial/epistemic_erasure/EpistemicErasure.agda
  • tutorial/epistemic_erasure/Smoke.agda
  • tutorial/provenance_debugging/All.agda
  • tutorial/provenance_debugging/ProvenanceDebugging.agda
  • tutorial/provenance_debugging/Smoke.agda
  • tutorial/region_exit_audit/All.agda
  • tutorial/region_exit_audit/RegionExitAudit.agda
  • tutorial/region_exit_audit/Smoke.agda

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 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.

@hyperpolymath
hyperpolymath marked this pull request as ready for review October 27, 2026 03:39
@hyperpolymath
hyperpolymath enabled auto-merge (squash) October 27, 2026 03:39
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 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-10-27T03:41:27.602491Z f4600da Draft marked ready
ℹ️ 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.

hyperpolymath added a commit to hyperpolymath/epistemic-types 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>
@hyperpolymath
hyperpolymath merged commit 1073d60 into main Oct 27, 2026
9 checks passed
@hyperpolymath
hyperpolymath deleted the proofs/strict-pragmas branch October 27, 2026 03:49
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