… PRs
PR test selection only follows source imports, so three PRs merged green
and broke the alpha cron's full suite: an OpenTelemetry lockfile bump
(#28581, otel-bridge), lockfile maintenance moving @ai-sdk/anthropic
(#29341, schema-compat e2e), and a new hook without a story (#29373,
storybook-coverage.test.ts reads the hooks folder rather than importing
it).
Prebuild now compares each workspace package's resolved dependency tree
between the base and head lockfiles and runs the tests of packages whose
tree or package.json changed. A root toolchain change, or a selection
over a quarter of the suite, runs the sharded full suite instead. Tests
that scan their package's directory run when a file there is added,
removed or renamed.
The selection logic also moves out of inline workflow script into
.github/scripts/select-affected-tests.cjs with unit tests, and keeps the
three-way split of large affected unit runs from #29143.
## Description
<!-- Required: Provide a brief description of the changes in this PR.
-->
## Related issue(s)
<!-- Required: Link to the issue(s) this PR addresses, e.g. with: Fixes
#123. PRs without linked issues will be closed. High-quality issues with
reproductions are preferred to vague pull requests. -->
## Type of change
- [ ] Bug fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
- [ ] Code refactoring
- [ ] Performance improvement
- [ ] Test update
## Checklist
- [ ] I have linked the related issue(s) in the description above
- [ ] I have made corresponding changes to the documentation (if
applicable)
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] I have addressed all Coderabbit comments on this PR
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## ELI5
The test selector checks whether package dependencies changed and
whether tests search their package folders for files. It uses the PR’s
own lockfile changes to select relevant tests, so unrelated changes on
the base branch do not trigger extra test runs.
## What changed
- Added dependency-based test routing. It compares resolved dependency
trees in the merge-base and PR-head lockfiles, follows workspace links,
and selects tests for affected packages.
- Selects a package’s tests when its `package.json` changes.
- Selects directory-scanning tests when files in their package are
added, removed, or renamed.
- Requests the full suite when root dependencies change or
dependency-based selection exceeds 25% of the test files.
- Moved Prebuild test selection into
`.github/scripts/select-affected-tests.cjs`. The script combines
import-graph and dependency-based selections and routes tests to the
applicable suites.
- Added tests for dependency routing and suite selection. Added `yaml`
as a root development dependency.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
This makes dashboard widget pinning work with any MCP Apps host, using
only standard MCP Apps messages, and gives React hosts a small hook to
wire it up.
When the user clicks a pin, the app sends `ui/update-model-context` with
the full list of widgets the user wants pinned under
`mastra.ai/dashboard-pinned-widgets` in `structuredContent` (each entry
is `{ widget, scope, defaults }`), plus a short text block so the model
knows too. The host still owns the state: it sends pinned ids back in
host context and the buttons follow that. Pin and drilldown state go in
the same update, so one never wipes the other, and quick clicks build on
each other until the host answers. Pin buttons only show when the host
holds the ids array and advertises
`updateModelContext.structuredContent`. Hosts parse the payload with
`dashboardPinnedWidgetsSchema`.
On the host side, `@mastra/playground-ui/domains/mcps` gets
`McpAppHostProvider`, which lets a chat add host-context keys per app
instance and receive raw model context with the app it came from,
without reloading the iframe. The existing text model-context path is
unchanged, and without the provider nothing changes.
`@mastra/mcp-apps-components/host` adds `useMcpAppHost`, which parses
and routes pin updates; that subpath doesn't pull in the app's HTML (1.6
KB vs 2.1 MB).
```tsx
import { McpAppHostProvider } from '@mastra/playground-ui/domains/mcps';
import { useMcpAppHost } from '@mastra/mcp-apps-components/host';
const host = useMcpAppHost({ dashboardPins: { pinnedIds, onPinnedChange } });
<McpAppHostProvider value={host}>{chat}</McpAppHostProvider>;
```
`@mastra/mcp-apps-components` is also added to the playground-snapshot
publish job so the platform frontend can pick it up with playground-ui.
Tested with the real app over an in-memory AppBridge (pin/unpin round
trip through `useMcpAppHost`, rapid clicks, host declining a pin,
drilldown + pins coexisting, capability gating, invalid payloads) and
MSW-backed tests for `McpAppToolResult`/`McpAppViewer` (host-context
changes reach the running app without reload, raw params reach
`onModelContext`, read-only and no-provider cases). Key behaviors were
mutation-checked. Typecheck, oxlint and builds pass for both packages.
Also checked by hand in Studio against `examples/agent`'s dashboard
agent, with a temporary `useMcpAppHost` provider around the chat: pin →
unpin → pin sends exactly one host update per click (with the widget's
defaults), the iframe never reloads, and the agent correctly names the
pinned widget from model context alone.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## ELI5
The dashboard can now send its pinned widgets to the app that hosts it.
The host can save those choices and send them back, while apps that do
not use the new host support can continue to work.
## What changed
- Added `McpAppHostProvider` to `@mastra/playground-ui/domains/mcps`. It
provides per-app host context and receives raw model-context updates
while the app is running.
- Added the `@mastra/mcp-apps-components/host` export and
`useMcpAppHost` hook. Hosts can provide pinned widget IDs and handle
validated pin updates.
- Changed dashboard pinning to use `ui/update-model-context`. The app
sends the full requested widget list under
`mastra.ai/dashboard-pinned-widgets`, with a text description and
request number. Pin and drilldown state share an update.
- Pin controls require host-provided pin IDs and support for
`updateModelContext.structuredContent`. The host can disable pinning by
setting the pin context value to `null`.
- Removed the dashboard pin notification API. Hosts now use the
pinned-widget schemas and model-context updates.
- Added `@mastra/mcp-apps-components` to the playground snapshot publish
workflow and updated snapshot release guidance. Snapshot checks and
publishing use production dependency filters.
## Compatibility
Apps can continue to work without `McpAppHostProvider`. The former
dashboard pin notification API was removed and replaced with
model-context updates.
## Tests and validation
Added tests for pin and unpin interactions, pending and declined
requests, host-context updates, model-context handling, capability
gating, and invalid pin data. The PR objectives report typecheck,
oxlint, and builds passing for both packages, plus manual Studio checks.
These results were not independently verified.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: mastracode <284800079+mastra-platform[bot]@users.noreply.github.com>
Enables all eleven requested Oxlint rules as errors in the root config
and migrates the 115 existing findings across 55 files. JSX curly-brace
simplification is limited to props (`props: 'never', children:
'ignore'`), boolean props use shorthand, and empty elements become
self-closing.
The manual edits preserve the exact continued-string and template
values, remove redundant assignment-side non-null assertions, and retain
the indexed-read assertion in fastembed's compound assignment. The
BigInt and octal conversions use native globals and exact values
supported by the existing compilation targets. No lint suppressions were
added.
Validation: the eleven-rule scan reports zero diagnostics; before/after
emitted-JavaScript comparison passes for all 55 migrated files,
including 31 JSX files, after normalizing only the reviewed syntax
rewrites. Formatting and whitespace checks pass. Core utility/clone
tests (146), fastembed pooling tests (9), the changed A2A signature test
(1), and fastembed build-config typechecking pass. The root lint scan
retains the same 1,244 pre-existing diagnostics with no new findings.
GitHub CI now also passes the full lint/format job, build, Mastra Code
typecheck, generated-file check, and bundle validation. Local UI/evals
runs were limited by missing dependencies; the CodeDiff folding failure
was reproduced on unchanged baseline code. A second audit confirmed
native unshadowed globals for all five literal conversions, pure targets
for all twelve assignment rewrites, no references or direct eval in all
eight simplified catches, and ordinary semantics for both computed keys.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## ELI5
This PR turns on more code-style checks and updates existing code to
pass them. The changes simplify syntax while preserving the intended
behavior.
## Changes
- Enabled eleven Oxlint rules as errors in the root configuration.
- Updated 115 findings across 55 files. Changes include simpler string
and JSX syntax, compound assignments, native BigInt and octal literals,
and catch clauses without unused error variables.
- Configured JSX curly-brace simplification for props only. JSX children
remain unchanged.
- Removed redundant assignment-side non-null assertions while retaining
the indexed-read assertion needed for fastembed’s compound assignment.
- Added no lint suppressions.
## Validation
The author reports zero diagnostics from the eleven-rule scan and no new
findings in the root lint scan, which retains 1,244 pre-existing
diagnostics. Before-and-after emitted-JavaScript comparisons reportedly
pass for all 55 changed files after normalizing the reviewed syntax
rewrites. Formatting and whitespace checks also pass.
Reported tests include 146 core utility and clone tests, 9 fastembed
pooling tests, 1 changed A2A signature test, and fastembed build-config
typechecking. Full workspace lint and the UI/evals suites were limited
by missing dependencies in the checkout. The CodeDiff folding test fails
on unchanged baseline code.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
> Opened by @user_01KN4T0VBWE4X5GKHXP2RCP40M
## What
`@mastra/inngest` (reported in #28120) was published without a `license`
field, so npm reported it as "Unlicensed" to license scanners even
though the tarball ships `LICENSE.md` with Apache-2.0. Auditing the repo
showed 12 publishable packages in the same state, not just Inngest.
This PR:
1. Adds `"license": "Apache-2.0"` to every affected manifest:
- `@mastra/inngest`
- `@mastra/editor`
- `@mastra/google-cloud-pubsub`, `@mastra/redis-streams`,
`@mastra/valkey-streams`
- `@mastra/cloudflare-d1`, `@mastra/couchbase`, `@mastra/dynamodb`,
`@mastra/elasticsearch`, `@mastra/lance`, `@mastra/mongodb`,
`@mastra/opensearch`
2. Teaches `.github/scripts/validate-pkg-json.mjs` to validate the field
for every package it already checks: missing license or a value other
than `Apache-2.0` fails the `Validate package.json files` CI job.
3. Ships one changeset (`patch` for all 12 packages) describing the
`package.json` update.
The validator's existing scope is unchanged: private packages, the
ignore list, and non-published templates/fixtures are still skipped.
Fixes#28120
## Proof
```
$ node .github/scripts/validate-pkg-json.mjs
✅ All checked package.json files passed validation.
Total: 160 files
```
Negative test — removing the new `license` field from
`workflows/inngest/package.json` and re-running:
```
❌ /workspace/mastra/workflows/inngest/package.json: missing license field
exit=1
```
Restoring the field returns the validator to `exit=0`, proving the check
is what fails rather than an unrelated error.
`npx prettier --check` passes on all changed files.
## Unverified
- `npm view @mastra/inngest license` only reflects the fix after the
next release publishes.
## Risk
low — metadata-only manifest changes plus a CI script check.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## ELI5
This change adds a clear license label to 12 packages. It also updates a
check that warns if a checked package is missing that label or uses a
different one.
## Summary
- Added `"license": "Apache-2.0"` to 12 package manifests.
- Updated `.github/scripts/validate-pkg-json.mjs` to reject checked
packages when the license field is missing or does not match
`Apache-2.0`. The validator’s existing package scope remains unchanged.
- Added a changeset that declares patch releases for 13 `@mastra`
packages.
## Validation
The author reports that the validator passes for 160 files, and that
removing the license field from `workflows/inngest/package.json`
produces an error and exit code 1. The author also reports that Prettier
checks pass on all changed files. Published npm metadata has not been
verified; it will reflect this change after a release.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Co-authored-by: mastra-platform[bot] <284800079+mastra-platform[bot]@users.noreply.github.com>
## 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>
Fixes the experiment companion-worker artifact contract required by
[MASTRA-4528](https://linear.app/kepler-crm/issue/MASTRA-4528/oss-experiment-worker-fix-persistence-enabled-execution-manifest).
## Summary
- disables worker-side experiment and score persistence while preserving
the protocol-supplied experiment ID
- makes pnpm experiment artifacts relocatable and excludes root
dependency/build metadata from reproducible content digests
- preserves configured native and dynamic dependencies as installable
artifact dependencies without evaluating native binaries during
validation
- rejects unresolved or malformed pnpm build approvals using a direct
runtime YAML parser dependency
- classifies cancellation during active item execution as cancelled
rather than failed
- adds installed-package E2E coverage across npm, strict pnpm, pnpm
workspaces, Yarn Berry, DuckDB, Postgres, workspace resources, LSP,
browser lifecycle, process isolation, and failure recovery
- adds exact CI path routing, PR/full/scheduled/gated tiers,
assertion-level JSON/Markdown evidence, and canonical immutable
Verdaccio artifact digest verification
- fixes complete registry package-name encoding reported by CodeQL
## Verification
- experiment-worker PR tier: 6 files / 14 tests passed
- experiment-worker full strict tier: 11 files / 30 tests passed
- experiment-worker routing/report/digest regressions: 4 files / 34
tests passed
- experiment-worker TypeScript, Prettier, workflow YAML parsing, and
whitespace checks passed
- CLI suite: 73 files / 935 tests passed
- deployer suite: 41 files / 590 tests passed
- workspace/CLI build: 50/50 tasks passed
- deployer build: 24/24 tasks passed
- cold adversarial ship review found no remaining blockers after
assertion-evidence, filtered-scenario, shell-input, and registry-digest
remediations
CLI typechecking remains blocked only by the two pre-existing oxlint
configuration errors in the root and CLI oxlint configs.
## Security review
- CodeQL incomplete package-name encoding finding was fixed with
`encodeURIComponent()` and regression coverage.
- Registry artifacts are hashed at publication and independently
verified after download; strict published-registry runs reject missing
digests and mutations.
- Workflow-dispatch scenario input is passed through a quoted
environment variable rather than interpolated into Bash.
- Socket Security exceeded its 10,000-dependency scan limit, so its PR
alert is a partial scan rather than a complete dependency-security
result.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## ELI5
This PR makes experiment workers safer to build, move, and run in
different environments. It also adds broad tests and CI checks to
confirm that workers keep the correct files, dependencies, protocol
behavior, and cleanup.
## Changes
- Disabled experiment and score persistence in standalone workers.
- Preserved experiment IDs and added protocol version and worker
identity metadata.
- Reported cancelled outcomes for interrupted in-flight experiment
items.
- Made pnpm artifacts relocatable.
- Excluded `node_modules`, pnpm metadata, and volatile build metadata
from artifact digests.
- Validated symlinks and rejected absolute or escaping symlink targets.
- Preserved configured native and dynamic dependencies without loading
native binaries during validation.
- Added pnpm `allowBuilds`, `onlyBuiltDependencies`, and hoisted linker
validation.
- Fixed complete scoped package-name URL encoding.
- Added protocol, manifest, artifact, registry digest, process cleanup,
and assertion-evidence helpers.
## E2E coverage
- Added 27 experiment-worker scenarios.
- Added installed-package tests for npm, Yarn, pnpm, and pnpm monorepos.
- Added coverage for persistence, PostgreSQL, DuckDB, workspaces, LSP,
browser lifecycle, process isolation, cancellation, failure recovery,
and negative cases.
- Added Verdaccio artifact digest and immutable registry snapshot
verification.
- Added scenario reports and assertion-level evidence validation.
## CI
- Added experiment-worker routing based on changed paths and CLI entry
files.
- Added PR, full, scheduled, gated, and manually dispatched test tiers.
- Added workflow contract tests and report artifact uploads.
- Renamed the required experiment E2E gate command to `test:experiment`.
## Validation
- Experiment-worker, CLI, deployer, workspace, CLI build, and deployer
build checks pass.
- CLI typechecking remains blocked by two pre-existing oxlint
configuration errors.
## Follow-up
- A non-blocking comment requested rejection of relative symlinks that
resolve outside the artifact root. This PR does not address that
request.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Mastra Code (anthropic/claude-fable-5) <noreply@mastra.ai>
Co-authored-by: Mastra CI <ci@mastra.ai>
This adds an in-house workflow that posts published GitHub releases to
Discord using Mastra-branded embeds. It includes manual preview and test
delivery options, release-note truncation with a link to the full
release, disabled mentions, and retries for rate limits and temporary
failures.
A notification title looks like `New release: @mastra/core@1.51.0 — July
15, 2026`. The webhook URL is read from the
`DISCORD_RELEASE_WEBHOOK_URL` Actions secret.
<img width="714" height="645" alt="image"
src="https://github.com/user-attachments/assets/9ffdc8c7-1175-4658-a3ee-7739b92d0d64"
/>
The payload builder and webhook delivery are covered by Node tests,
including server-error and rate-limit retries.
`DISCORD_RELEASE_WEBHOOK_URL` has already been setup in the secrets ;)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## ELI5
When a new stable Mastra release is published, this workflow
automatically posts a branded announcement to Discord. It also supports
previews, retries temporary failures, and keeps long release notes
manageable.
## What changed
- Added a GitHub Actions workflow for:
- Automatic notifications on stable `release.published` events
- Manual preview and delivery runs
- Prerelease filtering
- Secure webhook access via `DISCORD_RELEASE_WEBHOOK_URL`
- Added Discord payload generation with:
- Mastra-branded embeds
- Release name, version, date, URL, and notes
- Test-release labeling
- Mention suppression
- Safe URL fallbacks and release-note truncation
- Added webhook delivery with retries for network errors, rate limits,
and server failures.
- Added Node.js tests covering payload construction, truncation,
successful delivery, retries, and `retry_after` handling.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Adds a CI check that fails when any AGENTS.md file goes over the 500
token limit, then trims the existing AGENTS files so the repo passes the
new rule.
Before:
```md
# AGENTS.md
## Scope
This file applies to work in `packages/auth/`.
- Build from root: `pnpm build:auth`
```
After:
```md
Build from root: pnpm build:auth
Test from root: pnpm --filter ./packages/auth test
For broader auth coverage use pnpm test:auth
```
For codemod, the short AGENTS file now keeps the high-signal
instructions and points to a package-local skill for the longer workflow
and pattern reference.
codemod file went from ~5k tokens to 250, root AGENTS.md went from 1.8k
to 375
<img width="634" height="440" alt="Screenshot 2026-04-16 at 5 02 38 PM"
src="https://github.com/user-attachments/assets/307b6516-736b-47eb-98f4-48310d2d7d96"
/>
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## ELI5
This PR adds an automatic check that makes sure every AGENTS.md file
stays short (under 500 tokens) and shortens the existing AGENTS.md files
so they all pass that check.
## Overview
Enforces a 500-token limit for AGENTS.md files via CI, adds a validation
script to count tokens, and trims many AGENTS.md documents to keep only
high-signal guidance while moving large, detailed reference content into
a separate skill file.
## Changes
### CI & Validation
- Added `.github/scripts/validate-agents-md.mjs`: Node script that finds
AGENTS.md files, counts tokens using `tokenx`, and exits non‑zero if any
file exceeds the 500-token limit.
- Updated `.github/workflows/lint.yml`: new `agents-md-check` job runs
the validation script in CI for the mastra-ai/mastra repository.
### Dependencies
- Added `tokenx` (^1.3.0) to root `package.json` for token counting.
### AGENTS.md Consolidation
Multiple AGENTS.md files were condensed by removing multi-section
structure and extraneous formatting, preserving core commands and
high-signal instructions so each file stays ≤ 500 tokens:
- Root AGENTS.md: ~1.8k → 375 tokens (condensed conventions, removed
detailed examples and lengthy rules)
- docs/AGENTS.md: condensed docs and E2E guidance (removed fenced code
blocks and verbose explanations)
- packages/auth/AGENTS.md: simplified to core build/test guidance (62
tokens)
- packages/cli/AGENTS.md: collapsed into concise command lines (53
tokens)
- packages/codemod/AGENTS.md: main codemod guidance trimmed and
redirected to new skill file (result much smaller; AGENTS.md reduced
significantly)
- packages/core/AGENTS.md: flattened while keeping build/test/Zod-compat
notes (147 tokens)
- packages/mcp/AGENTS.md: consolidated client/server/integration test
guidance (107 tokens)
- packages/memory/AGENTS.md: reorganized integration workflow into a
concise section (283 tokens)
- packages/playground-ui/AGENTS.md: reduced to operational commands and
a brief design-system note (74 tokens)
- packages/playground/AGENTS.md: simplified build/test instructions and
coordination note (99 tokens)
- packages/rag/AGENTS.md: collapsed into brief build/test/lint guidance
(81 tokens)
- packages/server/AGENTS.md: condensed to three sentences covering
build/test/permissions (85 tokens)
### Knowledge Base Enhancement
- Added `packages/codemod/.claude/skills/codemod-patterns/SKILL.md`: a
607-line detailed codemod patterns and workflow guide moved out of
AGENTS.md to keep AGENTS.md concise.
## Validation
A terminal validation run (included in the PR) shows all AGENTS.md files
pass the 500-token rule, with token counts ranging from 53 to 403 and a
final message: "All AGENTS.md files are within the 500-token limit."
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Mastra Code (openai/gpt-5.4) <noreply@mastra.ai>
Co-authored-by: Abhi Aiyer <abhiaiyer91@gmail.com>
Replace execSync with spawn for pnpm list command to stream stdout
instead of buffering it all at once, preventing buffer overflow errors
in large workspaces.
Co-Authored-By: Mastra Code <noreply@mastra.ai>
## Description
- Refactor agent approval page
## Related Issue(s)
<!-- Link to the issue(s) this PR addresses, using hashtag notation:
#123 -->
## Type of Change
- [ ] Bug fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [x] Documentation update
- [ ] Code refactoring
- [ ] Performance improvement
- [ ] Test update
## Checklist
- [ ] I have made corresponding changes to the documentation (if
applicable)
- [ ] I have added tests that prove my fix is effective or that my
feature works
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Documentation**
* Added a new "Agent Approval" doc covering agent- and tool-level
approvals, suspension/resumption flows, storage prerequisites, approval
modes, and TypeScript examples for approve/decline/resume workflows.
* Removed the previous "Human-in-the-loop with Tools" doc and updated
navigation to point to the new page.
* **Chores**
* Added a permanent redirect so old links route to the new Agent
Approval page and updated routing logic to handle v1 doc paths.
<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Description
- docs: refine cloud observability and move logging
## Related Issue(s)
<!-- Link to the issue(s) this PR addresses, using hashtag notation:
#123 -->
## Type of Change
- [ ] Bug fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
- [ ] Code refactoring
- [ ] Performance improvement
- [ ] Test update
## Checklist
- [ ] I have made corresponding changes to the documentation (if
applicable)
- [ ] I have added tests that prove my fix is effective or that my
feature works
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Documentation**
* Reorganized logging content under Observability and updated navigation
links
* Expanded observability docs with detailed logs and traces guidance for
agents and workflows, plus illustrative examples
* Updated Mastra Cloud callout to reference a built-in "Studio" for
testing (linked in docs)
* Added redirect so legacy /docs/v1/logging URLs point to the new
Observability Logging page
<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Description
- chore: fix check deleted pages script
## Related Issue(s)
<!-- Link to the issue(s) this PR addresses, using hashtag notation:
#123 -->
## Type of Change
- [ ] Bug fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
- [ ] Code refactoring
- [ ] Performance improvement
- [ ] Test update
## Checklist
- [ ] I have made corresponding changes to the documentation (if
applicable)
- [ ] I have added tests that prove my fix is effective or that my
feature works
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Chores**
* Improved redirect-detection logic for more reliable and efficient
recognition of removed pages.
* Adjusted CI workflow steps and environment settings to streamline
checks and reduce false-positives during MDX-related runs.
* Minor workflow formatting and caching configuration tweaks to
stabilize automated redirect verification.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Description
- test: add new link checker scripts
## Related Issue(s)
<!-- Link to the issue(s) this PR addresses, using hashtag notation:
#123 -->
## Type of Change
- [ ] Bug fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
- [ ] Code refactoring
- [ ] Performance improvement
- [ ] Test update
## Checklist
- [ ] I have made corresponding changes to the documentation (if
applicable)
- [ ] I have added tests that prove my fix is effective or that my
feature works
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
## Chores
* Automated redirect validation now integrated into pull request checks
* Deleted documentation pages are validated for corresponding redirects
* PR comments alert about missing or invalid redirects
* Enhanced validation process with improved robustness
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Description
- chore: reset redirects
- remove locale check from validate-redirects
## Related Issue(s)
<!-- Link to the issue(s) this PR addresses, using hashtag notation:
#123 -->
## Type of Change
- [ ] Bug fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
- [ ] Code refactoring
- [ ] Performance improvement
- [ ] Test update
## Checklist
- [ ] I have made corresponding changes to the documentation (if
applicable)
- [ ] I have added tests that prove my fix is effective or that my
feature works
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Documentation**
* Streamlined documentation routing by removing numerous legacy
redirects and adding a single permanent redirect from the
agents-and-tools doc to the workflows overview, improving navigation
consistency.
* **Chores**
* Simplified redirect validation behavior and reporting to reduce noise
during checks.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Description
Bump minimum required Node.js version to 22.13.0
## Related Issue(s)
<!-- Link to the issue(s) this PR addresses, using hashtag notation:
#123 -->
## Type of Change
- [ ] Bug fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [X] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
- [ ] Code refactoring
- [ ] Performance improvement
- [ ] Test update
## Checklist
- [ ] I have made corresponding changes to the documentation (if
applicable)
- [ ] I have added tests that prove my fix is effective or that my
feature works
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Chores**
* Raised minimum Node.js requirement to 22.13.0 across the entire
package suite (core, SDKs, templates, deployers, stores, voice,
observability, examples).
* Issued major version bumps for the Mastra package suite.
* Added manifest validation to enforce presence of Node engine
declarations and cleaned up package metadata.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Description
Migration of Nextra docs to Docusaurus.
## Related Issue(s)
<!-- Link to the issue(s) this PR addresses, using hashtag notation:
#123 -->
## Type of Change
- [ ] Bug fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
- [ ] Code refactoring
- [ ] Performance improvement
- [ ] Test update
## Checklist
- [ ] I have made corresponding changes to the documentation (if
applicable)
- [ ] I have added tests that prove my fix is effective or that my
feature works
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Documentation**
* Removed a large set of docs in the docs-new directory, including
guides, examples, and reference pages across Agents, Auth, Deployment,
Examples, Evals, RAG, Memory, Observability, and Processors.
* **Chores**
* Updated redirect validation configuration source.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Paul Scanlon <pauliescanlon@gmail.com>
Co-authored-by: LekoArts <lekoarts@gmail.com>
## Description
<!-- Provide a brief description of the changes in this PR -->
## Related Issue(s)
<!-- Link to the issue(s) this PR addresses, using hashtag notation:
#123 -->
## Type of Change
- [ ] Bug fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
- [ ] Code refactoring
- [ ] Performance improvement
- [ ] Test update
## Checklist
- [ ] I have made corresponding changes to the documentation (if
applicable)
- [ ] I have added tests that prove my fix is effective or that my
feature works
## Description
Add rebase=false when pulling branch in sync template script to avoid
`divergent branches` issues. The content of the code is replaced after,
fixing any conflict that might arise
## Related Issue(s)
<!-- Link to the issue(s) this PR addresses, using hashtag notation:
#123 -->
## Type of Change
- [ ] Bug fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
- [ ] Code refactoring
- [ ] Performance improvement
- [ ] Test update
## Checklist
- [ ] I have made corresponding changes to the documentation (if
applicable)
- [ ] I have added tests that prove my fix is effective or that my
feature works
## Description
<!-- Provide a brief description of the changes in this PR -->
## Related Issue(s)
<!-- Link to the issue(s) this PR addresses, using hashtag notation:
#123 -->
## Type of Change
- [ ] Bug fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
- [ ] Code refactoring
- [ ] Performance improvement
- [ ] Test update
## Checklist
- [ ] I have made corresponding changes to the documentation (if
applicable)
- [ ] I have added tests that prove my fix is effective or that my
feature works
## Description
This script and Action aims to fix two issues we're experiencing with
the docs:
1. There are duplicate sources for redirects, depending on where the
redirect has been added in `next.config.mjs` it might be overwritten buy
the duplicate if it's been defined lower down in the redirects array.
2. Checks that destination URLs are actually pages
The GitHub Action passes in the current deployment URL using
`MASTRA_DEPLOYMENT_URL` so redirects can be checked against the preview
URL, before a PR is merged and the docs site is redeployed.
## Example
The output will look like this:
```bash
========================================
Links found: 154
Links skipped: 5
Redirects OK: 144
Broken destinations: 5
Duplicate sources: 21
Time elapsed: 0 minutes, 47 seconds
========================================
```
You can see the Action output here:
https://github.com/mastra-ai/mastra/actions/runs/16353420333/job/46205721011?pr=6046
## Test
Contained within this PR is also a change to `next.config.mjs` where
i've de-duplicated a URL for `/examples/rag/rerank/rerank`
The output after making this change looks like this, there is one fewer
**Links found**, and one fewer **Duplicate sources**:
```bash
========================================
Links found: 153
Links skipped: 5
Redirects OK: 143
Broken destinations: 5
Duplicate sources: 20
Time elapsed: 1 minutes, 14 seconds
========================================
```
You can see the Action output here:
https://github.com/mastra-ai/mastra/actions/runs/16353695814/job/46206653612?pr=6046
## Related Issue(s)
<!-- Link to the issue(s) this PR addresses, using hashtag notation:
#123 -->
## Type of Change
- [ ] Bug fix (non-breaking change that fixes an issue)
- [x] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
- [ ] Code refactoring
- [ ] Performance improvement
- [ ] Test update
## Checklist
- [ ] I have made corresponding changes to the documentation (if
applicable)
- [ ] I have added tests that prove my fix is effective or that my
feature works
## Description
<!-- Provide a brief description of the changes in this PR -->
## Related Issue(s)
<!-- Link to the issue(s) this PR addresses, using hashtag notation:
#123 -->
## Type of Change
- [ ] Bug fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
- [ ] Code refactoring
- [ ] Performance improvement
- [ ] Test update
## Checklist
- [ ] I have made corresponding changes to the documentation (if
applicable)
- [ ] I have added tests that prove my fix is effective or that my
feature works
## Description
<!-- Provide a brief description of the changes in this PR -->
## Related Issue(s)
<!-- Link to the issue(s) this PR addresses, using hashtag notation:
#123 -->
## Type of Change
- [ ] Bug fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
- [ ] Code refactoring
- [ ] Performance improvement
- [ ] Test update
## Checklist
- [ ] I have made corresponding changes to the documentation (if
applicable)
- [ ] I have added tests that prove my fix is effective or that my
feature works