Skip to content

Version 0.10.0: the 70 models no operation reaches are removed - #18

Merged
bensynapse merged 3 commits into
mainfrom
remove-legacy-models
Nov 16, 2026
Merged

bensynapse merged 3 commits into
mainfrom
remove-legacy-models

Conversation

@bensynapse

Copy link
Copy Markdown
Contributor

0.10.0 stops shipping the old admin and analytics schemas as public models. It follows API 1.20.11, as 0.9.1 did. No client method, argument or return type changed.

Which models, and how they were found

faxforagents.models had 244 models. An AST walk of client.py and async_client.py finds 133 of them named as m.<Name>, the same 133 in both. With the models those reach through their fields, that is 156.

The public document of API 1.20.11 (faxforagents/openapi at e5d64d8) defines 174 schemas. The saved spec had those 174 and 70 more, and none of the 70 is among the 156. A third view agrees. Following every $ref from the 163 operations of the saved spec reaches exactly the 174.

The older server documents vendored in the openapi repository show where each of the 70 was used:

  • 43 under /v1/admin, the admin console, analytics included
  • 17 under /v1/auth, the dashboard sign-in
  • 5 under /v1/oauth/authorizations, the consent calls
  • 2 for the Stripe and Telnyx receivers under /webhooks
  • 3 module-qualified names the server gave InboxItem, InboxItemSummary and Me, which stay

64 came in with 0.2.2 and 6 with 0.2.3. The CHANGELOG lists all 70 by name under "Removed".

What changed

spec/openapi.yaml drops the 70 schemas, one block at the end of components.schemas. Parsed, the new file equals the old one without those 70 keys. models.py is regenerated, and the 174 kept classes are byte for byte the same. Only OrganizationSummary moved, because Accepted no longer pulls it to the top.

scripts/gen_models.py writes a model only for a schema that an operation reaches. curate.py builds the public document by the same rule. So a refresh that brings the server's own schemas back still leaves them out of models.py.

tests/test_removed_models.py fails when one of the 70 is back in faxforagents.models or the generator would model one. It also fails when the saved spec holds a schema that no operation reaches.

The version is 0.10.0 in pyproject.toml and __init__.py. The README says how the spec and the generator work now.

A second commit rewords five older README and CHANGELOG lines, so every prose line passes the human-writing lint (docs channel). The brand header is unchanged. The lint still flags its HTML, the align="center" attribute and the link and badge rows.

Checked

  • pytest -q -m "not live": 187 pass, 4 of them new. The live test was not run, since it needs a test key.
  • Each new test was seen to fail. The triggers were AdminStats back in the spec, a removed class added to models.py and the generator without its filter.
  • ruff check src tests, ruff format --check src tests, mypy src, python scripts/gen_models.py --check and sh scripts/truthcheck.sh pass.
  • python -m build and twine check --strict pass. The wheel with [cli] installs in a clean venv and faxforagents version prints 0.10.0.
  • In that venv faxforagents.models has 174 names and from faxforagents.models import AdminStats raises ImportError.

No workflow file changed. Nothing is merged, tagged, released or published by this pull request.

No method of either client takes or returns them, directly or in a field.
The public document of API 1.20.11 does not define them.
Most came in 0.2.2 and 0.2.3 from the admin console and the dashboard sign-in of the server's own document.
The saved spec drops the same 70 schemas and keeps the 174 that the public operations reach.
gen_models.py now models only a schema that an operation reaches, the rule the public document is curated by.
tests/test_removed_models.py fails when one of the 70 is back in the package or the spec.
The CHANGELOG lists all 70 under Removed. The README says how the spec and the generator work now.
The meaning of each line is unchanged.
One README sentence of 33 words is split in two.
Three lines read "API key" where the lint took "key" for an adjective.
A semicolon in the 0.2.4 entry becomes a full stop.
The comment said the admin schemas point at a model the clients use.
None of them does. Only Accepted and the sign-in Me did.
@bensynapse
bensynapse merged commit a73d9c0 into main Nov 16, 2026
12 checks passed
@bensynapse
bensynapse deleted the remove-legacy-models branch November 16, 2026 12:59
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