Skip to content

Tighten SECURITY.md and prune docs-consistency tests#31

Merged
splch merged 10 commits intomainfrom
churchill/release-readiness
Apr 29, 2026
Merged

Tighten SECURITY.md and prune docs-consistency tests#31
splch merged 10 commits intomainfrom
churchill/release-readiness

Conversation

@splch
Copy link
Copy Markdown
Collaborator

@splch splch commented Apr 29, 2026

Summary

  • Drop PVR from SECURITY.md and route reports to security@ionq.co only. Private vulnerability reporting is disabled on the repo, so the previous "preferred" link rendered a dead form for external reporters; the security team monitors the email channel. Also fixes the stale "channels above" plural left behind in the safe-harbor paragraph.
  • Prune low-value pins from tests/test_docs_consistency.py per "test only what is likely to drift AND likely to be bad": drop test_retryable_status_codes_match_runtime (tautological self-pin), test_session_example_backend_consistent (stylistic, reviewer-visible), and the three *_canonical description tests (description rarely changes, divergence is benign).
  • Drop test_default_base_url_matches_spec_servers. Under the documented regen workflow DEFAULT_BASE_URL -> docs -> curl URL -> spec path are chained, and test_spec_path_matches_default_base_url already pins DEFAULT_BASE_URL.path into CONTRIBUTING.md and spec-drift.yml. Verified by fetching https://api-staging.ionq.co/v0.4/api-docs and regenerating end-to-end: staging declares the prod URL in servers[0] and the generated tree is byte-identical to a prod regen.

Test plan

  • uv run pytest tests/test_docs_consistency.py --no-cov passes (22/22, down from 26/26).
  • uv run ruff check tests/test_docs_consistency.py clean.
  • uv run ruff format --check tests/test_docs_consistency.py clean.
  • Verified staging regeneration end-to-end: curl https://api-staging.ionq.co/v0.4/api-docs returns 200, generator runs cleanly, diff -rq of staging-generated vs prod-generated trees is empty.
  • SECURITY.md renders correctly on GitHub with the email-only intake.

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 5 commits April 29, 2026 14:05
Private vulnerability reporting is disabled on this repo, so the previous
"preferred" link rendered a dead form for external reporters. The IonQ
security team monitors security@ionq.co; make that the only documented
channel and stop pointing reporters at a route that GitHub does not
forward to the team's inbox.
After dropping PVR there is only one reporting channel; update the
safe-harbor paragraph to say "the email above" instead.
Apply the philosophy "pin where drift is likely AND bad":

- test_retryable_status_codes_match_runtime: tautological self-pin; the
  set is checked against a copy of itself, no second source of truth.
- test_session_example_backend_consistent: stylistic check that all
  SessionManager examples in session.py share one backend literal.
  Pure consistency, no runtime correctness link, easily caught in
  review.
- test_pyproject_description_canonical / _init_module_docstring_canonical
  / _readme_tagline_canonical: the package description rarely changes,
  and divergence across pyproject / __init__.py / README is benign and
  reviewer-visible. Three pins for a once-set string isn't worth the
  maintenance overhead.
Previously test_default_base_url_matches_spec_servers compared the
full URL of openapi.json's first server entry against DEFAULT_BASE_URL,
which forced the spec to come from the production host. Regenerating
the client from staging (different host, same /v0.4 path) tripped the
test even though the API-version contract was identical.

The version path is the actual safety property the test cares about;
the host is just the environment, and the runtime base URL is
overridable on IonQClient anyway. Compare urlparse(...).path on both
sides so staging regenerations pass while a /v0.4 -> /v0.5 bump still
fails until DEFAULT_BASE_URL is updated.
The committed openapi.json's servers[0] path is whatever URL the
spec was fetched from. CONTRIBUTING.md hardcodes that fetch URL,
and test_spec_path_matches_default_base_url already pins
DEFAULT_BASE_URL.path into CONTRIBUTING.md and spec-drift.yml.
Under the documented regeneration workflow the spec path equals
DEFAULT_BASE_URL.path by construction; the only failure modes
left are manual fetches from a wrong version or version bumps
without regenerating, both of which code review catches.
@splch splch requested a review from a team as a code owner April 29, 2026 21:27
Likely to drift (every release) and bad if it does (shipped artifact's
version disagrees with the changelog readers consult to know what's in
it). The release.yml verify-version step already pins the git tag to
pyproject; this adds the missing CHANGELOG side of that triangle.
guenp
guenp previously approved these changes Apr 29, 2026
@splch splch changed the title Tighten SECURITY.md and prune docs-consistency tests Tighten SECURITY.md and adjust docs-consistency suite Apr 29, 2026
Cynocracy
Cynocracy previously approved these changes Apr 29, 2026
On honest reflection neither axis of the philosophy holds: release
prep tightly couples a pyproject bump with the CHANGELOG rename so
drift is unlikely, and "gh release create --generate-notes" already
gives users a fallback view of what changed if CHANGELOG.md ever
goes stale. Quality erosion at best, not the case-1 "likely AND bad"
the test was added under.
@splch splch dismissed stale reviews from Cynocracy and guenp via 785948a April 29, 2026 21:39
@splch splch changed the title Tighten SECURITY.md and adjust docs-consistency suite Tighten SECURITY.md and prune docs-consistency tests Apr 29, 2026
- Drop static (429, 500, 502, 503, "520-529") pins from
  test_client_extension_docstring_pins. They were hardcoded
  copies not derived from RETRYABLE_STATUS_CODES, so they
  inverted the drift the test claims to catch: additions to
  the constant go unnoticed, and docstring reformats fail
  spuriously.

- Add test_spec_servers_path_in_docs to close the docs <-> spec
  edge of the (DEFAULT_BASE_URL, docs, spec) triangle.

- Collapse multi-line WHY comments on four tests to one line.
Cynocracy
Cynocracy previously approved these changes Apr 29, 2026
@splch splch merged commit 07a346f into main Apr 29, 2026
10 checks passed
@splch splch deleted the churchill/release-readiness branch April 29, 2026 22:08
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.

3 participants