Repository navigation
Breaking
style.dbis now format 2. The first writable open converts format 1
replacement records: a replaced preference or habit becomesrejected, and a
habit created by renewal goes back tocandidatefor a new review. Each
change gets a review event. Mastermind 4.0.x refuses a format 2 store.- The automatic profile refresh after a task, the task-boundary drain and
every command that writes the profile convert a format 1 store. A read-only
command, such ashabit showor a profile read, does not convert it. While
the store still holds replacement records, it fails and says that the next
automatic refresh or any writing command converts them. - Task records refuse a repeated JSON key or a floating-point number:
state.json, verification, invocation and review invocation receipts,
preflight approvals,review-task submitreports and the guarded execution
decision log. Records written by 4.0.x still read. - Digests, receipt IDs, invocation IDs and review pins in those records must be
lowercase hex. miner feedback supersede,miner habit supersedeandminer habit renew
are gone. To replace a claim, reject it and review a new one.- The
mmcg_scratchpad_appendandmmcg_scratchpad_readMCP tools are gone.
An existing index keeps the old table, and nothing reads it.
Added
-
--skip-freshness-checkforquery,map,repo-mapandimpactleaves
out the walk of the source tree that checks if the index is current, and
printsfreshness check skippedon stderr. The flag only saves the time of
that scan, which can take seconds per command on a large repository. The
gain is largest forqueryandrepo-map. Forquerythe flag goes before
the subcommand. Use it only when you index after every change and never on a
working tree. Forquery,mapandrepo-map, when the index is behind
the files the answer is old and has no warning.impactstill compares
changed and new files with the index and exits 1 withindex_stalewhen
they differ. The flag does not skip that. An index from an older extractor
still warns, and a missing or old-schema index still fails. -
A skill-selection corpus of 91 prompts in
evals/behavior/cases/selection.jsonl. Each prompt expects one skill or
subagent, or none, and rejects the near misses.just checkruns
python -m evals.selection, a check of the case list and the catalogue that
needs no model. It never decides which skill a prompt should get, so it does
not show that a model picks well. It fails on a label the prompt's words
contradict without a reviewed reason, a prompt that names its skill in any
spelling, gibberish, a conflict case whose cited clause does not pick its
winner in one direction, a known neighbour pair with no conflict case, a
core skill that hands off outside core, and a corpus where more than a third
of cases can be answered by rare-word matching. Cases fall into a fixed
train and held-out split of about 60/40. The newselectionbehaviour suite
sends the prompts to Claude against a catalogue of every skill and subagent,
can run each prompt three times, and reports accuracy per split. Details and
limits are inevals/selection/README.md. -
mastermind doctorhas apermission rulescheck. It reads the Claude Code
permission lists and modes, Codex.rulesfiles, Codexconfig.tomland
profile files, and what a repository ships for its clients:.mcp.json
servers,.claude/skills/*/SKILL.mdand.claude/agents/**/*.md. Each
finding has a severity. An error fails the check and makesdoctorexit 1:
aReadrule for a secret store such as~/.sshor.env, an MCP server
or hook that downloads and runs code, a repository skill whose
allowed-toolsgrants a broad shell rule,defaultMode: bypassPermissions,
and Codex never asking while it has no sandbox or has network access. A
warning covers any command, interpreters and shells, commands that run other
commands, package managers, task runners and installs,gitandgh
without a fixed subcommand,git push,gh apiand other publishing
subcommands, network fetches without a fixed host,WebFetchand
WebSearchfor any host,mcp__*, writes to.mastermind, reads of the
whole home directory,enableAllProjectMcpServers, a repository subagent
withpermissionMode: bypassPermissions, and Codex commands that inherit
KEY, SECRET and TOKEN variables. A rule that a deny, ask or stricter rule
covers is not reported. It never edits the files and never prints rule
text, commands or addresses. -
mastermind doctorhas aclient hookscheck. It reads the hooks in Claude
Code managed, user, project and local settings and in enabled plugins, and
in Codex system, user and projecthooks.jsonand inline[hooks]. It
counts the ones Mastermind installed and reports the rest. A hook counts as
Mastermind's only when the program is the real mastermind launcher and the
command names this project, so a copied marker does not hide a hook. A hook
that downloads and runs code fails the check, and shell text, inline code,
unpinned package runners, network tools and unknown programs warn. A
malformed hook group is reported and the valid groups beside it are still
read. Hooks turned off withdisableAllHooksare still listed as warnings.
The hook readiness checks now say how many other hooks exist instead of only
"not configured". -
One bad hook in
~/.claude/settings.jsonor~/.codex/hooks.jsonnow fails
doctorin every project, because a user hook runs in every project. The
same holds for user MCP servers in~/.claude.json. -
The
permission rulescheck also reads managed settings and
managed-mcp.json,~/.claude.jsonservers and approvals, nested
.claude/skills, credential and header helpers, the status line and file
suggestion commands,envvariables that load code or redirect model
traffic, plugin marketplaces, third-party plugins, and Codexnotifyand
provider token commands. Approving a flagged.mcp.jsonserver is an error,
and so is an allow rule that lets the agent edit.codex. It still does not
read server-managed settings, files passed with--settings,--mcp-config
or--agents, user-level skills and subagents, plugin skills and subagents,
mods, or Codex skills. The reference lists them. -
The command check that
permission rulesandclient hooksshare is now
structural. Any command piped into a shell or an interpreter that reads
standard input is an error whatever produces it, sohttp,ssh,ncor
catof a temp file count as much ascurl. So are a substitution or
here-string run as program text, a file written by a redirect,tee,-o,
scporrsyncthat a later command runs, a build
aftergit clone, awksystem(),find -exec sh,xargsinto a shell,
and inline code that decodes and evaluates. The finding now reads "runs
downloaded or generated code".go run module@latestjoins the unpinned
runner warning. Formatters and linters that read repository config, such as
prettierandeslint, get a new info note that keeps the check ok, and a
repository-relative./node_modules/.bintool is no longer a known tool. -
A hook or MCP server counts as Mastermind's own only when its plain absolute
path resolves to the install doctor runs from, or to that install's
bin/mastermind.jsrun by a realnode. A baremastermind,
./node_modules/.bin/mastermind,npx, a copy in a temp directory or
/bin/sh x/mastermind.jsis checked like any other command. Global npm
setup now writes the node and launcher npm ran. -
EditandWriterules are matched as globs against the files that set
what an agent trusts. A rule aimed at.codex,AGENTS.mdor
.agents/skills, such asEdit(.cod*/**)orEdit(.*/**), is an error.
A bare or broad rule such asEdit,Write(*)orEdit(~/**)warns that
it can edit them.Edit(.claude/worktrees/**)is not reported. -
permission rulesalso readsgcpAuthRefresh, treats
CLAUDE_CODE_SHELL_PREFIXas an error and checks its value, reads
commands, servers and environment policy in Codex profile files, reads the
MCP servers of enabled plugins, and reads Codex approval modes on every
server, local or remote, per tool, for apps andapps._default, and for
plugin servers, plusdestructive_enabled. A file'sN flaggednow counts
servers, not findings.client hooksreads hooks files a plugin manifest
names and reports each wrong-typed hook entry on its own. -
The command check drops shell comments, so
curl … | sh # xis an error
again, and reads/dev/fd/0and/proc/self/fd/0as standard input. A
variable used as the shell ($SHELL <(curl …),| $0), an archive
extracted from a pipe and then run (| tar xz && ./install), input piped
intoat,crontab -,docker run -i … shorscript -qc sh, and a write
to a shell startup file such as~/.zshrcor~/.bashrcare errors.
cat ./scripts/check.sh | bashwarns likebash ./scripts/check.sh.
npx --nois no longer called unpinned. A program in a temporary directory
and a launcher whose path an upgrade removed each get their own message. -
Only the node doctor runs with, or the node of the npm prefix it is
installed under, can start Mastermind's launcher script. A file that is
merely callednodeis checked like any other program. -
Edit rules are matched as whole globs with
[]classes and{a,b}lists,
soEdit(**/*.ts)andEdit(**/test/**)are no longer errors, while
Edit(.[c]odex/**)andEdit({.codex,src}/**)are. Syntax doctor does not
read is treated as broad. The bareEditwarning now says it can edit
.codexand other trust files without a prompt in default mode. -
permission rulesreads the monitors and LSP servers of enabled plugins,
and warns on Codexopen_world_enabled = trueand
approvals_reviewer = "auto_review". -
Only
$SHELL,$BASH,$0, a default that names a shell, a variable
given a shell in the same command and a lookup such as$(which sh)count
as a shell in a pipe.| $PAGER,| ${PAGER:-less},| $EDITOR -and
| "$VAR"warn again instead of failing. -
Standard input paths are normalised, so
/dev//stdin,/dev/fd/00and
/proc/<any>/fd/0count, and a newline after|# cstill joins the pipe. -
A
node.exebeside the npm prefix is trusted only on Windows and only for a
global prefix, never beside a project'snode_modules. The system nodes in
/usr/bin,/usr/local/bin,/opt/homebrew/binand
C:\Program Files\nodejsare trusted after their links are resolved, so a
real registration with a system node stays ok. The launcher script must sit
in an@xcraftmind/mastermind/bininstall. -
A
MASTERMIND_*variable in Claude Codeenvor Codex
shell_environment_policy.setis an error. -
Writes to
.git/hooks,.husky,~/Library/LaunchAgents,
~/.config/systemd/userand~/.config/autostart, a crontab written and
then installed, and a pipe into a shell overssh,chroot,nsenter,
unshareorlxc execare errors. A.envrcand an extract into
~/.local/binwarn. -
An escaped glob character in an edit rule is literal, so
Edit(src/\[id\].tsx)andEdit(docs/\*.md)are not reported. -
scripts/validate.pynow runs a line-by-line copy of doctor's command check
inscripts/command_check.py. It loads doctor's word tables from
command_rules.json, which a Rust test keeps equal to the Rust constants,
and both copies must give the verdicts infetch_exec_corpus.json, a corpus
of every counter-example so far. -
Static detection cannot be complete: a command can build what it runs in
ways no reader of its text can follow. A passing check is not proof that
nothing runs without asking. Known gaps, such as a variable set outside the
command or| ssh hostwith no remote command, are listed in the reference.
A per-rolePreToolUseguard hook that checks each command when it runs is
the follow-up, in its own pull request. -
A package installed from a registry without an exact version, followed by
any command, warns that it runs a package without an exact version, the
same asnpx -y, since its programs need not share its name:
npm i -D eslint && npx eslint .,pip install pytest && pytest,
cargo install evil-crate && evil. A pipe into a shell, a file written and
then run, and decoded code run after the install are still errors. With an
exact version, as innpm i -g prettier@3.3.3 && prettier --check ., it
warns as shell text. A repository Go build such asgo build -o bin/tool ./cmd/tool && ./bin/toolor
go install ./cmd/toolwarns likecargo buildandmake. -
/proc/self/fd/../fd/0reads as standard input, and$(whence sh),
$ZSH_NAMEand$ZSH_ARGZEROcount as a shell in a pipe. -
A hook copied or linked from the checkout into
.git/hookswarns.
Downloaded content written into a hook or into.claude/settings*.json,
.mcp.json,~/.claude.jsonor.codex/config.tomlis an error, and so is
any write to$GIT_DIR/hooks,/Library/LaunchDaemons,/etc/cron.d, a
crontab spool or~/.local/share/systemd/user..vscode/tasks.json,
~/.ssh/rc,.git/configandcore.hooksPathare listed as known gaps. -
scripts/validate.pyalso runs doctor's persistence check, and fails a
frontmatter hook that writes a shell startup file or a file that runs later
on its own. The lookups, shell variables, remote shells, temporary folders,
package managers, startup files and persistence paths now live in
command_rules.json, and the corpus has a persistence section. The copy is
kept by hand, so only corpus commands are sure to agree. -
Every shipped subagent declares its capability class in its workflow
metadata:mutabilitypluscapabilities, whereshellandwebeach need
a reason.just validatefails when a role'stoolsdo not match:Edit,
Write,NotebookEditorMultiEditin a read-only role,Bashor
PowerShellwithoutshell,WebFetchorWebSearchwithoutweb, or a
declared capability no tool needs.AgentandTaskneeddelegate, tools
of MCP servers other than mmcg needmcp, andBashOutput,KillShell,
Monitor,REPLandTaskStopcount as shell.Workflow,
SendMessage,CronCreateandRemoteTriggerneeddelegate,Skill
needsskills, and a subagent with frontmatterhooksmust declare
hooks, and each hook command is checked for fetched, written or decoded
code, read the way doctor reads it, socurl -so a URL && sh aand
| sudo bashfail.mcp_toolhooks are valid, and one on a server other
than mmcg needsmcp. Tools that publish, send or change the session, such
asArtifact,PushNotification,SendUserFileandEnterWorktree, need
the newoutboundorsessioncapability, which a read-only role can never
hold. The MCP resource tools needmcpandScheduleWakeupneeds
delegate. A read-only role may only hold known read tools, so a new tool
fails until it is classified. A read-only role cannot ask forbypassPermissionsor
acceptEdits, a fixed deny list keeps the shell from the researcher and
four other roles, and the comment and frontend auditors no longer get
Bash. Six subagents that run commands declareshellwith a reason. -
One untrusted-content paragraph in
agents/blocks/untrusted-content.md.
Ten subagents and 28 skills that read repository, pull request, report,
transcript or tool content carry it verbatim. It names the person or the
agent that started the role as the only source of instructions, and keeps
the approved spec and declared checks part of the request.just validate
fails when a covered file lacks it, has it twice, has a changed copy or
holds it inside a code fence, an HTML comment or another paragraph. -
Five skills that are safe to point at an untrusted pull request:
mastermind-diff-review,mastermind-docs-authoringand
mastermind-verify-changein every profile, and
mastermind-dependency-upgradeandmastermind-scanner-alert-responsein
thesecurityandfullprofiles. They read repository instructions from
the base branch, treat everything in the change as data, never run the
change's scripts with credentials, and never fetch a secret's value. The
coreprofile now installs 23 skills.
Changed
-
Every subagent description now opens with when to delegate, says
Not for ... (use X)within its first 200 characters and stays within 300.
Claude Code decides when to delegate from these descriptions, so the two
roles that run only on request, the feedback collector and the prompt
refiner, start withUse only when.just validatefails a subagent
description that breaks this, says "proactively", "MUST BE USED" or another
phrase that pushes delegation, or has aNot forboundary with no
(use X)that resolves. In skill and subagent descriptions every hand-off
must be a lowercase(use <full-name>)naming something shipped, and names
may not appear outside one. Each subagent has a new patch version. -
Skill descriptions now pick one winner for four prompts that two skills
both claimed.mastermind-test-impacthands running checks to
mastermind-verify-change,mastermind-architecture-reviewhands a plan
check before approval tomastermind-critical-review, and
mastermind-diff-reviewhands React and Vue code to
mastermind-frontend-audit.mastermind-agent-security-reviewalready
claims changes touching auth and secrets, andmastermind-diff-reviewis a
core skill, so it does not name it.mastermind-agent-handoff,
mastermind-component-researchandmastermind-product-intakeno longer
hand off to skills that the core profile does not install.
mastermind-design-intakenow claims a mockup that comes with a ticket. -
mastermind-dependency-upgradenow does what its description promised for
a new package. It checks the name against the registry and the project's
documentation, looks for lookalike names, notes package and version age and
maintainer changes, respects a release-age cooldown and stops for a person
when a check fails. Registry lookups run outside the checkout and name the
public registry, so a pull request's.npmrc,pip.confor
.cargo/config.tomlcannot answer them, and any change to registry settings
is reported. Three workflow eval cases cover a days-old lookalike, an
established package that should pass and a registry override in a pull
request. -
mastermind-diff-reviewhas a "Hidden text" section. It lists where
steering text hides: HTML comments, collapsed blocks, alt text, link titles,
reference links, inline HTML or CSS that hides text, very long lines,
minified or unrendered diffs, encoded strings, and invisible Unicode,
including zero-width and word-joiner characters, the byte-order mark, soft
hyphens, bidi controls, tag characters and variation selectors. It gives a
command that printsfile:linefor each added line with one of those
characters, with hooks, external diff tools and textconv off so nothing from
the head runs. The command flags quoted file names and cannot be fooled by
an added line that looks like a file header. Lookalike letters get a
separate manual check. The skill also checks that the code keeps the promise
in the title and description. Five workflow eval cases cover a bidi
override, tag and zero-width characters, a hidden HTML comment, a fix
applied to two of three templates and the safe search command. -
mastermind-agent-security-reviewand the security auditor check every
agent context for the three legs of data theft: private data, text from
others and a way to send data out. All three together is at least P1 even
with a prompt guard, and the fix must remove one leg with a control the
model cannot override. Two workflow eval cases cover a triage bot with all
three legs and a local tool with none of the outbound ones. -
mastermind-test-auditand the test auditor have a fifth check. For each
changed line that decides something, they name the most likely small slip,
such as<for<=or a dropped branch, and the assertion that would fail
on it. When none would, they report asurvivor, at most one per symbol and
called likely rather than proven. Survivors are advisory: they go in their
own section and anadvisorieslist in the structured tail, and do not
count towardsflaggedor the verdict. Two workflow eval cases cover a surviving boundary slip
and the clean case where both sides of the boundary are asserted. -
mastermind-investigation-ledgerstarts from a failing command and only
then writes hypotheses. Every run, the bisect and the red/green proof
included, goes through themastermind-verify-changetrust gate as written
there. A regression with a known good version is bisected over a range that
passed the gate, withgit -c core.hooksPath=/dev/nullon every git call,
and the skill warns thatgit bisect run npm testruns each old commit's own
scripts. An intermittent failure is measured as a rate, and a cause is
confirmed only when removing it turns the failing command green. It ends
with a fixed report. The investigator subagent gets the same gate and bisect
rules and stays within its 3,500-character prompt. Four workflow eval cases
cover the fork, bisect, hooks and one-green-run behaviour. -
Every skill description now opens with when to use the skill, then a
Not forclause that names the sibling to use instead, for example
mastermind-verify-changefor a red CI run and
mastermind-investigation-ledgerfor a cause that is still unknown, then a
short line on what it does. Hosts pick skills from these descriptions alone.
When Codex's skill list is over budget, Codex cuts every description to the
same length from the end, so both clauses now start within the first 200
characters. The 32 descriptions total 7,631 characters, down from 10,032,
and the 23 in the core profile total 5,471, down from 7,110.just validate
now fails a skill description that is longer than 300 characters, or has no
Use when,before,after,fororto, or noNot forclause, in its
first 200 characters. The skills README has a short guide to writing a skill. -
The covered skills and subagents use the shared untrusted-content paragraph
in place of their own shorter wording, and each has a new patch version.
The critic opens with its own short data-not-instructions rule instead. The
FIND precondition notes and the legacyVERIFYforms moved from the planner
to its spec template. -
An index written with a newer extractor or concept contract is refused by
every open, the same as a newer schema version, and is never rebuilt. -
A symlink or other non-regular source no longer makes the index stale for MCP
queries,statusanddoctor. It is still listed inunindexable_sources,
andindexandcistill exit 1 for it. Theindexerror now lists such
sources apart from retryable failures, which keep the index stale. -
When
indexskips more submodules than it lists, it prints the total. -
enrichtakes the index writer lock for fact and SCIP imports. -
Project history, workflow status and history review use one rule for task
folders, so a loose*.mdfile in.mastermind/tasksis never a task. -
mastermind updatechecks every selected client before it writes anything
and lists each edited, linked or unowned workflow entry with aNext:step.
--move-asidemoves them to<client root>/.mastermind-preserved/<time>/
and installs the bundled copies. -
Updating from 4.0.x: the first
mastermind updatestill runs the 4.0.x
updater, which has no--move-asideand stops at the first edited, linked or
unowned entry. Move those entries out of~/.claude/skills,~/.claude/agentsand
~/.codex/skills, then runmastermind updateagain.
Fixed
- The frontend audit checks props contracts with
mmcg_change_impact, which
includes uncommitted work.mmcg_symbols_changed_sinceonly compares
commits, so it missed a changed component before the commit step. - The runtime, component and security research skills pass
max_depthto
mmcg_impact; it has nodepthargument. - The comment auditor no longer counts
could_not_verifyas a finding, so an
unjudged comment cannot turn a clean result intofindings. - The comment, test and frontend audits have an
incompleteverdict. A review
that stopped early, for example with no baseline, no longer reads as
clean. - The test and frontend auditors no longer re-index the repository. A query
refreshes a stale managed index once; if it is still stale they report
could_not_verify. - The router says the feedback collector writes to the private review inbox
only when asked; it never edits the profile. - The auditor's report tail uses a repository-relative spec path, and the
report contract lists the auditor's full set of fields. - The planner links its spec template, defect labels, design review packet and
report schema references. miner profile --deephelp says it saves a separate candidate file for
review instead of replacing part of the profile.- A 4.0 task is no longer refused because an
executor-report.mdor
audit.mdsits beside its spec. Only a task started before 4.0 gets the
old-name refusal, and a spec namedaudit.mdnever counts as its own old
audit. review-taskwith a missing spec or a_draftfolder no longer leaves a
controller lock or run-state directory behind.- Closing the terminal stops a running verification check, and its receipt is
interrupted. - Terminal control characters from the executor report are escaped in its
parse errors. audit verifyand workflow status fail at once on a FIFO in place of a file,
instead of hanging.- An audit bundle
snapshot_changederror names its reason, such as
snapshot_changed: worktree_not_clean. run-tasksays why it stopped when the task state disappears or cannot be
read after a review.serveno longer fails withdatabase is lockedwhen it opens the index
right after an incrementalindex.watchwaits for another index writer with full refreshes that never use up
its three retries. It checks a removed path again under the writer lock and
parses under the lock, so it never commits content older than another
writer's.- Outside Git, a directory the walk may not read is skipped when the index
holds no source under it. Before, it failed the run. mmcg_contextandmastermind context previewreturn
context_index_unavailablefor an index that exists but does not open, for
example one a newer mmcg wrote. Before, they built the packet without it.mmcg_unreferencedhides only names that start with a literaltest_in
test files._was a wildcard, so names such astestingwere hidden too.serveprints a warning when it cannot remove its index snapshot on exit.
On Windows a snapshot that SQLite still holds open stays behind.- The hook journal no longer fills up with rows from ended sessions. Archiving
drops their event receipts and shrinks intake and task-mining rows to a
summary thathooks showstill reads. - A full hook journal records the
journal_fullgap,hooks statuslists the
steps to free space, andhooks forgetworks on a full journal. - One hook delivery spends at most 2.5 s in total waiting for the journal
lock, so a busy journal still leaves time to record the gap. hooks recover --project-root PATHworks after the project folder was
deleted or moved, anddoctorprints that command for each such project.doctorshows why hook readiness is unavailable, such as a journal from a
newer version..DS_Store,__pycache__and*.pycfiles in installed workflow folders no
longer count as edits.initandstatusprint the reason and theNext:steps when a workflow
update fails, anddoctor --workflowreports a linked or misplaced client
folder as a layout error with a recovery step.
Removed
- The
mmcg_scratchpad_appendandmmcg_scratchpad_readMCP tools. An
existing index keeps the old table, and nothing reads it. miner feedback supersede,miner habit supersedeandminer habit renew.
To replace a claim, reject it and review a new one.- The generation column in
habit list, and the relation and generation lines
inhabit showandfeedback show. docs/README.md,docs/architecture.md, the Claude Code and Codex
integration pages anddocs/reference/persona-context.md. Their content now
lives in the README, getting started, effort routing and the persona
reference. Eval narratives that only retold a retained JSON record are gone,
and the scorecard links the JSON directly.
Development
just bootstrapandjust sync-templatesno longer runjust checkand
just validateby accident: their closing hint quoted the command in
backticks, which the shell executed.- Every workflow installs Rust from
rust-toolchain.toml, and the validator
checks that the Docker Action builds with the same channel. just release-tagsdispatches the npm and crates.io publish dry runs and
waits for them and push CI. The publish verify job no longer repeats the
tests in release mode.- New
just release-checkandjust test-linux.just index,just outline
andjust recentare gone. - Dependencies: notify 9, cargo-deny-action 2.1.4 with
unmaintained = "all",
PyYAML 6.0.4 and a lockfile refresh.