stress-task-lifecycle
A larger project that exercises several parts of the format together.
Our implementation passes this case when its check --json output for the input below equals the expected
output.
Input
nodes/accepted.md---
id: accepted
type: state
plane: p
fields:
initial: false
terminal: false
links:
- type: transitions-to
to: delivered
fields: {on: deliver}
- type: transitions-to
to: cancelled
---nodes/cancelled.md---
id: cancelled
type: state
plane: p
fields:
initial: false
terminal: true
---nodes/declined.md---
id: declined
type: state
plane: p
fields:
initial: false
terminal: true
links:
- type: transitions-to
to: requested
fields: {on: retry}
---nodes/delivered.md---
id: delivered
type: state
plane: p
fields:
initial: false
terminal: true
---nodes/orphan.md---
id: orphan
type: state
plane: p
fields:
initial: false
terminal: true
---nodes/p.md---
id: p
type: plane
fields:
order: 1
---nodes/r-entry.md---
id: r-entry
type: rule
fields:
statement: s
applies_to: {type: state, initial: false}
check: {require_link: {type: transitions-to, dir: in}}
---nodes/r-event.md---
id: r-event
type: rule
fields:
statement: s
severity: error
applies_to: {type: state}
check: {require_link_fields: {type: transitions-to, fields: [on]}}
---nodes/r-exit.md---
id: r-exit
type: rule
fields:
statement: s
severity: error
applies_to: {type: state, terminal: false}
check: {require_link: {type: transitions-to}}
---nodes/r-final.md---
id: r-final
type: rule
fields:
statement: s
severity: error
applies_to: {type: state, terminal: true}
check: {require_link: {type: transitions-to, max: 0}}
---nodes/requested.md---
id: requested
type: state
plane: p
fields:
initial: true
terminal: false
links:
- type: transitions-to
to: accepted
fields: {on: accept}
- type: transitions-to
to: declined
fields: {on: decline}
---nodes/stuck.md---
id: stuck
type: state
plane: p
fields:
initial: false
terminal: false
---Expected output
1 ghosts · 0 load errors · 12 nodes · 20 results
expected.json{
"ghosts": [
{
"link": "transitions-to",
"node": "stuck",
"plane": "p",
"rule": "r-exit",
"to_type": null
}
],
"load_errors": [],
"nodes": [
{
"body": "",
"fields": {
"initial": false,
"terminal": false
},
"id": "accepted",
"links": [
{
"fields": {
"on": "deliver"
},
"to": "delivered",
"type": "transitions-to"
},
{
"to": "cancelled",
"type": "transitions-to"
}
],
"parent": null,
"plane": "p",
"title": "accepted",
"type": "state"
},
{
"body": "",
"fields": {
"initial": false,
"terminal": true
},
"id": "cancelled",
"links": [],
"parent": null,
"plane": "p",
"title": "cancelled",
"type": "state"
},
{
"body": "",
"fields": {
"initial": false,
"terminal": true
},
"id": "declined",
"links": [
{
"fields": {
"on": "retry"
},
"to": "requested",
"type": "transitions-to"
}
],
"parent": null,
"plane": "p",
"title": "declined",
"type": "state"
},
{
"body": "",
"fields": {
"initial": false,
"terminal": true
},
"id": "delivered",
"links": [],
"parent": null,
"plane": "p",
"title": "delivered",
"type": "state"
},
{
"body": "",
"fields": {
"initial": false,
"terminal": true
},
"id": "orphan",
"links": [],
"parent": null,
"plane": "p",
"title": "orphan",
"type": "state"
},
{
"body": "",
"fields": {
"order": 1
},
"id": "p",
"links": [],
"parent": null,
"plane": null,
"title": "p",
"type": "plane"
},
{
"body": "",
"fields": {
"applies_to": {
"initial": false,
"type": "state"
},
"check": {
"require_link": {
"dir": "in",
"type": "transitions-to"
}
},
"statement": "s"
},
"id": "r-entry",
"links": [],
"parent": null,
"plane": null,
"title": "r-entry",
"type": "rule"
},
{
"body": "",
"fields": {
"applies_to": {
"type": "state"
},
"check": {
"require_link_fields": {
"fields": [
"on"
],
"type": "transitions-to"
}
},
"severity": "error",
"statement": "s"
},
"id": "r-event",
"links": [],
"parent": null,
"plane": null,
"title": "r-event",
"type": "rule"
},
{
"body": "",
"fields": {
"applies_to": {
"terminal": false,
"type": "state"
},
"check": {
"require_link": {
"type": "transitions-to"
}
},
"severity": "error",
"statement": "s"
},
"id": "r-exit",
"links": [],
"parent": null,
"plane": null,
"title": "r-exit",
"type": "rule"
},
{
"body": "",
"fields": {
"applies_to": {
"terminal": true,
"type": "state"
},
"check": {
"require_link": {
"max": 0,
"type": "transitions-to"
}
},
"severity": "error",
"statement": "s"
},
"id": "r-final",
"links": [],
"parent": null,
"plane": null,
"title": "r-final",
"type": "rule"
},
{
"body": "",
"fields": {
"initial": true,
"terminal": false
},
"id": "requested",
"links": [
{
"fields": {
"on": "accept"
},
"to": "accepted",
"type": "transitions-to"
},
{
"fields": {
"on": "decline"
},
"to": "declined",
"type": "transitions-to"
}
],
"parent": null,
"plane": "p",
"title": "requested",
"type": "state"
},
{
"body": "",
"fields": {
"initial": false,
"terminal": false
},
"id": "stuck",
"links": [],
"parent": null,
"plane": "p",
"title": "stuck",
"type": "state"
}
],
"results": [
{
"node": "accepted",
"rule": "r-entry",
"severity": "warn",
"status": "pass"
},
{
"node": "accepted",
"rule": "r-event",
"severity": "error",
"status": "fail"
},
{
"node": "accepted",
"rule": "r-exit",
"severity": "error",
"status": "pass"
},
{
"node": "cancelled",
"rule": "r-entry",
"severity": "warn",
"status": "pass"
},
{
"node": "cancelled",
"rule": "r-event",
"severity": "error",
"status": "pass"
},
{
"node": "cancelled",
"rule": "r-final",
"severity": "error",
"status": "pass"
},
{
"node": "declined",
"rule": "r-entry",
"severity": "warn",
"status": "pass"
},
{
"node": "declined",
"rule": "r-event",
"severity": "error",
"status": "pass"
},
{
"node": "declined",
"rule": "r-final",
"severity": "error",
"status": "fail"
},
{
"node": "delivered",
"rule": "r-entry",
"severity": "warn",
"status": "pass"
},
{
"node": "delivered",
"rule": "r-event",
"severity": "error",
"status": "pass"
},
{
"node": "delivered",
"rule": "r-final",
"severity": "error",
"status": "pass"
},
{
"node": "orphan",
"rule": "r-entry",
"severity": "warn",
"status": "fail"
},
{
"node": "orphan",
"rule": "r-event",
"severity": "error",
"status": "pass"
},
{
"node": "orphan",
"rule": "r-final",
"severity": "error",
"status": "pass"
},
{
"node": "requested",
"rule": "r-event",
"severity": "error",
"status": "pass"
},
{
"node": "requested",
"rule": "r-exit",
"severity": "error",
"status": "pass"
},
{
"node": "stuck",
"rule": "r-entry",
"severity": "warn",
"status": "fail"
},
{
"node": "stuck",
"rule": "r-event",
"severity": "error",
"status": "pass"
},
{
"node": "stuck",
"rule": "r-exit",
"severity": "error",
"status": "fail"
}
],
"structure": {
"errors": [],
"warnings": []
}
}