;;; TDD Suite: org-skill-scribe (Distillation & Audit) ;;; Status: RED ;;; Author: Tech-Analyst-Agent ;;; Created: [2026-03-31 Tue 14:00] (defpackage :org-skill-scribe-tests (:use :cl :fiveam :org-skill-scribe)) (in-package :org-skill-scribe-tests) (def-suite scribe-pipeline-suite :description "Tests for the Scribe distillation and audit pipeline.") (in-suite scribe-pipeline-suite) ;;; --- 2.1 State Perception Tests --- (test scan-for-knowledge-gaps "Ensure the scribe correctly identifies new daily files via Git." ;; Requires mock Git environment (skip "Mock Git environment required.")) ;;; --- 2.2 Concept Distillation Tests --- (test distill-concept-with-backlink "Ensure a concept is transformed into an atomic note with provenance." (let ((daily-path "/tmp/scribe-daily.org") (concept '(:title "Lisp Machine Mandate" :content "The system must be fully introspectable." :source "daily/2026-03-31.org"))) (let ((note-path (scribe-distill-concept daily-path concept))) (is (cl-ppcre:scan "lisp_machine_mandate.org" note-path)) (is (cl-ppcre:scan "Source: \\[\\[file:daily/2026-03-31.org\\]\\]" (uiop:read-file-string note-path)))))) ;;; --- 2.3 Mandate Auditing Tests --- (test audit-compliant-project "Ensure a project with PRD and PROTOCOL passes the audit." (let ((project-name "compliant-project")) ;; Logic to scaffold a mock compliant project (is (null (scribe-audit-foundry-mandate project-name))))) (test audit-missing-protocol "Ensure a project missing a PROTOCOL.org is flagged." (let ((project-name "broken-project")) ;; Logic to scaffold a mock project missing protocol (let ((violations (scribe-audit-foundry-mandate project-name))) (is (member :missing-protocol violations)))))