Skip to content

Share the duplicated tool helpers and cut four empty claims - #80

Merged
ryanduguid merged 1 commit into
mainfrom
ryan/ponytail-stop-slop
Sep 7, 2026
Merged

Share the duplicated tool helpers and cut four empty claims#80
ryanduguid merged 1 commit into
mainfrom
ryan/ponytail-stop-slop

Conversation

@ryanduguid

@ryanduguid ryanduguid commented Sep 7, 2026

Copy link
Copy Markdown
Owner

What this changes

Tools only; ozzit.xlsx, src/, functions.csv and the AFE store are untouched.

  • Deletes test_regression_tests_remain_proportionate_to_production_tools (a test-to-tool line ratio of 0.50 that proves nothing about behaviour and fails on any legitimate trim) and physical_code_lines, which had no other caller.
  • The eleven byte-identical text-IO helpers across seven modules become one read_text and write_text pair in tools/sanitise_workbook.py, which the postbuild modules already reach; every copy was checked identical by AST hash before merging.
  • The two identical xml_escape bodies become xml.sax.saxutils.escape (fuzzed against the old body on 3,469 inputs; identical for &, <, > and quotes). The copy inside the frozen v3.0.0 provenance rebuild stays.
  • column_number was defined twice with identical bodies; one lives in sanitise_workbook.py, which both callers already import (keeping either original would have pulled a mutating tool into a read-only gate or the reverse).
  • The ruff-format pre-commit hook goes: ruff format --check would reformat 45 files today and no CI gate checks formatting, so the hook rewrote files nothing verified. CONTRIBUTING says the hooks run the pinned ruff check.
  • Prose: docs/australian-modelling.md names the profile (front-loaded, the author's own wording from the lease schedule's help) instead of "the profile AASB 16 is known for" and drops the kicker; docs/workbook-use.md drops the sentence that fits any spreadsheet and keeps the specific volatility facts; CHANGELOG loses two bold kickers and two em dashes; llms.txt opens on the workbook's own facts (138 functions, no VBA or add-ins) instead of the shared template sentence.

Why

Verification

python -m ruff check .                                   # All checks passed!
python -m mypy --config-file mypy.ini                    # Success: no issues found in 27 source files
python tools/verify_workbook.py ozzit.xlsx               # OK: ozzit.xlsx, 138 functions, 169 parts
python tools/verify_sources.py ozzit.xlsx src            # OK: src/ reproduces all 138 functions
python tools/verify_signatures.py src                    # OK: all 130 signatures, 130 parameter tables and 127 example blocks
python tools/verify_previous_names.py functions.csv      # OK: 138 functions, 130 of them replacing a name
python tools/verify_index.py ozzit.xlsx src functions.csv   # OK: all 138 functions.csv rows match
python tools/verify_afe.py ozzit.xlsx src                # OK: AFE store matches all 6 modules
python -m unittest discover -s tools/tests -v            # Ran 216 tests, OK (218 before: the two deleted tests)

Mutation check: stubbing the shared read_text to return an empty string fails 22 postbuild tests plus one error; restored, 42 postbuild tests OK.

Checklist

  • No client, taxpayer, employee or payroll data, and no credentials, tokens, tenant IDs or .env contents, appear in the diff, the commit messages or this description.
  • The change is single-purpose. (One audit, one repository, batched as agreed.)
  • New or changed behaviour has a test that fails without the change. (The mutation check above; the escape fuzz.)
  • Documentation, README and any docstring that describes the changed rule were updated together with it.
  • Any new dependency is justified in the description, or there is none.

Eleven byte-identical text readers and writers across seven modules, two
copies of a hand-rolled XML escape and two copies of column_number all
collapse into one implementation. read_text, write_text and column_number
now live in tools/sanitise_workbook.py, which every caller already imports
through its sys.path entry, and the escape is xml.sax.saxutils.escape,
which is the same three replacements in the same order. The parser fixture
that exec'd the removed xml_escape drops it with the function.

test_regression_tests_remain_proportionate_to_production_tools asserted a
test-to-tool line ratio of at least 0.50. It proves nothing about
behaviour and fails on a legitimate trim, so it and its only helper,
physical_code_lines, are gone.

The ruff-format pre-commit hook has no CI counterpart, and
python -m ruff format --check . reports 45 files it would reformat, so the
hook goes rather than the repository being reformatted; CONTRIBUTING.md no
longer promises it.

Prose: docs/australian-modelling.md names the front-loaded expense profile
instead of gesturing at it, docs/workbook-use.md drops a claim that fits
any spreadsheet, two CHANGELOG.md kicker sentences and its two em dashes
go, and llms.txt opens with what the library actually ships.

Verified: ruff check, mypy, verify_workbook, verify_sources,
verify_signatures, verify_previous_names, verify_index, verify_afe all
pass, and unittest discover runs 216 tests OK (218 before the two deleted
tests). Breaking the shared reader to return "" fails 22 postbuild tests;
restored. No workbook, src/, AFE store or functions.csv change.
@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Powered by Qodo

@ryanduguid
ryanduguid merged commit 8b48a42 into main Sep 7, 2026
7 checks passed
@ryanduguid
ryanduguid deleted the ryan/ponytail-stop-slop branch September 7, 2026 12:06
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