mirror of
https://github.com/mastra-ai/mastra.git
synced 2026-11-17 08:44:46 +00:00
199 commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
8d4abc4f88 |
chore(deps): Vanta 2026-11-12 — raise undici to 8.12.4 / 7.30.2 (#30205) | ||
|
|
1892f79532 |
chore: remove stale scripts, workspace entries and package metadata (#29891)
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com> |
||
|
|
3a01ed16f4 |
ci: cache what affected-test detection parses, so PR test selection takes ~4s instead of ~40s (#29133)
## What "Detect affected tests" decides which test files a PR runs. Today it parses ~15,000 files on every PR run: madge builds the import graph, then a second pass extracts exported names and symbol edges. That takes ~40s on the 5 vCPU runner, and almost none of those files changed since the last run. This change caches the parse results in a file, keyed by a hash of each file's content: - `scripts/affected-tests-cache.mjs` stores, per file, only what its own text decides: the import specifiers precinct finds and the exports and symbol edges the second pass extracts. Records are keyed by `sha1(extension + content)`. - Resolving those specifiers to files is **not** cached. It still runs live through filing-cabinet with madge's exact options, so a rename, a moved file or an alias change can't be hidden by a cache hit. - The cache file records its schema version and the precinct and typescript versions. If any of them differ, the run starts cold. It is never wrong. - `.github/workflows/prebuild.yml` restores the cache before detection (restore only; PRs never save). The key is `affected-graph-v1-<os>-<sha>` with the prefix restore-key `affected-graph-v1-<os>-`, so a PR gets the newest main seed. - The new `.github/workflows/affected-graph-seed.yml` refreshes the seed on every push to main. It runs detection once on core's entry point, which touches the whole graph, then saves the cache. A newer push cancels an older seed run. The detection output (selected files, graph nodes, test files) is unchanged. ## Numbers Measured on a 5 vCPU / 16 GB container like the CI runner, Node 24.22.1: | | time | |---|---| | Uncached (today) | 40.3s | | Cached, current seed | 4.0s | | Cached, seed ~300 commits old | ~13s | | Seed run on main | ~40s | The seed file is 14.8 MB raw and 1.7 MB in the actions cache. Compute: about 36s saved per PR run, against about 90s per merge to main for the seed run. ## Testing - Ran detection uncached and cached on 20 recent merged PRs (between 1 and 3,532 files selected): output identical on all 20. - Renamed `retry-after.ts`, updated its importers and added a new test file importing the renamed module: identical output (2,849 selected), the new test is selected and the old path is gone from the graph. - `packages/core/src/affected-tests-cache.test.ts` covers cold, warm and changed-import runs. It fails if records are keyed by file name instead of content. - `packages/core/src/affected-tests-resolution.test.ts` and `.github/scripts/ci-routing.test.ts` pass. oxlint and prettier are clean. Stacked on #29091 (cancelled runs stop downstream jobs). It will be retargeted to main once that merges. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## ELI5 The affected-test detector checks which tests may need to run after code changes. This PR saves file-parsing results so later checks can reuse them, while still resolving file links against the current code. ## What changed - Added a content-addressed cache for file parsing. It stores import specifiers, exported names, and symbol edges, and checks a schema and extractor-version string before reusing records. - Kept file resolution live through filing-cabinet and Madge’s existing options. Updated affected-test detection to use the cache and save records used during the run. - Added a workflow to refresh the cache seed on pushes to `main`. Updated prebuild to restore the seed for affected-test detection. - Added a test for uncached, cold-cache, and warm-cache graphs, including after a file’s imports change. ## Validation Test, lint, formatting, output-comparison, runtime, and review-finding results: not available. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: remy-builder[bot] <324360501+remy-builder[bot]@users.noreply.github.com> |
||
|
|
43f77e77a0 |
ci: delete the Changed Test Gate (#29099)
## What this does
Deletes the Changed Test Gate workflow, its labeler workflow (which
labels PRs from the gate's result) and `scripts/pr-test-gate/`. The
gate's deployer rule is kept: it moves into Prebuild as a small
`Deployer E2E coverage` job.
## What the gate enforced, and what goes
The gate checked out the base branch, restored the PR's changed test
files on top of it, and ran them. Removing it drops two rules:
1. **Fail-before-fix.** If a PR changed tests, those tests had to fail
against the base branch ("Changed tests passed against the base branch.
They should fail before the PR code is applied."). This rule goes.
2. **External contributors must add tests.** A PR from outside the org
(`AUTHOR_ASSOCIATION` not OWNER/MEMBER/COLLABORATOR) with no changed
test files failed. This rule goes.
A third rule stays: **a PR that changes `packages/deployer/` must also
change `e2e-tests/monorepo/`** (`packages/deployer/AGENTS.md` and
`CHANGELOG.md` exempt; the same-repo Changesets release PR skipped).
It's now `Deployer E2E coverage` in `prebuild.yml`: a `git diff
--name-only` against the merge base, no install or build. It's its own
job rather than a step in `changes`, because a failing `changes` job
would skip every test job. `packages/deployer/AGENTS.md` now names that
job.
## Why dropping 1 and 2 is acceptable
- Neither rule was enforced at merge time: the gate isn't a required
check. The required checks are `Lint` and `Unit and E2E Tests / Merge
Test Reports`, and this PR touches neither.
- Of the gate's last 1000 runs, 8 failed. All 8 were the fail-before-fix
rule firing on tests that passed without the fix; each PR resolved it by
rewriting its tests. Across 812 gate logs from Aug–Oct, every run that
executed tests took the passing path (changed tests failed against base,
as required). So it shaped how a few tests were written, but no run
showed it stopping broken code from merging.
- It costs a runner, a checkout and a test run on every non-draft PR, on
top of Prebuild running the same changed tests against the PR head.
- External contributions still go through maintainer review, which can
ask for tests.
## Test plan
- [x] `rg` for remaining references: only two "former" comments and an
unrelated fixture name
- [x] `pnpm install --frozen-lockfile` works after removing
`scripts/pr-test-gate` (192 projects)
- [x] Deployer check shell logic run locally under `bash -eo pipefail`
with a stubbed diff: deployer-only change fails with the annotation;
deployer + `e2e-tests/monorepo/` passes; `AGENTS.md`/`CHANGELOG.md`-only
passes; no deployer change passes
- [ ] CI on this PR: no Changed Test Gate check appears; `Deployer E2E
coverage` passes
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## ELI5
This change removes the old system that checked whether pull requests
added and tested tests. It keeps one focused rule: changes to the
deployer package must include a monorepo E2E test change, with specified
documentation files exempt.
## Changes
- Deleted the Changed Test Gate workflow, its labeler workflow, and the
`scripts/pr-test-gate/` package.
- Added a separate `Deployer E2E coverage` job to Prebuild. The job
checks the merge-base diff and fails when a non-exempt file under
`packages/deployer/` changes without a file under `e2e-tests/monorepo/`.
- Exempted `packages/deployer/AGENTS.md` and
`packages/deployer/CHANGELOG.md` from the coverage check.
- Updated `packages/deployer/AGENTS.md` to refer to the Prebuild job.
- Updated comments in the memory simulation config and two test
link-provider files.
## Validation
The PR description reports that `pnpm install --frozen-lockfile`
succeeded across 192 projects and that the deployer-check shell logic
passed the listed local cases. CI validation is not confirmed: the
description says it is not yet known whether the old check disappears
and the new job passes.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: remy-builder[bot] <324360501+remy-builder[bot]@users.noreply.github.com>
|
||
|
|
ee5a1b0282 |
docs: make packages frontmatter more precise (#29499)
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com> |
||
|
|
0893940ca2 |
fix(docs): generate SOURCE_MAP.json from public export names (#29328)
Co-authored-by: Lennart <lekoarts@gmail.com> |
||
|
|
f0ad164646 |
chore(security): Vanta 2026-11-02 - @hono/node-server 2.1.6 (MCP SDK/templates), graphql-scalars 2.0.1, raw-body 4, jose 6 (overrides) (#29199) | ||
|
|
9ce7e350ea |
chore(deps): lock file maintenance (#29341)
Co-authored-by: wardpeet <ward@coding-tech.com> Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com> |
||
|
|
3bdb4ec5f4 |
chore(deps): update build tools (major) (#29026)
> [!NOTE] > This PR body was truncated due to platform limits. This PR contains the following updates: | Package | Type | Update | Change | Pending | |---|---|---|---|---| | [@vitest/coverage-v8](https://vitest.dev/guide/coverage) ([source](https://redirect.github.com/vitest-dev/vitest/tree/HEAD/packages/coverage-v8)) | pnpm.catalog.default | major | [`4.1.12` → `5.0.5`](https://renovatebot.com/diffs/npm/@vitest%2fcoverage-v8/4.1.12/5.0.5) | `5.1.0` | | [@vitest/mocker@>=2.1.0 <4.1.12](https://redirect.github.com/vitest-dev/vitest/tree/main/packages/mocker) ([source](https://redirect.github.com/vitest-dev/vitest/tree/HEAD/packages/mocker)) | pnpm-workspace.overrides | major | [`4.1.12` → `5.0.5`](https://renovatebot.com/diffs/npm/@vitest%2fmocker@>=2.1.0 <4.1.12/4.1.12/5.0.5) | `5.1.0` | | [@vitest/ui](https://vitest.dev/guide/ui) ([source](https://redirect.github.com/vitest-dev/vitest/tree/HEAD/packages/ui)) | pnpm.catalog.default | major | [`4.1.12` → `5.0.5`](https://renovatebot.com/diffs/npm/@vitest%2fui/4.1.12/5.0.5) | `5.1.0` | | [dotenv](https://redirect.github.com/motdotla/dotenv) | devDependencies | major | [`^17.4.2` → `^18.0.9`](https://renovatebot.com/diffs/npm/dotenv/17.4.2/18.0.9) | | | [dotenv](https://redirect.github.com/motdotla/dotenv) | devDependencies | major | [`17.4.2` → `18.0.9`](https://renovatebot.com/diffs/npm/dotenv/17.4.2/18.0.9) | | | [vitest](https://vitest.dev) ([source](https://redirect.github.com/vitest-dev/vitest/tree/HEAD/packages/vitest)) | devDependencies | major | [`^4.1.12` → `^5.0.5`](https://renovatebot.com/diffs/npm/vitest/4.1.12/5.0.5) | `5.1.0` | | [vitest](https://vitest.dev) ([source](https://redirect.github.com/vitest-dev/vitest/tree/HEAD/packages/vitest)) | pnpm.catalog.default | major | [`4.1.12` → `5.0.5`](https://renovatebot.com/diffs/npm/vitest/4.1.12/5.0.5) | `5.1.0` | | [vitest](https://vitest.dev) ([source](https://redirect.github.com/vitest-dev/vitest/tree/HEAD/packages/vitest)) | devDependencies | major | [`4.1.12` → `5.0.5`](https://renovatebot.com/diffs/npm/vitest/4.1.12/5.0.5) | `5.1.0` | | [vitest@>=2.1.0 <4.1.12](https://vitest.dev) ([source](https://redirect.github.com/vitest-dev/vitest/tree/HEAD/packages/vitest)) | pnpm-workspace.overrides | major | [`4.1.12` → `5.0.5`](https://renovatebot.com/diffs/npm/vitest@>=2.1.0 <4.1.12/4.1.12/5.0.5) | `5.1.0` | --- > [!WARNING] > Some dependencies could not be looked up. Check the [Dependency Dashboard](../issues/9505) for more information. --- ### Release Notes <details> <summary>vitest-dev/vitest (@​vitest/coverage-v8)</summary> ### [`v5.0.5`](https://redirect.github.com/vitest-dev/vitest/releases/tag/v5.0.5) [Compare Source](https://redirect.github.com/vitest-dev/vitest/compare/v5.0.4...v5.0.5) ##### 🐞 Bug Fixes - Keep vite default `fs.deny` with api token file - by [@​hi-ogawa](https://redirect.github.com/hi-ogawa), **Hiroshi Ogawa** and **Claude Opus 5.5** in [#​11578](https://redirect.github.com/vitest-dev/vitest/issues/11578) [<samp>(28dc1)</samp>]( |
||
|
|
47a6cd82e5 |
chore(deps): update ai sdk (#29242)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> |
||
|
|
278ecceb2d |
chore(deps): update ai sdk (#28928)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> |
||
|
|
f6cd11f348 |
chore(deps): lock file maintenance (#28672)
This PR contains the following updates: | Update | Change | |---|---| | lockFileMaintenance | All locks refreshed | --- > [!WARNING] > Some dependencies could not be looked up. Check the [Dependency Dashboard](../issues/9505) for more information. 🔧 This Pull Request updates lock files to use the latest dependency versions. --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - "before 6am on wednesday" - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://redirect.github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate CLI](https://redirect.github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xOTAuMCIsInVwZGF0ZWRJblZlciI6IjQ0LjE5MC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJhdXRvbWF0aW9uIl19--> --------- Co-authored-by: mastra-platform[bot] <284800079+mastra-platform[bot]@users.noreply.github.com> |
||
|
|
6deb7c0a1e |
chore(security): Vanta 2026-10-28 - qs 6.16.1, @modelcontextprotocol/node 2.1.1 floors (#28716)
Refs mastra-ai/platform#2931 Vanta remediation pass for 2026-10-28. It follows #28325, which has merged. ## 2026-10-28 update Today's live Vanta export added 3 advisory IDs on `mastra-ai/mastra` (GitHub/Dependabot). This PR fixes the two that have a published fix and leaves deepmerge, which has none. | Package | From → To | Finding | Where | How | |---|---|---|---|---| | qs | 6.16.0 → 6.16.1 | CVE-2026-110816 / GHSA-6pq8-jhm2-2vcw (Medium ×4) | root `pnpm-lock.yaml`, 9 `e2e-tests/*` lockfiles, `scripts/gh-issue-triage/package-lock.json` | Raised the existing floors `qs@>=6.7.0 <6.16.0: 6.16.0` → `<6.16.1: 6.16.1` and `'qs@<6.7.0': 6.16.0` → `6.16.1`. Raised the npm override in gh-issue-triage. | | @modelcontextprotocol/node | 2.0.0 → 2.1.1 | GHSA-f897-62hf-6gxq (High ×2; HTTP transports had no body-size or batch-length limit) | root `pnpm-lock.yaml` (published `@mastra/mcp` 1.18.0, used as `mcp-legacy`), `scripts/gh-issue-triage/package-lock.json` | New pnpm override `'@modelcontextprotocol/node@>=2.0.0 <2.1.0': 2.1.1` and a new npm override in gh-issue-triage. I used 2.1.1 rather than 2.1.2 because 2.1.2 needs a `@modelcontextprotocol/server` peer of `^2.4.0`, while `@mastra/mcp` 1.18 resolves server 2.3.1. `packages/mcp` itself already uses node 2.1.2. | - Both versions are older than the 1-day `minimumReleaseAge`: qs 6.16.1 was published 10-14 and node 2.1.1 on 10-02. I did not use qs 6.16.2 (10-27), which is too new. - No floors or overrides were removed; existing ones were only raised. - `pnpm install --frozen-lockfile --lockfile-only` passes at the root. Each nested e2e workspace was regenerated with `pnpm install --lockfile-only`. - Added the empty changeset `.changeset/vanta-2026-10-28-security-floors.md`. No published package changes. - After this change, osv-scanner over all 33 lockfiles reports only the documented leftovers: - zod 3.25.76 (zod v3 compat line on purpose) - ai 4.3.19 / `@ai-sdk/provider-utils` 2.2.8 (vendored v4 line) - `@azure/msal-node` 5.6.0 / 6.0.1 (fix 7.1.0 needs majors in identity and teams) - `@opentelemetry/core` 1.30.1 (needs pubsub 6) - extract-zip 2.0.1 (no patched release) - deepmerge 4.3.1 (CVE-2026-93753 / GHSA-gcqx-w48m-w2h4; no patched release, 4.3.1 is the latest) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## ELI5 This PR updates dependency rules and package versions to use newer releases, including security fixes for `qs` and `@modelcontextprotocol/node`. It also updates AI SDK dependencies and does not include published package changes. ## Summary - Raise the `qs` override target to `6.16.1` in the root and e2e workspaces and in `scripts/gh-issue-triage`. - Add an `@modelcontextprotocol/node` override at `2.1.1` in the root workspace and `scripts/gh-issue-triage`. - Update AI SDK dependency versions across package manifests and add a changeset describing the provider-utils update. - Add an empty changeset for the security-only dependency updates. <!-- end of auto-generated comment: release notes by coderabbit.ai --> ## Update 2026-10-28 (afternoon) - Merged origin/main (clean). - Bumped the AI SDK v5 compat line from @ai-sdk/provider-utils 3.0.41 to 3.0.42 (patch, published 2026-10-21; it blocks `.internal` hostnames in download URL validation and encodes provider-returned IDs in request paths). This addresses the Aikido /mastra Highs AIKIDO-2026-10990 and AIKIDO-2026-10981: - ai 5.0.277 → 5.0.282, @ai-sdk/gateway 2.0.168 → 2.0.173 (vendored ai_v5) - anthropic 2.0.109 → 2.0.110, google 2.0.103 → 2.0.106, groq 2.0.58 → 2.0.59, openai 2.0.135 → 2.0.137, openai-compatible 1.0.58 → 1.0.59, xai 2.0.99 → 2.0.100 - Nested lockfiles updated: memory/integration-tests and playground/e2e/kitchen-sink. - No new overrides. Changeset: `vanta-2026-10-28-ai-sdk-v5-provider-utils.md`. |
||
|
|
34983c9bbb |
chore(security): Vanta 2026-10-23/26 - storybook 9.1.21, body-parser, fast-uri, multer, serialize-javascript, zod pins, esbuild/bundle-name overrides (#28325)
## Update 2026-10-26 afternoon (Vanta pass) Added commit ` |
||
|
|
0f82b38ed4 |
refactor(lint): flatten lone if statements in else branches (#28431)
Enable `no-lonely-if` in the shared Oxlint config and flatten 38 lone
`if` statements in `else` blocks across 35 files. For example, `else {
if (condition) { ... } }` becomes `else if (condition) { ... }`.
Conditions, evaluation order, statements, comments, and local bindings
are preserved. No package filters or lint exceptions are added.
Strengthen the existing monorepo test to execute another named export
from an optimized dependency. Comparisons of TypeScript syntax, emitted
JavaScript, raw template text, comments, and local bindings pass for all
35 migrated files after normalizing only the redundant else blocks. The
rule clears all 15,094 scanned files.
[CI lint and formatting
pass](https://github.com/mastra-ai/mastra/actions/runs/40344286057/job/121647174331)
for `
|
||
|
|
2f485b2d56 |
chore(deps): update security updates [security] (#28222) | ||
|
|
82e82fb5a7 |
chore(deps): update security updates [security] (#27869)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> |
||
|
|
40a522c142 |
chore(deps): update build tools (#27997) | ||
|
|
a15ea70e71 |
security: Vanta remediation (2026-10-21) (#28018) | ||
|
|
353b4811df |
test(libsql): port T81 recovered-history cross-process coverage (#27945)
Ports T81 using a real child process, shared LibSQL storage and UNIX-socket pubsub. The original parks in a blocking tool; the replacement confirms live-owner recovery is refused, waits for real lease expiry while the original is SIGSTOPped, then recovers without force. After SIGCONT and full original execution settlement, persisted history must still contain exactly one replacement-authored final answer with unchanged message IDs, ordering and content. Existing pause/resume helpers are reused; only a test and fixture are added, with no runtime changes or changeset. Both durable and evented controls are enabled, as is durable recovery. Evented recovery is explicitly skipped: one uninstrumented run stalled in recover() before returning its stream (20s guard, repetition 8); 50 instrumented repeats passed without explaining it. The assertions remain in-tree for re-enablement after diagnosis. This is not COR-1334 reproduction, a runtime fix, or proof that a stale write was attempted and rejected. Validation: 20 final uninstrumented fresh-process runs, each 3 passed / 1 explicitly skipped; 28 neighboring helper, ownership, T79 and T80 tests passed; temporary stale-overwrite and duplicate-answer negative controls failed on the intended assertions for both engines and were removed. Package tsc --noEmit, type-aware lint, formatting and git diff --check pass. No orphan T81 peers or cross-process sockets remain. Independent final reviews found no remaining must-fix issues. Test command: pnpm --filter @mastra/libsql exec vitest run src/__tests__/cross-process/xproc-recovered-original-write.test.ts Related: https://linear.app/kepler-crm/issue/COR-1444/port-t81-xproc-recovered-original-write-pause-and-resume-a-cross. Records the in-tree port for COR-1388; does not close COR-1334. Evented recovery coverage remains incomplete as documented above. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## ELI5 This PR adds a test that starts work in one process, pauses it, and checks that another process can safely finish it after the first process loses its lease. It confirms that the saved conversation has one correct final answer and no duplicate messages. ## Changes - Added the `t81-peer` cross-process fixture. - Added durable LibSQL recovery coverage with: - A real child process. - Shared LibSQL storage. - UNIX-socket pubsub. - Lease-expiry handling. - `SIGSTOP` and resume behavior. - Message ID, order, content, and replacement-author checks. - Added a control test for normal completion. - Confirmed recovery is rejected while the original process still owns the run. - Skipped evented recovery because an instrumented setup stall remains unresolved. - Added no runtime changes or changeset. ## Validation The PR reports passing results for: - 20 fresh-process runs. - 28 neighboring tests. - Type checking. - Linting. - Formatting. - Diff checks. Validation command: ```bash pnpm --filter @mastra/libsql exec vitest run src/__tests__/cross-process/xproc-recovered-original-write.test.ts ``` <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: NikAiyer <nick.aiyer@gmail.com> Co-authored-by: mastra-platform[bot] <284800079+mastra-platform[bot]@users.noreply.github.com> |
||
|
|
4f60903242 |
chore(deps): lock file maintenance (#27013) | ||
|
|
f3cf77305f |
security: Vanta remediation (2026-10-20) (#27828) | ||
|
|
dbde4bf36a |
chore(deps): update ai sdk (#27728)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> |
||
|
|
fa409d430b |
security: Vanta remediation pass 2026-10-14/15/19 (zod 4.6.7, @ai-sdk/provider-utils, @copilotkit template) (#27023) | ||
|
|
4bb2f0ad72 |
feat(ci): fail PRs and publishes on packages missing from npm (#26721)
## Why Alpha.9 publish run 38152562840 published 7 packages, then failed partway through on the brand-new `@mastra/sprites` with `E404 PUT` / `ERR_PNPM_AUTH_TOKEN_EXCHANGE`. `npm-publish.yml` uses npm trusted publishing (OIDC) with no token fallback. npm only exchanges the job's GitHub OIDC token for a publish token if the package exists and has a trusted publisher matching this repo and workflow, and npm only allows a trusted publisher on a package that already exists. So a never-published workspace package, or an existing one with no trusted publisher (or one for another workflow), breaks the release after other packages have already gone out. Recovery took an npm org admin doing a manual first publish and an `npm trust` call, then a rerun. ## What - **`.github/scripts/check-npm-packages-exist.mjs`** checks that every non-private workspace package exists on npm, using anonymous registry reads (works in PR workflows without secrets). `--since <ref>` limits the check to packages whose `package.json` changed, which catches new packages and private→public promotions. `--retry-404` waits out registry propagation delay. A registry it can't reach (exit 2) is reported separately from a missing package (exit 1), so registry flakiness is never reported as a missing package. - **Trusted-publishing check (`--oidc`, publish jobs only; new in this PR)**: for every package in scope, the script requests a GitHub OIDC token (audience `npm:registry.npmjs.org`) and POSTs it to `/-/npm/v1/oidc/token/exchange/package/<name>`. This is the exchange pnpm 11 and npm 11 perform at publish time (endpoint and request shape taken from pnpm 11.21's `publish/oidc/authToken.js` and npm 12.2's `lib/utils/oidc.js`). The token npm returns is discarded and never printed. A granted token proves npm accepts this job as the package's trusted publisher (repo, workflow and, if the publisher names one, GitHub environment). It does not prove the publish itself will be accepted: npm uses the same exchange for publish, stage publish and dist-tag, so a trusted publisher limited to staged publishing passes this check. The placeholder script below checks that permission when it configures or reads back trust. A refused exchange fails with the packages named and the fix (`scripts/npm-placeholder-publish.mjs` or `npm trust github … --file npm-publish.yml`). Registry or GitHub-token errors are reported separately as "could not verify". The check covers every package in scope, not just those with a new version, because stable and snapshot run it before versioning. All 163 current public packages already have a version published through trusted publishing. - **PR gate** (`lint.yml`, job *New packages exist on npm*): Changesets release PRs check every package. Other PRs only check packages whose `package.json` changed, and PRs that touch none make no registry calls. PR refs stay out of shell: routing is done with `if:` and the base ref is passed through `env:`. The gate has no OIDC token, so it only **warns** (`:⚠️:`, never fails) when a package exists but no version of it was ever published through trusted publishing. A fresh placeholder looks like that until CI's first publish. - **Publish check** in all four publish jobs (prerelease, stable, snapshot, playground-snapshot): existence check, then the trusted-publishing check. Each check makes one pass over every package, then re-checks only the missing or refused ones against one shared 5-minute deadline, which picks up a package or trusted publisher an admin fixed minutes ago. A failing job therefore takes about one retry window, however many packages fail. If every package is refused, which points to a misconfigured job rather than the packages, the check fails after the first pass. It runs before anything publishes, and for stable before the version commit is pushed to `main`. - **`scripts/npm-placeholder-publish.mjs`**: the recovery both checks point to. An npm org admin runs `node scripts/npm-placeholder-publish.mjs <package>` after `npm login`. For a never-published name it publishes an empty `0.0.0` placeholder (package.json + README, no code from any branch). It then configures trusted publishing for `npm-publish.yml` (with npm ^11.15.0, the first version with `--allow-publish`) and reads it back with `npm trust list`. It skips the setup when a usable trusted publisher is already present, and fails if npm doesn't report one afterwards. A trusted publisher for this repo and workflow is usable only if it allows publishing (`createPackage`; older settings with no permissions field count) and is not restricted to a GitHub environment, because the publish jobs declare none. A stage-only or environment-restricted one is reported with the `npm trust revoke --id` command to remove it, instead of being treated as configured. CI then publishes the real versions. Prereleases go out under `alpha`, so `latest` stays on the placeholder until the first stable release, and the placeholder's description and README point installers to `<package>@alpha`. The script refuses unknown or private names, an unreachable registry and a logged-out session, publishes nothing for a name already on npm, and supports `--dry-run`. CI-only change, so there is no changeset. ## Testing - `node --test .github/scripts/check-npm-packages-exist.test.mjs scripts/npm-placeholder-publish.test.mjs`: 37/37, all against local mock registries. Against the previous scripts, 12 of the 13 new tests fail, as does the tightened trust-configuration test. The one exception is the "no warning" test, which passes on both. - Trusted-publishing check: trust present (exchange granted), no trust (exchange refused, package named, fix printed), every package refused (points at the job), exchange endpoint unreachable (exit 2, not "no trust"), transient 503/429 recovery, GitHub token endpoint failing, missing `id-token: write`, and trust appearing within the retry window. Timing tests cover a run where every package is refused (fails in under a second with a 60-second window; the earlier per-package polling took 144 seconds) and 24 refused or 24 missing packages (about one 3-second window; per-package polling took about 7.6 seconds). The tests assert the request shape (audience, POST path, bearer token) and that no token appears in the output. - Placeholder script: runs the real `npm publish`, `npm trust github` and `npm trust list`, and asserts the uploaded tarball holds only `README.md` and `package.json` at 0.0.0, with the `@alpha` install pointer. Trust read-back is covered for already configured, configured but not reported back (fails), an existing package trusting another workflow, a stage-only publisher and an environment-restricted publisher (both fail with revoke steps; both were accepted before), and older settings with no permissions field (accepted). - **The token exchange has not been run against live npm with a real GitHub OIDC token.** That needs `npm-publish.yml` in mastra-ai/mastra, so the first real run will be the next publish. Locally, read-only: a fake id token sent to the live exchange endpoint gets `401 OIDC token exchange error - unauthorized`, which the check reports as refused (exit 1). Without `id-token: write` it exits 2. - Current main against live npm: all 163 publishable packages exist (exit 0), with no trusted-publishing warnings. - Incident replay (tree before the alpha.9 version commit, registry in its publish-day state): flags only `@mastra/sprites`. Running the placeholder script then publishes 0.0.0 and sets up trust, and the re-run check passes. - The PR that added sprites (#26650, which added the `@mastra/sprites` package) would have been flagged by the PR gate: of the 32 packages it changed, only sprites is flagged. - Live npm, read-only: `--dry-run` for an existing name and for a never-published name (nothing uploaded). - actionlint on `lint.yml` and `npm-publish.yml` (no findings besides the repo-wide custom runner labels); `yaml-lint` on both workflows; `oxfmt --check` on the scripts. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## ELI5 This PR checks that packages exist on npm before release workflows use them. It also adds a script to prepare new packages for their first npm release. ## Changes - Added a pull request check. Changesets release PRs check all publishable packages. Other PRs check packages whose `package.json` changed. PRs that change no package manifests make no registry calls. - Added package-existence and trusted-publishing preflights to the prerelease, stable, snapshot, and playground-snapshot jobs. - Added optional `--oidc` checks. A successful token exchange shows that npm granted the job a token; it does not prove that the token has publish permission. Without OIDC, the check warns when a package has no version previously published through trusted publishing. - Added retries for missing packages and refused token exchanges, using a shared deadline. The check stops polling when every package’s first OIDC exchange is refused. - Added `scripts/npm-placeholder-publish.mjs`. It can publish a public `0.0.0` placeholder and configure trusted publishing. It rejects unknown, private, already-published, unverifiable, or unauthenticated cases, and supports `--dry-run`. - Added tests for the package checks and placeholder-publishing flows. - The PR objectives report 37/37 tests passing against local mock registries and workflow and script lint checks. These results were not independently verified. - The PR objectives report that live npm token exchange with a real GitHub OIDC token has not yet been tested. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: remy-builder[bot] <324360501+remy-builder[bot]@users.noreply.github.com> |
||
|
|
7aec8b0d95 |
security: Vanta remediation pass 2026-10-12 (better-auth, MCP SDK) (#26773)
## Summary Vanta remediation for 2026-10-12. Target list is today's live export (77 findings, 44 unique IDs). Platform findings are handled in mastra-ai/platform#3317. ### What changed | Package | From → To | Findings | Where | How | |---|---|---|---|---| | better-auth | 1.7.5 → 1.7.7 | AIKIDO-2026-373183 (Critical) | root + `examples/agent` | raise override `better-auth: ^1.7.7`; direct dep `@mastra/auth-better-auth` ^1.7.7 | | @better-auth/drizzle-adapter | 1.7.5 → 1.7.7 | AIKIDO-2026-261025 (Low) | root + `examples/agent` | floor `'@better-auth/drizzle-adapter@<1.7.7': 1.7.7` (also pulled by better-auth 1.7.7) | | @modelcontextprotocol/sdk | 1.31.0 → 1.32.1 | AIKIDO-2026-365378 (High), -156139, -344432 | root, nested locks, `scripts/gh-issue-triage` | raise floor to `<1.32.0 → 1.32.1`; bump direct pins/ranges | Nested `pnpm-workspace.yaml` floors raised in e2e-tests/*, examples/*, integration-tests, etc., and those lockfiles regenerated. Versions used were published >24h ago (minimumReleaseAge). Patch changeset included for published packages whose dependency ranges changed. Aikido lens on this branch: better-auth and MCP SDK findings are gone. OSV: handlebars already clear on main; remaining high are braces/extract-zip (no patch). ### Left as-is (no patch, or major-only) - extract-zip ≤2.0.1: no fix (overdue; removed by #25855 when that lands). Needs Vanta risk acceptance. - braces 3.0.3, sprintf-js 1.0.3/1.1.3: no patched release - postcss-selector-parser 6.x: @tailwindcss/typography pins 6.0.10 - katex 0.16: mermaid declares ^0.16.47 - @ag-ui/client 0.0.59: fix only in 1.0.0 (major). Parent `@copilotkit/channels-*` 0.11.0 pins 0.0.59 exactly (template-genui-data-explorer) - @hono/node-server 1.19 (fix 2.1.3), undici 6.29 (fix 7.23/8.10), raw-body 3 in templates (fix 4), bundle-name 3 (fix 4.1.1), got 15 (fix 16), zod 3.25 (fix 4.x), @bufbuild/protobuf 1.10 (fix 2.x), openai 6.49 (fix 7.x), jose 5.10 via @segment/analytics-node in template (fix 6.x), @ai-sdk/provider-utils 2.2.8 / 3.0.x Aikido ranges wanting 4.0.18+: major-only or scanner range noise Do not merge unless reviewed. No CI weakened. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## ELI5 This PR updates shared dependency versions so the project uses newer releases of Better Auth and the MCP SDK. It also updates workspace rules to keep older versions from being selected. ## Changes - Updated Better Auth requirements and workspace overrides to `^1.7.7`. - Updated `@modelcontextprotocol/sdk` requirements and overrides to `1.32.1` across affected packages and workspaces. - Added overrides for older `@better-auth/drizzle-adapter` versions to use `1.7.7`. - Added a patch changeset for `@mastra/auth-better-auth`, `@mastra/mcp-registry-registry`, and `@mastra/playground-ui`. Test results and review findings were not provided. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
ea7ca755a4 |
security: Vanta remediation pass 2026-10-07 (MCP SDK, sharp, hono) (#26260) | ||
|
|
4358322b7b |
chore(deps): override upstream-blocked vulnerable transitive deps (#25853) | ||
|
|
aeddbc9909 |
security: Vanta 2026-09-28 residuals (template proxy-addr, nested undici/next/shell-quote/form-data, OTEL, onnxruntime) (#25344) | ||
|
|
7b777d38d9 |
security: Vanta zero pass 2026-09-23 (grpc/compression/provider-utils floors) (#24848) | ||
|
|
fdcd75925f |
Make the affected-test detector see packages that import with .js specifiers (#24488)
## Summary CI picks which tests to run on a PR by building a module graph of the repo and walking it backwards from the changed files. That graph is built by madge, which resolves imports through enhanced-resolve using `scripts/madge.webpack.config.cjs`. That config had no `extensionAlias`. Packages written for TypeScript's NodeNext resolution import their own relative files as `'../tools.js'` even though the file on disk is `../tools.ts` — and without `extensionAlias` the resolver looks for a literal `.js` file, finds nothing, and silently drops the edge. `mastracode/sdk` is written entirely in that style (212 of 256 source files), so its portion of the graph was essentially empty and any PR touching SDK source was told no tests were affected. The full-suite jobs did not catch this either, so those changes shipped with no test signal at all. Two changes: teach the resolver to map `.js`/`.mjs`/`.cjs` specifiers onto their TypeScript sources, and let madge traverse `.mts`/`.cts` files, which this package uses for its child-process fixtures. Fixes #24218 ## Test plan Detector output for the same inputs, before and after: | changed file | before | after | | --- | --- | --- | | `mastracode/sdk/src/agent-connections/tools.ts` | 0 tests | 20 tests, including its own colocated `__tests__/tools.test.ts` | | `mastracode/sdk/src/index.ts` | 0 tests | 19 tests | | `packages/core/src/agent/index.ts` (control) | 1229 tests | 1470 tests | The control case was already working but was also under-selecting, since workspace packages consumed by core use the same import style; it now resolves those edges too. Graph is denser, so selection is slightly slower — 21.4s to 23.5s for the core case, about 10%. That is well worth the correctness. Note: registering the SDK's own vitest project is separate work, as the issue describes — `vitest.config.ts` points at a `mastracode/vitest.config.ts` that does not exist, and the SDK suite is currently red on main. This PR only fixes the detector. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## ELI5 This PR helps the test selector follow SDK imports correctly. It ensures source changes select the tests that depend on them. ## Changes - Added Madge aliases for `.js`, `.mjs`, and `.cjs` imports. - Added `.mts` and `.cts` files to Madge traversal. - Added a NodeNext import-resolution test. - Added a guard for missing colocated tests. - Added two retries for failed TUI E2E shard tests. ## Reported results - SDK tool changes select 20 tests instead of none. - SDK index changes select 19 tests instead of none. - A core control case selects 1,470 tests, up from 1,229. - Runtime increased from 21.4 to 23.5 seconds. - SDK Vitest project registration remains out of scope. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: tyler-mastra[bot] <331730378+tyler-mastra[bot]@users.noreply.github.com> Co-authored-by: Tyler Barnes <tylerdbarnes@gmail.com> |
||
|
|
5bfe0af40c |
security: clear remaining Dependabot alerts + raise Aikido floors (round 2) (#24391) | ||
|
|
95f1ad9148 |
security: raise pnpm override floors for Vanta/Dependabot (proxy-addr critical) (#24327) | ||
|
|
80845a3559 |
fix(ci): build local @mastra/core before packing it for the import floor check (#23907)
`check:core-imports` falls back to packing the local `packages/core` when a package's core peer floor names a version that isn't published yet. The "Validate peer dependencies" CI job never builds core, so that fallback packed a tarball with no `dist/` and every `@mastra/core/*` subpath import failed to resolve — e.g. `Resolved 0/23 @mastra/core import paths` for `@mastra/server` on #23875, the first PR to raise a floor to an unpublished core. The script now builds core (`pnpm turbo build --filter ./packages/core`) before packing when `dist/` is absent. Reproduced locally by deleting `dist/`, bumping core to `999.0.0` and pointing `@mastra/server`'s floor at it: before the change the server check resolved 0 paths; after, it builds, packs and resolves all imports. No changeset: script-only change. Co-authored-by: Mastra Code (anthropic/claude-fable-5-1) <noreply@mastra.ai> |
||
|
|
164e197aa5 |
fix: bump vulnerable dependencies to patched releases (#24027)
Co-authored-by: Cursor Agent <cursoragent@cursor.com> |
||
|
|
d77518bd2a |
chore: update package READMEs and add conditional CI validation (#23488)
Co-authored-by: Mastra Code (openai/gpt-6-astra) <noreply@mastra.ai> |
||
|
|
e983f74987 |
chore(*): Update/unify/add READMEs (#22858)
Co-authored-by: Mastra Code (openai/gpt-5.6-sol) <noreply@mastra.ai> |
||
|
|
c975ebdb0b |
fix: validate core imports against peer dependency floors (#22564)
Co-authored-by: Mastra Code (openai/gpt-5.6-sol) <noreply@mastra.ai> |
||
|
|
d50fe06cbf |
chore: upgrade monorepo to TypeScript 7 (#22459)
Co-authored-by: Mastra Code (openai/gpt-5.6-sol) <noreply@mastra.ai> |
||
|
|
8d368276f6 |
fix: secure issue triage dependencies (#22501)
Co-authored-by: Mastra Code (openai/gpt-5.6-sol) <noreply@mastra.ai> |
||
|
|
7d35cca22b |
fix: raise dependency security floors (#22484)
Co-authored-by: Mastra Code (openai/gpt-5.6-sol) <noreply@mastra.ai> |
||
|
|
de8784224a |
fix(ci): include exported server subpaths in affected tests (#21140)
Before, `@mastra/server/server-adapter` was resolved as if it lived directly under `packages/server/src`, so affected-test selection skipped adapter coverage. This now follows workspace export paths back to source modules, so server handler changes select dependent adapter tests. For the workflow change from #20184, the analyzer now includes 9 Express and 11 Fastify tests. I checked formatting and graph resolution, then ran the affected-test analyzer. Running the Express suite now reaches the existing 409 expectation failures that this CI gap had hidden. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## ELI5 The test tool now follows workspace package links to the real source files. It selects tests that depend on changed server handlers, including 9 Express tests and 11 Fastify tests. ## Changes - Added `buildWorkspaceSourceAliases` in `scripts/workspace-source-aliases.cjs`. - Reused shared workspace alias logic in affected-test analysis and Madge Webpack configuration. - Added support for workspace export subpaths and exact aliases. - Removed duplicated package discovery and alias construction logic. - The Express suite now exposes existing 409 expectation failures that CI previously missed. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> |
||
|
|
cc85af2425 |
fix(deps): update fast-uri (#20557)
Updates all tracked fast-uri resolutions to 3.1.5 to address CVE-2026-18446 and the earlier Aikido findings. Moves the agent-hub pnpm overrides into its workspace config so pnpm 11 enforces the security floor. Also refreshes the stale gh-issue-triage pnpm-lock to match its manifest. Validated frozen lockfile installs, the triage npm install, and the agent-hub tests. No related issue. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## ELI5 This PR updates `fast-uri` to a safer version that fixes security problems. It also moves dependency rules so pnpm 11 applies them correctly. ## Changes - Updated all tracked `fast-uri` resolutions to `3.1.5`. - Updated security override constraints from `<3.1.2` to `<3.1.5`. - Moved `agent-hub` pnpm overrides into `agent-hub/pnpm-workspace.yaml`. - Preserved local Mastra package links and dependency version overrides. - Excluded `fast-uri@3.1.5` from minimum release age checks. ## Validation - Ran frozen lockfile installs. - Ran the triage npm install. - Ran `agent-hub` tests. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
9a20c3fa52 |
chore(deps): update mastra (#20410) | ||
|
|
bdeaef58f0 |
chore: migrate linting to oxlint (#20173)
Co-authored-by: GitHub Action <action@github.com> Co-authored-by: Mastra Code (openai/gpt-5.6-sol) <noreply@mastra.ai> |
||
|
|
1aad6198fd |
chore(deps): lock file maintenance (#19903) | ||
|
|
de2e407f7a |
chore(deps): update dependency typescript to v7 (#19271)
Co-authored-by: wardpeet <ward@coding-tech.com> |
||
|
|
2592c7226a |
chore(deps): lock file maintenance (#19457)
This PR contains the following updates: | Update | Change | |---|---| | lockFileMaintenance | All locks refreshed | 🔧 This Pull Request updates lock files to use the latest dependency versions. --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - "before 6am on wednesday" - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://redirect.github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://redirect.github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yNjMuNSIsInVwZGF0ZWRJblZlciI6IjQzLjI2My41IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJhdXRvbWF0aW9uIl19--> |
||
|
|
d709df0053 |
chore(deps): update build tools to ^4.23.1 (#19612)
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [tsx](https://tsx.hirok.io) ([source](https://redirect.github.com/privatenumber/tsx)) | devDependencies | patch | [`^4.23.0` → `^4.23.1`](https://renovatebot.com/diffs/npm/tsx/4.23.0/4.23.1) | --- ### Release Notes <details> <summary>privatenumber/tsx (tsx)</summary> ### [`v4.23.1`](https://redirect.github.com/privatenumber/tsx/releases/tag/v4.23.1) [Compare Source](https://redirect.github.com/privatenumber/tsx/compare/v4.23.0...v4.23.1) ##### Bug Fixes - support tsImport after global preload ([8d4ffc2]( |
||
|
|
0532405a28 |
chore(deps): update build tools (#18043) |