Skip to content
Open

v4 #2406

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions .changeset/add-node-engine.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"braintrust": major
---

feat(v4)!: Add Node Engine to package json
5 changes: 5 additions & 0 deletions .changeset/remove-eve-pre-034.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"braintrust": major
---

ref(eve)!: Bump minimum eve version to `0.34.0`
5 changes: 5 additions & 0 deletions .changeset/remove-flue-pre-v1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"braintrust": major
---

ref(v4)!: Remove flue pre-v1 support
5 changes: 5 additions & 0 deletions .changeset/remove-js-braintrust-cli.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"braintrust": major
---

ref(v4)!: Remove JS Braintrust CLI
5 changes: 5 additions & 0 deletions .changeset/remove-plugins-public-api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"braintrust": major
---

ref!: Remove plugins as part of public API
5 changes: 5 additions & 0 deletions .changeset/remove-zod-derived-types.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"braintrust": major
---

ref!: Remove Zod derived types from public SDK declarations
16 changes: 2 additions & 14 deletions .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -236,11 +236,10 @@ jobs:
pnpm install --frozen-lockfile || { echo "Baseline install failed"; git checkout "$CURRENT_REF"; exit 0; }
pnpm run build || { echo "Baseline build failed"; git checkout "$CURRENT_REF"; exit 0; }

mkdir -p "$BASELINE_DIR/js/dev" "$BASELINE_DIR/js/util"
mkdir -p "$BASELINE_DIR/js/util"
cp -R js/dist "$BASELINE_DIR/js/"
cp -R js/dev/dist "$BASELINE_DIR/js/dev/"
cp -R js/util/dist "$BASELINE_DIR/js/util/"
echo "Copied js/dist, js/dev/dist, and js/util/dist to baseline"
echo "Copied js/dist and js/util/dist to baseline"

git checkout "$CURRENT_REF"

Expand Down Expand Up @@ -473,17 +472,6 @@ jobs:
- name: Run hermetic tests
working-directory: ./js
run: pnpm run test:checks
- name: Run zod v3 tests
if: matrix.zod-version == '3.25.34'
working-directory: ./js
run: |
pnpm test:zod-v3
- name: Run zod v4 tests
if: matrix.zod-version == '4.2.1'
working-directory: ./js
run: |
pnpm test:zod-v4

checks-passed:
name: checks-passed
needs:
Expand Down
15 changes: 15 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,21 @@ mise install # Install toolchain and dependencies
pnpm run build # Build all workspace packages (from repo root)
```

## Public TypeScript APIs

Do not derive SDK-owned public TypeScript types from Zod schemas (for example,
with `z.infer`, `z.input`, `z.output`, or equivalent schema-derived aliases).
Define public API types explicitly with interfaces, type aliases, or generated
plain types. Generic APIs may still infer types from caller-provided schemas.
When exporting a runtime validator, give it a compact public type such as
`z.ZodType<PublicType>` and test that the validator and public type stay in sync.

Zod-derived public declarations can expand into large schema implementation
graphs. Those declarations are expensive for downstream TypeScript consumers to
parse, instantiate, and type-check, increasing compile time, declaration size,
and memory usage. They also expose validation-library implementation details as
part of the SDK's API surface.

## Instrumentation

Use the normal Orchestrion config plus plugin/channel path by default. Special-case source patches should be rare exceptions only when the target SDK cannot be instrumented through the standard transformer path, and the reason should be documented next to the patch.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Eval("Say Hi Bot", {
Run it:

```bash
BRAINTRUST_API_KEY=<YOUR_API_KEY> npx braintrust eval tutorial.eval.ts
BRAINTRUST_API_KEY=<YOUR_API_KEY> npx bt eval tutorial.eval.ts
```

## Packages
Expand Down
10 changes: 1 addition & 9 deletions e2e/config/pr-comment-scenarios.json
Original file line number Diff line number Diff line change
Expand Up @@ -600,14 +600,6 @@
"label": "Flue Instrumentation",
"metadataScenario": "flue-instrumentation",
"variants": [
{
"variantKey": "flue-v0-8-0",
"label": "v0.8 pinned"
},
{
"variantKey": "flue-v0-8-latest",
"label": "v0.8 latest"
},
{
"variantKey": "flue-v1-0-0-beta-3",
"label": "v1 pinned"
Expand All @@ -631,7 +623,7 @@
"label": "Eve Instrumentation",
"metadataScenario": "eve-instrumentation",
"variants": [
{ "variantKey": "eve-v0", "label": "v0 pinned" },
{ "variantKey": "eve-v0", "label": "v0.34 pinned" },
{ "variantKey": "eve-v0-latest", "label": "v0 latest" }
]
},
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ span_tree:
│ │ ]
│ │ metadata: {
│ │ "eve.session_id": "<eve.session_id:1>",
│ │ "model": "qwen/qwen3-30b-a3b",
│ │ "provider": "openrouter",
│ │ "scenario": "eve-instrumentation",
│ │ "testRunId": "<run:1>"
│ │ }
Expand Down Expand Up @@ -95,8 +97,6 @@ span_tree:
│ │ output: "Researcher result: [Eve instrumentation](https://eve.dev/docs/guides/instrumentation)"
│ │ metadata: {
│ │ "eve.session_id": "<eve.session_id:1>",
│ │ "model": "qwen/qwen3-30b-a3b",
│ │ "provider": "openrouter",
│ │ "scenario": "eve-instrumentation",
│ │ "testRunId": "<run:1>"
│ │ }
Expand Down Expand Up @@ -347,6 +347,8 @@ span_tree:
│ ]
│ metadata: {
│ "eve.session_id": "<eve.session_id:1>",
│ "model": "qwen/qwen3-30b-a3b",
│ "provider": "openrouter",
│ "scenario": "eve-instrumentation",
│ "testRunId": "<run:1>"
│ }
Expand Down Expand Up @@ -498,6 +500,8 @@ span_tree:
│ ]
│ metadata: {
│ "eve.session_id": "<eve.session_id:1>",
│ "model": "qwen/qwen3-30b-a3b",
│ "provider": "openrouter",
│ "scenario": "eve-instrumentation",
│ "testRunId": "<run:1>"
│ }
Expand Down Expand Up @@ -528,8 +532,6 @@ span_tree:
│ output: "Researcher result: Eve instrumentation https://eve.dev/docs/guides/instrumentation"
│ metadata: {
│ "eve.session_id": "<eve.session_id:1>",
│ "model": "qwen/qwen3-30b-a3b",
│ "provider": "openrouter",
│ "scenario": "eve-instrumentation",
│ "testRunId": "<run:1>"
│ }
Expand Down Expand Up @@ -855,6 +857,8 @@ span_tree:
]
metadata: {
"eve.session_id": "<eve.session_id:1>",
"model": "qwen/qwen3-30b-a3b",
"provider": "openrouter",
"scenario": "eve-instrumentation",
"testRunId": "<run:1>"
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ span_tree:
│ │ ]
│ │ metadata: {
│ │ "eve.session_id": "<eve.session_id:1>",
│ │ "model": "qwen/qwen3-30b-a3b",
│ │ "provider": "openrouter",
│ │ "scenario": "eve-instrumentation",
│ │ "testRunId": "<run:1>"
│ │ }
Expand Down Expand Up @@ -95,8 +97,6 @@ span_tree:
│ │ output: "Researcher result: {\"title\": \"Eve instrumentation\", \"url\": \"https://eve.dev/docs/guides/instrumentation\"}"
│ │ metadata: {
│ │ "eve.session_id": "<eve.session_id:1>",
│ │ "model": "qwen/qwen3-30b-a3b",
│ │ "provider": "openrouter",
│ │ "scenario": "eve-instrumentation",
│ │ "testRunId": "<run:1>"
│ │ }
Expand Down Expand Up @@ -347,6 +347,8 @@ span_tree:
│ ]
│ metadata: {
│ "eve.session_id": "<eve.session_id:1>",
│ "model": "qwen/qwen3-30b-a3b",
│ "provider": "openrouter",
│ "scenario": "eve-instrumentation",
│ "testRunId": "<run:1>"
│ }
Expand Down Expand Up @@ -498,6 +500,8 @@ span_tree:
│ ]
│ metadata: {
│ "eve.session_id": "<eve.session_id:1>",
│ "model": "qwen/qwen3-30b-a3b",
│ "provider": "openrouter",
│ "scenario": "eve-instrumentation",
│ "testRunId": "<run:1>"
│ }
Expand Down Expand Up @@ -528,8 +532,6 @@ span_tree:
│ output: "Researcher result: Eve instrumentation (https://eve.dev/docs/guides/instrumentation)"
│ metadata: {
│ "eve.session_id": "<eve.session_id:1>",
│ "model": "qwen/qwen3-30b-a3b",
│ "provider": "openrouter",
│ "scenario": "eve-instrumentation",
│ "testRunId": "<run:1>"
│ }
Expand Down Expand Up @@ -855,6 +857,8 @@ span_tree:
]
metadata: {
"eve.session_id": "<eve.session_id:1>",
"model": "qwen/qwen3-30b-a3b",
"provider": "openrouter",
"scenario": "eve-instrumentation",
"testRunId": "<run:1>"
}
Expand Down
10 changes: 7 additions & 3 deletions e2e/scenarios/eve-instrumentation/agent/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,15 @@ const dynamicModel = withReadableReasoning(
);

export default defineAgent({
experimental: {
instrumentationProviders: true,
},
model: defineDynamic({
fallback: dynamicModel,
events: {
"step.started": () => dynamicModel,
"step.started": () => ({
model: dynamicModel,
modelContextWindowTokens: 8_192,
}),
},
}),
modelContextWindowTokens: 8_192,
});
7 changes: 7 additions & 0 deletions e2e/scenarios/eve-instrumentation/agent/channels/eve.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { none } from "eve/channels/auth";
import { eveChannel } from "eve/channels/eve";

export default eveChannel({
// This local e2e fixture has no user accounts and only serves the test runner.
auth: none(),
});
15 changes: 0 additions & 15 deletions e2e/scenarios/eve-instrumentation/agent/hooks/braintrust.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import { braintrustEveInstrumentation, initLogger } from "braintrust";
import { defineState } from "eve/context";
import { defineInstrumentation } from "eve/instrumentation";

export default defineInstrumentation(
braintrustEveInstrumentation({
defineState,
metadata: {
scenario: "eve-instrumentation",
...(process.env.BRAINTRUST_E2E_RUN_ID
? { testRunId: process.env.BRAINTRUST_E2E_RUN_ID }
: {}),
},
setup: ({ agentName }) => {
initLogger({
projectName: process.env.BRAINTRUST_E2E_PROJECT_NAME || agentName,
Expand Down
Loading