interplane.Get Omega
Read in your language

interplane-forge

INTERPLANE Forge

Brought by drakestapleton

branch main Branches Tags History

interplane-forge / door / ev3col.om

1029 lines · 18246 bytes Raw Blame History
1note door/ev3col.om: one collection pass. Change-triggered: each source is read only when its
2note fingerprint moved since the last pass of this process (a start reads every repository once and
3note finds nothing new: the snapshots in <data>events/r/ and the keys of the log say what was seen).
4note social log its size; the new bytes are read with social's own line parser (stars, follows)
5note open shelf <data>open/list.tsv, its change time and size (brought, withdrawn)
6note repository i the change times of refs/heads, refs/tags, packed-refs, refs/namespaces, refs/rad
7note and every refs/namespaces/<nid>/refs/rad (Radicle renames sigrefs into it at
8note every ref update of that node, COB changes included); then one for-each-ref of
9note the default branch, the tags and the patch and issue COB refs, compared line by
10note line with the snapshot; only COBs whose tip moved are loaded (collab coload)
11text tevfh1 "<section class=\"box\"><h1>Feed</h1>\n<p class=\"muted\">What happened on this forge, newest first: changes proposed, reviewed and merged, issues, releases, new commits on default branches, stars, follows and the open builds shelf. Only public repositories. Agents read the same list as <a href=\""
12const EVNO ulong 99999999
13fn evcollect to void
14if eq get gevok 0 0
15evload
16end
17if ne get gevok 0 1
18ret
19end
20t0 = monons
21put gevpr 0 0
22put gevpe 0 0
23put gevbn 0 0
24put gevbatl 0 0
25evsocial
26evopen
27for i ulong get fan 0 bound FAMAX
28evrepochk i
29end
30if gt get gevbn 0 0
31evflush
32end
33note a COB read past a buffer marks the response cut (fincut); collection is not the response
34put ficut 0 0
35put fobtr 0 0
36put fobl 0 0
37if gt get gevpr 0 0
38dt = div ulong sub monons t0 1000
39evgb
40evgt tevlpas
41evgn dt
42evgt tevlpus
43evgn get gevpr 0
44evgt tevlpev
45evgn get gevpe 0
46evgout
47end
48end
49note ---- the social log (social/30store.om writes it; soload has verified it)
50fn evsocial to void
51if eq get gsok 0 0
52ret
53end
54sopdd
55sopt tslog
56fpb
57for i ulong get gspthl 0 bound 1024
58fpc get gspth i
59end
60if eq evstat 0
61ret
62end
63sz = evst64 48
64off = get gevsoff 0
65if eq sz off
66ret
67end
68if lt sz off
69off = ulong 0
70end
71fd = fopen fpth 0 get fpthl 0 524288 0
72if lt fd 0
73ret
74end
75put gevpr 0 add get gevpr 0 1
76for it ulong 100000
77r = pread int fd gevrb 0 len gevrb long off
78if le r 0
79break
80end
81u = evsocscan ulong r
82if eq u 0
83break
84end
85off = add off u
86end
87x = fclose int fd
88put gevsoff 0 off
89end
90fn evsocscan n ulong to ulong
91ln = new uchar 1024 0
92p = ulong 0
93for it ulong 2097152
94e = evrbeol p n
95if ge e n
96break
97end
98l = sub e p
99if lt l 1024
100for i ulong l bound 1024
101put ln i get gevrb add p i
102end
103evsocln part ln 0 l
104end
105p = add e 1
106end
107ret p
108end
109fn evrbeol p ulong n ulong to ulong
110e = p
111for k ulong 2097152
112if ge e n
113ret n
114end
115if eq get gevrb e 10
116ret e
117end
118e = add e 1
119end
120ret n
121end
122note evsocln: one social line; only star (1) and follow (7) are events. fav, unfav, watch, unwatch,
123note unstar, unfollow, account, name, session and logout are never read past their action word.
124fn evsocln ln view uchar * to void
125put gspc 0 0
126put gsbad 0 0
127solit ln tsl1
128seq = sonum ln
129solit ln tsl2
130ts = sonum ln
131solit ln tsl3
132sokclr
133sokt tsdidp
134dl = sostr ln
135evclr
136for i ulong get gskbl 0 bound 128
137evactc get gskb i
138end
139solit ln tsl4
140a = soact ln
141solit ln tsl5
142sokclr
143tl = sostr ln
144if ne get gsbad 0 0
145ret
146end
147put gevt 0 ts
148evsrct tevsocs
149evsrcnum seq
150if eq a 1
151evsstar
152end
153if eq a 7
154evsfoll
155end
156end
157note evsstar: gskb holds rad:<rid>; an event only for a repository that is public now
158fn evsstar to void
159if not sokpre tsradp
160ret
161end
162for i ulong sub get gskbl 0 len tsradp bound 64
163evridc get gskb add len tsradp i
164end
165r = evridpub
166if eq r 9999
167ret
168end
169put gevk 0 11
170evpthrepo r
171evjsame
172evjst tevjsx
173for k ulong frnlen r bound 128
174evsubc frnbyte r k
175end
176evemit
177end
178note evsfoll: gskb holds the followed account's did:key; its page is found when the stream is read
179fn evsfoll to void
180if not sokpre tsdidp
181ret
182end
183put gevk 0 12
184for i ulong get gskbl 0 bound 128
185evxc get gskb i
186evsubc get gskb i
187end
188evemit
189end
190note ---- the open shelf: <data>open/list.tsv (rid, state, did, date, size, name, ...), as the intake wrote it
191fn evopen to void
192evpath tevlist
193fp = evstat
194if eq fp get gevofp 0
195ret
196end
197put gevofp 0 fp
198if eq fp 0
199ret
200end
201r = frdall
202if or lt r 0 ne get fxotr 0 0
203ret
204end
205put gevpr 0 add get gevpr 0 1
206n = get fxol 0
207p = ulong 0
208for it ulong 16777216
209if ge p n
210break
211end
212e = p
213for k ulong 16777216
214if ge e n
215break
216end
217if eq get fxo e 10
218break
219end
220e = add e 1
221end
222evopnln p e
223p = add e 1
224end
225end
226fn evfxeq a ulong e ulong t view uchar * to bool
227if ne sub e a len t
228ret false
229end
230for i ulong len t bound 64
231if ne get fxo add a i get t i
232ret false
233end
234end
235ret true
236end
237note evopnln a e: one shelf row; held or stored is "brought", withdrawn is "withdrawn". Time: the row's
238note date at 00:00 UTC (the list keeps the day only). A denied RID (server/repos.om fdeny) is never named.
239fn evopnln a ulong e ulong to void
240tb = new ulong 8 0
241k = ulong 0
242for i ulong sub e a bound 16777216
243if eq get fxo add a i 9
244if lt k 8
245put tb k add a i
246k = add k 1
247end
248end
249end
250if lt k 6
251ret
252end
253evopn2 tb a
254end
255fn evopnkd tb view ulong * to ulong
256s = add get tb 0 1
257e = get tb 1
258if or evfxeq s e tevheld evfxeq s e tevstor
259ret 13
260end
261if evfxeq s e tevwdr
262ret 14
263end
264ret 0
265end
266fn evopn2 tb view ulong * a ulong to void
267kd = evopnkd tb
268if eq kd 0
269ret
270end
271if or eq get tb 0 a gt sub get tb 0 a 64
272ret
273end
274if evfxeq a get tb 0 tfdnr1
275ret
276end
277d = add get tb 2 1
278if ne sub get tb 3 d 10
279ret
280end
281t = evdate d
282if eq t 0
283ret
284end
285evclr
286put gevk 0 kd
287put gevt 0 t
288evopnf a get tb 0 add get tb 1 1 get tb 2 d
289evopnnm add get tb 4 1 get tb 5
290evemit
291end
292fn evopnnm a ulong e ulong to void
293for i ulong sub e a bound 4096
294c = get fxo add a i
295evxc c
296evsubc c
297end
298end
299note evopnf: rid fxo[a, ra), actor fxo[da, de) when it is a did:key, source, path and json
300fn evopnf a ulong ra ulong da ulong de ulong d ulong to void
301for i ulong sub ra a bound 64
302evridc get fxo add a i
303end
304if evfxpre da de tevdidk
305for i ulong sub de da bound 128
306evactc get fxo add da i
307end
308end
309evsrct tevopns
310for i ulong sub ra a bound 64
311evsrcc get fxo add a i
312end
313evsrcc 64
314for i ulong 10
315evsrcc get fxo add d i
316end
317evptht tevopnp
318if eq get gevk 0 13
319for i ulong sub ra a bound 64
320evpthc get fxo add a i
321end
322evjsame
323evjst tevjsx
324else
325evjst tevopnj
326end
327end
328fn evfxpre a ulong e ulong t view uchar * to bool
329if lt sub e a len t
330ret false
331end
332for i ulong len t bound 64
333if ne get fxo add a i get t i
334ret false
335end
336end
337ret true
338end
339note evdate p: fxo[p, p+10) = YYYY-MM-DD as epoch seconds at 00:00 UTC; 0 when it is not a date
340fn evdate p ulong to ulong
341for i ulong 10
342c = get fxo add p i
343if or eq i 4 eq i 7
344if ne c 45
345ret 0
346end
347else
348if not evdig c
349ret 0
350end
351end
352end
353y = evdn add p 0 4
354m = evdn add p 5 2
355d = evdn add p 8 2
356if or or lt y 1970 lt m 1 or gt m 12 or lt d 1 gt d 31
357ret 0
358end
359ret mul evdays y m d 86400
360end
361note evdays y m d: days since 1970-01-01 of a civil date (proleptic Gregorian, y >= 1970)
362fn evdays y0 ulong m ulong d ulong to ulong
363y = y0
364if le m 2
365y = sub y 1
366end
367era = div y 400
368yoe = sub y mul era 400
369mp = add m 9
370if gt m 2
371mp = sub m 3
372end
373doy = add div add mul 153 mp 2 5 sub d 1
374a = add mul yoe 365 div yoe 4
375doe = add sub a div yoe 100 doy
376ret sub add mul era 146097 doe 719468
377end
378fn evdn p ulong n ulong to ulong
379v = ulong 0
380for i ulong n bound 4
381v = add mul v 10 ulong sub get fxo add p i 48
382end
383ret v
384end
385note ---- repositories
386note evstp: fpth = <storage><rid of repo i><t>
387fn evstp i ulong t view uchar * to void
388fpb
389fpt tfstore
390for k ulong fridlen i bound 64
391fpc fridbyte i k
392end
393fpt t
394end
395fn evrepochk i ulong to void
396h = ulong 14695981039346656037
397for k ulong fridlen i bound 64
398h = evfnv h fridbyte i k
399end
400evstp i tevsrh
401h = add h evstat
402evstp i tevsrt
403h = add h mul evstat 3
404evstp i tevspk
405h = add h mul evstat 5
406evstp i tevsns
407h = add h mul evstat 7
408evstp i tevsrad
409h = add h mul evstat 11
410h = add h evnsfp i
411if eq h get gevfp i
412ret
413end
414if evrepo i
415put gevfp i h
416end
417end
418note evnsfp i: the sum of the fingerprints of refs/namespaces/<nid>/refs/rad, one per node
419fn evnsfp i ulong to ulong
420evstp i tevsns
421fd = fopen fpth 0 get fpthl 0 540672 0
422if lt fd 0
423ret 0
424end
425s = ulong 0
426for it ulong 4096
427n = getdnts int fd gevde 0 len gevde
428if le n 0
429break
430end
431s = add s evnsdir i ulong n
432end
433x = fclose int fd
434ret s
435end
436fn evnsdir i ulong n ulong to ulong
437s = ulong 0
438p = ulong 0
439for it ulong 16384
440if ge add p 19 n
441break
442end
443rl = or ulong get gevde add p 16 shl ulong get gevde add p 17 8
444if eq rl 0
445break
446end
447s = add s evnsent i p
448p = add p rl
449end
450ret s
451end
452note evnsent i p: a node folder (d_type 4, not dot-named) at gevde[p]: its refs/rad fingerprint, else 0
453fn evnsent i ulong p ulong to ulong
454if ne get gevde add p 18 4
455ret 0
456end
457if eq get gevde add p 19 46
458ret 0
459end
460evstp i tevsns
461fpc 47
462for k ulong 255
463c = get gevde add add p 19 k
464if eq c 0
465break
466end
467fpc c
468end
469fpt tevsrad
470ret mul evstat 13
471end
472note evsetrepo i: the request globals collab reads (fridx, frid, frepo) name repository i
473fn evsetrepo i ulong to void
474put fridx 0 i
475for k ulong fridlen i bound 64
476put frid k fridbyte i k
477end
478put fridl 0 fridlen i
479for k ulong frnlen i bound 128
480put frepo k frnbyte i k
481end
482put frepol 0 frnlen i
483end
484fn evunset to void
485put fridx 0 9999
486put fridl 0 0
487put frepol 0 0
488end
489note evsnapp i: fpth = <data>events/r/<rid of i>
490fn evsnapp i ulong to void
491evpath tevrp
492for k ulong fridlen i bound 64
493fpc fridbyte i k
494end
495end
496note evrepo i: read repository i; false when git did not answer (the next pass tries again)
497fn evrepo i ulong to bool
498evsetrepo i
499fkgiti i
500fka tevfer
501fka tevfmt
502fkopen
503fkt tevrh
504for k ulong get fabl i bound 64
505fkc get fabr add get fabo i k
506end
507fka tevrt
508fkopen
509fkt tevns
510fkt tfnid
511fkt tevnst
512fka tevcpg
513fka tevcig
514x = fexec 10000000000
515if ne x 0
516evunset
517ret false
518end
519put gevpr 0 add get gevpr 0 1
520if or ne get fxotr 0 0 gt get fxol 0 len gevnew
521evgb
522evgt tevlcut
523for k ulong fridlen i bound 64
524evgc fridbyte i k
525end
526evgout
527evunset
528ret true
529end
530n = get fxol 0
531for k ulong n bound 4194304
532put gevnew k get fxo k
533end
534put gevnewl 0 n
535first = evoldld i
536put gevcn 0 0
537p = ulong 0
538for it ulong 4194304
539if ge p n
540break
541end
542e = p
543for k ulong 4194304
544if ge e n
545break
546end
547if eq get gevnew e 10
548break
549end
550e = add e 1
551end
552evrefln i p e first
553p = add e 1
554end
555evcobs i 1
556evcobs i 2
557evsnapw i
558evunset
559ret true
560end
561note evoldld i: the snapshot of the last read into gevold; true when there is none (first sight)
562fn evoldld i ulong to bool
563put gevoldl 0 0
564evsnapp i
565r = frdall
566if lt r 0
567ret true
568end
569if or ne get fxotr 0 0 gt get fxol 0 len gevold
570ret true
571end
572n = get fxol 0
573for k ulong n bound 4194304
574put gevold k get fxo k
575end
576put gevoldl 0 n
577ret false
578end
579note evsnapw i: gevnew becomes the snapshot (written to .tmp, then renamed over it)
580fn evsnapw i ulong to void
581evsnapp i
582fpt tevtmp
583fd = fopen fpth 0 get fpthl 0 524865 384
584if lt fd 0
585ret
586end
587n = get gevnewl 0
588off = ulong 0
589for it ulong 4096
590if ge off n
591break
592end
593w = write int fd gevnew off sub n off
594if le w 0
595break
596end
597off = add off ulong w
598end
599x = fsync int fd
600y = fclose int fd
601if ne off n
602ret
603end
604pk = new uchar 8200 0
605put pk 0 2
606o = evpkadd pk 2
607evsnapp i
608o = evpkadd pk o
609r = renames pk 0 o 0
610end
611fn evpkadd pk edit uchar * o ulong to ulong
612n = get fpthl 0
613put pk o uchar and n 255
614put pk add o 1 uchar shr n 8
615for k ulong n bound 4096
616put pk add add o 2 k get fpth k
617end
618ret add add o 2 n
619end
620note ---- one ref line of gevnew: "<sha> <time> <refname>"
621fn evrefln i ulong a ulong e ulong first bool to void
622if lt sub e a 44
623ret
624end
625if ne get gevnew add a 40 32
626ret
627end
628r = add a 41
629t = ulong 0
630for k ulong 20
631if ge r e
632ret
633end
634c = get gevnew r
635r = add r 1
636if eq c 32
637break
638end
639if not evdig c
640ret
641end
642t = add mul t 10 ulong sub c 48
643end
644o = ulong EVNO
645if not first
646o = evoldsha r e
647end
648if ne o EVNO
649if evsame o a
650ret
651end
652end
653evrefcls i a e r t o
654end
655fn evsame o ulong a ulong to bool
656for k ulong 40
657if ne get gevold add o k get gevnew add a k
658ret false
659end
660end
661ret true
662end
663note evrefcls: classify the moved ref (the default branch, a tag, a patch or issue COB)
664fn evrefcls i ulong a ulong e ulong r ulong t ulong o ulong to void
665if evnat r e tevrh
666if evnbr i add r len tevrh e
667if ne o EVNO
668evbranch i o a t
669end
670ret
671end
672end
673if evnat r e tevrtp
674evtag i a t add r len tevrtp e
675ret
676end
677if evnat r e tevns
678q = add r len tevns
679if evnat q e tfnid
680q2 = add q len tfnid
681if evnat q2 e tevnstp
682evtag i a t add q2 len tevnstp e
683ret
684end
685end
686end
687if lt sub e r add len tevcpm 40
688ret
689end
690m = sub sub e 40 len tevcpm
691if evnat m e tevcpm
692evaddcob sub e 40 1
693ret
694end
695m2 = sub sub e 40 len tevcim
696if evnat m2 e tevcim
697evaddcob sub e 40 2
698end
699end
700note evnat p e t: gevnew[p, e) starts with t
701fn evnat p ulong e ulong t view uchar * to bool
702if lt sub e p len t
703ret false
704end
705for k ulong len t bound 128
706if ne get gevnew add p k get t k
707ret false
708end
709end
710ret true
711end
712note evnbr i p e: gevnew[p, e) is exactly the default branch of repository i
713fn evnbr i ulong p ulong e ulong to bool
714if ne sub e p get fabl i
715ret false
716end
717o = get fabo i
718for k ulong get fabl i bound 64
719if ne get gevnew add p k get fabr add o k
720ret false
721end
722end
723ret true
724end
725note evoldsha r e: the offset of the sha of the gevold line whose refname equals gevnew[r, e), else EVNO
726fn evoldsha r ulong e ulong to ulong
727n = get gevoldl 0
728l = sub e r
729p = ulong 0
730for it ulong 4194304
731if ge p n
732break
733end
734q = p
735for k ulong 4194304
736if ge q n
737break
738end
739if eq get gevold q 10
740break
741end
742q = add q 1
743end
744s = evoldref p q
745if ne s EVNO
746if eq sub q s l
747if evrefeq s r l
748ret p
749end
750end
751end
752p = add q 1
753end
754ret EVNO
755end
756note evoldref p q: start of the refname of the gevold line [p, q) (after the second space), else EVNO
757fn evoldref p ulong q ulong to ulong
758if lt sub q p 44
759ret EVNO
760end
761s = add p 41
762for k ulong 21
763if ge s q
764ret EVNO
765end
766if eq get gevold s 32
767ret add s 1
768end
769s = add s 1
770end
771ret EVNO
772end
773fn evrefeq s ulong r ulong l ulong to bool
774for k ulong l bound 4096
775if ne get gevold add s k get gevnew add r k
776ret false
777end
778end
779ret true
780end
781note evaddcob p kd: the COB id gevnew[p, p+40) of kind kd moved (each id once)
782fn evaddcob p ulong kd ulong to void
783for k ulong 40
784if not evhexd get gevnew add p k
785ret
786end
787end
788n = get gevcn 0
789for j ulong n bound 4096
790if evcideq j p
791ret
792end
793end
794if ge n 4096
795ret
796end
797for k ulong 40
798put gevcid add mul n 40 k get gevnew add p k
799end
800put gevckd n kd
801put gevcn 0 add n 1
802end
803fn evcideq j ulong p ulong to bool
804o = mul j 40
805for k ulong 40
806if ne get gevcid add o k get gevnew add p k
807ret false
808end
809end
810ret true
811end
812note ---- events of one repository
813fn evtag i ulong a ulong t ulong s ulong e ulong to void
814evclr
815put gevk 0 9
816put gevt 0 t
817evowndid
818evridi i
819for k ulong 40
820evsrcc get gevnew add a k
821end
822evpthrepo i
823evptht tevrelp
824for k ulong sub e s bound 1024
825c = get gevnew add s k
826evpthc c
827evsubc c
828end
829evjsame
830evemit
831end
832fn evbranch i ulong o ulong a ulong t ulong to void
833fkgiti i
834fka tevrl
835fka tevcnt
836fkopen
837for k ulong 40
838fkc get gevold add o k
839end
840fkt tevdots
841for k ulong 40
842fkc get gevnew add a k
843end
844x = fexec 10000000000
845known = false
846cnt = ulong 0
847if eq x 0
848for k ulong get fxol 0 bound 21
849c = get fxo k
850if not evdig c
851break
852end
853cnt = add mul cnt 10 ulong sub c 48
854known = true
855end
856end
857evclr
858put gevk 0 10
859put gevt 0 t
860evowndid
861evridi i
862for k ulong 40
863evsrcc get gevnew add a k
864evxc get gevold add o k
865end
866evxc 32
867evpthrepo i
868evptht tevcmpp
869for k ulong 40
870evpthr get gevold add o k
871end
872evptht tevtdot
873for k ulong 40
874evpthr get gevnew add a k
875end
876evjsame
877evbrsub i known cnt
878evemit
879end
880note evbrsub: "<n> new commit(s) on <branch>", or "<branch> moved" when the count is not known
881fn evbrsub i ulong known bool cnt ulong to void
882o = get fabo i
883if not known
884evxc 45
885for k ulong get fabl i bound 64
886evsubc get fabr add o k
887end
888evsubt tevmovd
889ret
890end
891d = new uchar 24 0
892n = evdec cnt d
893for k ulong n bound 24
894evxc get d k
895evsubc get d k
896end
897evsubt tevncom
898if ne cnt 1
899evsubt tevncs
900end
901evsubt tevon
902for k ulong get fabl i bound 64
903evsubc get fabr add o k
904end
905end
906note ---- COBs: the moved ids of kind kd are loaded with collab's corefs / coload
907fn evcobs i ulong kd ulong to void
908any = false
909for j ulong get gevcn 0 bound 4096
910if eq get gevckd j kd
911any = true
912end
913end
914if not any
915ret
916end
917if not corefs kd
918ret
919end
920for j ulong get gevcn 0 bound 4096
921if eq get gevckd j kd
922for k ulong 40
923put gcid k get gevcid add mul j 40 k
924end
925ok = false
926if coload kd
927if eq get gcov 0 0
928ok = true
929end
930end
931if ok
932evcob i kd
933else
934evgb
935evgt tevlcob
936for k ulong 40
937evgc get gcid k
938end
939evgout
940end
941end
942end
943end
944note evcob i kd: the events of the loaded COB (collab's model: changes, revisions, merges, reviews,
945note comments, lifecycle). One event per kind and change; the opening is keyed by the COB id.
946fn evcob i ulong kd ulong to void
947if eq kd 1
948evchg i kd 1 0 true 0
949for r ulong get gcrn 0 bound 64
950if gt r 0
951evchg i kd 2 get gcrt r false 0
952end
953end
954for m ulong get gcmn 0 bound 16
955evchg i kd 3 get gcmt m false 0
956end
957for w ulong get gcwn 0 bound 64
958evchg i kd 5 get gcwt w false get gcwv w
959end
960if eq get gcm 2 2
961evchg i kd 4 get gclfc 0 false 0
962end
963else
964evchg i kd 7 0 true 0
965if eq get gcm 2 2
966evchg i kd 8 get gclfc 0 false 0
967end
968end
969for q ulong get gcqn 0 bound 8192
970if and eq get gcqx q 0 ne get gcqt q 0
971evchg i kd 6 get gcqt q false 0
972end
973end
974end
975fn evchg i ulong kd ulong kind ulong ci ulong root bool vd ulong to void
976if ge ci get gccn 0
977ret
978end
979evchgh kind ci
980evridi i
981evchgs ci root
982if eq vd 1
983evxt tevvacc
984end
985if eq vd 2
986evxt tevvrej
987end
988evchgp i kd
989evemit
990end
991note evchgh kind ci: kind, the change's author time and its author (did:key of the NID that signed it)
992fn evchgh kind ulong ci ulong to void
993evclr
994put gevk 0 kind
995put gevt 0 get gccts ci
996evactt tevdidk
997o = mul ci 64
998for k ulong get gccal ci bound 64
999evactc get gccau add o k
1000end
1001end
1002note evchgs ci root: the source: the COB id for its opening, else the change commit
1003fn evchgs ci ulong root bool to void
1004o = mul ci 40
1005for k ulong 40
1006if root
1007evsrcc get gcid k
1008else
1009evsrcc get gcch add o k
1010end
1011end
1012end
1013note evchgp i kd: path and json <owner>/<repo>/patches|issues/<id>, and the title as the subject
1014fn evchgp i ulong kd ulong to void
1015evpthrepo i
1016if eq kd 1
1017evptht tevpatp
1018else
1019evptht tevissp
1020end
1021for k ulong 40
1022evpthr get gcid k
1023end
1024evjsame
1025o = get gcm 0
1026for k ulong get gcm 1 bound 400
1027evsubc get gcpool add o k
1028end
1029end