Repository navigation
Commit c148e04
authored
Use the vendor TypeSafe SDK for crosswalk transport and retry (#725)
### Scope
The crosswalk's `call()` duplicates HTTP transport and retries already shipped by TypeSafe. Replace that loop with the published `typesafe-sdk==0.7.2` client and its native retry policy, imported only for `judge`. Preserve request construction, validation, thresholds, ledger code and recorded judgments.
- Base commit after the requested rebase: `4af7417b7d4db8936c0136235a86717f31d16f27` (descends from `77d7516d8`).
- Lane: `lane:foundation`.
- Owned paths: `tools/sota-convergence/gap_crosswalk.py`, its new SDK test, dated decision, compact synthetic evidence and the evidence registry.
- Claude cross-family read completed: 0 P1, 0 P2; both P3 documentation corrections are addressed. The command center authorized leaving draft after these fixes; the command center alone lands the PR. This is separate from the currency handoff in #721.
- Rebased conflict-free onto current main on 2026-10-05. The five owned source/evidence files remain byte-identical to their original qualification; dated evidence retains its original input revision. Main's registry was restored and native registration rerun, preserving every main entry and all non-file registry fields.
## SOTA sources
- [typesafe-ai/[email protected], f078f1e2: native client](https://github.com/typesafe-ai/typesafe-sdk-python/blob/f078f1e208a0d885154dc758344ae4fce77ac168/src/typesafe_sdk/_core/client/sync/client.py#L22), [structured Choice types](https://github.com/typesafe-ai/typesafe-sdk-python/blob/f078f1e208a0d885154dc758344ae4fce77ac168/src/typesafe_sdk/_core/question_types.py#L39) and [raw-question normalization](https://github.com/typesafe-ai/typesafe-sdk-python/blob/f078f1e208a0d885154dc758344ae4fce77ac168/src/typesafe_sdk/_core/questions.py#L10). All three prerequisite compatibility gates pass at this pin.
- [Usage](https://github.com/typesafe-ai/typesafe-sdk-python/blob/f078f1e208a0d885154dc758344ae4fce77ac168/src/typesafe_sdk/_core/response_types.py#L65), [choice probabilities](https://github.com/typesafe-ai/typesafe-sdk-python/blob/f078f1e208a0d885154dc758344ae4fce77ac168/src/typesafe_sdk/_schemas/models.py#L25) and [public HTTP metadata](https://github.com/typesafe-ai/typesafe-sdk-python/blob/f078f1e208a0d885154dc758344ae4fce77ac168/src/typesafe_sdk/_core/schemas/base.py#L81) preserve the existing validator input and optional request ID.
- The [strict SDK schema](https://github.com/typesafe-ai/typesafe-sdk-python/blob/f078f1e208a0d885154dc758344ae4fce77ac168/src/typesafe_sdk/_core/schemas/base.py#L21) uses `extra="ignore"` and `strict=True`, requires [confidence](https://github.com/typesafe-ai/typesafe-sdk-python/blob/f078f1e208a0d885154dc758344ae4fce77ac168/src/typesafe_sdk/_schemas/models.py#L19), and [drops unknown answer types](https://github.com/typesafe-ai/typesafe-sdk-python/blob/f078f1e208a0d885154dc758344ae4fce77ac168/src/typesafe_sdk/_core/response_types.py#L86) before `validate()`/ledger. No modeled field is lost on any of the 695 retained successful rows (2,254 choice answers); future schema-mismatched responses can change acceptance or lose extra fields. The decision now makes this boundary explicit.
- [RetryPolicy](https://github.com/typesafe-ai/typesafe-sdk-python/blob/f078f1e208a0d885154dc758344ae4fce77ac168/src/typesafe_sdk/_core/retry.py#L52) and [native retry-count header](https://github.com/typesafe-ai/typesafe-sdk-python/blob/f078f1e208a0d885154dc758344ae4fce77ac168/src/typesafe_sdk/_core/transport.py#L68). Explicit settings retain five attempts, 429/529 only, 1/2/4/8-second delays, no jitter or Retry-After, no connection/timeout retries and a 60-second attempt timeout.
- [Vendor-owned headers](https://github.com/typesafe-ai/typesafe-sdk-python/blob/f078f1e208a0d885154dc758344ae4fce77ac168/src/typesafe_sdk/_core/transport.py#L116) explain the authorized User-Agent change to `typesafe-sdk/0.7.2`. [pydantic/[email protected], d426e2c4: public elapsed contract](https://github.com/pydantic/httpx2/blob/d426e2c44d1247fcf3326ed1cb496e56353efa4a/src/httpx2/httpx2/_models.py#L579) supplies successful-attempt HTTP timing, excluding SDK decoding; the prior timer also included final JSON decoding. Earlier attempts/backoff remain excluded.
- [Upstream MockTransport seam](https://github.com/typesafe-ai/typesafe-sdk-python/blob/f078f1e208a0d885154dc758344ae4fce77ac168/tests/conftest.py#L33) supplies the offline test boundary. [PyPI 0.7.2](https://pypi.org/pypi/typesafe-sdk/0.7.2/json) publishes the wheel; its downloaded SHA256 matches `0a961148187d52e18276ed7f2d02617cfac48e3b97673cb631a8749397d43d1e`. Installation used an isolated uv environment with source builds disabled.
- [Repository hot-file protocol at 4af7417](https://github.com/seathatflowsinourveins/native-agent-stack/blob/4af7417b7d4db8936c0136235a86717f31d16f27/docs/lanes.md#L94): native `host_receipts.register_file` updated the five owned files from main's registry and re-registered the revised decision; the registry is committed last at `ad6979a866317456cf80e32855c0a591f8371d88`.
### Evidence-class table
| Claim | Evidence class | Command / receipt |
| --- | --- | --- |
| SDK accepts structured questions and exposes all required response/retry fields | `source_review` | Pinned sources above and dated decision |
| Native SDK transport/parser/retry preserves modeled choice payload, metadata and selected retry policy with injected responses | `synthetic` | 6 MockTransport tests plus 3 offline import and version checks; all 22 touched tests pass, no skips |
| Existing crosswalk output remains current without the SDK or site packages | `local_integration` | Ordinary and `python3 -S` offline `build --check`, exit 0 |
| Registered evidence is internally consistent | `local_integration` | `validate.py` after final P3 registry commit: exit 0, 10,098 hashes; integrity and scope only |
The stub tests are locally authored integration checks through the unchanged SDK implementation, not an unchanged upstream suite or live provider acceptance. No live judge call occurred. The original environment-only credential consumer remains unchanged. No credential inventory, install script, host receipt or host-stack pin changed.
Dependency pinning in the runtime install hint remains an explicit limitation: the hint pins only `typesafe-sdk==0.7.2`. The observed dependency set includes `httpx2==2.13.1`, `pydantic==2.13.5` and `tenacity==9.1.4`; another resolution can select versions outside that tested set. The optional hint change is deferred, as allowed by the cross-family verdict.
### Local commands run
Checks used private scratch and an isolated uv cache; the private environment path prefixes are recorded in the lane status. Runtime checks are reused from the unchanged code/test inputs at `9a87ae07`; the P3 follow-up changes only the decision and its registration. Validation was rerun before the doc/registry commits and after the final registry commit.
```text
python3 tools/sota-convergence/gap_crosswalk.py build --check
exit 0: crosswalk up to date
python3 -S tools/sota-convergence/gap_crosswalk.py build --check
exit 0: crosswalk up to date
uv run --no-project --no-config --no-env-file --no-build --no-managed-python --no-python-downloads --offline --with typesafe-sdk==0.7.2 python3 -m unittest discover -s tests -p 'test_gap_crosswalk*.py' -v
exit 0: 22 tests, no skips
python3 scripts/component_matrix.py --write
exit 0; outputs unchanged
python3 scripts/new_host_grand_list.py --write
exit 0; outputs unchanged
python3 scripts/validate.py
exit 0 after the final P3 registry commit; final commit is registry-only
git diff --check
exit 0
```
The first eight-test stub run exited 1 because three preloaded mock responses lacked elapsed metadata. The final streamed fixture exercises native read/close timing; that failed attempt and correction remain in `evidence/artifacts/typesafe-sdk-transport-20261005/checks.json`, with final returned output alongside it. Independent review also corrected the missing-SDK hint to preserve the original command's required `--set`/`--out` arguments; no material findings remain.
### Decision record
`docs/decisions/2026-10-05-typesafe-sdk-transport.md` records the three gates, retry comparison, header/timing changes, alternatives, overturn conditions and completeness critic.
### Host evidence
Not applicable: no host receipts changed.
### Checklist
- [x] No GitHub Actions changes; existing offline CI build remains stdlib-only.
- [x] No secrets printed or committed; no new required secret.
- [x] No new paid hosting, subscription or billing surface.
- [x] Peer-owned files and #721's worktree preserved.
- [x] Registry committed last; required post-commit validation passed.1 parent 4fd7106 commit c148e04
6 files changed
Lines changed: 465 additions & 19 deletions
File tree
- docs/decisions
- evidence/artifacts/typesafe-sdk-transport-20261005
- manifests
- tests
- tools/sota-convergence
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16682 | 16682 | | |
16683 | 16683 | | |
16684 | 16684 | | |
| 16685 | + | |
| 16686 | + | |
| 16687 | + | |
| 16688 | + | |
| 16689 | + | |
16685 | 16690 | | |
16686 | 16691 | | |
16687 | 16692 | | |
| |||
49552 | 49557 | | |
49553 | 49558 | | |
49554 | 49559 | | |
| 49560 | + | |
| 49561 | + | |
| 49562 | + | |
| 49563 | + | |
| 49564 | + | |
| 49565 | + | |
| 49566 | + | |
| 49567 | + | |
| 49568 | + | |
| 49569 | + | |
49555 | 49570 | | |
49556 | 49571 | | |
49557 | 49572 | | |
| |||
53677 | 53692 | | |
53678 | 53693 | | |
53679 | 53694 | | |
| 53695 | + | |
| 53696 | + | |
| 53697 | + | |
| 53698 | + | |
| 53699 | + | |
53680 | 53700 | | |
53681 | 53701 | | |
53682 | 53702 | | |
| |||
54594 | 54614 | | |
54595 | 54615 | | |
54596 | 54616 | | |
54597 | | - | |
54598 | | - | |
| 54617 | + | |
| 54618 | + | |
54599 | 54619 | | |
54600 | 54620 | | |
54601 | 54621 | | |
| |||
0 commit comments