Skip to content

test: check every cited Agda lemma against echo-types - #36

Merged
hyperpolymath merged 2 commits into
mainfrom
marina/jolly-volta-lkmb1k
Nov 14, 2026
Merged

hyperpolymath merged 2 commits into
mainfrom
marina/jolly-volta-lkmb1k

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Summary

EchoTypes cites the echo-types lemmas it mirrors as backticked names (for example `echo-intro`), and nothing checked that those names exist. There is no Agda-to-Julia import path, so this check is name-level: it proves each cited lemma is declared in echo-types at a pinned commit. It does not prove that the Julia shadow agrees with the lemma.

A backticked name that contains a hyphen cannot be a Julia identifier, so the check treats each one as an Agda name.

Changes

  1. Fix 2 citations (src/EchoTypes.jl). These were found by the new check against echo-types dedda75:
    • A comment called EchoNoSectionGeneric a generalisation of `no-section`. echo-types declares no lemma of that name; the result meant is no-section-collapse-to-residue (EchoResidue.agda:63).
    • The prose label "audience-facing" was set in backticks, so it read as a lemma name.
  2. test/agda-citations.txt: the 62 cited names, and the echo-types commit they were checked against.
  3. New testset (offline, in Pkg.test()): fails when src/ cites a name the fixture does not list, or the fixture lists a name src/ no longer cites.
  4. scripts/check-agda-citations.sh (POSIX sh): extract lists the cited names; verify <echo-types checkout> checks the fixture against src/, and checks each name against the .agda declarations.
  5. .github/workflows/agda-citations.yml: checks out echo-types at the pinned commit and runs verify. To re-check against a newer echo-types, bump the pin.

Testing

  • Pkg.test() on Julia 1.11.7: 306 pass (302 before plus 4 new).
  • scripts/check-agda-citations.sh verify against echo-types dedda75: PASS: 62 cited Agda names match the fixture and are declared in echo-types.
  • Negative controls:
    • An unlisted citation added to src/ fails both the testset (1 failure) and the script (exit 1).
    • A fixture entry renamed to a non-existent lemma fails the script (exit 1, MISSING in echo-types).
  • actionlint v1.7.7: clean. sh -n: ok. shellcheck was not available in this environment, so it did not run.

Scope

  • ASCII names only. Names with Unicode or other symbols (for example ⊕-fold-++) are not checked.
  • The existing licence note in the SPDX comments is unchanged; it is the maintainer's to edit.

Generated by Claude Code

A section comment called EchoNoSectionGeneric a generalisation of
`no-section`, but echo-types declares no lemma of that name; the residue
result it means is `no-section-collapse-to-residue` (EchoResidue.agda:63).
A second comment set the prose label "audience-facing" in backticks, which
reads as a lemma name. Found by checking every cited name against
echo-types dedda75.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0136P7ZnB2Fzqf8br8DGDD4k
EchoTypes cites the echo-types lemmas it mirrors as backticked names, and
nothing checked that those names exist. A backticked hyphenated name cannot
be a Julia identifier, so each one is taken to be an Agda name.

- test/agda-citations.txt records the 62 cited names and the echo-types
  commit they were checked against (dedda75).
- A new testset (offline) fails when src/ cites a name that the fixture
  does not list, or the fixture lists a name src/ no longer cites.
- scripts/check-agda-citations.sh verify <checkout> also checks that each
  name is declared in an .agda file; the new agda-citations workflow runs
  it against echo-types at the pinned commit.

The check is name-level: it proves each cited lemma exists, not that the
Julia shadow agrees with it. Pkg.test(): 306 pass. Negative controls: an
unlisted citation fails both the testset and the script, and a renamed
fixture entry fails the script. actionlint is clean on the workflow.

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

coderabbitai Bot commented Nov 14, 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 23 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: ecac0a09-d58b-4848-82f6-6330c5b0705f
Commits

Reviewing files that changed from the base of the PR and between 2ded186 and 1c50d5f.

Files selected for processing: 5

  • .github/workflows/agda-citations.yml
  • scripts/check-agda-citations.sh
  • src/EchoTypes.jl
  • test/agda-citations.txt
  • test/runtests.jl
  • 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

@hyperpolymath
hyperpolymath marked this pull request as ready for review November 14, 2026 17:15
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-14T17:18:03.854809Z 1c50d5f Draft marked ready
🔒 Security Review ✅ Completed 2026-11-14T17:18:42.694790Z 1c50d5f 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1c50d5f3ae

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +29 to +30
grep -ohE '`[A-Za-z][A-Za-z0-9]*(-[A-Za-z0-9]+)+`' "$ROOT"/src/*.jl \
| tr -d '`' | LC_ALL=C sort -u

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Traverse nested source directories when extracting citations

When a cited lemma appears in a Julia file below a subdirectory such as src/foo/bar.jl, this glob never examines it. The offline test has the same limitation because it only iterates the immediate results of readdir(srcdir), so the fixture can omit that citation and both Pkg.test() and the workflow's verify command still pass. Recursively enumerate .jl files under src/ in both implementations.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed. Both the script and the testset read only the top level of src/. This PR was merged before the review arrived, so the fix is in a follow-up PR: find in the script and walkdir in the testset. An unlisted citation in src/nested/control.jl now fails both checks.


Generated by Claude Code

@hyperpolymath
hyperpolymath merged commit a665d93 into main Nov 14, 2026
6 checks passed
@hyperpolymath
hyperpolymath deleted the marina/jolly-volta-lkmb1k branch November 14, 2026 17:21
hyperpolymath added a commit that referenced this pull request Nov 14, 2026
## Summary

Follow-up to #36, from the Codex review of that PR. The citation
extractor in `scripts/check-agda-citations.sh` globbed only `src/*.jl`,
and the offline testset read only the top-level entries of `src/`. A
citation in a file under a subdirectory, such as `src/foo/bar.jl`, would
be missed by both, so the fixture could omit it and both checks would
still pass.

## Changes

- `scripts/check-agda-citations.sh`: `find "$ROOT/src" -type f -name
'*.jl'` in place of the `src/*.jl` glob.
- `test/runtests.jl`: `walkdir(srcdir)` in place of `readdir(srcdir)`.

## Testing

- `src/` has no subdirectories today, so the fixture is unchanged.
`verify` against echo-types `dedda75`: 62 names pass. `Pkg.test()`: 306
pass.
- Negative control: an unlisted citation in `src/nested/control.jl` now
fails both the script (exit 1, `+nested-fake-lemma`) and the testset (1
failure). The control file was not committed.

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

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.

3 participants