<commit_before># Structured Acceptance Test Output

This document is part of the Structured Acceptance Test specification, please see versioning information and details at [the project main page](README.md). *Process* refers to a computer program that supports the Structured Acceptance Test standard. *Consumer* refers to something that uses the output of the *process*.

The key words MUST, MUST NOT, REQUIRED, SHALL, SHALL NOT, SHOULD, SHOULD NOT, RECOMMEND, MAY, and OPTIONAL in this document are to be interpreted as described in [RFC 2119](https://www.ietf.org/rfc/rfc2119.txt).

## Valid output examples

### The simplest valid example

```json
{
  "statVersion": "1.0.0",
  "process": {
    "name": "Vowel grep"    
  }
}
```

This example identifies an acceptance test named "Vowel grep" and does not express any findings. A `pass` outcome is implied.

### Full-featured example

```json
{
  "statVersion": "1.0.0",
  "process": {
    "name": "Vowel grep",
    "version": "0.1.0",
    "description": "Ensures that no a's, e's, i's, o's or u's are found",
    "maintainer": "<NAME>",
    "email": "<EMAIL>",
    "website": "https://github.com/fulldecent/structured-acceptance-test/tree/master/Examples",
    "repeatability": "Associative"
  },
  "findings": [
    {
      "failure": true,
      "rule": "Vowel used",
      "description": "Letter a was used",
      "detail": {
        "body": "Don't use `a` because only consonants are allowed."
      },
      "categories": [
        "Style"
      ],
      "location": {
        "path": "code\/hello.txt",
        "beginLine": 1,
        "beginColumn": 2,
        "endLine": 1,
        "endColumn": 2
      },
      "timeToFix": 60,
      "recommendation": "Replace this with an X",
      "fixes": [
        {
          "location": {
            "path": "code\/hello.txt",
            "beginLine": 1,
            "beginColumn": 2,
            "endLine": 1,
            "endColumn": 2
          },
          "newText": "X"
        }
      ]
    }
  ]
}
```

This example shows the partial output of a *process* that disallows vowels being applied to a file containing "hello world".

## Full specification

The output is a [JSON-formatted](http://www.json.org/) object containing a **Process** object and zero or more **Finding** objects.

```json
{
  "statVersion": "1.0.0",
  "process": Process,
  "findings": [Finding]
}
```

* `statVersion` &mdash; **Required** &mdash; The version of Structured Acceptance Test against which this output is valid
* `process` &mdash; **Required** &mdash; Identification of the *process* which is doing testing
* `findings` &mdash; **Optional** &mdash; A set of observations reported by the *process*, or `[]` if not specified

Each finding SHOULD be delimited by a new line. A computer program with STAT-compliant output SHOULD immediately output each finding as available (e.g. use `flush()`). This allows the `consumer` to begin processing the results right away.

A *consumer* should ignore the entire STAT Output if it is not valid JSON. This may occur, for example, if the *process* was interrupted or had an internal error.

A STAT-compliant computer program MUST produce STAT-compliant output on STDOUT and MUST exit with a return status of zero if no *failure* *findings* were reported, or non-zero otherwise.

### Process

```json
{
  "name": String,
  "version": String,
  "description": String,
  "maintainer": String,
  "email": String,
  "website": String,
  "repeatability": Repeatability
}
```

 * `name` &mdash; **Required** &mdash; Identification of the acceptance test *process*
   * For automated tools, this MUST be the name of the tool
   * For manual review, this SHOULD refer to the name of the test and validation procedure performed<commit_msg>Add title for incremental output section<commit_after># Structured Acceptance Test Output

This document is part of the Structured Acceptance Test specification, please see versioning information and details at [the project main page](README.md). *Process* refers to a computer program that supports the Structured Acceptance Test standard. *Consumer* refers to something that uses the output of the *process*.

The key words MUST, MUST NOT, REQUIRED, SHALL, SHALL NOT, SHOULD, SHOULD NOT, RECOMMEND, MAY, and OPTIONAL in this document are to be interpreted as described in [RFC 2119](https://www.ietf.org/rfc/rfc2119.txt).

## Valid output examples

### The simplest valid example

```json
{
  "statVersion": "1.0.0",
  "process": {
    "name": "Vowel grep"    
  }
}
```

This example identifies an acceptance test named "Vowel grep" and does not express any findings. A `pass` outcome is implied.

### Full-featured example

```json
{
  "statVersion": "1.0.0",
  "process": {
    "name": "Vowel grep",
    "version": "0.1.0",
    "description": "Ensures that no a's, e's, i's, o's or u's are found",
    "maintainer": "<NAME>",
    "email": "<EMAIL>",
    "website": "https://github.com/fulldecent/structured-acceptance-test/tree/master/Examples",
    "repeatability": "Associative"
  },
  "findings": [
    {
      "failure": true,
      "rule": "Vowel used",
      "description": "Letter a was used",
      "detail": {
        "body": "Don't use `a` because only consonants are allowed."
      },
      "categories": [
        "Style"
      ],
      "location": {
        "path": "code\/hello.txt",
        "beginLine": 1,
        "beginColumn": 2,
        "endLine": 1,
        "endColumn": 2
      },
      "timeToFix": 60,
      "recommendation": "Replace this with an X",
      "fixes": [
        {
          "location": {
            "path": "code\/hello.txt",
            "beginLine": 1,
            "beginColumn": 2,
            "endLine": 1,
            "endColumn": 2
          },
          "newText": "X"
        }
      ]
    }
  ]
}
```

This example shows the partial output of a *process* that disallows vowels being applied to a file containing "hello world".

## Full specification

The output is a [JSON-formatted](http://www.json.org/) object containing a **Process** object and zero or more **Finding** objects.

```json
{
  "statVersion": "1.0.0",
  "process": Process,
  "findings": [Finding]
}
```

* `statVersion` &mdash; **Required** &mdash; The version of Structured Acceptance Test against which this output is valid
* `process` &mdash; **Required** &mdash; Identification of the *process* which is doing testing
* `findings` &mdash; **Optional** &mdash; A set of observations reported by the *process*, or `[]` if not specified

INCREMENTAL OUTPUT: Each finding SHOULD be delimited by a new line. A computer program with STAT-compliant output SHOULD immediately output each finding as available (e.g. use `flush()`). This allows the `consumer` to begin processing the results right away.

A *consumer* should ignore the entire STAT Output if it is not valid JSON. This may occur, for example, if the *process* was interrupted or had an internal error.

A STAT-compliant computer program MUST produce STAT-compliant output on STDOUT and MUST exit with a return status of zero if no *failure* *findings* were reported, or non-zero otherwise.

### Process

```json
{
  "name": String,
  "version": String,
  "description": String,
  "maintainer": String,
  "email": String,
  "website": String,
  "repeatability": Repeatability
}
```

 * `name` &mdash; **Required** &mdash; Identification of the acceptance test *process*
   * For automated tools, this MUST be the name of the tool
   * For manual review, this SHOULD refer to the name of the test and validation procedure performed
{'fraction_non_alphanumeric': 0.12633663366336634, 'fraction_numerical': 0.007920792079207921, 'mean_word_length': 3.265765765765766, 'pattern_counts': {'":': 90, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 4, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1917776', 'n_tokens_mistral': 2356, 'n_tokens_neox': 2204, 'n_words': 876}