feat(rust): Teams from first-party clans (phase 9, protocol 6) #12

Merged
whitlocktech merged 1 commits from feat/phase-9-clans into edge 2026-09-23 10:33:14 +00:00
Member

Phase 9 (R5): a first-party Rust clan is a Team, and this module becomes the site's Team provider. Design of record: docs/modules/rust/PLAN.md §24, D47–D58 (docs PR alongside). It pairs with Rust-Plugins and Rust-Link feat/phase-9-clans (protocol 6).

What it does

  • Provider. getTeams, getTeamMembers, getTeamLeaders, projectRoster, and pageUrlTemplate: '/rust/clans/{externalId}'.
    • externalId is <serverId>:<clanId>:<createdMs> (D52), because the game restarts clan ids whenever its clan database version changes.
    • complete: true only when every server's board is fresh, supported and untruncated (D53). It answers partial when some are, and refuses when none are.
    • Freshness uses the website's clock: when the board's t last advanced.
  • Store. rust_clans, rust_clan_members and rust_clan_boards.
    • Only a complete board may mark a clan gone. A board at the game's 100-clan ceiling (D55), or one with an unreadable row, proves nothing about what it leaves out.
  • Push. The five clan events are published as team.* kinds. Leadership is diffed board to board (D54). Membership lines go to the Team feed, all members-only (D49).
  • Roster audience (D48). The clan's linked members and staff by default. projectRoster and the module's own clan page use one function, and it re-reads the users row. The setting is a new section on Admin → Rust visibility, which also flags servers running uMod Clans (D47) and servers at the ceiling.
  • Public routes. GET …/servers/:id/clans (the list is public, D58) and GET /public/rust/clans/:externalId.
  • Client. A Clans tab, and /rust/clans/:externalId with three module slots for core's notify, activity and forum contributions (D56).
  • Links. Linking or unlinking asks core to reconcile Teams (D57).
  • The clan kinds are staff-class in the public feed allowlist. PROTOCOL_VERSION is 6.

Two traps in core's contract, both handled here

  • Core writes a feed item only for a Team it already holds. A new clan's Team appears on core's next reconcile (debounced 30 s), so "founded the clan" would always be dropped. The module re-offers the last 10 minutes of clan events on each board refresh.
  • Core clamps dedupeKey to 40 characters, silently. The key is therefore a sha1 (exactly 40 characters), so a re-offer is a no-op instead of a collision.

Verified

  • 204 server tests (a new 20-test clans.test.js, mutation-checked by planting two defects) and 41 client tests.
  • check:imports, check:bundle, check:externals, the regenerated OpenAPI fragment, and the frozen route manifest generated against core at the pinned sha.
  • Walked live on the Oxide rig, protocol-6 sidecar in the container, core running only this module:
    • two clans founded, members added, one promoted, one leaving, one kicked, one disbanded;
    • core created the Teams, synced the rosters and leaders, marked the departures, and archived the disbanded clan's Team;
    • the dropped first feed lines landed on the re-offer, once each;
    • the roster gate agrees between the module's page and core's /public/teams/:slug/members for anonymous, stranger, linked member and moderator.
  • Walked in the browser, signed out: the Clans tab, and the clan page with its roster withheld and core's activity slot filled.

Not walked: a real player's name on a feed line (the synthetic Steam ids have none, so lines read "A player …"), and the admin page in a browser. Its API was walked: a moderator's PUT gets 403, an unknown rung 400, and public opens the roster.

Depends on website#204 (one module per site). Core allows one Team provider per site, and a second registration fails the whole load, which would take module-uo down on a site running both.

AI disclosure

Written with Claude Code (Opus 5.5).

🤖 Generated with Claude Code

https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY

Phase 9 (R5): a first-party Rust clan is a Team, and this module becomes the site's Team provider. Design of record: `docs/modules/rust/PLAN.md` §24, D47–D58 (docs PR alongside). It pairs with Rust-Plugins and Rust-Link `feat/phase-9-clans` (protocol 6). ### What it does * **Provider.** `getTeams`, `getTeamMembers`, `getTeamLeaders`, `projectRoster`, and `pageUrlTemplate: '/rust/clans/{externalId}'`. * `externalId` is `<serverId>:<clanId>:<createdMs>` (D52), because the game restarts clan ids whenever its clan database version changes. * `complete: true` only when **every** server's board is fresh, supported and untruncated (D53). It answers partial when some are, and refuses when none are. * Freshness uses the website's clock: when the board's `t` last advanced. * **Store.** `rust_clans`, `rust_clan_members` and `rust_clan_boards`. * Only a complete board may mark a clan gone. A board at the game's **100-clan ceiling** (D55), or one with an unreadable row, proves nothing about what it leaves out. * **Push.** The five clan events are published as `team.*` kinds. Leadership is diffed board to board (D54). Membership lines go to the Team feed, all members-only (D49). * **Roster audience (D48).** The clan's linked members and staff by default. `projectRoster` and the module's own clan page use one function, and it re-reads the users row. The setting is a new section on **Admin → Rust visibility**, which also flags servers running uMod Clans (D47) and servers at the ceiling. * **Public routes.** `GET …/servers/:id/clans` (the list is public, D58) and `GET /public/rust/clans/:externalId`. * **Client.** A **Clans** tab, and `/rust/clans/:externalId` with three module slots for core's notify, activity and forum contributions (D56). * **Links.** Linking or unlinking asks core to reconcile Teams (D57). * The clan kinds are staff-class in the public feed allowlist. `PROTOCOL_VERSION` is 6. ### Two traps in core's contract, both handled here * **Core writes a feed item only for a Team it already holds.** A new clan's Team appears on core's next reconcile (debounced 30 s), so "founded the clan" would *always* be dropped. The module re-offers the last 10 minutes of clan events on each board refresh. * **Core clamps `dedupeKey` to 40 characters, silently.** The key is therefore a sha1 (exactly 40 characters), so a re-offer is a no-op instead of a collision. ### Verified * 204 server tests (a new 20-test `clans.test.js`, mutation-checked by planting two defects) and 41 client tests. * `check:imports`, `check:bundle`, `check:externals`, the regenerated OpenAPI fragment, and the frozen route manifest generated against core at the pinned sha. * **Walked live on the Oxide rig**, protocol-6 sidecar in the container, core running only this module: * two clans founded, members added, one promoted, one leaving, one kicked, one disbanded; * core created the Teams, synced the rosters and leaders, marked the departures, and **archived the disbanded clan's Team**; * the dropped first feed lines landed on the re-offer, once each; * the roster gate agrees between the module's page and core's `/public/teams/:slug/members` for anonymous, stranger, linked member and moderator. * **Walked in the browser, signed out:** the Clans tab, and the clan page with its roster withheld and core's activity slot filled. **Not walked:** a real player's name on a feed line (the synthetic Steam ids have none, so lines read "A player …"), and the admin page in a browser. Its API was walked: a moderator's PUT gets 403, an unknown rung 400, and `public` opens the roster. **Depends on website#204** (one module per site). Core allows one Team provider per site, and a second registration fails the whole load, which would take module-uo down on a site running both. ### AI disclosure Written with Claude Code (Opus 5.5). 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
wtclaude added 1 commit 2026-09-23 10:29:25 +00:00
feat(rust): Teams from first-party clans (phase 9, protocol 6)
All checks were successful
PR Checks / server-tests (pull_request) Successful in 24s
PR Checks / frozen-manifest (pull_request) Successful in 46s
PR Checks / client-build (pull_request) Successful in 8m3s
c94271104f
A first-party Rust clan is a Team (R5). This module becomes the site's
Team provider and answers core from the plugin's `clans` board. Design
of record: docs/modules/rust/PLAN.md §24, D47-D58.

- The store: rust_clans, rust_clan_members and rust_clan_boards. A clan's
  identity is <serverId>:<clanId>:<createdMs> (D52), because the game
  restarts clan ids whenever its clan database version changes.
- The provider (D53): getTeams is complete only when every server's
  board is fresh, supported and untruncated. It is partial when some
  are, and refuses when none are. Freshness is judged by the website's
  clock, from when the board's `t` last advanced.
- Only a complete board may mark a clan gone. A board at the game's
  100-clan ceiling (D55), or one with an unreadable row, proves nothing
  about what it leaves out.
- Leadership is diffed board to board and published (D54). The five clan
  events are published as team.* kinds, and written to the Team feed as
  members-only lines (D49).
- Core only writes feed items for a Team it already holds. So the last 10
  minutes of clan events are re-offered on each board refresh, deduped by
  a sha1 key: core clamps a dedupeKey to 40 characters, and a readable key
  would be truncated into collisions.
- projectRoster and the clan page share one audience rule (D48): the
  clan's linked members and staff by default, re-read from the users row.
  The setting lives on Admin > Rust visibility, which also warns about
  uMod Clans (D47) and the ceiling.
- Public: GET servers/:id/clans (the list is public, D58) and
  GET clans/:externalId. The client adds a Clans tab and
  /rust/clans/:externalId, with three module slots for core's notify,
  activity and forum contributions (D56).
- Linking and unlinking an account ask core to reconcile Teams (D57).
- The clan kinds are staff-class in the public feed allowlist.
- PROTOCOL_VERSION is now 6.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
whitlocktech merged commit dc3c9689b4 into edge 2026-09-23 10:33:14 +00:00
whitlocktech deleted branch feat/phase-9-clans 2026-09-23 10:33:15 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: RunicGateway/Module-Rust#12
No description provided.