Skip to content

Stop property tests from generating _b and other reserved names as variables - #388

Merged
jbearak merged 1 commit into
mainfrom
test/no-reserved-system-names
Nov 5, 2026
Merged

jbearak merged 1 commit into
mainfrom
test/no-reserved-system-names

Conversation

@jbearak

@jbearak jbearak commented Nov 5, 2026 •

Copy link
Copy Markdown
Owner

tests/property/severity-settings.prop.test.ts failed about one run in six. Since #386, summarize _b no longer reports _b as an undefined variable, because _b is one of Stata's reserved names. The test expects an undefined-variable diagnostic for a name from arbitrary_non_reserved_identifier(), and that generator could still return _b.

The generator now skips Stata's reserved underscore names and _se.

Proof: on main, the flaky file failed 4 of 25 runs (counterexample ["_b","error"]). With this change it passed 25 of 25. bun test ./tests/property passes (2482 tests) and typecheck passes.

Reviewed with sol-loop: 1 round with gpt-6.1-sol. Sol verdict: approved

Created with Claude Opus 5.5 in T3 Code.

Summary by CodeRabbit

  • Tests
    • Property-based identifier checks now account for Stata’s reserved underscore names and _se, alongside existing excluded keywords and command names.
    • Generated identifiers avoid these reserved names, keeping automated checks focused on valid identifier handling. No user-facing behavior changes are included in this update.

@coderabbitai

coderabbitai Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

Next included review available in 52 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available. Your 65 included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.

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: CHILL
  • Plan: Team
  • Run ID: 7c969cd7-494e-4f99-95cb-fb2617de2c36
Commits

Reviewing files that changed from the base of the PR and between f0cdd6b and 8587267.

Files selected for processing: 1

  • tests/property/generators/primitives.ts

No actionable comments were generated in the recent review.

Walkthrough

The property-test identifier generator now excludes Stata reserved system names, including _b and _se, alongside its existing exclusions.

Changes: Identifier filtering

Layer / File(s) Summary
Reserved system names and generator filter
tests/property/generators/primitives.ts
Adds the exported RESERVED_SYSTEM_NAMES set and updates arbitrary_non_reserved_identifier to filter out those names. Existing qualifier-keyword, prefix-command, and file-command exclusions remain.

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Bug fix

Possibly related PRs

  • jbearak/sight#342: Introduced arbitrary_non_reserved_identifier() and excluded Stata qualifier words.
  • jbearak/sight#346: Expanded the same generator’s qualifier and prefix exclusions.
Merge Risk: Minimal · previous review f0cdd

The generator excludes the listed reserved names. No merge-blocking issue was established.

Pre-merge checks: Passed 5

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: property-test generators no longer emit Stata reserved names such as _b as variables. The raw summary confirms that arbitrary_non_reserved_identifier now rejects RESER…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: property-test generators no longer emit Stata reserved names such as _b as variables. The raw summary confirms that arbitrary_non_reserved_identifier now rejects RESERVED_SYSTEM_NAMES, which includes the reserved underscore names and _se. The title is specific and matches the changeset and the stated objective of fixing the intermittent failure in severity-settings.prop.test.ts.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 1 files.

Finishing Touches

Generate docstrings

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Team
  • Run ID: b3cade32-a76a-4c1c-a357-a8eb4cba6227
Commits

Reviewing files that changed from the base of the PR and between 77cd973 and f0cdd6b.

Files selected for processing: 1

  • tests/property/generators/primitives.ts

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.

…riables

Since #386, `summarize _b` reports no undefined variable, because `_b`
is one of Stata's reserved names, not a variable. The severity-settings
property test still drew `_b` as a variable name and failed about one
run in six.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@jbearak
jbearak force-pushed the test/no-reserved-system-names branch from f0cdd6b to 8587267 Compare November 5, 2026 20:51
@jbearak
jbearak merged commit 2091726 into main Nov 5, 2026
14 checks passed
@jbearak
jbearak deleted the test/no-reserved-system-names branch November 5, 2026 20:56
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.

1 participant