Skip to content

factory: workstreams share to people and teams with roles, and can be private (E1, part 2) - #2637

Merged
santoshkumarradha merged 4 commits into
work/teamsfrom
w2/e1-access-ws
Nov 13, 2026
Merged

santoshkumarradha merged 4 commits into
work/teamsfrom
w2/e1-access-ws

Conversation

@santoshkumarradha

@santoshkumarradha santoshkumarradha commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Wave-2 lane E1, part 2 — workstreams on the access core. Contract: ~/work/teams-wave/WAVE2.md §3 E1 as amended by §4.1. Part 1 (the core) is #2632.

Wire (also written into WAVE2.md §4 "E1 wire as landed", edited in place outside the repo, and docs/design/app-v3/PROTOCOL.md)

  • PUT /v1/workstreams/{id}/shares {"shares"?:[{kind,id,role}], "teams"?, "owner"?, "private"?, "rev"?, "include_linked"} — one save. shares wins; the old {"teams":[...]} still works as edit. Stale rev → 412. private:true empties shares (non-empty shares beside it → 422; team owner → 422); non-empty shares clear private.
  • GET .../shares/preview?shares=kind:id:role,... (and ?teams=): linked, non-private items where an added share would raise someone's role.
  • WorkstreamSummary += shares, private, my_role. The operator's row for someone's private workstream is name only (my_role:"", no shares, zero counts); its content is 404.
  • POST /v1/workstreams += private.
  • Engine: factory.org_workstream_shares / _share_preview / _create forward the new fields; engine_features += org_roles.

Rules and holes

  • view reads · edit = PATCH + approve go-aheads · full = archive + owner/shares/privacy. Operator: view on non-private, governs owner/shares of non-private, never an editor.
  • Hole 4: private items; their events never reach the operator.
  • Hole 5: the server signs every new/changed decision (by = caller, at = now); import ignores created_by.
  • Hole 6: on an org workstream the go-ahead first-writer lock is gone; anyone with edit approves.
  • Hole 7: DELETE /v1/people/{h}/sessions?heir=<h> hands their workstreams to the heir (default: the operator), removes their person shares, publishes events; private stays private (now the heir's).
  • W1's ask: import translates laptop-id links to the same importer's earlier copies, and back-links later imports (from_local_links).

Proof

  • TestTwoPeopleOverTheWireMeetE1sAcceptance: the real handler on a real loopback listener, santosh/abir/operator signed in through the device flow, plain HTTP. abir with view → 403 PATCH and archive; santosh's private workstream is a name-only row for the operator and 404 for content; a forged decision by is stored as the caller.
  • TestAShareGivesItsRoleAndNoMore, TestAPrivateWorkstreamIsANameToTheOperator, TestTheServerSignsDecisionsAndImports, TestMovingLinkedWorkstreamsInKeepsTheLinks, TestOwnerAndSharesLandInOneSave, TestATeamWorkstreamsGoAheadsAreNotTheFirstWritersAlone, TestARemovedPersonsWorkstreamsGoToAnHeir, TestTheSharePreviewTakesPeopleAndRoles; engine forwarding in cmd/codeaf/appfactory_org_test.go.
  • Not a codeaf factory serve binary run: E0's two-person e2e harness (internal/e2e/org_two_people_test.go) has not landed, and real sign-in needs GitHub for two accounts. The wire test above is the same handler over TCP.
  • make pr-ready BASE=<merge-base>: see the comment below.

santoshkumarradha and others added 4 commits November 13, 2026 14:44
… private

PUT /v1/workstreams/{id}/shares takes shares (people or teams, view |
comment | edit | full), owner, private and rev in one save; the old
teams body stays as edit. Rows carry shares, private and my_role; the
operator's row for someone's private workstream is its name only.
Archive needs full. The server signs decisions and imports, a team's
go-aheads are no longer the first approver's, and a removed person's
workstreams go to an heir. Imports keep links to earlier imports. The
engine forwards the new fields and says org_roles in hello.

Assisted-by: CodeAF
Co-Authored-By: CodeAF <[email protected]>
…takes roles

Assisted-by: CodeAF
Co-Authored-By: CodeAF <[email protected]>
@santoshkumarradha

Copy link
Copy Markdown
Member Author

Gate on head c5aad6b (rebased onto E3a #2635 / E7 #2636): factory/serve, factory, factory/api, factory/store, appwire green. The only factory/serve failures are TestFactorySetupContinueHoldsAgainstAConcurrentRead, TestFactorySetupDoubleContinueEndsReadingOnce and TestFactorySetupContinueEndsReadingWithoutWatchingUnreadRepos; make pr-ready's classifier found all three already failing on the base. The cmd/codeaf full leg lost one shard to box load (load average ~110: 358 tests never reported); its one real failure, TestAppIdleReleaseI1I2BackgroundChatStaysReleasedUntilSend, passes alone, as do all TestOrg* tests. Conflicts with E3a resolved: publishWorkstreams carries by, and the sharing record now names shares with roles.

@santoshkumarradha
santoshkumarradha merged commit 58cb333 into work/teams Nov 13, 2026
@santoshkumarradha
santoshkumarradha deleted the w2/e1-access-ws branch November 13, 2026 19:51
santoshkumarradha added a commit that referenced this pull request Nov 13, 2026
E1's #2637 brought OrgShare and orgShareList into appwire; the canvas
methods now use them instead of a second copy.

Assisted-by: CodeAF
Co-Authored-By: CodeAF <[email protected]>
santoshkumarradha added a commit that referenced this pull request Nov 13, 2026
E1's #2637 brought OrgShare and orgShareList into appwire; the canvas
methods now use them instead of a second copy.

Assisted-by: CodeAF
Co-Authored-By: CodeAF <[email protected]>
ZeroPoint95 pushed a commit that referenced this pull request Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant