Skip to content

Team mode M1: A member signs in on the LAN and talks in a public Channel #4140

Closed

Description

@DoodleBears

Parent: hub #4138 (spec #4137, ADR-0336). Blocked by: #4139.

This is the first end-to-end tracer. Obtain Human feedback before the sibling slices broaden.

Behavior

  1. The Owner enables Team mode and sets a password.
  2. The Owner creates member Bob; the one-time password is shown once.
  3. Bob opens the Host over HTTPS from another machine and signs in.
  4. Bob is forced to change his password.
  5. Bob sees only the Tobs Client.
  6. Bob browses a public Channel and joins it.
  7. Bob and the Owner exchange messages, and each sees the correct authors.

Includes

  • humans and Member Credential persistence; argon2id; login rate limiting by username and IP.
  • Paired Device grants bound to a Human ID; existing grants bound to the Owner.
  • Loopback, local Desktop and CLI act as the Owner.
  • API Gateway default-deny of DSH-native methods for members.
  • Plain-HTTP password sign-in refused.
  • Minimal public Channel browsing and joining.
  • CLI: team-mode on/off, members create/list, local --as <member>.

Acceptance

  • Real Host and two browsers.
  • Bob is refused on a DSH-native method and over plain HTTP.
  • Turning Team mode off restores unchanged single-Human behavior.
  • CLI parity passes.

Activity

  1. DoodleBears commented on Nov 13, 2026

    @DoodleBears
    ContributorAuthor

    Agent work claim

    • Agent: Claude Code (orchestrator, UI/UX) + Codex CLI (logic)
    • Task: claude/local/74a5ee4a-f6fe-4aab-870f-5e465b0b8474 (not a DSH Session); Codex thread added once started
    • Issue scope: M1 tracer — Team mode on, Owner password, member creation, member sign-in over HTTPS, Tobs-only member shell, public Channel browse/join, CLI parity
    • Branch: claude/4140-team-sign-in (stacked on claude/4139-human-context; Codex sub-branch codex/4140-logic)
    • Started: 2026-11-13 18:50 UTC
    • State: active (UI against the contract now; Codex logic starts after the M0 review)

    M1 wire contract (agreed before parallel work; Claude = UI, Codex = logic)

    Stacked on M0 (HumanContext, resolveInvocationHuman). Names below are binding; changes go through the claim comment first.

    Identity on the wire

    • New DSH principal kind botharness-member: { kind: 'botharness-member', humanId, grantId } (merged into DSH PrincipalMap). The Owner keeps DSH's owner principal.
    • resolveInvocationHuman: owner → Owner context; botharness-member → that Human after re-checking the grant is live and the member active; anything else → refused.
    • A dsh-api-remote-access policy for botharness-member allows only the BotHarness bridge endpoints listed as member-callable; every DSH-native method is denied (remote-access/denied, reason no-allow).

    Member web entry (HTTP, served by the device gateway; before a Peer exists)

    • GET /botharness-device/team/ — sign-in page (static bundle built from packages/client, by Claude), or the member shell when the cookie holds a live grant.
    • POST /botharness-device/team/sign-in { username, password } → 200 { humanId, displayName, mustChangePassword } + HttpOnly; Secure; SameSite=Strict cookie bound to a new grant (device, Host, Human ID).
      Refusals { code }: 401 credentials-invalid · 429 rate-limited (+retryAfterSeconds; per username and per IP) · 403 insecure-transport (non-loopback plain HTTP without the Owner's warned exception) · 403 team-mode-off · 403 member-suspended.
    • POST /botharness-device/team/sign-out → revokes that grant only.
    • Member calls after sign-in run through connection.createPeer({ principal }) + the API Gateway, so remote-access decides every call.

    Bridge methods (flat names like humanNameSet; refusals are BridgeCallError codes, i.e. { ok: false, error: { code, message } })

    Method Caller Result / refusals
    teamMode Owner, member { enabled, ownerPasswordSet, insecureHttpAllowed, memberUrls: string[], viewer: { humanId, kind: 'owner'|'member', displayName, mustChangePassword } }
    teamModeSet { enabled } Owner owner-password-required
    teamOwnerPasswordSet { password, current? } Owner password-weak (< 10 chars), credentials-invalid
    teamInsecureHttpSet { allowed } Owner —
    members Owner [{ humanId, username, displayName, status: 'active'|'suspended', mustChangePassword, createdAt, owner }]
    memberCreate { username, displayName } Owner { member, initialPassword } (shown once, never stored in plain text) · team-mode-off, username-invalid, username-taken
    memberPasswordChange { current, next } member, Owner credentials-invalid, password-weak, password-reused; clears mustChangePassword
    publicChannels member, Owner [{ channelId, name, description?, memberCount, joined }]
    publicChannelJoin { channelId } member, Owner channel-not-public, channel-not-found
    channelPublicSet { channelId, public } Owner minimal M1 switch; M4 replaces it with public/roles/private
    While mustChangePassword is true, every member call except teamMode and memberPasswordChange is refused password-change-required.

    Persistence: humans (identity only), member_credentials (argon2id), member_grants (hashed token, revocable), Team mode settings; existing Paired Device grants bind to the Owner. Group Channels get a public flag, default off. Source Events record the speaking Human (M0).

    CLI (deepseekbot, one JSON document, secrets via stdin/files only)

    • team-mode status|on|off, team-mode owner-password --password-stdin, team-mode insecure-http on|off --confirm
    • members list, members create --username <u> --display-name <n> --initial-password-file <path> (file written 0600; JSON reports the path, not the password)
    • channels browse-public, channels join-public <id>, channels set-public <id> on|off
    • Global --as <username>: the local Owner CLI evaluates the command through that member's Peer and policy; it never bypasses checks.

    Client (Claude): Settings → Team mode (switch, Owner password, insecure-HTTP exception with warning, member URLs), Members (list, create, one-time password reveal), sign-in page, forced password change, member shell showing only the Tobs Client, public Channel browse/join; en + zh copy.

  2. added
    agent:activeOne or more coding-agent tasks currently claim this issue; see claim comments for task IDs
    on Nov 13, 2026
  3. DoodleBears commented on Nov 13, 2026

    @DoodleBears
    ContributorAuthor

    Codex logic task for this claim: codex/local/01a1d66a-9b89-73f0-8fc1-cfdd55c283cb on codex/4140-logic (gpt-6.1-sol, high), started after M0 review. M0 PR: #4158. Additional contract details now fixed: usernames match ^[a-z0-9][a-z0-9._-]{1,31}$; the pre-sign-in page is renderTeamSignInPage in packages/client/src/shared/team-sign-in-page.ts.

  4. DoodleBears commented on Nov 13, 2026

    @DoodleBears
    ContributorAuthor

    Contract change (agreed in review, before merge): the forced initial-password change moves to the pre-shell page.

    • GET /botharness-device/team/ with a live grant whose member has mustChangePassword serves renderTeamSignInPage({ ..., step: 'change-password', displayName }) instead of the shell.
    • New POST /botharness-device/team/password { current, next } (member cookie, same transport rule) → 200; refusals 401 credentials-invalid, 400 password-weak, 409 password-reused, 429 rate-limited (+retryAfterSeconds).
    • teamMode.memberUrls lists only addresses another device can use (no loopback).
      Reason: the in-shell gate raced the shell's first loads and rendered once per sidebar instance.
  5. 10 remaining items

  6. DoodleBears commented on Nov 14, 2026

    @DoodleBears
    ContributorAuthor

    Agent work outcome

  7. removed
    agent:activeOne or more coding-agent tasks currently claim this issue; see claim comments for task IDs
    on Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions