{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/proptastic/proptastic/main/contract/schemas/manifest/v1.json",
  "title": "proptastic's run-time manifest, v1",
  "description": "`properties.json` in proptastic's directory (PROPTASTIC_DIR, else proptastic's directory in the build's output): every property a run has started since the directory was made, the newest run of each, one a line in order of `id` (decision 29). No host can tell a property from a plain test, so this is how a tool knows which tests are properties. A mutant's run (`PROPTASTIC_EVENTS=false`) writes none. Within v1, a property only gains fields: read what you know, and ignore a field you don't.",
  "type": "object",
  "required": ["schema", "edition", "properties"],
  "properties": {
    "schema": { "const": "proptastic.manifest/v1" },
    "edition": { "enum": ["java", "rust", "swift"], "description": "Which edition wrote the file." },
    "properties": {
      "type": "array",
      "description": "The properties, in order of `id`.",
      "items": { "$ref": "#/$defs/property" }
    }
  },
  "$defs": {
    "property": {
      "type": "object",
      "description": "One property: its fields in the contract's order (`manifest.fields`).",
      "required": ["id", "class", "method", "signature", "key", "domains", "seed", "seeded", "tries", "budget", "profile", "at"],
      "properties": {
        "id": {
          "type": "string",
          "description": "The property's exact id in its host's form, as the edition's `identity` binding (E2) gives it: Java `com.example.SortTest#sortKeepsSize()`."
        },
        "class": { "type": "string", "description": "The test's class, module or file, as the host names it." },
        "method": { "type": "string", "description": "The test's name, as a failure's header prints it." },
        "signature": { "type": "string", "description": "The name the random stream is keyed on." },
        "key": {
          "type": "string",
          "description": "The key of the property's corpus: its `.id`, or class and signature."
        },
        "domains": {
          "type": "string",
          "description": "The domains' shape, whose fingerprint marks corpus entries stale."
        },
        "seed": {
          "type": "string",
          "pattern": "^0x[0-9a-f]{1,16}$",
          "description": "This run's seed, `0x` and hex digits."
        },
        "seeded": {
          "enum": ["chain", "setting", "random"],
          "description": "Where the seed came from: the chain's `.seed`, `PROPTASTIC_SEED`, or drawn at random."
        },
        "tries": { "type": "integer", "minimum": 0, "description": "The tries the run allows." },
        "budget": {
          "type": ["string", "null"],
          "description": "The time budget, as said (`2s`), or `null`."
        },
        "profile": { "enum": ["local", "pr", "nightly"] },
        "at": {
          "description": "Where the property's `forAll` is called, which `--at` selects by and `example` pins after; `null` where the edition can't tell.",
          "oneOf": [
            {
              "type": "object",
              "required": ["path", "line"],
              "properties": {
                "path": {
                  "type": "string",
                  "description": "The file, as the edition's `identity` binding (E2) gives it: Java `com/example/SortTest.java`, under its source root."
                },
                "line": { "type": "integer", "minimum": 1 }
              }
            },
            { "type": "null" }
          ]
        },
        "task": {
          "type": ["string", "null"],
          "description": "The host's task that ran the property, as the CLI runs it again (decision 75): a Gradle test task's name, `test` or `docsTest`; Maven's `test` under Surefire, `verify` under Failsafe; `null` where the edition can't tell. Not required: a manifest written before decision 75 has none, and is still v1; a reader takes none as the host's default task."
        }
      }
    }
  }
}
