Repository navigation
factory: who is in an organization item, and who changed it (E3a) - #2635
Merged
Merged
Conversation
POST /v1/presence is a heartbeat (10 s, 30 s TTL) kept in memory; only a
change to who is on an item is published as `presence`, filtered by view.
Every org event carries `by`. Teams, workstreams, go-ahead policy, rules,
routes, spending and settings are written to the record with the
server-resolved actor, and GET /v1/workstreams/{id}/activity lists a
workstream's changes. The engine relays presence as factory.org_presence
and serves factory.org_presence and factory.org_workstream_activity.
Assisted-by: CodeAF
Co-Authored-By: CodeAF <[email protected]>
Assisted-by: CodeAF Co-Authored-By: CodeAF <[email protected]>
Assisted-by: CodeAF Co-Authored-By: CodeAF <[email protected]>
santoshkumarradha
force-pushed
the
w2/e3a-presence
branch
from
November 13, 2026 19:24
426fefb to
fbd9cfb
Compare
This was referenced Nov 13, 2026
Merged
ZeroPoint95
pushed a commit
that referenced
this pull request
Nov 24, 2026
) Presence heartbeat and events filtered by view, by on every org event, org changes in the record, workstream activity, engine relay and methods. Assisted-by: CodeAF Co-Authored-By: CodeAF <[email protected]>
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.
Wave-2 lane E3a — presence and actor, per
~/work/teams-wave/WAVE2.md§3 E3a as amended by §4 (no page hand: character-level co-editing in E7 replaces it; carets come from Yjs awareness).What changes
Presence —
POST /v1/presence {"item":{"kind","id"},"part"?,"editing"?,"left"?,"client"?}api.PresenceBeat/api.PresenceTTL), answered with{"item","here":[{handle,part,editing}]}.left, silence via a timer likemachine_events.go), as eventpresence, so unchanged beats cost the stream nothing.view(throughorgWorkstreamAccess, so E1's private rule applies). A beat on an item you cannot view is 404; unknown kind 422.h.presenceKinds); E4 registerscanvas.Actor
byonteam.changed,workstream.changedandworkstream.removed, stamped from the sign-in.team_changed,workstream_changed,policy_changed,rules_changed,routes_changed,spending_changed,settings_changed; verbs fixed inrecord.OrgVerbs; detail names fields, never content).h.recordWorkstreamis the door E2's part routes call./v1/audit,/v1/activityand the liveactivityevent.GET /v1/workstreams/{id}/activity?since=&limit=: oldest first, at most 500, withpeople.Engine
factory.org_presenceandfactory.org_workstream_activity.factory.org_presence {connection,item,here};factory.org_changedgainsby.org_presence.Wire changes are also written into
~/work/teams-wave/WAVE2.md§4 ("E3a as built"). That file is outside the repo and was edited in place.Proof
Two real sessions against one real
bin/codeaf factory serve(team mode). The seededsessions.jsonheld owner, santosh and abir, with teams as inorgScene. Only the GitHub sign-in was skipped, because it is hardwired to github.com.{"here":[{"handle":"abir","part":"pg_retry"},{"handle":"santosh","part":"pg_retry","editing":true}]}abir created workstream→santosh changed workstream (purpose)→abir changed go-aheads./v1/events:workstream.changed … "by":"abir"presenceframesworkstream.changed … "by":"santosh"team.changed … "by":"owner"here:[abir]. abir's four unchanged beats published nothing (3 presence events in total).Tests:
TestPresenceSaysWhoIsEditingWhichPage,TestPresenceIsSeenOnlyByThoseWhoMayView,TestPresenceFoldsOnePersonsWindows,TestWorkstreamActivityNamesEveryoneInOrder,TestWorkstreamActivityIsPrivateToThoseWhoSee,TestOrgEventsCarryWhoAndTeamsAreRecorded.TestOrgPresenceAndActivityForwardToTheServer,TestOrgPresenceAndByAreRelayed.Gate:
make pr-ready BASE=origin/work/teamson headfbd9cfb9a.appwire,factory/api,factory/recordandfactory/servepassed. Every new test passed on its first run.origin/work/teams@da27602af:cmd/codeaf:TestAppFactoryJobActionsTwoPeopleAgainstTheRealServer,TestAppFactoryIssueCommentAgainstTheRealServerandTestAppFactoryRejectPlanAgainstTheRealServerfail on the base with "only @alice can do this". That refusal is E5's (factory: a job in a workstream answers to that workstream (E5) #2634) job-owner check.factory/serve:TestFactorySetupContinue*andTestFactorySetupDouble*fail on the base under load, and pass on this head when run alone. The classifier marked one of them "introduced"; that is wrong, because it failed at base when run back to back.cmd/codeafshard 7 hit its 15 m timeout on a box shared with several lanes. Its other failures (HostedTakeBack,PlanFilesAnswer,FinishSharesOneDeadline,TakeET1ET2,TakeF1P2,StartBadRepositoryFile) pass on this head when rerun.Commits use the lane rules' CodeAF trailers.