Repository navigation
test: check every cited Agda lemma against echo-types - #36
Conversation
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
|
Warning Review limit reachedYou'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. View limit details
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. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 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".
| grep -ohE '`[A-Za-z][A-Za-z0-9]*(-[A-Za-z0-9]+)+`' "$ROOT"/src/*.jl \ | ||
| | tr -d '`' | LC_ALL=C sort -u |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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
## 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>
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
src/EchoTypes.jl). These were found by the new check against echo-typesdedda75:`no-section`. echo-types declares no lemma of that name; the result meant isno-section-collapse-to-residue(EchoResidue.agda:63).test/agda-citations.txt: the 62 cited names, and the echo-types commit they were checked against.Pkg.test()): fails whensrc/cites a name the fixture does not list, or the fixture lists a namesrc/no longer cites.scripts/check-agda-citations.sh(POSIX sh):extractlists the cited names;verify <echo-types checkout>checks the fixture againstsrc/, and checks each name against the.agdadeclarations..github/workflows/agda-citations.yml: checks out echo-types at the pinned commit and runsverify. 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 verifyagainst echo-typesdedda75:PASS: 62 cited Agda names match the fixture and are declared in echo-types.src/fails both the testset (1 failure) and the script (exit 1).MISSING in echo-types).actionlintv1.7.7: clean.sh -n: ok.shellcheckwas not available in this environment, so it did not run.Scope
⊕-fold-++) are not checked.Generated by Claude Code