PKE
Trace de abstração
Frase → JSON da LLM → claims → primitivos. Até onde o James desceu nesta fala.
PKE · 20260926215844_485f76685f53d69af3238e36eb2fbd9d.log
=== 2026-09-27T00:58:44.190785Z stage=srl_trace ===
client_request_id: 485f76685f53d69af3238e36eb2fbd9d
pke_request_id: req_01M3G5Y6JNEQ7HGMZ87718VV1C
conversation_id: conv_01M3G5M3PZ6XQCFZQRE2Q9MAXP
trace_id: 485f76685f53d69af3238e36eb2fbd9d
---
{
"trace_id": "485f76685f53d69af3238e36eb2fbd9d",
"client_request_id": "485f76685f53d69af3238e36eb2fbd9d",
"pke_request_id": "req_01M3G5Y6JNEQ7HGMZ87718VV1C",
"guardrails": {
"max_depth": 8,
"max_llm_rounds": 6,
"max_nodes": 64,
"max_children_per_node": 8,
"max_same_concept_visits": 2,
"confidence_threshold": 0.5,
"cycle_detection": true
},
"loop": false
}
=== 2026-09-27T00:58:44.200365Z stage=discourse_input ===
client_request_id: 485f76685f53d69af3238e36eb2fbd9d
pke_request_id: req_01M3G5Y6JNEQ7HGMZ87718VV1C
conversation_id: conv_01M3G5M3PZ6XQCFZQRE2Q9MAXP
trace_id: 485f76685f53d69af3238e36eb2fbd9d
---
{
"conversation_id": "conv_01M3G5M3PZ6XQCFZQRE2Q9MAXP",
"active_focus": {
"primitive": "ingest",
"relation_type": null,
"target_type": "entity.person",
"entity_ids": [
"01M3G5QKX1TM61HH21HK4AJHT2"
],
"display_name": "lucas"
},
"recent_referents": [
{
"entity_id": "01M3G5QKX1TM61HH21HK4AJHT2",
"type_key": "entity.person",
"display_name": "lucas",
"role": "active_focus",
"salience": 1.0
}
],
"allowed_entity_ids": [
"01M3G5QKX1TM61HH21HK4AJHT2"
],
"pending_intent": null
}
=== 2026-09-27T00:58:45.657708Z stage=llm_response ===
client_request_id: 485f76685f53d69af3238e36eb2fbd9d
pke_request_id: req_01M3G5Y6JNEQ7HGMZ87718VV1C
interpreter_request_id: aefa3ab7-bb21-4dcd-be5c-2ce9458eca9e
conversation_id: conv_01M3G5M3PZ6XQCFZQRE2Q9MAXP
user_text: o que eu comprei hoje?
provider_request_id: 668a74a9-b4fc-4a0e-8e89-ac9456cd178b
attempt: 1
model: deepseek-flash
latency_ms: 1437
prompt_tokens: 5740
completion_tokens: 124
total_tokens: 5864
raw_available: 1
---
{
"ir_kind": "semantic_query",
"ir": {
"raw_input": "o que eu comprei hoje?",
"utterance_kind": "query",
"primitive_hint": "event",
"subject": {
"text": "self",
"kind_hint": "person",
"reference_kind": "contextual"
},
"action_expression": "comprei",
"event_expression": "comprei",
"change_semantics": true,
"entities_mentioned": [],
"temporal": {
"original_text": "hoje",
"occurrence_aspect": "happened",
"relative_day": 0
},
"discourse_decision": "new_topic",
"confidence": 0.9
}
}
=== 2026-09-27T00:58:45.667708Z stage=normalize ===
client_request_id: 485f76685f53d69af3238e36eb2fbd9d
pke_request_id: req_01M3G5Y6JNEQ7HGMZ87718VV1C
interpreter_request_id: aefa3ab7-bb21-4dcd-be5c-2ce9458eca9e
conversation_id: conv_01M3G5M3PZ6XQCFZQRE2Q9MAXP
user_text: o que eu comprei hoje?
route: semantic_v3
notes: []
---
{
"ir_kind": "semantic_query",
"ir": {
"raw_input": "o que eu comprei hoje?",
"utterance_kind": "query",
"primitive_hint": "event",
"subject": {
"text": "self",
"kind_hint": "person",
"reference_kind": "contextual"
},
"action_expression": "comprei",
"event_expression": "comprei",
"change_semantics": true,
"entities_mentioned": [],
"temporal": {
"original_text": "hoje",
"occurrence_aspect": "happened"
},
"discourse_decision": "new_topic",
"confidence": 0.9
}
}
=== 2026-09-27T00:58:45.676931Z stage=proposal ===
client_request_id: 485f76685f53d69af3238e36eb2fbd9d
pke_request_id: req_01M3G5Y6JNEQ7HGMZ87718VV1C
interpreter_request_id: aefa3ab7-bb21-4dcd-be5c-2ce9458eca9e
conversation_id: conv_01M3G5M3PZ6XQCFZQRE2Q9MAXP
user_text: o que eu comprei hoje?
ir_kind: semantic_query
---
{
"raw_input": "o que eu comprei hoje?",
"utterance_kind": "query",
"primitive_hint": "event",
"subject": {
"text": "self",
"kind_hint": "person",
"reference_kind": "contextual",
"confidence": 1.0
},
"participants": [],
"entities_mentioned": [],
"action_expression": "comprei",
"event_expression": "comprei",
"temporal": {
"original_text": "hoje",
"occurrence_aspect": "happened"
},
"negation": false,
"change_semantics": true,
"condition_semantics": false,
"link_semantics": false,
"stable_property_semantics": false,
"classification_semantics": false,
"measurement_semantics": false,
"domain_hints": [],
"confidence": 0.9,
"assertion_confidence": {},
"claims": [],
"correction_semantics": false,
"discourse_decision": "new_topic"
}
=== 2026-09-27T00:58:45.687179Z stage=repair ===
client_request_id: 485f76685f53d69af3238e36eb2fbd9d
pke_request_id: req_01M3G5Y6JNEQ7HGMZ87718VV1C
interpreter_request_id: aefa3ab7-bb21-4dcd-be5c-2ce9458eca9e
conversation_id: conv_01M3G5M3PZ6XQCFZQRE2Q9MAXP
user_text: o que eu comprei hoje?
utterance_kind: query
primitive_hint: event
---
{
"raw_input": "o que eu comprei hoje?",
"utterance_kind": "query",
"primitive_hint": "event",
"subject": {
"text": "self",
"kind_hint": "person",
"reference_kind": "contextual",
"confidence": 1.0
},
"participants": [],
"entities_mentioned": [],
"action_expression": "comprei",
"event_expression": "comprei",
"temporal": {
"original_text": "hoje",
"occurrence_aspect": "happened"
},
"negation": false,
"change_semantics": true,
"condition_semantics": false,
"link_semantics": false,
"stable_property_semantics": false,
"classification_semantics": false,
"measurement_semantics": false,
"domain_hints": [],
"confidence": 0.9,
"assertion_confidence": {},
"claims": [],
"correction_semantics": false,
"discourse_decision": "new_topic"
}
=== 2026-09-27T00:58:45.696788Z stage=assessment ===
client_request_id: 485f76685f53d69af3238e36eb2fbd9d
pke_request_id: req_01M3G5Y6JNEQ7HGMZ87718VV1C
interpreter_request_id: aefa3ab7-bb21-4dcd-be5c-2ce9458eca9e
conversation_id: conv_01M3G5M3PZ6XQCFZQRE2Q9MAXP
user_text: o que eu comprei hoje?
---
{
"status": "actionable",
"routed_primitive": "event",
"decision_source": "legacy_fallback",
"evidence": [],
"ignored_fallbacks": [],
"missing_semantic_roles": [],
"conflicting_signals": [],
"notes": [
"query utterance — primitive resolved downstream"
]
}
=== 2026-09-27T00:58:45.707009Z stage=query_resolution ===
client_request_id: 485f76685f53d69af3238e36eb2fbd9d
pke_request_id: req_01M3G5Y6JNEQ7HGMZ87718VV1C
interpreter_request_id: aefa3ab7-bb21-4dcd-be5c-2ce9458eca9e
conversation_id: conv_01M3G5M3PZ6XQCFZQRE2Q9MAXP
user_text: o que eu comprei hoje?
---
{
"status": "resolved",
"primitive": "event",
"notes": [
"no alias match"
]
}
=== 2026-09-27T00:58:45.718038Z stage=canonical ===
client_request_id: 485f76685f53d69af3238e36eb2fbd9d
pke_request_id: req_01M3G5Y6JNEQ7HGMZ87718VV1C
interpreter_request_id: aefa3ab7-bb21-4dcd-be5c-2ce9458eca9e
conversation_id: conv_01M3G5M3PZ6XQCFZQRE2Q9MAXP
user_text: o que eu comprei hoje?
ir_type: QueryIR
wire_stage: canonical
execution_reasons: []
primitive: event
concepts_status: unresolved
concepts_notes: ["no alias match"]
---
{
"intent": "query",
"raw_input": "o que eu comprei hoje?",
"query": {
"intent": "list",
"entities": [
{
"text": "self",
"type_hint": {
"key": "entity.person"
},
"role": {
"key": "role.subject"
},
"suggested_aliases": [],
"confidence": 1.0,
"reference_kind": "contextual",
"kind_hint": "person"
}
],
"entity_association": "subject",
"event_types": [],
"state_dimensions": [],
"state_values": [],
"relation_types": [],
"relation_scope": "current",
"actions": [],
"facts": [],
"domains": [],
"aggregate": "none",
"hierarchy": "exact",
"version_policy": "current",
"time": {
"original_text": "hoje"
},
"sort": "event_time_desc"
},
"discourse_decision": "new_topic"
}
=== 2026-09-27T00:58:45.728306Z stage=conversation_decision ===
client_request_id: 485f76685f53d69af3238e36eb2fbd9d
pke_request_id: req_01M3G5Y6JNEQ7HGMZ87718VV1C
interpreter_request_id: aefa3ab7-bb21-4dcd-be5c-2ce9458eca9e
conversation_id: conv_01M3G5M3PZ6XQCFZQRE2Q9MAXP
trace_id: 485f76685f53d69af3238e36eb2fbd9d
---
{
"decision": "DELEGATE",
"source": "SRL",
"delegated": true
}
=== 2026-09-27T00:58:45.737459Z stage=discourse_resolution ===
client_request_id: 485f76685f53d69af3238e36eb2fbd9d
pke_request_id: req_01M3G5Y6JNEQ7HGMZ87718VV1C
interpreter_request_id: aefa3ab7-bb21-4dcd-be5c-2ce9458eca9e
conversation_id: conv_01M3G5M3PZ6XQCFZQRE2Q9MAXP
trace_id: 485f76685f53d69af3238e36eb2fbd9d
---
{
"decision": "new_topic",
"source": "current_utterance",
"resolved_entity_ids": []
}
=== 2026-09-27T00:58:45.771805Z stage=entity_resolution ===
client_request_id: 485f76685f53d69af3238e36eb2fbd9d
pke_request_id: req_01M3G5Y6JNEQ7HGMZ87718VV1C
interpreter_request_id: aefa3ab7-bb21-4dcd-be5c-2ce9458eca9e
conversation_id: conv_01M3G5M3PZ6XQCFZQRE2Q9MAXP
trace_id: 485f76685f53d69af3238e36eb2fbd9d
---
{
"resolutions": [
{
"reference": {
"text": "self",
"reference_kind": "contextual",
"type_hint": "entity.person"
},
"strategy": "principal_self",
"outcome": "resolved",
"candidate_count": 1,
"candidates": [
{
"entity_id": "01M2AZ0YGCFRZ6VKPSCCMVTBN8",
"canonical_name": "__principal__",
"type": "entity.person",
"match": "principal"
}
],
"resolved_entity_ids": [
"01M2AZ0YGCFRZ6VKPSCCMVTBN8"
],
"notes": [
"d2a:KNOWN_INSTANCE"
]
}
],
"count": 1
}
=== 2026-09-27T00:58:45.782001Z stage=discourse_update ===
client_request_id: 485f76685f53d69af3238e36eb2fbd9d
pke_request_id: req_01M3G5Y6JNEQ7HGMZ87718VV1C
interpreter_request_id: aefa3ab7-bb21-4dcd-be5c-2ce9458eca9e
conversation_id: conv_01M3G5M3PZ6XQCFZQRE2Q9MAXP
trace_id: 485f76685f53d69af3238e36eb2fbd9d
---
{
"previous_focus": [
"01M3G5QKX1TM61HH21HK4AJHT2"
],
"new_focus": [
"01M3G5QKX1TM61HH21HK4AJHT2"
],
"reason": "successful_write",
"active_focus": {
"primitive": "ingest",
"relation_type": null,
"target_type": "entity.person",
"entity_ids": [
"01M3G5QKX1TM61HH21HK4AJHT2"
],
"display_name": "lucas"
},
"recent_referents": [
{
"entity_id": "01M3G5QKX1TM61HH21HK4AJHT2",
"type_key": "entity.person",
"display_name": "lucas",
"role": "active_focus",
"salience": 1.0
}
],
"idle_turns": 0
}
=== 2026-09-27T00:58:45.791167Z stage=engine ===
client_request_id: 485f76685f53d69af3238e36eb2fbd9d
pke_request_id: req_01M3G5Y6JNEQ7HGMZ87718VV1C
conversation_id: conv_01M3G5M3PZ6XQCFZQRE2Q9MAXP
trace_id: 485f76685f53d69af3238e36eb2fbd9d
---
{
"path": "ask",
"status": "needs_clarification",
"issues": [
{
"code": "time.insufficient",
"message": "IrQueryTime sem período estruturado"
}
],
"resolved_entity_ids": [],
"clarification_reason": "temporal_range_missing",
"clarification_contract": "clarify.time.range"
}
=== 2026-09-27T00:58:45.871329Z stage=presenter_request ===
request_id: req_01M3G5Y6JNEQ7HGMZ87718VV1C
client_request_id: 485f76685f53d69af3238e36eb2fbd9d
conversation_id: 6dbdc0a3-e43e-4306-8c0b-c51b5a7726a1
operation: clarification
status: needs_clarification
---
{
"user_text": "o que eu comprei hoje?",
"structured_result": {
"status": "needs_clarification",
"operation": "clarification",
"kind": "clarification",
"value": null,
"values": [],
"relation_answer": null,
"matched_entities": [],
"candidates": [],
"reason": "clarify.time.range",
"error_code": null,
"items": [],
"dimension": null,
"unit": null,
"entity": null,
"claims": null
},
"conversation_context": [
{
"role": "assistant",
"text": "Não entendi bem o que você quer saber com isso. Pode reformular?"
},
{
"role": "user",
"text": "e sobre o que foi a conversa?"
},
{
"role": "assistant",
"text": "Não entendi bem o que você quer saber com isso. Pode reformular?"
},
{
"role": "user",
"text": "qual foi o restaurante que almocei hoje?"
},
{
"role": "assistant",
"text": "Não entendi bem o que você quer saber com isso. Pode reformular?"
}
],
"presenter_provider": "deepseek",
"presenter_model": "deepseek-chat",
"attempt": 1
}
=== 2026-09-27T00:58:47.077469Z stage=presenter_response ===
request_id: req_01M3G5Y6JNEQ7HGMZ87718VV1C
client_request_id: 485f76685f53d69af3238e36eb2fbd9d
conversation_id: 6dbdc0a3-e43e-4306-8c0b-c51b5a7726a1
provider_request_id: 1d6cf9b9-6156-4ee9-abfe-f2950f713caa
status: failed
---
{
"text": "Em que período você quer consultar?",
"presenter_provider": "deepseek",
"presenter_model": "deepseek-flash",
"provider": "deepseek",
"model": "deepseek-flash",
"fallback_used": true,
"latency_ms": 1196,
"attempt": 1,
"provider_request_id": "1d6cf9b9-6156-4ee9-abfe-f2950f713caa",
"safe_error_message": "unattested_facts",
"fallback_reason": "malformed_response",
"rejected_text": "Só pra eu não errar o período: você quer saber o que comprou hoje mesmo, nas últimas horas, ou em outro momento do dia?",
"status": "failed",
"reason": "unattested_facts",
"fallback_template": "needs_clarification",
"structured_result_status": "needs_clarification"
}