rustev-core 0.2.0

Rustev's pure core: validation, value kinds, exact operators, compiler, calibration binding and selection policy.
Documentation
1
{"inputs":[{"freshness":"not_required","name":"ticket.message","provenance":["user-supplied"],"type":{"text":{"max_bytes":4096}}},{"freshness":{"max_age_ms":86400000},"name":"account.tier","provenance":["authenticated-app-field"],"type":{"enum":{"options":["free","pro","enterprise"]}}},{"freshness":{"max_age_ms":300000},"name":"payments.events","provenance":["system-of-record"],"type":{"list":{"item":{"record":{"fields":[{"name":"id","type":{"text":{"max_bytes":64}}},{"name":"status","type":{"enum":{"options":["succeeded","failed","refunded"]}}},{"name":"at","type":"timestamp"}]}},"max_items":500}}}],"limits":{"deadline_ms":2000,"distribution_tolerance":"0.000001","max_projection_bytes":65536,"max_semantic_requests":3,"on_excess":"refuse"},"name":"support-routing","package":"rustev-reference","policy":{"adjustments":[{"id":"urgency","param":"priority","scale":["normal","high","urgent"],"when":{"any":[{"expectation_at_least":{"step":"frustration","value":"1.5"}},{"mass_at_least":{"option":"true","step":"explicit_deadline","threshold":"0.7","uncalibrated_threshold":{"declared":{"reason":"no calibration artifact exists for explicit_deadline; synthetic fixture"}}}}]}}],"on_unresolved":[{"action":{"escalate":{"reason":"ambiguous-topic"}},"reasons":"any","target":"step:topic"},{"action":"propagate","reasons":"any","target":"step:failed_payments_30d"},{"action":"propagate","reasons":"any","target":"step:hours_since_first_failure"},{"action":"propagate","reasons":"any","target":"input:account.tier"},{"action":"as_unmet","reasons":"any","target":"step:frustration"},{"action":"as_unmet","reasons":"any","target":"step:explicit_deadline"}],"rules":[{"id":"ambiguous","then":{"escalate":{"reason":"ambiguous-topic"}},"when":{"top_mass_below":{"step":"topic","threshold":"0.6","uncalibrated_threshold":"not_declared"}}},{"id":"billing_priority","then":{"propose":{"action":"route_ticket","params":[{"name":"queue","value":{"lit":{"enum":"billing-priority"}}},{"name":"priority","value":{"lit":{"enum":"normal"}}},{"name":"failed_payments_30d","value":{"ref":"step:failed_payments_30d"}},{"name":"hours_since_first_failure","value":{"ref":"step:hours_since_first_failure"}}]}},"when":{"all":[{"top_label":{"label":"billing","step":"topic"}},{"any":[{"exact":{"cmp":{"left":{"ref":"step:failed_payments_30d"},"op":"ge","right":{"lit":{"integer":2}}}}},{"exact":{"cmp":{"left":{"ref":"input:account.tier"},"op":"eq","right":{"lit":{"enum":"enterprise"}}}}}]}]}},{"id":"billing","then":{"propose":{"action":"route_ticket","params":[{"name":"queue","value":{"lit":{"enum":"billing"}}},{"name":"priority","value":{"lit":{"enum":"normal"}}},{"name":"failed_payments_30d","value":{"ref":"step:failed_payments_30d"}},{"name":"hours_since_first_failure","value":{"ref":"step:hours_since_first_failure"}}]}},"when":{"top_label":{"label":"billing","step":"topic"}}},{"id":"engineering","then":{"propose":{"action":"route_ticket","params":[{"name":"queue","value":{"lit":{"enum":"engineering"}}},{"name":"priority","value":{"lit":{"enum":"normal"}}},{"name":"failed_payments_30d","value":{"ref":"step:failed_payments_30d"}},{"name":"hours_since_first_failure","value":{"ref":"step:hours_since_first_failure"}}]}},"when":{"top_label":{"label":"integration_defect","step":"topic"}}},{"id":"identity","then":{"propose":{"action":"route_ticket","params":[{"name":"queue","value":{"lit":{"enum":"identity"}}},{"name":"priority","value":{"lit":{"enum":"normal"}}},{"name":"failed_payments_30d","value":{"ref":"step:failed_payments_30d"}},{"name":"hours_since_first_failure","value":{"ref":"step:hours_since_first_failure"}}]}},"when":{"top_label":{"label":"account_access","step":"topic"}}},{"id":"general","then":{"propose":{"action":"route_ticket","params":[{"name":"queue","value":{"lit":{"enum":"general"}}},{"name":"priority","value":{"lit":{"enum":"normal"}}},{"name":"failed_payments_30d","value":{"ref":"step:failed_payments_30d"}},{"name":"hours_since_first_failure","value":{"ref":"step:hours_since_first_failure"}}]}},"when":"always"}]},"schema":"rustev.definition/1","steps":[{"body":{"exact":{"args":{"field":"at","list":"input:payments.events","predicate":{"cmp":{"left":{"ref":"item:status"},"op":"eq","right":{"lit":{"enum":"failed"}}}},"within_ms":2592000000},"op":"window_filter","version":1}},"id":"failed_30d"},{"body":{"exact":{"args":{"list":"step:failed_30d","predicate":{"all":[]}},"op":"count_where","version":1}},"id":"failed_payments_30d"},{"body":{"exact":{"args":{"field":"at","list":"step:failed_30d","which":"min"},"op":"extremum","version":1}},"id":"first_failure"},{"body":{"exact":{"args":{"earlier":{"ref":"step:first_failure"},"later":{"ref":"now"},"unit_ms":3600000},"op":"timestamp_diff","version":1}},"id":"hours_since_first_failure"},{"body":{"semantic":{"backend":{"artifact":"any","binding":"auto","min_determinism":"unspecified"},"calibration":{"id":"sha256:62f878583a4ca84b6dbf61783a903b1142c632af6f558aeff22fa6b2c9a8b9e4"},"candidates":"none","fallback":"none","for_each":[],"operation":"classify","options":["billing","integration_defect","account_access","other"],"project":["input:ticket.message"],"question":"Which area does this support ticket concern?","requires":"calibrated_probability","task":"support.topic"}},"id":"topic"},{"body":{"semantic":{"backend":{"artifact":"any","binding":"auto","min_determinism":"unspecified"},"calibration":"none","candidates":"none","fallback":"none","for_each":[],"operation":"rubric","options":["calm","frustrated","very_angry"],"project":["input:ticket.message"],"question":"How frustrated is the customer?","requires":"ordinal_distribution","task":"support.frustration"}},"id":"frustration"},{"body":{"semantic":{"backend":{"artifact":"any","binding":"auto","min_determinism":"unspecified"},"calibration":"none","candidates":"none","fallback":"none","for_each":[],"operation":"proposition","options":["false","true"],"project":["input:ticket.message"],"question":"The customer states a time limit.","requires":"distribution","task":"support.deadline"}},"id":"explicit_deadline"}],"version":"1.0.0"}