polaris_fitness_functions
Manage fitness functions by creating, versioning, validating, activating, and retiring definitions with immutable draft-then-activate history.
Instructions
Manage fitness functions: versioned definitions of intent, scope, criteria, acquisition, freshness, and enforcement. Definitions evolve as immutable draft-then-activate versions.
Actions and required parameters:
list: squad_id — the squad's functions with full version history (limit/cursor/all_pages)
get: fitness_function_id — aggregate with lifecycle (DRAFT|ACTIVE|RETIRED), revision, and complete version history
create: squad_id + definition — creates the function with draft version 1
add_version: fitness_function_id + definition — appends a new draft version (guarded by If-Match: pass the aggregate
revisionexplicitly, or omit it to use the current one)update_draft_version: fitness_function_id + version + definition — replaces a still-DRAFT version (If-Match as above; activated versions are immutable)
validate_version: fitness_function_id + version — re-runs validation without side effects
activate_version: fitness_function_id + version (optional reason) — makes it the active definition; evaluations then use it
retire: fitness_function_id (optional reason) — terminal; history stays queryable
definition is a JSON object with camelCase keys (Polaris FitnessDefinition):
required: name; purpose; objective; targetIds (array of the squad's fitness-target ids);
criteria (array of {key (pattern ^[a-z][a-z0-9_]{0,62}$, unit, warningComparison?,
warningValue?, failureComparison (GREATER_THAN|GREATER_THAN_OR_EQUAL|LESS_THAN|LESS_THAN_OR_EQUAL|
EQUAL|NOT_EQUAL), failureValue, required?});
acquisition ({mode: "PUSH", producerId, maximumObservationAgeSeconds} or {mode: "PULL",
sourceId, trigger: SCHEDULED|ON_DEMAND, intervalSeconds? (>=60, SCHEDULED only),
timeoutSeconds (1-30), queries: array of {criterionKey, expression (PromQL), mode:
INSTANT|RANGE, lookbackSeconds?, stepSeconds?, reduction (LAST|MIN|MAX|AVERAGE|SUM|COUNT),
seriesPolicy (REQUIRE_SINGLE_SERIES|REDUCE_ACROSS_SERIES|ERROR_ON_MULTIPLE_SERIES), unit}
covering every criterion key});
freshnessSeconds (how long an evaluation stays fresh); enforcement (OBSERVE|WARN|BLOCK);
optional: characteristic (e.g. RELIABILITY), changeRationale.
Warning thresholds must be milder than failure thresholds when both are declared.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| action | Yes | ||
| cursor | No | ||
| reason | No | ||
| version | No | ||
| revision | No | ||
| squad_id | No | ||
| all_pages | No | ||
| definition | No | ||
| fitness_function_id | No |