Repository navigation
factory: a workstream's parts live on the organization server (SQLite, per-page revs, versions) - #2639
Merged
Conversation
santoshkumarradha
force-pushed
the
w2/e2-parts
branch
2 times, most recently
from
November 13, 2026 19:55
15cfaa0 to
0ff3596
Compare
Member
Author
|
Gate on head 0ff3596 (rebased on #2637 E1 part 2, #2636 E7, #2635 E3a, #2634 E5):
|
…the JSON once factory-workstreams.db keeps one row per workstream, one per page version, the plan/wakes/suggestions parts and posted spend. The old JSON document is copied in on first use and renamed aside. Pages carry a rev; workstreams carry jobs and a budget. Assisted-by: CodeAF Co-Authored-By: CodeAF <[email protected]>
…on server Pages are added, renamed, moved and deleted one at a time under their own rev; versions are saved by clients and restored as a new version by the restorer; the plan, wakes and suggestions keep their own revs and the server's authors; jobs are membership on the server, one workstream each; unarchive works; a budget is set and spend posted by the caller; a dropped decision stays as superseded. Every change says its part, id, author and rev. Assisted-by: CodeAF Co-Authored-By: CodeAF <[email protected]>
Assisted-by: CodeAF Co-Authored-By: CodeAF <[email protected]>
…e organization 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]>
…on who made it Assisted-by: CodeAF Co-Authored-By: CodeAF <[email protected]>
Assisted-by: CodeAF Co-Authored-By: CodeAF <[email protected]>
…es full, as archive does Assisted-by: CodeAF Co-Authored-By: CodeAF <[email protected]>
santoshkumarradha
force-pushed
the
w2/e2-parts
branch
from
November 13, 2026 20:38
0ff3596 to
8474ab7
Compare
ZeroPoint95
pushed a commit
that referenced
this pull request
Nov 24, 2026
…e, per-page revs, versions (E2) (#2639) Storage moves to factory-workstreams.db (migrated from the JSON once). Pages one at a time under their own rev, client-saved versions and restore, plan/wakes/suggestions, job membership (now deciding who reaches a job), unarchive, budget and spend, supersede-not-delete, part-level events and activity, and a factory.org_workstream_<part> engine method per route. 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 E2 — workstream parts on the server (WAVE2.md §3 "E2", as amended by §4.4: page bodies are E7's Yjs docs, so no per-page body PATCH or drafts here).
What changes
factory-workstreams.dbreplaces the one JSON document: one row per workstream, one per page version, plus parts (plan/wakes/suggestions) and posted spend. A save writes only the rows it changed, in one transaction, under the same cross-process lock. The oldfactory-workstreams.jsonis migrated once on first use and renamed.json.migrated.Store.Workstreams/Workstream/EditWorkstreamskeep their signatures (E1'sFoldSharesruns on every read).rev: create / rename / re-kind / move (index,parent) / delete (children move up; versions dropped; E7'sdropDoccalled when present). Two people changing two different pages both succeed; the same page from a stale read is 412.body_mdmirror without moving any rev.PUT|DELETE /jobs/{job}), one workstream per job; E5'sjobWorkstreamIDnow reads membership first (fail-closed if the store cannot answer).superseded.part,part_id,by,rev,deleted, relayed infactory.org_changed.org_workstream_partsand onefactory.org_workstream_<part>method per route (spend's method is W8's, by agreement).Seams with other lanes
wsViewer/canWrite/audienceOf; aviewshare reads parts and changes none (tested).jobWorkstreamIDextended as agreed;jobSightreads membership once per request./v1/docs/*; versions/restore here, coordinated (client posts doc snapshot then version on 30 s idle).publishWorkstreamPartis separate frompublishWorkstreams; I'll addrecordWorkstreamcalls when factory: who is in an organization item, and who changed it (E3a) #2635 lands.Proof
make pr-ready BASE=origin/work/teams: build, vet, laws, manual, packed corpora green; touchedappwire,factory,factory/api,factory/serve,factory/storegreen. Twoservetests failed once under box load and passed on retry (classifier: flaky) —TestPeopleCardAndQueueUseFakeForgeAndVisibleJobs(a timed CODEOWNERS fetch) andTestFactorySetupDoubleContinueEndsReadingOnce; both pass 20/20 on this branch and on base. Thecmd/codeafleg: see comment below.serve.Handler: different pages concurrently both 200, same page 412; versions nameby, restore by mia is version 3restored_from:1; plan/wake revs; a job added by santosh shows in abir's workstream and leaves the other one; membership hides a job in santosh's private workstream from abir; view share = read-only; unarchive; budget; spend once per key; supersede.bin/codeaf factory serveon a root holding the old JSON → migrated (rev 5 kept, file renamed aside), then every route driven with curl.WAVE2.md §4 is edited in place (outside the repo) — new section "E2 as built"; PROTOCOL.md carries the methods and event fields.