Skip to content

feat(server): Team registry: core workspace structure + team CRUD #630#653

Open
tarikcosovic97 wants to merge 2 commits into
andresharpe:releases/4.1.0from
tarikcosovic97:feat/team-registry-v41
Open

feat(server): Team registry: core workspace structure + team CRUD #630#653
tarikcosovic97 wants to merge 2 commits into
andresharpe:releases/4.1.0from
tarikcosovic97:feat/team-registry-v41

Conversation

@tarikcosovic97

@tarikcosovic97 tarikcosovic97 commented Jul 17, 2026

Copy link
Copy Markdown

Linked issue

Closes #630

Summary of changes

Delivers the minimum team-registry write surface that unblocks the v4.1 human-in-the-loop chain (#632, #600, #609, #586, #587). Sole writer of a new tracked file .bot/team-registry.json; three CLI commands (team add / list / get); schema validation + actionable errors. Mothership sync (#601), lifecycle commands (remove/update/set-availability, role-* — #631), and hosting (#576) are all handled elsewhere.

Files touched:

src/runtime/Modules/Dotbot.TeamRegistry/ — new module. Sole writer of the registry file; read/add/get/assert helpers.
src/cli/team-{add,list,get}.ps1 — thin CLI wrappers over the module. Both positional and --flag argument forms supported.
bin/dotbot.ps1 — Invoke-Team dispatcher + team switch branch + help entries.
tests/Test-TeamRegistry.ps1 — Layer 2 test file registered in tests/Run-Tests.ps1.
README.md — three team commands added to the Commands table.
Registry shape (schema_version: 1):

{
  "schema_version": 1,
  "members": [
    { "id": "tm_a1b2c3d4",
      "name": "ana-smith",
      "email": "ana@example.com",
      "role": "developer",
      "created_at": "2026-07-17T13:00:00Z",
      "created_by": "cli" }
  ]
}

Reviewer feedback applied:

Path corrected to .bot/team-registry.json (directly under .bot/, git-tracked).
email is required — needed by downstream Q&A routing; basic user@domain.tld validation.
role constrained to developer | lead | reviewer | qa; invalid values rejected with a message that names the allowed set.
id generation contract documented: tm_ + 8 chars uniform-drawn from [0-9a-zA-Z] via CSRNG rejection sampling; belt-and-suspenders collision retry.
Add-DotbotTeamMember serializes read-modify-write under a named System.Threading.Mutex keyed on a hash of the registry path. Prevents lost updates from concurrent adds. Atomic temp-file rename on top guards readers from torn files.
Branch cut from releases/4.1.0, not main.
Testing notes
pwsh tests/Test-TeamRegistry.ps1 # focused
pwsh tests/Run-Tests.ps1 # full pyramid (layers 1-3)
Covers the module read/add/get/list paths, email + role validation (including case-sensitivity of role), duplicate rejection (case-insensitive), schema-version mismatch, atomic-write cleanup, and a concurrent-add race check that spawns two Start-ThreadJob racers across 5 rounds and asserts both entries survive every round. Plus CLI smoke: script parse + dispatcher wiring.

Scope note
team add / list / get only. remove / update / set-availability and role-* land in #631 on v4.2. Mothership sync of the local registry lives in #601. Deployment / hosting is documented in #576. This PR is intentionally minimal — the write surface downstream tickets need to exist.

Checklist

  • Tests added or updated
  • Docs updated (if behaviour changed)
  • Linked issue exists
  • Follows the contribution guide

@github-actions

Copy link
Copy Markdown
Contributor

This PR is missing a linked issue reference.

Please add one of the following to the PR description:

  • Closes #<issue-number>
  • Fixes #<issue-number>
  • Resolves #<issue-number>

If this is a trivial change that doesn't need an issue, ask a maintainer to add the no-issue label.

@tarikcosovic97

Copy link
Copy Markdown
Author

@aselim31 ready for review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Inbox

Development

Successfully merging this pull request may close these issues.

2 participants