chadtmiller.com/group-host
atmosphere group host
Commands are grouped, and each MCP tool is its command's twin
MergedThis pull groups the opensocial commands into ten groups. It makes each MCP tool the twin of its command, built from one TOOLS list with one plan per call. It also renames the host's assistant code and tables to mcp, with a migration, and updates AGENTS.md and the docs. The design looks sound and the docs are updated with it. The check, lexicons, docs, web and e2e runs pass. The test run fails at head 246f877, so the coverage gate has not passed. I read the failure and the migration it hits, not the whole 5k-line diff.
test fails because of the new migration. crates/group-host/tests/moderation.rs:737, keeps_what_was_resolved_escalated_and_noted_as_a_status_set, panics with no such table: assistant_client.
- The test drops the
mod_eventcolumns, then setsuser_versiontoMIGRATIONS.len() - 1so that the last migration runs again. - That used to be the
mod_eventmigration. - This pull appends the
assistant_*tomcp_*rename after it, so the last migration is now the rename. Re-running it on a database that already hasmcp_clientfails. - Fix the test so it re-runs the
mod_eventmigration. Uselen() - 2, or better, find that migration by its content so the next appended migration doesn't break it again. - The coverage gate can't be judged until this passes.
Behaviour change to confirm: profile set drops a field it isn't given, including the picture. You say so under Shortcomings, but a person running opensocial profile set --display-name X will lose the avatar silently. Consider reading the current record and merging, or at least warning in the command's output.
The migration-test failure from round 1 looks fixed, but the pull now conflicts with main, so no check has run on the new head.
- Test fix (done).
moderation.rsnow finds themod_eventmigration by its content. It renames the later tables back to their old names and resetsuser_versionto that migration's position. The newIF EXISTS/IF NOT EXISTSon the index statements makes the rename migration safe to re-run.identity.rsnow drops renamed tables as well. I read these two diffs and the head's conflict list, not the whole 5k-line change. - Conflict with
main(blocking). The head conflicts at 1c5a313 indocs/design/assistants.md,docs/reference/mcp.md,harness/e2e/flows.spec.mjs,harness/lexicons.mjs,web/src/lib/organisms/ConnectedApps.svelte,web/src/routes/g/[handle]/+page.server.tsandweb/src/routes/g/[handle]/+page.svelte.- Every workflow (check, test, lexicons, docs, web, e2e) failed at 0daabdc with this conflict error and ran nothing.
- Whether the migration fix makes
testpass is therefore still unverified. mainhas changed the same MCP and console files this pull renames. Please rebase or mergemain, and resolvemcp.md,lexicons.mjsand the console files carefully so nothingmainadded is dropped.
- Still open from round 1:
profile setdrops the avatar. You list it under Shortcomings and did not change it.opensocial profile set --display-name Xstill silently erases the picture and any field not given. I'd still prefer reading the current record and merging, or printing a warning. I'm not blocking on this.
Once rebased and green, this should be ready.
The merge with main is done and the checks now run. check, lexicons, docs, web and e2e pass at 30dc1b9. The test run fails at the coverage gate.
- Migration-test fix (done). The round 1
mod_eventmigration failure is gone. The run reaches the coverage report. - Conflict with
main(done). The head mergesmaincleanly and the workflows ran. - Coverage gate (blocking).
.knotless/workflows/test.ymlrunscargo llvm-cov --fail-under-lines 100 --fail-under-functions 100. The report ends with 2 functions and 2 lines missed.group-host/src/mcp.rsandopensocial/src/lib.rseach have 1 function and 1 line uncovered (totals: 99.92% functions, 99.99% lines). Both files are new or rewritten by this pull. Run--show-missing-lineslocally to find them, then cover them with a test or remove dead code. The tail of the log I could read doesn't name the lines. - Still open from earlier rounds:
profile setdrops the avatar. It is unchanged and listed under Shortcomings. I'm not blocking on it.
I did not re-read the whole diff this round. I only checked the run results and the gate.
Every workflow now passes at 47a5e28: check, test, lexicons, docs, web and e2e. That includes the coverage gate I blocked on last round. The last commit, "No closure only a failure runs, in carrying out a plan", removed the two uncovered functions and lines.
Earlier asks:
- Migration-test fix (done). It was done in round 2.
- Conflict with
main(done). It was done in round 3. - Coverage gate (done).
testis green. profile setdrops the avatar and any field not given. This is unchanged. The pull lists it under Shortcomings and I never blocked on it. I'd still like a read-and-merge or a warning as a follow-up.
I did not re-read the whole diff this round. I only checked the run results.
What changes
Commands are grouped. Every command of
opensocialisopensocial <group> <action> <group> …, in ten singular groups:group(create, show, seed, move),profile(set),rule(set, delete),role(set, delete, grant),member(list, assign, eject),join(list, deny),invite(send, list),space(create, records),mod(list, history, resolve, label) andaccount(import). An opposite is--undoon the action (invite send --undo,role grant --undo,mod label --undo).opensocial --helplists them by group. No old names are kept: nobody uses the host yet.group-host move-hoststands alone as it was: it is the host's one command.Each MCP tool is its command's twin. There are 20 tools, each
<group>_<action>, taking what the command takes but the group, its flags in snake case (--display-name,display_name). Both come from one list,TOOLSincrates/group-host-mcp/src/lib.rs: the tool's schema is made from the lexicon of what it asks or writes, the command reads its words by that schema, andplansays what a call comes to (a method asked, a record of the group's written, an invite written or taken back, a role's grant set or dropped), which the host carries out for an MCP client and the command for a person. The old tools are renamed, split or joined to match:getGroupisgroup_show,putProfileisprofile_set,putRule/deleteRulearerule_set/rule_delete,putRole/deleteRolearerole_set/role_delete,putPermissions(the whole record) isrole_grant(one role's grant),putMembership/deleteMembershiparemember_assign/member_eject,sendInvite/takeBackInviteareinvite_sendand itsundo,applyLabel/negateLabelaremod_labeland itsundo,listMembersismember_list, and the rest take their command's name. A moderation subject is given as text, a DID or anat://URI with acid, rather than the union. What either side lacked is added: every tool's command (profile set,rule,role,join,invite list,space,mod), androle_grant. Onlygroup create,group seed,group moveandaccount importhave no tool: an MCP client acts in the one group it was connected to, and these make or move a group or an account.The MCP side says MCP. The host's
assistants.rsismcp.rs, its teststests/mcp.rs, its functions and types MCP-named (McpRequest,McpGrant,register_mcp_client, …), and its tablesmcp_client,mcp_requestandmcp_grant, renamed by a migration (the two tests that roll migrations back now undo a later rename too). getAuthorization'sassistantismcp, retracted inharness/lexicons.mjswith why (the console here was its only reader). The design page isdocs/design/mcp.md. The console's copy says "AI app": "Your AI apps", "No AI apps connected", "An AI app calling itself …".AGENTS.md says how to add one, in "Commands and tools".
docs/reference/cli.mdanddocs/reference/mcp.mdare laid out by group;mcp.md's tables name each tool's command and lexicon, and the docs site shows that lexicon under the tool (a record's fields too), as a tool's name is no longer its method's.Why
The tools had grown as methods by their NSIDs beside record writes named for what they did, and matched the command in nothing; the command had seven words of its own. Grouping by what a command acts on gives a new one an obvious home, and making the tool and the command from one entry, carried out from one plan, keeps them from drifting.
The HTTP side of MCP stays in the host as
mcp.rsrather than moving togroup-host-mcp/src/http.rs: each of its steps is the host's (its store for clients, requests and grants; the console's approval page throughgetAuthorization; the router it asks itself through; the writes it makes as the group), so moving it would mean a trait over most ofHostwith one implementer. What is the MCP crate's (the protocol, the tools, the plans) is there.How it was checked
Here:
cargo fmt, clippy with warnings denied, the tests ofgroup-host-mcp(the tool list, each schema, each plan,regrant),group-host --test mcp(each kind of plan carried out as the member, and refused as the host refuses), andopensocial's (the words read by each schema, every command in the usage, and the commands against the reference PDS: invites sent, listed and taken back, members assigned and ejected, join requests listed and denied, rules, roles, grants and the profile written, labels applied and taken back, history, resolving).node harness/lexicons.mjs,node harness/docs.mjs,node harness/layers.mjs, and the docs site's build. Left to CI: the coverage gate, svelte-check and the console's build, and e2e.Shortcomings
role grantreplaces a role's whole grant; to add one scope, give them all. A write replaces its record whole, soprofile setdrops a field not given, a picture with it. Anyone's prompts naming the old tools break at once.🤖 Generated with Claude Code