This tool provides a structured way to define requirements, understand their dependencies, and verify that each requirement is truly satisfied.
The workflow is intentionally simple and iterative:
Start with the goal → work backward to understand dependencies → define verifications → ( ... verify → close dependency → ...)
Inspired by a linear "IN ORDER TO, AS A, I NEED A" sequence, but composed as a hierarchy in order to avoid atomic dependencies.
Add root task to the contractsGraph/moon.yml
isDocPrinted:
command: "bash ./isDocPrinted.sh"
stateDiagram-v2
isDocPrinted
Add dependency task
isPrinterOn:
command: "bash ./isPrinterOn.sh"
deps:
- "isDocPrinted"
stateDiagram-v2
isDocPrinted --> isPrinterOn: require
#!/bin/bash
set -e
echo ""
echo " file: isDocPrinted.sh"
echo " description: Verifying if the document is ready."
echo ""
echo " Please perform the following in another terminal:"
echo " 1. Go to the desk and ask for the paper."
echo ""
echo "Send OK if login succeeded, press ENTER if login failed."
read VALUE
if [ -n "$VALUE" ]; then
echo "✅ [tty] verification passed: Doc is received"
exit 0
else
echo "❌ [tty] verification failed: Something gone wrong"
exit 1
fi#!/bin/bash
set -e
echo ""
echo " file: isPrinterOn.sh"
echo " description: Verifying if printer is ready."
echo ""
VALUE="$(curl -s -o /dev/null -w '%{http_code}' http://printer:8080)"
if [ "$VALUE" = "200" ]; then
echo "✅ [tty] verification passed: Printer is ready"
exit 0
else
echo "❌ [tty] verification failed: Printer is offline"
exit 1
fimoon run contractsGraph:isDocPrinted
moon task-graph --json > ./test/moonGraphTestData.json
moon2merm --moonGraph ./test/moonGraphTestData.json --runReport ./.moon/cache/runReport.json --outdir ./test
stateDiagram-v2
🔵isDocPrinted --> 🔵isPrinterOn : 🔵require
🔵isPrinterOn --> 🟢void : 🟢require
- Turn on the printer
stateDiagram-v2
🔵isDocPrinted --> 🟢isPrinterOn : 🟢require
🟢isPrinterOn --> 🟢void : 🟢require
- Print the doc
stateDiagram-v2
🟢isDocPrinted --> 🟢isPrinterOn : 🟢require
🟢isPrinterOn --> 🟢void : 🟢require