feat(server): Team registry: core workspace structure + team CRUD #630#653
Open
tarikcosovic97 wants to merge 2 commits into
Open
feat(server): Team registry: core workspace structure + team CRUD #630#653tarikcosovic97 wants to merge 2 commits into
tarikcosovic97 wants to merge 2 commits into
Conversation
Contributor
|
This PR is missing a linked issue reference. Please add one of the following to the PR description:
If this is a trivial change that doesn't need an issue, ask a maintainer to add the |
5 tasks
Author
|
@aselim31 ready for review. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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):
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