Skip to content

Releases

v6.1.0

Choose a tag to compare

@github-actions github-actions released this 29 Sep 10:03

Grain 6.1.0 states a convention, a norm or a co-change partner only when it beats chance or the rest of the repository, so what it tells you is more often true. It finds dependencies with the same code as Yggdrasil 6.1.0, shows what changes together with grain cochange, measures a stretch of work with grain measure, and offers every command over MCP. The core of the family (Yggdrasil, Grain, Jarl and Horde) ships under one number, so this minor release includes a few changes that ask something of you: Before you upgrade lists them, and Upgrading from 6.0.0 walks through the steps.

Before you upgrade

  • Type-only imports count as dependencies. Grain reads a TypeScript or JavaScript type-only import (import type, typeof import('./m') and the other forms) as a dependency between modules, as Yggdrasil 6.1.0 does. Expect the relations they imply in your next proposal and in grain check and grain report.
  • The six original MCP tools answer with the command line's text. grain_where, grain_how, grain_what, grain_check, grain_status and grain_report keep their names and fields. Pass json: true wherever your client reads their JSON.
  • MCP paths are absolute. The server does not run in your directory, so it takes an absolute path in every field the command resolves against its working directory, such as repo, out, graph, proposal, content, family-candidates, and grain_propose's out-dir and json. A path inside the repository, such as grain_check's file, can stay relative. A number field takes a number, and a field the tool does not list is refused. Pass absolute paths for repo and the other path fields.
  • grain export no longer carries agentShare and lastByAgent (see Removed), and the schema stays grain-export/1. Drop those two fields from any script that reads the export.
  • Grain's family candidates have their own file and unique ids. grain propose writes its look-alike groups to .family-candidates.grain.json, separate from the .family-candidates.json Yggdrasil's miner writes, and yg advise reads it from Yggdrasil 6.1.0 on. Each id now names the partition and the group (family-grain-<partition>-<group>), so a family you dismissed or deferred appears once more under its new id; dismiss or defer it again.
  • grain completeness takes at least one file. Called with none, it prints its usage and exits 1, so a script that builds the list should pass at least one.

Upgrading from 6.0.0

  1. Update the plugin in each host you use: claude plugin update grain@grain-marketplace and restart the session, copilot plugin update grain, codex plugin marketplace upgrade grain-marketplace, or in Cursor git pull in your clone of Grain and Developer: Reload Window. Grain needs Node 22 or newer and git, as before.
  2. Upgrade Yggdrasil to 6.1.0 alongside it, and pin the exact versions of the family tools your pipeline runs. Horde 6.1.0 needs Grain 6.1.0 or newer. grain propose checks whether the yg it finds accepts the new root parent for top-level types; with no yg on PATH it writes root, which Yggdrasil 6.1.0 accepts and 6.0.0 does not, and says so.
  3. Give the first Grain command in each repository a little longer: it rebuilds the store and reads the whole history once.
  4. Update MCP clients and scripts: absolute paths for repo and the other path fields, only the fields each tool lists, json: true wherever you read JSON from the six original tools, and no agentShare or lastByAgent from grain export.
  5. In a repository that adopted a Grain proposal before 6.1.0, run grain propose --family-candidates .yggdrasil once from the repository root to give yg advise Grain's families; it writes .yggdrasil/.family-candidates.grain.json. Dismiss or defer again any family that shows under its new id.
  6. In the same repository, drill an adopted rule with yg drill --aspect <id>. The CORPUS.md beside its cases names --dir and --corpus grain-proposal, which record the run as an external hold-out that yg advise and the health reading leave out; a new proposal's CORPUS.md names the plain command.

Added

  • The MCP server offers every command as a tool (grain_propose, grain_advise, grain_decide_steer and the rest), with the command's flags as its fields; grain_help returns the full usage. A call ends on cancel or after 10 minutes (60 for propose and selftest; see GRAIN_MCP_TIMEOUT_MS and GRAIN_MCP_LONG_TIMEOUT_MS).
  • grain cochange shows which files, directories or nodes change together more often than chance and scores a proposed split into parts (--partition); grain measure --from <commit> --to <commit> compares one part of the repository at two commits. Their --json documents are grain-cochange/1 and grain-measure/1.
  • grain advise drafts rules the graph could take on (kind: rule items): a grain decide boundary the graph does not enforce yet, and a convention inside one node that no rule states.
  • grain propose --scope <nodes and paths> proposes a graph for one part of the repository, and --shape types covers each file by its type and writes a node only where one type sits inside another (--shape nodes stays the default).
  • grain propose writes its look-alike groups beside the proposed graph, so yg adopt installs them and yg advise suggests a rule for each; --family-candidates <path> and --no-family-candidates choose another place or none, and Grain leaves another producer's file alone.
  • grain report names the smallest set of dependencies that breaks each dependency cycle between modules, with the file and line of each reference, also in report --json (cycleCuts) and the proposal's refactor backlog.
  • grain where, check and review carry location in their JSON (the module a path belongs in and whether it exists yet), and grain completeness --json gives grain-completeness/1.
  • grain selftest --null and --cochange measure how often Grain's claims survive shuffled evidence and how often its co-change partners come true, and grain oracle score also scores ownership units.
  • Vue and Svelte components join the architecture through their <script> imports, and more Ruby and C++ files read as those languages (Gemfile, .gemspec, .cppm, .ixx and others).
  • Copilot CLI and Codex load the plugin from the portable Agent Plugins 1.0 layout.

Changed

  • Architecture norms ("files here do not import that module"), "never X" statements, group conventions, value sets and commit shapes now have to beat chance or the rest of the repository before Grain states them. Expect different findings from grain check and grain propose on the same code: fewer false ones, and some new ones, such as a boundary no file has ever crossed.
  • Co-change partners are the files that change beside yours more often than chance would bring them there, so busy files such as a changelog stay out of the list.
  • grain propose offers a short list of below-the-bar candidate rules, each passing the same test as a convention: 37 and 61 on Grain and Yggdrasil, down from about 500 and 740.
  • Grain spots a fading convention on a repository of any age, and check stops flagging new code under a convention the new code has left behind.
  • Grain parses with Yggdrasil 6.1.0's grammars, so a relation in a proposal is one yg check sees, and it reads newer syntax such as TypeScript using, C++20 modules and C# 14 extension blocks.
  • grain decide list marks a boundary promoted once the architecture graph forbids it, and Grain leaves that import to yg check.
  • The skill and the session-start note point the agent to the MCP tools first, with the command line as the fallback.

Fixed

  • Dependencies: Grain resolves imports the way each language's toolchain does in Java, Kotlin, C#, Rust, Go, Python, Ruby, C, C++, PHP, TypeScript and JavaScript, and on a case-insensitive file system (the macOS and Windows default) it matches a file only under the exact name its directory lists, so a new proposal carries more real relations and fewer false ones.
  • Proposals: yg adopt accepts a proposal for code with dependency cycles, because grain propose breaks each cycle at its weakest dependency and lists the cut in REFACTOR-BACKLOG.md. A rule whose drill cases could not all run stays unverified, and over an existing graph the next: line previews with yg adopt <out> --replace --dry-run.
  • Mining skips the root .yggdrasil/, so the drill corpora yg adopt installs there stay out of conventions and co-change.
  • Every family candidate has a unique id and reports its measured tightness.
  • grain check gives one consistent verdict when a narrow convention and a wider one disagree about a function.
  • Dev containers: in VS Code attached to a container, the hooks and the MCP server exit 0 with one line when the plugin path is missing inside, and the MCP server maps a container path to the host through the containers' mounts.
  • The MCP server stops the running command on SIGTERM, SIGINT or SIGHUP, and answers ping while a command runs.
  • Windows: the hooks accept short and differently cased paths, grain propose finds an npm-installed yg, and files with Windows line endings read as they do elsewhere.

Removed

  • Grain treats every commit the same, whether a person or an agent made it, and no longer reports who wrote the code. That retires the agent-authored share and its alarm in status and report, the "held mostly by agent-authored code" note, and agentShare and lastByAgent in grain export. A repository written mostly with an agent gets more conventions: 163 instead of 90 on Yggdrasil.

Full Changelog: v6.0.0...v6.1.0

v6.0.0

Choose a tag to compare

@github-actions github-actions released this 12 Sep 07:55
67f22f7

Added

  • grain propose writes graphs in the 6.0.0 format; loading one needs Yggdrasil 6.0.0 or newer.

Changed

  • Marketplace renamed to grain-marketplace: /plugin install grain@grain-marketplace. Also installable from the same repository via GitHub Copilot CLI, Codex CLI and Cursor.
  • grain propose no longer writes charter.md beside a proposed component. What it opens with is now the component's own description; conventions and co-change partners are a live answer from grain explain, grain where and grain completeness instead.
  • A boundary decision recorded with grain decide boundary now also appears in what grain propose writes, as a forbidden dependency in the proposed graph.
  • grain advise's count of places a finer cut would help now separates places it could not read from places it could read but found too coarse.
  • Session start in a repository that already has an architecture graph now says so and points at yg prime, and names how to install yg when it isn't on PATH.
  • Session start now warns when the repository's index is sparse.
  • grain propose's report now names how many of its rules look ready to earn enforcement once Yggdrasil is installed, on a run with no Yggdrasil CLI to check them itself.

Fixed

  • The checks proving grain propose works with Yggdrasil and Horde now install Yggdrasil the way an adopter would, not a local build standing in for it.

0.4.0 — from clone to graph

Choose a tag to compare

@krzysztofdudek krzysztofdudek released this 08 Sep 12:23
51c9c5d

Experimental. The measured record behind every claim, negatives included, ships with the build.

Added

  • From a repository with no architecture graph to a proposed one, in a single command. It reads your code and your whole commit history and writes a complete draft: the kinds of part your repository is made of, the parts themselves, what depends on what, where those dependencies run in circles, and the rules your own code already keeps — each rule carrying the evidence that produced it and the count of places that break it today. It never touches a graph you already have. Yggdrasil accepts the draft with one command, and when Yggdrasil is on hand the preview of how much of your code the new rules would refuse runs before you decide anything.
  • For a repository that already has a graph: what its own history says about it. Where a finer split of one part beats the current one on that part's own evidence, and which parts change together with nothing in the graph connecting them.
  • Keeping the difference between the draft it wrote and the graph you actually accepted, and scoring itself against it in both directions. It records structure and paths, never the contents of your files, prints what it would store before storing anything, and writes nothing until you say so.
  • Dependencies between parts are now resolved for thirteen languages. The other supported languages keep the conventions answers only.

Changed

  • What the tool is for. Mining the first graph for a repository that has none is now the first thing it does. The questions it has always answered — where does this belong, does my change match how this repository does things — work exactly as before, and are now the second thing.

0.3.0 — released as a portfolio piece, results attached

Choose a tag to compare

@krzysztofdudek krzysztofdudek released this 02 Sep 12:44

Grain 0.3.0 is released as a portfolio piece. Development paused on 2026-09-02, and this release ships with the complete measured record, negatives first: docs/results.md.

The verdict

On every task where it was measured, an agent with grep, cat and its own judgement produced the same diff, in the same place, with the same number of tool calls as an agent with grain. Two paired trials on this build — 25 runs with grain across 6 task pairs on 5 repositories — produced zero diffs changed by a grain answer. The one demonstrated effect in the project's history (trial 3, 0.1.0) came from a placement note that spoke unbidden before the write, not from an answer to a question.

The engine is in the best state it has ever been, and there is no evidence that it helps anyone. Both are true at once.

What is in the build

  • 23 tree-sitter grammars, 26 commands, hooks for Claude Code / Codex / Cursor / Copilot, an MCP server, grain export.
  • One objective (two-part MDL) and one loss constant (λ = 8); no name lists, no tuned thresholds beyond that constant.
  • Seven honesty instruments in CI over a SHA-pinned 25-repository corpus: claim auditor, declaration recall, surface cross-check, disclosure fixtures, ranking harness with automatic ground truth, scale ladder, command reachability.
  • New since the previous 0.3.0 commit: grain obligation <path> (precision 0.958, coverage 0.048, disclosed), completeness rewritten, where on named queries +0.184 hit@3, three high-severity fabrication classes fixed (Python dotted heritage, Kotlin by-delegation, Rust 'static), chunked history serialisation that no longer dies silently on 80k-commit repositories, structured disclosures[] on JSON surfaces.
  • 2181 tests, CI on node 22 and 24.

What is not

  • No measured productivity benefit for coding agents on ordinary tasks. Hard tasks — where an agent without grain demonstrably fails — were never put through the paired harness; that is the open question.
  • where still loses to a plain path-match baseline on most repositories when the query does not name a symbol.
  • Every language was validated by instruments, not by a support claim; the per-grammar table is in docs/validation.md.

This build was developed under the working number 0.4.0. Internal research documents under .system/research/ keep that number; nothing in them was edited to match the release.

grain 0.1.0

Choose a tag to compare

@krzysztofdudek krzysztofdudek released this 26 Aug 08:18

First release. A repository-convention and architecture oracle for coding agents (Claude Code, Codex; Cursor and Copilot packaged, unverified): ask where before creating code, get check findings after an edit, placement advice before a file is written — every answer a percentage with a denominator and a path you can open, mined locally from syntax trees and full git history. No model calls, no network, no gate.

Built on a single principle: a claim exists iff stating it compresses the repository (two-part MDL); one loss constant (λ=8) decides when to speak; gitignore decides what is code; partitions are cut from the directory tree by compression — on express that cut rediscovers examples/ · lib/ · test/ unaided.

Evidence travels in the README: two independent truth audits (28/39 exact, 1 false class — fixed same-day), three A/B agent trials on a private post-cutoff repository (the third recording the first demonstrated effect of a grain note on an agent's diff), and performance numbers (queries 0.12 s warm; cold full-history build 18 s on a 1,100-file repo). 916 tests, CI on node 22/24.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LazAUBEuAFUFh65zzGD7Ff