;
; test-continuous.scm - Test the unified continuous learning approach
;
; Shows how counting + PMI works BOTH directions:
; UP: words → clusters (similarity)
; DOWN: concepts → grounding (operational associations)
;
(primitive-load "continuous-learner.scm")
(display "=== Unified Continuous Learning Test ===\n\n")
;; Feed ANProto-related text
(display "Feeding ANProto knowledge...\n")
(process-text! "ANProto is a signing protocol for messages")
(process-text! "ANProto uses Ed25519 signatures")
(process-text! "to create a message you need a keypair")
(process-text! "the keypair contains a public key and a secret key")
(process-text! "sign takes a keypair and a payload and returns a signature")
(process-text! "verify checks if the signature is valid for the message")
(process-text! "send transmits the signed message over the network")
(process-text! "wirecore uses ANProto to send and receive messages")
;; Also feed some general animal text for clustering comparison
(display "Feeding animal knowledge for clustering comparison...\n")
(process-text! "fish swim in water")
(process-text! "birds fly in sky")
(process-text! "dogs run on ground")
(process-text! "cats climb trees")
(process-text! "fish have fins and gills")
(process-text! "birds have wings and feathers")
(display "\n")
(display (show-stats))
(display "\n\n")
;; Check specific units
(display "=== ANProto Grounding Analysis ===\n\n")
(display "--- 'anproto' ---\n")
(display (show-unit "anproto"))
(display "\n\n")
(display "--- 'message' ---\n")
(display (show-unit "message"))
(display "\n\n")
(display "--- 'sign' ---\n")
(display (show-unit "sign"))
(display "\n\n")
(display "--- 'keypair' ---\n")
(display (show-unit "keypair"))
(display "\n\n")
;; Check clustering (going UP)
(display "=== Clustering (Going UP) ===\n\n")
(display "--- 'fish' (should cluster with animals) ---\n")
(display (show-unit "fish"))
(display "\n\n")
(display "--- 'birds' ---\n")
(display (show-unit "birds"))
(display "\n\n")
;; Show grounding status
(display "=== Grounding Status ===\n\n")
(display (show-grounded))
(display "\n\n")
;; Show gaps (going DOWN - what we don't know)
(display "=== Knowledge Gaps (Going DOWN) ===\n\n")
(display (show-gaps 10))
(display "\n")