apiwells 0.1.0__tar.gz → 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. apiwells-0.2.0/CHANGELOG.md +28 -0
  2. apiwells-0.2.0/PKG-INFO +197 -0
  3. apiwells-0.2.0/README.md +179 -0
  4. apiwells-0.2.0/docs/COMPATIBILITY.md +34 -0
  5. apiwells-0.2.0/docs/RELEASE_CHECKLIST.md +79 -0
  6. apiwells-0.2.0/docs/TEST_PLAN.md +132 -0
  7. apiwells-0.2.0/docs/V0.2_SPEC.md +121 -0
  8. apiwells-0.2.0/docs/compatibility/compatibility-matrix.md +86 -0
  9. apiwells-0.2.0/docs/compatibility/model0001-deepseek-flash.md +102 -0
  10. apiwells-0.2.0/docs/compatibility/model0002-alibaba-qwen37-plus.md +102 -0
  11. apiwells-0.2.0/docs/compatibility/model0003-openrouter-ling30-flash-fin.md +109 -0
  12. apiwells-0.2.0/docs/releases/0.1.0/VALIDATION.md +37 -0
  13. {apiwells-0.1.0 → apiwells-0.2.0}/pyproject.toml +30 -27
  14. {apiwells-0.1.0 → apiwells-0.2.0}/src/apiwells/__init__.py +2 -2
  15. apiwells-0.2.0/src/apiwells/cli.py +588 -0
  16. apiwells-0.2.0/src/apiwells/config.py +61 -0
  17. apiwells-0.2.0/src/apiwells/models/__init__.py +11 -0
  18. apiwells-0.2.0/src/apiwells/models/errors.py +62 -0
  19. apiwells-0.2.0/src/apiwells/models/result.py +56 -0
  20. apiwells-0.2.0/src/apiwells/probes/__init__.py +27 -0
  21. apiwells-0.2.0/src/apiwells/probes/chat.py +236 -0
  22. apiwells-0.2.0/src/apiwells/probes/connectivity.py +557 -0
  23. apiwells-0.2.0/src/apiwells/probes/models.py +280 -0
  24. apiwells-0.2.0/src/apiwells/probes/streaming.py +722 -0
  25. apiwells-0.2.0/src/apiwells/probes/structured.py +817 -0
  26. apiwells-0.2.0/src/apiwells/probes/tools.py +749 -0
  27. apiwells-0.2.0/src/apiwells/probes/usage.py +92 -0
  28. apiwells-0.2.0/src/apiwells/reporting/__init__.py +21 -0
  29. apiwells-0.2.0/src/apiwells/reporting/aggregation.py +55 -0
  30. apiwells-0.2.0/src/apiwells/reporting/console.py +192 -0
  31. apiwells-0.2.0/src/apiwells/reporting/json_report.py +69 -0
  32. apiwells-0.2.0/src/apiwells/reporting/redaction.py +225 -0
  33. apiwells-0.2.0/src/apiwells/runner.py +217 -0
  34. apiwells-0.2.0/src/apiwells/transport.py +242 -0
  35. apiwells-0.2.0/src/apiwells.egg-info/PKG-INFO +197 -0
  36. apiwells-0.2.0/src/apiwells.egg-info/SOURCES.txt +74 -0
  37. apiwells-0.2.0/src/apiwells.egg-info/requires.txt +1 -0
  38. apiwells-0.2.0/tests/integration/mock_server/__init__.py +0 -0
  39. apiwells-0.2.0/tests/integration/mock_server/responses.py +147 -0
  40. apiwells-0.2.0/tests/integration/mock_server/scenarios.py +21 -0
  41. apiwells-0.2.0/tests/integration/mock_server/server.py +842 -0
  42. apiwells-0.2.0/tests/integration/test_basic_full_flow.py +398 -0
  43. apiwells-0.2.0/tests/integration/test_cli_matrix.py +369 -0
  44. apiwells-0.2.0/tests/integration/test_deep_full_flow.py +418 -0
  45. apiwells-0.2.0/tests/integration/test_mock_gap_closure.py +328 -0
  46. apiwells-0.2.0/tests/integration/test_mock_server.py +337 -0
  47. apiwells-0.2.0/tests/integration/test_reporter_contract.py +378 -0
  48. apiwells-0.2.0/tests/integration/test_secret_safety_full_flow.py +422 -0
  49. apiwells-0.2.0/tests/test_basic_runner.py +248 -0
  50. apiwells-0.2.0/tests/test_chat_probe.py +431 -0
  51. apiwells-0.2.0/tests/test_cli_reporting.py +285 -0
  52. apiwells-0.2.0/tests/test_config.py +43 -0
  53. apiwells-0.2.0/tests/test_connectivity_probe.py +810 -0
  54. apiwells-0.2.0/tests/test_console_reporter.py +270 -0
  55. apiwells-0.2.0/tests/test_deep_runner.py +792 -0
  56. apiwells-0.2.0/tests/test_errors.py +48 -0
  57. apiwells-0.2.0/tests/test_json_reporter.py +265 -0
  58. apiwells-0.2.0/tests/test_models_probe.py +342 -0
  59. apiwells-0.2.0/tests/test_redaction.py +157 -0
  60. apiwells-0.2.0/tests/test_reporting_aggregation.py +121 -0
  61. apiwells-0.2.0/tests/test_result.py +98 -0
  62. apiwells-0.2.0/tests/test_runner.py +75 -0
  63. apiwells-0.2.0/tests/test_secret_leak.py +397 -0
  64. apiwells-0.2.0/tests/test_streaming_probe.py +1022 -0
  65. apiwells-0.2.0/tests/test_structured_probe.py +610 -0
  66. apiwells-0.2.0/tests/test_tool_probe.py +733 -0
  67. apiwells-0.2.0/tests/test_transport.py +562 -0
  68. apiwells-0.2.0/tests/test_usage.py +157 -0
  69. apiwells-0.1.0/CHANGELOG.md +0 -6
  70. apiwells-0.1.0/PKG-INFO +0 -118
  71. apiwells-0.1.0/README.md +0 -101
  72. apiwells-0.1.0/docs/PUBLISH_ZH.md +0 -290
  73. apiwells-0.1.0/src/apiwells/cli.py +0 -178
  74. apiwells-0.1.0/src/apiwells.egg-info/PKG-INFO +0 -118
  75. apiwells-0.1.0/src/apiwells.egg-info/SOURCES.txt +0 -15
  76. {apiwells-0.1.0 → apiwells-0.2.0}/LICENSE +0 -0
  77. {apiwells-0.1.0 → apiwells-0.2.0}/MANIFEST.in +0 -0
  78. {apiwells-0.1.0 → apiwells-0.2.0}/setup.cfg +0 -0
  79. {apiwells-0.1.0 → apiwells-0.2.0}/src/apiwells/__main__.py +0 -0
  80. {apiwells-0.1.0 → apiwells-0.2.0}/src/apiwells.egg-info/dependency_links.txt +0 -0
  81. {apiwells-0.1.0 → apiwells-0.2.0}/src/apiwells.egg-info/entry_points.txt +0 -0
  82. {apiwells-0.1.0 → apiwells-0.2.0}/src/apiwells.egg-info/top_level.txt +0 -0
  83. {apiwells-0.1.0 → apiwells-0.2.0}/tests/test_doctor.py +0 -0
@@ -0,0 +1,28 @@
1
+ # Changelog
2
+
3
+ ## Unreleased — v0.2 development
4
+
5
+ The package and CLI remain at 0.1.0 (v0.2 development build); v0.2.0 has not
6
+ been released.
7
+
8
+ - Add Basic connectivity/authentication/models diagnostics and explicit-model
9
+ Deep capability diagnostics while retaining legacy `--chat` behavior.
10
+ - Validate Streaming/SSE and report client TTFT and total latency.
11
+ - Parse provider-reported Usage without estimating missing token counts.
12
+ - Validate Tool Calling through the complete local-tool/two-request round trip.
13
+ - Validate Structured Output against JSON Schema, distinguishing strict schema
14
+ support from JSON-object-only behavior.
15
+ - Separate probe execution status from capability support.
16
+ - Add a shared error taxonomy and centralized secret redaction.
17
+ - Add versioned structured JSON reporting alongside compatibility reports.
18
+ - Validate live endpoint compatibility with three preserved ED-031 records;
19
+ results remain point-in-time observations, including partial capabilities.
20
+ - Validate local wheel/sdist packaging and Windows clean installation, including
21
+ Basic and critical Deep smoke checks and 43 clean-wheel integration tests.
22
+ - Document Local-First/no-telemetry behavior, security boundaries, test coverage
23
+ and remaining release gates.
24
+
25
+ ## 0.1.0
26
+ - Add a single-request models endpoint check and opt-in text chat smoke check.
27
+ - Add HTTP/network failure categories, response shape checks and sanitized JSON.
28
+ - Disable redirects, retries and implicit environment proxy use.
@@ -0,0 +1,197 @@
1
+ Metadata-Version: 2.4
2
+ Name: apiwells
3
+ Version: 0.2.0
4
+ Summary: Endpoint Doctor for OpenAI-compatible model APIs
5
+ License-Expression: MIT
6
+ Keywords: api,diagnostics,llm,endpoint
7
+ Classifier: Development Status :: 3 - Alpha
8
+ Classifier: Environment :: Console
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Operating System :: OS Independent
12
+ Classifier: Topic :: Software Development :: Testing
13
+ Requires-Python: >=3.10
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+ Requires-Dist: jsonschema<5,>=4.26
17
+ Dynamic: license-file
18
+
19
+ # ApiWells Endpoint Doctor
20
+
21
+ A Local-First CLI for diagnosing OpenAI-compatible model API endpoints from
22
+ your machine. Endpoint Doctor checks connectivity and protocol capabilities;
23
+ it does not score model quality. Python 3.10+ is required.
24
+
25
+ This checkout is a **v0.2 development build**. The installed package and CLI
26
+ version remain **0.1.0**; v0.2.0 has not been released. Runtime dependencies
27
+ include `jsonschema` for Structured Output validation.
28
+
29
+ ## Install
30
+
31
+ Install the current released package from PyPI:
32
+
33
+ ```sh
34
+ python -m pip install apiwells
35
+ apiwells --version
36
+ ```
37
+
38
+ The current repository contains v0.2 development work but remains at version
39
+ 0.1.0 until RC version synchronization. v0.2.0 has not been released to PyPI.
40
+
41
+ Install this local checkout with:
42
+
43
+ ```sh
44
+ python -m pip install .
45
+ ```
46
+
47
+ The checkout's version command currently prints `apiwells 0.1.0`.
48
+
49
+ ## Basic Doctor
50
+
51
+ Set `APIWELLS_API_KEY` using your shell's secret-input mechanism. Do not put a
52
+ real key in a command, screenshot, issue or repository. Use `--api-key-env NAME`
53
+ to select another environment variable.
54
+
55
+ ```sh
56
+ apiwells doctor --base-url https://YOUR-API-HOST/v1
57
+ apiwells doctor --base-url https://YOUR-API-HOST/v1 --v2-json
58
+ ```
59
+
60
+ Basic is the default mode: **URL → DNS → TLS → HTTP → Authentication → /models**.
61
+ It sends no inference request. HTTP, authentication and model-list checks share
62
+ one GET to `BASE/models`. An empty model list can pass the response-shape check;
63
+ a model list alone does not prove inference works.
64
+
65
+ Supply the exact API base: `/v1` is not added automatically. For a gateway with
66
+ `/openai/v1`, include that prefix. Do not supply the full `/models` or
67
+ `/chat/completions` URL.
68
+
69
+ For a local unauthenticated development server:
70
+
71
+ ```sh
72
+ apiwells doctor --base-url http://127.0.0.1:3000/v1 --anonymous
73
+ ```
74
+
75
+ ## Deep Doctor
76
+
77
+ ```sh
78
+ apiwells doctor --base-url https://YOUR-API-HOST/v1 --deep --model YOUR-MODEL-ID
79
+ apiwells doctor --base-url https://YOUR-API-HOST/v1 --deep --model YOUR-MODEL-ID --v2-json
80
+ ```
81
+
82
+ Deep requires an explicit, nonempty model ID and follows:
83
+ **Basic → Chat → Streaming/SSE → Usage → Tool Calling → Structured Output**.
84
+ Usage is extracted from Chat and Streaming responses, not a separate request.
85
+ Capability probes run only after Basic passes and the requested model is found.
86
+
87
+ Deep makes multiple potentially billable inference requests:
88
+
89
+ - Chat validates a nonempty assistant text response.
90
+ - Streaming validates SSE framing, output and terminal `[DONE]`; it reports
91
+ TTFT and total latency. TTFT is measured from request start to the first valid
92
+ model-output event. HTTP headers, keepalive, role-only, empty and metadata-only
93
+ events do not count.
94
+ - Usage contains provider-reported token counts only. Missing values remain
95
+ unavailable or null; ApiWells never estimates them.
96
+ - Tool Calling must complete a full round trip: tool call, validated arguments,
97
+ local diagnostic tool execution, tool result, second request and a final
98
+ response using that result. Merely accepting `tools` is insufficient.
99
+ - Structured Output must return JSON that passes the requested JSON Schema.
100
+ An explicit rejection of `json_schema` as unsupported can trigger one
101
+ additional, potentially billable `json_object` sub-test. JSON-object-only
102
+ success does not certify strict JSON Schema support.
103
+
104
+ There are no hidden billable retries or fallback models. The Tool Calling
105
+ second request and conditional Structured Output sub-test are diagnostic steps,
106
+ with request counts included in their results. `--max-tokens` controls applicable
107
+ generation budgets and is not a guaranteed total cost ceiling; diagnostic
108
+ sub-tests may use bounded request parameters. Provider support varies; not every
109
+ endpoint supports every capability.
110
+
111
+ ## Legacy chat compatibility
112
+
113
+ ```sh
114
+ apiwells doctor --base-url https://YOUR-API-HOST/v1 --chat --model YOUR-MODEL-ID --json
115
+ ```
116
+
117
+ Legacy `--chat` remains a single, opt-in, potentially billable non-streaming
118
+ request to `BASE/chat/completions`, with `Reply OK.` and default `max_tokens=8`.
119
+ A pass requires nonempty assistant text, not exactly `OK`. Use `--max-tokens 32`
120
+ to change the budget; some models need more output tokens. It performs no
121
+ automatic retry or fallback model selection. `--chat` and `--deep` are mutually
122
+ exclusive.
123
+
124
+ ## Results and timing
125
+
126
+ Probe execution status (`PASS`, `FAIL`, `PARTIAL`) is separate from capability
127
+ support (`SUPPORTED`, `UNSUPPORTED`, `UNKNOWN`, `NOT_APPLICABLE`). A failed or
128
+ partial probe with unknown support does not establish that a capability is
129
+ unsupported. Core failures make the overall result FAIL; non-passing
130
+ Streaming, Tool Calling or Structured Output probes make it PARTIAL when core
131
+ checks pass.
132
+
133
+ The exit-code contract remains:
134
+
135
+ | Code | Meaning |
136
+ |---|---|
137
+ | `0` | Selected check / overall diagnostics passed |
138
+ | `1` | Endpoint diagnostics did not pass, including an overall PARTIAL |
139
+ | `2` | Local usage or configuration error |
140
+
141
+ For Basic/Deep, `--v2-json` writes a versioned JSON report with
142
+ `schema_version: "1"`, `apiwells_version`, `overall_status` and `probes`.
143
+ Each probe includes status, support, summary, metrics, evidence and error code.
144
+ The report schema version is independent of the package version.
145
+ `--json` retains the compatibility report with `ok`; legacy `--chat --json`
146
+ retains its single-check report. Use `--json`, not `--v2-json`, for legacy chat.
147
+ Completed checks produce one JSON object on stdout; usage/configuration errors
148
+ go to stderr and do not produce a JSON report.
149
+
150
+ Error codes distinguish configuration, DNS/TLS/connectivity/timeout, HTTP/auth,
151
+ JSON/schema, SSE/interruption and capability validation failures. They are
152
+ diagnostic evidence, not definitive root-cause conclusions.
153
+
154
+ `--timeout 15` is a socket-operation timeout, not an overall deadline. Client
155
+ TTFT and total latency include transport effects and are not server-only
156
+ inference timings. Legacy `elapsed_ms` is request/response elapsed time, not
157
+ streaming TTFT.
158
+
159
+ ## Security and boundaries
160
+
161
+ - Local-First execution; no telemetry or hidden upload of prompts, responses or
162
+ usage. Requested diagnostic traffic goes to the endpoint you select.
163
+ - API keys and Authorization header values must not be printed. Centralized
164
+ redaction protects console/JSON reports and error paths; raw provider bodies
165
+ are not dumped into reports. Review reports before sharing.
166
+ - HTTPS certificate verification stays enabled. Remote HTTP requires
167
+ `--allow-http`; literal loopback addresses and localhost are allowed for
168
+ development.
169
+ - All redirects, including same-host redirects, are blocked so credentials are
170
+ not forwarded to redirect destinations.
171
+ - Environment proxies are ignored unless `--use-env-proxy` is supplied.
172
+ - Test only endpoints you are authorized to test. Private/local destinations are
173
+ intentionally allowed; this CLI is not an unrestricted server-side URL fetcher.
174
+
175
+ See [Security](SECURITY.md) for handling and reporting guidance.
176
+
177
+ ## Compatibility and development
178
+
179
+ [Compatibility](docs/COMPATIBILITY.md) indexes three point-in-time ED-031 live
180
+ certification records. These establish observed endpoint behavior, not
181
+ universal provider support or model quality.
182
+
183
+ [The release-facing specification](docs/V0.2_SPEC.md) summarizes the frozen
184
+ v0.2 scope. Benchmark, scoring/ranking, recommendations, cost optimization,
185
+ Router, Gateway, long-term Monitoring, Web Dashboard, SaaS accounts, cloud
186
+ telemetry and complete Responses API coverage are outside that scope.
187
+
188
+ For test coverage and the observed QA harness dependencies, see
189
+ [the test plan](docs/TEST_PLAN.md). With the test harness installed, run:
190
+
191
+ ```sh
192
+ python -m pytest tests -q
193
+ ```
194
+
195
+ See [the release checklist](docs/RELEASE_CHECKLIST.md) for completed evidence
196
+ and pending release gates, and [the changelog](CHANGELOG.md) for changes.
197
+ License: MIT.
@@ -0,0 +1,179 @@
1
+ # ApiWells Endpoint Doctor
2
+
3
+ A Local-First CLI for diagnosing OpenAI-compatible model API endpoints from
4
+ your machine. Endpoint Doctor checks connectivity and protocol capabilities;
5
+ it does not score model quality. Python 3.10+ is required.
6
+
7
+ This checkout is a **v0.2 development build**. The installed package and CLI
8
+ version remain **0.1.0**; v0.2.0 has not been released. Runtime dependencies
9
+ include `jsonschema` for Structured Output validation.
10
+
11
+ ## Install
12
+
13
+ Install the current released package from PyPI:
14
+
15
+ ```sh
16
+ python -m pip install apiwells
17
+ apiwells --version
18
+ ```
19
+
20
+ The current repository contains v0.2 development work but remains at version
21
+ 0.1.0 until RC version synchronization. v0.2.0 has not been released to PyPI.
22
+
23
+ Install this local checkout with:
24
+
25
+ ```sh
26
+ python -m pip install .
27
+ ```
28
+
29
+ The checkout's version command currently prints `apiwells 0.1.0`.
30
+
31
+ ## Basic Doctor
32
+
33
+ Set `APIWELLS_API_KEY` using your shell's secret-input mechanism. Do not put a
34
+ real key in a command, screenshot, issue or repository. Use `--api-key-env NAME`
35
+ to select another environment variable.
36
+
37
+ ```sh
38
+ apiwells doctor --base-url https://YOUR-API-HOST/v1
39
+ apiwells doctor --base-url https://YOUR-API-HOST/v1 --v2-json
40
+ ```
41
+
42
+ Basic is the default mode: **URL → DNS → TLS → HTTP → Authentication → /models**.
43
+ It sends no inference request. HTTP, authentication and model-list checks share
44
+ one GET to `BASE/models`. An empty model list can pass the response-shape check;
45
+ a model list alone does not prove inference works.
46
+
47
+ Supply the exact API base: `/v1` is not added automatically. For a gateway with
48
+ `/openai/v1`, include that prefix. Do not supply the full `/models` or
49
+ `/chat/completions` URL.
50
+
51
+ For a local unauthenticated development server:
52
+
53
+ ```sh
54
+ apiwells doctor --base-url http://127.0.0.1:3000/v1 --anonymous
55
+ ```
56
+
57
+ ## Deep Doctor
58
+
59
+ ```sh
60
+ apiwells doctor --base-url https://YOUR-API-HOST/v1 --deep --model YOUR-MODEL-ID
61
+ apiwells doctor --base-url https://YOUR-API-HOST/v1 --deep --model YOUR-MODEL-ID --v2-json
62
+ ```
63
+
64
+ Deep requires an explicit, nonempty model ID and follows:
65
+ **Basic → Chat → Streaming/SSE → Usage → Tool Calling → Structured Output**.
66
+ Usage is extracted from Chat and Streaming responses, not a separate request.
67
+ Capability probes run only after Basic passes and the requested model is found.
68
+
69
+ Deep makes multiple potentially billable inference requests:
70
+
71
+ - Chat validates a nonempty assistant text response.
72
+ - Streaming validates SSE framing, output and terminal `[DONE]`; it reports
73
+ TTFT and total latency. TTFT is measured from request start to the first valid
74
+ model-output event. HTTP headers, keepalive, role-only, empty and metadata-only
75
+ events do not count.
76
+ - Usage contains provider-reported token counts only. Missing values remain
77
+ unavailable or null; ApiWells never estimates them.
78
+ - Tool Calling must complete a full round trip: tool call, validated arguments,
79
+ local diagnostic tool execution, tool result, second request and a final
80
+ response using that result. Merely accepting `tools` is insufficient.
81
+ - Structured Output must return JSON that passes the requested JSON Schema.
82
+ An explicit rejection of `json_schema` as unsupported can trigger one
83
+ additional, potentially billable `json_object` sub-test. JSON-object-only
84
+ success does not certify strict JSON Schema support.
85
+
86
+ There are no hidden billable retries or fallback models. The Tool Calling
87
+ second request and conditional Structured Output sub-test are diagnostic steps,
88
+ with request counts included in their results. `--max-tokens` controls applicable
89
+ generation budgets and is not a guaranteed total cost ceiling; diagnostic
90
+ sub-tests may use bounded request parameters. Provider support varies; not every
91
+ endpoint supports every capability.
92
+
93
+ ## Legacy chat compatibility
94
+
95
+ ```sh
96
+ apiwells doctor --base-url https://YOUR-API-HOST/v1 --chat --model YOUR-MODEL-ID --json
97
+ ```
98
+
99
+ Legacy `--chat` remains a single, opt-in, potentially billable non-streaming
100
+ request to `BASE/chat/completions`, with `Reply OK.` and default `max_tokens=8`.
101
+ A pass requires nonempty assistant text, not exactly `OK`. Use `--max-tokens 32`
102
+ to change the budget; some models need more output tokens. It performs no
103
+ automatic retry or fallback model selection. `--chat` and `--deep` are mutually
104
+ exclusive.
105
+
106
+ ## Results and timing
107
+
108
+ Probe execution status (`PASS`, `FAIL`, `PARTIAL`) is separate from capability
109
+ support (`SUPPORTED`, `UNSUPPORTED`, `UNKNOWN`, `NOT_APPLICABLE`). A failed or
110
+ partial probe with unknown support does not establish that a capability is
111
+ unsupported. Core failures make the overall result FAIL; non-passing
112
+ Streaming, Tool Calling or Structured Output probes make it PARTIAL when core
113
+ checks pass.
114
+
115
+ The exit-code contract remains:
116
+
117
+ | Code | Meaning |
118
+ |---|---|
119
+ | `0` | Selected check / overall diagnostics passed |
120
+ | `1` | Endpoint diagnostics did not pass, including an overall PARTIAL |
121
+ | `2` | Local usage or configuration error |
122
+
123
+ For Basic/Deep, `--v2-json` writes a versioned JSON report with
124
+ `schema_version: "1"`, `apiwells_version`, `overall_status` and `probes`.
125
+ Each probe includes status, support, summary, metrics, evidence and error code.
126
+ The report schema version is independent of the package version.
127
+ `--json` retains the compatibility report with `ok`; legacy `--chat --json`
128
+ retains its single-check report. Use `--json`, not `--v2-json`, for legacy chat.
129
+ Completed checks produce one JSON object on stdout; usage/configuration errors
130
+ go to stderr and do not produce a JSON report.
131
+
132
+ Error codes distinguish configuration, DNS/TLS/connectivity/timeout, HTTP/auth,
133
+ JSON/schema, SSE/interruption and capability validation failures. They are
134
+ diagnostic evidence, not definitive root-cause conclusions.
135
+
136
+ `--timeout 15` is a socket-operation timeout, not an overall deadline. Client
137
+ TTFT and total latency include transport effects and are not server-only
138
+ inference timings. Legacy `elapsed_ms` is request/response elapsed time, not
139
+ streaming TTFT.
140
+
141
+ ## Security and boundaries
142
+
143
+ - Local-First execution; no telemetry or hidden upload of prompts, responses or
144
+ usage. Requested diagnostic traffic goes to the endpoint you select.
145
+ - API keys and Authorization header values must not be printed. Centralized
146
+ redaction protects console/JSON reports and error paths; raw provider bodies
147
+ are not dumped into reports. Review reports before sharing.
148
+ - HTTPS certificate verification stays enabled. Remote HTTP requires
149
+ `--allow-http`; literal loopback addresses and localhost are allowed for
150
+ development.
151
+ - All redirects, including same-host redirects, are blocked so credentials are
152
+ not forwarded to redirect destinations.
153
+ - Environment proxies are ignored unless `--use-env-proxy` is supplied.
154
+ - Test only endpoints you are authorized to test. Private/local destinations are
155
+ intentionally allowed; this CLI is not an unrestricted server-side URL fetcher.
156
+
157
+ See [Security](SECURITY.md) for handling and reporting guidance.
158
+
159
+ ## Compatibility and development
160
+
161
+ [Compatibility](docs/COMPATIBILITY.md) indexes three point-in-time ED-031 live
162
+ certification records. These establish observed endpoint behavior, not
163
+ universal provider support or model quality.
164
+
165
+ [The release-facing specification](docs/V0.2_SPEC.md) summarizes the frozen
166
+ v0.2 scope. Benchmark, scoring/ranking, recommendations, cost optimization,
167
+ Router, Gateway, long-term Monitoring, Web Dashboard, SaaS accounts, cloud
168
+ telemetry and complete Responses API coverage are outside that scope.
169
+
170
+ For test coverage and the observed QA harness dependencies, see
171
+ [the test plan](docs/TEST_PLAN.md). With the test harness installed, run:
172
+
173
+ ```sh
174
+ python -m pytest tests -q
175
+ ```
176
+
177
+ See [the release checklist](docs/RELEASE_CHECKLIST.md) for completed evidence
178
+ and pending release gates, and [the changelog](CHANGELOG.md) for changes.
179
+ License: MIT.
@@ -0,0 +1,34 @@
1
+ # v0.2 Compatibility
2
+
3
+ ED-031 real endpoint/provider live validation is **CLOSED / PASS**. This page is
4
+ a release-facing index; the historical
5
+ [compatibility matrix](compatibility/compatibility-matrix.md) and individual
6
+ records remain the authoritative detailed evidence. An overall PARTIAL record
7
+ does not mean that the ED-031 validation work package failed.
8
+
9
+ | Record | Provider | Model | Test date | ApiWells version | Overall |
10
+ |---|---|---|---|---|---|
11
+ | [MODEL-0001](compatibility/model0001-deepseek-flash.md) | DeepSeek Official | `deepseek-flash` | 2026-09-24 | 0.1.0 (v0.2 development build) | PARTIAL |
12
+ | [MODEL-0002](compatibility/model0002-alibaba-qwen37-plus.md) | Alibaba Cloud Model Studio | `qwen3.7-plus` | 2026-09-27 | 0.1.0 (v0.2 development build) | PASS |
13
+ | [MODEL-0003](compatibility/model0003-openrouter-ling30-flash-fin.md) | OpenRouter | `inclusionai/ling-3.0-flash-fin:free` | 2026-09-27 | 0.1.0 (v0.2 development build) | PARTIAL |
14
+
15
+ ## Interpretation
16
+
17
+ - Results are point-in-time observations for the recorded endpoint, model,
18
+ configuration and date, not permanent provider guarantees.
19
+ - Probe execution status and capability support are separate concepts.
20
+ `FAIL / UNKNOWN` does not establish permanent lack of support;
21
+ `PARTIAL / UNKNOWN` does not mean unsupported.
22
+ - Tool Calling certification requires the full round trip, and Structured
23
+ Output certification requires successful JSON Schema validation. Request
24
+ acceptance alone is insufficient.
25
+ - Some historical records use `AVAILABLE` for Usage. This is a
26
+ compatibility-record-local label meaning provider-reported usage data was
27
+ returned and parsed. It does not add a new ProbeResult support enum; those
28
+ remain `SUPPORTED`, `UNSUPPORTED`, `UNKNOWN` and `NOT_APPLICABLE`.
29
+ - Compatibility evidence is not a model-quality Benchmark, ranking or
30
+ recommendation. Timings are observations, not a performance guarantee.
31
+
32
+ Detailed metrics and qualifications belong to the linked ED-031 records and
33
+ are not duplicated here. ED-032 Windows clean-install smoke evidence validates
34
+ installation and execution; its metrics do not replace ED-031 measurements.
@@ -0,0 +1,79 @@
1
+ # v0.2 Release Checklist
2
+
3
+ Repository release-facing scope reference: [V0.2_SPEC.md](V0.2_SPEC.md), derived
4
+ from the project-level frozen engineering baseline maintained outside the
5
+ repository release artifacts.
6
+
7
+ A checked evidence item applies only to its recorded development build/environment,
8
+ not automatically to a future RC or final artifact. Unverified work stays unchecked.
9
+
10
+ Current baseline: branch `feature/v0.2-diagnostics`, starting commit
11
+ `f63de41`, package/CLI **0.1.0 (v0.2 development build)**.
12
+ v0.2.0 has not been released.
13
+
14
+ ## Completed development-build evidence
15
+
16
+ - [x] ED-031 real endpoint/provider live validation: **CLOSED / PASS**.
17
+ The [compatibility index](COMPATIBILITY.md) links the authoritative matrix
18
+ and MODEL-0001, MODEL-0002 and MODEL-0003 records.
19
+ - [x] ED-032 Windows clean-install test: **CLOSED / PASS**.
20
+ - [x] Local wheel + sdist build: **PASS**.
21
+ - [x] Windows Basic real endpoint smoke: **PASS**.
22
+ - [x] Windows clean-wheel integration suite: **43 passed**.
23
+ - [x] Windows critical Deep smoke: **PASS**.
24
+ - [x] No secret leak observed in the recorded validation.
25
+
26
+ The ED-032 outcomes above are carried forward from the supplied ED-033
27
+ acceptance baseline; they are not newly executed ED-033 checks. They do not
28
+ replace or overwrite ED-031 compatibility measurements. Historical
29
+ [0.1.0 validation](releases/0.1.0/VALIDATION.md) remains separate evidence, not
30
+ v0.2 RC acceptance.
31
+
32
+ ## Frozen Scope gates (section 46)
33
+
34
+ | Gate | Required evidence | Current release disposition |
35
+ |---|---|---|
36
+ | A — Baseline | v0.1 regression tests, editable install, CLI smoke, clean baseline | Historical gate evidence must be included in final release review; no new PASS claimed here |
37
+ | B — Core Architecture | Unified ProbeResult; runner independent of console; reporters do not send HTTP | Implementation described in the spec; final gate acceptance remains to be recorded |
38
+ | C — Functional | Success, unsupported and failure paths for Models, Chat, Streaming, Tools and Structured Output | Test plan covers these paths; complete release validation evidence remains pending |
39
+ | D — Security | Secret Leak Test passes; any complete credential leak blocks release | No leak observed in accepted validation; retain the dedicated release test evidence before final acceptance |
40
+ | E — Real Providers | At least 3 independent providers/endpoints covering 3–5 Chinese models | PASS: closed ED-031 records |
41
+ | F — Package | Build wheel + sdist and clean install | PASS for the development build via ED-032; RC/final artifact acceptance remains pending |
42
+ | G — Release Documentation | README, CHANGELOG, SECURITY and the four release documents | PASS — ED-033 documentation reviewed and accepted |
43
+
44
+ ## Documentation acceptance (ED-033)
45
+
46
+ - [x] Reconcile the release-facing specification/checklist with the supplied
47
+ frozen specification and current CLI compatibility behavior.
48
+ - [x] Reviewer acceptance of README, changelog, security guidance, specification,
49
+ test plan, compatibility index and this checklist (Gate G): PASS.
50
+
51
+ TESTENV-01: the observed Windows harness used pytest **9.1.1**,
52
+ pytest-httpserver **1.1.5** and Werkzeug **3.1.8**. These are test dependencies,
53
+ not ApiWells runtime dependencies. See [TEST_PLAN.md](TEST_PLAN.md).
54
+ No new dev-dependency packaging mechanism is selected in ED-033.
55
+
56
+ ## Remaining formal release gates
57
+
58
+ - [ ] Complete remaining required release validation under the frozen scope:
59
+ unit, mock integration, Secret Leak Test and any outstanding platform/Python
60
+ coverage; retain evidence tied to the release candidate.
61
+ - [ ] Complete macOS and Linux installation, `--version`, `--help`, Basic smoke
62
+ and mock-suite validation required by section 38.
63
+ - [ ] Verify the minimal CI checks: unit tests, mock integration, wheel/sdist build
64
+ and package verification; live provider tests stay separately controlled.
65
+ - [ ] Synchronize production version declarations to **0.2.0** in both
66
+ `pyproject.toml` and `src/apiwells/__init__.py` before formal RC/final artifacts.
67
+ - [ ] Build and identify the formal **RC artifact**; validate metadata and
68
+ preserve artifact hashes and provenance.
69
+ - [ ] Complete **TestPyPI** publication/installation validation.
70
+ - [ ] Complete **RC clean-install acceptance** against the actual RC artifact.
71
+ - [ ] Review all required release evidence and approve the final release.
72
+ - [ ] Publish the final **PyPI 0.2.0 release**.
73
+ - [ ] Complete **post-release PyPI clean-install smoke**, including the frozen
74
+ onboarding target of a first Basic check within about five minutes.
75
+
76
+ VERSION-01: both version declarations remain 0.1.0 in ED-033. Whether to refactor
77
+ to a single version source is undecided. Closed ED-031/ED-032 work is not
78
+ reopened by these future artifact-specific gates. This checklist does not
79
+ authorize publishing.
@@ -0,0 +1,132 @@
1
+ # v0.2 Test Plan
2
+
3
+ This plan covers the frozen Endpoint Doctor v0.2 scope summarized in
4
+ [V0.2_SPEC.md](V0.2_SPEC.md). It describes required validation, not a claim that
5
+ every release gate has passed. See [the release checklist](RELEASE_CHECKLIST.md)
6
+ for evidence status. ED-031 and ED-032 remain closed; ED-033 does not rerun or
7
+ reopen them.
8
+
9
+ ## 1. Unit testing
10
+
11
+ Keep unit tests offline. Use the tests under `tests/` to cover:
12
+
13
+ | Area | Required checks |
14
+ |---|---|
15
+ | URL/configuration | Exact base path, schemes, host/port, credentials/query/fragment rejection, loopback versus remote HTTP, key characters, model requirement, token/timeout bounds |
16
+ | ProbeResult | Required fields, allowed status/support enums and error codes, ordered probe collection |
17
+ | Status/support | Execution outcome separate from support; core failure versus capability PARTIAL aggregation; unknown support is not unsupported |
18
+ | Redaction | Exact runtime secrets, bearer/header/query patterns, nested values, summaries, metrics and evidence |
19
+ | Error classification | DNS, TLS, connection, timeout, redirect, authentication, permissions, quota/rate, upstream, parsing and capability errors |
20
+ | JSON parsing | Valid and malformed JSON, invalid response shapes, non-JSON HTTP 200 responses, bounded response reads |
21
+ | SSE parsing | LF/CRLF, multiline data, comments, UTF-8, event boundaries, malformed JSON, broken/pending events, missing DONE and interrupted streams |
22
+ | TTFT/latency | Measure from request start to the first valid model-output event; HTTP headers, keepalive, role-only, empty and metadata-only events do not count; total latency remains distinct |
23
+ | Tool Calling | Correct tool name/ID, arguments JSON and schema, diagnostic challenge, local execution, tool-result linkage, second request and final response using the runtime tool result |
24
+ | Structured Output | Strict JSON Schema success, malformed JSON, wrong types/extra properties, explicit unsupported detection, json_object-only result distinct from schema support |
25
+ | Usage | Provider-reported nonnegative integer fields, partial/missing/invalid fields, streaming merge, no estimated counts or derived missing totals |
26
+ | Reporters | Console, versioned JSON and legacy compatibility output; schema/package versions, fields/order, aggregation, secret safety, stdout/stderr and exit codes |
27
+
28
+ ## 2. Mock integration testing
29
+
30
+ Use `tests/integration/` with the local HTTP mock server. Validate Basic and
31
+ Deep end to end, CLI flag combinations, legacy `--chat` (including the default
32
+ `max_tokens=8`), console/JSON agreement and the exit-code contract.
33
+
34
+ Exercise successful and failed authentication, missing requested model,
35
+ 301/302 redirects, 400/401/403/404/429/500/502/503 responses, invalid JSON/schema, broken and interrupted
36
+ SSE, invalid tool arguments, full tool round trips and Structured Output
37
+ outcomes. Verify that Deep stops before billable probes when Basic does not
38
+ pass. Check redirect blocking and request counts: no hidden billable retry;
39
+ only the documented Tool Calling second request and conditional
40
+ `json_object` sub-test may add their respective requests.
41
+
42
+ With a prepared development/test environment:
43
+
44
+ ```sh
45
+ python -m pytest tests -q
46
+ python -m pytest tests/integration -q
47
+ ```
48
+
49
+ The first command includes the integration suite. The second is the focused
50
+ integration command, including for clean-wheel acceptance when package imports
51
+ are verified to resolve to the installed wheel.
52
+
53
+ ## 3. Secret Leak Test
54
+
55
+ Use synthetic canary credentials, never live keys in fixtures. Inject them into
56
+ provider echoes, errors, headers, nested evidence, malformed responses and
57
+ unexpected exceptions. Check captured stdout, stderr, logs, tracebacks, console reports, both
58
+ JSON paths and serialized results for credential leakage or raw traceback/body
59
+ exposure. Exercise full Basic, Deep and legacy paths, including timeout and
60
+ interrupted-stream failures. Search captured outputs and generated test artifacts for complete canary secrets;
61
+ any leak blocks release. Preserve only sanitized evidence.
62
+
63
+ ## 4. Real Endpoint Certification
64
+
65
+ The frozen minimum is three independent providers/endpoints covering three to
66
+ five Chinese models. Record provider, exact endpoint/model, date, package/build version, environment,
67
+ configuration, per-capability status/support, safe evidence and client timings.
68
+ Validate Models, Chat, SSE/TTFT, provider-reported Usage, Tool Calling's full
69
+ round trip and strict JSON Schema output. Preserve FAIL/PARTIAL/UNKNOWN
70
+ observations without turning them into permanent provider claims.
71
+
72
+ ED-031 is **CLOSED / PASS**. The three certified records and matrix linked from
73
+ [COMPATIBILITY.md](COMPATIBILITY.md) are authoritative historical evidence.
74
+ Do not overwrite them or replace their measurements with clean-install smoke
75
+ timings. Provider capability outcomes need not all be PASS for a valid record.
76
+
77
+ ## 5. Packaging / clean-install testing
78
+
79
+ Build local wheel and sdist, check distribution metadata, install the wheel
80
+ into a clean environment, and verify imports resolve to that environment's
81
+ site-packages rather than the checkout. Check package/CLI version agreement,
82
+ entry points, dependency consistency, Basic real endpoint smoke, the mock
83
+ integration suite and critical Deep smoke. Preserve artifact identity and
84
+ sanitized command/results evidence.
85
+
86
+ ED-032 Windows clean-install testing is **CLOSED / PASS**. The supplied ED-032
87
+ acceptance evidence records local wheel + sdist build PASS, Windows Basic real
88
+ endpoint smoke PASS, clean-wheel integration **43 passed**, critical Deep smoke
89
+ PASS and no secret leak observed. These are prior observations, not new ED-033
90
+ test runs.
91
+
92
+ ### TESTENV-01: observed Windows QA harness
93
+
94
+ | Test dependency | Observed version |
95
+ |---|---|
96
+ | pytest | 9.1.1 |
97
+ | pytest-httpserver | 1.1.5 |
98
+ | Werkzeug | 3.1.8 |
99
+
100
+ These are **test dependencies, not ApiWells runtime dependencies**. They describe
101
+ the observed Windows clean-wheel integration environment, not a new supported
102
+ dependency matrix. ED-033 neither adds them to runtime dependencies nor chooses
103
+ a new dev-dependency packaging or management mechanism.
104
+
105
+ ## 6. Cross-platform testing
106
+
107
+ Validate the release candidate on Windows, macOS and Linux, including shell
108
+ entry points, environment-key handling, TLS/proxy behavior, JSON encoding and
109
+ exit codes. macOS and Linux each require installation, `--version`, `--help`,
110
+ Basic smoke and the mock suite. Each platform run records OS, Python version
111
+ and the tested artifact. Python must satisfy the declared `>=3.10` requirement.
112
+ The Frozen Scope requires the specified Windows/macOS/Linux validation, not an
113
+ exhaustive OS × Python-version matrix.
114
+
115
+ Windows development-build acceptance is supported by ED-032. Remaining required
116
+ platform validation and RC acceptance stay open until corresponding evidence
117
+ exists. Historical 0.1.0 validation does not certify a v0.2 RC.
118
+
119
+ ## 7. Release evidence
120
+
121
+ Keep live provider tests separately controlled and out of ordinary CI by default;
122
+ provide credentials through environment variables or managed CI secrets.
123
+ Keep unit/mock/secret-test summaries, sanitized compatibility records,
124
+ build/metadata checks, artifact hashes and clean-install/platform results tied
125
+ to the tested commit and artifact. Record failures and limitations as well as
126
+ passes. Before formal RC/final artifacts, synchronize both version declarations
127
+ to 0.2.0; they remain 0.1.0 in ED-033 (VERSION-01). A single version source is
128
+ not decided here.
129
+
130
+ TestPyPI, RC artifact/clean-install acceptance, remaining required validation,
131
+ final PyPI release and post-release PyPI clean-install smoke are future gates,
132
+ tracked in [RELEASE_CHECKLIST.md](RELEASE_CHECKLIST.md).