interplane.Get Omega
Read in your language

omega-mv

Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.

Brought by drakestapleton

branch main Branches Tags History

omega-mv / protocol / synapse / board / src / 20-emit.om

529 lines · 11113 bytes Raw Blame History
1note synapse-board src/20-emit.om -- BOARD.md (w 0) and index.html (w 1) from the indexed inputs.
2note Every input byte goes through sbesc (Markdown or HTML escaping); links only for safe http(s) URLs.
3text h1md "# AIEN coordination board\n\n> Generated file. Do not edit. Agents write through synapse-claims; this page is rebuilt from the claims ledger, the repo map and pulse findings.\n\n"
4text h1ht "<!doctype html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\">\n<meta http-equiv=\"Content-Security-Policy\" content=\"default-src 'none'; style-src 'unsafe-inline'\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<title>AIEN coordination board</title>\n<style>\nbody{font:14px/1.45 system-ui,sans-serif;margin:1.5em auto;max-width:72em;padding:0 1em;color:#1b1b1b;background:#fff}\ntable{border-collapse:collapse;width:100%;margin:.5em 0 1.5em}\nth,td{border:1px solid #ccc;padding:.25em .45em;text-align:left;vertical-align:top}\nth{background:#f2f2f2}\n.note{background:#fff8d6;border:1px solid #e0d38a;padding:.5em .8em}\n.inf{color:#8a4b00;font-weight:600}\n.lap{color:#a00;font-weight:600}\nul.map{list-style:none;padding-left:0}\n.d1{margin-left:1.5em}.d2{margin-left:3em}.d3{margin-left:4.5em}.d4{margin-left:6em}.d5{margin-left:7.5em}.d6{margin-left:9em}.d7{margin-left:10.5em}.d8{margin-left:12em}.d9{margin-left:13.5em}\n</style>\n</head>\n<body>\n<h1>AIEN coordination board</h1>\n<p class=\"note\">Generated file. Do not edit. Agents write through synapse-claims; this page is rebuilt from the claims ledger, the repo map and pulse findings.</p>\n"
5text tgen1 "Generated by synapse-board from ledger head "
6text tgen2 " at "
7text tunk "unknown"
8text tpmd "_"
9text tpe "_\n\n"
10text tpht "<p><small>"
11text tpht2 "</small></p>\n"
12text s1md "## Summary\n\n"
13text s1ht "<h2>Summary</h2>\n<ul>\n"
14text s1end "</ul>\n"
15text lact "active claims: "
16text llap "active but past expiry (lapsed): "
17text lina "inactive claims (released or expired): "
18text lrep "repos with active claims: "
19text lcnf "conflicts: "
20text lerr "findings, error: "
21text lwrn "findings, warn: "
22text linf "findings, info: "
23text lmap "repos in map: "
24text lpin "INFERRED parents: "
25text mdli "- "
26text htli "<li>"
27text htlie "</li>\n"
28text s2md "\n## Conflicts\n\n"
29text s2ht "<h2>Conflicts</h2>\n"
30text s3md "\n## Pulse findings\n\n"
31text s3ht "<h2>Pulse findings</h2>\n"
32text s4md "\n## Active claims\n\n"
33text s4ht "<h2>Active claims</h2>\n"
34text s5md "\n## Repo map\n\n"
35text s5ht "<h2>Repo map</h2>\n"
36text nonemd "_none_\n"
37text noneht "<p>none</p>\n"
38text c2md "| severity | target | agent | id | other agent | other id | detail |\n|---|---|---|---|---|---|---|\n"
39text c2ht "<table>\n<thead><tr><th>severity</th><th>target</th><th>agent</th><th>id</th><th>other agent</th><th>other id</th><th>detail</th></tr></thead>\n<tbody>\n"
40text c3md "| kind | severity | repo | target | agent | session | pr | path | detail |\n|---|---|---|---|---|---|---|---|---|\n"
41text c3ht "<table>\n<thead><tr><th>kind</th><th>severity</th><th>repo</th><th>target</th><th>agent</th><th>session</th><th>pr</th><th>path</th><th>detail</th></tr></thead>\n<tbody>\n"
42text c4md "| agent | target | mode | state | intent | expires | evidence |\n|---|---|---|---|---|---|---|\n"
43text c4ht "<table>\n<thead><tr><th>agent</th><th>target</th><th>mode</th><th>state</th><th>intent</th><th>expires</th><th>evidence</th></tr></thead>\n<tbody>\n"
44text tbeht "</tbody>\n</table>\n"
45text rsmd "|"
46text rsht "<tr>"
47text remd "\n"
48text reht "</tr>\n"
49text cemd " "
50text cemd2 " |"
51text cht "<td>"
52text chte "</td>"
53text g4md "\n### "
54text g4ht "<h3>"
55text g4hte "</h3>\n"
56text gext "external"
57text gunp "(unparsed)"
58text tlap " LAPSED"
59text tlapht " <span class=\"lap\">LAPSED</span>"
60text tevmd ", "
61text tevht "<br>"
62text taht1 "<a href=\""
63text taht2 "\">"
64text taht3 "</a>"
65text tamd1 "<"
66text tamd2 ">"
67text thttp "http://"
68text thttps "https://"
69text ulmap "<ul class=\"map\">\n"
70text tsp2 " "
71text tli1 "<li class=\"d"
72text tli2 "\">"
73text tbold "**"
74text tb1 "<b>"
75text tb2 "</b>"
76text tinfmd " [INFERRED: "
77text tinfht " <span class=\"inf\">[INFERRED: "
78text tclose "]"
79text tcloseh "]</span>"
80text troot " [ROOT]"
81text tnone " [NONE]"
82text tarch " [archived]"
83text tfork " [fork]"
84text tcyc " [cycle]"
85text tpout " [parent outside map: "
86text tdash " - "
87text tnlmd "\n"
88text tfoot "</body>\n</html>\n"
89note ---- small pieces
90fn sbsum lab view uchar * v ulong to void
91sbraw 0 mdli
92sbraw 1 htli
93sbr2 lab
94sbn2 v
95sbraw 0 tnl
96sbraw 1 htlie
97end
98fn sbrow0 to void
99sbraw 0 rsmd
100sbraw 1 rsht
101end
102fn sbrow1 to void
103sbraw 0 remd
104sbraw 1 reht
105end
106fn sbc0 to void
107sbraw 0 cemd
108sbraw 1 cht
109end
110fn sbc1 to void
111sbraw 0 cemd2
112sbraw 1 chte
113end
114note sbcell: one table cell holding the escaped string value of key
115fn sbcell lb view uchar 65536 tp view uint 16400 sb edit uchar 65536 key view uchar * to void
116sbc0
117n = sbgets lb tp sb key
118if gt n 0
119sbe2 sb ulong n
120end
121sbc1
122end
123fn sbcelln v ulong to void
124sbc0
125if gt v 0
126sbn2 v
127end
128sbc1
129end
130fn sbtblend to void
131sbraw 0 tnl
132sbraw 1 tbeht
133end
134fn sbnone to void
135sbraw 0 nonemd
136sbraw 1 noneht
137end
138note sburlok: http(s) URL whose every byte is in the safe set
139fn sburlok sb view uchar 65536 n ulong to bool
140p = ulong 0
141if and ge n 8 sbpre sb thttps
142p = 8
143end
144if and eq p 0 and ge n 7 sbpre sb thttp
145p = 7
146end
147if or eq p 0 ge p n
148ret false
149end
150for i ulong n
151c = get sb i
152ok = and ge c 97 le c 122
153ok = or ok and ge c 65 le c 90
154ok = or ok and ge c 48 le c 57
155if not ok
156ok = sbsafe c
157end
158if not ok
159ret false
160end
161end
162ret true
163end
164fn sbpre sb view uchar 65536 t view uchar * to bool
165for i ulong len t
166if ne get sb i get t i
167ret false
168end
169end
170ret true
171end
172note sbsafe: URL punctuation allowed in a link - . _ ~ : / ? # [ ] @ ! $ & * + , ; = %
173fn sbsafe c uchar to bool
174if or or or eq c 45 eq c 46 or eq c 95 eq c 126 or or eq c 58 eq c 47 or eq c 63 eq c 35
175ret true
176end
177if or or or eq c 91 eq c 93 or eq c 64 eq c 33 or or eq c 36 eq c 38 or eq c 42 eq c 43
178ret true
179end
180ret or or eq c 44 eq c 59 or eq c 61 eq c 37
181end
182note sblink: one evidence entry: a link when safe, else escaped text
183fn sblink sb view uchar 65536 n ulong to void
184if sburlok sb n
185sbraw 0 tamd1
186sbesc 0 sb n
187sbraw 0 tamd2
188sbraw 1 taht1
189sbesc 1 sb n
190sbraw 1 taht2
191sbesc 1 sb n
192sbraw 1 taht3
193ret
194end
195sbe2 sb n
196end
197fn sbevid lb view uchar 65536 tp view uint 16400 sb edit uchar 65536 to void
198sbc0
199v = sbkey lb tp kev
200if ne v jsnone
201if eq js_type tp v jsarr
202e = js_first tp v
203k = ulong 0
204for it ulong 4096
205if eq e jsnone
206break
207end
208if eq js_type tp e jsstr
209n = js_sget lb js_off tp e sb
210if gt n 0
211if gt k 0
212sbraw 0 tevmd
213sbraw 1 tevht
214end
215sblink sb ulong n
216k = add k 1
217end
218end
219e = js_enext tp e
220end
221end
222end
223sbc1
224end
225note ======== header, generated-by line and summary
226fn sbhead to void
227sbraw 0 h1md
228sbraw 1 h1ht
229sbraw 0 tpmd
230sbraw 1 tpht
231sbr2 tgen1
232n = get gplen 5
233if eq n 0
234sbr2 tunk
235else
236for i ulong n
237sbesc1 0 sbslotc 5 i
238end
239for j ulong n
240sbesc1 1 sbslotc 5 j
241end
242end
243sbr2 tgen2
244m = get gnowl 0
245for k ulong m
246sbesc1 0 get gnow k
247end
248for k2 ulong m
249sbesc1 1 get gnow k2
250end
251sbraw 0 tpe
252sbraw 1 tpht2
253sbraw 0 s1md
254sbraw 1 s1ht
255sbsum lact get gcnt 0
256sbsum llap get gcnt 1
257sbsum lina get gcnt 2
258sbsum lrep get gcnt 3
259sbsum lcnf get gcnt 4
260sbsum lerr get gcnt 5
261sbsum lwrn get gcnt 6
262sbsum linf get gcnt 7
263sbsum lmap get gcnt 8
264sbsum lpin get gcnt 9
265sbraw 1 s1end
266end
267note ======== findings: conflicts (cf true) or the other pulse findings (cf false)
268fn sbfind cf bool to void
269lb = new uchar 65536 0
270tp = new uint 16400 0
271sb = new uchar 65536 0
272if cf
273sbraw 0 s2md
274sbraw 1 s2ht
275if eq get gcnt 4 0
276sbnone
277ret
278end
279sbraw 0 c2md
280sbraw 1 c2ht
281else
282sbraw 0 s3md
283sbraw 1 s3ht
284if eq get gcnt 10 0
285sbnone
286ret
287end
288sbraw 0 c3md
289sbraw 1 c3ht
290end
291tot = get glen 2
292off = ulong 0
293for it ulong SBLINES
294if ge off tot
295break
296end
297n = sbpl 2 off lb tp
298if lt n 0
299break
300end
301if gt n 0
302k = sbgets lb tp sb kkind
303isc = sbeqv sb k vconf
304if eq isc cf
305sbrow0
306if cf
307sbcell lb tp sb ksev
308sbcell lb tp sb ktgt
309sbcell lb tp sb kagent
310sbcell lb tp sb kid
311sbcell lb tp sb koag
312sbcell lb tp sb koid
313sbcell lb tp sb kdet
314else
315sbcell lb tp sb kkind
316sbcell lb tp sb ksev
317sbcell lb tp sb krepo
318sbcell lb tp sb ktgt
319sbcell lb tp sb kagent
320sbcell lb tp sb ksess
321sbcelln sbgetu lb tp kpr
322sbcell lb tp sb kpath
323sbcell lb tp sb kdet
324end
325sbrow1
326end
327end
328off = add add off ulong n 1
329end
330sbtblend
331end
332note ======== active claims grouped by repo key
333fn sbgroup c ulong to void
334sbraw 0 g4md
335sbraw 1 g4ht
336r = get gkrk c
337if eq r 1
338sbr2 gext
339end
340if eq r 2
341sbr2 gunp
342end
343if eq r 0
344o = get gkoff c
345for i ulong get gkln c
346sbesc1 0 get gpool add o i
347end
348for j ulong get gkln c
349sbesc1 1 get gpool add o j
350end
351end
352sbraw 0 tnl
353sbraw 1 g4hte
354sbraw 0 tnl
355sbraw 0 c4md
356sbraw 1 c4ht
357end
358fn sbclaims to void
359lb = new uchar 65536 0
360tp = new uint 16400 0
361sb = new uchar 65536 0
362sbraw 0 s4md
363sbraw 1 s4ht
364nc = get gnc 0
365if eq nc 0
366sbnone
367ret
368end
369for i ulong nc
370c = get gord i
371if eq i 0
372sbgroup c
373else
374if not sbkeyeq get gord sub i 1 c
375sbraw 1 tbeht
376sbgroup c
377end
378end
379n = sbpl 0 get gcoff c lb tp
380sbrow0
381sbcell lb tp sb kagent
382sbcell lb tp sb ktgt
383sbcell lb tp sb kmode
384sbcell lb tp sb kstate
385sbcell lb tp sb kint
386sbc0
387e = sbgets lb tp sb kexp
388if gt e 0
389sbe2 sb ulong e
390end
391if eq get glap c 1
392sbraw 0 tlap
393sbraw 1 tlapht
394end
395sbc1
396sbevid lb tp sb
397sbrow1
398end
399sbraw 1 tbeht
400end
401note ======== repo map tree (iterative depth-first, file order among siblings)
402fn sbname w ulong m ulong to void
403o = get gmno m
404for j ulong get gmnl m
405sbesc1 w get gpool add o j
406end
407end
408fn sbnode m ulong d ulong cyc bool to void
409lb = new uchar 65536 0
410tp = new uint 16400 0
411sb = new uchar 65536 0
412put gmvis m 1
413n = sbpl 1 get gmoff m lb tp
414for i ulong d
415sbraw 0 tsp2
416end
417sbraw 0 mdli
418sbraw 0 tbold
419sbraw 1 tli1
420dd = d
421if gt dd 9
422dd = 9
423end
424sbnum 1 dd
425sbraw 1 tli2
426sbraw 1 tb1
427sbname 0 m
428sbname 1 m
429sbraw 0 tbold
430sbraw 1 tb2
431st = get gmst m
432if eq st 1
433sbraw 0 tinfmd
434sbraw 1 tinfht
435sbfld 0 lb tp sb krule
436sbfld 1 lb tp sb krule
437sbraw 0 tclose
438sbraw 1 tcloseh
439end
440if eq st 2
441sbr2 troot
442end
443if eq st 3
444sbr2 tnone
445end
446if gt get gmpl m 0
447if eq get gmpar m jsnone
448sbr2 tpout
449sbfld 0 lb tp sb kpar
450sbfld 1 lb tp sb kpar
451sbr2 tclose
452end
453end
454if sbgetb lb tp karch
455sbr2 tarch
456end
457if sbgetb lb tp kfork
458sbr2 tfork
459end
460if cyc
461sbr2 tcyc
462end
463k = sbgets lb tp sb kpurp
464if gt k 0
465sbr2 tdash
466sbe2 sb ulong k
467end
468sbraw 0 tnl
469sbraw 1 htlie
470end
471note sbtree: print root r and its descendants; nodes already printed are skipped (cycle guard)
472fn sbtree r ulong cyc bool to void
473nm = get gnm 0
474put gstk 0 r
475put gsdp 0 0
476sp = ulong 1
477for it ulong 999999
478if eq sp 0
479ret
480end
481sp = sub sp 1
482m = get gstk sp
483d = get gsdp sp
484if eq get gmvis m 0
485sbnode m d and cyc eq it 0
486for i ulong nm
487c = sub sub nm 1 i
488if eq get gmpar c m
489if eq get gmvis c 0
490if lt sp SBMAXM
491put gstk sp c
492put gsdp sp add d 1
493sp = add sp 1
494end
495end
496end
497end
498end
499end
500end
501fn sbmap to void
502sbraw 0 s5md
503sbraw 1 s5ht
504nm = get gnm 0
505if eq nm 0
506sbnone
507ret
508end
509sbraw 1 ulmap
510for i ulong nm
511if eq get gmpar i jsnone
512sbtree i false
513end
514end
515for j ulong nm
516if eq get gmvis j 0
517sbtree j true
518end
519end
520sbraw 1 s1end
521end
522fn sbemit to void
523sbhead
524sbfind true
525sbfind false
526sbclaims
527sbmap
528sbraw 1 tfoot
529end