Skip to content

Commit 2b9696a

Browse files
committed
Merge remote-tracking branch 'origin/main' into lforst/dum-e/edinburgh-c4d8064dec
# Conflicts: # e2e/scenarios/flue-instrumentation/versions/v1/package.json # e2e/scenarios/flue-instrumentation/versions/v1/pnpm-lock.yaml
2 parents 8d6b056 + 406d614 commit 2b9696a

193 files changed

Lines changed: 46321 additions & 10636 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.agents/skills/instrumentation/SKILL.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Map the change before editing:
2727
- Inputs are untrusted: treat args, results, events, headers, and metadata as hostile. Prototype pollution is a concrete risk here. Avoid unsafe property access patterns, prototype-sensitive operations, and unnecessary mutation of third-party objects.
2828
- Support both auto-instrumentation and manual instrumentation. Auto-instrumentation does not cover every environment, loader, or framework.
2929
- For orchestrion auto-instrumentation, prefer targeting public API functions. Instrumenting internal helpers is more likely to break across library versions.
30-
- Auto and manual paths should share logic. Prefer both paths emitting the same tracing-channel events, with provider plugins converting those events into spans/logs/errors. Manual wrappers should not directly emit observability data.
30+
- Auto and manual paths should share logic through the same typed channel. For new and migrated instrumentation, prefer `invoke` in manual wrappers and `intercept` in provider plugins so the target can be scoped with `AsyncLocalStorage.run()` and its arguments, receiver, or output can be patched. Keep tracing-style hooks only as the compatibility path for instrumentation that has not migrated yet. Manual wrappers should not directly emit observability data.
3131
- Reuse shared repo utilities before introducing local helpers. Check `js/util/index.ts`, neighboring instrumentation files, and existing plugins/wrappers for utilities like `isObject`, merge helpers, and sanitizers before adding ad hoc replacements.
3232
- If a public instrumentation surface changes, check whether the export surface also needs updates in `js/src/instrumentation/index.ts` or `js/src/exports.ts`.
3333
- Preserve async context propagation. Changes around tracing channels, stream patching, or loader hooks must keep the current span context across awaits and stream consumption.

‎.changeset/add-flue-v2-support.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"braintrust": patch
3+
---
4+
5+
feat: Add support for flue v2
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"braintrust": patch
3+
---
4+
5+
ref: Add simple wrapper to orchestrion transform
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"braintrust": minor
3+
---
4+
5+
feat(vitest-evals): Add `meta.eval.input`

‎AGENTS.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ Use the normal Orchestrion config plus plugin/channel path by default. Special-c
3131

3232
Instrumentation patches generally do not need to be removed during teardown. Prefer leaving behavior-preserving patches installed when they are idempotent; do not add unpatching machinery by default.
3333

34+
Span names should generally remain stable across calls and versions. Do not include dynamic values such as model names in span names; record those values in metadata instead.
35+
3436
## Testing
3537

3638
Uses Vitest. Prefer running the **narrowest relevant test** rather than the full suite.

‎e2e/README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ Scenario-local manifests are optional and should stay slim. They are only for sc
121121

122122
Scenarios that should participate in `test:e2e:bump` declare `braintrustScenario.bump.dependencies` in their existing scenario-local `package.json`. Each rule points at the real npm package and the tested range for that dependency alias; prereleases are ignored unless the rule sets `allowPrerelease: true`.
123123

124+
Packages such as Next.js must be installed under their real dependency name. For a latest lane stored in a nested version manifest, set `targetManifest` to that scenario-relative `package.json` and `targetDependency` to the real dependency name. The bump script updates that manifest and regenerates its colocated lockfile while the rule key remains the logical `*-latest` lane name.
125+
124126
`workspace:` dependency specs are intentionally not supported in scenario-local manifests. If a scenario needs a workspace package, keep that dependency in `e2e/package.json`.
125127

126128
## Running

‎e2e/config/pr-comment-scenarios.json‎

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,11 +572,27 @@
572572
"variants": [
573573
{
574574
"variantKey": "flue-v0-8-0",
575-
"label": "v0.8.0"
575+
"label": "v0.8 pinned"
576+
},
577+
{
578+
"variantKey": "flue-v0-8-latest",
579+
"label": "v0.8 latest"
576580
},
577581
{
578582
"variantKey": "flue-v1-0-0-beta-3",
579-
"label": "v1.0.0-beta.3"
583+
"label": "v1 pinned"
584+
},
585+
{
586+
"variantKey": "flue-v1-latest",
587+
"label": "v1 latest"
588+
},
589+
{
590+
"variantKey": "flue-v2",
591+
"label": "v2 pinned"
592+
},
593+
{
594+
"variantKey": "flue-v2-latest",
595+
"label": "v2 latest"
580596
}
581597
]
582598
},
@@ -612,6 +628,36 @@
612628
}
613629
]
614630
},
631+
{
632+
"scenarioDirName": "nextjs-instrumentation",
633+
"label": "Next.js Instrumentation",
634+
"metadataScenario": "nextjs-instrumentation",
635+
"variants": [
636+
{
637+
"variantKey": "nextjs-v14",
638+
"label": "v14 pinned"
639+
},
640+
{
641+
"variantKey": "nextjs-v14-latest",
642+
"label": "v14 latest"
643+
}
644+
]
645+
},
646+
{
647+
"scenarioDirName": "test-framework-evals-jest",
648+
"label": "Jest Test Framework Evals",
649+
"metadataScenario": "test-framework-evals-jest",
650+
"variants": [
651+
{
652+
"variantKey": "jest-v29",
653+
"label": "v29 pinned"
654+
},
655+
{
656+
"variantKey": "jest-v29-latest",
657+
"label": "v29 latest"
658+
}
659+
]
660+
},
615661
{
616662
"scenarioDirName": "test-framework-evals-vitest",
617663
"label": "Vitest Test Framework Evals",

‎e2e/helpers/normalize.test.ts‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { describe, expect, test } from "vitest";
2+
import { normalizeForSnapshot } from "./normalize";
3+
4+
describe("normalizeForSnapshot", () => {
5+
test("normalizes a foreign repository path ending at a workspace directory", () => {
6+
expect(
7+
normalizeForSnapshot(
8+
"find /another/checkout/braintrust-sdk-javascript/e2e -name AGENTS.md",
9+
),
10+
).toBe("find <repo>/e2e -name AGENTS.md");
11+
});
12+
});

‎e2e/helpers/normalize.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ const REPO_ROOT = path.resolve(HELPERS_DIR, "../..").replace(/\\/g, "/");
110110
const STACK_FRAME_REPO_PATH_REGEX =
111111
/(?:[A-Za-z]:)?[^\s)\n]*braintrust-sdk-javascript(?:[\\/](?:braintrust-sdk-javascript|[^\\/\s)\n]+))?((?:[\\/](?:e2e|js)[^:\s)\n]+)):\d+:\d+/g;
112112
const REPO_PATH_REGEX =
113-
/(?:[A-Za-z]:)?[^\s)\n]*braintrust-sdk-javascript(?:[\\/](?:braintrust-sdk-javascript|[^\\/\s)\n]+))?((?:[\\/](?:e2e|js)[^:\s)\n]+))/g;
113+
/(?:[A-Za-z]:)?[^\s)\n]*braintrust-sdk-javascript(?:[\\/](?:braintrust-sdk-javascript|[^\\/\s)\n]+))?((?:[\\/](?:e2e|js)[^:\s)\n]*))/g;
114114
const NODE_INTERNAL_FRAME_REGEX = /node:[^)\n]+:\d+:\d+/g;
115115
const TEMP_SCENARIO_PATH_REGEX =
116116
/\/e2e\/\.bt-tmp\/[^/\s)]+\/scenarios\/([^/\s)]+)\/?/g;

‎e2e/scenarios/ai-sdk-instrumentation/__cassettes__/ai-sdk-v7-latest.cassette.json‎

Lines changed: 288 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)