{"schemaVersion":"2.0.0","locale":"en","title":"JSON and exit codes","description":"This page describes source-scan schema 1.0.0 at product 524fa07e. Other subcommands have separate report contracts; do not deserialize them as source-scan reports.","htmlUrl":"https://docs.swift-analyzer.com/reference/output/","markdownUrl":"https://docs.swift-analyzer.com/reference/output/index.md","productRevision":"524fa07e0ae4153c84ac12ae9eb6559df89ec2be","catalogRevision":"4558458d","docsRevision":"1f17ba58ab08627e0de898f1442067b09e960b48cd5605d6529e9275f8930d68","channel":"pre-prod","maturity":"experimental","access":"owner-provided-checkout","markdown":"# JSON and exit codes\n\nThis page describes source-scan schema 1.0.0 at product 524fa07e. Other subcommands have separate report contracts; do not deserialize them as source-scan reports.\n\n## Report fields\n\n| Field | Interpretation |\n| --- | --- |\n| kind | `swift-analyzer.source-scan` identifies this report type |\n| schemaVersion | `1.0.0` for the documented source-scan report |\n| maturity | `experimental`; independent of the documentation's pre-prod channel |\n| status | complete, degraded or unavailable |\n| requestedConditions | Selected condition IDs, not a finding list |\n| conditions | Per-condition requested/executed state, coverage, observations and counts |\n| families | Family-level coverage, observations, findings, reasons and evidence payload |\n| reasons | Machine-readable limitations or acquisition reasons |\n| admittedSourceCount | Sources admitted to the analysis, not all files on disk |\n| snapshot | Admitted snapshot identity, or null when unavailable |\n| sourceInputDigest | Identity of discovered input, when available |\n\nAdditional discovery/admission counters distinguish authored, generated, Swift and native inputs. Read them alongside reasons; discovered inputs are not necessarily admitted. Fields may be absent when their acquisition stage did not finish.\n\n## Condition coverage\n\nA condition row includes `conditionID`, `ruleID`, `requested`, `executed`, `coverage`, `observationCount`, `unknownObservationCount`, `findingCount`, `notApplicableCount` and `observationIDs`. Coverage values are `not-run`, `no-observations`, `degraded` and `completed`. [Understand results](https://docs.swift-analyzer.com/guides/results/) explains their use.\n\n## Exit codes\n\n| Code | Meaning |\n| --- | --- |\n| 0 | Operation completed; a configured gate passed where applicable |\n| 1 | An explicitly configured findings gate failed |\n| 2 | Invalid CLI, schema, manifest or configuration input |\n| 3 | Requested definitive analysis lacks sufficient quality or capability |\n| 4 | Acquisition, source, index or toolchain failure |\n| 5 | Internal invariant or serialization failure |\n| 130 | Cancelled; do not treat output as a complete result |\n\nThese are the shared analyzer outcome codes. Argument parsing and the separate experimental preview can report errors through their own command error path; preserve stderr and do not infer source-scan coverage from those failures. Source-scan returns 3 when degraded, even if useful findings are present. It has no findings-gate option.\n\n## Streams and stability\n\nExecution proof `anchors` are pairs such as `[\"Sources/Example/Execution.swift\", 67]`: the logical source path followed by a zero-based UTF-8 byte offset from the start of that file. The number is not a line number or a character index. Open the matching source snapshot; non-ASCII characters can occupy several bytes. Other report payloads may use separate line/column or range fields, so interpret each named field according to its report contract.\n\nJSON is written to stdout after validation and serialization. Timing is written to stderr. Preserve the process result separately from JSON. Snapshot IDs, evidence IDs and timings are not expected to match across differently located or rebuilt inputs. Do not parse human-readable output as a stable schema.\n\n[Follow one recorded finding](https://docs.swift-analyzer.com/guides/results/#follow-one-recorded-finding) walks from a catalog condition through observation IDs to the actual family-specific proof and source locations. It also explains a remaining unknown in the edited control.\n","anchors":["json-and-exit-codes","report-fields","condition-coverage","exit-codes","streams-and-stability"]}
