Files
memex/projects/psf-core/tests/verification.org

1.9 KiB

PSF Core: Literate Verification

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

(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)

1. Perception Logic

We must verify that the agent can distinguish between a Draft PRD and a Frozen PRD.

(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)))))

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).

(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))))

3. GTD Integration

(test sync-gtd-property
  "Verify that the :PSF-STATE: property update returns success."
  (is (eq t (psf-sync-gtd "mock-project" :BLUEPRINT))))

4. Chaos Integrity

The Chaos Gauntlet must be able to simulate a dependency failure and return a report.

(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")))))

Execution

(run! 'psf-core-suite)