Skip to content

Commit f4eb178

Browse files
hyperpolymathclaude
andcommitted
fix: Elixir client type specs mixing keyword and optional() syntax
Elixir doesn't allow mixing keyword-style required keys (field: type) with optional() keys in the same map type. Use required(:field) => syntax consistently when optional() keys are present. Found via Burble dogfooding integration (first real consumer). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d6f6754 commit f4eb178

File tree

1 file changed

+21
-21
lines changed
  • verisimdb/connectors/clients/elixir/lib/verisim_client

1 file changed

+21
-21
lines changed

verisimdb/connectors/clients/elixir/lib/verisim_client/types.ex

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -130,23 +130,23 @@ defmodule VeriSimClient.Types do
130130

131131
@typedoc "A single directed edge in the graph modality."
132132
@type graph_edge :: %{
133-
source: String.t(),
134-
target: String.t(),
135-
label: String.t(),
133+
required(:source) => String.t(),
134+
required(:target) => String.t(),
135+
required(:label) => String.t(),
136136
optional(:properties) => map()
137137
}
138138

139139
@typedoc "Vector modality input: dense embeddings for similarity search."
140140
@type octad_vector_input :: %{
141-
embedding: [float()],
141+
required(:embedding) => [float()],
142142
optional(:dimensions) => non_neg_integer(),
143143
optional(:model) => String.t()
144144
}
145145

146146
@typedoc "Tensor modality input: multi-dimensional numeric data."
147147
@type octad_tensor_input :: %{
148-
data: [float()],
149-
shape: [non_neg_integer()],
148+
required(:data) => [float()],
149+
required(:shape) => [non_neg_integer()],
150150
optional(:dtype) => String.t()
151151
}
152152

@@ -166,15 +166,15 @@ defmodule VeriSimClient.Types do
166166

167167
@typedoc "Document modality input: unstructured / semi-structured content."
168168
@type octad_document_input :: %{
169-
content: String.t(),
169+
required(:content) => String.t(),
170170
optional(:content_type) => String.t(),
171171
optional(:language) => String.t(),
172172
optional(:metadata) => map()
173173
}
174174

175175
@typedoc "Temporal modality input: time-series events and temporal metadata."
176176
@type octad_temporal_input :: %{
177-
timestamp: String.t(),
177+
required(:timestamp) => String.t(),
178178
optional(:duration_ms) => non_neg_integer(),
179179
optional(:recurrence) => String.t(),
180180
optional(:timezone) => String.t(),
@@ -183,8 +183,8 @@ defmodule VeriSimClient.Types do
183183

184184
@typedoc "Provenance modality input: lineage and audit trail events."
185185
@type octad_provenance_input :: %{
186-
event_type: String.t(),
187-
agent: String.t(),
186+
required(:event_type) => String.t(),
187+
required(:agent) => String.t(),
188188
optional(:description) => String.t(),
189189
optional(:source_ids) => [String.t()],
190190
optional(:metadata) => map()
@@ -223,9 +223,9 @@ defmodule VeriSimClient.Types do
223223
"""
224224
@type provenance_event :: %{
225225
optional(:id) => String.t(),
226-
entity_id: String.t(),
227-
event_type: String.t(),
228-
agent: String.t(),
226+
required(:entity_id) => String.t(),
227+
required(:event_type) => String.t(),
228+
required(:agent) => String.t(),
229229
optional(:description) => String.t(),
230230
optional(:timestamp) => String.t(),
231231
optional(:source_ids) => [String.t()],
@@ -240,8 +240,8 @@ defmodule VeriSimClient.Types do
240240
A single result from a federated cross-instance query.
241241
"""
242242
@type federation_result :: %{
243-
store_id: String.t(),
244-
entity: octad(),
243+
required(:store_id) => String.t(),
244+
required(:entity) => octad(),
245245
optional(:score) => float(),
246246
optional(:latency_ms) => non_neg_integer()
247247
}
@@ -254,10 +254,10 @@ defmodule VeriSimClient.Types do
254254
Response from a VQL query execution or explain request.
255255
"""
256256
@type vql_response :: %{
257-
success: boolean(),
258-
statement_type: String.t(),
259-
row_count: non_neg_integer(),
260-
data: term(),
257+
required(:success) => boolean(),
258+
required(:statement_type) => String.t(),
259+
required(:row_count) => non_neg_integer(),
260+
required(:data) => term(),
261261
optional(:message) => String.t()
262262
}
263263

@@ -269,8 +269,8 @@ defmodule VeriSimClient.Types do
269269
Standard error response body from the VeriSimDB REST API.
270270
"""
271271
@type error_response :: %{
272-
error: String.t(),
273-
message: String.t(),
272+
required(:error) => String.t(),
273+
required(:message) => String.t(),
274274
optional(:details) => term()
275275
}
276276

0 commit comments

Comments
 (0)