docs: define the trace export v1 contract#31
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7ec6ada7fa
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ...metadata | ||
| } = expression; | ||
| return { | ||
| ...metadata, |
There was a problem hiding this comment.
Serialize condition literals before exporting
When traceExpression receives condition metadata whose literalValue is not JSON-native—for example a bigint—this spread copies the raw condition into TraceExport; #redactConditionEvaluation likewise preserves its raw literalValue. The overlay's JSON.stringify then throws for bigint (and silently converts non-finite numbers to null), preventing the download or corrupting the recorded condition even though other captured values use tagged serialization. Recursively serialize condition literals before returning the export.
AGENTS.md reference: AGENTS.md:L9-L9
Useful? React with 👍 / 👎.
What changed
TraceExportandTraceExportVersionfrom the public package entrypointWhy
Consumers need to determine whether exported traces are structurally compatible without reading CauseScope implementation files. The checked example also prevents the public documentation from drifting away from the package type.
Validation
pnpm checkpnpm docs:build/trace-export/examples/trace-v1.jsonand verifiedversion: 1plus redacted valuesThe example is fully synthetic. This change adds only TypeScript type exports and documentation; it does not add production instrumentation or a network path.
Closes #24