The Executor Pattern
An executor is a stateless component that calls one target system and records the outcome. It does not reason, does not re-interpret the action, and applies no policy beyond its retry configuration.
Two structural rules are test-enforced:
-
Executor classes are not importable from agent modules. A Tier 2 agent writes Findings; it does not dispatch Actions.
-
No agent code calls a channel API directly. SNS
Publishcalls for AVX Findings go through the broker only.
Eight executor targets
| Target | Description | Trigger | Failure model |
|---|---|---|---|
|
|
Creates a repair order in the dealer management system: an owner’s service visit, a fleet recall remedy (with the recall line), or a fleet service visit (with one line per need). Files a fleet warranty claim through DMS’s fleet claims route, where DMS validates the claim and computes the amount. The body carries |
Owner approves a service Finding; fleet operator approves a recall booking, a fleet service booking or a warranty claim |
Refusal 4xx ( |
|
|
Calls the CMS remote commands API. Used when an agent recommendation warrants an immediate vehicle action. |
Agent recommends a remote command |
Same 4xx/5xx model as |
|
|
Calls the Acquire |
Owner approves a concierge or coverage Finding |
Same failure model. |
|
|
Advisory only. No external call. Records the Action for audit and surfaces it on the owner’s ledger. |
Informational Finding requiring acknowledgement |
Cannot fail; transitions directly to |
|
|
Writes a pre-seed marker that the Tier 1 supervisor reads at session initialisation. The drill-down conversation starts with the Finding’s evidence already in context. |
Owner taps "Drill down" |
If the marker write fails, the conversation opens unseeded rather than blocking. |
|
|
Writes an inbox row on the owner’s Action feed. Used for reverse-direction proposals from dealers and for |
Dealer proposes action to owner; or |
If the inbox write fails, the operator event still fires. |
|
|
Applies fleet changes to CMS’s own records through CMS’s Fleet Intelligence API: records an approved cost action on the vehicle, grounds a vehicle for a recall or a stop-driving fault, and moves vehicles between locations. CMS re-checks the fleet, groundings, the origin location and parking before a move. |
Fleet operator approves a fleet recommendation, or a fleet rule auto-approves a move |
Same failure model as |
|
|
Invokes ADP’s |
Product engineer approves an investigation option or a campaign issue |
|
Failure model
Retry policy and escalation targets are per-target SSM configuration, not code constants. The keys /vsa/{stage}/avx/executor/{target}/retry-policy and /vsa/{stage}/avx/executor/{target}/escalation are read at Lambda cold start.
classify_status() in agents/executors/base.py is the single source of truth for which HTTP status codes are transient, which are client errors, and which are refusals:
-
Transient (retry): 5xx, connection errors, timeouts,
408,425,429. -
Client error (terminal,
failed):401,403,404,405,415. The request was malformed or the credentials were wrong; nothing reached the target. Reporting these asdeclinedwould tell the owner "the dealer refused" when in fact our token had expired. -
Refusal (terminal,
declined): any other 4xx such as400or409. The target received the request and chose to say no.
On failed, dual escalation fires:
-
Owner-visible — an
ios-ownerinbox card is written, routed through the broker. Headline pattern: "We couldn’t reach {target} to {action_kind_verb}. You can retry with a different {target} or contact us." Category:service. Consent is still enforced. -
Operator-visible — an
vsa.avx.action.terminal_failureEventBridge event (sourcevsa.avx.executor) is emitted, plus aAVXActionTerminalFailureCloudWatch metric dimensioned bytarget_system. The operator alarm SNS topic must have an active subscriber; an alarm that fires into an empty topic does not page anyone.