Skip to content

portage-ucp-decision

The System One decision layer — offer ranking, escalation policy, a confidence gate (Jev/Laya), and a typed PolicyGuard wrapper. Used by shop-via-ucp when it's available, in preference to raw MCP calls.

portage-ucp-decision

The System One decision layer for portage-ucp — see docs/plans/system-one-decision-layer.md for why this exists.

Sits between the agent loop and the Adapter/client layer, turning judgment calls that were scattered across skill instructions, portage-cli, and portage-ucp into typed, inspectable decisions:

  • Portage::Ucp::Decision::OfferRanking — which offer to pick among several. A typed wrapper around Portage::Ucp::Support::OfferRanking.
  • Portage::Ucp::Decision::EscalationPolicy — hand off vs. keep going. A typed wrapper around Portage::Ucp::Support::Escalation.
  • Portage::Ucp::Decision::ConfidenceGate — proceed unattended above a threshold.
  • Portage::Ucp::Decision::PolicyCheck — a typed wrapper around Portage::Ucp::PolicyGuard.check!.

The ranking, escalation and policy rules live in portage-ucp core, and these three wrap them as Verdicts. portage-cli calls the core modules directly, so it answers the same way with or without this gem. Only ConfidenceGate and its model backends are unique to this gem.

ModelBackends::Laya needs a Python bridge script (it's HuggingFace weights, not a hosted API) — see examples/laya_bridge.py and set LAYA_BRIDGE_SCRIPT; a missing or broken bridge raises BackendNotConfiguredError/BackendError with a message naming the exact problem (unset, path doesn't exist, LAYA_PYTHON not executable, non-zero exit, timeout, unreadable reply). The bridge must answer with the same {"answers": {name => answer}} body Jev returns, each answer keyed by its type: {"type": "noul", "noul": <P(yes)>}, `{"type": "choice", "choice":