Skip to content

proofs: make the repo's own modules pass the strict flag set - #355

Merged
hyperpolymath merged 3 commits into
mainfrom
proofs/strict-flag-fixes
Oct 27, 2026
Merged

hyperpolymath merged 3 commits into
mainfrom
proofs/strict-flag-fixes

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Summary

This PR fixes the four echo-types sites that failed the strict Agda flag set. No theorem statements change. These are clause splits plus one stdlib rename.

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 Flag Fix
EchoExampleParser.agda (parses-aux) --exact-split Move the LP clause first so the case tree splits on the token first.
EchoExampleParser.agda (second-token) --exact-split Replace the catch-all with explicit [] and (_ ∷ []) clauses. This site was hidden behind the parses-aux failure.
EchoTropical.agda (_⊕_) --exact-split m ⊕ zero = m becomes suc m ⊕ zero = suc m.
EchoBitNarrowingNumeric.agda -W error Replace the deprecated stdlib ≤-step with m≤n⇒m≤1+n.

Verification (Agda 2.6.3, stdlib 2.3)

  • agda proofs/agda/All.agda and agda proofs/agda/Smoke.agda both exit 0 under the repo's current flags.

  • scripts/kernel-guard.sh PASS. tools/check-guardrails.sh OK (137 modules).

  • Strict sweep, every module compiled on its own with the strict set: 2 sites remain, both outside this repo:

    • EchoCNOBridge.agda:35
    • EchoThermodynamicsArbitrary.agda:76

    Both import absolute-zero's CNO, which does not declare --cubical-compatible. That flag is coinfective: a module using it can only import modules that also use it. So the fix belongs in absolute-zero, not here.

This PR does not add the strict pragmas to the repo's files. It only makes the code compatible with them.


Generated by Claude Code

Fixes the repo-side sites the strict-flag survey found:

- EchoExampleParser.parses-aux: the LP clause takes a variable depth
  but came after clauses that split on the depth, so --exact-split
  rejected it. Put it first, so the case tree splits on the token
  first. The function is unchanged.
- EchoTropical._⊕_: the clause `m ⊕ zero = m` overlapped `zero ⊕ n`.
  It is now `suc m ⊕ zero = suc m`; the two agree at zero.
- EchoBitNarrowingNumeric: stdlib's deprecated ≤-step, fatal under
  -W error, is replaced by m≤n⇒m≤1+n.

Remaining strict failures, outside this repo: EchoCNOBridge and
EchoThermodynamicsArbitrary import absolute-zero's CNO, which does not
declare --cubical-compatible. That fix belongs in absolute-zero.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MF5GeeBBDF6sUzr6pZTjWV
The strict re-sweep found one more site that the earlier parses-aux
failure had masked: second-token's catch-all clause. List its two
short-list cases explicitly. Behaviour is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MF5GeeBBDF6sUzr6pZTjWV
@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 27 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

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: 949e73e2-21d0-4e3d-95dc-9ba8497f7c20
Commits

Reviewing files that changed from the base of the PR and between 3582c9b and d0bea84.

Files selected for processing: 3
  • proofs/agda/EchoBitNarrowingNumeric.agda
  • proofs/agda/EchoExampleParser.agda
  • proofs/agda/EchoTropical.agda
  • 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.

@github-actions

Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 38 issues detected

Severity Count
🔴 Critical 0
🟠 High 12
🟡 Medium 26
View findings
[
  {
    "reason": "Required file missing",
    "type": "missing",
    "file": "0-AI-MANIFEST.a2ml",
    "level": "epi",
    "action": "create",
    "rule_module": "root_hygiene",
    "severity": "high",
    "evidence": [
      {
        "span": {
          "file": "0-AI-MANIFEST.a2ml",
          "end_line": 0,
          "start_line": 0
        },
        "rule": "root_hygiene/missing",
        "observations": 1,
        "rule_version": "0.1.0"
      }
    ],
    "support": {
      "kind": "pattern"
    }
  },
  {
    "reason": "Job `triage` in label-triage.yml has no `timeout-minutes:` declaration. Default is 6 hours — a stuck codeload fetch or runner hang can burn budget. Add `timeout-minutes: 10` (or proportional).",
    "type": "missing_timeout_minutes",
    "file": ".github/workflows/label-triage.yml",
    "level": "epi",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium",
    "recipe_id": "recipe-add-workflow-timeout-minutes",
    "job": "triage",
    "evidence": [
      {
        "span": {
          "file": ".github/workflows/label-triage.yml",
          "end_line": 0,
          "start_line": 0
        },
        "rule": "workflow_audit/missing_timeout_minutes",
        "observations": 1,
        "rule_version": "0.1.0"
      }
    ],
    "support": {
      "kind": "pattern"
    }
  },
  {
    "reason": "Job `sync` in labels.yml has no `timeout-minutes:` declaration. Default is 6 hours — a stuck codeload fetch or runner hang can burn budget. Add `timeout-minutes: 10` (or proportional).",
    "type": "missing_timeout_minutes",
    "file": ".github/workflows/labels.yml",
    "level": "epi",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium",
    "recipe_id": "recipe-add-workflow-timeout-minutes",
    "job": "sync",
    "evidence": [
      {
        "span": {
          "file": ".github/workflows/labels.yml",
          "end_line": 0,
          "start_line": 0
        },
        "rule": "workflow_audit/missing_timeout_minutes",
        "observations": 1,
        "rule_version": "0.1.0"
      }
    ],
    "support": {
      "kind": "pattern"
    }
  },
  {
    "line": 39,
    "reason": "job in .github/workflows/labels.yml references `secrets.*` but does not install `step-security/harden-runner` — review outbound-egress monitoring",
    "type": "RE001",
    "file": ".github/workflows/labels.yml",
    "level": "epi",
    "action": "report",
    "rule_module": "research_extensions",
    "severity": "medium",
    "evidence": [
      {
        "span": {
          "file": ".github/workflows/labels.yml",
          "end_line": 39,
          "start_line": 39
        },
        "rule": "research_extensions/RE001",
        "observations": 1,
        "rule_version": "0.1.0"
      }
    ],
    "support": {
      "kind": "pattern"
    }
  },
  {
    "line": 53,
    "reason": "job in .github/workflows/label-triage.yml references `secrets.*` but does not install `step-security/harden-runner` — review outbound-egress monitoring",
    "type": "RE001",
    "file": ".github/workflows/label-triage.yml",
    "level": "epi",
    "action": "report",
    "rule_module": "research_extensions",
    "severity": "medium",
    "evidence": [
      {
        "span": {
          "file": ".github/workflows/label-triage.yml",
          "end_line": 53,
          "start_line": 53
        },
        "rule": "research_extensions/RE001",
        "observations": 1,
        "rule_version": "0.1.0"
      }
    ],
    "support": {
      "kind": "pattern"
    }
  },
  {
    "line": 87,
    "reason": "job in .github/workflows/hypatia-scan.yml references `secrets.*` but does not install `step-security/harden-runner` — review outbound-egress monitoring",
    "type": "RE001",
    "file": ".github/workflows/hypatia-scan.yml",
    "level": "epi",
    "action": "report",
    "rule_module": "research_extensions",
    "severity": "medium",
    "evidence": [
      {
        "span": {
          "file": ".github/workflows/hypatia-scan.yml",
          "end_line": 87,
          "start_line": 87
        },
        "rule": "research_extensions/RE001",
        "observations": 1,
        "rule_version": "0.1.0"
      }
    ],
    "support": {
      "kind": "pattern"
    }
  },
  {
    "line": 46,
    "reason": "job in .github/workflows/push-email-notify.yml references `secrets.*` but does not install `step-security/harden-runner` — review outbound-egress monitoring",
    "type": "RE001",
    "file": ".github/workflows/push-email-notify.yml",
    "level": "epi",
    "action": "report",
    "rule_module": "research_extensions",
    "severity": "medium",
    "evidence": [
      {
        "span": {
          "file": ".github/workflows/push-email-notify.yml",
          "end_line": 46,
          "start_line": 46
        },
        "rule": "research_extensions/RE001",
        "observations": 1,
        "rule_version": "0.1.0"
      }
    ],
    "support": {
      "kind": "pattern"
    }
  },
  {
    "line": 34,
    "reason": "workflow .github/workflows/labels.yml:34 job `sync` has no `timeout-minutes:` — defaults to 360 min on hang",
    "type": "WH006",
    "file": ".github/workflows/labels.yml",
    "level": "epi",
    "action": "report",
    "rule_module": "workflow_hardening",
    "severity": "medium",
    "evidence": [
      {
        "span": {
          "file": ".github/workflows/labels.yml",
          "end_line": 34,
          "start_line": 34
        },
        "rule": "workflow_hardening/WH006",
        "observations": 1,
        "rule_version": "0.1.0"
      }
    ],
    "support": {
      "kind": "pattern"
    }
  },
  {
    "line": 48,
    "reason": "workflow .github/workflows/label-triage.yml:48 job `triage` has no `timeout-minutes:` — defaults to 360 min on hang",
    "type": "WH006",
    "file": ".github/workflows/label-triage.yml",
    "level": "epi",
    "action": "report",
    "rule_module": "workflow_hardening",
    "severity": "medium",
    "evidence": [
      {
        "span": {
          "file": ".github/workflows/label-triage.yml",
          "end_line": 48,
          "start_line": 48
        },
        "rule": "workflow_hardening/WH006",
        "observations": 1,
        "rule_version": "0.1.0"
      }
    ],
    "support": {
      "kind": "pattern"
    }
  },
  {
    "line": null,
    "reason": "workflow .github/workflows/hypatia-scan.yml uploads SARIF to code scanning but masks the scanner's failure (`|| true` / `|| echo 0`) and never asserts the findings artefact is a non-empty array. When the scanner fails, this uploads a SARIF with zero results, and GitHub AUTO-CLOSES every previously-open alert for that category — silently, with the job green.",
    "type": "WH014",
    "file": ".github/workflows/hypatia-scan.yml",
    "level": "epi",
    "action": "report",
    "rule_module": "workflow_hardening",
    "severity": "high",
    "evidence": [
      {
        "span": {
          "file": ".github/workflows/hypatia-scan.yml",
          "end_line": 0,
          "start_line": 0
        },
        "rule": "workflow_hardening/WH014",
        "observations": 1,
        "rule_version": "0.1.0"
      }
    ],
    "support": {
      "kind": "pattern"
    }
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

@hyperpolymath
hyperpolymath marked this pull request as ready for review October 26, 2026 22:26
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 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 🔄 Running since 2026-10-26T22:42:46.883799Z d0bea84 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.

@hyperpolymath
hyperpolymath enabled auto-merge (squash) October 26, 2026 22:29
@coderabbitai

coderabbitai Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Add Carrot credits or activate Agent usage billing to use Autofix

@hyperpolymath
hyperpolymath merged commit 71d6dd6 into main Oct 27, 2026
9 checks passed
@hyperpolymath
hyperpolymath deleted the proofs/strict-flag-fixes branch October 27, 2026 00:08
hyperpolymath added a commit that referenced this pull request Oct 27, 2026
…357)

## 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](https://claude.ai/code/session_01MF5GeeBBDF6sUzr6pZTjWV)_

Co-authored-by: Claude <[email protected]>
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