zuse: remove +ford

This commit is contained in:
Philip Monk 2020-05-14 00:22:39 -07:00
parent e95f34a325
commit a874ab4355
No known key found for this signature in database
GPG Key ID: B66E1F02604E44EC
19 changed files with 248 additions and 2005 deletions

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:51ea2b84964f7ae79c6c10a17610e6f812e7842659db852aaed4a9c94f20f21b
size 13136190
oid sha256:600d74621bc74756d0488dc38dce8cc7a56c560ca0aa276f0cde81eadac35832
size 13077251

View File

@ -382,7 +382,6 @@
%c %clay
%d %dill
%e %eyre
%f %ford
%g %gall
%j %jael
%g %gall

View File

@ -22,10 +22,10 @@
poy/(unit dojo-project) :: working
$: :: sur: structure imports
::
sur=(list cable:ford)
sur=(list cable:clay)
:: lib: library imports
::
lib=(list cable:ford)
lib=(list cable:clay)
==
var/(map term cage) :: variable state
old/(set term) :: used TLVs
@ -88,7 +88,7 @@
$: mad/dojo-command :: operation
num/@ud :: number of tasks
cud/(unit dojo-source) :: now solving
pux/(unit path) :: ford working
pux/(unit path) :: working
pro/(unit vase) :: prompting loop
per/(unit sole-edit) :: pending reverse
job/(map @ud dojo-build) :: problems
@ -187,13 +187,13 @@
::
++ parse-cables
%+ cook
|= cables=(list cable:ford)
|= cables=(list cable:clay)
:+ 0 %ex
^- hoon
::
:- %clsg
%+ turn cables
|= cable=cable:ford
|= cable=cable:clay
^- hoon
::
:+ %clhp
@ -204,7 +204,7 @@
(most ;~(plug com gaw) parse-cable)
::
++ parse-cable
%+ cook |=(a=cable:ford a)
%+ cook |=(a=cable:clay a)
;~ pose
(stag ~ ;~(pfix tar sym))
(cook |=([face=term tis=@ file=term] [`face file]) ;~(plug sym tis sym))
@ -322,9 +322,7 @@
dir
dir(r [%da now.hid])
::
++ he-disc `disc:ford`[p q]:he-beam
++ he-beak `beak`[p q r]:he-beam
++ he-rail `rail:ford`[[p q] s]:he-beam
++ he-parser (parser-at our.hid he-beam)
::
++ dy :: project work
@ -359,7 +357,8 @@
:: really shoud stop the thread as well
::
[%pass u.pux %agent [our.hid %spider] %leave ~]
[%pass u.pux %arvo %f %kill ~]
=/ [=ship =desk =case:clay] he-beak
[%pass u.pux %arvo %c %warp ship desk ~]
::
++ dy-errd :: reject change, abet
|= {rev/(unit sole-edit) err/@u}
@ -526,13 +525,13 @@
$lib
%_ .
lib
((dy-cast (list cable:ford) !>(*(list cable:ford))) q.cay)
((dy-cast (list cable:clay) !>(*(list cable:clay))) q.cay)
==
::
$sur
%_ .
sur
((dy-cast (list cable:ford) !>(*(list cable:ford))) q.cay)
((dy-cast (list cable:clay) !>(*(list cable:clay))) q.cay)
==
::
$dir =+ ^= pax ^- path

View File

@ -192,13 +192,10 @@
^- (quip card _state)
~& > %lsp-shutdown
:_ *state-zero
%- zing
%+ turn
~(tap in ~(key by builds))
|= uri=@t
:+ [%pass /ford/[uri] %arvo %f %kill ~]
[%pass /ford/[uri]/deps %arvo %f %kill ~]
~
[%pass /ford/[uri] %arvo %c %warp our.bow %home ~]
::
++ handle-did-close
|= [uri=@t version=(unit @)]
@ -210,10 +207,7 @@
=. builds
(~(del by builds) uri)
:_ state
:~
[%pass /ford/[uri] %arvo %f %kill ~]
[%pass /ford/[uri]/deps %arvo %f %kill ~]
==
[%pass /ford/[uri] %arvo %c %warp our.bow %home ~]~
::
++ handle-did-save
|= [uri=@t version=(unit @)]

View File

@ -155,7 +155,6 @@
~(wyt by u.inv)
:_ this(state [%2 new-state])
;: weld
kill-builds
kick-cards
init-cards
(move-files old-subs)
@ -176,20 +175,6 @@
[~ subs]
[[%give %kick paths ~]~ subs]
::
++ kill-builds
^- (list card)
%- zing
%+ turn ~(tap by pubs.zero)
|= [col-name=@tas col-data=collection-zero]
^- (list card)
:- [%pass /collection/[col-name] %arvo %f %kill ~]
%- zing
%+ turn ~(tap by pos.col-data)
|= [pos-name=@tas *]
:~ [%pass /post/[col-name]/[pos-name] %arvo %f %kill ~]
[%pass /comments/[col-name]/[pos-name] %arvo %f %kill ~]
==
::
++ send-invites
|= [book=@tas subscribers=(set @p)]
^- (list card)

View File

@ -10,7 +10,6 @@
mar-ok=?
==
--
=, ford
=, format
^- agent:gall
=| =state

View File

@ -1,14 +0,0 @@
:: Helm: Disable/enable/toggle auto-reload of kernel components
::
:::: /hoon/autoload/hood/gen
::
/? 310
::
::::
::
:- %say
|= $: {now/@da eny/@uvJ bec/beak}
{arg/?(~ {? ~}) ~}
==
:- %kiln-autoload
`(unit ?)`?~(arg ~ `-.arg)

View File

@ -1,13 +0,0 @@
:: Kiln: regularly clear %ford cache XX find relevant leak
::
:::: /hoon/overload/hood/gen
::
/? 310
::
::::
::
:- %say
|= $: {now/@da eny/@uvJ bec/beak}
{{recur/@dr start/@da ~} ~}
==
[%kiln-overload recur start]

View File

@ -10,4 +10,4 @@
|= $: {now/@da eny/@uvJ bec/beak}
{arg/~ ~}
==
[%helm-reload ~[%z %a %b %c %d %e %f %g %i %j]]
[%helm-reload ~[%z %a %b %c %d %e %g %i %j]]

View File

@ -1,13 +0,0 @@
:: Helm: Reload %ford
::
:::: /hoon/rf/hood/gen
::
/? 310
::
::::
::
:- %say
|= $: {now/@da eny/@uvJ bec/beak}
{arg/~ ~}
==
[%helm-reload ~[%f]]

View File

@ -206,10 +206,6 @@
::
(vent %e /vane/eyre)
::
:: sys/vane/ford: build
::
(vent %f /vane/ford)
::
:: sys/vane/gall: applications
::
(vent %g /vane/gall)

View File

@ -190,8 +190,6 @@
=/ =rite [%r ~ ?:(pub %black %white) ~]
[%pass /kiln/permission %arvo %c [%perm syd pax rite]]
::
++ poke-autoload |=(lod/(unit ?) abet:(poke:autoload lod))
++ poke-start-autoload |=(~ abet:start:autoload)
++ poke
|= [=mark =vase]
?+ mark ~|([%poke-kiln-bad-mark mark] !!)
@ -206,99 +204,14 @@
%kiln-track =;(f (f !<(_+<.f vase)) poke-track)
%kiln-sync =;(f (f !<(_+<.f vase)) poke-sync)
%kiln-syncs =;(f (f !<(_+<.f vase)) poke-syncs)
%kiln-autoload =;(f (f !<(_+<.f vase)) poke-autoload)
%kiln-overload =;(f (f !<(_+<.f vase)) poke-overload)
%kiln-goad-gall =;(f (f !<(_+<.f vase)) poke-goad-gall)
%kiln-unmount =;(f (f !<(_+<.f vase)) poke-unmount)
%kiln-unsync =;(f (f !<(_+<.f vase)) poke-unsync)
%kiln-permission =;(f (f !<(_+<.f vase)) poke-permission)
%kiln-cancel-autocommit =;(f (f !<(_+<.f vase)) poke-cancel-autocommit)
%kiln-start-autoload =;(f (f !<(_+<.f vase)) poke-start-autoload)
%kiln-merge =;(f (f !<(_+<.f vase)) poke-merge)
==
::
++ autoload
|%
++ emit
|= a/card:agent:gall
+>(..autoload (^emit a))
::
++ tracked-vanes
^- (list @tas)
~[%ames %behn %clay %dill %eyre %ford %gall %iris %jael]
::
++ our-home /(scot %p our)/home/(scot %da now)
++ sys-hash |=(pax/path .^(@uvI %cz :(welp our-home /sys pax)))
++ hash-vane
|= syd/@tas ^- (pair term @uvI)
[syd (sys-hash /vane/[syd]/hoon)]
::
++ rehash-vanes
^+ cur-vanes
(malt (turn tracked-vanes hash-vane))
::
::
++ poke
|= lod/(unit ?)
?^ lod
..autoload(autoload-on u.lod)
=. autoload-on !autoload-on
(spam leaf+"turned autoload {?:(autoload-on "on" "off")}" ~)
::
++ start
=. cur-hoon (sys-hash /hoon/hoon)
=. cur-arvo (sys-hash /arvo/hoon)
=. cur-zuse (sys-hash /zuse/hoon)
=. cur-vanes rehash-vanes
subscribe-next
::
++ subscribe-next
%- emit
[%pass /kiln/autoload %arvo %c [%warp our %home `[%next %z da+now /sys]]]
::
++ writ =>(check-new subscribe-next)
++ check-new
?. autoload-on
..check-new
=/ new-hoon (sys-hash /hoon/hoon)
=/ new-arvo (sys-hash /arvo/hoon)
?: |(!=(new-hoon cur-hoon) !=(new-arvo cur-arvo))
=. cur-hoon new-hoon
=. cur-arvo new-arvo
=. cur-vanes rehash-vanes
(emit %pass /kiln/reload/hoon %agent [our %hood] %poke %helm-reset !>(~))
:: XX updates cur-vanes?
=/ new-zuse (sys-hash /zuse/hoon)
?: !=(new-zuse cur-zuse)
=. cur-zuse new-zuse
=. cur-vanes rehash-vanes
=/ =cage [%helm-reload !>([%zuse tracked-vanes])]
(emit [%pass /kiln/reload/zuse %agent [our %hood] %poke cage])
(roll tracked-vanes load-vane)
::
++ load-vane
=< %_(. con ..load-vane)
|: $:{syd/@tas con/_.}
=. +>.$ con
=/ new-vane q:(hash-vane syd)
?: =(`new-vane (~(get by cur-vanes) syd))
+>.$
=. cur-vanes (~(put by cur-vanes) syd new-vane)
=/ =cage [%helm-reload !>(~[syd])]
(emit %pass /kiln/reload/[syd] %agent [our %hood] %poke cage)
::
++ coup-reload
|= {way/wire saw/(unit tang)}
~? ?=(^ saw) [%kiln-reload-lame u.saw]
+>.$
--
::
++ poke-overload
:: +poke-overload: wipes ford cache at {start}, and then every {recur}.
|= [recur=@dr start=@da]
?> (gte start now)
abet:(emit %pass /kiln/overload/(scot %dr recur) %arvo %b [%wait start])
::
++ poke-goad-gall
|= [force=? agent=(unit dude:gall)]
abet:(emit %pass /kiln %arvo %g %goad force agent)
@ -313,8 +226,6 @@
?+ wire ~|([%kiln-bad-take-agent wire -.sign] !!)
[%kiln %fancy *] ?> ?=(%poke-ack -.sign)
(take-coup-fancy t.t.wire p.sign)
[%kiln %reload *] ?> ?=(%poke-ack -.sign)
(take-coup-reload t.t.wire p.sign)
[%kiln %spam *] ?> ?=(%poke-ack -.sign)
(take-coup-spam t.t.wire p.sign)
==
@ -324,14 +235,10 @@
?- wire
[%sync %merg *] %+ take-mere-sync t.t.wire
?>(?=(%mere +<.sign-arvo) +>.sign-arvo)
[%autoload *] %+ take-writ-autoload t.wire
?>(?=(%writ +<.sign-arvo) +>.sign-arvo)
[%find-ship *] %+ take-writ-find-ship t.wire
?>(?=(%writ +<.sign-arvo) +>.sign-arvo)
[%sync *] %+ take-writ-sync t.wire
?>(?=(%writ +<.sign-arvo) +>.sign-arvo)
[%overload *] %+ take-wake-overload t.wire
?>(?=(%wake +<.sign-arvo) +>.sign-arvo)
[%autocommit *] %+ take-wake-autocommit t.wire
?>(?=(%wake +<.sign-arvo) +>.sign-arvo)
*
@ -351,10 +258,6 @@
|= {way/wire saw/(unit tang)}
abet:abet:(coup-fancy:(take way) saw)
::
++ take-coup-reload ::
|= {way/wire saw/(unit tang)}
abet:(coup-reload:autoload way saw)
::
++ take-coup-spam ::
|= {way/wire saw/(unit tang)}
~? ?=(^ saw) [%kiln-spam-lame u.saw]
@ -390,23 +293,6 @@
==
abet:abet:(writ:(auto hos) rot)
::
++ take-writ-autoload
|= {way/wire rot/riot}
?> ?=(~ way)
?> ?=(^ rot)
abet:writ:autoload
::
++ take-wake-overload
|= {way/wire error=(unit tang)}
?^ error
%- (slog u.error)
~& %kiln-take-wake-overload-fail
abet
?> ?=({@ ~} way)
=+ tym=(slav %dr i.way)
~& %wake-overload-deprecated
abet
::
++ take-wake-autocommit
|= [way=wire error=(unit tang)]
?^ error
@ -553,15 +439,6 @@
~| %kiln-work-fail
.
::
++ ford-fail
|=(tan/tang ~|(%ford-fail (mean tan)))
::
++ unwrap-tang
|* res/(each * tang)
?: ?=(%& -.res)
p.res
(ford-fail p.res)
::
++ perform ::
^+ .
(blab [%pass /kiln/[syd] %arvo %c [%merg syd her sud cas gem]] ~)

View File

@ -1,267 +0,0 @@
/+ *test
=, ford
|%
:: +expect-schematic: assert a +schematic:ford is what we expect
::
:: Since Ford requests contain types, we can't do simple
:: equality checking. This function handles all the different
:: kinds of +schematic:ford, dealing with types as necessary.
::
++ expect-schematic
|= [expected=schematic actual=schematic]
^- tang
::
?^ -.expected
?. ?=(^ -.actual)
[%leaf "expected autocons, but got {<-.actual>}"]~
::
%+ weld
$(expected head.expected, actual head.actual)
$(expected tail.expected, actual tail.actual)
::
?- -.expected
%$
?. ?=(%$ -.actual)
[%leaf "expected %$, but got {<-.actual>}"]~
::
%+ weld
(expect-eq !>(p.literal.expected) !>(p.literal.actual))
(expect-eq q.literal.expected q.literal.actual)
::
%pin
::
?. ?=(%pin -.actual)
[%leaf "expected %pin, but got {<-.actual>}"]~
::
%+ weld
(expect-eq !>(date.expected) !>(date.actual))
$(expected schematic.expected, actual schematic.actual)
::
%alts
::
?. ?=(%alts -.actual)
[%leaf "expected %alts, but got {<-.actual>}"]~
::
|- ^- tang
?~ choices.expected
:: make sure there aren't any extra :choices in :actual
::
?~ choices.actual
~
[%leaf "actual had more choices than expected"]~
:: :expected isn't empty yet; make sure :actual isn't either
::
?~ choices.actual
[%leaf "expected had more choices than actual"]~
:: recurse on the first sub-schematic
::
%+ weld
^$(expected i.choices.expected, actual i.choices.actual)
$(choices.expected t.choices.expected, choices.actual t.choices.actual)
::
%bake
(expect-eq [schematic-type expected] [schematic-type actual])
::
%bunt
(expect-eq [schematic-type expected] [schematic-type actual])
::
%call
::
?. ?=(%call -.actual)
[%leaf "expected %call, but got {<-.actual>}"]~
::
%+ weld
$(expected gate.expected, actual gate.actual)
$(expected sample.expected, actual sample.actual)
::
%cast
::
?. ?=(%cast -.actual)
[%leaf "expected %cast, but got {<-.actual>}"]~
::
;: weld
(expect-eq !>(disc.expected) !>(disc.actual))
(expect-eq !>(mark.expected) !>(mark.actual))
$(expected input.expected, actual input.actual)
==
::
%core
(expect-eq [schematic-type expected] [schematic-type actual])
::
%diff
::
?. ?=(%diff -.actual)
[%leaf "expected %diff, but got {<-.actual>}"]~
::
;: weld
(expect-eq !>(disc.expected) !>(disc.actual))
$(expected start.expected, actual start.actual)
$(expected end.expected, actual end.actual)
==
::
%dude
::
?. ?=(%dude -.actual)
[%leaf "expected %dude, but got {<-.actual>}"]~
::
%+ weld
(expect-eq !>(error.expected) !>(error.actual))
$(expected attempt.expected, actual attempt.actual)
::
%hood
(expect-eq [schematic-type expected] [schematic-type actual])
::
%join
::
?. ?=(%join -.actual)
[%leaf "expected %join, but got {<-.actual>}"]~
::
;: weld
(expect-eq !>(disc.expected) !>(disc.actual))
(expect-eq !>(mark.expected) !>(mark.actual))
$(expected first.expected, actual first.actual)
$(expected second.expected, actual second.actual)
==
::
%list
::
?. ?=(%list -.actual)
[%leaf "expected %list, but got {<-.actual>}"]~
::
|- ^- tang
?~ schematics.expected
:: make sure there aren't any extra :schematics in :actual
::
?~ schematics.actual
~
[%leaf "actual had more schematics than expected"]~
:: :expected isn't empty yet; make sure :actual isn't either
::
?~ schematics.actual
[%leaf "expected had more schematics than actual"]~
::
%+ weld
^$(expected i.schematics.expected, actual i.schematics.actual)
::
%_ $
schematics.expected t.schematics.expected
schematics.actual t.schematics.actual
==
::
%mash
::
?. ?=(%mash -.actual)
[%leaf "expected %mash, but got {<-.actual>}"]~
::
;: weld
(expect-eq !>(disc.expected) !>(disc.actual))
(expect-eq !>(mark.expected) !>(mark.actual))
(expect-eq !>(disc.first.expected) !>(disc.first.actual))
(expect-eq !>(mark.first.expected) !>(mark.first.actual))
(expect-eq !>(disc.second.expected) !>(disc.second.actual))
(expect-eq !>(mark.second.expected) !>(mark.second.actual))
$(expected schematic.first.expected, actual schematic.first.actual)
$(expected schematic.second.expected, actual schematic.second.actual)
==
::
%mute
::
?. ?=(%mute -.actual)
[%leaf "expected %mute, but got {<-.actual>}"]~
::
%+ weld $(expected subject.expected, actual subject.actual)
::
|- ^- tang
?~ mutations.expected
:: make sure there aren't any extra :mutations in :actual
::
?~ mutations.actual
~
[%leaf "actual had more mutations than expected"]~
:: :expected isn't empty yet; make sure :actual isn't either
::
?~ mutations.actual
[%leaf "expected had more mutations than actual"]~
::
;: weld
(expect-eq !>(p.i.mutations.expected) !>(p.i.mutations.actual))
^$(expected q.i.mutations.expected, actual q.i.mutations.actual)
%_ $
mutations.expected t.mutations.expected
mutations.actual t.mutations.actual
==
==
::
%pact
::
?. ?=(%pact -.actual)
[%leaf "expected %pact, but got {<-.actual>}"]~
::
;: weld
(expect-eq !>(disc.expected) !>(disc.actual))
$(expected start.expected, actual start.actual)
$(expected diff.expected, actual diff.actual)
==
::
%path
(expect-eq [schematic-type expected] [schematic-type actual])
::
%plan
(expect-eq [schematic-type expected] [schematic-type actual])
::
%reef
(expect-eq [schematic-type expected] [schematic-type actual])
::
%ride
::
?. ?=(%ride -.actual)
[%leaf "expected %ride, but got {<-.actual>}"]~
::
%+ weld
(expect-eq !>(formula.expected) !>(formula.actual))
$(expected subject.expected, actual subject.actual)
::
%same
::
?. ?=(%same -.actual)
[%leaf "expected %same, but got {<-.actual>}"]~
::
$(expected schematic.expected, actual schematic.actual)
::
%scry
(expect-eq [schematic-type expected] [schematic-type actual])
::
%slim
::
?. ?=(%slim -.actual)
[%leaf "expected %slim, but got {<-.actual>}"]~
::
%+ weld
(expect-eq !>(formula.expected) !>(formula.actual))
::
%+ expect-eq
!>(`?`%.y)
^- vase
:- -:!>(*?)
^- ?
(~(nest ut subject-type.expected) | subject-type.actual)
::
%slit
::
?. ?=(%slit -.actual)
[%leaf "expected %slit, but got {<-.actual>}"]~
::
%+ weld
(expect-eq gate.expected gate.actual)
(expect-eq sample.expected sample.actual)
::
?(%vale %volt)
(expect-eq [schematic-type expected] [schematic-type actual])
::
%walk
(expect-eq [schematic-type expected] [schematic-type actual])
==
:: +schematic-type: the +type for +schematic:ford
::
++ schematic-type ^~ `type`-:!>(*schematic:ford)
--

View File

@ -1,341 +0,0 @@
/+ *test
::
/= ford-vane /: /===/sys/vane/ford /!noun/
::
/= hoon-scry /: /===/sys/hoon /hoon/
/= arvo-scry /: /===/sys/arvo /hoon/
/= zuse-scry /: /===/sys/zuse /hoon/
/= txt-scry /: /===/mar/txt /hoon/
/= diff-scry /: /===/mar/txt-diff /hoon/
::
!:
=, ford
=, format
::
=/ test-pit=vase !>(..zuse)
=/ ford-gate (ford-vane test-pit)
::
|%
++ verify-post-made
|= $: move=move:ford-gate
=duct
=type
date=@da
title=@tas
contents=tape
==
^- tang
::
?> ?=([* %give %made @da %complete %success ^ *] move)
=/ result build-result.result.p.card.move
?> ?=([%success %scry %noun type-a=* @tas *] head.result)
?> ?=([%success ^ *] tail.result)
?> ?=([%success %ride type-title-a=* %post-a] head.tail.result)
?> ?=([%success %ride type-title-b=* %post-b] tail.tail.result)
::
;: welp
%+ expect-eq
!> duct
!> duct.move
::
%+ expect-eq
!> date
!> date.p.card.move
::
%+ expect-eq
!> [%success %scry %noun *^type [title=title contents=contents]]
!> head.result(p.q.cage *^type)
::
%+ expect-eq
!> &
!> (~(nest ut p.q.cage.head.result) | type)
::
%+ expect-eq
!> 'post-a'
vase.head.tail.result
::
%+ expect-eq
!> 'post-b'
vase.tail.tail.result
==
++ scry-with-results
|= results=(map [=term =beam] cage)
|= [* (unit (set monk)) =term =beam]
^- (unit (unit cage))
::
=/ date=@da ?>(?=(%da -.r.beam) p.r.beam)
::
?^ reef=((scry-reef date) +<.$)
reef
::
~| scry-with-results+[term=term beam=beam]
::
[~ ~ (~(got by results) [term beam])]
:: +scry-with-results-and-failures
::
++ scry-with-results-and-failures
|= results=(map [=term =beam] (unit cage))
|= [* (unit (set monk)) =term =beam]
^- (unit (unit cage))
::
=/ date=@da ?>(?=(%da -.r.beam) p.r.beam)
::
?^ reef=((scry-reef date) +<.$)
reef
::
~| scry-with-results+[term=term beam=beam]
::
[~ (~(got by results) [term beam])]
:: +scry-succeed: produces a scry function with a known request and answer
::
++ scry-succeed
|= [date=@da result=cage] ^- sley
|= [* (unit (set monk)) =term =beam]
^- (unit (unit cage))
::
?^ reef=((scry-reef date) +<.$)
reef
::
~| scry-succeed+[beam+beam term+term]
?> =(term %cx)
?> =(beam [[~nul %desk %da date] /bar/foo])
::
[~ ~ result]
:: +scry-fail: produces a scry function with a known request and failed answer
::
++ scry-fail
|= date=@da ^- sley
|= [* (unit (set monk)) =term =beam]
^- (unit (unit cage))
::
?^ reef=((scry-reef date) +<.$)
reef
::
~| scry-fail+[beam+beam term+term]
?> =(term %cx)
?> =(beam [[~nul %desk %da date] /bar/foo])
::
[~ ~]
:: +scry-block: produces a scry function with known request and blocked answer
::
++ scry-block
|= date=@da ^- sley
|= [* (unit (set monk)) =term =beam]
^- (unit (unit cage))
::
?^ reef=((scry-reef date) +<.$)
reef
::
~| scry-block+[beam+beam term+term]
?> =(term %cx)
?> =(beam [[~nul %desk %da date] /bar/foo])
::
~
:: +scry-blocks: block on a file at multiple dates; does not include %reef
::
++ scry-blocks
|= dates=(set @da) ^- sley
|= [* (unit (set monk)) =term =beam]
^- (unit (unit cage))
::
~| scry-block+[beam+beam term+term]
?> =(term %cx)
?> ?=([%da @da] r.beam)
?> (~(has in dates) p.r.beam)
::
~
:: +scry-is-forbidden: makes sure ford does not attempt to scry
::
++ scry-is-forbidden ^- sley
|= [* (unit (set monk)) =term =beam]
^- (unit (unit cage))
::
=/ date=@da ?>(?=(%da -.r.beam) p.r.beam)
::
?^ reef=((scry-reef date) +<.$)
reef
::
~| scry-is-forbidden+[beam+beam term+term]
!!
::
++ scry-reef
|= date=@da ^- sley
|= [* (unit (set monk)) =term =beam]
^- (unit (unit cage))
::
=- ?~ res=(~(get by -) [term beam])
~
`res
::
(with-reef date ~)
::
++ with-reef
|= [date=@da scry-results=(map [term beam] cage)]
^+ scry-results
%- ~(gas by scry-results)
:~ :- [%cx [[~nul %home %da date] /hoon/hoon/sys]]
[%hoon !>(hoon-scry)]
:- [%cx [[~nul %home %da date] /hoon/arvo/sys]]
[%hoon !>(arvo-scry)]
:- [%cx [[~nul %home %da date] /hoon/zuse/sys]]
[%hoon !>(zuse-scry)]
::
:- [%cw [[~nul %home %da date] /hoon/hoon/sys]]
[%cass !>([ud=1 da=date])]
==
::
++ with-reef-unit
|= [date=@da scry-results=(map [term beam] (unit cage))]
^+ scry-results
%- ~(gas by scry-results)
:~ :- [%cx [[~nul %home %da date] /hoon/hoon/sys]]
`[%noun !>(~)]
:- [%cx [[~nul %home %da date] /hoon/arvo/sys]]
`[%noun !>(~)]
:- [%cx [[~nul %home %da date] /hoon/zuse/sys]]
`[%noun !>(~)]
::
:- [%cw [[~nul %home %da date] /hoon/hoon/sys]]
`[%cass !>([ud=1 da=date])]
==
::
++ ford-call
|= $: ford-gate=_ford-gate
now=@da
scry=sley
call-args=[=duct type=* wrapped-task=(hobo task:able:ford-gate)]
expected-moves=(list move:ford-gate)
==
^- [tang _ford-gate]
::
=/ ford (ford-gate our=~nul now=now eny=`@`0xdead.beef scry=scry)
::
=^ moves ford-gate
%- call:ford [duct ~ type wrapped-task]:call-args
::
=/ output=tang
%+ expect-eq
!> expected-moves
!> moves
::
[output ford-gate]
::
++ ford-take
|= $: ford-gate=_ford-gate
now=@da
scry=sley
take-args=[=wire =duct wrapped-sign=(hypo sign:ford-gate)]
expected-moves=(list move:ford-gate)
==
^- [tang _ford-gate]
::
=/ ford (ford-gate our=~nul now=now eny=`@`0xdead.beef scry=scry)
::
=^ moves ford-gate
%- take:ford [wire duct ~ wrapped-sign]:take-args
::
=/ output=tang
%+ expect-eq
!> expected-moves
!> moves
::
[output ford-gate]
:: +ford-call-with-comparator
::
:: Sometimes we can't just do simple comparisons between the moves statements
:: and must instead specify a gate that performs the comparisons.
::
++ ford-call-with-comparator
|= $: ford-gate=_ford-gate
now=@da
scry=sley
call-args=[=duct type=* wrapped-task=(hobo task:able:ford-gate)]
move-comparator=$-((list move:ford-gate) tang)
==
^- [tang _ford-gate]
::
=/ ford (ford-gate our=~nul now=now eny=`@`0xdead.beef scry=scry)
::
=^ moves ford-gate
%- call:ford [duct ~ type wrapped-task]:call-args
::
=/ output=tang (move-comparator moves)
::
[output ford-gate]
:: +ford-take-with-comparator
::
++ ford-take-with-comparator
|= $: ford-gate=_ford-gate
now=@da
scry=sley
take-args=[=wire =duct wrapped-sign=(hypo sign:ford-gate)]
move-comparator=$-((list move:ford-gate) tang)
==
^- [tang _ford-gate]
::
=/ ford (ford-gate our=~nul now=now eny=`@`0xdead.beef scry=scry)
::
=^ moves ford-gate
%- take:ford [wire duct ~ wrapped-sign]:take-args
::
=/ output=tang (move-comparator moves)
::
[output ford-gate]
:: +expect-cage: assert that the actual cage has the right mark and vase
::
++ expect-cage
|= [mark=term expected=vase actual=cage]
%+ weld
%+ expect-eq
!> mark
!> p.actual
::
(expect-eq expected q.actual)
:: +expect-ford-empty: assert that ford's state is one empty ship
::
:: At the end of every test, we want to assert that we have cleaned up all
:: state.
::
++ expect-ford-empty
|= [ford-gate=_ford-gate ship=@p]
^- tang
::
=^ results1 ford-gate
%- ford-call :*
ford-gate
now=~1234.5.6
scry=scry-is-forbidden
call-args=[duct=~[/empty] type=~ [%keep 0 0]]
expected-moves=~
==
::
=/ ford *ford-gate
=/ state state.ax.+>+<.ford
::
=/ default-state *ford-state:ford
::
=. max-size.compiler-cache.state max-size.compiler-cache.default-state
=. max-size.queue.build-cache.state max-size.queue.build-cache.default-state
=. next-anchor-id.build-cache.state 0
::
%+ welp results1
::
?: =(default-state state)
~
::
=/ build-state=(list tank)
%- zing
%+ turn ~(tap by builds.state)
|= [build=build:ford build-status=build-status:ford]
:~ [%leaf (build-to-tape:ford build)]
[%leaf "requesters: {<requesters.build-status>}"]
[%leaf "clients: {<~(tap in ~(key by clients.build-status))>}"]
==
::
=/ braces [[' ' ' ' ~] ['{' ~] ['}' ~]]
::
:~ [%leaf "failed to cleanup"]
[%leaf "builds.state:"]
[%rose braces build-state]
==
--

View File

@ -1796,12 +1796,231 @@
==
{$c gift:able:clay}
{$d $<(%pack gift:able:dill)}
{$f gift:able:ford}
{$f gift:ford}
[%e gift:able:eyre]
{$g gift:able:gall}
[%i gift:able:iris]
{$j gift:able:jael}
==
::
++ ford
|%
+= gift
$% :: %made: build result; response to %build +task
::
$: %made
:: date: formal date of the build
::
date=@da
:: result: result of the build; either complete build, or error
::
result=made-result
== ==
+= made-result
$% :: %complete: contains the result of the completed build
::
[%complete =build-result]
:: %incomplete: couldn't finish build; contains error message
::
[%incomplete =tang]
==
+= build-result
$% :: %error: the build produced an error whose description is :message
::
[%error message=tang]
:: %success: result of successful +build, tagged by +schematic sub-type
::
$: %success
$^ [head=build-result tail=build-result]
$% [%$ =cage]
[%alts =build-result]
[%bake =cage]
[%bunt =cage]
[%call =vase]
[%cast =cage]
[%core =vase]
[%diff =cage]
[%hood =scaffold]
[%join =cage]
[%list results=(list build-result)]
[%mash =cage]
[%mute =cage]
[%pact =cage]
[%path =rail]
[%plan =vase]
[%reef =vase]
[%ride =vase]
[%scry =cage]
[%slim [=type =nock]]
[%slit =type]
[%vale =cage]
[%volt =cage]
[%walk results=(list mark-action)]
== == ==
+= scaffold
$: :: source-rail: the file this scaffold was parsed from
::
source-rail=rail
:: zuse-version: the kelvin version of the standard library
::
zuse-version=@ud
:: structures: files from %/sur which are included
::
structures=(list cable)
:: libraries: files from %/lib which are included
::
libraries=(list cable)
:: cranes: a list of resources to transform and include
::
cranes=(list crane)
:: sources: hoon sources, either parsed or on the filesystem
::
sources=(list hoon)
==
+= mark-action [type=?(%grow %grab) source=term target=term]
+= rail [=disc =spur]
+$ cable
$: face=(unit term)
file-path=term
==
+= crane
$% $: :: %fssg: `/~` hoon literal
::
:: `/~ <hoon>` produces a crane that evaluates arbitrary hoon.
::
%fssg
=hoon
==
$: :: %fsbc: `/$` process query string
::
:: `/$` will call a gate with the query string supplied to this
:: build. If no query string, this errors.
::
%fsbc
=hoon
==
$: :: %fsbr: `/|` first of many options that succeeds
::
:: `/|` takes a series of cranes and produces the first one
:: (left-to-right) that succeeds. If none succeed, it produces
:: stack traces from all of its arguments.
::
%fsbr
:: choices: cranes to try
::
choices=(list crane)
==
$: :: %fsts: `/=` wrap a face around a crane
::
:: /= runs a crane (usually produced by another ford rune), takes
:: the result of that crane, and wraps a face around it.
::
%fsts
:: face: face to apply
::
face=term
:: crane: internal build step
::
=crane
==
$: :: %fsdt: `/.` null-terminated list
::
:: Produce a null-terminated list from a sequence of cranes,
:: terminated by a `==`.
::
%fsdt
:: items: cranes to evaluate
::
items=(list crane)
==
$: :: %fscm: `/,` switch by path
::
:: `/,` is a switch statement, which picks a branch to evaluate
:: based on whether the current path matches the path in the
:: switch statement. Takes a sequence of pairs of (path, crane)
:: terminated by a `==`.
::
%fscm
:: cases: produces evaluated crane of first +spur match
::
cases=(list (pair spur crane))
==
$: :: %fspm: `/&` pass through a series of marks
::
:: `/&` passes a crane through multiple marks, right-to-left.
::
%fspm
:: marks: marks to apply to :crane, in reverse order
::
marks=(list mark)
=crane
==
$: :: %fscb: `/_` run a crane on each file in the current directory
::
:: `/_` takes a crane as an argument. It produces a new crane
:: representing the result of mapping the supplied crane over the
:: list of files in the current directory. The keys in the
:: resulting map are the basenames of the files in the directory,
:: and each value is the result of running that crane on the
:: contents of the file.
::
%fscb
=crane
==
$: :: %fssm: `/;` operate on
::
:: `/;` takes a hoon and a crane. The hoon should evaluate to a
:: gate, which is then called with the result of the crane as its
:: sample.
::
%fssm
=hoon
=crane
==
$: :: %fscl: `/:` evaluate at path
::
:: `/:` takes a path and a +crane, and evaluates the crane with
:: the current path set to the supplied path.
::
%fscl
:: path: late bound path to be resolved relative to current beak
::
:: This becomes current path of :crane
::
path=truss
=crane
==
$: :: %fskt: `/^` cast
::
:: `/^` takes a +mold and a +crane, and casts the result of the
:: crane to the mold.
::
%fskt
:: mold: evaluates to a mold to be applied to :crane
::
=spec
=crane
==
$: :: %fstr: `/*` run :crane on all files with current path as prefix
::
%fstr
=crane
==
$: :: %fszp: `/!mark/` evaluate as hoon, then pass through mark
::
%fszp
=mark
==
$: :: %fszy: `/mark/` passes current path through :mark
::
%fszy
=mark
== ==
+= truss
$: pre=(unit tyke)
pof=(unit [p=@ud q=tyke])
==
--
--
:: +scry: standard scry
::

View File

@ -7,14 +7,13 @@
:: or classes).
::
:: each of these stages is split into cores for each of
:: arvo's nine major vanes (kernel modules). these are:
:: arvo's eight major vanes (kernel modules). these are:
::
:: - %ames: networking (rhymes with "games")
:: - %behn: scheduling ("bane")
:: - %clay: revision control ("play")
:: - %dill: console ("pill")
:: - %eyre: http server ("fair")
:: - %ford: build ("lord")
:: - %gall: application ("ball")
:: - %iris: http client ("virus")
:: - %jael: security ("jail")
@ -70,6 +69,9 @@
==
::
++ coop (unit ares) :: possible error
:: +disc: a desk on a ship; can be used as a beak that varies with time
::
+$ disc [=ship =desk]
++ life @ud :: ship key revision
++ rift @ud :: ship continuity
++ mime {p/mite q/octs} :: mimetyped data
@ -582,6 +584,13 @@
$% {$delta p/lobe q/{p/mark q/lobe} r/page} :: delta on q
{$direct p/lobe q/page} :: immediate
== ::
:: +cable: a reference to something on the filesystem
:: face: the face to wrap around the imported file
:: file-path: location in clay
+$ cable
$: face=(unit term)
file-path=term
==
++ care ?($a $b $c $d $p $r $s $t $u $v $w $x $y $z) :: clay submode
++ case :: ship desk case spur
$% {$da p/@da} :: date
@ -1177,709 +1186,6 @@
++ user knot :: username
-- ::eyre
:: ::::
:::: ++ford :: (1f) build
:: ::::
:: |ford: build system vane interface
::
++ ford ^?
|%
:: |able:ford: ford's public +move interface
::
++ able ^?
|%
:: +task:able:ford: requests to ford
::
+= task
$~ [%vega ~]
$% :: %build: perform a build, either live or once
::
$: %build
:: live: whether we run this build live
::
:: A live build will subscribe to further updates and keep the
:: build around.
::
live=?
:: plan: the schematic to build
::
=schematic
==
:: %keep: reset cache sizes
::
[%keep compiler-cache=@ud build-cache=@ud]
:: %kill: stop a build; send on same duct as original %build request
::
[%kill ~]
:: trim state (in response to memory pressure)
::
$>(%trim vane-task)
:: %vega: report kernel upgrade
::
$>(%vega vane-task)
:: %wipe: wipes stored builds
::
[%wipe percent-to-remove=@ud]
==
:: +gift:able:ford: responses from ford
::
+= gift
$% :: %made: build result; response to %build +task
::
$: %made
:: date: formal date of the build
::
date=@da
:: result: result of the build; either complete build, or error
::
result=made-result
== ==
--
:: +made-result: the main payload for a %made +gift
::
+= made-result
$% :: %complete: contains the result of the completed build
::
[%complete =build-result]
:: %incomplete: couldn't finish build; contains error message
::
[%incomplete =tang]
==
:: +disc: a desk on a ship; can be used as a beak that varies with time
::
+= disc [=ship =desk]
:: +rail: a time-varying full path
::
:: This can be thought of as a +beam without a +case, which is what
:: would specify the time. :spur is flopped just like the +spur in a +beam.
::
+= rail [=disc =spur]
:: +resource: time-varying dependency on a value from the urbit namespace
::
+= resource
$: :: vane which we are querying
::
vane=%c
:: type of request
::
:: TODO: care:clay should be cleaned up in zuse as it is a general
:: type, not a clay specific one.
::
care=care:clay
:: path on which to depend, missing time, which will be filled in
::
=rail
==
:: +build-result: the referentially transparent result of a +build
::
:: A +build produces either an error or a result. A result is a tagged
:: union of the various kinds of datatypes a build can produce. The tag
:: represents the sub-type of +schematic that produced the result.
::
+= build-result
$% :: %error: the build produced an error whose description is :message
::
[%error message=tang]
:: %success: result of successful +build, tagged by +schematic sub-type
::
$: %success
$^ [head=build-result tail=build-result]
$% [%$ =cage]
[%alts =build-result]
[%bake =cage]
[%bunt =cage]
[%call =vase]
[%cast =cage]
[%core =vase]
[%diff =cage]
[%hood =scaffold]
[%join =cage]
[%list results=(list build-result)]
[%mash =cage]
[%mute =cage]
[%pact =cage]
[%path =rail]
[%plan =vase]
[%reef =vase]
[%ride =vase]
[%scry =cage]
[%slim [=type =nock]]
[%slit =type]
[%vale =cage]
[%volt =cage]
[%walk results=(list mark-action)]
== == ==
:: +mark-action: represents a single mark conversion step
::
:: In mark conversion, we want to convert from :source to :target. We also
:: need to keep track of what type of conversion this is. If %grab, we
:: want to use the definitions in the :target mark. If %grow, we want to
:: use the :source mark.
::
+= mark-action [type=?(%grow %grab) source=term target=term]
::
:: +schematic: plan for building
::
++ schematic
:: If the head of the +schematic is a pair, it's an auto-cons
:: schematic. Its result will be the pair of results of its
:: sub-schematics.
::
$^ [head=schematic tail=schematic]
::
$% :: %$: literal value. Produces its input unchanged.
::
$: %$
:: literal: the value to be produced by the build
::
literal=cage
==
:: %pin: pins a sub-schematic to a date
::
:: There is a difference between live builds and once builds. In
:: live builds, we produce results over and over again and aren't
:: pinned to a specifc time. In once builds, we want to specify a
:: specific date, which we apply recursively to any sub-schematics
:: contained within :schematic.
::
:: If a build has a %pin at the top level, we consider it to be a
:: once build. Otherwise, we consider it to be a live build. We do
:: this so schematics which depend on the result of a once build can
:: be cached, giving the client explicit control over the caching
:: behaviour.
::
$: %pin
:: date: time at which to perform the build
::
date=@da
:: schematic: wrapped schematic of pinned time
::
=schematic
==
:: %alts: alternative build choices
::
:: Try each choice in :choices, in order; accept the first one that
:: succeeds. Note that the result inherits the dependencies of all
:: failed schematics, as well as the successful one.
::
$: %alts
:: choices: list of build options to try
::
choices=(list schematic)
==
:: %bake: run a file through a renderer
::
$: %bake
:: renderer: name of renderer; also its file path in ren/
::
renderer=term
:: query-string: the query string of the renderer's http path
::
query-string=coin
:: path-to-render: full path of file to render
::
path-to-render=rail
==
:: %bunt: produce the default value for a mark
::
$: %bunt
:: disc where in clay to load the mark from
::
=disc
:: mark: name of mark; also its file path in mar/
::
mark=term
==
:: %call: call a gate on a sample
::
$: %call
:: gate: schematic whose result is a gate
::
gate=schematic
:: sample: schematic whose result will be the gate's sample
::
sample=schematic
==
:: %cast: cast the result of a schematic through a mark
::
$: %cast
:: disc where in clay to load the mark from
::
=disc
:: mark: name of mark; also its file path in ren/
::
mark=term
:: input: schematic whose result will be run through the mark
::
input=schematic
==
:: %core: build a hoon program from a source file
::
$: %core
:: source-path: clay path from which to load hoon source
::
source-path=rail
==
:: %diff: produce marked diff from :first to :second
::
$: %diff
:: disc where in clay to load the mark from
::
=disc
:: old: schematic producing data to be used as diff starting point
::
start=schematic
:: new: schematic producing data to be used as diff ending point
::
end=schematic
==
:: %dude: wrap a failure's error message with an extra message
::
$: %dude
:: error: a trap producing an error message to wrap the original
::
error=tank
:: attempt: the schematic to try, whose error we wrap, if any
::
attempt=schematic
==
:: %hood: create a +hood from a hoon source file
::
$: %hood
:: source-path: clay path from which to load hoon source
::
source-path=rail
==
:: %join: merge two diffs into one diff; produces `~` if conflicts
::
$: %join
:: disc where in clay to load the mark from
::
=disc
:: mark: name of the mark to use for diffs; also file path in mar/
::
mark=term
:: first: schematic producing first diff
::
first=schematic
:: second: schematic producing second diff
::
second=schematic
==
:: %list: performs a list of schematics, returns a list of +builds-results
::
$: %list
:: schematics: list of builds to perform
::
schematics=(list schematic)
==
:: %mash: force a merge, annotating any conflicts
::
$: %mash
:: disc where in clay to load the mark from
::
=disc
:: mark: name of mark used in diffs; also file path in mar/
::
mark=term
:: first: marked schematic producing first diff
::
first=[=disc mark=term =schematic]
:: second: marked schematic producing second diff
::
second=[=disc mark=term =schematic]
==
:: %mute: mutate a noun by replacing its wings with new values
::
$: %mute
:: subject: schematic producing the noun to mutate
::
subject=schematic
:: mutations: axes and schematics to produce their new contents
::
mutations=(list (pair wing schematic))
==
:: %pact: patch a marked noun by applying a diff
::
$: %pact
:: disc where in clay to load marks from
::
=disc
:: start: schematic producing a noun to be patched
::
start=schematic
:: diff: schematic producing the diff to apply to :start
::
diff=schematic
==
:: %path: resolve a path with `-`s to a path with `/`s
::
:: Resolve +raw-path to a path containing a file, replacing
:: any `-`s in the path with `/`s if no file exists at the
:: original path. Produces an error if multiple files match,
:: e.g. a/b/c and a/b-c, or a/b/c and a-b/c.
::
$: %path
:: disc: the +disc forming the base of the path to be resolved
::
=disc
:: prefix: path prefix under which to resolve :raw-path, e.g. lib
::
prefix=@tas
:: raw-path: the file path to be resolved
::
raw-path=@tas
==
:: %plan: build a hoon program from a preprocessed source file
::
$: %plan
:: path-to-render: the clay path of a file being rendered
::
:: TODO: Once we've really implemented this, write the
:: documentation. (This is the path that starts out as the path
:: of the hoon source which generated the scaffold, but can be
:: changed with `/:`.)
::
path-to-render=rail
:: query-string: the query string of the http request
::
query-string=coin
:: scaffold: preprocessed hoon source and imports
::
=scaffold
==
:: %reef: produce a hoon+zuse kernel. used internally for caching
::
$: %reef
:: disc: location of sys/hoon/hoon and sys/zuse/hoon
::
=disc
==
:: %ride: eval hoon as formula with result of a schematic as subject
::
$: %ride
:: formula: a hoon to be evaluated against a subject
::
formula=hoon
:: subject: a schematic whose result will be used as subject
::
subject=schematic
==
:: %same: the identity function
::
:: Functionally used to "unpin" a build for caching reasons. If you
:: run a %pin build, it is treated as a once build and is therefore
:: not cached. Wrapping the %pin schematic in a %same schematic
:: converts it to a live build, which will be cached due to live
:: build subscription semantics.
::
$: %same
:: schematic that we evaluate to
::
=schematic
==
:: %scry: lookup a value from the urbit namespace
::
$: %scry
:: resource: a namespace request, with unspecified time
::
:: Schematics can only be resolved when specifying a time,
:: which will convert this +resource into a +scry-request.
::
=resource
==
:: %slim: compile a hoon against a subject type
::
$: %slim
:: compile-time subject type for the :formula
::
subject-type=type
:: formula: a +hoon to be compiled to (pair type nock)
::
formula=hoon
==
:: %slit: get type of gate product
::
$: %slit
:: gate: a vase containing a gate
::
gate=vase
:: sample: a vase containing the :gate's sample
::
sample=vase
==
:: %vale: coerce a noun to a mark, validated
::
$: %vale
:: disc where in clay to load the mark from
::
=disc
:: mark: name of mark to use; also file path in mar/
::
mark=term
:: input: the noun to be converted using the mark
::
input=*
==
:: %volt: coerce a noun to a mark, unsafe
::
$: %volt
:: disc where in clay to load the mark from
::
=disc
:: mark: name of mark to use; also file path in mar/
::
mark=term
:: input: the noun to be converted using the mark
::
input=*
==
:: %walk: finds a mark conversion path between two marks
::
$: %walk
:: disc in clay to load the marks from
::
=disc
:: source: the original mark type
::
source=term
:: target: the destination mark type
::
target=term
==
==
::
:: +scaffold: program construction in progress
::
:: A source file with all its imports and requirements, which will be
:: built and combined into one final product.
::
+= scaffold
$: :: source-rail: the file this scaffold was parsed from
::
source-rail=rail
:: zuse-version: the kelvin version of the standard library
::
zuse-version=@ud
:: structures: files from %/sur which are included
::
structures=(list cable)
:: libraries: files from %/lib which are included
::
libraries=(list cable)
:: cranes: a list of resources to transform and include
::
cranes=(list crane)
:: sources: hoon sources, either parsed or on the filesystem
::
sources=(list hoon)
==
:: +cable: a reference to something on the filesystem
::
+= cable
$: :: face: the face to wrap around the imported file
::
face=(unit term)
:: file-path: location in clay
::
file-path=term
==
:: +truss: late-bound path
::
:: TODO: the +tyke data structure should be rethought, possibly as part
:: of this effort since it is actually a `(list (unit hoon))`, when it
:: only represents @tas. It should be a structure which explicitly
:: represents a path with holes that need to be filled in.
::
+= truss
$: pre=(unit tyke)
pof=(unit [p=@ud q=tyke])
==
:: +crane: parsed rune used to include and transform resources
::
:: Cranes lifting cranes lifting cranes!
::
:: A recursive tree of Ford directives that specifies instructions for
:: including and transforming resources from the Urbit namespace.
::
+= crane
$% $: :: %fssg: `/~` hoon literal
::
:: `/~ <hoon>` produces a crane that evaluates arbitrary hoon.
::
%fssg
=hoon
==
$: :: %fsbc: `/$` process query string
::
:: `/$` will call a gate with the query string supplied to this
:: build. If no query string, this errors.
::
%fsbc
=hoon
==
$: :: %fsbr: `/|` first of many options that succeeds
::
:: `/|` takes a series of cranes and produces the first one
:: (left-to-right) that succeeds. If none succeed, it produces
:: stack traces from all of its arguments.
::
%fsbr
:: choices: cranes to try
::
choices=(list crane)
==
$: :: %fsts: `/=` wrap a face around a crane
::
:: /= runs a crane (usually produced by another ford rune), takes
:: the result of that crane, and wraps a face around it.
::
%fsts
:: face: face to apply
::
face=term
:: crane: internal build step
::
=crane
==
$: :: %fsdt: `/.` null-terminated list
::
:: Produce a null-terminated list from a sequence of cranes,
:: terminated by a `==`.
::
%fsdt
:: items: cranes to evaluate
::
items=(list crane)
==
$: :: %fscm: `/,` switch by path
::
:: `/,` is a switch statement, which picks a branch to evaluate
:: based on whether the current path matches the path in the
:: switch statement. Takes a sequence of pairs of (path, crane)
:: terminated by a `==`.
::
%fscm
:: cases: produces evaluated crane of first +spur match
::
cases=(list (pair spur crane))
==
$: :: %fspm: `/&` pass through a series of marks
::
:: `/&` passes a crane through multiple marks, right-to-left.
::
%fspm
:: marks: marks to apply to :crane, in reverse order
::
marks=(list mark)
=crane
==
$: :: %fscb: `/_` run a crane on each file in the current directory
::
:: `/_` takes a crane as an argument. It produces a new crane
:: representing the result of mapping the supplied crane over the
:: list of files in the current directory. The keys in the
:: resulting map are the basenames of the files in the directory,
:: and each value is the result of running that crane on the
:: contents of the file.
::
%fscb
=crane
==
$: :: %fssm: `/;` operate on
::
:: `/;` takes a hoon and a crane. The hoon should evaluate to a
:: gate, which is then called with the result of the crane as its
:: sample.
::
%fssm
=hoon
=crane
==
$: :: %fscl: `/:` evaluate at path
::
:: `/:` takes a path and a +crane, and evaluates the crane with
:: the current path set to the supplied path.
::
%fscl
:: path: late bound path to be resolved relative to current beak
::
:: This becomes current path of :crane
::
path=truss
=crane
==
$: :: %fskt: `/^` cast
::
:: `/^` takes a +mold and a +crane, and casts the result of the
:: crane to the mold.
::
%fskt
:: mold: evaluates to a mold to be applied to :crane
::
=spec
=crane
==
$: :: %fstr: `/*` run :crane on all files with current path as prefix
::
%fstr
=crane
==
$: :: %fszp: `/!mark/` evaluate as hoon, then pass through mark
::
%fszp
=mark
==
$: :: %fszy: `/mark/` passes current path through :mark
::
%fszy
=mark
== ==
:: +result-to-cage: extract a +cage from a +build-result
::
++ result-to-cage
|= result=build-result
^- cage
?: ?=(%error -.result)
[%tang !>(message.result)]
?- -.+.result
^ [%noun (slop q:$(result head.result) q:$(result tail.result))]
%$ cage.result
%alts $(result build-result.result)
%bake cage.result
%bunt cage.result
%call [%noun vase.result]
%cast cage.result
%core [%noun vase.result]
%diff cage.result
%hood [%noun !>(scaffold.result)]
%join cage.result
%list [%noun -:!>(*(list cage)) (turn results.result result-to-cage)]
%mash cage.result
%mute cage.result
%pact cage.result
%path [%noun !>(rail.result)]
%plan [%noun vase.result]
%reef [%noun vase.result]
%ride [%noun vase.result]
%scry cage.result
%slim [%noun !>([type nock]:result)]
%slit [%noun !>(type.result)]
%vale cage.result
%volt cage.result
%walk [%noun !>(results.result)]
==
:: +result-as-error: extracts a tang out of a made-result
::
++ made-result-as-error
|= result=made-result
^- tang
?: ?=([%incomplete *] result)
tang.result
?: ?=([%complete %error *] result)
message.build-result.result
~
--
:: ::::
:::: ++gall :: (1g) extensions
:: ::::
++ gall ^?
@ -2358,7 +1664,6 @@
gift:able:clay
gift:able:dill
gift:able:eyre
gift:able:ford
gift:able:gall
gift:able:iris
gift:able:jael
@ -2369,7 +1674,6 @@
task:able:behn
task:able:dill
task:able:eyre
task:able:ford
task:able:gall
task:able:iris
task:able:jael
@ -2381,7 +1685,6 @@
{$c task:able:clay}
{$d task:able:dill}
[%e task:able:eyre]
{$f task:able:ford}
{$g task:able:gall}
[%i task:able:iris]
{$j task:able:jael}
@ -2399,7 +1702,6 @@
==
{$c gift:able:clay}
{$d gift:able:dill}
{$f gift:able:ford}
[%e gift:able:eyre]
{$g gift:able:gall}
[%i gift:able:iris]

View File

@ -1,33 +0,0 @@
/- spider
/+ strandio
=, strand=strand:spider
^- thread:spider
|= arg=vase
=+ !<([scratch=desk real=desk ~] arg)
|^
=/ m (strand ,vase)
^- form:m
;< apps=(map path vase) bind:m load-apps
(pure:m !>((~(run by apps) mug)))
::
++ scratch-path
|= [=bowl:spider =path]
(weld /(scot %p our.bowl)/[scratch]/(scot %da now.bowl) path)
::
++ load-apps
=/ m (strand ,(map path vase))
^- form:m
;< =bowl:spider bind:m get-bowl:strandio
=+ .^(=arch %cy (scratch-path bowl /app))
=/ apps ~(tap in ~(key by dir.arch))
=/ rails
%- malt
%+ murn apps
|= =term
^- (unit [^term rail:ford])
=+ .^(=app=^arch %cy (scratch-path bowl /app/[term]))
?. (~(has by dir.app-arch) %hoon)
~
`[/[term] our.bowl^scratch /hoon/[term]/app]
(build-cores:strandio rails)
--

View File

@ -1,4 +1,4 @@
/+ *test, test-ford-external
/+ *test
/= clay-raw /sys/vane/clay
/* hello-gen %hoon /gen/hello/hoon
/* strandio-lib %hoon /lib/strandio/hoon
@ -161,452 +161,6 @@
!> dez:(~(got by vases.cache.nub) /lib/strandio/hoon)
==
::
++ test-info ^- tang
=^ results0 clay-gate
%- clay-call :*
clay-gate
now=~1111.1.1
scry=*sley
call-args=[duct=~[/init] -:!>(*task:able:clay) [%init ~nul]]
expected-moves=~
==
::
=^ results1 clay-gate
%- clay-call-with-comparator :*
clay-gate
now=~1111.1.1
scry=*sley
^= call-args
:+ duct=~[/info] type=-:!>(*task:able:clay)
^- task:able:clay
:+ %info %home
^- nori:clay
:- %&
^- soba:clay
:~ [/file1/noun `miso:clay`[%ins [%noun %noun 'file1']]]
[/file2/noun `miso:clay`[%ins [%noun %noun 'file2']]]
==
^= move-comparator
|= moves=(list move:clay-gate)
^- tang
::
?. ?=([* ~] moves)
[%leaf "wrong number of moves: {<(lent moves)>}"]~
::
^- tang
;: weld
::
^- tang
::
=/ move=move:clay-gate i.moves
=/ =duct p.move
=/ card=(wind note:clay-gate gift:able:clay) q.move
::
%+ weld
(expect-eq !>(~[/info]) !>(duct))
::
?. ?=(%pass -.card)
[%leaf "bad move, not a %pass: {<move>}"]~
::
=/ =wire p.card
::
%+ weld
(expect-eq !>(/commit/home/inserts) !>(wire))
::
=/ note=note:clay-gate q.card
::
?. ?=([%f %build *] note)
[%leaf "bad move, not a %build: {<move>}"]~
::
%+ weld
(expect-eq !>(%.n) !>(live.note))
::
%- expect-schematic:test-ford-external
:_ schematic.note
^- schematic:ford
:+ %pin ~1111.1.1
:- %list
:~ :- [%$ %path -:!>(*path) /file1/noun]
:^ %cast [~nul %home] %noun
[%$ %noun %noun 'file1']
::
:- [%$ %path -:!>(*path) /file2/noun]
:^ %cast [~nul %home] %noun
[%$ %noun %noun 'file2']
==
== ==
::
:: inserting
::
=^ results2 clay-gate
%- clay-take-with-comparator :*
clay-gate
now=~1111.1.1
scry=*sley
^= take-args
:* wire=/commit/home/inserts
duct=~[/info]
-:!>(*sign:clay-gate)
^- sign:clay-gate
:* %f %made ~1111.1.1 %complete %success %list
^- (list build-result:ford)
:~ :+ %success
[%success %$ %path -:!>(*path) /file1/noun]
[%success %cast %noun %noun 'file1']
::
:+ %success
[%success %$ %path -:!>(*path) /file2/noun]
[%success %cast %noun %noun 'file2']
== == ==
^= comparator
|= moves=(list move:clay-gate)
^- tang
::
?. ?=([* ~] moves)
[%leaf "wrong number of moves: {<(lent moves)>}"]~
::
%+ expect-eq
!> ^- move:clay-gate
:- duct=~[/info]
^- (wind note:clay-gate gift:able:clay)
:+ %pass /commit/home/diffs
^- note:clay-gate
:- %f
[%build live=%.n [%pin ~1111.1.1 [%list ~]]]
!> i.moves
== :: ==
::
:: diffing
::
=^ results3 clay-gate
%- clay-take-with-comparator :*
clay-gate
now=~1111.1.1
scry=*sley
^= take-args
:* wire=/commit/home/diffs
duct=~[/info]
-:!>(*sign:clay-gate)
^- sign:clay-gate
[%f %made ~1111.1.1 %complete %success %list ~]
==
^= move-comparator
|= moves=(list move:clay-gate)
^- tang
::
?. ?=([* ~] moves)
[%leaf "wrong number of moves: {<(lent moves)>}"]~
::
%+ expect-eq
!> ^- move:clay-gate
:- duct=~[/info]
^- (wind note:clay-gate gift:able:clay)
:+ %pass /commit/home/casts
^- note:clay-gate
:- %f
[%build live=%.n [%pin ~1111.1.1 [%list ~]]]
!> i.moves
==
::
:: castifying
::
=^ results4 clay-gate
%- clay-take-with-comparator :*
clay-gate
now=~1111.1.1
scry=*sley
^= take-args
:* wire=/commit/home/casts
duct=~[/info]
-:!>(*sign:clay-gate)
^- sign:clay-gate
[%f %made ~1111.1.1 %complete %success %list ~]
==
^= comparator
|= moves=(list move:clay-gate)
^- tang
::
?. ?=([* ~] moves)
[%leaf "wrong number of moves: {<(lent moves)>}"]~
::
=/ move=move:clay-gate i.moves
=/ =duct p.move
=/ card=(wind note:clay-gate gift:able:clay) q.move
::
%+ weld
(expect-eq !>(~[/info]) !>(duct))
::
?. ?=(%pass -.card)
[%leaf "bad move, not a %pass: {<move>}"]~
::
=/ =wire p.card
::
%+ weld
(expect-eq !>(/commit/home/mutates) !>(wire))
::
=/ note=note:clay-gate q.card
::
?. ?=([%f %build *] note)
[%leaf "bad move, not a %build: {<move>}"]~
::
%+ weld
(expect-eq !>(%.n) !>(live.note))
::
%- expect-schematic:test-ford-external
:_ schematic.note
^- schematic:ford
[%pin ~1111.1.1 %list ~]
==
::
:: mutating
::
=^ results5 clay-gate
%- clay-take-with-comparator :*
clay-gate
now=~1111.1.1
scry=*sley
^= take-args
:* wire=/commit/home/mutates
duct=~[/info]
-:!>(*sign:clay-gate)
^- sign:clay-gate
[%f %made ~1111.1.1 %complete %success %list ~]
==
^= comparator
|= moves=(list move:clay-gate)
^- tang
::
?. ?=([* ~] moves)
[%leaf "wrong number of moves: {<(lent moves)>}"]~
::
=/ move=move:clay-gate i.moves
=/ =duct p.move
=/ card=(wind note:clay-gate gift:able:clay) q.move
::
%+ weld
(expect-eq !>(~[/info]) !>(duct))
::
?. ?=(%pass -.card)
[%leaf "bad move, not a %pass: {<move>}"]~
::
=/ =wire p.card
::
%+ weld
(expect-eq !>(/commit/home/checkout) !>(wire))
::
=/ note=note:clay-gate q.card
::
?. ?=([%f %build *] note)
[%leaf "bad move, not a %build: {<move>}"]~
::
%+ weld
(expect-eq !>(%.n) !>(live.note))
::
%- expect-schematic:test-ford-external
:_ schematic.note
^- schematic:ford
:- %list
^- (list schematic:ford)
:~ :- :^ %$ %path-hash -:!>([*path *@uvI])
:- /file1/noun
0v1u.egg7f.h1o7a.22g2g.torgm.2kcfj.k8b3s.n5hlf.57i21.5m1nn.bhob7
::
[%volt [~nul %home] %noun 'file1']
::
:- :^ %$ %path-hash -:!>([*path *@uvI])
:- /file2/noun
0vj.5f6kr.5o1of.dubnd.6k5a7.jprgp.8ifgp.0ljbi.dqau7.7c0q0.fj144
::
[%volt [~nul %home] %noun 'file2']
== ==
::
:: patching
::
=^ results6 clay-gate
%- clay-take :*
clay-gate
now=~1111.1.1
scry=*sley
^= take-args
:* wire=/commit/home/checkout
duct=~[/info]
-:!>(*sign:clay-gate)
^- sign:clay-gate
:* %f %made ~1111.1.1 %complete %success %list
^- (list build-result:ford)
:~ :+ %success
:* %success %$ %path-hash -:!>([*path *@uvI])
/file1/noun
0v1u.egg7f.h1o7a.22g2g.torgm.2kcfj.
k8b3s.n5hlf.57i21.5m1nn.bhob7
==
[%success %volt %noun %noun 'file1']
::
:+ %success
:* %success %$ %path-hash -:!>([*path *@uvI])
/file2/noun
0vj.5f6kr.5o1of.dubnd.6k5a7.jprgp.
8ifgp.0ljbi.dqau7.7c0q0.fj144
==
[%success %volt %noun %noun 'file2']
== == ==
^= expected-moves
:~ :* duct=~[/init] %give %note '+' %rose ["/" "/" ~]
:~ [%leaf "~nul"]
[%leaf "home"]
[%leaf "1"]
[%leaf "file1"]
[%leaf "noun"]
== ==
::
:* duct=~[/init] %give %note '+' %rose ["/" "/" ~]
:~ [%leaf "~nul"]
[%leaf "home"]
[%leaf "1"]
[%leaf "file2"]
[%leaf "noun"]
== == == ==
:: make a second write request during the same arvo event
::
:: This should produce a Behn timer at `now` to run the write
:: request.
::
=^ results7 clay-gate
%- clay-call-with-comparator :*
clay-gate
now=~1111.1.1
scry=*sley
^= call-args
:+ duct=~[/info2] type=-:!>(*task:able:clay)
^- task:able:clay
:+ %info %home
^- nori:clay
:- %&
^- soba:clay
:~ [/file3/noun `miso:clay`[%ins [%noun %noun 'file3']]]
[/file4/noun `miso:clay`[%ins [%noun %noun 'file4']]]
==
^= comparator
|= moves=(list move:clay-gate)
^- tang
::
?. ?=([* ~] moves)
[%leaf "wrong number of moves: {<moves>}"]~
::
=/ move=move:clay-gate i.moves
=/ =duct p.move
=/ card=(wind note:clay-gate gift:able:clay) q.move
::
%+ weld
(expect-eq !>(~[/info2]) !>(duct))
::
?. ?=(%pass -.card)
[%leaf "bad move, not a %pass: {<move>}"]~
::
=/ =wire p.card
::
%+ weld
(expect-eq !>(/queued-request) !>(wire))
::
=/ note=note:clay-gate q.card
::
?. ?=([%b %wait *] note)
[%leaf "bad move, not a %wait: {<move>}"]~
::
(expect-eq !>(~1111.1.1) !>(p.note))
==
::
=^ results8 clay-gate
%- clay-take-with-comparator :*
clay-gate
now=~2222.2.2
scry=*sley
^= take-args
:* wire=/queued-request
duct=~[/info2]
-:!>(*sign:clay-gate)
^- sign:clay-gate
[%b %wake ~]
==
^= comparator
|= moves=(list move:clay-gate)
^- tang
::
?. ?=([* * * ~] moves)
[%leaf "wrong number of moves: {<(lent moves)>}"]~
::
^- tang
;: weld
%+ expect-eq
!> ^- move:clay-gate
:- duct=~[/info2]
^- (wind note:clay-gate gift:able:clay)
:+ %pass /castifying/~nul/home/~2222.2.2
^- note:clay-gate
:- %f
[%build live=%.n [%pin ~2222.2.2 [%list ~]]]
!> i.moves
::
%+ expect-eq
!> ^- move:clay-gate
:- duct=~[/info2]
^- (wind note:clay-gate gift:able:clay)
:+ %pass /diffing/~nul/home/~2222.2.2
^- note:clay-gate
:- %f
[%build live=%.n [%pin ~2222.2.2 [%list ~]]]
!> i.t.moves
::
^- tang
::
=/ move=move:clay-gate i.t.t.moves
=/ =duct p.move
=/ card=(wind note:clay-gate gift:able:clay) q.move
::
%+ weld
(expect-eq !>(~[/info2]) !>(duct))
::
?. ?=(%pass -.card)
[%leaf "bad move, not a %pass: {<move>}"]~
::
=/ =wire p.card
::
%+ weld
(expect-eq !>(/inserting/~nul/home/~2222.2.2) !>(wire))
::
=/ note=note:clay-gate q.card
::
?. ?=([%f %build *] note)
[%leaf "bad move, not a %build: {<move>}"]~
::
%+ weld
(expect-eq !>(%.n) !>(live.note))
::
%- expect-schematic:test-ford-external
:_ schematic.note
^- schematic:ford
:+ %pin ~2222.2.2
:- %list
:~ :- [%$ %path -:!>(*path) /file3/noun]
:^ %cast [~nul %home] %noun
[%$ %noun %noun 'file3']
::
:- [%$ %path -:!>(*path) /file4/noun]
:^ %cast [~nul %home] %noun
[%$ %noun %noun 'file4']
==
== ==
::
;: welp
results0
results1
results2
results3
results4
results5
results6
results7
==
:: |utilities: helper functions for testing
::
:: TODO: make these utilities generic for any vane

View File

@ -1,4 +1,4 @@
/+ *test, *test-ford-external
/+ *test
/= eyre-raw /sys/vane/eyre
::
!: