Skip to content

factory: a job in a workstream answers to that workstream (E5) - #2634

Merged
santoshkumarradha merged 4 commits into
work/teamsfrom
w2/e5-factory-acl
Nov 13, 2026
Merged

santoshkumarradha merged 4 commits into
work/teamsfrom
w2/e5-factory-acl

Conversation

@santoshkumarradha

@santoshkumarradha santoshkumarradha commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Wave-2 lane E5 (WAVE2.md §3 "After the demo cut → E5", §1c holes 1–2; moved into the demo cut by §4.5).

What changes

  • Job write doors (POST /v1/jobs/{id}/<verb>: stop, steer, priority/prioritize, reply, nudge, recheck, request_changes, undo, …) need the job's person, edit on its workstream, or the operator. One gate in postJob (verbs.go) → mayChangeJob (job_access.go).
  • A job with no person in a workstream needs edit on it. Outside every workstream it keeps today's rule.
  • A job with a person outside every workstream is now changed only by that person or the operator (was: any repo reader).
  • Undo of a stop: allowed to whoever stopped it AND the job's person.
  • Visibility = repo read AND view on the job's workstream: queue (forViewer), GET /v1/jobs/{id} (404), record/activity, job ticks on /v1/events, routes preview, runners, read marks.
  • A sign-in with no profile sees no workstream job and acts as no one's person (it used to read as the server machine's GitHub login).
  • Exempt: follow, brief_seen, scout (the caller's own facts); take/release keep the lease desk's person rule when the job has a person.

Seams with other lanes

  • Built on E1's access core (factory: one access core for every organization item (E1, part 1) #2632): workstreamCan from item_access.go. The interim stub is deleted. The operator gets job writes explicitly; through roles the operator only has view, and has nothing on private items.
  • jobWorkstreamID(it) is the one place a job's workstream is resolved (today PolicyGroup ws_*). E2 will extend it with Store.WorkstreamOfJob (explicit membership wins).
  • job.can is unchanged; W5 hides verbs per my_role.

Proof

make pr-ready BASE=origin/work/teams: green, every selected test passed first run.

internal/factory/serve/job_access_test.go, on the org scene (santosh, abir, mia; Platform/Growth/Design) with each person signed in by token:

  • abir 403 stopping/steering/re-prioritising/replying santosh's job outside a workstream; 200 stopping it inside Webhook reliability (shared, edit); santosh undoes that stop.
  • abir cannot see jobs of santosh's private Launch plan: absent from the queue, 404 by id, absent from the record.
  • A profileless token sees no workstream job and cannot stop santosh's job.
  • abir with a view share sees santosh's job and gets 403 stopping it; with edit, 200. The operator cannot see a job in santosh's private workstream (absent from queue, 404).
  • Mutation-checked: removing the sight filter or the profileless guard fails these tests.

Not proven against a running codeaf factory serve binary with two real GitHub sign-ins: these tests run the real serve.Handler in-process with a fake GitHub. E0's two-person harness (#2630) is not merged yet.

WAVE2.md §4 is edited in place (outside the repo) with the job-door rule; PROTOCOL.md carries it.

santoshkumarradha and others added 4 commits November 13, 2026 13:42
Job write doors need the job's person, edit on its workstream or the
operator; a job with no person needs edit on its workstream. Undo of a
stop is allowed to the job's person. A job is seen only with repo read
and view on its workstream, across the queue, the job, the record and
the event stream. A sign-in with no profile sees no workstream job and
acts as no one's person.

Assisted-by: CodeAF
Co-Authored-By: CodeAF <[email protected]>
@santoshkumarradha
santoshkumarradha merged commit da27602 into work/teams Nov 13, 2026
1 check passed
@santoshkumarradha
santoshkumarradha deleted the w2/e5-factory-acl branch November 13, 2026 18:48
ZeroPoint95 pushed a commit that referenced this pull request Nov 24, 2026
Job write doors need the job person, edit on its workstream or the operator; sight needs repo read and view on its workstream; a profileless sign-in sees no workstream job.

Assisted-by: CodeAF
Co-Authored-By: CodeAF <[email protected]>
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