Expand description
The record path: wrap an agent, capture what crossed the provider boundary.
amberfork has two ingestion paths sharing one canonical model (design doc, “Counterfactual attribution is impossible against passive OTLP alone”). The PASSIVE path aligns OTel traces you already have — framework-agnostic, but content is opt-in and often absent, and you cannot re-run a telemetry photo. This crate is the RECORD path: it runs the agent behind a local capture proxy, so content is guaranteed and the run stays re-executable.
Two things follow from that, and they are the reason this crate exists rather than being a
flag on ingest:
- Full content. The passive path’s
full content guaranteedcell is “no”; this path’s is “yes”. Full inputs are worth +76% relative step-level accuracy over output-only logs (“Replay fidelity ceiling”), which improves the ordinary diff before any re-execution exists. - Re-executability. A boundary recording can be replayed and mutated, which is what counterfactual attribution needs. This crate captures; re-execution is its consumer.
tokio lives here because this is an I/O edge, alongside amberfork-server. Engine crates
stay sync and pure.
Structs§
- Capture
Proxy - A bound, running capture proxy.
- Captured
Request - One captured request, with full inputs.
- Captured
Response - One captured response.
- Cassette
- A full-content recording of one agent run at the provider boundary.
- Cassette
Version - Version of the cassette contract.
- Exchange
- One request/response round trip at the provider boundary.
Enums§
- Body
- What the recorder writes when a body is not valid JSON. The cassette stays a JSON document, so a non-JSON body (an HTML error page from a proxy, a truncated stream) is preserved as text rather than dropped or allowed to fail the capture.
- Record
Error - Something that went wrong standing up or running a recording session.
Functions§
- normalize
- Normalize a captured cassette into the canonical
Runthe aligner consumes. - normalize_
str - Parse a cassette from JSON and normalize it into a
Run. - retain_
request_ headers - Filter request headers to the recordable allowlist.
- retain_
response_ headers - Filter response headers to the recordable allowlist.