clay: add +promote-ford

This commit is contained in:
Philip Monk 2020-04-15 16:24:48 -07:00
parent 0c2eddd39f
commit d04191320a
No known key found for this signature in database
GPG Key ID: B66E1F02604E44EC
3 changed files with 60 additions and 10 deletions

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:297cc4a1c8cce6b7e7313e3665a24f425e9a150cd597e738f838c5b63978119a
size 13126555
oid sha256:2c98427abee9fee5206d47863a450e0e30aaba61fb687dc8b0fe4da19b7ab336
size 13143510

View File

@ -88,6 +88,7 @@
hit/(map aeon tako) :: versions by id
lab/(map @tas aeon) :: labels
mim/(map path mime) :: mime cache
fod/ford-cache :: ford cache
== ::
::
:: Commit state.
@ -107,6 +108,34 @@
mut/(list (trel path lobe cage)) :: mutations
== ::
::
:: Ford cache
::
+$ ford-cache
$: vases=(map path [res=vase dez=(set path)])
marks=(map mark [res=dais dez=(set path)])
casts=(map mars [res=tube dez=(set path)])
==
:: $mars: mark conversion request
:: $tube: mark conversion gate
+$ mars [a=mark b=mark]
+$ tube $-(vase vase)
:: $dais: processed mark core
::
+$ dais
$_ ^|
|_ sam=vase
++ bunt sam
++ diff |~(new=_sam *vase)
++ form *mark
++ join |~([a=vase b=vase] *(unit (unit vase)))
++ mash
|~ [a=[ship desk diff=vase] b=[ship desk diff=vase]]
*(unit vase)
++ pact |~(diff=vase sam)
++ vale |~(noun sam)
++ volt |~(noun sam)
--
::
:: Hash of a blob, for lookup in the object store (lat.ran)
::
++ lobe @uvI :: blob ref
@ -2929,6 +2958,26 @@
==
wake:ergo
::
++ promote-ford
|= [=ford-cache deletes=(set path) changes=(map path (each page lobe))]
=/ invalid=(set path) (~(uni in deletes) ~(key by changes))
=: vases.ford-cache ((invalidate path vase) vases.ford-cache invalid)
marks.ford-cache ((invalidate mark dais) marks.ford-cache invalid)
casts.ford-cache ((invalidate mars tube) casts.ford-cache invalid)
==
ford-cache
::
++ invalidate
|* [key=mold value=mold]
|= [cache=(map key [value dez=(set path)]) invalid=(set path)]
=/ builds=(list [key value dez=(set path)]) ~(tap by cache)
|- ^+ cache
?~ builds
~
?: ?=(^ (~(int in dez.i.builds) invalid))
$(builds t.builds)
(~(put by $(builds t.builds)) i.builds)
::
++ ergo
^+ ..park
=/ must (must-ergo:util her syd mon (turn ~(tap by mim) head))

View File

@ -44,14 +44,15 @@
(pure:m !>(~))
::
+$ merge-result
%- unit
$: conflicts=(set path)
bop=(map path cage)
new=yaki
deletes=(set path)
changes=(set path)
lat=(map lobe blob)
==
%- unit
$: conflicts=(set path)
bop=(map path cage)
new=yaki
deletes=(set path)
changes=(set path)
lat=(map lobe blob)
==
::
++ merge
|= [=ali=yaki bob-yaki=(unit yaki)]
=/ m (strand ,merge-result)