Skip to content

Team mode M7: Bot visibility and Role Policy #4150

Open

Description

@DoodleBears

Parent: hub #4138 (spec #4137 + Bot access amendment of 2026-11-15, ADR-0336). Blocked by: #4143 (merged), #4145.

Implements the Bot access model recorded on spec #4137 (2026-11-15). Replaces the earlier audience-containment design.

Behavior

  • Principal. Every Bot has one principal (its owner). Its effective access = principal's access ∩ the principal's restrictions on it; the Owner and holders of all-Bots management may restrict any Bot further. It changes the moment the principal's access changes. Audited private-content viewing (M11) is never available to Bots.
  • Read / in. A Bot can read any Channel its principal can access (subject to the "may join Channels I'm in" switch). It can write only in Channels it was added to. No silenced state.
  • Visibility. private (only the principal may DM it or add it) or public with an audience everyone | roles(roleIds) | members(humanIds) (who may DM it and add it to Channels). Making a Bot public or widening its audience requires the create public Bots permission. Shrinking it shows a preview; afterwards outsiders' DMs are read-only and the Bot leaves Channels it no longer qualifies for.
  • Switches (per Bot, set by its principal): proactive DMs to its audience (members can opt out per Bot); may join Channels the principal is in (default on). Adding a Bot to a Channel requires the adder's addBots right there, the principal's access to that Channel, and the switch on.
  • Channels. Anyone in a Channel may @ a Bot that is in it. No co-occupancy block for sensitive Bots; whoever adds it decides.
  • DMs. One DM per (Human, public Bot); the principal cannot read other Humans' DMs with it except via M11.
  • Bot–Bot. Private Bots may message and delegate to public Bots their principal can reach; public Bots cannot proactively reach private Bots.
  • Shared Bots' Memory lives in a shared space whose audience matches (M6), apart from the grantable files folder; public Bots are managed by their principal and holders of all-Bots management. Binding a Bot to an external IM App requires being its principal plus bind-external-im.
  • Role Policy stays advisory (existing evaluator, given to the Bot with the speaking Human's identity and roles).

Acceptance

  • A Bot never reads a Channel its principal cannot; it loses read and write the moment the principal is removed or loses the granting role.
  • Only allowed people can DM or add a Bot, per its visibility and switches; refusals are coded and shown in UI and CLI.
  • Each Human's DM with a public Bot is private to them.
  • A private Bot can delegate to a public Bot; the reverse is refused.
  • Making a Bot public without the permission is refused.
  • CLI --as parity; real-Host verification with two members.

Activity

  1. DoodleBears commented on Nov 14, 2026

    @DoodleBears
    ContributorAuthor

    Scope addition (Vain, 2026-11-14): Bot visibility also supports specific members ({ kind: 'members', humanIds }), alongside roles and shared-with-everyone, matching the shared-space audience options from M6, so an owner can choose exactly which members may DM a Bot or have it join Channels with them.

  2. DoodleBears commented on Nov 14, 2026

    @DoodleBears
    ContributorAuthor

    Human decisions (Vain, 2026-11-15) for Role Policy:

    1. Multiple roles allowed; conflicts made explicit. Hard permissions are the union across roles. For plain-language policy items, Deny wins, but conflicts are shown when roles are assigned: the member sheet flags each conflicting pair ("Intern denies X, Finance allows X → Deny applies") and the admin resolves it then (keep, remove a role, or edit a policy). Detecting "same subject" uses topic tags on policy items (admin-set, model-assisted suggestion allowed).
    2. Speaker context, append-only (never rewrite the system prompt, to keep the cached prefix). A per-Bot switch, default on. The fixed system prompt only states the rule once. Each message carries a short speaker tag ([Bob · Finance, Intern]). A role's full policy text is attached to the envelope of the first message in the Session where that role appears; a changed policy is re-attached (with its revision) on the next message carrying that role, and the latest revision wins. A Bot tool returns a named Human's roles and the resolved Allow/Deny for a policy topic, for on-demand checks (especially in group Channels).
  3. DoodleBears commented on Nov 15, 2026

    @DoodleBears
    ContributorAuthor

    Agent work claim

    • Agent: Codex (implementation sub-agent)
    • Task: codex/local/01a1e0ec-da95-72e1-b965-20fe01d14b28 (not a DSH Session)
    • Issue scope: Restore proactive messaging to the current Bot principal; preserve audience switch and opt-out enforcement. Core and regressions only, under PR feat(team): Bot visibility, shared Bots and Role Policy (M7) #4258 owner coordination.
    • Branch: claude/4150-bot-visibility
    • Started: 2026-11-15 20:37 UTC
    • State: active
  4. added
    agent:activeOne or more coding-agent tasks currently claim this issue; see claim comments for task IDs
    on Nov 15, 2026
  5. DoodleBears commented on Nov 15, 2026

    @DoodleBears
    ContributorAuthor

    Agent work outcome

    • Task: codex/local/01a1e0ec-da95-72e1-b965-20fe01d14b28 (Codex implementation sub-agent).
    • State: handed-off to PR owner.
    • Commit: 90d172f, fast-forward pushed to claude/4150-bot-visibility in feat(team): Bot visibility, shared Bots and Role Policy (M7) #4258.
    • Root cause: proactive audience policy was also applied to the Bot principal, including Owner-only Hosts because TeamService exists with Team mode off.
    • Fix: after the existing active-principal check, requireProactive exempts the current persisted owner. Both explicit sends and startHumanDm inherit the exemption, including after transfer. Non-principal audience/switch/opt-out checks remain enforced.
    • Regressions: principal sends through channel_id and human_id with Team mode on/off and opt-out rows; non-principal switch-off and opt-out refusal; audience narrowing; transfer to a new principal and former-principal opt-out; paused principal refusal. Targeted suite: 29 passed.
    • CI-planned affected tests (--maxWorkers=2): 748 files passed, 5 skipped; 8,137 tests passed, 23 skipped, zero failures. The known local simultaneous-retirement failure did not reproduce.
    • Additional validation: CI-planned docs suite (1 test), slides build, typecheck, lint, full formatting check, build and e2e:smoke all passed.
    • Exact GenUI CI step on an isolated DSH 0.2.2-rc.1 Host: passed, all budgets passed, 3 plain/rich pairs, 6 publications, 3 previews, no page errors or cleanup failures. Headless/model-free Web evidence only.
    • Cleanup: task Host and children exited, ports released, disposable perf Profile removed after open-file checks, evidence retained. Closed smoke fixture retained. No UI/Client source edits; inherited generated docs unchanged.
    • Remaining: parent PR review and CI on the pushed head (running when handed off). PR owner retains integration/review ownership.
  6. DoodleBears commented on Nov 15, 2026

    @DoodleBears
    ContributorAuthor

    Agent work claim

    • Agent: Codex (implementation sub-agent)
    • Task: codex/local/01a1e126-1b1c-7b13-a959-717240df07d0 (not a DSH Session)
    • Issue scope: Verify and repair the 12 assigned core CodeRabbit findings on PR feat(team): Bot visibility, shared Bots and Role Policy (M7) #4258, with failing regressions and serial validation. Client files remain under the Claude owner.
    • Branch: claude/4150-bot-visibility
    • Started: 2026-11-15 21:00 UTC
    • State: active
  7. DoodleBears commented on Nov 15, 2026

    @DoodleBears
    ContributorAuthor

    Agent work outcome

    • Task: codex/local/01a1e126-1b1c-7b13-a959-717240df07d0 (Codex implementation sub-agent).
    • State: handed-off to the orchestrator at the Human's instruction.
    • Local, unpublished commit: 841a32e1a3dd5e54139e9ffa08ec5dc1360f5c98, branch claude/4150-bot-visibility; committed with HUSKY=0 and explicit paths only. No push.
    • All 12 assigned core CodeRabbit findings were repaired with regressions; no finding was skipped. Client changes remain under the separate owner. The principal proactive exemption from 90d172f remains.
    • Focused regressions passed; after fixing static speaker_policy catalogue enumeration, 4 files / 140 tests passed.
    • Initial complete CI-planned affected run: 749 files passed, 1 failed, 5 skipped; 8,154 tests passed, 1 failed, 23 skipped. Its only failure was the static tool catalogue assertion, subsequently fixed and rerun successfully. The known simultaneous-retirement failure did not reproduce.
    • A second complete affected sweep was interrupted by disk exhaustion and is not green; widespread fixture failures followed and no final aggregate summary was produced.
    • Final own-file formatting, root/mobile typecheck, lint, slides build, docs companion test and real isolated DSH 0.2.2-rc.1 e2e:smoke passed.
    • Smoke Hosts exited and ports were released. Only this task's idle copied CLI dependency tree was removed after ownership/open-file checks; Profile, credentials, test data and evidence were preserved and fingerprinted unchanged. Nothing outside task-owned resources was deleted.
    • Remaining: Human frees disk space; orchestrator reruns the complete affected sweep with --maxWorkers=2 and checks the frozen source identity, then pushes only after validation passes. Native/Human acceptance is not claimed.
  8. DoodleBears commented on Nov 15, 2026

    @DoodleBears
    ContributorAuthor

    Agent work claim

    • Agent: Codex (implementation sub-agent)
    • Task: codex/local/01a1e194-9964-7e61-80d0-476b88e05a48 (not a DSH Session)
    • Issue scope: Verify the five assigned findings from review 5913505447 on PR feat(team): Bot visibility, shared Bots and Role Policy (M7) #4258; add failing regressions, apply minimal core fixes, validate serially with two Vitest workers, and push only after validation passes. Continuing the prior handed-off implementation at the Human’s instruction.
    • Branch: claude/4150-bot-visibility
    • State: active
  9. DoodleBears commented on Nov 15, 2026

    @DoodleBears
    ContributorAuthor

    Agent work outcome

    • Task: codex/local/01a1e194-9964-7e61-80d0-476b88e05a48 (Codex implementation sub-agent).
    • State: handed-off; stopped at the Human-specified disk threshold.
    • Local unpublished commit: 4c0af8e1f614d2ee0c75d373a84ff403ab227584; branch claude/4150-bot-visibility. Committed with HUSKY=0 and explicit paths, required trailers included. No push; PR feat(team): Bot visibility, shared Bots and Role Policy (M7) #4258 remains at 841a32e.
    • All five findings from review 5913505447 are valid and fixed with regressions; none skipped. Transfer code is currently in team/service.ts. Group steering rechecks current access; Assignment and non-native attention use the recorded DM participant; private transfer stamps legacy unstamped DMs transactionally; DM lookup excludes deleted records before LIMIT.
    • Seven new regression cases passed. The full Assignment participant suite passed 7/7. Root/mobile typecheck and lint passed; all edited files formatted with oxfmt.
    • Complete CI-planned affected run used --maxWorkers=2, but was interrupted with SIGINT (exit 130) when free disk reached 1.9 GiB. No final aggregate; no failure output before interruption. The known simultaneous-retirement failure was not observed, and the sweep is not green.
    • Docs companion validation and e2e:smoke remain unrun. No task-owned Host/browser/device launched. Verified this task’s Vitest root and recorded workers exited. Other tasks and all inherited generated docs remain untouched; no unrelated deletion.
    • Remaining: resume full affected suite, planned docs validation and e2e:smoke after disk recovery; push only when validation passes. Parent owns integration/review. No native or Human acceptance claimed.
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

    agent:activeOne or more coding-agent tasks currently claim this issue; see claim comments for task IDsfeature:teamready-for-agentFully specified, ready for an AFK agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions