Strong suspicion I've made the same changes on Ploughwright and on Mason

But I'll get them all into Git then sort them out.
This commit is contained in:
Simon Brooke 2025-08-21 15:02:03 +01:00
parent ae26a393e8
commit 792ad6fbfa

View file

@ -2,7 +2,7 @@
"Knowledge base to use in testing."
(:require
[arboretum.dengine.case :refer [make-case]]
[arboretum.dengine.core :refer [add-dtree! add-feature!]]
[arboretum.dengine.core :refer [add-dtree!]]
[arboretum.dengine.feature :refer [make-feature]]
[arboretum.dengine.kb :refer [!kb]]
[arboretum.dengine.node :refer [make-node]]
@ -37,7 +37,20 @@
(reset! !kb testkb)
(add-feature! "Is entitled to Widows' Allowance" :is-entitled-to-widows-allowance false nil)
;; TODO:
;; we can't add a node in `add-feature!` since creating the root node requires
;; that the feature already exists. So the 'rootnode' argument to `add-feature`
;; and make-feature is not useful and should be deleted. We also need to test
;; when adding a dtree to an existing feature that the rootnode references that
;; feature.
;; OK, it's worse than that. We can't persist and restore a knowledge base in
;; which features are directly linked from DTree nodes, since then we would
;; (probably) create multiple copies of the feature when reloading. So probably
;; the node should only hold the id of the feature, not a direct link.
;; This does mean, however, that the node could be made at feature creation
;; time.
(add-dtree! :is-entitled-to-widows-allowance
(make-node :is-entitled-to-widows-allowance false