Skip to content
Closed
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions .github/workflows/mastra-typescript-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Mastra TypeScript tests

on:
pull_request:
branches: [dev, main]
paths:
- 'typescript/packages/traceai_mastra/**'
- 'typescript/packages/fi-core/**'
- 'typescript/packages/fi-semantic-conventions/**'
- 'typescript/pnpm-lock.yaml'
- '.github/workflows/mastra-typescript-tests.yml'
push:
branches: [dev]
paths:
- 'typescript/packages/traceai_mastra/**'
- '.github/workflows/mastra-typescript-tests.yml'

permissions:
contents: read

jobs:
contract:
name: Mastra ${{ matrix.version }}
runs-on: ubuntu-24.04
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
include:
- { version: floor, core: '1.16.0', observability: '1.0.0', exporter: '1.0.0' }
- { version: latest, core: latest, observability: latest, exporter: latest }
- { version: latest-runtime-floor-converter, core: latest, observability: latest, exporter: '1.0.0' }
- { version: floor-runtime-latest-converter, core: latest, observability: '1.0.0', exporter: latest }
defaults:
run:
shell: bash
working-directory: typescript
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: '22.23.4'
- name: Install frozen dependencies
run: |
corepack enable
pnpm --filter @traceai/mastra... install --frozen-lockfile --ignore-scripts
- name: Build, offline unit test and pack
run: |
pnpm --filter @traceai/mastra... run build
sudo unshare --net bash -c 'ip link set lo up; exec "$@"' _ \
"$(command -v node)" "$PWD/node_modules/jest/bin/jest.js" \
--config "$PWD/packages/traceai_mastra/jest.config.js" --runInBand
mkdir -p "$RUNNER_TEMP/mastra-package"
pnpm --dir packages/fi-core pack --pack-destination "$RUNNER_TEMP/mastra-package"
pnpm --dir packages/traceai_mastra pack --pack-destination "$RUNNER_TEMP/mastra-package"
git diff --exit-code -- pnpm-lock.yaml
- name: Install packed exporter and real SDK in a clean consumer
env:
CORE_VERSION: ${{ matrix.core }}
OBSERVABILITY_VERSION: ${{ matrix.observability }}
EXPORTER_VERSION: ${{ matrix.exporter }}
run: |
mkdir -p "$RUNNER_TEMP/mastra-consumer"
npm install --prefix "$RUNNER_TEMP/mastra-consumer" --ignore-scripts --no-audit --no-fund \
"$RUNNER_TEMP"/mastra-package/*.tgz \
"@mastra/core@$CORE_VERSION" "@mastra/observability@$OBSERVABILITY_VERSION" \
"@mastra/otel-exporter@$EXPORTER_VERSION" \
@opentelemetry/otlp-transformer@0.201.1
- name: Native lifecycle and wire contracts (loopback-only network namespace)
run: |
export MASTRA_TEST_DEPS="$RUNNER_TEMP/mastra-consumer"
for entrypoint in src esm; do
export MASTRA_TEST_PACKAGE="$RUNNER_TEMP/mastra-consumer/node_modules/@traceai/mastra/dist/$entrypoint/index.js"
sudo unshare --net bash -c 'ip link set lo up; exec "$@"' _ \
env MASTRA_TEST_DEPS="$MASTRA_TEST_DEPS" MASTRA_TEST_PACKAGE="$MASTRA_TEST_PACKAGE" \
"$(command -v node)" --test "$PWD/packages/traceai_mastra/contract/recall.test.cjs"
done
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"python/frameworks/weaviate": "0.1.2",
"python/frameworks/xai": "0.1.1",
"python/traceai": "0.1.0",
"typescript/packages/fi-core": "1.1.0",
"typescript/packages/fi-core": "1.1.1",
"typescript/packages/fi-semantic-conventions": "1.0.0",
"typescript/packages/traceai_anthropic": "0.1.4",
"typescript/packages/traceai_bedrock": "0.1.2",
Expand Down
4 changes: 4 additions & 0 deletions typescript/packages/fi-core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [1.1.1] - pending release
### Fix
- Export `redactPiiInValue` from the package root for integrations that apply the shared PII policy at the OTLP export boundary. `@traceai/mastra` requires at least this version; publish fi-core before publishing Mastra.

## [1.1.0] - 2026-10-18
### Security fix: content hiding skipped the attributes passed when a span is created
- **This bug predates 1.1.0: it is in every published release, 0.1.0 to 1.0.0.** `FITracer.startSpan` handed `options.attributes` straight to the OpenTelemetry span, so attributes passed at span creation skipped `FISpan` and every masking rule: `hideInputs` and the other hide flags, PII redaction, and (new in this release) error-detail hiding. About 22 instrumentations put the prompt there, `@traceai/openai` included, so with `FI_HIDE_INPUTS=true` the prompt was still exported in `input.value`, `gen_ai.input.messages` and `raw.input`.
Expand Down
2 changes: 1 addition & 1 deletion typescript/packages/fi-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@traceai/fi-core",
"version": "1.1.0",
"version": "1.1.1",
"description": "OpenTelemetry tracing for AI applications: tracer setup, span helpers, and exporters for Future AGI.",
"main": "./dist/src/index.js",
"module": "./dist/esm/index.js",
Expand Down
2 changes: 2 additions & 0 deletions typescript/packages/fi-core/src/trace/trace-config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ export {
REDACTED_VALUE,
} from "./constants";
export { generateTraceConfig } from "./traceConfig";
// Native exporters reuse the same opt-in policy without creating extra spans.
export { redactPiiInValue } from "./piiRedaction";
export {
ERROR_TYPE,
ERROR_MESSAGE,
Expand Down
Loading
Loading