plan-verify 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/ci.yml +48 -0
- package/README.md +1431 -2
- package/assets/icon.png +0 -0
- package/assets/logo-mark.png +0 -0
- package/assets/logo.png +0 -0
- package/examples/checkout.ears.md +74 -0
- package/examples/order-always.ears.md +3 -0
- package/examples/order-awkward.ears.md +8 -0
- package/examples/order-bad.json +1 -0
- package/examples/order-chain.ears.md +9 -0
- package/examples/order-chosen.ears.md +7 -0
- package/examples/order-clear.ears.md +8 -0
- package/examples/order-combined.ears.md +10 -0
- package/examples/order-conflict.ears.md +8 -0
- package/examples/order-covered.ears.md +9 -0
- package/examples/order-duplicate.ears.md +8 -0
- package/examples/order-fail.json +5 -0
- package/examples/order-misuse.ears.md +7 -0
- package/examples/order-negation.ears.md +7 -0
- package/examples/order-pass.json +5 -0
- package/examples/order-quantity.ears.md +8 -0
- package/examples/order-redundant.ears.md +9 -0
- package/examples/order-repair.ears.md +9 -0
- package/examples/order-repeat.ears.md +13 -0
- package/examples/order-same.ears.md +3 -0
- package/examples/order-status.ears.md +7 -0
- package/examples/order-unanswered.ears.md +8 -0
- package/examples/order-unhandled.ears.md +8 -0
- package/examples/order-unmeasured.ears.md +10 -0
- package/examples/order-unused.ears.md +13 -0
- package/examples/order-vacuous.ears.md +9 -0
- package/examples/order-vague.ears.md +7 -0
- package/examples/order-wide.ears.md +5 -0
- package/examples/order-wording.ears.md +8 -0
- package/examples/order.ears.md +7 -0
- package/examples/payment-if.ears.md +7 -0
- package/examples/plan-to-problems/README.md +54 -0
- package/examples/plan-to-problems/expected-problems.md +25 -0
- package/examples/plan-to-problems/generate.mjs +186 -0
- package/examples/plan-to-problems/generated.ears.md +27 -0
- package/examples/plan-to-problems/lint.json +576 -0
- package/examples/plan-to-problems/plan.md +5 -0
- package/examples/plan-to-problems/planted.txt +5 -0
- package/examples/plan-to-problems/problems.md +112 -0
- package/examples/status-placed.ears.md +3 -0
- package/package.json +25 -4
- package/scripts/install-scriptc.sh +16 -0
- package/skills/plan-verify/SKILL.md +1515 -0
- package/src/check.ts +250 -0
- package/src/decide.ts +1324 -0
- package/src/ears.ts +1520 -0
- package/src/jsonvalue.ts +228 -0
- package/src/lint.ts +1245 -0
- package/src/main.ts +273 -0
- package/src/policy.ts +148 -0
- package/src/repair.ts +567 -0
- package/src/report.ts +329 -0
- package/src/scenarios.ts +149 -0
- package/src/smt.ts +97 -0
- package/src/solver.ts +868 -0
- package/src/spec.ts +307 -0
- package/src/term.ts +331 -0
- package/src/text.ts +95 -0
- package/test/fixtures/malformed.ears.md +3 -0
- package/test/fixtures/unknown-phrase.ears.md +5 -0
- package/test/golden/check-fail-json.exit +1 -0
- package/test/golden/check-fail-json.stderr +0 -0
- package/test/golden/check-fail-json.stdout +13 -0
- package/test/golden/check-fail.exit +1 -0
- package/test/golden/check-fail.stderr +0 -0
- package/test/golden/check-fail.stdout +7 -0
- package/test/golden/check-pass-json.exit +1 -0
- package/test/golden/check-pass-json.stderr +0 -0
- package/test/golden/check-pass-json.stdout +6 -0
- package/test/golden/check-pass.exit +1 -0
- package/test/golden/check-pass.stderr +0 -0
- package/test/golden/check-pass.stdout +3 -0
- package/test/golden/emit-smt-json-usage.exit +1 -0
- package/test/golden/emit-smt-json-usage.stderr +0 -0
- package/test/golden/emit-smt-json-usage.stdout +4 -0
- package/test/golden/emit-smt-json.exit +1 -0
- package/test/golden/emit-smt-json.stderr +0 -0
- package/test/golden/emit-smt-json.stdout +5 -0
- package/test/golden/emit-smt.exit +1 -0
- package/test/golden/emit-smt.stderr +0 -0
- package/test/golden/emit-smt.stdout +10 -0
- package/test/golden/help.exit +1 -0
- package/test/golden/help.stderr +0 -0
- package/test/golden/help.stdout +8 -0
- package/test/golden/lint-awkward.exit +1 -0
- package/test/golden/lint-awkward.stderr +0 -0
- package/test/golden/lint-awkward.stdout +29 -0
- package/test/golden/lint-chain.exit +1 -0
- package/test/golden/lint-chain.stderr +0 -0
- package/test/golden/lint-chain.stdout +56 -0
- package/test/golden/lint-checkout.exit +1 -0
- package/test/golden/lint-checkout.stderr +0 -0
- package/test/golden/lint-checkout.stdout +301 -0
- package/test/golden/lint-clean.exit +1 -0
- package/test/golden/lint-clean.stderr +0 -0
- package/test/golden/lint-clean.stdout +9 -0
- package/test/golden/lint-clear.exit +1 -0
- package/test/golden/lint-clear.stderr +0 -0
- package/test/golden/lint-clear.stdout +9 -0
- package/test/golden/lint-conflict-json.exit +1 -0
- package/test/golden/lint-conflict-json.stderr +0 -0
- package/test/golden/lint-conflict-json.stdout +80 -0
- package/test/golden/lint-conflict.exit +1 -0
- package/test/golden/lint-conflict.stderr +0 -0
- package/test/golden/lint-conflict.stdout +41 -0
- package/test/golden/lint-duplicate.exit +1 -0
- package/test/golden/lint-duplicate.stderr +0 -0
- package/test/golden/lint-duplicate.stdout +14 -0
- package/test/golden/lint-gap.exit +1 -0
- package/test/golden/lint-gap.stderr +0 -0
- package/test/golden/lint-gap.stdout +12 -0
- package/test/golden/lint-misuse.exit +1 -0
- package/test/golden/lint-misuse.stderr +0 -0
- package/test/golden/lint-misuse.stdout +18 -0
- package/test/golden/lint-negation.exit +1 -0
- package/test/golden/lint-negation.stderr +0 -0
- package/test/golden/lint-negation.stdout +13 -0
- package/test/golden/lint-quantity.exit +1 -0
- package/test/golden/lint-quantity.stderr +0 -0
- package/test/golden/lint-quantity.stdout +41 -0
- package/test/golden/lint-redundant.exit +1 -0
- package/test/golden/lint-redundant.stderr +0 -0
- package/test/golden/lint-redundant.stdout +14 -0
- package/test/golden/lint-repair-json.exit +1 -0
- package/test/golden/lint-repair-json.stderr +0 -0
- package/test/golden/lint-repair-json.stdout +127 -0
- package/test/golden/lint-repair.exit +1 -0
- package/test/golden/lint-repair.stderr +0 -0
- package/test/golden/lint-repair.stdout +54 -0
- package/test/golden/lint-repeat.exit +1 -0
- package/test/golden/lint-repeat.stderr +0 -0
- package/test/golden/lint-repeat.stdout +48 -0
- package/test/golden/lint-status.exit +1 -0
- package/test/golden/lint-status.stderr +0 -0
- package/test/golden/lint-status.stdout +44 -0
- package/test/golden/lint-unanswered.exit +1 -0
- package/test/golden/lint-unanswered.stderr +0 -0
- package/test/golden/lint-unanswered.stdout +12 -0
- package/test/golden/lint-unhandled.exit +1 -0
- package/test/golden/lint-unhandled.stderr +0 -0
- package/test/golden/lint-unhandled.stdout +12 -0
- package/test/golden/lint-unmeasured.exit +1 -0
- package/test/golden/lint-unmeasured.stderr +0 -0
- package/test/golden/lint-unmeasured.stdout +13 -0
- package/test/golden/lint-unused-json.exit +1 -0
- package/test/golden/lint-unused-json.stderr +0 -0
- package/test/golden/lint-unused-json.stdout +37 -0
- package/test/golden/lint-unused.exit +1 -0
- package/test/golden/lint-unused.stderr +0 -0
- package/test/golden/lint-unused.stdout +25 -0
- package/test/golden/lint-vacuous-json.exit +1 -0
- package/test/golden/lint-vacuous-json.stderr +0 -0
- package/test/golden/lint-vacuous-json.stdout +27 -0
- package/test/golden/lint-vacuous.exit +1 -0
- package/test/golden/lint-vacuous.stderr +0 -0
- package/test/golden/lint-vacuous.stdout +19 -0
- package/test/golden/lint-vague.exit +1 -0
- package/test/golden/lint-vague.stderr +0 -0
- package/test/golden/lint-vague.stdout +21 -0
- package/test/golden/lint-wide.exit +1 -0
- package/test/golden/lint-wide.stderr +0 -0
- package/test/golden/lint-wide.stdout +9 -0
- package/test/golden/lint-wording.exit +1 -0
- package/test/golden/lint-wording.stderr +0 -0
- package/test/golden/lint-wording.stdout +21 -0
- package/test/golden/malformed-scenario.exit +1 -0
- package/test/golden/malformed-scenario.stderr +1 -0
- package/test/golden/malformed-scenario.stdout +0 -0
- package/test/golden/malformed-spec.exit +1 -0
- package/test/golden/malformed-spec.stderr +1 -0
- package/test/golden/malformed-spec.stdout +0 -0
- package/test/golden/policy-counterexample.exit +1 -0
- package/test/golden/policy-counterexample.stderr +0 -0
- package/test/golden/policy-counterexample.stdout +13 -0
- package/test/golden/policy-covered.exit +1 -0
- package/test/golden/policy-covered.stderr +0 -0
- package/test/golden/policy-covered.stdout +19 -0
- package/test/golden/policy-holds.exit +1 -0
- package/test/golden/policy-holds.stderr +0 -0
- package/test/golden/policy-holds.stdout +3 -0
- package/test/golden/policy-json.exit +1 -0
- package/test/golden/policy-json.stderr +0 -0
- package/test/golden/policy-json.stdout +34 -0
- package/test/golden/policy-status.exit +1 -0
- package/test/golden/policy-status.stderr +0 -0
- package/test/golden/policy-status.stdout +16 -0
- package/test/golden/policy-vacuous.exit +1 -0
- package/test/golden/policy-vacuous.stderr +0 -0
- package/test/golden/policy-vacuous.stdout +3 -0
- package/test/golden/policy-wide.exit +1 -0
- package/test/golden/policy-wide.stderr +0 -0
- package/test/golden/policy-wide.stdout +15 -0
- package/test/golden/policy.exit +1 -0
- package/test/golden/policy.stderr +0 -0
- package/test/golden/policy.stdout +19 -0
- package/test/golden/scenarios-json.exit +1 -0
- package/test/golden/scenarios-json.stderr +0 -0
- package/test/golden/scenarios-json.stdout +75 -0
- package/test/golden/scenarios-status.exit +1 -0
- package/test/golden/scenarios-status.stderr +0 -0
- package/test/golden/scenarios-status.stdout +24 -0
- package/test/golden/scenarios.exit +1 -0
- package/test/golden/scenarios.stderr +0 -0
- package/test/golden/scenarios.stdout +26 -0
- package/test/golden/unit.exit +1 -0
- package/test/golden/unit.stderr +0 -0
- package/test/golden/unit.stdout +2 -0
- package/test/golden/unknown-phrase.exit +1 -0
- package/test/golden/unknown-phrase.stderr +1 -0
- package/test/golden/unknown-phrase.stdout +0 -0
- package/test/golden/usage.exit +1 -0
- package/test/golden/usage.stderr +9 -0
- package/test/golden/usage.stdout +0 -0
- package/test/run-all.ts +499 -0
- package/test/soundness.ts +375 -0
- package/test/unit.ts +1352 -0
- package/tsconfig.json +15 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"ok": false,
|
|
3
|
+
"spec": "examples/order-unused.ears.md",
|
|
4
|
+
"conflicts": [],
|
|
5
|
+
"gaps": [],
|
|
6
|
+
"misuse": [],
|
|
7
|
+
"wording": [],
|
|
8
|
+
"redundant": [],
|
|
9
|
+
"duplicate": [],
|
|
10
|
+
"vacuous": [],
|
|
11
|
+
"unused": [
|
|
12
|
+
{
|
|
13
|
+
"name": "loyalty",
|
|
14
|
+
"kind": "state",
|
|
15
|
+
"text": "loyalty (\"the customer is loyal\") is a state and no requirement mentions it.",
|
|
16
|
+
"fix": "Suggested fix: use loyalty in a requirement, or remove it from the schema."
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"name": "region",
|
|
20
|
+
"kind": "input",
|
|
21
|
+
"text": "region (\"the region\") is an input and no requirement mentions it.",
|
|
22
|
+
"fix": "Suggested fix: use region in a requirement, or remove it from the schema."
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"name": "receipt_sent",
|
|
26
|
+
"kind": "output",
|
|
27
|
+
"text": "Nothing sets receipt_sent (\"a receipt is sent\"). Requirements mention it, but no response says what it shall be.",
|
|
28
|
+
"fix": "Suggested fix: add a shall requirement that sets receipt_sent, or declare it as an input if the environment provides it. Do not choose the value."
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"name": "Lane.refund",
|
|
32
|
+
"kind": "variant",
|
|
33
|
+
"text": "Lane.refund is never mentioned.",
|
|
34
|
+
"fix": "Suggested fix: use refund in a requirement, or remove it from Lane."
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1
|
|
File without changes
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
spec: examples/order-unused.ears.md
|
|
2
|
+
conflicts: 0
|
|
3
|
+
gaps: 0
|
|
4
|
+
misuse: 0
|
|
5
|
+
wording: 0
|
|
6
|
+
redundant: 0
|
|
7
|
+
duplicate: 0
|
|
8
|
+
vacuous: 0
|
|
9
|
+
unused: 4
|
|
10
|
+
|
|
11
|
+
unused loyalty
|
|
12
|
+
loyalty ("the customer is loyal") is a state and no requirement mentions it.
|
|
13
|
+
Suggested fix: use loyalty in a requirement, or remove it from the schema.
|
|
14
|
+
|
|
15
|
+
unused region
|
|
16
|
+
region ("the region") is an input and no requirement mentions it.
|
|
17
|
+
Suggested fix: use region in a requirement, or remove it from the schema.
|
|
18
|
+
|
|
19
|
+
unused receipt_sent
|
|
20
|
+
Nothing sets receipt_sent ("a receipt is sent"). Requirements mention it, but no response says what it shall be.
|
|
21
|
+
Suggested fix: add a shall requirement that sets receipt_sent, or declare it as an input if the environment provides it. Do not choose the value.
|
|
22
|
+
|
|
23
|
+
unused Lane.refund
|
|
24
|
+
Lane.refund is never mentioned.
|
|
25
|
+
Suggested fix: use refund in a requirement, or remove it from Lane.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1
|
|
File without changes
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"ok": false,
|
|
3
|
+
"spec": "examples/order-vacuous.ears.md",
|
|
4
|
+
"conflicts": [],
|
|
5
|
+
"gaps": [],
|
|
6
|
+
"misuse": [],
|
|
7
|
+
"wording": [],
|
|
8
|
+
"redundant": [],
|
|
9
|
+
"duplicate": [],
|
|
10
|
+
"vacuous": [
|
|
11
|
+
{
|
|
12
|
+
"id": "R1",
|
|
13
|
+
"line": 7,
|
|
14
|
+
"sentence": "When the cart is open and the cart is not open, the Checkout shall accept the order.",
|
|
15
|
+
"text": "R1 can never trigger. Its condition is impossible for every allowed value.",
|
|
16
|
+
"fix": "Suggested fix: rewrite the condition in R1 so a real situation can make it true, or remove the requirement. Do not invent a response."
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"id": "R2",
|
|
20
|
+
"line": 8,
|
|
21
|
+
"sentence": "When the quantity is at least 9, the Checkout shall accept the order.",
|
|
22
|
+
"text": "R2 can never trigger. Its condition is impossible for every allowed value.",
|
|
23
|
+
"fix": "Suggested fix: rewrite the condition in R2 so a real situation can make it true, or remove the requirement. Do not invent a response."
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"unused": []
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1
|
|
File without changes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
spec: examples/order-vacuous.ears.md
|
|
2
|
+
conflicts: 0
|
|
3
|
+
gaps: 0
|
|
4
|
+
misuse: 0
|
|
5
|
+
wording: 0
|
|
6
|
+
redundant: 0
|
|
7
|
+
duplicate: 0
|
|
8
|
+
vacuous: 2
|
|
9
|
+
unused: 0
|
|
10
|
+
|
|
11
|
+
vacuous R1 line 7
|
|
12
|
+
R1 can never trigger. Its condition is impossible for every allowed value.
|
|
13
|
+
When the cart is open and the cart is not open, the Checkout shall accept the order.
|
|
14
|
+
Suggested fix: rewrite the condition in R1 so a real situation can make it true, or remove the requirement. Do not invent a response.
|
|
15
|
+
|
|
16
|
+
vacuous R2 line 8
|
|
17
|
+
R2 can never trigger. Its condition is impossible for every allowed value.
|
|
18
|
+
When the quantity is at least 9, the Checkout shall accept the order.
|
|
19
|
+
Suggested fix: rewrite the condition in R2 so a real situation can make it true, or remove the requirement. Do not invent a response.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1
|
|
File without changes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
spec: examples/order-vague.ears.md
|
|
2
|
+
conflicts: 0
|
|
3
|
+
gaps: 0
|
|
4
|
+
misuse: 0
|
|
5
|
+
wording: 3
|
|
6
|
+
redundant: 0
|
|
7
|
+
duplicate: 0
|
|
8
|
+
vacuous: 0
|
|
9
|
+
unused: 0
|
|
10
|
+
|
|
11
|
+
wording line 4
|
|
12
|
+
"fast" is too vague to test. Replace it with something a scenario can check.
|
|
13
|
+
output order_fulfilled: Bool "The checkout is fast, appropriate, and user-friendly." phrase "fulfill the order" outcome "the order was fulfilled" / "the order was not fulfilled"
|
|
14
|
+
|
|
15
|
+
wording line 4
|
|
16
|
+
"appropriate" is too vague to test. Replace it with something a scenario can check.
|
|
17
|
+
output order_fulfilled: Bool "The checkout is fast, appropriate, and user-friendly." phrase "fulfill the order" outcome "the order was fulfilled" / "the order was not fulfilled"
|
|
18
|
+
|
|
19
|
+
wording line 4
|
|
20
|
+
"user-friendly" is too vague to test. Replace it with something a scenario can check.
|
|
21
|
+
output order_fulfilled: Bool "The checkout is fast, appropriate, and user-friendly." phrase "fulfill the order" outcome "the order was fulfilled" / "the order was not fulfilled"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1
|
|
File without changes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
spec: examples/order-wording.ears.md
|
|
2
|
+
conflicts: 0
|
|
3
|
+
gaps: 0
|
|
4
|
+
misuse: 0
|
|
5
|
+
wording: 2
|
|
6
|
+
redundant: 0
|
|
7
|
+
duplicate: 0
|
|
8
|
+
vacuous: 0
|
|
9
|
+
unused: 1
|
|
10
|
+
|
|
11
|
+
wording line 4
|
|
12
|
+
"quickly" is too vague to test. Replace it with something a scenario can check.
|
|
13
|
+
output order_fulfilled: Bool "The system responds quickly." phrase "fulfill the order" outcome "the order was fulfilled" / "the order was not fulfilled"
|
|
14
|
+
|
|
15
|
+
wording line 5
|
|
16
|
+
"database" names a solution. Say what the system must do, not how to build it.
|
|
17
|
+
state saved: Bool "Store the order in the database." phrase "the order is saved"
|
|
18
|
+
|
|
19
|
+
unused saved
|
|
20
|
+
saved ("the order is saved") is a state and no requirement mentions it.
|
|
21
|
+
Suggested fix: use saved in a requirement, or remove it from the schema.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
error: examples/order-bad.json:2: expected '}'
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
error: test/fixtures/malformed.ears.md:3: expected "shall"
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1
|
|
File without changes
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
spec: examples/order.ears.md
|
|
2
|
+
property: examples/order-always.ears.md
|
|
3
|
+
counterexample:
|
|
4
|
+
{
|
|
5
|
+
"order_submitted": false,
|
|
6
|
+
"inventory_available": false,
|
|
7
|
+
"order_fulfilled": false
|
|
8
|
+
}
|
|
9
|
+
This scenario satisfies every requirement and violates the property.
|
|
10
|
+
|
|
11
|
+
P1 line 3
|
|
12
|
+
The Order System shall fulfill the order.
|
|
13
|
+
The order was not fulfilled.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0
|
|
File without changes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
spec: examples/order-covered.ears.md
|
|
2
|
+
accepted:
|
|
3
|
+
{
|
|
4
|
+
"order_submitted": false,
|
|
5
|
+
"inventory_available": false,
|
|
6
|
+
"order_fulfilled": false
|
|
7
|
+
}
|
|
8
|
+
This scenario satisfies every requirement.
|
|
9
|
+
rejected:
|
|
10
|
+
{
|
|
11
|
+
"order_submitted": false,
|
|
12
|
+
"inventory_available": false,
|
|
13
|
+
"order_fulfilled": true
|
|
14
|
+
}
|
|
15
|
+
This scenario violates a requirement.
|
|
16
|
+
|
|
17
|
+
R3 line 9
|
|
18
|
+
When an order is not submitted, the Order System shall not fulfill the order.
|
|
19
|
+
An order was not submitted, but the order was fulfilled.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1
|
|
File without changes
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"ok": false,
|
|
3
|
+
"spec": "examples/order.ears.md",
|
|
4
|
+
"property": "examples/order-always.ears.md",
|
|
5
|
+
"holds": false,
|
|
6
|
+
"note": "",
|
|
7
|
+
"acceptedFound": false,
|
|
8
|
+
"accepted": [],
|
|
9
|
+
"rejectedFound": false,
|
|
10
|
+
"rejected": [],
|
|
11
|
+
"counterexampleFound": true,
|
|
12
|
+
"counterexample": [
|
|
13
|
+
{
|
|
14
|
+
"name": "order_submitted",
|
|
15
|
+
"value": "false"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"name": "inventory_available",
|
|
19
|
+
"value": "false"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"name": "order_fulfilled",
|
|
23
|
+
"value": "false"
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"breaks": [
|
|
27
|
+
{
|
|
28
|
+
"id": "P1",
|
|
29
|
+
"line": 3,
|
|
30
|
+
"sentence": "The Order System shall fulfill the order.",
|
|
31
|
+
"because": "The order was not fulfilled."
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0
|
|
File without changes
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
spec: examples/order-status.ears.md
|
|
2
|
+
accepted:
|
|
3
|
+
No scenario satisfies every requirement.
|
|
4
|
+
rejected:
|
|
5
|
+
{
|
|
6
|
+
"status": "placed"
|
|
7
|
+
}
|
|
8
|
+
This scenario violates a requirement.
|
|
9
|
+
|
|
10
|
+
R6 line 6
|
|
11
|
+
The Order System shall mark the order shipped.
|
|
12
|
+
The order was placed.
|
|
13
|
+
|
|
14
|
+
R7 line 7
|
|
15
|
+
The Order System shall mark the order cancelled.
|
|
16
|
+
The order was placed.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0
|
|
File without changes
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
spec: examples/order-wide.ears.md
|
|
2
|
+
accepted:
|
|
3
|
+
{
|
|
4
|
+
"quantity": 0
|
|
5
|
+
}
|
|
6
|
+
This scenario satisfies every requirement.
|
|
7
|
+
rejected:
|
|
8
|
+
{
|
|
9
|
+
"quantity": 1
|
|
10
|
+
}
|
|
11
|
+
This scenario violates a requirement.
|
|
12
|
+
|
|
13
|
+
R1 line 5
|
|
14
|
+
The Counter shall count 0.
|
|
15
|
+
The quantity was 1.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0
|
|
File without changes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
spec: examples/order.ears.md
|
|
2
|
+
accepted:
|
|
3
|
+
{
|
|
4
|
+
"order_submitted": false,
|
|
5
|
+
"inventory_available": false,
|
|
6
|
+
"order_fulfilled": false
|
|
7
|
+
}
|
|
8
|
+
This scenario satisfies every requirement.
|
|
9
|
+
rejected:
|
|
10
|
+
{
|
|
11
|
+
"order_submitted": true,
|
|
12
|
+
"inventory_available": true,
|
|
13
|
+
"order_fulfilled": false
|
|
14
|
+
}
|
|
15
|
+
This scenario violates a requirement.
|
|
16
|
+
|
|
17
|
+
R1 line 7
|
|
18
|
+
WHEN an order is submitted AND inventory is available, THE Order System SHALL fulfill the order.
|
|
19
|
+
An order was submitted and inventory was available, but the order was not fulfilled.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0
|
|
File without changes
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
{
|
|
2
|
+
"ok": true,
|
|
3
|
+
"spec": "examples/order.ears.md",
|
|
4
|
+
"scenarios": [
|
|
5
|
+
{
|
|
6
|
+
"id": "R1",
|
|
7
|
+
"line": 7,
|
|
8
|
+
"kind": "accepted",
|
|
9
|
+
"trigger": "true",
|
|
10
|
+
"found": true,
|
|
11
|
+
"sameAs": "",
|
|
12
|
+
"scenario": [
|
|
13
|
+
{
|
|
14
|
+
"name": "order_submitted",
|
|
15
|
+
"value": "true"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"name": "inventory_available",
|
|
19
|
+
"value": "true"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"name": "order_fulfilled",
|
|
23
|
+
"value": "true"
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"text": "An order was submitted and inventory was available, and the order was fulfilled."
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"id": "R1",
|
|
30
|
+
"line": 7,
|
|
31
|
+
"kind": "accepted",
|
|
32
|
+
"trigger": "false",
|
|
33
|
+
"found": true,
|
|
34
|
+
"sameAs": "",
|
|
35
|
+
"scenario": [
|
|
36
|
+
{
|
|
37
|
+
"name": "order_submitted",
|
|
38
|
+
"value": "false"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"name": "inventory_available",
|
|
42
|
+
"value": "false"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"name": "order_fulfilled",
|
|
46
|
+
"value": "false"
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"text": "An order was not submitted and inventory was not available, and the order was not fulfilled."
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"id": "R1",
|
|
53
|
+
"line": 7,
|
|
54
|
+
"kind": "rejected",
|
|
55
|
+
"trigger": "true",
|
|
56
|
+
"found": true,
|
|
57
|
+
"sameAs": "",
|
|
58
|
+
"scenario": [
|
|
59
|
+
{
|
|
60
|
+
"name": "order_submitted",
|
|
61
|
+
"value": "true"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"name": "inventory_available",
|
|
65
|
+
"value": "true"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"name": "order_fulfilled",
|
|
69
|
+
"value": "false"
|
|
70
|
+
}
|
|
71
|
+
],
|
|
72
|
+
"text": "An order was submitted and inventory was available, but the order was not fulfilled."
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0
|
|
File without changes
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
spec: examples/order-status.ears.md
|
|
2
|
+
scenarios: 6
|
|
3
|
+
|
|
4
|
+
R6 accepted, trigger true
|
|
5
|
+
No scenario satisfies every requirement while this trigger is true.
|
|
6
|
+
|
|
7
|
+
R6 accepted, trigger false
|
|
8
|
+
R6 has no trigger, so there is no case where the trigger is false.
|
|
9
|
+
|
|
10
|
+
R6 rejected, trigger true
|
|
11
|
+
{
|
|
12
|
+
"status": "placed"
|
|
13
|
+
}
|
|
14
|
+
The order was placed.
|
|
15
|
+
|
|
16
|
+
R7 accepted, trigger true
|
|
17
|
+
No scenario satisfies every requirement while this trigger is true.
|
|
18
|
+
|
|
19
|
+
R7 accepted, trigger false
|
|
20
|
+
R7 has no trigger, so there is no case where the trigger is false.
|
|
21
|
+
|
|
22
|
+
R7 rejected, trigger true
|
|
23
|
+
Same scenario as R6 rejected, trigger true.
|
|
24
|
+
The order was placed.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0
|
|
File without changes
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
spec: examples/order.ears.md
|
|
2
|
+
scenarios: 3
|
|
3
|
+
|
|
4
|
+
R1 accepted, trigger true
|
|
5
|
+
{
|
|
6
|
+
"order_submitted": true,
|
|
7
|
+
"inventory_available": true,
|
|
8
|
+
"order_fulfilled": true
|
|
9
|
+
}
|
|
10
|
+
An order was submitted and inventory was available, and the order was fulfilled.
|
|
11
|
+
|
|
12
|
+
R1 accepted, trigger false
|
|
13
|
+
{
|
|
14
|
+
"order_submitted": false,
|
|
15
|
+
"inventory_available": false,
|
|
16
|
+
"order_fulfilled": false
|
|
17
|
+
}
|
|
18
|
+
An order was not submitted and inventory was not available, and the order was not fulfilled.
|
|
19
|
+
|
|
20
|
+
R1 rejected, trigger true
|
|
21
|
+
{
|
|
22
|
+
"order_submitted": true,
|
|
23
|
+
"inventory_available": true,
|
|
24
|
+
"order_fulfilled": false
|
|
25
|
+
}
|
|
26
|
+
An order was submitted and inventory was available, but the order was not fulfilled.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
error: test/fixtures/unknown-phrase.ears.md:5: unknown phrase "an order was submitted". Closest: "an order is submitted", "inventory is available", "fulfill the order".
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
error: missing command
|
|
2
|
+
usage:
|
|
3
|
+
plan-verify check [--json] <spec> --input <scenario>
|
|
4
|
+
plan-verify emit-smt [--json] <spec>
|
|
5
|
+
plan-verify lint [--json] <spec>
|
|
6
|
+
plan-verify report <spec>
|
|
7
|
+
plan-verify scenarios [--json] <spec>
|
|
8
|
+
plan-verify policy [--json] <spec> [--property <file>]
|
|
9
|
+
plan-verify help
|
|
File without changes
|