Files
memex/projects/org-skill-project-foundry/tests/verification.org

62 lines
1.9 KiB
Org Mode

#+TITLE: PSF Core: Literate Verification
#+ID: psf-core-verification
#+PROPERTY: header-args :tangle test-suite.lisp
* Overview
This document defines the *Success Criteria* for the PSF Core Role Automation. It ensures that our agents are perceiving and enforcing the Consensus Loop correctly.
* Test Setup
#+begin_src lisp
(defpackage :psf-core-tests
(:use :cl :fiveam :org-agent))
(in-package :psf-core-tests)
(def-suite psf-core-suite :description "Consensus Loop Automation Tests")
(in-suite psf-core-suite)
#+end_src
* 1. Perception Logic
We must verify that the agent can distinguish between a Draft PRD and a Frozen PRD.
#+begin_src lisp
(test perceive-frozen-prd
"Verify that a project with a FROZEN PRD is correctly identified as being in Phase B."
(let ((mock-prd "#+TITLE: Mock\n#+STATUS: FROZEN"))
(is (eq :BLUEPRINT (psf-perceive-state "mock-project" mock-prd)))))
#+end_src
* 2. Mandate Enforcement
The system must raise a `mandate-violation` if a transition to the Build phase is attempted without passing the Quality gate (Tests).
#+begin_src lisp
(test block-build-without-tests
"Ensure the system blocks transition to :BUILD if the tests directory is missing or empty."
(let ((mock-project "empty-project"))
(signals mandate-violation
(psf-transition-gate mock-project :SUCCESS :BUILD))))
#+end_src
* 3. GTD Integration
...
#+begin_src lisp
(test sync-gtd-property
"Verify that the :PSF-STATE: property update returns success."
(is (eq t (psf-sync-gtd "mock-project" :BLUEPRINT))))
#+end_src
* 4. Chaos Integrity
The Chaos Gauntlet must be able to simulate a dependency failure and return a report.
#+begin_src lisp
(test simulate-sabotage
"Verify that the Chaos Specialist can detect an injected failure."
(let ((project "chaos-test"))
(is (search "FAIL" (psf-sabotage-dependency project "sqlite3")))))
#+end_src
* Execution
#+begin_src lisp
(run! 'psf-core-suite)
#+end_src