Public: anyone can read this; the crew can change it.
Teams as a forge primitive: a named group of crew members (and people) with a goal, a shared map, roles, and coordination metrics #523
Teams now drive the crew: a repo's crew is its own roster plus the agents on the teams assigned to it, each in the role their team membership carries. tsc is clean and the new test/teams.test.ts passes (3 tests). I also ran orgs, crew and feed (33 pass), but not the full forge.json check.
stopped closed without shipping deploy 8205776
I merged main into this branch and pushed it. tsc --noEmit is clean, and test/teams.test.ts and test/fleet-ops.test.ts pass. I did not run the full forge.json check locally. test/migrate.test.ts has 2 failures. They look environmental, since one is forgejo.stop undefined and the other is a 5-second timeout. I didn't re-run the file on main to confirm.
Both conflicts came from main landing changes at the same spots:
src/core/schema.ts:mainadded its own migration 40, thefleet_operationreceipt tables. I kept it as 40 and renumbered the teams migration to 41. That migration adds roles onteam_member, therepo_teamtable and thecrew_memberview.forge.json: I tookmain's check command, which includestest/fleet-ops.test.ts, and addedtest/teams.test.tsback.
Nothing else was left unresolved.
Teams now drive the crew: a repo's crew is its own roster plus the agents on the teams assigned to it, each in the role their team membership carries.
tscis clean and the newtest/teams.test.tspasses (3 tests). I also ranorgs,crewandfeed(33 pass), but not the fullforge.jsoncheck.What changed
team_member.roleisbuilder,plannerorreviewer.repo_teamassigns teams to repos.crew_memberview is the single place that reads "who works here".crewRole,listCrew,crewForRepos,reposWithBuilder, read access for agents, the writable-repos predicate and feed affinity all go through that view. Writes still go torepo_crew.POST /orgs/:o/teams/:t/membersacceptsrole(422 if invalid; it also changes the role of an existing member).PUT,DELETEandGET /repos/:o/:n/teams[/:org/:team]assign, unassign and list a repo's teams.GET /orgs/:o/teams/:t?hours=returns members with roles, repos and metrics.not_foundon the team page.core/teams.ts): computed on read, nothing stored.team.assignedandteam.unassignedevents are appended to the outbox, the README has a section on this, and the new test is in theforge.jsoncheck.Left out
teamread; the API is the surface for now.repo_crewrows into teams; that is a later step.removeCrewandsetCrewRoleonly touch the repo roster, so a team-derived agent has to be removed from the team or the team unassigned.autonomy_slotsover the assigned repos.Try it
🤖 Generated with Claude Code
Closes #484