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

Bound what a report says, and take up the other reviews' notes

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/group-host:review/notes

What changes

What the reviews of the last pulls asked for, each where it belongs:

  • A report is bounded (the moderation pull). Anyone may write to a group's queue, so:

    • a report's subject must be a record URI each of whose parts is valid (DIDs, NSIDs, record keys), which bounds its length;
    • its reason is 20,000 bytes at most, as createReport's lexicon has it;
    • its reason type is at most 256 bytes.

    LabelForm's comment no longer mentions a rule field it doesn't have.

  • The console's action list is held to the lexicon (the settings pull). web/src/lib/actions.ts is typed against fyi.opensocial.defs#action both ways, so a value the lexicon doesn't know, or one it knows and the list leaves out, fails svelte-check. The lexicon's generated code carries those values only as a type.

  • The settings flows stand alone: "defining a role" and "making an app password" each open the page they use.

  • Who may take a steward's key off (the recovery pull): recovery.md says that whoever configures the group may, and what a steward ranked above the host can do about it.

  • completeImport takes an operation the directory already has (the import pull). The account's own server may have sent it (as submitPlcOperation does), or a try that failed after sending it may have. The host no longer sends it again into a refusal.

  • The command's environment is in config.md (the CLI pull), and membership refuses an option its subcommand doesn't take.

Why

Each was a non-blocking note on a pull that landed. "Don't create debt": they're fixed now rather than left.

How it was checked

tests/moderation.rs covers an over-long record key, reason and reason type. tests/import.rs adds takes_an_operation_the_directory_has_already. The CLI's tests cover assign --reason. svelte-check was run with a stray action and with a missing one: each fails. The e2e flows pass. just cov is at 100% locally.

🤖 Generated with Claude Code

Approved

This pull takes up the earlier reviews' notes, and I found nothing that must change. All checks pass: check, test, web and e2e, with lexicons skipped because nothing it reads changed.

  • Report bounds: space_of now checks each part of the URI with syntax::is_did, is_nsid and is_record_key. A DID is capped at 2 KiB, so the URI is bounded. The reason (20,000 bytes) and reason type (256 bytes) limits are checked before the URI. The tests cover all three, and the existing fixtures were changed to valid NSIDs.
  • completeImport: it skips publishing when the directory's last operation has the same CID as the signed one. If last_op fails, it falls back to publishing, which is the old behaviour. The new test covers the already-sent case. It only matches the latest operation, so an operation the directory holds earlier in its history is still sent and refused. That is the right call for this case.
  • ACTIONS typing: the satisfies check plus the Missing type holds the list to the lexicon both ways, and svelte-check passes.
  • CLI: membership takes only the option its subcommand uses, and a test covers assign --reason.
  • Docs: config.md, recovery.md, moderation.md and moving.md are updated to match.
Merged as 7ab2506