{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "CountTotalOutput",
"description": "NDJSON output for total line/file counts.",
"type": "object",
"properties": {
"type": {
"description": "Event type discriminator.",
"type": "string"
},
"mode": {
"description": "Count mode name.",
"type": "string"
},
"total": {
"description": "Aggregate totals.",
"$ref": "#/$defs/CountTotals"
},
"elapsed_ms": {
"description": "Duration in milliseconds.",
"type": "integer",
"format": "uint64",
"minimum": 0
},
"files_failed": {
"description": "Files the walk saw but could not read; present only when some failed.",
"type": [
"integer",
"null"
],
"format": "uint64",
"minimum": 0
},
"errors": {
"description": "First read failures, capped; `files_failed` is the full count.",
"type": [
"array",
"null"
],
"items": {
"$ref": "#/$defs/FileFailure"
}
},
"partial": {
"description": "The run answered from part of its targets, so the answer is partial.\n\nPresent exactly when `files_failed` is present, so a consumer reads one\nflag instead of comparing two counters.",
"type": [
"boolean",
"null"
]
},
"walker_stopped_early": {
"description": "Present and true when the walker itself quit before the tree ended.\n\nIt is read off the walk, never off the writer's output budget: a walk\nthat visited every file reports `false` (or omits the field) even when\n`--limit` dropped records. A path that collects the whole tree and only\nthen slices the page never sets it.",
"type": [
"boolean",
"null"
]
},
"ok": {
"description": "Outcome of the run, stamped by the writer",
"type": "boolean"
},
"code": {
"description": "Machine error code, present when ok is false",
"type": "string"
},
"exit": {
"description": "Process exit status, present when ok is false",
"type": "integer",
"minimum": 0
},
"target_resolved": {
"description": "Absolute targets the run resolved, in invocation order, and never a joined string, so a path holding `,` stays readable; a run with one target publishes a one-item array, so the shape never depends on the count",
"type": "array",
"items": {
"type": "string"
}
},
"target_source": {
"description": "Where the target came from: named in the invocation line, inherited from the workspace slot, or the standard-input stream",
"type": "string",
"enum": [
"argv",
"workspace",
"stdin"
]
},
"workspace_source": {
"description": "Where the workspace root came from: the `--workspace` flag or the process working directory",
"type": "string",
"enum": [
"argv",
"cwd"
]
},
"records_suppressed": {
"description": "Records the writer dropped before the terminal event: `--filter` rejections, `--select` projections that emptied the record, dedupe duplicates and `--limit` cuts. It counts records, never files, so it does not compare with `files_matched`: one file can contribute several records",
"type": "integer",
"minimum": 0
},
"files_budget_dropped": {
"description": "Entries the `--limit` budget dropped, in the unit the verb produces: files for walking verbs, records for streaming ones; a floor, because workers may stop before producing the rest",
"type": "integer",
"minimum": 0
},
"files_planned": {
"description": "Files the run would have modified in `--dry-run` or `--preview`; absent from a run that really wrote",
"type": "integer",
"minimum": 0
},
"truncated": {
"description": "The record itself was cut by `--truncate-content` or `--max-output-bytes`, so the fields are shorter than the source",
"type": "boolean"
},
"truncated_records": {
"description": "Records the writer cut this run, counted once per record",
"type": "integer",
"minimum": 0
}
},
"required": [
"type",
"mode",
"total",
"elapsed_ms",
"ok"
],
"additionalProperties": false,
"$defs": {
"CountTotals": {
"description": "Aggregate file and line counts.",
"type": "object",
"properties": {
"files": {
"description": "Total files counted.",
"type": "integer",
"format": "uint64",
"minimum": 0
},
"lines": {
"description": "Total lines counted.",
"type": "integer",
"format": "uint64",
"minimum": 0
},
"blank": {
"description": "Total blank lines.",
"type": "integer",
"format": "uint64",
"minimum": 0
},
"bytes": {
"description": "Total bytes.",
"type": "integer",
"format": "uint64",
"minimum": 0
}
},
"required": [
"files",
"lines",
"blank",
"bytes"
]
},
"FileFailure": {
"description": "One file an operation could not process, as listed in a summary's `errors[]`.",
"type": "object",
"properties": {
"path": {
"description": "Path of the file that failed.",
"type": "string"
},
"code": {
"description": "Machine error code of the failure (for example `PERMISSION_DENIED`).",
"type": "string"
},
"message": {
"description": "Human-readable failure message.",
"type": "string"
}
},
"required": [
"path",
"code",
"message"
]
}
}
}