Skip to content

Enforce Oxford spelling with typos - #415

Merged
leynos merged 5 commits into
mainfrom
typos-roll-out
Jul 14, 2026
Merged

Enforce Oxford spelling with typos#415
leynos merged 5 commits into
mainfrom
typos-roll-out

Conversation

@leynos

@leynos leynos commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Summary

This branch enforces the estate-wide en-GB-oxendict policy through a generated
Typos configuration, a hardened shared-dictionary cache, and a companion exact
phrase checker for punctuation-separated corrections such as hand-written to
handwritten.

It refreshes the merged shared authority, corrects maintained prose and private
identifiers to artefact spelling, and preserves fixed public workflow or
upstream contracts through narrow token-scoped protections. It also addresses
the outstanding review findings by documenting public helper interfaces,
improving assertion diagnostics, parameterizing invalid inputs, and caching
dictionary state in CI without skipping freshness validation.

No matching roadmap implementation item was found. Open issue #408 concerns a
separate internal identifier rename and is not changed or closed by this
policy rollout.

Review walkthrough

Validation

  • make check-fmt: passed.
  • make lint: passed, including Rustdoc, Clippy, and Whitaker.
  • make typecheck: passed.
  • make test-workflow-contracts: passed; six tests.
  • make test: passed; 1,094 tests across 41 binaries.
  • make release: passed.
  • make spelling-helper-test: passed; 31 tests, 91.94% total coverage, and 94% phrase-checker coverage.
  • make spelling: passed; phrase policy and pinned Typos are clean.
  • make markdownlint: passed; 70 files and zero findings.
  • make nixie: passed; all Mermaid diagrams are valid.
  • make formal-pr: passed with pinned Kani 0.67.0.
  • checkmake Makefile, mbake validate Makefile, and actionlint: passed.
  • Generated-config, Make-order, AST parameter/file-size, 42-path authority, 31-correction/30-protection reference-closure, masked-literal, and whitespace audits: passed.

Notes

The optional make kani-full suite reaches unchanged origin/main code and
fails because rotate_index is unavailable under the full Kani build, alongside
an unchanged unused path_cmp warning. Neither path is modified by this branch;
the repository's required pull-request formal gate is make formal-pr, which
passes.

Generate the repository policy from the shared estate dictionary and a
narrow local overlay. Refresh the untracked base only when the authority is
newer, validate the helper and generated config, and run the pinned spelling
gate in CI.

Correct the maintained documentation spellings now enforced by the gate.

@sourcery-ai sourcery-ai Bot 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.

Sorry @leynos, your pull request is larger than the review limit of 150000 diff characters

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

The PR replaces the hand-maintained spelling generator with a cached shared dictionary and local overlay, adds deterministic rendering and refresh handling, introduces focused rollout tests, and wires make spelling into CI and contributor workflows.

Changes

Generated spelling policy

Layer / File(s) Summary
Dictionary model and deterministic rendering
scripts/typos_rollout.py, scripts/typos_rollout_cache.py, typos.local.toml, typos.toml
Defines validated dictionary merging, Oxford mappings, deterministic TOML rendering, atomic writes, local policy, and generated spelling output.
Cache refresh and generator integration
scripts/typos_rollout_http.py, scripts/generate_typos_config.py
Refreshes local or HTTPS dictionary caches with validators, secure redirects, offline handling, stale-cache fallback, and generator integration.
Rollout validation and hardening
scripts/tests/*
Tests dictionary parsing, rendering, refresh decisions, HTTPS enforcement, fallback behaviour, and atomic-write cleanup.
Spelling gate and contributor workflow
Makefile, .github/workflows/ci.yml, AGENTS.md, docs/developers-guide.md, docs/netsuke-design.md, docs/reliable-testing-in-rust-via-dependency-injection.md, .gitignore
Adds spelling targets and CI execution, updates maintenance guidance, ignores local caches, and corrects documented spellings.

Sequence Diagram(s)

sequenceDiagram
  participant Contributor
  participant Makefile
  participant Generator as generate_typos_config.py
  participant Source as HTTPS dictionary source
  participant Typos
  Contributor->>Makefile: Run make spelling
  Makefile->>Generator: Generate typos.toml
  Generator->>Source: Refresh shared dictionary
  Source-->>Generator: Return dictionary or cache status
  Generator-->>Makefile: Write generated policy
  Makefile->>Typos: Scan tracked Markdown files
  Typos-->>Contributor: Report spelling result
Loading

Possibly related PRs

Suggested reviewers: lodyai[bot]

Poem

A dictionary wakes in the cache,
Oxford forms march into place.
Make guards the spelling gate,
CI checks before it’s late.
Tiny tests keep errors bright,
And typos fade from Markdown’s sight.

🚥 Pre-merge checks | ✅ 5 | ❌ 15

❌ Failed checks (15 inconclusive)

Check name Status Explanation Resolution
Testing (Overall) ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
User-Facing Documentation ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Developer Documentation ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Module-Level Documentation ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Testing (Unit And Behavioural) ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Testing (Property / Proof) ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Testing (Compile-Time / Ui) ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Unit Architecture ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Domain Architecture ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Observability ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Security And Privacy ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Performance And Resource Use ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Concurrency And State ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Architectural Complexity And Maintainability ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Rust Compiler Lint Integrity ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 97.53% which is sufficient. The required threshold is 80.00%.
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.
Title check ✅ Passed The title matches the main change: enforcing Oxford spelling with typos.
Description check ✅ Passed The description clearly describes the spelling-policy rollout, CI integration, and helper hardening.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch typos-roll-out

Comment @coderabbitai help to get the list of available commands.

codescene-access[bot]

This comment was marked as outdated.

Group refresh policy and transport state into immutable values so the
shared spelling helper remains within the estate's code-health limits.
Split refresh tests into focused modules to keep every source file below
the repository's 400-line limit while preserving the full contract suite.
codescene-access[bot]

This comment was marked as outdated.

Comment thread scripts/typos_rollout_http.py Outdated
@leynos
leynos marked this pull request as ready for review July 13, 2026 22:25

@sourcery-ai sourcery-ai Bot 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.

Sorry @leynos, your pull request is larger than the review limit of 150000 diff characters

@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: d7c5310081

ℹ️ 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 thread typos.toml Outdated

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 9

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/developers-guide.md`:
- Around line 120-126: Update both three-item lists in the shared estate
dictionary and typos.local.toml descriptions to include an Oxford comma before
“and,” preserving the existing wording and meaning.
- Line 117: Update the wording in the repository-root typos.toml description
from “deterministic generated output” to “deterministically generated output,”
preserving the surrounding sentence.

In `@Makefile`:
- Line 58: Remove the redundant test-typos-config alias from the Makefile,
unless the repository search finds external references requiring compatibility;
otherwise retain only spelling-helper-test as the shared spelling-policy test
target.
- Around line 85-91: Update the spelling target and its CI workflow so the
shared-dictionary cache and metadata used by generate_typos_config.py are
restored before the target runs and persisted after it completes, using the
repository’s established cache mechanism. Ensure cache misses still allow the
refresh to run and cache hits avoid an unnecessary network request while
preserving the existing typos validation steps.

In `@scripts/generate_typos_config.py`:
- Around line 58-83: Expand the docstring for the public function main to use
the project’s NumPy-style structure: document output, repository, source, and
offline parameters with their types and meanings; document the
rollout.RefreshResult return value; and document that
rollout.NetworkUnavailableError is re-raised when no tracked fallback is
available. Keep the existing refresh and fallback behavior unchanged.
- Around line 27-42: Expand the docstrings for the public functions
dictionary_from_cache and render_config to follow the project’s full NumPy-style
format. Document the repository parameter, including its Path type and default,
and add Returns sections describing the rollout.Dictionary and str results
respectively; preserve the existing behavior and summaries.

In `@scripts/tests/test_typos_rollout.py`:
- Around line 36-43: Update every bare assert in the affected tests, including
the assertions around generate_word_mappings and those at the referenced later
locations, to include a concise failure message describing the expected mapping
or value. Preserve the existing assertions and test behavior while applying the
repository’s assert-with-message convention consistently.
- Around line 68-87: The test
test_dictionary_validation_rejects_invalid_documents should use
pytest.mark.parametrize to provide each invalid document as a separate test case
instead of iterating inside one test. Move the document variants into
parametrized inputs while preserving the existing load_dictionary call and
expected TypeError/ValueError assertion.

In `@scripts/typos_rollout.py`:
- Around line 106-108: Expand the NumPy-style docstrings for public functions
load_dictionary, merge_dictionaries, generate_word_mappings,
render_typos_config, write_config, and refresh_base in scripts/typos_rollout.py,
documenting Parameters, Returns, and applicable TypeError/ValueError cases. Also
update atomic_write in scripts/typos_rollout_cache.py with a Parameters section
and Notes describing its atomic write-and-replace guarantee.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 094f63b6-e430-4b20-a0c4-f598694f3e4c

📥 Commits

Reviewing files that changed from the base of the PR and between 7f69811 and d7c5310.

📒 Files selected for processing (19)
  • .github/workflows/ci.yml
  • .gitignore
  • AGENTS.md
  • Makefile
  • docs/developers-guide.md
  • docs/netsuke-design.md
  • docs/reliable-testing-in-rust-via-dependency-injection.md
  • scripts/generate_typos_config.py
  • scripts/tests/conftest.py
  • scripts/tests/test_generate_typos_config.py
  • scripts/tests/test_typos_rollout.py
  • scripts/tests/test_typos_rollout_hardening.py
  • scripts/tests/test_typos_rollout_refresh.py
  • scripts/tests/typos_rollout_test_support.py
  • scripts/typos_rollout.py
  • scripts/typos_rollout_cache.py
  • scripts/typos_rollout_http.py
  • typos.local.toml
  • typos.toml
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • leynos/rstest-bdd (auto-detected)
  • leynos/ortho-config (auto-detected)
  • leynos/shared-actions (auto-detected)
💤 Files with no reviewable changes (1)
  • scripts/tests/test_generate_typos_config.py

Comment thread docs/developers-guide.md Outdated
Comment thread docs/developers-guide.md
Comment thread Makefile
Comment thread Makefile Outdated
Comment thread scripts/generate_typos_config.py
Comment thread scripts/generate_typos_config.py
Comment thread scripts/tests/test_typos_rollout.py Outdated
Comment thread scripts/tests/test_typos_rollout.py Outdated
Comment thread scripts/typos_rollout.py
Refresh the rollout from the merged shared authority, enforce exact phrase
corrections alongside Typos, and replace maintained artefact spellings while
preserving public workflow contracts with narrow protections.

Apply the outstanding review fixes, split and document the helper tests,
cache shared dictionary state in CI, and retain the documented focused-test
alias. Rename the legacy package helper to its Oxford spelling and update all
internal references.
codescene-access[bot]

This comment was marked as outdated.

Extract mapping validation, correction merging and phrase scanning into
focused helpers. Preserve deterministic diagnostics and matching behaviour
while satisfying the review complexity limits.

Add characterization coverage for invalid policy documents, merge ordering
and complete phrase-finding order.
codescene-access[bot]

This comment was marked as outdated.

Bundle the expected exception class and diagnostic into one parametrized
value so each named validation case remains exact while meeting the review
argument limit.
@leynos
leynos merged commit 5cf790b into main Jul 14, 2026
19 checks passed
@leynos
leynos deleted the typos-roll-out branch July 14, 2026 01:24
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