Skip to content

impl(030): increment 4, the recorded Responses exchange - #416

Merged
bartekus merged 1 commit into
mainfrom
impl/030-responses
Oct 30, 2026
Merged

bartekus merged 1 commit into
mainfrom
impl/030-responses

Conversation

@bartekus

Copy link
Copy Markdown
Contributor

Spec 030 increment 4: the recorded Responses exchange (3.14 item 3).

  • One live smoke call on the Responses wire, us.openai.gpt-5.6-luna from ca-central-1 through the us. geographic profile, store: false, JSON-schema output, synthetic content only. HTTP 200, mapped to Label("apple"); 95 input and 27 output tokens, estimated at 56,540 nano-USD against the R-29 testing journal.
  • fixtures/recorded/ adds responses-binding.json, responses-policy.json and responses-smoke-0.json. The provider response and item ids and the encrypted reasoning content are redacted; no credential, account id, ARN or request id is recorded.
  • tests/recorded.rs replays each recorded exchange under the binding and policy it was recorded with, so the Responses exchange replays offline beside the four Converse ones.
  • The implementation record gains increment 4 (the access wait, the result, Fact 2 confirmed against a recorded response, the journal totals); the crate README names the new fixtures.

Both wires now have a recorded live exchange. No contract change; spec 030's status is unchanged.

Verification: make gate, spec-spine verify 030, cargo test -p rustev-bedrock with and without aws-config, clippy -D warnings, fmt.

@github-actions

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the diff for bugs, security issues, and internal inconsistencies.

SHA256 digest lengths — all digests verified as 64 hex characters (valid). Key digests checked: binding in smoke fixture, request_digest, response_digest, outcome.output.digest, policy_digest, instructions.digest, prompt_template_digest, option_description_digest.

Cost calculation — spec claims 56,540 nano-USD estimated charge. The binding gives USD 0.22/Mtok input and USD 1.32/Mtok output. Fixture shows 95 input tokens and 27 output tokens (11 reasoning, charged as output at output rate per the Responses API):

  • Input: 95 × 0.22 / 1,000,000 × 1,000,000,000 = 20,900
  • Output: 27 × 1.32 / 1,000,000 × 1,000,000,000 = 35,640
  • Total: 56,540 ✓ — matches exchange_charge.estimated.units and member charge.estimated.units.

Headroom arithmetic — spec states total before is 1,421,364 observed + 3,465,372 estimated + 18,075,006 liability = 23,018,282 nano-USD; after adding 56,540 estimated the new total is 23,018,282 + 56,540 = 23,074,822 nano-USD = $0.023017282. R-29's $5 budget less $0.023017282 ≈ $4.976983, consistent with the stated $4.976982 ✓.

Unix timestamp — provider.completed_at: "1793385809". Days from epoch to 2026-10-30: (20454 + 302) × 86400 = 1,793,318,400; 1,793,385,809 − 1,793,318,400 = 67,409 s → 18:43:29 UTC on 2026-10-30 ✓ matches provenance claim.

Binding/policy/fixture consistency — responses-binding.json declares model_id: "us.openai.gpt-5.6-luna", region: "ca-central-1", wire: "responses", inference_profile: "geo", structured_output: "json_schema", reasoning_effort: "low", max_tokens: 1024, prices 0.22/1.32, no cache rates. All consistent with spec's increment 4 narrative and the smoke fixture's request/response bodies. responses-policy.json allows exactly that model/region/profile/wire combination ✓.

Test refactoring — projection is computed from binding.operations[0].operation before binding is moved into BedrockBackend::new(); this is safe. Removing .clone() is correct since binding is freshly created per iteration. Converse entries still receive the same CONVERSE_BINDING/CONVERSE_POLICY as before, so existing exchange replays are unaffected ✓.

Token accounting — usage fields in exchange_record, raw_usage provider extra, and response_body.usage all agree: 95 input, 27 output (11 reasoning), 122 total ✓.

Redactions — provider response id, item ids, and encrypted reasoning content are consistently marked "redacted:…" throughout; no credentials or keys visible.

Spec date alignment — README says "2026-10-30", spec says "2026-10-30", destination_regions.as_of says "2026-10-29" (policy read the day before), all internally coherent.

No defects found.

{"head": "af2b5523c8c4046febfbec492d6335fff285e003", "verdict": "no-findings", "findings": []}

Subject: 5de6139...af2b552, diff digest 7cc2acabfaf847f16e7c223ebe87b22350e7e5108cfcac33591306f15d5267b6, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus enabled auto-merge October 30, 2026 19:03
@bartekus
bartekus added this pull request to the merge queue Oct 30, 2026
Merged via the queue into main with commit e9aaa9d Oct 30, 2026
30 checks passed
@bartekus
bartekus deleted the impl/030-responses branch October 30, 2026 19:51
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