From f3348543180f931d79b5a98623a70d56e488b466 Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Fri, 18 Sep 2020 15:50:54 -0400 Subject: [PATCH 1/4] WIP: +graph-export --- pkg/arvo/app/graph-store.hoon | 14 ++++++++++++++ pkg/arvo/gen/graph-store/export-graph.hoon | 11 +++++++++++ 2 files changed, 25 insertions(+) create mode 100644 pkg/arvo/gen/graph-store/export-graph.hoon diff --git a/pkg/arvo/app/graph-store.hoon b/pkg/arvo/app/graph-store.hoon index bdfabe744..32178dee7 100644 --- a/pkg/arvo/app/graph-store.hoon +++ b/pkg/arvo/app/graph-store.hoon @@ -473,6 +473,20 @@ :+ %0 now.bowl [%add-graph [ship term] `graph:store`p.u.result q.u.result] + :: + :: note: near-duplicate of /x/graph + :: + [%x %archive @ @ ~] + =/ =ship (slav %p i.t.t.path) + =/ =term i.t.t.t.path + =/ result=(unit marked-graph:store) + (~(get by archive) [ship term]) + ?~ result [~ ~] + :- ~ :- ~ :- %graph-update + !> ^- update:store + :+ %0 + now.bowl + [%add-graph [ship term] `graph:store`p.u.result q.u.result] :: [%x %graph-subset @ @ @ @ ~] =/ =ship (slav %p i.t.t.path) diff --git a/pkg/arvo/gen/graph-store/export-graph.hoon b/pkg/arvo/gen/graph-store/export-graph.hoon new file mode 100644 index 000000000..d29f95a88 --- /dev/null +++ b/pkg/arvo/gen/graph-store/export-graph.hoon @@ -0,0 +1,11 @@ +/+ graph-store +:: +:- %say +|= $: [now=@da eny=@uvJ bec=beak] + [=ship graph=term ~] + == +:- %noun +=/ our (scot %p p.bec) +=/ wen (scot %da now) +=/ who (scot %p ship) +.^(update:graph-store /gx/[our]/graph-store/[wen]/[who]/[graph]) From 3c03d61038f7921795d9bbc56c53e7391725bb0b Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Fri, 18 Sep 2020 16:21:00 -0400 Subject: [PATCH 2/4] +graph-store/export-graph and associated scry handler --- pkg/arvo/app/graph-store.hoon | 1 + pkg/arvo/gen/graph-store/export-graph.hoon | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/arvo/app/graph-store.hoon b/pkg/arvo/app/graph-store.hoon index 32178dee7..6a0c0421e 100644 --- a/pkg/arvo/app/graph-store.hoon +++ b/pkg/arvo/app/graph-store.hoon @@ -449,6 +449,7 @@ ^- (unit (unit cage)) |^ ?> (team:title our.bowl src.bowl) + ~& path=path ?+ path (on-peek:def path) [%x %keys ~] :- ~ :- ~ :- %graph-update diff --git a/pkg/arvo/gen/graph-store/export-graph.hoon b/pkg/arvo/gen/graph-store/export-graph.hoon index d29f95a88..24d9713d6 100644 --- a/pkg/arvo/gen/graph-store/export-graph.hoon +++ b/pkg/arvo/gen/graph-store/export-graph.hoon @@ -2,10 +2,13 @@ :: :- %say |= $: [now=@da eny=@uvJ bec=beak] - [=ship graph=term ~] + [[=ship graph=term ~] ~] == :- %noun =/ our (scot %p p.bec) =/ wen (scot %da now) =/ who (scot %p ship) -.^(update:graph-store /gx/[our]/graph-store/[wen]/[who]/[graph]) +:: +.^ update:graph-store + /gx/[our]/graph-store/[wen]/archive/[who]/[graph]/graph-update +== From d6899857f4b2649f328ccdb7e541967c07b313b7 Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Fri, 18 Sep 2020 16:50:34 -0400 Subject: [PATCH 3/4] +graph-store/import-graph --- pkg/arvo/app/graph-store.hoon | 4 +++- pkg/arvo/gen/graph-store/export-graph.hoon | 2 +- pkg/arvo/gen/graph-store/import-graph.hoon | 9 +++++++++ pkg/arvo/mar/graph/update.hoon | 4 ++++ 4 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 pkg/arvo/gen/graph-store/import-graph.hoon diff --git a/pkg/arvo/app/graph-store.hoon b/pkg/arvo/app/graph-store.hoon index 6a0c0421e..f8115b1b1 100644 --- a/pkg/arvo/app/graph-store.hoon +++ b/pkg/arvo/app/graph-store.hoon @@ -482,7 +482,9 @@ =/ =term i.t.t.t.path =/ result=(unit marked-graph:store) (~(get by archive) [ship term]) - ?~ result [~ ~] + ?~ result + ~& no-archived-graph+[ship term] + [~ ~] :- ~ :- ~ :- %graph-update !> ^- update:store :+ %0 diff --git a/pkg/arvo/gen/graph-store/export-graph.hoon b/pkg/arvo/gen/graph-store/export-graph.hoon index 24d9713d6..9a52862d6 100644 --- a/pkg/arvo/gen/graph-store/export-graph.hoon +++ b/pkg/arvo/gen/graph-store/export-graph.hoon @@ -4,7 +4,7 @@ |= $: [now=@da eny=@uvJ bec=beak] [[=ship graph=term ~] ~] == -:- %noun +:- %graph-update =/ our (scot %p p.bec) =/ wen (scot %da now) =/ who (scot %p ship) diff --git a/pkg/arvo/gen/graph-store/import-graph.hoon b/pkg/arvo/gen/graph-store/import-graph.hoon new file mode 100644 index 000000000..720c24e61 --- /dev/null +++ b/pkg/arvo/gen/graph-store/import-graph.hoon @@ -0,0 +1,9 @@ +/+ graph-store +:: +:- %say +|= $: [now=@da eny=@uvJ bec=beak] + [[graph=term =path ~] ~] + == +:- %graph-update +=- ~& update=- - +.^(=update:graph-store %cx path) diff --git a/pkg/arvo/mar/graph/update.hoon b/pkg/arvo/mar/graph/update.hoon index 1cd2a2068..e6766edb5 100644 --- a/pkg/arvo/mar/graph/update.hoon +++ b/pkg/arvo/mar/graph/update.hoon @@ -1,15 +1,19 @@ /+ *graph-store +=* as-octs as-octs:mimes:html +:: |_ upd=update ++ grad %noun ++ grow |% ++ noun upd ++ json (update:enjs upd) + ++ mime [/application/x-urb-graph-update (as-octs (jam upd))] -- :: ++ grab |% ++ noun update ++ json update:dejs + ++ mime |=([* =octs] ;;(update (cue q.octs))) -- -- From 9ee1a1751c578633cba6ff2b0354af27568eca8e Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Mon, 21 Sep 2020 10:50:03 -0400 Subject: [PATCH 4/4] :graph-store: remove stray printf --- pkg/arvo/app/graph-store.hoon | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg/arvo/app/graph-store.hoon b/pkg/arvo/app/graph-store.hoon index f8115b1b1..de93ec1ad 100644 --- a/pkg/arvo/app/graph-store.hoon +++ b/pkg/arvo/app/graph-store.hoon @@ -449,7 +449,6 @@ ^- (unit (unit cage)) |^ ?> (team:title our.bowl src.bowl) - ~& path=path ?+ path (on-peek:def path) [%x %keys ~] :- ~ :- ~ :- %graph-update