Skip to main content
Developer docs
core/catalog

Action enum

The full move set the decision engine can emit — each tied to a trigger, valid from-states, and a pre-stored reversal op.

Actions are the verbs an agent can emit. Each one is bound to a trigger that can fire it, the set of from-states it's valid in, and the reversal op written alongside it. There is no free-form action — if it isn't in the enum, the agent can't do it.

The move set

  • KEEP — no-op with a logged rationale (the agent considered and declined).
  • SCALE_WINNER / OPTIMIZE_LOSER — adjust merchandising weight up or down.
  • DISCOUNT_TEST / PRICE_DROP — price moves; Tier A only.
  • DRAFT / REVIVE_SEASONAL — create or re-list.
  • VAULT / FLAG_ORPHAN — archive, or flag a SKU with no cost data.

Each action is fully specified

action definitionpython
Action(
    name="OPTIMIZE_LOSER",
    trigger="roas_below_floor_14d",
    valid_from={"active", "promoted", "watch"},
    min_tier="B",
    reverse_op=lambda sku: f"RESTORE_RANK {sku}",
)

Because the reversal op is part of the definition, every emitted action is reversible by construction — the undo is written when the do is written, never derived after the fact.

// developer docs

Magistry runs your store. We run Magistry.

The SDK is the same one our worker uses in production. Same auth, same rate limits, same audit plane — no shadow surface.

Stable for a year · Versioned changelogs · No silent breaking changes