Skip to content

Report a Word Tuple Keying a Mapping in the Vocabulary Check - #3477

Merged
ptr727 merged 3 commits into
developfrom
is-word-docstring
Oct 25, 2026
Merged

ptr727 merged 3 commits into
developfrom
is-word-docstring

Conversation

@ptr727

@ptr727 ptr727 commented Oct 25, 2026

Copy link
Copy Markdown
Owner

Summary

Answers the finding promotion #3476 raised on the vocabulary check #3474 added to tests/test_prose_lint.py.

  • The is_word docstring said "letters alone", while its pattern joins letter runs with single spaces, hyphens, or apostrophes. It now says that. It also names which paths and environment variable names are not words, those with a separator or an underscore, since an all-letter name such as HOME is one. The test covering them is renamed to match.
  • A word tuple keying a mapping beside a value holding no words was never reported (class sweep, found by the local pass). The mapping does not count such a key, yet marked it nested, so the key literal was skipped as well. Only a key the mapping counts is nested now, and the docstring says a literal reports at the outermost literal that counts it. One case proves each half: KEYED reports at the tuple, and COUNTED reports once, at the mapping.

Verification

  • tests/test_prose_lint.py: 629 tests, OK. ruff format and check, mypy: clean. prose_lint.py --diff against the merge base, with and without --check sentence-length: clean.
  • Three local adversarial passes at the frontier tier. The first found the remaining environment-name overclaim and the skipped key, the second two unproven halves and two wording gaps, each fixed. The third found nothing.

🤖 Generated with Claude Code

ptr727 and others added 3 commits October 25, 2026 10:56
The docstring said letters alone, while the pattern also joins letter
runs with single spaces, hyphens, or apostrophes, so "had had" and
"sentence-length" are words.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A key holding words beside a value holding none was marked nested and
so never reported, since the mapping does not count it. Only a key the
mapping counts is nested now. The is_word docstring names which paths
and environment variable names are not words, since an all-letter name
such as HOME is one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds a case whose word-tuple key sits beside a value holding words, so
dropping the key from the nested set would report it twice. The
docstring now says the report lands on the outermost literal that counts
it, and the underscore test's name says what it covers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings October 25, 2026 18:02
@coderabbitai

coderabbitai Bot commented Oct 25, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • 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.

@ptr727

ptr727 commented Oct 25, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 0999fc81b3c75de84bb05a7ea8592b4c442bd244, the content this pull request carries at that commit against develop, and it recorded 0 findings.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No unresolved review issues were identified, and all reviewed changes have approval readiness.

No open issues 🎉

What changed in this PR

This pull request clarifies vocabulary-check documentation and fixes nested-literal handling for mapping keys, with regression coverage for counted and uncounted tuple keys.

Changes:

  • Clarifies the is_word contract and renames the environment-name test.
  • Marks mapping keys as nested only when their associated values contribute words.
  • Adds regression cases for counted and uncounted mapping keys.
File Description
tests/​test_prose_lint.py Updates vocabulary-check documentation, nested mapping logic, and regression tests.

Review effort: Lite

@codecov

codecov Bot commented Oct 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.98%. Comparing base (aa85f74) to head (0999fc8).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3477   +/-   ##
========================================
  Coverage    80.98%   80.98%           
========================================
  Files           25       25           
  Lines         8895     8895           
========================================
  Hits          7204     7204           
  Misses        1691     1691           
Flag Coverage Δ
python-3.13 80.98% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ptr727
ptr727 merged commit 86f66b4 into develop Oct 25, 2026
14 checks passed
@ptr727
ptr727 deleted the is-word-docstring branch October 25, 2026 18:10
ptr727 added a commit that referenced this pull request Oct 25, 2026
…3476)

## Summary

Promotes the pull requests merged into develop since release 2.0.1178.

- [#3474](#3474): replaces
the prose gate's line ceiling with a test that fails where
`prose_lint.py` holds a banned spelling, an exemption entry, or a
collection literal of more than five words.
- [#3477](#3477): answers
this promotion's review. The `is_word` docstring now says what its
pattern accepts, and a word tuple keying a mapping beside a wordless
value is reported.
- [#3478](#3478): answers
this promotion's second review round, a case proving paths with a `/` or
`\` separator are not words.

Closes #3441

## Constituent coverage

Each change this promotion carries had coverage on its own pull request
into develop, at its merged head:

| Pull request | Merged head | Coverage |
| --- | --- | --- |
| [#3474](#3474) |
`9d631289` | attested local pass at the merged head, base `develop`, and
a Copilot table on the merged head naming exactly its one changed file,
no open findings |
| [#3477](#3477) |
`0999fc81` | attested local pass at the merged head, base `develop`, and
a Copilot table on the merged head naming exactly its one changed file,
no open findings |
| [#3478](#3478) |
`93ba9d90` | attested local pass at the merged head, base `develop`, and
a Copilot table on the merged head naming exactly its one changed file,
no open findings |

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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