Commit 2816520
test: lock public-surface barrel exports (#30)
## Summary
Locks every public helper's documented import path so a future
barrel-export gap fails CI.
The trigger was a Node-side gap on `loadUCPSigningKeyFromEnv` during the
recent helper lift: the function was defined in
`src/identity/ucp-jwks.ts` but never re-exported from `src/index.ts`.
The helper's own test imported from the module path so the gap stayed
invisible until a consumer tried importing from the documented top-level
barrel.
Python's barrel was correct the first time around, but the same gap
could hit any future helper. These tests give us a single-failure signal
in CI whenever a helper lands in a submodule and is forgotten in the
`__init__.py` re-export.
## What's covered
- `agentscore_commerce.identity` → `hash_operator_token`,
`load_ucp_signing_key_from_env`, `LoadUCPSigningKeyOptions`
- `agentscore_commerce.payment` → `detect_rail_from_headers`,
`zero_amount_carve_out`, `usd_to_atomic`,
`classify_orchestration_error`, `classify_x402_settle_result`,
`extract_payment_signer`, `read_x402_payment_header`
Each test asserts the barrel-imported symbol is the same object as the
module-level one (`barrel.foo is module.foo`), so a future barrel
rewrite that re-binds rather than re-exports also fails.
## Test plan
- [x] `uv run pytest tests/test_public_surface.py` — 5 passed
- [x] Full suite still green
- [x] `uv run ruff check` + `uv run ty check` clean
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 7a9b43c commit 2816520
1 file changed
Lines changed: 58 additions & 0 deletions
| 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 | + | |
0 commit comments