Skip to content

Remove documentation rot and tighten the prose - #98

Open
splch wants to merge 2 commits into
scan-findings/2-simplifyfrom
scan-findings/3-prose
Open

Remove documentation rot and tighten the prose#98
splch wants to merge 2 commits into
scan-findings/2-simplifyfrom
scan-findings/3-prose

Conversation

@splch

@splch splch commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

Part 3 of the stack #96 -> #97 -> #98 -> #95; merge bottom-up (each PR targets the previous one's branch). Removes documentation rot and drift opportunities, then shortens the remaining prose.

  • Fixes drift that had already happened (CONTRIBUTING described a post-hook that no longer existed; the exceptions example referenced an undefined name).
  • Prose that restates code is deleted or converted to a pointer at the source of truth: hook enumerations point at the self-commented config, _transport's docstring names constants instead of repeating retry numbers, AGENTS.md drops rot-prone counts and literals plus its drifted third copy of the regen command.
  • What must state a value is pinned in test_docs_consistency.py: IonQClient's documented defaults, the setup-uv composite's Python default, the spec-drift SPEC_URL, and a new guard that parses every ```python fence in README and the published docstrings (12 today), so examples can no longer rot silently.
  • Documented setup commands fixed: plain pre-commit is not installed by uv sync; both docs now use uvx pre-commit.

Test plan

  • uv run pytest at this head: 275 passed (new pins and the example parse guard included), 100% branch coverage, warnings-as-errors.
  • uv run ruff check, uv run ruff format --check, uv run ty check ionq_core/: clean. pdoc builds.
  • Verified the example guard finds all 12 fences rather than passing vacuously.

Important

Most code in ionq_core/ is auto-generated and overwritten on regeneration.
See CONTRIBUTING.md for which files are safe to edit.

splch added 2 commits August 25, 2026 15:48
Prose that restates code is deleted, converted to a pointer at the source
of truth, or pinned by tests/test_docs_consistency.py:

- Fix drift that had already happened: CONTRIBUTING still said the
  post-hooks "run ruff fix-and-format" after the fix hook was removed. The
  hook enumeration there is now a pointer, and every hook in
  openapi-python-client-config.yaml carries its own explanatory comment.
- exceptions' module example imported nothing and referenced an undefined
  payload; it now imports create_job and elides the body honestly.
- Remove unpinned numeric copies: _transport's docstring no longer repeats
  the retry codes and backoff knobs (it names RETRYABLE_STATUS_CODES and
  build_transport instead); ClientExtension.retryable_status_codes points
  at the constant rather than enumerating it; "Defaults to
  DEFAULT_MAX_RETRIES (2)" drops the "(2)".
- Remove rot-prone literals from AGENTS.md: the "Four have non-obvious
  behavior" workflow count and the fixture bullet's hardcoded token and
  test base URL.
- New pins: IonQClient's user-facing defaults (retries, timeout read and
  connect) now track the constants; the setup-uv composite's hardcoded
  python-version default tracks .python-version; and every python code
  fence in README and the published docstrings (12 today) must parse, so
  example code can no longer rot silently.
Prose-only pass over comments, docstrings, and docs: delete what restates
the code, tighten what stays, keep constraints and why-notes. No behavior
change; generated files untouched.

@natestemen natestemen 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.

LGTM. Did you tell an agent to use ASD-STE100 Simplified Technical English? I've seen that's all the rage nowadays.

Comment thread ionq_core/_transport.py
Comment on lines -150 to +136
max_retries: Maximum number of retry attempts. Defaults to
`DEFAULT_MAX_RETRIES` (2).
retryable_status_codes: HTTP status codes that trigger a retry.
Defaults to `RETRYABLE_STATUS_CODES`.
verify: TLS verification (``True``/``False``, a CA bundle path, or an
``ssl.SSLContext``) applied to the underlying transports; httpx
ignores client-level ``verify`` when a custom transport is
supplied, so it must be configured here to take effect.

Returns:
A configured `ErrorRaisingTransport` ready to be passed to an
httpx client (sync or async).
verify: TLS verification (``True``/``False``, a CA bundle path, or an ``ssl.SSLContext``)
applied to the underlying transports. httpx ignores client-level ``verify`` when a
custom transport is supplied, so it must be set here to take effect.

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.

Looks like some of the argument descriptions got dropped. Was that intentional?

Comment thread AGENTS.md

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.

Might be worth a comment in this file about catching drift between docs and code, and also whatever writing style you recommended for the agent that made the changes in this PR.

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