Skip to content

Commit 0db3ad8

Browse files
committed
fix: resolve 10 dialyzer warnings in new modules
- Policy: suppress MapSet opaque type warnings with @dialyzer [:no_opaque] - Tool.Behaviour: widen metadata/0 callback type to map() for extra keys - Transcript: remove redundant nil fallback on extract_text/1 return
1 parent 3d46108 commit 0db3ad8

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

lib/nous/permissions.ex

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
defmodule Nous.Permissions do
2+
# MapSet is opaque — suppress contract_with_opaque for functions returning Policy structs
3+
@dialyzer [:no_opaque]
4+
25
@moduledoc """
36
Tool-level permission policy engine.
47

lib/nous/permissions/policy.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ defmodule Nous.Permissions.Policy do
3030
@type mode :: :default | :permissive | :strict
3131

3232
@type t :: %__MODULE__{
33-
deny_names: MapSet.t(String.t()),
33+
deny_names: MapSet.t(),
3434
deny_prefixes: [String.t()],
35-
approval_required: MapSet.t(String.t()),
35+
approval_required: MapSet.t(),
3636
mode: mode()
3737
}
3838
end

lib/nous/tool/behaviour.ex

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,7 @@ defmodule Nous.Tool.Behaviour do
108108
}
109109
110110
"""
111-
@callback metadata() :: %{
112-
name: String.t(),
113-
description: String.t(),
114-
parameters: map()
115-
}
111+
@callback metadata() :: map()
116112

117113
@doc """
118114
Return the tool's schema definition for introspection.

lib/nous/transcript.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ defmodule Nous.Transcript do
299299
messages
300300
|> Enum.map(fn msg ->
301301
role = msg.role || :unknown
302-
text = Message.extract_text(msg) || ""
302+
text = Message.extract_text(msg)
303303
preview = text |> String.slice(0..100) |> String.replace("\n", " ")
304304
" [#{role}] #{preview}"
305305
end)

0 commit comments

Comments
 (0)