Skip to content

fix(parser): Hypatia directives and a safe update mode for the grammar test - #433

Merged
hyperpolymath merged 2 commits into
mainfrom
claude/e2e-language-pass-ow72tj
Nov 10, 2026
Merged

hyperpolymath merged 2 commits into
mainfrom
claude/e2e-language-pass-ow72tj

Conversation

@hyperpolymath

@hyperpolymath hyperpolymath commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

Summary

2 small follow-ups to #432, which merged with one red check and one open review finding. Both are in src/ephapax-parser/src/grammar_conformance.rs.

1. Hypatia alerts

The Hypatia code scan reported 2 new alerts in that file on #432:

  • code_safety/panic_macro (error, 4 places)
  • code_safety/expect_in_hot_path (warning, 11 places)

The file is a test-only module: lib.rs declares it as #[cfg(test)] mod grammar_conformance. But it is a file of its own below src/, so the scanner reads it as library code. In a test, a panic with a message is how the test fails, and there is no hot path.

The file now has the 2 hypatia: allow directives, each with its reason. This is the form that other files of the repository use (for example src/ephapax-vram-cache/benches/cache_bench.rs).

2. Update mode (Codex finding on #432)

With UPDATE_GRAMMAR=1, one test wrote spec/ephapax-v2-grammar.ebnf again while another test read the same file on a second thread. The reader could get the old text or a part of the new text.

The tests now take the text from one function with a OnceLock. The first call reads the file and, in update mode, writes part 1 again. Each other test waits for that call and gets the same text.

Verification

  • cargo fmt --all --check and cargo clippy -p ephapax-parser --all-targets: clean.
  • cargo test -p ephapax-parser grammar_conformance: 3 passed.
  • A file with a damaged part 1 fails in normal mode. In update mode, 5 runs in sequence pass and give back the committed text.
  • I can not run the Hypatia scan in this session. The check on this pull request shows if the 2 alerts close.

🤖 Generated with Claude Code

https://claude.ai/code/session_0136P7ZmKrYLDC4WHi2yt11u

The Hypatia code scan reported `code_safety/panic_macro` (error) and
`code_safety/expect_in_hot_path` (warning) in grammar_conformance.rs,
on #432. The file is a test-only module
(`#[cfg(test)] mod grammar_conformance` in lib.rs), but it is a file of
its own below src/, so the scanner reads it as library code.

The file now has the 2 `hypatia: allow` directives, with the reason, in
the form that other files of the repository use.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0136P7ZmKrYLDC4WHi2yt11u
@coderabbitai

coderabbitai Bot commented Nov 10, 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 18 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: 7ca686e8-3f12-480b-a70e-76f16b31eeae
Commits

Reviewing files that changed from the base of the PR and between e7e3a97 and e69ad60.

Files selected for processing: 1

  • src/ephapax-parser/src/grammar_conformance.rs
  • 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

Review finding on #432. With `UPDATE_GRAMMAR=1`, one test wrote
spec/ephapax-v2-grammar.ebnf again while another test read the same
file on a second thread. The reader could get the old text or a part of
the new text, so the update command could fail or check stale content.

The tests now take the text from one function with a `OnceLock`. The
first call reads the file and, in update mode, writes part 1 again; each
other test waits for that call and gets the same text.

Checked: a file with a damaged part 1 fails in normal mode; in update
mode, 5 runs in sequence pass and give back the committed text.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0136P7ZmKrYLDC4WHi2yt11u
@hyperpolymath hyperpolymath changed the title chore(parser): mark the grammar test module as test code for Hypatia fix(parser): Hypatia directives and a safe update mode for the grammar test Nov 10, 2026
@sonarqubecloud

Copy link
Copy Markdown

@hyperpolymath
hyperpolymath marked this pull request as ready for review November 10, 2026 17:05
@hyperpolymath
hyperpolymath merged commit 85617f4 into main Nov 10, 2026
46 checks passed
@chatgpt-codex-connector

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

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-10T17:07:35.863145Z e69ad60 Draft marked ready
🔒 Security Review ❌ Failed 2026-11-10T17:05:33.874930Z
We couldn’t complete this review. Comment @codex security review to try again.
e69ad60 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
hyperpolymath deleted the claude/e2e-language-pass-ow72tj branch November 10, 2026 17:05
@chatgpt-codex-connector

Copy link
Copy Markdown

This security review couldn’t start because the paying account has exhausted its Codex allowance and has insufficient available credits. The payer can check their balance and add credits in the Codex usage dashboard, then try again. If you do not manage the paying account, contact this repository's admins.

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