Skip to content

feat: typespecs for the public API, Dialyzer in CI, doctests, grouped docs - #6

Merged
schainks merged 2 commits into
mainfrom
feat/typespecs-and-docs
Oct 12, 2026
Merged

schainks merged 2 commits into
mainfrom
feat/typespecs-and-docs

Conversation

@schainks

Copy link
Copy Markdown
Owner

Stacked on #5 (which is stacked on #2). Merge order: #2, #5, then this. GitHub retargets each to main as the one below it merges.

Types and specs

  • New public types: SystemOneClient.option/0 and options/0 (every option evaluate/3 accepts), error/0 (every error SystemOneClient.HTTP returns), questions/0, question_id/0, and SystemOneClient.Provider.name/0.
  • Specs on both evaluate/3 implementations and on Provider.resolve/1; the behaviour callback uses the new types.
  • Dialyzer runs with :unmatched_returns, :error_handling, :extra_return and :missing_return: 0 errors. It runs in the CI lint job with a cached PLT in priv/plts, which is git-ignored.

Docs

  • 8 doctests on the pure functions (validate_questions/1, Answer.parse/1, Provider.resolve/1, the OpenAI request encoder). They run in mix test and show as examples on hexdocs.
  • ex_doc groups modules into Client, Providers, Answers and Testing.
  • CHANGELOG entries under 0.2.0.

Verified locally

63 tests (55 plus 8 doctests), Dialyzer in dev and test, credo --strict, format, warnings-as-errors, docs --warnings-as-errors.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GCRzC1xV9gCW4bf7LzBGcB

schainks and others added 2 commits October 11, 2026 01:40
… docs

- SystemOneClient.option/0, options/0, error/0, questions/0 and
  Provider.name/0 types; specs on both evaluate/3 implementations and on
  Provider.resolve/1, all checked by Dialyzer with :unmatched_returns,
  :error_handling, :extra_return and :missing_return (0 errors)
- Dialyzer runs in the CI lint job with a cached PLT (priv/plts, ignored)
- 8 doctests on the pure functions, run from test/system_one_client/doctest_test.exs
- ex_doc groups modules into Client, Providers, Answers and Testing

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GCRzC1xV9gCW4bf7LzBGcB
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GCRzC1xV9gCW4bf7LzBGcB
@schainks
schainks changed the base branch from chore/ci-and-package-hygiene to main October 12, 2026 17:28
@schainks
schainks merged commit ce689ea into main Oct 12, 2026
5 checks passed
@schainks
schainks deleted the feat/typespecs-and-docs branch October 12, 2026 17:30
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