Metric.unit is declared val unit: String (non-nullable) at lib/src/main/kotlin/dev/arcp/messages/Telemetry.kt:56, and ARCPRuntime.handleMetric at lib/src/main/kotlin/dev/arcp/runtime/ARCPRuntime.kt:304 passes it directly to Currency(metric.unit), which requires a non-blank value. The README quickstart at README.md:176 and README.md:225, however, dereferences the field as ${m.unit ?: ""}, which only makes sense if the field were nullable. A reader following the README either pastes code that compiles with a "Elvis operator on non-nullable receiver" warning or assumes runtime metrics can omit the unit — neither of which matches the wire schema. The guides under docs/guides/job-events.md use the same idiom in the streamed snippets.
Fix prompt: Drop the ?: "" and print ${m.unit} directly in all README and docs snippets. While editing, audit other code samples that dereference Metric fields and verify each matches the actual declared nullability. If the intent is to allow the unit to be omitted on the wire, change Telemetry.kt to val unit: String? = null and propagate the change through ARCPRuntime.handleMetric and BudgetAmount/Currency callers — but that is a larger schema change and should be its own issue.
Metric.unitis declaredval unit: String(non-nullable) atlib/src/main/kotlin/dev/arcp/messages/Telemetry.kt:56, andARCPRuntime.handleMetricatlib/src/main/kotlin/dev/arcp/runtime/ARCPRuntime.kt:304passes it directly toCurrency(metric.unit), whichrequires a non-blank value. The README quickstart atREADME.md:176andREADME.md:225, however, dereferences the field as${m.unit ?: ""}, which only makes sense if the field were nullable. A reader following the README either pastes code that compiles with a "Elvis operator on non-nullable receiver" warning or assumes runtime metrics can omit the unit — neither of which matches the wire schema. The guides underdocs/guides/job-events.mduse the same idiom in the streamed snippets.Fix prompt: Drop the
?: ""and print${m.unit}directly in all README and docs snippets. While editing, audit other code samples that dereferenceMetricfields and verify each matches the actual declared nullability. If the intent is to allow the unit to be omitted on the wire, changeTelemetry.kttoval unit: String? = nulland propagate the change throughARCPRuntime.handleMetricandBudgetAmount/Currencycallers — but that is a larger schema change and should be its own issue.