Problem
AOCI-CODE currently recognises four hosts: Claude Code, Codex, Cursor and
OpenCode V1. WorkBuddy is not among them, so for that host:
aoci init --agent workbuddy fails closed with hook.bad_agent;
aoci doctor reports no WorkBuddy row at all, so an operator who did wire
the server by hand cannot see that state from the tool;
- the managed
AGENTS.md block is appended at the end of the file. WorkBuddy
injects only the first few thousand characters of AGENTS.md into model
context, so a trailing block is never read — the one written instruction
that tells a model to load aoci_rules and aoci_overview before starting
work is structurally unreachable on that host.
An operator can work around all three by hand, but the result is invisible to
doctor and unverified by any gate.
Why WorkBuddy is structurally different
WorkBuddy has no project-scoped MCP configuration surface. Its only entry is
the machine-level ~/.workbuddy/mcp.json, read and written by UserMcpProvider.
There is no project-level variant to write, and ./.mcp.json is only consulted
when a plugin declares it.
That collides with a fixed assumption in every existing installer: the server is
bound to one --repo, while this one file is shared by every project on the
machine. Copying the Claude implementation would make init for repository B
silently repoint repository A's server.
Proposed behaviour
- Merge into the machine-level file, never overwrite a foreign entry.
init --agent workbuddy writes mcpServers.aoci when that key is free or
already bound to the current repository. When an aoci key points at a
different repository, that entry is left byte-for-byte intact and the new one
is written as aoci-<project>; if both keys are taken by other repositories,
the command reports the conflict and changes nothing.
- Write nothing into the repository. No Baseline path, no
.gitignore
line, no host file for git status to report. --hooks is inert, stated
plainly rather than emulated.
- Prepend the managed
AGENTS.md block for this host only, because a
trailing block is unreadable there. Every other host keeps the existing
append behaviour; a file that already carries the block still gets an
in-place replacement that never moves it.
- Make it visible:
doctor gains a WorkBuddy MCP (~/.workbuddy/mcp.json)
row, the UI panel gains a matching integration key, and
hooks.Detect probes the user-level file (a project-root probe would always
miss).
Boundary
- The nine MCP tool names, their schemas and the binary name are unchanged.
spec/public/ is not touched: it describes host capability contracts and does
not enumerate hosts. The user-visible strings live in the Locale assets, and
both locales gain the same keys.
--agent all keeps its existing claude/codex/cursor set. It means "install
project-level host configuration", and this host writes a file outside every
repository; silently widening that set would change what all does.
internal/machinecontract is untouched.
Evidence
- Control experiment on the changed packages: identical pass/fail sets before
and after the change, compared by test name (comparing whole lines is
useless because every line carries a duration).
- Ten new tests cover: idempotence, foreign-entry preservation, scoped-key
conflict, broken-JSON refusal, existing-config preservation, the
"another repository is not installed here" predicate, Detect, dispatch
through Install, key sanitisation, and both block placements.
- End-to-end against a throwaway repository with an isolated
HOME: the entry
lands in the user file, the working tree stays clean, a second repository gets
aoci-<project> without disturbing the first, doctor reports the row, and
the managed block lands on line 1 with existing content intact and a second
run changing nothing.
Open question for maintainers
The PR template asks whether a contribution that changes managed objects also
ships its cognition governance in the same commit. For this repository that
loop is driven through the MCP tools, which are bound to whichever repository
the host started them for — so a contributor working in two checkouts cannot
complete the loop for the second one without restarting the host. This
repository's own aoci check is not clean to begin with, so I would rather ask
than guess: should such a change ship with the governance entry, or is tracking
it as a follow-up acceptable?
Problem
AOCI-CODE currently recognises four hosts: Claude Code, Codex, Cursor and
OpenCode V1. WorkBuddy is not among them, so for that host:
aoci init --agent workbuddyfails closed withhook.bad_agent;aoci doctorreports no WorkBuddy row at all, so an operator who did wirethe server by hand cannot see that state from the tool;
AGENTS.mdblock is appended at the end of the file. WorkBuddyinjects only the first few thousand characters of
AGENTS.mdinto modelcontext, so a trailing block is never read — the one written instruction
that tells a model to load
aoci_rulesandaoci_overviewbefore startingwork is structurally unreachable on that host.
An operator can work around all three by hand, but the result is invisible to
doctorand unverified by any gate.Why WorkBuddy is structurally different
WorkBuddy has no project-scoped MCP configuration surface. Its only entry is
the machine-level
~/.workbuddy/mcp.json, read and written byUserMcpProvider.There is no project-level variant to write, and
./.mcp.jsonis only consultedwhen a plugin declares it.
That collides with a fixed assumption in every existing installer: the server is
bound to one
--repo, while this one file is shared by every project on themachine. Copying the Claude implementation would make
initfor repository Bsilently repoint repository A's server.
Proposed behaviour
init --agent workbuddywritesmcpServers.aociwhen that key is free oralready bound to the current repository. When an
aocikey points at adifferent repository, that entry is left byte-for-byte intact and the new one
is written as
aoci-<project>; if both keys are taken by other repositories,the command reports the conflict and changes nothing.
.gitignoreline, no host file for
git statusto report.--hooksis inert, statedplainly rather than emulated.
AGENTS.mdblock for this host only, because atrailing block is unreadable there. Every other host keeps the existing
append behaviour; a file that already carries the block still gets an
in-place replacement that never moves it.
doctorgains aWorkBuddy MCP (~/.workbuddy/mcp.json)row, the UI panel gains a matching integration key, and
hooks.Detectprobes the user-level file (a project-root probe would alwaysmiss).
Boundary
spec/public/is not touched: it describes host capability contracts and doesnot enumerate hosts. The user-visible strings live in the Locale assets, and
both locales gain the same keys.
--agent allkeeps its existing claude/codex/cursor set. It means "installproject-level host configuration", and this host writes a file outside every
repository; silently widening that set would change what
alldoes.internal/machinecontractis untouched.Evidence
and after the change, compared by test name (comparing whole lines is
useless because every line carries a duration).
conflict, broken-JSON refusal, existing-config preservation, the
"another repository is not installed here" predicate,
Detect, dispatchthrough
Install, key sanitisation, and both block placements.HOME: the entrylands in the user file, the working tree stays clean, a second repository gets
aoci-<project>without disturbing the first,doctorreports the row, andthe managed block lands on line 1 with existing content intact and a second
run changing nothing.
Open question for maintainers
The PR template asks whether a contribution that changes managed objects also
ships its cognition governance in the same commit. For this repository that
loop is driven through the MCP tools, which are bound to whichever repository
the host started them for — so a contributor working in two checkouts cannot
complete the loop for the second one without restarting the host. This
repository's own
aoci checkis not clean to begin with, so I would rather askthan guess: should such a change ship with the governance entry, or is tracking
it as a follow-up acceptable?