Repository navigation
impl(022): the direct mapping and stage 2's recorded exchanges - #401
Conversation
AI review (findings)Reviewing the diff for bugs, security issues, and inconsistencies. Mapping and parsing logic ( Transport/version gating ( Production gate ( Fixture provenance check ( Recorded fixtures: Request bodies, response shapes, and stated probabilities are internally consistent and match test expectations in Test logic bug in {"head": "754ed5aa2b7b050d1d9ae41b6abba9dfbdf71b96", "verdict": "findings", "findings": [{"path": "integrations/rustev-jev/src/binding.rs", "line": 601, "summary": "The new `estimate_units` assertion expects `Ok(21_672)` while the usage map contains both `input_tokens: 516` and `output_tokens: 49`; any non-zero `output_usd_per_million` in the test fixture makes the expected value wrong, and a zero rate makes the assertion prove nothing about output-token pricing despite the comment claiming otherwise."}]}Subject: 6ce5d1d...754ed5a, diff digest d66321a8e59f94a97dfeb7693eb63e3d7fa1aa197b47112aba83aff1bba1442b, 1 call(s). An AI comment is not an approval. |
754ed5a to
fe2aa1b
Compare
AI review (no-findings)The PR records spec 022 stage 2 (the direct-transport mapping), adds the Binding logic ( Mapping logic ( Production gate ( Fixtures and provenance: The Test ( Score fixture: Probabilities keyed No defects found. {"head": "fe2aa1b9c67f0db7fec8362bd333416c18269632", "verdict": "no-findings", "findings": []}Subject: ca81e1e...fe2aa1b, diff digest 45e8b0fab08af876074823bc5836ed8b4f439718b7ddd85f30eea6815e239f92, 1 call(s). An AI comment is not an approval. |
Records spec 022 3.7 stage 2, the owner-authorized live smoke on TypeSafe's direct API (2026-10-29), and the direct mapping it fixes (3.2.3). Stage 3 is not part of this change.
What the live calls showed. There were two runs of spec 012's smoke harness (
--transport direct --pin jev-1.13.0), four synthetic cases each:model: jev-1.13.0, recorded asserved: reported.classifyandrubricare answered in the Gateway's shapes.booleantype. A proposition sent asbooleanis HTTP 400; it isnoul, answered as{"type":"noul","noul":p}.input_tokens/output_tokens. The Gateway price table did not name those, so every first-run charge wasunknown.Changes
DIRECT_MAPPING_VERSION(rustev-jev-mapping/2 (direct shapes of 022 stage 2)) is the only version a direct binding accepts, andJevBinding::directsets it. A Gateway binding still accepts only/1. It has a guard test.noul, and itsnoulfield maps losslessly to{"false": 1 - p, "true": p}. Abooleananswer there ismalformed_response. The Gateway is unchanged.input_tokens/output_tokensat the same rates, so direct charges areestimated.tests/fixtures/recorded-direct-*): the four answered exchanges and the refusedbooleanrequest.tests/direct_recorded.rsreplays them on loopback: each recorded request is the body the mapping sends, and each answer replays to the live output, an estimated charge and servedjev-1.13.0. The fixtures were checked for the key and carry no headers.noul; their synthetic cost members are kept for the reconciliation mechanics.production_eligiblestill refuses construction, now naming stage 3.verify:cliline fortests/direct_recorded.rs.Spend (shared testing journal, nano-USD units): estimated 344,520 to 411,552 and liability 13,001,784 to 13,079,694. That is about USD 0.00015 in total, out of R-29's USD 5.
make code,make gate,spec-spine verify 022,012and044, and the authored-content check pass locally.