Reference

Diagnostics

Checker error codes, structured fields, and repair hints for agents.

Summary

point check-json returns diagnostics designed for automated repair. Each entry includes a stable code, human message, semantic ref when available, and optional expected, actual, repair, and relatedRefs.

JSON shape

{
  "schemaVersion": "point.core.check.v1",
  "ok": false,
  "diagnostics": [
    {
      "code": "unknown-field",
      "message": "Unknown field email on User",
      "ref": "point://semantic/Math/record.User/field.email",
      "expected": ["name", "active"],
      "actual": "email",
      "repair": "Use one of: name, active.",
      "relatedRefs": []
    }
  ]
}

Error codes

CodeTypical cause
unknown-fieldField not on record type
missing-fieldRecord literal missing required field
unknown-identifierName not in scope
unknown-functionCall to undefined function
unknown-typeType name not declared
type-mismatchExpression type does not match expected
return-type-mismatchReturn does not match function output
iteration-type-mismatchfor each needs List<T>
operator-type-mismatchOperator used on wrong types
arity-mismatchWrong number of call arguments
missing-awaitAction call without await
missing-variant-caseon Case return dispatch misses declared variant cases
pipeline-step-type-mismatchPipeline step argument types do not match action inputs or pipeline output
float-money-fieldFloat used on a money-like record field name
middleware-input-unavailableRoute referenced by before does not declare a middleware input
middleware-input-type-mismatchMiddleware input type does not match route input for the same label
immutable-assignmentAssign to non-mutable binding
nullable-field-accessField access on Maybe<T> without narrow
not-a-recordField access on non-record type
record-type-requiredRecord literal without expected type
list-type-requiredEmpty list without List<T> context
invalid-type-arityWrong number of generic args
duplicate-typeTwo types with same name
duplicate-functionTwo functions with same name
duplicate-valueTwo values with same name

Parse failures from the semantic parser may surface as parse-error in LSP output.

unknown-field behavior

unknown-field now supports two repair-oriented ergonomics:

  • CamelCase aliases can resolve to spaced field labels when the match is unique (for example input.monthlyAmount can resolve to monthly price).
  • When a field is still unknown, the repair hint can include Did you mean "..."? based on edit distance to known field labels.

If an alias is ambiguous, diagnostics keep code: "unknown-field" and narrow expected to ambiguous candidates so agents can pick a concrete field explicitly.

Repair workflow

1. point check-json <file> 2. Read ref and repair on each diagnostic 3. point explain <file> <ref> when context is unclear 4. point repair-plan <file> for ordered steps when multiple errors exist 5. Patch .point source and repeat

Agent note

Use point://semantic/... refs from public diagnostics. Do not edit generated TypeScript to clear semantic errors.

See also