From 88ab046d886f2fc19a82fd9d3c489ca44d5c0f47 Mon Sep 17 00:00:00 2001 From: Elliot Glaysher Date: Thu, 10 May 2018 11:18:52 -0700 Subject: [PATCH] Change %wris so it always returns a date. This removes the scry from +rebuild in ford-turbo. This is ok since ford-turbo Is the only consumer of %wris. The ford-turbo app now works end-to-end in a way that theoretically should work without the app. --- app/ford-turbo.hoon | 2 +- lib/ford-turbo.hoon | 15 +++++++-------- sys/vane/clay.hoon | 15 ++++++++++++++- sys/zuse.hoon | 2 +- 4 files changed, 23 insertions(+), 11 deletions(-) diff --git a/app/ford-turbo.hoon b/app/ford-turbo.hoon index 412835cdfb..df7c6a87f7 100644 --- a/app/ford-turbo.hoon +++ b/app/ford-turbo.hoon @@ -40,7 +40,7 @@ :: clay response to a %multi :: ++ wris - |= {way/wire p/case q/(set (pair care path))} + |= {way/wire p/[%da @da] q/(set (pair care path))} ^- [(list move) _+>.$] ~& [%wris way p q] :: diff --git a/lib/ford-turbo.hoon b/lib/ford-turbo.hoon index 6bc5b21ae2..205e9b06b2 100644 --- a/lib/ford-turbo.hoon +++ b/lib/ford-turbo.hoon @@ -718,7 +718,9 @@ $: %wris :: case: case of the new files :: - =case + :: %wris can only return dates to us. + :: + case=[%da p=@da] :: care-paths: the +care:clay and +path of each file :: care-paths=(set [care=care:clay =path]) @@ -1427,17 +1429,14 @@ :: +rebuild: rebuild any live builds based on +resource updates :: ++ rebuild - |= [=beak care-paths=(set [care=care:clay =path])] + |= [ship=@p desk=@tas case=[%da p=@da] care-paths=(set [care=care:clay =path])] ^- [(list move) ford-state] :: =< finalize :: + =/ date=@da p.case :: - =/ date=@da - ?: ?=(%da -.r.beak) - p.r.beak - da:.^(cass:clay %cw /(scot %p p.beak)/[q.beak]/(scot %da now)) - =/ =disc [p.beak q.beak] + =/ =disc [ship desk] :: delete the now-dead clay subscription :: =. clay-subscriptions.state (~(del in clay-subscriptions.state) disc) @@ -3479,7 +3478,7 @@ =+ [ship desk]=(raid:wired t.t.wire ~[%p %tas]) :: =* rebuild rebuild:(per-event event-args) - (rebuild [ship desk case.sign] care-paths.sign) + (rebuild ship desk case.sign care-paths.sign) :: %resource: response to a request for a +resource :: ?. =(%scry-request i.t.wire) diff --git a/sys/vane/clay.hoon b/sys/vane/clay.hoon index 3bae1cada9..763f972245 100644 --- a/sys/vane/clay.hoon +++ b/sys/vane/clay.hoon @@ -598,7 +598,20 @@ |= {hen/duct das/(set mood)} ^+ +> ?> ?=(^ das) - =- (emit hen %give %wris q.n.das -) + :: translate the case to a date + :: + =/ cas=[%da p=@da] + :: if the case is already a date, use it. + :: + ?: ?=([%da *] q.n.das) + q.n.das + :: translate other cases to dates + :: + =/ aey (case-to-aeon:ze q.n.das) + ?~ aey [%da `@da`0] + ?: =(0 u.aey) [%da `@da`0] + [%da t:(aeon-to-yaki:ze u.aey)] + =- (emit hen %give %wris cas -) (~(run in `(set mood)`das) |=(m/mood [p.m r.m])) :: :: Give next step in a subscription. diff --git a/sys/zuse.hoon b/sys/zuse.hoon index f62807d0e7..671bf445dc 100644 --- a/sys/zuse.hoon +++ b/sys/zuse.hoon @@ -394,7 +394,7 @@ {$rule red/dict wit/dict} :: node r+w permissions {$send p/lane:ames q/@} :: transmit packet {$writ p/riot} :: response - {$wris p/case p/(set (pair care path))} :: many changes + {$wris p/{$da p/@da} q/(set (pair care path))} :: many changes == :: ++ task :: in request ->$ $% {$boat $~} :: pier rebooted