{
  "$schema": "./conformance-tests.schema.json",
  "schemaVersion": 1,
  "title": "OCPS Conformance Test Vectors",
  "status": "DRAFT",
  "description": "Shared machine-readable conformance test vectors grouped by OCPS version.",
  "versions": {
    "1.0": {
      "datetimeFormat": "YYYY-MM-DD HH:mm:ss",
      "tests": [
        {
          "id": "ocps-1.0-basic-5-field-matching",
          "type": "datetime-match",
          "description": "Basic 5-field matching.",
          "pattern": "15 10 * * *",
          "expectations": {
            "mustMatch": [
              "2025-03-10 10:15:00"
            ],
            "mustNotMatch": [
              "2025-03-10 10:14:00"
            ]
          }
        },
        {
          "id": "ocps-1.0-case-insensitive-month-and-weekday-names",
          "type": "datetime-match",
          "description": "Case-insensitive month and day-of-week names.",
          "pattern": "30 8 * jan Mon",
          "expectations": {
            "mustMatch": [
              "2025-01-06 08:30:00"
            ],
            "mustNotMatch": [
              "2025-02-03 08:30:00"
            ]
          }
        },
        {
          "id": "ocps-1.0-step-evaluation-over-explicit-range",
          "type": "datetime-match",
          "description": "Step evaluation over an explicit range.",
          "pattern": "5-59/15 9 * * *",
          "expectations": {
            "mustMatch": [
              "2025-03-10 09:05:00",
              "2025-03-10 09:20:00",
              "2025-03-10 09:35:00",
              "2025-03-10 09:50:00"
            ],
            "mustNotMatch": [
              "2025-03-10 09:15:00"
            ]
          }
        },
        {
          "id": "ocps-1.0-restricted-day-fields-use-logical-or",
          "type": "datetime-match",
          "description": "Restricted day-of-month and day-of-week fields use logical OR.",
          "pattern": "0 12 1 * MON",
          "expectations": {
            "mustMatch": [
              "2025-10-01 12:00:00",
              "2025-10-06 12:00:00"
            ],
            "mustNotMatch": [
              "2025-10-07 12:00:00"
            ]
          }
        },
        {
          "id": "ocps-1.0-leading-wildcard-is-unrestricted-for-section-6-1",
          "type": "datetime-match",
          "description": "A literal leading wildcard in the day-of-month field is treated as unrestricted for Section 6.1.",
          "pattern": "0 12 * * MON",
          "expectations": {
            "mustMatch": [
              "2025-10-06 12:00:00"
            ],
            "mustNotMatch": [
              "2025-10-07 12:00:00"
            ]
          }
        },
        {
          "id": "ocps-1.0-full-range-expression-remains-restricted-for-section-6-1",
          "type": "datetime-match",
          "description": "A full-range day-of-month expression remains restricted for Section 6.1.",
          "pattern": "0 12 1-31 * MON",
          "expectations": {
            "mustMatch": [
              "2025-10-06 12:00:00",
              "2025-10-07 12:00:00"
            ],
            "mustNotMatch": [
              "2025-10-08 11:00:00"
            ]
          }
        },
        {
          "id": "ocps-1.0-out-of-range-minute-rejected",
          "type": "parse-reject",
          "description": "Out-of-range minute values are rejected.",
          "pattern": "60 0 * * *",
          "expectations": {
            "parse": {
              "result": "reject"
            }
          }
        },
        {
          "id": "ocps-1.0-invalid-range-rejected",
          "type": "parse-reject",
          "description": "Ranges with descending bounds are rejected.",
          "pattern": "0 0 10-5 * *",
          "expectations": {
            "parse": {
              "result": "reject"
            }
          }
        },
        {
          "id": "ocps-1.0-invalid-step-syntax-rejected",
          "type": "parse-reject",
          "description": "Invalid step syntax is rejected.",
          "pattern": "0 0 /30 * *",
          "expectations": {
            "parse": {
              "result": "reject"
            }
          }
        },
        {
          "id": "ocps-1.0-impossible-date-is-syntactically-valid",
          "type": "parse-accept",
          "description": "Impossible dates remain syntactically valid.",
          "pattern": "* * 31 2 *",
          "expectations": {
            "parse": {
              "result": "accept"
            }
          }
        }
      ]
    },
    "1.1": {
      "datetimeFormat": "YYYY-MM-DD HH:mm:ss",
      "tests": [
        {
          "id": "ocps-1.1-yearly-nickname",
          "type": "datetime-match",
          "description": "Yearly nickname.",
          "pattern": "@yearly",
          "expectations": {
            "mustMatch": [
              "2026-01-01 00:00:00"
            ],
            "mustNotMatch": [
              "2026-01-02 00:00:00"
            ]
          }
        },
        {
          "id": "ocps-1.1-monthly-nickname",
          "type": "datetime-match",
          "description": "Monthly nickname.",
          "pattern": "@monthly",
          "expectations": {
            "mustMatch": [
              "2026-02-01 00:00:00"
            ],
            "mustNotMatch": [
              "2026-02-02 00:00:00"
            ]
          }
        },
        {
          "id": "ocps-1.1-weekly-nickname",
          "type": "datetime-match",
          "description": "Weekly nickname.",
          "pattern": "@weekly",
          "expectations": {
            "mustMatch": [
              "2025-10-05 00:00:00"
            ],
            "mustNotMatch": [
              "2025-10-06 00:00:00"
            ]
          }
        },
        {
          "id": "ocps-1.1-daily-nickname",
          "type": "datetime-match",
          "description": "Daily nickname.",
          "pattern": "@daily",
          "expectations": {
            "mustMatch": [
              "2025-10-07 00:00:00"
            ],
            "mustNotMatch": [
              "2025-10-07 00:01:00"
            ]
          }
        },
        {
          "id": "ocps-1.1-hourly-nickname",
          "type": "datetime-match",
          "description": "Hourly nickname.",
          "pattern": "@hourly",
          "expectations": {
            "mustMatch": [
              "2025-10-07 10:00:00"
            ],
            "mustNotMatch": [
              "2025-10-07 10:01:00"
            ]
          }
        },
        {
          "id": "ocps-1.1-daily-nickname-midnight-schedule",
          "type": "datetime-match",
          "description": "The daily nickname runs at midnight each day across adjacent days and month boundaries.",
          "pattern": "@daily",
          "expectations": {
            "mustMatch": [
              "2025-10-08 00:00:00",
              "2025-10-09 00:00:00",
              "2025-11-01 00:00:00"
            ],
            "mustNotMatch": [
              "2025-10-08 00:00:01",
              "2025-10-08 23:59:59",
              "2025-11-01 00:01:00"
            ]
          }
        },
        {
          "id": "ocps-1.1-nicknames-are-case-sensitive",
          "type": "parse-reject",
          "description": "Nicknames are case-sensitive.",
          "pattern": "@Daily",
          "expectations": {
            "parse": {
              "result": "reject"
            }
          }
        },
        {
          "id": "ocps-1.1-nickname-surrounding-whitespace-is-ignored",
          "type": "parse-accept",
          "description": "Leading and trailing whitespace around nicknames is ignored.",
          "pattern": "  @daily  ",
          "expectations": {
            "parse": {
              "result": "accept"
            }
          }
        },
        {
          "id": "ocps-1.1-nickname-cannot-be-combined-with-field-expression",
          "type": "parse-reject",
          "description": "Nicknames cannot be combined with field expressions.",
          "pattern": "@daily 0 0 * * *",
          "expectations": {
            "parse": {
              "result": "reject"
            }
          }
        },
        {
          "id": "ocps-1.1-nickname-cannot-be-combined-with-other-token",
          "type": "parse-reject",
          "description": "Nicknames cannot be followed by any other token.",
          "pattern": "@daily foo",
          "expectations": {
            "parse": {
              "result": "reject"
            }
          }
        },
        {
          "id": "ocps-1.1-unknown-nickname-is-rejected",
          "type": "parse-reject",
          "description": "Nicknames not defined by the specification are rejected.",
          "pattern": "@weekdays",
          "expectations": {
            "parse": {
              "result": "reject"
            }
          }
        },
        {
          "id": "ocps-1.1-nickname-surrounding-tab-whitespace-is-ignored",
          "type": "parse-accept",
          "description": "Leading and trailing horizontal tabs around nicknames are ignored.",
          "pattern": "\t@hourly\t",
          "expectations": {
            "parse": {
              "result": "accept"
            }
          }
        },
        {
          "id": "ocps-1.1-reboot-parse-and-runtime-handling",
          "type": "runtime-capability",
          "description": "The reboot nickname is accepted at parse time and may be rejected at runtime when no startup event exists.",
          "pattern": "@reboot",
          "expectations": {
            "parse": {
              "result": "accept"
            },
            "runtime": {
              "contextType": "startup-event",
              "whenUnsupported": "reject-with-clear-error"
            }
          }
        },
        {
          "id": "ocps-1.1-annually-nickname",
          "type": "datetime-match",
          "description": "The annually nickname is an alias of yearly.",
          "pattern": "@annually",
          "expectations": {
            "mustMatch": [
              "2026-01-01 00:00:00"
            ],
            "mustNotMatch": [
              "2026-01-02 00:00:00"
            ]
          }
        },
        {
          "id": "ocps-1.1-midnight-nickname",
          "type": "datetime-match",
          "description": "The midnight nickname is an alias of daily.",
          "pattern": "@midnight",
          "expectations": {
            "mustMatch": [
              "2026-03-10 00:00:00"
            ],
            "mustNotMatch": [
              "2026-03-10 00:01:00"
            ]
          }
        },
        {
          "id": "ocps-1.1-reboot-cannot-be-combined-with-field-expression",
          "type": "parse-reject",
          "description": "The reboot nickname cannot be combined with field expressions.",
          "pattern": "@reboot 0 0 * * *",
          "expectations": {
            "parse": {
              "result": "reject"
            }
          }
        }
      ]
    },
    "1.2": {
      "datetimeFormat": "YYYY-MM-DD HH:mm:ss",
      "tests": [
        {
          "id": "ocps-1.2-five-field-patterns-default-seconds-to-zero",
          "type": "datetime-match",
          "description": "Five-field patterns default the seconds field to 0.",
          "pattern": "15 10 * * *",
          "expectations": {
            "mustMatch": [
              "2025-03-10 10:15:00"
            ],
            "mustNotMatch": [
              "2025-03-10 10:15:30"
            ]
          }
        },
        {
          "id": "ocps-1.2-six-field-patterns-match-explicit-seconds",
          "type": "datetime-match",
          "description": "Six-field patterns match explicit seconds.",
          "pattern": "30 15 10 * * *",
          "expectations": {
            "mustMatch": [
              "2025-03-10 10:15:30"
            ],
            "mustNotMatch": [
              "2025-03-10 10:15:29"
            ]
          }
        },
        {
          "id": "ocps-1.2-seven-field-patterns-constrain-year",
          "type": "datetime-match",
          "description": "Seven-field patterns constrain the year.",
          "pattern": "0 15 10 * * * 2025",
          "expectations": {
            "mustMatch": [
              "2025-03-10 10:15:00"
            ],
            "mustNotMatch": [
              "2026-03-10 10:15:00"
            ]
          }
        },
        {
          "id": "ocps-1.2-range-step-begins-at-1970",
          "type": "datetime-match",
          "description": "Stepping over the explicit standard range begins at 1970.",
          "pattern": "0 0 0 1 1 * 1970-2199/2",
          "expectations": {
            "mustMatch": [
              "2026-01-01 00:00:00"
            ],
            "mustNotMatch": [
              "2025-01-01 00:00:00"
            ]
          }
        },
        {
          "id": "ocps-1.2-parser-accepts-5-field-patterns",
          "type": "parse-accept",
          "description": "A compliant parser accepts 5-field patterns.",
          "pattern": "15 10 * * *",
          "expectations": {
            "parse": {
              "result": "accept"
            }
          }
        },
        {
          "id": "ocps-1.2-parser-accepts-6-field-patterns",
          "type": "parse-accept",
          "description": "A compliant parser accepts 6-field patterns.",
          "pattern": "30 15 10 * * *",
          "expectations": {
            "parse": {
              "result": "accept"
            }
          }
        },
        {
          "id": "ocps-1.2-parser-accepts-7-field-patterns",
          "type": "parse-accept",
          "description": "A compliant parser accepts 7-field patterns.",
          "pattern": "0 15 10 * * * 2025",
          "expectations": {
            "parse": {
              "result": "accept"
            }
          }
        },
        {
          "id": "ocps-1.2-years-before-1970-are-non-portable",
          "type": "portability",
          "description": "Years before the standard range are non-portable unless the implementation documents a wider range.",
          "pattern": "0 0 0 1 1 * 1969",
          "expectations": {
            "portability": {
              "result": "non-portable",
              "allowedWhenDocumentedRangeIncludesValue": true
            }
          }
        }
      ]
    },
    "1.3": {
      "datetimeFormat": "YYYY-MM-DD HH:mm:ss",
      "tests": [
        {
          "id": "ocps-1.3-last-day-of-month",
          "type": "datetime-match",
          "description": "Last day of month.",
          "pattern": "0 0 L * *",
          "expectations": {
            "mustMatch": [
              "2025-02-28 00:00:00"
            ],
            "mustNotMatch": [
              "2025-02-27 00:00:00"
            ]
          }
        },
        {
          "id": "ocps-1.3-last-weekday-of-month",
          "type": "datetime-match",
          "description": "Last Friday of the month.",
          "pattern": "0 0 * * FRI#L",
          "expectations": {
            "mustMatch": [
              "2025-02-28 00:00:00"
            ],
            "mustNotMatch": [
              "2025-02-21 00:00:00"
            ]
          }
        },
        {
          "id": "ocps-1.3-nth-weekday-of-month",
          "type": "datetime-match",
          "description": "Third Tuesday of the month.",
          "pattern": "0 0 * * TUE#3",
          "expectations": {
            "mustMatch": [
              "2025-06-17 00:00:00"
            ],
            "mustNotMatch": [
              "2025-06-10 00:00:00"
            ]
          }
        },
        {
          "id": "ocps-1.3-closest-weekday-within-month",
          "type": "datetime-match",
          "description": "Closest weekday within the month.",
          "pattern": "0 12 15W * *",
          "expectations": {
            "mustMatch": [
              "2025-06-16 12:00:00"
            ],
            "mustNotMatch": [
              "2025-06-15 12:00:00"
            ]
          }
        },
        {
          "id": "ocps-1.3-closest-weekday-does-not-cross-month-boundary",
          "type": "datetime-match",
          "description": "The closest weekday does not cross the month boundary.",
          "pattern": "0 12 1W * *",
          "expectations": {
            "mustMatch": [
              "2025-02-03 12:00:00"
            ],
            "mustNotMatch": [
              "2025-02-01 12:00:00"
            ]
          }
        },
        {
          "id": "ocps-1.3-w-cannot-be-combined-with-range",
          "type": "parse-reject",
          "description": "The W modifier cannot be combined with a range.",
          "pattern": "0 12 1-15W * *",
          "expectations": {
            "parse": {
              "result": "reject"
            }
          }
        }
      ]
    },
    "1.4": {
      "datetimeFormat": "YYYY-MM-DD HH:mm:ss",
      "tests": [
        {
          "id": "ocps-1.4-restricted-day-fields-default-to-logical-or",
          "type": "datetime-match",
          "description": "Restricted day fields default to logical OR. Here, 2025-09-01 is a Monday and 2025-10-01 is a Wednesday.",
          "pattern": "0 12 1 * MON",
          "expectations": {
            "mustMatch": [
              "2025-09-01 12:00:00",
              "2025-09-08 12:00:00",
              "2025-10-01 12:00:00"
            ],
            "mustNotMatch": [
              "2025-10-07 12:00:00"
            ]
          }
        },
        {
          "id": "ocps-1.4-plus-prefix-requires-logical-and",
          "type": "datetime-match",
          "description": "A plus-prefixed day-of-week field requires logical AND.",
          "pattern": "0 12 1 * +MON",
          "expectations": {
            "mustMatch": [
              "2025-09-01 12:00:00"
            ],
            "mustNotMatch": [
              "2025-09-08 12:00:00",
              "2025-10-01 12:00:00"
            ]
          }
        },
        {
          "id": "ocps-1.4-plus-must-prefix-day-of-week-expression",
          "type": "parse-reject",
          "description": "The plus modifier must prefix the day-of-week field expression.",
          "pattern": "0 12 +1 * MON",
          "expectations": {
            "parse": {
              "result": "reject"
            }
          }
        },
        {
          "id": "ocps-1.4-question-mark-invalid-outside-day-fields",
          "type": "parse-reject",
          "description": "The question mark is only meaningful in the day-of-month and day-of-week fields.",
          "pattern": "? 12 * * *",
          "expectations": {
            "parse": {
              "result": "reject"
            }
          }
        }
      ]
    }
  }
}
