Adaptation Feedback

Harmovela Adaptation Feedback Specification

> Status: draft. Part of the 0.5 Adaptation Preview.

Purpose

Define the feedback and outcome event family that correlates each completed outcome to its originating task, goal, delegation chain, authority, and declared and consumed cost. These events make the results of coordinated work first-class and observable so the system can reason about its own performance.

Adaptation feedback builds on the event contract and the coordination profile. It does not duplicate envelope, session, subscription, or task-lifecycle semantics.

Ownership

Governance owns the adaptation event family (adaptation.*). Feedback and budget events share the same family prefix and are subject to the authorization and audit boundaries defined in the governance contract and the adaptation profile.

Event Types

adaptation.outcome.correlated

Emitted when an outcome (a completed, failed, cancelled, or timed-out task) has been correlated to its upstream context. This event ties the result of work back to the goal, delegation chain, authority, and cost that produced it.

{
  "type": "adaptation.outcome.correlated",
  "id": "evt_adapt_corr_01",
  "source": "harness:adaptation",
  "created_at": "2026-07-14T10:30:00Z",
  "payload": {
    "task_id": "task_01",
    "task_outcome": "completed",
    "goal_id": "goal_ping_cycle_01",
    "goal_description": "Verify service connectivity every 60s",
    "delegation_chain": [
      { "agent_id": "agent:supervisor", "role": "delegator" },
      { "agent_id": "agent:pinger",    "role": "delegate" }
    ],
    "authority": {
      "issuer": "agent:supervisor",
      "capability": "delegation.own",
      "granted_at": "2026-07-14T10:00:00Z"
    },
    "cost": {
      "declared": {
        "max_cost_usd_millicents": 100000,
        "max_duration_ms": 300000,
        "max_actions": 50
      },
      "consumed": {
        "cost_usd_millicents": 12500,
        "duration_ms": 28000,
        "actions": 3
      }
    }
  }
}
FieldTypeRequiredDescription
payload.task_idstringyesThe correlated task identifier.
payload.task_outcomestringyesThe terminal task state: completed, failed, cancelled, or timed_out.
payload.goal_idstringnoThe originating goal identifier, if the task was dispatched toward a declared goal.
payload.goal_descriptionstringnoHuman-readable summary of the goal.
payload.delegation_chainarraynoOrdered list of {agent_id, role} entries representing the delegation path, with the original delegator first.
payload.authorityobjectnoThe authority under which the task was executed.
payload.authority.issuerstringyes if authority presentThe agent that granted the authority.
payload.authority.capabilitystringyes if authority presentThe capability granted (e.g., delegation.own).
payload.authority.granted_atstringyes if authority presentISO 8601 timestamp of the grant.
payload.cost.declaredobjectnoThe budget limits declared for the task. Mirrors the capabilities.budget fields.
payload.cost.consumedobjectnoThe actual resources consumed.
payload.cost.consumed.cost_usd_millicentsnumbernoActual cost in thousandths of a cent.
payload.cost.consumed.duration_msnumbernoActual wall-clock time spent.
payload.cost.consumed.actionsnumbernoActual discrete actions performed.

adaptation.goal.achieved

Emitted when a goal is evaluated and found to be achieved. A goal is achieved when all tasks dispatched toward it have reached a satisfactory terminal state.

{
  "type": "adaptation.goal.achieved",
  "id": "evt_goal_ach_01",
  "source": "harness:adaptation",
  "created_at": "2026-07-14T14:00:00Z",
  "correlation_id": "goal_ping_cycle_01",
  "payload": {
    "goal_id": "goal_ping_cycle_01",
    "goal_description": "Verify service connectivity every 60s",
    "achievement_criteria": "all_tasks_completed",
    "completed_task_count": 5,
    "failed_task_count": 0,
    "task_ids": ["task_01", "task_02", "task_03", "task_04", "task_05"],
    "evaluated_at": "2026-07-14T14:00:00Z",
    "evaluator": "agent:supervisor"
  }
}
FieldTypeRequiredDescription
payload.goal_idstringyesThe achieved goal identifier.
payload.goal_descriptionstringnoHuman-readable summary of the goal.
payload.achievement_criteriastringyesHow achievement was determined: all_tasks_completed, threshold_met, or a custom criterion key.
payload.completed_task_countnumberyesNumber of tasks that reached a successful terminal state.
payload.failed_task_countnumberyesNumber of tasks that reached a failure terminal state.
payload.task_idsstring[]yesIdentifiers of all tasks dispatched toward this goal.
payload.evaluated_atstringyesISO 8601 timestamp of the evaluation.
payload.evaluatorstringyesIdentity of the evaluating agent.

adaptation.goal.blocked

Emitted when a goal cannot progress because a required precondition is not met, a dependency is unavailable, or a budget/authorization constraint prevents further work.

{
  "type": "adaptation.goal.blocked",
  "id": "evt_goal_blk_01",
  "source": "harness:adaptation",
  "created_at": "2026-07-14T11:00:00Z",
  "correlation_id": "goal_backup_cycle_01",
  "payload": {
    "goal_id": "goal_backup_cycle_01",
    "goal_description": "Perform nightly backup to remote storage",
    "block_reason": "dependency_unavailable",
    "block_detail": "Remote storage endpoint unreachable after 3 retries",
    "blocked_task_ids": ["task_backup_01"],
    "resolution_hint": "retry_after",
    "retry_after_ms": 3600000,
    "blocked_at": "2026-07-14T11:00:00Z"
  }
}
FieldTypeRequiredDescription
payload.goal_idstringyesThe blocked goal identifier.
payload.goal_descriptionstringnoHuman-readable summary of the goal.
payload.block_reasonstringyesReason for blocking: dependency_unavailable, budget_exhausted, authorization_denied, precondition_unmet, or a custom reason key.
payload.block_detailstringnoHuman-readable description of the block.
payload.blocked_task_idsstring[]noIdentifiers of tasks that cannot proceed.
payload.resolution_hintstringnoSuggested resolution: retry_after, escalate, reauthorize, increase_budget.
payload.retry_after_msnumbernoSuggested wait time before retry, in milliseconds.
payload.blocked_atstringyesISO 8601 timestamp when the block was detected.

adaptation.cost.exceeded

Emitted when the consumed cost for a task or goal exceeds the declared budget. This is the L3 enforced equivalent of the L1 advisory task.failed with budget_exceeded.

{
  "type": "adaptation.cost.exceeded",
  "id": "evt_cost_exc_01",
  "source": "harness:adaptation",
  "created_at": "2026-07-14T10:32:00Z",
  "correlation_id": "task_01",
  "causation_id": "task_01",
  "payload": {
    "task_id": "task_01",
    "goal_id": "goal_ping_cycle_01",
    "exceeded_dimension": "max_actions",
    "declared": 50,
    "consumed": 54,
    "enforced": true,
    "enforcement_action": "task_failed",
    "exceeded_at": "2026-07-14T10:32:00Z"
  }
}
FieldTypeRequiredDescription
payload.task_idstringyesThe task that exceeded its cost budget.
payload.goal_idstringnoThe goal the task belongs to, if any.
payload.exceeded_dimensionstringyesThe budget dimension exceeded: max_cost_usd_millicents, max_duration_ms, or max_actions.
payload.declarednumberyesThe declared limit.
payload.consumednumberyesThe actual consumption at the point of exceedance.
payload.enforcedbooleanyesWhether the runtime enforced the limit (true at L3).
payload.enforcement_actionstringyesWhat action the runtime took: task_failed, task_cancelled, task_escalated, session_quarantined.
payload.exceeded_atstringyesISO 8601 timestamp of exceedance.

Correlation Model

All adaptation feedback events carry correlation metadata through the standard envelope:

Envelope fieldUsage
correlation_idLinks feedback events to the originating goal or batch.
causation_idLinks feedback events to the specific task or budget event that triggered them.
sourceSet to harness:adaptation when emitted by the protocol runtime; set to the evaluating agent when emitted by an external evaluator.

The correlation chain is: goal → dispatched tasks → outcomes → correlated feedback. Each adaptation.outcome.correlated event closes the loop by linking the outcome back to the goal. The consumer can then evaluate goal achievement through the adaptation.goal.achieved or adaptation.goal.blocked signals.

Authorization and Audit

Adaptation feedback events are subject to the security profile authorization boundary. Consumers may only receive feedback events for tasks and goals within their authorized scope. Audit linkage for adaptation feedback events follows the same pattern as all other governance-audited events: actor identity, timestamp, affected resource, and granted authority.

Fee​dback events do not carry application payloads; they carry only the correlation and cost metadata defined above. Payload redaction does not apply.

Dependencies