Role Context Query Source-Authority Handoff
The promoted runtime contract signal is now queryable by title.
A local caller can ask for a role title and get a conservative route action: serve, fallback, fallback_with_caveat, abstain, confirm_more_context, or not_found.
A read-only query surface sits on top of runtime contracts.
The new module role_context_query.py reads production_runtime_contracts_v1.jsonl, joins role-resolution decisions to role-context evidence and runtime payload contracts, and returns a local routing decision. The CLI command is role-context-query --title.
role_resolution_decision_v1 rows.This fixes the title-only overconfidence path.
In the live contract rows, case manager and web designer both had generic deterministic decisions and repair-aware decisions. A naive selector picked the higher-confidence deterministic row and over-served. The new query surface ranks repair-aware decisions first, so ambiguity and source conflicts actually affect runtime behavior.
The routing logic is explicit.
| Source-authority status | Route |
|---|---|
deterministic_payload | serve |
runtime_payload_source_backstop | serve |
jd_context_authoritative_backstop | serve |
runtime_payload_backstop_with_source_conflicts | fallback_with_caveat |
source_authority_incomplete | fallback |
jd_context_confirmation_blocked | confirm_more_context unless the decision abstains |
decision status abstain | abstain |
The live examples cover serve, abstain, and fallback.
| Title | Route | Status | JD status |
|---|---|---|---|
seasonal sales associate | serve | deterministic_payload | source_ref_keys_available |
data analyst-ny | serve | jd_context_authoritative_backstop | fixture_ready_authoritative |
case manager | abstain | jd_context_confirmation_blocked | confirmation_or_ambiguity_blocked |
web designer | fallback_with_caveat | runtime_payload_backstop_with_source_conflicts | confirmation_or_ambiguity_blocked |
case manager result is the meaningful one: it now abstains even when a higher-confidence generic deterministic row exists for the same title.The focused checks pass.
| Check | Result |
|---|---|
| Role context query tests | 3 passed |
| Combined focused tests | 11 passed |
| Ruff | All checks passed |
| Live query smoke | serve / serve / abstain / fallback_with_caveat |
Build the 25-50 real-row runtime fixture set.
Use this query surface to assemble a fixture set across ambiguous, frontline, regulated, healthcare, HR, legal, general business, and generic-neighbor cases. That becomes the bridge from source-authority contracts to AI Fluency loop fixtures.
Run role-context-query on the top-band JD-aware rows and keep the abstain/fallback cases as first-class training signals.