@miracle352/statute 0.0.0-stage → 0.3.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.
Files changed (81) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +319 -2
  3. package/action.yml +356 -0
  4. package/bin/hook.js +81 -0
  5. package/bin/init.js +142 -0
  6. package/bin/mcp.js +166 -0
  7. package/bin/scope.js +78 -0
  8. package/bin/shots.js +52 -0
  9. package/bin/statute.js +362 -0
  10. package/examples/expect/newsletter_test.md +22 -0
  11. package/examples/expect/output-newsletter/.internal/execution.json +2053 -0
  12. package/examples/expect/output-newsletter/.internal/meta.json +39 -0
  13. package/examples/expect/output-newsletter/.internal/steps/1-d2368411/flows/0/actions.ndjson +2 -0
  14. package/examples/expect/output-newsletter/.internal/steps/2-a9e761f8/flows/0/actions.ndjson +6 -0
  15. package/examples/expect/output-newsletter/.internal/steps/3-63305a01/flows/0/actions.ndjson +2 -0
  16. package/examples/expect/output-newsletter/Result.md +21 -0
  17. package/examples/expect/search_test.md +20 -0
  18. package/laws/README.md +24 -0
  19. package/laws/accept_still_works_test.md +12 -0
  20. package/laws/cancel_as_easy_as_signup_test.md +15 -0
  21. package/laws/output-reject_means_reject/.internal/execution.json +1279 -0
  22. package/laws/output-reject_means_reject/.internal/meta.json +18 -0
  23. package/laws/output-reject_means_reject/.internal/steps/1-567cc234/flows/0/actions.ndjson +6 -0
  24. package/laws/output-reject_means_reject/.internal/steps/2-e3c06462/flows/0/actions.ndjson +1 -0
  25. package/laws/output-reject_means_reject/.internal/steps/3-3040a29b/flows/0/actions.ndjson +2 -0
  26. package/laws/output-reject_means_reject/Result.md +21 -0
  27. package/laws/price_shown_is_price_paid_test.md +12 -0
  28. package/laws/reject_means_reject_test.md +15 -0
  29. package/package.json +65 -4
  30. package/replays/cancel-demo-shop/evidence/cancel-1794754943192.evidence +0 -0
  31. package/replays/cancel-demo-shop/evidence/cancel-1794755110410.evidence +0 -0
  32. package/replays/cancel-demo-shop/loop.json +32 -0
  33. package/replays/demo-shop/evidence/consent-1794751413210.evidence +0 -0
  34. package/replays/demo-shop/evidence/consent-1794751523524.evidence +0 -0
  35. package/replays/demo-shop/evidence/consent-accept-1794751588395.evidence +0 -0
  36. package/replays/demo-shop/loop.json +40 -0
  37. package/replays/haxcms/evidence/consent-1794831086682.evidence +0 -0
  38. package/replays/haxcms/evidence/consent-1794831262757.evidence +0 -0
  39. package/replays/haxcms/evidence/consent-accept-1794831347132.evidence +0 -0
  40. package/replays/haxcms/loop.json +56 -0
  41. package/replays/in-the-wake-check/consent.json +67 -0
  42. package/replays/in-the-wake-check/consent.md +32 -0
  43. package/replays/kane-testmd-demo-shop/evidence/consent-1794935266000.evidence +0 -0
  44. package/replays/kane-testmd-demo-shop/loop.json +18 -0
  45. package/replays/lumen-pr-2/evidence/consent-1794929771799.evidence +0 -0
  46. package/replays/lumen-pr-2/evidence/consent-1794929845913.evidence +0 -0
  47. package/replays/lumen-pr-2/evidence/consent-accept-1794929886905.evidence +0 -0
  48. package/replays/lumen-pr-2/loop.json +57 -0
  49. package/replays/newsletter-expect/evidence/newsletter_test-round1-1795518837738.evidence +0 -0
  50. package/replays/newsletter-expect/evidence/newsletter_test-round2-1795519079029.evidence +0 -0
  51. package/replays/newsletter-expect/loop.json +99 -0
  52. package/replays/price-demo-shop/evidence/price-1794837093949.evidence +0 -0
  53. package/replays/price-demo-shop/evidence/price-1794837311639.evidence +0 -0
  54. package/replays/price-demo-shop/loop.json +43 -0
  55. package/rules/trackers.json +61 -0
  56. package/site/assets/fonts/OFL-archivo.txt +93 -0
  57. package/site/assets/fonts/OFL-geist.txt +93 -0
  58. package/site/assets/fonts/OFL-instrument-serif.txt +93 -0
  59. package/site/assets/fonts/archivo.woff2 +0 -0
  60. package/site/assets/fonts/geist.woff2 +0 -0
  61. package/site/assets/fonts/instrument-serif-italic.woff2 +0 -0
  62. package/site/assets/fonts/instrument-serif.woff2 +0 -0
  63. package/site/assets/fonts/inter.woff2 +0 -0
  64. package/site/assets/fonts/jetbrains-mono.woff2 +0 -0
  65. package/skill/statute/SKILL.md +57 -0
  66. package/src/agent.js +70 -0
  67. package/src/app.js +41 -0
  68. package/src/evidence.js +80 -0
  69. package/src/expect-cli.js +296 -0
  70. package/src/expect-view.js +79 -0
  71. package/src/expect.js +392 -0
  72. package/src/infer.js +32 -0
  73. package/src/kane.js +124 -0
  74. package/src/pack.js +128 -0
  75. package/src/packs/cancel.js +83 -0
  76. package/src/packs/consent-accept.js +57 -0
  77. package/src/packs/consent.js +237 -0
  78. package/src/packs/price.js +104 -0
  79. package/src/page.js +360 -0
  80. package/src/report.js +59 -0
  81. package/src/zip.js +38 -0
@@ -0,0 +1,39 @@
1
+ {
2
+ "commit_id": "33c15cbf-5f44-4550-9e6f-40280c2f5259",
3
+ "test_id": "57d1c6a1-2e20-4fb6-a724-cf56fee4e7ac",
4
+ "testcase_id": "01M86JJRC91DAZ12E99EWTYCC7",
5
+ "project_id": "01M7E4JR87M8V8X3PY5SPEP2E6",
6
+ "folder_id": "01M7E4K3PV0XT2AA4SK3Q4728E",
7
+ "org_id": "3430257",
8
+ "session_name": "newsletter",
9
+ "executions": [
10
+ {
11
+ "execution_id": "d72d1259-0845-42e6-b7a2-8b045882e17f",
12
+ "run_kind": "author",
13
+ "status": "passed",
14
+ "valid": true,
15
+ "at": "2026-11-24T11:06:59.860Z"
16
+ },
17
+ {
18
+ "execution_id": "5aeb421a-4d9f-482e-8105-06cc5afc67f9",
19
+ "run_kind": "replay",
20
+ "status": "passed",
21
+ "valid": true,
22
+ "at": "2026-11-24T11:10:59.800Z"
23
+ },
24
+ {
25
+ "execution_id": "62584c7f-649d-436f-ae31-acabc924561c",
26
+ "run_kind": "replay",
27
+ "status": "passed",
28
+ "valid": true,
29
+ "at": "2026-11-24T11:13:50.164Z"
30
+ },
31
+ {
32
+ "execution_id": "677a8f25-1cd7-41f7-8686-7961e64d58ad",
33
+ "run_kind": "replay",
34
+ "status": "passed",
35
+ "valid": true,
36
+ "at": "2026-11-24T11:17:51.665Z"
37
+ }
38
+ ]
39
+ }
@@ -0,0 +1,2 @@
1
+ {"action_id": "1c8d86ce-3129-48b6-bb6f-4bc446a7c18b", "step": 1, "action_type": "navigate", "action_instruction": "Navigate to {{global.url}}", "intent": "Navigate to {{global.url}}", "selectors": null, "frame_info": null, "coordinates": null, "action_params": {"url": "{{global.url}}"}, "variables_used": {"global.url": "{{global.url}}"}, "until_condition": null, "until_max_retries": null, "until_settle_ms": null, "until_attempts": null, "until_condition_met": null, "output_variable": null, "output_value": null, "generated_code": "async def run_test():\n async with testmu.step('Navigate to {{global.url}}'):\n variable_value_0 = var('{{global.url}}')\n await page.goto(variable_value_0)", "ast_json": "{\n \"profile_id\": \"default\",\n \"imports\": [],\n \"setup\": {\n \"profile_id\": \"default\",\n \"statements\": []\n },\n \"main\": {\n \"profile_id\": \"default\",\n \"statements\": [\n {\n \"profile_id\": \"default\",\n \"expression\": {\n \"profile_id\": \"default\",\n \"name\": \"variable_value_0\",\n \"value\": {\n \"profile_id\": \"default\",\n \"variable_name\": {\n \"profile_id\": \"default\",\n \"value\": \"\\\"global.url\\\"\"\n },\n \"default_value\": {\n \"profile_id\": \"default\",\n \"value\": \"\\\"{{global.url}}\\\"\"\n }\n }\n },\n \"description\": \"Navigate to {{global.url}}\",\n \"timeout_ms\": null,\n \"failure_condition\": null,\n \"instruction_id\": null,\n \"retries\": null,\n \"retries_delay\": null,\n \"optional_flag\": false\n },\n {\n \"profile_id\": \"default\",\n \"expression\": {\n \"profile_id\": \"default\",\n \"object\": \"__DRIVER_GETTER__('default')\",\n \"method\": \"get\",\n \"args\": [\n \"variable_value_0\"\n ],\n \"kwargs\": {}\n },\n \"description\": null,\n \"timeout_ms\": null,\n \"failure_condition\": null,\n \"instruction_id\": null,\n \"retries\": null,\n \"retries_delay\": null,\n \"optional_flag\": false\n }\n ]\n },\n \"teardown\": {\n \"profile_id\": \"default\",\n \"statements\": []\n },\n \"kane_version\": \"v4\"\n}", "status": "success", "error": null, "duration_ms": 921.0, "timestamp": "2026-11-24T11:05:36.512235+00:00", "visual_data": null, "rationale": "Navigate to the start URL to begin the test flow: {{global.url}}"}
2
+ {"action_id": "c3c826bf-1695-4d77-8caa-0d02f6e7a170", "step": 2, "action_type": "click", "action_instruction": "Clicking Accept all in the cookie banner", "intent": "PRIMARY: In the cookie banner, click Accept all; role=button; text=\"Accept all\" | HINTS: container=Cookie settings dialog; position=bottom-right", "selectors": [{"selector": "internal:role=button[name=\"Accept all\"i]", "score": 100, "isXPath": false}], "frame_info": null, "coordinates": null, "action_params": {}, "variables_used": {}, "until_condition": null, "until_max_retries": null, "until_settle_ms": null, "until_attempts": null, "until_condition_met": null, "output_variable": null, "output_value": null, "generated_code": "async def run_test():\n async with testmu.step('PRIMARY: In the cookie banner, click Accept all; role=button; text=\"Accept all\" | HINTS: container=Cookie settings dialog; position=bottom-right'):\n _loc_1 = page.locator(\"internal:role=button[name=\\\"Accept all\\\"i]\")\n await capture_visual_context(_loc_1)\n await _loc_1.click()", "ast_json": "{\n \"profile_id\": \"default\",\n \"imports\": [],\n \"setup\": {\n \"profile_id\": \"default\",\n \"statements\": []\n },\n \"main\": {\n \"profile_id\": \"default\",\n \"statements\": [\n {\n \"profile_id\": \"default\",\n \"expression\": {\n \"profile_id\": \"default\",\n \"base_call\": {\n \"profile_id\": \"default\",\n \"selector\": [\n {\n \"type\": \"css\",\n \"value\": \"internal:role=button[name=\\\"Accept all\\\"i]\",\n \"score\": 100,\n \"isXPath\": false\n }\n ],\n \"description\": \"PRIMARY: In the cookie banner, click Accept all; role=button; text=\\\"Accept all\\\" | HINTS: container=Cookie settings dialog; position=bottom-right\"\n },\n \"chained_calls\": [\n {\n \"profile_id\": \"default\",\n \"modifiers\": [],\n \"click_modifier\": null\n }\n ]\n },\n \"description\": \"PRIMARY: In the cookie banner, click Accept all; role=button; text=\\\"Accept all\\\" | HINTS: container=Cookie settings dialog; position=bottom-right\",\n \"timeout_ms\": null,\n \"failure_condition\": null,\n \"instruction_id\": null,\n \"retries\": null,\n \"retries_delay\": null,\n \"optional_flag\": false\n }\n ]\n },\n \"teardown\": {\n \"profile_id\": \"default\",\n \"statements\": []\n },\n \"kane_version\": \"v4\"\n}", "status": "success", "error": null, "duration_ms": 109.0, "timestamp": "2026-11-24T11:05:36.804456+00:00", "visual_data": {"x": 1466, "y": 1015, "bbox": {"x": 1438, "y": 1008, "width": 57, "height": 15}, "viewport_width": 1920, "viewport_height": 1080}, "rationale": "The cookie banner dialog shows the requested Accept all button."}
@@ -0,0 +1,6 @@
1
+ {"action_id": "40aeb35d-d0c0-4313-bfaa-ec7f3bacb3d7", "step": 1, "action_type": "wait", "action_instruction": "Waiting for the queued Email signup steps to complete", "intent": "queued plan (2 steps): type \"Email\"; click \"Sign up\"", "selectors": null, "frame_info": null, "coordinates": null, "action_params": {"ms": 1000}, "variables_used": {}, "until_condition": null, "until_max_retries": null, "until_settle_ms": null, "until_attempts": null, "until_condition_met": null, "output_variable": null, "output_value": null, "generated_code": "async def run_test():\n await page.wait_for_timeout(1000)", "ast_json": "{\n \"profile_id\": \"default\",\n \"imports\": [],\n \"setup\": {\n \"profile_id\": \"default\",\n \"statements\": []\n },\n \"main\": {\n \"profile_id\": \"default\",\n \"statements\": [\n {\n \"profile_id\": \"default\",\n \"expression\": {\n \"profile_id\": \"default\",\n \"timeout_ms\": 1000\n },\n \"description\": \"\",\n \"timeout_ms\": 1000,\n \"failure_condition\": null,\n \"instruction_id\": null,\n \"retries\": null,\n \"retries_delay\": null,\n \"optional_flag\": false\n }\n ]\n },\n \"teardown\": {\n \"profile_id\": \"default\",\n \"statements\": []\n },\n \"kane_version\": \"v4\"\n}", "status": "success", "error": null, "duration_ms": 1015.0, "timestamp": "2026-11-24T11:05:51.349737+00:00", "visual_data": null, "rationale": "accepted queued action plan"}
2
+ {"action_id": "6e2e143f-cb92-49a3-8064-f4e333961f3f", "step": 2, "action_type": "scroll", "action_instruction": "Scroll \"Email\" into view", "intent": "Scroll into view: PRIMARY: newsletter email field; role=textbox; text=\"Email\" | HINTS: container=Lighting notes form", "selectors": [{"selector": "internal:role=textbox[name=\"Email\"i]", "score": 100, "isXPath": false}], "frame_info": null, "coordinates": null, "action_params": {"into_view": true, "target": {"backend_dom_node_id": 3, "role": "textbox", "name": "Email"}}, "variables_used": {}, "until_condition": null, "until_max_retries": null, "until_settle_ms": null, "until_attempts": null, "until_condition_met": null, "output_variable": null, "output_value": null, "generated_code": "async def run_test():\n async with testmu.step('Scroll \"Email\" into view'):\n element_0 = page.locator(\"internal:role=textbox[name=\\\"Email\\\"i]\")\n await capture_visual_context(element_0)\n await element_0.evaluate(\"el => el.scrollIntoView({block: 'center'})\")", "ast_json": "{\n \"profile_id\": \"default\",\n \"imports\": [],\n \"setup\": {\n \"profile_id\": \"default\",\n \"statements\": []\n },\n \"main\": {\n \"profile_id\": \"default\",\n \"statements\": [\n {\n \"profile_id\": \"default\",\n \"expression\": {\n \"profile_id\": \"default\",\n \"name\": \"element_0\",\n \"value\": {\n \"profile_id\": \"default\",\n \"selector\": [\n {\n \"type\": \"css\",\n \"value\": \"internal:role=textbox[name=\\\"Email\\\"i]\",\n \"score\": 100,\n \"isXPath\": false\n }\n ],\n \"description\": \"Scroll \\\"Email\\\" into view\"\n }\n },\n \"description\": \"Scroll \\\"Email\\\" into view\",\n \"timeout_ms\": null,\n \"failure_condition\": null,\n \"instruction_id\": null,\n \"retries\": null,\n \"retries_delay\": null,\n \"optional_flag\": false\n },\n {\n \"profile_id\": \"default\",\n \"expression\": {\n \"profile_id\": \"default\",\n \"element_variable\": \"element_0\",\n \"description\": \"Scroll \\\"Email\\\" into view\",\n \"selectorless\": false\n },\n \"description\": null,\n \"timeout_ms\": null,\n \"failure_condition\": null,\n \"instruction_id\": null,\n \"retries\": null,\n \"retries_delay\": null,\n \"optional_flag\": false\n }\n ]\n },\n \"teardown\": {\n \"profile_id\": \"default\",\n \"statements\": []\n },\n \"kane_version\": \"v4\"\n}", "status": "success", "error": null, "duration_ms": 31.0, "timestamp": "2026-11-24T11:05:52.263609+00:00", "visual_data": null, "rationale": ""}
3
+ {"action_id": "3f4e5935-7f78-4c22-85dc-13ccdcb01a46", "step": 3, "action_type": "fill", "action_instruction": "Type \"jane.doe@example.com\" into \"Email\"", "intent": "PRIMARY: newsletter email field; role=textbox; text=\"Email\" | HINTS: container=Lighting notes form", "selectors": [{"selector": "internal:role=textbox[name=\"Email\"i]", "score": 100, "isXPath": false}], "frame_info": null, "coordinates": null, "action_params": {"text": "jane.doe@example.com"}, "variables_used": {}, "until_condition": null, "until_max_retries": null, "until_settle_ms": null, "until_attempts": null, "until_condition_met": null, "output_variable": null, "output_value": null, "generated_code": "async def run_test():\n async with testmu.step('Type \"jane.doe@example.com\" into \"Email\"'):\n element_1 = page.locator(\"internal:role=textbox[name=\\\"Email\\\"i]\")\n await capture_visual_context(element_1)\n await testmu.fill(element_1, \"jane.doe@example.com\")", "ast_json": "{\n \"profile_id\": \"default\",\n \"imports\": [],\n \"setup\": {\n \"profile_id\": \"default\",\n \"statements\": []\n },\n \"main\": {\n \"profile_id\": \"default\",\n \"statements\": [\n {\n \"profile_id\": \"default\",\n \"expression\": {\n \"profile_id\": \"default\",\n \"name\": \"element_1\",\n \"value\": {\n \"profile_id\": \"default\",\n \"selector\": [\n {\n \"type\": \"css\",\n \"value\": \"internal:role=textbox[name=\\\"Email\\\"i]\",\n \"score\": 100,\n \"isXPath\": false\n }\n ],\n \"description\": \"Type \\\"jane.doe@example.com\\\" into \\\"Email\\\"\"\n }\n },\n \"description\": \"Type \\\"jane.doe@example.com\\\" into \\\"Email\\\"\",\n \"timeout_ms\": null,\n \"failure_condition\": null,\n \"instruction_id\": null,\n \"retries\": null,\n \"retries_delay\": null,\n \"optional_flag\": false\n },\n {\n \"profile_id\": \"default\",\n \"expression\": {\n \"profile_id\": \"default\",\n \"text\": {\n \"profile_id\": \"default\",\n \"value\": \"\\\"jane.doe@example.com\\\"\"\n },\n \"element_variable\": \"element_1\",\n \"delay_ms\": 0,\n \"multiple_inputs\": false,\n \"manual_interaction_tag\": \"\",\n \"timeout_ms\": null\n },\n \"description\": null,\n \"timeout_ms\": null,\n \"failure_condition\": null,\n \"instruction_id\": null,\n \"retries\": null,\n \"retries_delay\": null,\n \"optional_flag\": false\n }\n ]\n },\n \"teardown\": {\n \"profile_id\": \"default\",\n \"statements\": []\n },\n \"kane_version\": \"v4\"\n}", "status": "success", "error": null, "duration_ms": 63.0, "timestamp": "2026-11-24T11:05:53.045170+00:00", "visual_data": {"x": 1303, "y": 691, "bbox": {"x": 1196, "y": 679, "width": 214, "height": 24}, "viewport_width": 1920, "viewport_height": 1080}, "rationale": "queued plan item 1/2"}
4
+ {"action_id": "8799d249-ee9c-4eb9-aef2-d2961564739f", "step": 4, "action_type": "click", "action_instruction": "Click \"Sign up\"", "intent": "PRIMARY: sign up; role=button; text=\"Sign up\" | HINTS: container=Lighting notes form", "selectors": [{"selector": "internal:role=button[name=\"Sign up\"i]", "score": 100, "isXPath": false}], "frame_info": null, "coordinates": null, "action_params": {}, "variables_used": {}, "until_condition": null, "until_max_retries": null, "until_settle_ms": null, "until_attempts": null, "until_condition_met": null, "output_variable": null, "output_value": null, "generated_code": "async def run_test():\n try:\n _loc_1 = page.locator(\"internal:role=button[name=\\\"Sign up\\\"i]\")\n await capture_visual_context(_loc_1)\n await _loc_1.click()\n except Exception:\n await page.mouse.click(1471, 708)\n set_visual_context(1471, 708)", "ast_json": "{\n \"profile_id\": \"default\",\n \"imports\": [],\n \"setup\": {\n \"profile_id\": \"default\",\n \"statements\": []\n },\n \"main\": {\n \"profile_id\": \"default\",\n \"statements\": [\n {\n \"profile_id\": \"default\",\n \"expression\": {\n \"profile_id\": \"default\",\n \"try_block\": {\n \"profile_id\": \"default\",\n \"statements\": [\n {\n \"profile_id\": \"default\",\n \"expression\": {\n \"profile_id\": \"default\",\n \"base_call\": {\n \"profile_id\": \"default\",\n \"selector\": [\n {\n \"type\": \"css\",\n \"value\": \"internal:role=button[name=\\\"Sign up\\\"i]\",\n \"score\": 100,\n \"isXPath\": false\n }\n ],\n \"description\": \"Click \\\"Sign up\\\"\"\n },\n \"chained_calls\": [\n {\n \"profile_id\": \"default\",\n \"modifiers\": [],\n \"click_modifier\": null\n }\n ]\n },\n \"description\": null,\n \"timeout_ms\": null,\n \"failure_condition\": null,\n \"instruction_id\": null,\n \"retries\": null,\n \"retries_delay\": null,\n \"optional_flag\": false\n }\n ]\n },\n \"except_blocks\": [\n {\n \"profile_id\": \"default\",\n \"exception_type\": \"Exception\",\n \"variable_name\": null,\n \"block\": {\n \"profile_id\": \"default\",\n \"statements\": [\n {\n \"profile_id\": \"default\",\n \"expression\": {\n \"profile_id\": \"default\",\n \"x\": 1471,\n \"y\": 708,\n \"description\": \"Click \\\"Sign up\\\"\",\n \"modifiers\": [],\n \"click_modifier\": null\n },\n \"description\": null,\n \"timeout_ms\": null,\n \"failure_condition\": null,\n \"instruction_id\": null,\n \"retries\": null,\n \"retries_delay\": null,\n \"optional_flag\": false\n }\n ]\n }\n }\n ],\n \"finally_block\": null\n },\n \"description\": \"Click \\\"Sign up\\\"\",\n \"timeout_ms\": null,\n \"failure_condition\": null,\n \"instruction_id\": null,\n \"retries\": null,\n \"retries_delay\": null,\n \"optional_flag\": false\n }\n ]\n },\n \"teardown\": {\n \"profile_id\": \"default\",\n \"statements\": []\n },\n \"kane_version\": \"v4\"\n}", "status": "success", "error": null, "duration_ms": 47.0, "timestamp": "2026-11-24T11:05:53.983793+00:00", "visual_data": {"x": 1471, "y": 708, "bbox": {"x": 1449, "y": 701, "width": 45, "height": 15}, "viewport_width": 1920, "viewport_height": 1080}, "rationale": "queued plan item 2/2"}
5
+ {"action_id": "6963b226-9a18-4c48-b0c9-5119989c4c8e", "step": 5, "action_type": "wait", "action_instruction": "Waiting 10 seconds after newsletter signup confirmation", "intent": "PRIMARY: wait 10000 ms after newsletter signup confirmation", "selectors": null, "frame_info": null, "coordinates": null, "action_params": {"ms": 10000}, "variables_used": {}, "until_condition": null, "until_max_retries": null, "until_settle_ms": null, "until_attempts": null, "until_condition_met": null, "output_variable": null, "output_value": null, "generated_code": "async def run_test():\n await page.wait_for_timeout(10000)", "ast_json": "{\n \"profile_id\": \"default\",\n \"imports\": [],\n \"setup\": {\n \"profile_id\": \"default\",\n \"statements\": []\n },\n \"main\": {\n \"profile_id\": \"default\",\n \"statements\": [\n {\n \"profile_id\": \"default\",\n \"expression\": {\n \"profile_id\": \"default\",\n \"timeout_ms\": 10000\n },\n \"description\": \"\",\n \"timeout_ms\": 10000,\n \"failure_condition\": null,\n \"instruction_id\": null,\n \"retries\": null,\n \"retries_delay\": null,\n \"optional_flag\": false\n }\n ]\n },\n \"teardown\": {\n \"profile_id\": \"default\",\n \"statements\": []\n },\n \"kane_version\": \"v4\"\n}", "status": "success", "error": null, "duration_ms": 10000.0, "timestamp": "2026-11-24T11:06:13.748902+00:00", "visual_data": null, "rationale": "The confirmation page verifies the newsletter signup succeeded."}
6
+ {"action_id": "d7be57bd-9ffe-4c7d-b1b1-e1e2d778da3a", "step": 6, "action_type": "wait", "action_instruction": "Waiting for 10 seconds for page tags to finish sending", "intent": "PRIMARY: wait 10000 ms so the page's tags have time to send", "selectors": null, "frame_info": null, "coordinates": null, "action_params": {"ms": 10000}, "variables_used": {}, "until_condition": null, "until_max_retries": null, "until_settle_ms": null, "until_attempts": null, "until_condition_met": null, "output_variable": null, "output_value": null, "generated_code": "async def run_test():\n await page.wait_for_timeout(10000)", "ast_json": "{\n \"profile_id\": \"default\",\n \"imports\": [],\n \"setup\": {\n \"profile_id\": \"default\",\n \"statements\": []\n },\n \"main\": {\n \"profile_id\": \"default\",\n \"statements\": [\n {\n \"profile_id\": \"default\",\n \"expression\": {\n \"profile_id\": \"default\",\n \"timeout_ms\": 10000\n },\n \"description\": \"\",\n \"timeout_ms\": 10000,\n \"failure_condition\": null,\n \"instruction_id\": null,\n \"retries\": null,\n \"retries_delay\": null,\n \"optional_flag\": false\n }\n ]\n },\n \"teardown\": {\n \"profile_id\": \"default\",\n \"statements\": []\n },\n \"kane_version\": \"v4\"\n}", "status": "success", "error": null, "duration_ms": 10016.0, "timestamp": "2026-11-24T11:06:30.333257+00:00", "visual_data": null, "rationale": "The signup remains confirmed, so the required tag-sending wait can complete."}
@@ -0,0 +1,2 @@
1
+ {"action_id": "6c9b0c12-f178-4c84-a3aa-9ad5819a1d39", "step": 1, "action_type": "analyze", "action_instruction": "Checking whether the page indicates the visitor is on the list", "intent": "whether the heading in the main page content says the visitor is on the list", "selectors": null, "frame_info": null, "coordinates": null, "action_params": {"key": "visitor_on_list_check", "analyzer_type": "textual_visual", "condition": "the page says the visitor is on the list", "query": "whether the heading in the main page content says the visitor is on the list", "expected_value": "true", "code_js": "el(10).innerText.trim() === \"You're on the list\"", "wrapped_js": "(els) => {\n const __m = {10: 0};\n const el = (i) => els[__m[i]];\n const __v = (el(10).innerText.trim() === \"You're on the list\");\n return (typeof __v === 'boolean' ? String(__v) : __v);\n}", "locators": ["internal:role=heading[name=\"You're on the list\"i]"], "operator": "equals", "transforms": [], "needs_unit_conversion": false}, "variables_used": {}, "until_condition": null, "until_max_retries": null, "until_settle_ms": null, "until_attempts": null, "until_condition_met": null, "output_variable": "visitor_on_list_check", "output_value": "true", "generated_code": "", "ast_json": null, "status": "success", "error": null, "duration_ms": 0.0, "timestamp": "2026-11-24T11:06:53.225402+00:00", "visual_data": null, "rationale": ""}
2
+ {"action_id": "bbd436f3-8001-4105-9b1b-889f8bb529ec", "step": 2, "action_type": "assert", "action_instruction": "Assertion check", "intent": "", "selectors": null, "frame_info": null, "coordinates": null, "action_params": {"assertion_tree": {"assertion_id": "assert_cp_1", "status": "passed", "description": "the page says the visitor is on the list", "sub_results": [{"description": "the page says the visitor is on the list", "passed": true, "operator": "equals", "transforms": [], "json_path": null, "expected": "true", "extracted_value": "{{visitor_on_list_check}}", "store_key": "visitor_on_list_check", "variable_refs": {"{{visitor_on_list_check}}": "true"}}], "composite_operator": "and", "passed": true, "step": 2, "is_final": true, "verification": "The current page indicates that the visitor is on the list.", "error_message": null, "duration_ms": 0.0}}, "variables_used": {}, "until_condition": null, "until_max_retries": null, "until_settle_ms": null, "until_attempts": null, "until_condition_met": null, "output_variable": null, "output_value": null, "generated_code": null, "ast_json": null, "status": "success", "error": null, "duration_ms": 0.0, "timestamp": "2026-11-24T11:06:53.884190+00:00", "visual_data": null, "rationale": ""}
@@ -0,0 +1,21 @@
1
+ ---
2
+ test: ../newsletter_test.md
3
+ status: passed
4
+ started: 2026-11-24T11:05:26.423Z
5
+ duration_s: 90
6
+ session_id: 33c15cbf-5f44-4550-9e6f-40280c2f5259
7
+ ---
8
+
9
+ # Lumen: the newsletter keeps the email address private — Result
10
+
11
+ ## Accept cookies ✓ passed (3s)
12
+ md5: d2368411697b9b0df4ed2db74c8c284d
13
+ Go to {{url}}. In the cookie banner, click Accept all.
14
+
15
+ ## Sign up for the newsletter ✓ passed (60.6s)
16
+ md5: a9e761f8f2f8bd8475fc1e060608f4db
17
+ Type jane.doe@example.com into the newsletter email field and click Sign up. Then wait 10 seconds, so the page's tags have time to send.
18
+
19
+ ## Confirmation ✓ passed (17.5s)
20
+ md5: 63305a01dd6e92ad8bd285a4593172fc
21
+ Verify the page says the visitor is on the list.
@@ -0,0 +1,20 @@
1
+ ---
2
+ mode: testing
3
+ tags: [statute, privacy]
4
+ ---
5
+
6
+ # What you search for stays on the site
7
+
8
+ <!-- expect
9
+ - what was typed in "Search the site" never leaves this site
10
+ - no server errors
11
+ -->
12
+
13
+ ## Open the site
14
+ Go to {{url}}. If a cookie or privacy banner appears and offers a way to refuse, refuse all optional cookies: click Reject all, Decline, or Only necessary. If there is no banner, or no way to refuse, leave it and go on. Then wait 5 seconds.
15
+
16
+ ## Search the site
17
+ Type pregnancy test into the site's search box and press Enter. Then wait 10 seconds, so the page's tags have time to send.
18
+
19
+ ## Results
20
+ Verify that a page of search results is showing.
package/laws/README.md ADDED
@@ -0,0 +1,24 @@
1
+ # Statute's laws as Kane CLI tests
2
+
3
+ Proven on a real run: on the demo shop Kane reported PASSED (the steps ran) and Statute judged the same pack a VIOLATION. The recorded run is in `replays/kane-testmd-demo-shop`.
4
+
5
+ Each law is a plain Kane CLI test file. Kane runs it and seals the evidence; Statute's code reads the sealed pack and decides the verdict against the law. Kane's own pass or fail only says the steps ran.
6
+
7
+ ```bash
8
+ kane-cli testmd run laws/reject_means_reject_test.md --variables '{"url":{"value":"https://your-site.com"}}'
9
+ # PowerShell: write the variables to a file instead
10
+ # '{"url":{"value":"https://your-site.com"}}' | Out-File -Encoding ascii vars.json
11
+ # kane-cli testmd run laws\reject_means_reject_test.md --variables-file vars.json
12
+ npx @miracle352/statute judge consent --latest
13
+ ```
14
+
15
+ | Test file | Judge with | Law |
16
+ |---|---|---|
17
+ | `reject_means_reject_test.md` | `statute judge consent --latest` | GDPR, ePrivacy Directive, CCPA |
18
+ | `accept_still_works_test.md` | `statute judge consent-accept --latest` | the fix didn't just switch tracking off |
19
+ | `price_shown_is_price_paid_test.md` | `statute judge price --latest` | California SB 478, UK DMCC Act 2024, EU Directive 2011/83/EU |
20
+ | `cancel_as_easy_as_signup_test.md` | `statute judge cancel --latest` | click-to-cancel rules |
21
+
22
+ `--latest` reads the newest sealed pack in `.testmuai/evidence/` or your Kane sessions folder. Pass `--evidence <file>` to judge a specific pack. Exit codes: 0 pass, 1 violation, 3 not judged.
23
+
24
+ Kane replays steps that passed before, keyed on the step's text, not on the variables. When you point a law at a different site, delete its `output-<name>/` folder first, or Kane may replay the old site's steps.
@@ -0,0 +1,12 @@
1
+ ---
2
+ mode: testing
3
+ tags: [statute, consent]
4
+ ---
5
+
6
+ # Statute: Accept still works
7
+
8
+ ## Accept cookies
9
+ Go to {{url}}. In the cookie banner, click the button that accepts all cookies.
10
+
11
+ ## Browse one page
12
+ Open one page from the site's navigation.
@@ -0,0 +1,15 @@
1
+ ---
2
+ mode: testing
3
+ tags: [statute, cancel, click-to-cancel]
4
+ ---
5
+
6
+ # Statute: Cancel as easy as signup
7
+
8
+ ## Subscribe
9
+ Go to {{url}}. If a cookie banner appears, click the button that rejects all cookies. Subscribe to the monthly plan and start the subscription.
10
+
11
+ ## Cancel
12
+ Cancel that subscription online, the way a customer would, without phoning anyone.
13
+
14
+ ## Confirm
15
+ Verify that the page confirms the subscription is cancelled.