Notices when a task's model stops fitting it, and signals it
(PhoenixKitAI.GuardEvents.model_unfit/4: one event a day per task and
endpoint).
The process (started by PhoenixKitAI.children/0) keeps, for every
enabled task and every endpoint it uses now (Tasks.endpoints/1), the last
fitness that was known (:fit or :unfit; not knowing leaves the last
known one as it was). It looks again when the capability cache changes
({:capabilities_refreshed, _}: a catalogue refresh, a model alias that
moved) and when an endpoint is created, saved or deleted. A pair that was
:fit and is unfit now is signalled. A pair first seen unfit — at start,
or an endpoint a task has just begun to use — is not: it is shown on the
Tasks page, and a consumer's form refuses to save an unfit choice.
Each node runs its own; the event's dedupe key keeps the signal to one.
It also drops this node's cached task limits when a task's limits change
anywhere ({:task_limits_changed, task_key} on TaskLimits.topic/0), its
copy of the active blocks when a block is set or lifted anywhere
({:guard_blocks_changed, group}, same topic), and both whole when it starts.
After every look it emits [:phoenix_kit_ai, :guard_watch, :look]
(measurement pairs, metadata trigger: :first_look, :capabilities
or :endpoint), so whoever needs to know that a change has been looked at
can wait for it.
Summary
Functions
Returns a specification to start this module under a supervisor.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.