Harissa, the Moroccan sauce made with various peppers, spices and oil, probably evolved over a long period of time, so its origin is unlikely to be discovered. But it seems to first have been mentioned in European texts in 1881 in Our mission to the court of Marocco in 1880: under Sir John Drummond Hay ... by Philip Durham Trotter: "harissa, a mixture of crushed wheat, meat, and marrow"
It is clear from this description that it has already changed in the century since.
While it might seem unlikely one could go back further, a much earlier reference to the word at least is found in the Kitab al tabikh fi-l-Maghrib wa-l-Andalus fi `asr al-Muwahhidin, limu'allif majhul. (The Book of Cooking in Maghreb and Andalus in the era of Almohads, by an unknown author) which has been made available by Candida Martinelli's as a 13th Century Al-Andalus Cookbook ( from "a translation by Charles Perry, working from the original Arabic, a printed copy of the Arabic and its translation into Spanish, and assisted by an English translation by various persons translating collaboratively the text from Spanish to English."
There one finds, first:
Information about Harîsa According to its Kinds [savory meat puddings] Harisa is heating, moist, very nutritious, strengthening and fertilizing for dry, thin bodies. It increases blood and sperm, with increased ability in coitus, but makes digestion and good bowel elimination difficult. .....(The entry is long), then:
The Method of Making It [savory wheat, meat mush]
Take good wheat and soak it in water. Then pound it in a wooden or stone mortar until it is free from husks. Then shake it and put the clean wheat [its marrow] in a pot with clean red meat and cover it with a lot of fresh water. Put it on a strong fire until it falls apart.
Then stir it very forcefully until it becomes blended and one part blends into the other. Then pour on enough melted fresh fat to cover it and beat it together until it is mixed. When it seems that the fat begins to separate and remain on top, turn it onto a platter andcover it with salted fat. Sprinkle it with ground cinnamon and use it as you please.
This sounds nothing like today's harissa, but it does sound more like that described in 1881.
And is there more to be found? Perhaps. The above already goes surprisingly far, but, somewhere in untranslated records, still more information may yet lurk.