Skip to content

Contentrain/ai

v@contentrain/[email protected] Breaking

This release includes breaking changes 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 10d

The release introduces several performance optimizations: inlining applyPlan blob content for GitHub provider writes, adding opt‑in read memoization to GitHubReader, injecting stats into buildContextChange to skip expensive walks, and batching local git subprocess spawns during transaction creation.

Why it matters: These changes reduce API calls per write to a fixed three, deduplicate repeated path reads, skip O(models·locales) reader walks when counts are known, and cut config/checkout calls per transaction, directly improving efficiency for GitHub‑related operations.

Summary

AI summary

Updates Minor Changes, Patch Changes, and f1a2dce across a mixed release.

Changes in this release

Performance Medium

GitHub provider now inlines applyPlan blob content reducing API calls per write to a fixed 3.

GitHub provider now inlines applyPlan blob content reducing API calls per write to a fixed 3.

Source: llm_adapter@2026-07-16

Confidence: high

Performance Medium

GitHubReader adds opt‑in read memoization deduplicating repeated path reads within one operation.

GitHubReader adds opt‑in read memoization deduplicating repeated path reads within one operation.

Source: llm_adapter@2026-07-16

Confidence: high

Performance Medium

buildContextChange gains stats injection to skip O(models·locales) reader walk when model/entry counts are known.

buildContextChange gains stats injection to skip O(models·locales) reader walk when model/entry counts are known.

Source: llm_adapter@2026-07-16

Confidence: high

Performance Medium

Local writes batch git subprocess spawns, cutting config and checkout calls per transaction.

Local writes batch git subprocess spawns, cutting config and checkout calls per transaction.

Source: llm_adapter@2026-07-16

Confidence: high

Full changelog

Minor Changes

  • f1a2dce: Three additive GitHub-provider optimizations that cut API calls per write (no breaking changes)

    • applyPlan blob inliningapplyPlanToGitHub now inlines file content directly in the Git tree entries instead of POSTing a blob per file. A write drops from N+3 GitHub mutations to a fixed 3 (tree + commit + ref) regardless of file count, easing the mutation-rate secondary limit. This brings the GitHub provider to parity with the GitLab provider, which already inlines content in its commit actions. Deletions are unchanged (null-sha entries); content is passed through byte-for-byte.
    • GitHubReader opt-in read memoizationnew GitHubReader(client, repo, { memoize: true }) deduplicates repeated (path, ref) reads within one operation across readFile / listDirectory / fileExists. Opt-in and off by default; failed reads are evicted so transient errors are retried, not cached. The provider's own long-lived reader does not enable it (a reader that outlives a write must not serve stale results).
    • buildContextChange stats injectionbuildContextChange(reader, operation, source, { stats }) lets a caller that already knows the model/entry counts skip the O(models·locales) reader walk; only readConfig remains. The emitted context.json is byte-identical to the scanned variant. Parameterless callers are unaffected.

Patch Changes

  • cfface5: Speed up local writes by batching git subprocess spawns in the worktree transaction

    Every local write (content_save, model_save, bulk, normalize apply, …) runs through createTransaction, which spawned ~40 git processes for a single content save. Two behavior-preserving batches cut that:

    • Commit identity via environment — the worktree git instance now carries GIT_AUTHOR_* / GIT_COMMITTER_* in its env instead of running two git config user.* spawns per transaction (and per contentrain_merge). Git honors these for both the sync merges and the feature-branch commit.
    • Batched selective syncselectiveSync replaced its per-file git cat-file -e existence loop with a single git ls-tree over the changed paths, and its per-file git checkout HEAD -- <file> loop with a single batched checkout (per-file fallback on error preserves precise skip accounting). Working-tree deletions are parallel fs removals.

    Measured: a 2-locale content_save drops from ~40 git spawns to ~30 (config 2→0, cat-file 5→0, checkout 7→3), roughly halving the operation's wall-clock. The selective-sync win scales with file count, so bulk writes benefit the most. No behavior change — the full worktree-transaction test suite passes unchanged.

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]