v0.29.0—Sharper bug analysis, reliable resource cleanup, and stronger test and CI checks.See what's new

Structured Output

Machine-readable JSON, SARIF, and NDJSON output contracts

Diagnostic-producing commands emit a shared schema 2.0 envelope. In structured mode, stdout contains exactly one parseable document; progress and status text go to stderr. Early failures also produce an envelope.

Bash
calor --input file.calr --format json
calor --input file.calr --format sarif
calor lint file.calr --format json
calor watch src/ --format json

Root compile supports -f; on lint, spell out --format because -f means --fix. Watch produces NDJSON: one compact envelope per line for every rebuild.

Envelope Shape

Example output (not checked)
{
  "version": "2.0",
  "command": "verify",
  "diagnostics": [
    {
      "code": "Calor0712",
      "message": "Postcondition refuted",
      "severity": "warning",
      "location": { "file": "Math.calr", "line": 4, "column": 5 },
      "declarationId": "f001",
      "verification": {
        "status": "refuted",
        "counterexample": {
          "bindings": [{ "name": "x", "value": "1" }]
        }
      }
    }
  ],
  "summary": { "total": 1, "errors": 0, "warnings": 1, "info": 0 },
  "data": {}
}

Fields that do not apply are omitted. diagnostics[].fix.edits[] carries machine-applicable, 1-based, end-exclusive source edits when a diagnostic has a fix. Command-specific results live under data.

Conversion Output

The C# → Calor surfaces report in three shapes:

SurfaceDocumentConversion issuesPer-file result
calor convert --format jsonEnvelope on stdout; the text report goes to stderrdiagnostics[]: Calor1343, message prefixed with the feature namedata.losses[] and data.conversionPaths
calor migrate --report <file>.jsonEnvelope written to the report fileCalor1343 diagnosticsdata.fileResults[].losses[] and .conversionPaths
MCP calor_convertThe tool's own result objecttop-level issues[] (envelope-form Calor1343 entries)lossSummary.locations[] and lossSummary.paths
MCP calor_migrate (phase: "convert")The tool's own result objectperFile[].errors[] and perFile[].warnings[]perFile[].losses[] and perFile[].conversionPaths
MCP calor_batch (action: "convert")The tool's own result objectfiles[].issues[]files[].conversionPaths

conversionPaths.outcome (native, preserved, lossy, unverified, refused) is the field to test. unverified means the file was written under --lossy but its C# failed the round-trip compile check; conversionPaths.roundTrip says whether that check ran (verified, failed, deferred, not-run). The native construct counts (nativeConversionCount, lossSummary.nativeConversions) also count constructs of a type a rescue later replaced with C#. See Which mechanism kept the C# for the per-surface defaults.

Exit codes do not change with the output format: tools must inspect both the process exit code and the document. See Envelope Schema for field-level details.