~ knotless Search/
↑↓ move↵ open⇧↵ all results
0
0

The lexicons say what the host answers, and an ejection is kept

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/group-host:lexicons/match-code

What changes

NotPlc goes where it cannot happen. A group here is always a did:plc, made here or imported (import refuses anything else with NotPlc), so checkGroupHandle, updateGroupHandle, addRecoveryKey and removeRecoveryKey no longer list it. listRecoveryKeys names NotController instead, which it answers for a group whose DID is ended. The handle methods' remaining errors are the ones group_handle.rs raises. Fixes at://did:plc:bcgltzqazw5tb6k2g3ttenbj/space/dev.knotless.space/group-host/did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.issue/3mzjdf3ubdcv3

migrateExport lists what it answers. leaving goes, as there is no export for a plain PDS. Its errors are now InvalidToken and BlobNotFound in place of Forbidden and NotFound, which it never answered. Fixes at://did:plc:bcgltzqazw5tb6k2g3ttenbj/space/dev.knotless.space/group-host/did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.issue/3mzjde7ndjzgq

migratePrepare's snapshot has the right shape. Its description now reads {handle, address, spaces: [uri]}, each space a URI string, as spaces_of writes it and receive reads it. Fixes at://did:plc:bcgltzqazw5tb6k2g3ttenbj/space/dev.knotless.space/group-host/did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.issue/3mzjdeayzukiz

actorView holds what the host answers. That is a DID, the handle from the DID document, and canCreateGroup on one's own view. The profile fields nothing filled (displayName, description, avatar with its /img/actor route, pronouns, links, bot) and actorLink go. They can come back as new optional fields once a profile is read. Fixes at://did:plc:bcgltzqazw5tb6k2g3ttenbj/space/dev.knotless.space/group-host/did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.issue/3mzjdf6w3f5zo

createGroup lists the errors it answers. It now names InvalidHandle (not one label under the handle domain) and AccountCreationFailed (the directory did not take the DID). Fixes at://did:plc:bcgltzqazw5tb6k2g3ttenbj/space/dev.knotless.space/group-host/did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.issue/3mzjdfabobx3x

Invites and roles are described as they work.

  • createInvite loses NoInvitesSpace, which nothing raises.
  • requestJoin loses invite, which the handler never read. Its description says that a waiting invite admits the caller, redeemed from the host's own list.
  • role.default says it is also what admitMember gives when no roles are named, with member when no role is marked default.
  • invite and createInvite call the space the inbox, as does docs/reference/api.md.
  • ejectMember's reason is now kept (below), and it lists LastConfigurer, which it answers.

Fixes at://did:plc:bcgltzqazw5tb6k2g3ttenbj/space/dev.knotless.space/group-host/did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.issue/3mzjde5vf4oeh

negateLabel answers its record. It returns the negation's uri and cid, as applyLabel does and as its lexicon requires, where before it answered {}. The negation is a record someone may want to cite. Fixes at://did:plc:bcgltzqazw5tb6k2g3ttenbj/space/dev.knotless.space/group-host/did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.issue/3mzjdeiu4jvwu

An ejection is kept in the group's queue. Once ejectMember has put someone out, it notes an eject event on the member's DID with who did it and the reason, if one was given. getSubjectHistory shows it, as eventView.kind always said. A reason longer than the lexicon's 300 graphemes or 3000 bytes is refused. Like a label, an ejection opens a subject nobody reported. Leaving keeps nothing there. The moderation and membership pages say so. Fixes at://did:plc:bcgltzqazw5tb6k2g3ttenbj/space/dev.knotless.space/group-host/did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.issue/3mzjdelnfwy3g

The migration module's doc says only the opensocial command walks through a move, since the console has no page for it. Fixes at://did:plc:bcgltzqazw5tb6k2g3ttenbj/space/dev.knotless.space/group-host/did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.issue/3mzjdecer6zlc

listSpaceRecords loses rev and actors, which it never answered. Fixes at://did:plc:bcgltzqazw5tb6k2g3ttenbj/space/dev.knotless.space/group-host/did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.issue/3mzjdga4n3ysd

Why

The lexicons are what clients and assistants (whose MCP tools are described from them) are written from. None is published yet, so they can still be made to say what the host does. Where the lexicon described the better contract (a negation's record, an ejection in the moderation history), the code changed to match it instead.

The removed fields are still named in the code under other meanings (displayName, bot, invite and so on). The lexicon check's growth rule counts them as referred to, so they are let go by name in its retracted set, each with why.

How it was checked

  • tests/moderation.rs (writes_a_label_beside_what_it_labels) now checks that negateLabel answers the negation's own uri and cid. It failed before the fix.
  • tests/members.rs (one_put_out_reads_no_more) now checks the eject event, its actor and its reason in the queue, and that an overlong reason is refused. It failed before the fix.
  • cargo test --workspace passes, including the interop and command tests on the reference PDS. So do cargo fmt --all, cargo clippy --workspace --all-targets -- -D warnings and node harness/lexicons.mjs.
  • The console's svelte-check and e2e are left to CI. Nothing in web/src reads the removed fields.

Shortcomings

  • listSpaceRecords still answers "cursor": null on its last page, where its lexicon has a string. It is not in this batch, so it is left as found.
  • If the lexicons/unused branch (which also removes leaving) lands first, the leaving entry in retracted matches nothing and can go.

🤖 Generated with Claude Code

Approved

This brings the lexicons in line with what the host answers. It makes negateLabel return the negation's uri and cid, and ejectMember note an eject event with the actor and reason. The diff matches the description, and the tests cover both behaviour changes. I read every file in the diff but did not run the tests or the lexicon check. I found nothing that blocks a merge. There are two small points on ejectMember, inline below.

crates/group-host/src/group_members.rslines 484 to 485Outdated

These lines can no longer be read.

review.knotless.dev

chars().count() counts code points, not graphemes. A reason of 300 or fewer graphemes but more than 300 code points (emoji with joiners, combining marks) is refused although the lexicon allows it. It errs on the strict side. Say so in the comment, or count graphemes if the crate already has a way to.

crates/group-host/src/group_members.rslines 508 to 509Outdated

These lines can no longer be read.

review.knotless.dev

put_out has already run when moderate fails. In that case the caller gets a 500 although the member is out, and retrying answers NotAMember. This is unlikely, but you could log the failure and still answer 200, since the ejection itself succeeded.

Approved

The only change since my last review is the follow-up commit. It updates the e2e moderation flow to expect the ejected member already in the queue, and changes the empty-state text to "Reports, labels and ejections show here." The selectors the test uses (.subject, .status, .events) exist in ModerationQueue.svelte, so the assertions should hold. This is the console break the PR body said was left to CI. I didn't run the e2e. My two earlier inline notes on ejectMember (code points versus graphemes in the length check, and the 500 if moderate fails after put_out) are minor, still open and don't block the merge.

Approved

The only changes since my last review are two merges: main into this branch, and lexicons/unused into it. The second drops defs#file and defs#actorLink and the leaving entry in retracted. That last one is what the pull body's shortcomings said would happen. I read the harness/lexicons.mjs and defs.json diffs. The retracted set and the mayGo rule are coherent and match what the body describes. I didn't run the tests or the lexicon check.

My two earlier notes on ejectMember are still open and minor. One is that the length check counts code points, not graphemes. The other is that a moderate failure after put_out answers 500 although the member is out. Neither blocks the merge.

Approved

The only change since my last review is a merge of main into the branch. The merge conflicted in lexicons/fyi/opensocial/defs.json, and I found no conflict markers left. actorLink now appears only in the retracted set in harness/lexicons.mjs, as intended. Every check at this head passed: web, test, lexicons, e2e, docs and the Rust lint. I didn't run anything myself. My two earlier notes on ejectMember are still open and minor: the length check counts code points, not graphemes, and a moderate failure after put_out answers 500 although the member is out. Neither blocks the merge.

Merged as 4b77a9e