chat: wire (or rule out) the komiti→Mattermost-team construct reconciler declared by #1543 #1550
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Matou/idss#1550
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Symptom / gap
Since #1543, the chat port (
internal/chatsvc) declaresRoleMappingas reconciler-mapped with the komiti constructteam(ADR 0076 Tier 2 — "Chat: team"), and ships the operator→system_adminrole reconciler (ReconcileRole). But the komiti→team construct reconciler (chatsvc.Port.ApplyRoleMapping) is still a truthful no-op: creating a komiti does not create or populate a Mattermost team, so P6-S7's "kaimahi is a team in chat" is a declared capability whose verb is not yet wired.Why it was deferred
#1543 is scoped to the operator role (spec #1535). Two honest constraints on the team side:
ApplyRoleMappingcreates a team, komiti membership cannot be reconciled from the OIDC claim — an empty team is its own fiction.nameslug (lowercase DNS-ish) derived from the komiti name, with idempotent ensure (GET/api/v4/teams/name/{name}→ POST/api/v4/teams).Proposed fix (one of)
ApplyRoleMappingto ensure a Mattermost team per komiti as its home (idempotent), and add each komiti member to the team over the admin API on the members reconciler's fan-out (Team Edition membership is add-by-API, not claim sync); orFound while implementing #1543 (chat operator→system_admin reconciler).
mmctl --local roles system-admin <user>for operators androles memberon revoke (sign-in already OIDC; Team Edition has no claim-to-role mapping) #1543Ruled by agent under ADR 0174 — veto anytime
Ruling: Take Proposed fix #1 (wire
ApplyRoleMapping), not #2 (downgrade to front-door-only). Labellingenhancement+ready-for-agent.Why #1 over #2 — path #2's premise doesn't hold. #2 rests on "the construct is undeliverable in Team Edition." But the blocker is narrower than that: Team Edition lacks automatic group-to-team claim sync (an Enterprise SAML/LDAP feature). It does not lack team creation or membership management over the admin API — and a reconciler doesn't need claim sync, because it does the fan-out itself. The issue body already concedes this ("Team Edition membership is add-by-API, not claim sync"). So the construct is deliverable via the reconciler pattern, and #2's downgrade is the wrong call.
Two accepted design artifacts also point at #1, and #2 would have to contradict both:
docs/ux/wireframes/p6-members/p6-s7-komiti-detail.htmlstates, present tense, "kaimahi is a team in Chat" with areconciler-mappedchip. Wiring the reconciler makes that caption honest; downgrading would force an edit that contradicts it.Why this is a two-way door (not a human gate):
GET /api/v4/teams/name/{slug}and (b) the komiti's members are on it via the team-members admin endpoint.One honest caveat carried into the brief: no port has built a container-ensuring
ApplyRoleMappingyet — codesvc (Forgejo org, #1542) and newslettersvc (Listmonk, #1541) ship the same truthful-no-op stub as their own tracked follow-ups. So this is a net-new increment, not pattern-following; the brief is written to be built from the ADR-0076 contract, with codesvc'sorganisationstub as the closest structural analogue.Agent Brief
Category: enhancement
Summary: Wire chat's komiti→team construct reconciler (
chatsvc.Port.ApplyRoleMapping) so opening Chat for a komiti ensures a Mattermost team and populates it with the komiti's members over the admin API — replacing today's truthful no-op.Current behavior:
Since #1543 the chat port (
internal/chatsvc) declares itsRoleMappingasMappingReconcilerwith constructteam(ADR 0076 Tier 2) and ships the operator→system_adminrole reconciler (ReconcileRole, real and idempotent). But the komiti→team construct reconcilerApplyRoleMappingis a truthful no-op (return nil): creating/opening a komiti creates no Mattermost team and no membership. Its own doc comment and the package doc still describe the mapping as front-door-only, and a test pins the no-op as the current intended contract.Desired behavior:
When a komiti opens Chat, the port ensures that komiti's Mattermost team exists (idempotent create) and reconciles its membership from the komiti's members:
nameslug (lowercase, DNS-ish) from the komiti, then ensure-by-GET /api/v4/teams/name/{slug}→ create withPOST /api/v4/teamsonly if absent. Re-running is a no-op; the slug is stable across runs for the same komiti.ReconcileRole's posture). No account for a member ⇒ that member is skipped, not fabricated.RoleMapping. The p6-s7 wireframe's present-tense "kaimahi is a team in Chat" becomes true and needs no edit.Key interfaces:
chatsvc.Port.ApplyRoleMapping(komiti string) error— currently returns nil; should ensure the team and reconcile membership as above. Keep the signature; it implementsmemberorbit.ServicePort.chatsvc.Port.RoleMapping()— unchanged (MappingReconciler, constructteam, operatorsystem_admin, membermember).chatsvc.Port.ReconcileRole— unchanged; the new work is the construct verb alongside it, and it is the template for admin-API convergence and no-fabrication error handling.ReconcileRoleper member), so a komiti membership change re-converges the team.ReconcileRole(rolePUT) — extend it with the teams endpoints (GET /teams/name/{slug},POST /teams, team-members add) rather than introducing a second client.Acceptance criteria:
ApplyRoleMappingfor a komiti creates a Mattermost team whose name slug is stable and derived from the komiti; a second call creates nothing new (idempotent).ReconcileRole.ApplyRoleMappingas a no-op, asserting the ensure-team and membership-reconcile behavior (idempotency, skip-no-account, error-not-fabricate).GET /teams/name/{slug}) and carries the komiti's members.ReconcileRole(operator→system_admin) behavior is unchanged.Out of scope:
RoleMapping's shape.swarm-claim host=bens-mac-04 run=25440
(automated multi-host claim — lowest live claim id works this ticket)
close-report for #1550 — status
success✅ close-report gates passed — every claim verified against main; issue closed.
envelope