Skip to content

Contentrain/ai

v@contentrain/[email protected] Breaking

This release includes 1 breaking change for platform teams planning a safe upgrade.

✓ No known CVEs patched
Read the diff → Tool health → What is this tool? →

✓ No known CVEs patched in this version

Topics

ai-agents claude-code content-governance contentrain cursor developer-tools
+8 more
git i18n mcp mcp-server model-context-protocol sdk typescript windsurf

ReleasePort's take

Light signal
editorial:auto 11d

`CdnDocumentQuery.all()` now returns index entries without the `body` field.

Why it matters: Affects code that relies on `document().all()` returning full documents; update queries to handle missing `body`. Severity 70 indicates significant impact.

Summary

AI summary

Breaking change: CdnDocumentQuery.all() no longer returns documents with a body field.

Changes in this release

Breaking High

`CdnDocumentQuery.all()` now returns index entries without `body` field, breaking previous usage.

`CdnDocumentQuery.all()` now returns index entries without `body` field, breaking previous usage.

Source: llm_adapter@2026-07-15

Confidence: low

Breaking High

`CdnDocumentQuery.all()` now returns `DocumentIndexEntry<T>[]`, omitting the `body` field.

`CdnDocumentQuery.all()` now returns `DocumentIndexEntry<T>[]`, omitting the `body` field.

Source: granite4.1:30b@2026-07-15-audit

Confidence: low

Breaking High

`CdnDocumentQuery.first()` now returns `DocumentIndexEntry<T> | undefined`, no longer including `body`.

`CdnDocumentQuery.first()` now returns `DocumentIndexEntry<T> | undefined`, no longer including `body`.

Source: granite4.1:30b@2026-07-15-audit

Confidence: low

Refactor Medium

Type-level contracts for document queries are enforced via `*.test-d.ts` using `vitest --typecheck`.

Type-level contracts for document queries are enforced via `*.test-d.ts` using `vitest --typecheck`.

Source: granite4.1:30b@2026-07-15-audit

Confidence: low

Full changelog

Major Changes

  • d617dab: feat(sdk)!: CDN document().all() returns index entries, so reading .body no longer compiles

    On the CDN, document(model).all() reads the model's _index, which carries
    frontmatter only — the body lives in the per-slug document and is reachable via
    bySlug(). But all() was typed Promise<T[]>, and the generated document type
    declares body: string. So entry.body type-checked, returned undefined at
    runtime, and pages rendered their headings and dropped their prose — with no
    error, no warning, and a passing typecheck.

    The trap is that the bundled runtime's all() does carry bodies. Code written
    and tested against bundled delivery compiled and passed, then quietly rendered
    empty on CDN. The two modes genuinely differ in shape, so they no longer share
    one return type.

    BREAKING: CdnDocumentQuery.all() now returns DocumentIndexEntry<T>[]
    (Omit<T, 'body'>), and first() returns DocumentIndexEntry<T> | undefined.
    Reading .body off either is now a compile error. Fetch the body with
    bySlug(slug), which returns { frontmatter, body, html }. Runtime behaviour is
    unchanged — this only makes the types tell the truth about what was already
    being returned.

    // before — compiled, rendered nothing
    const sections = await client.document<GuideSections>("guide-sections").all();
    sections.map((s) => renderMarkdown(s.body)); // undefined at runtime
    
    // after — the first line is a compile error; fetch bodies explicitly
    const index = await client.document<GuideSections>("guide-sections").all();
    const full = await Promise.all(index.map((s) => q.bySlug(s.slug)));
    full.map((d) => renderMarkdown(d!.body));
    

    Type-level contracts are now asserted in *.test-d.ts via vitest --typecheck,
    since tsconfig.json only covers src and never type-checked the tests.

Breaking Changes

  • `CdnDocumentQuery.all()` now returns `DocumentIndexEntry[]` (omitting `body`) and `first()` returns `DocumentIndexEntry | undefined`; reading `.body` is a compile error. Use `bySlug(slug)` to fetch the full document including `body`.

Weekly OSS security release digest.

The CVE patches and breaking changes that affected production tools this week. One email, every Sunday.

No spam, unsubscribe anytime.

Share this release

Track Contentrain/ai

Get notified when new releases ship.

Sign up free

About Contentrain/ai

Local-first MCP server for AI content governance — 13 tools for model/content CRUD, validation, normalization, and i18n across any framework.

All releases →

Related context

Earlier breaking changes

Beta — feedback welcome: [email protected]