feat(trace): record llm choice number and chosen_action echo

This commit is contained in:
pj committed 2026-07-13 07:23:21 +05:30
1 parent 0ead53757c
commit 75aa1eefd6
1 file changed
+7 -8
+7 -8
View File
@@ -87,14 +87,13 @@ type Action struct {
// the model's short rationale, shown by the replay UI to explain the pick. // the model's short rationale, shown by the replay UI to explain the pick.
Source string `json:"source,omitempty"` Source string `json:"source,omitempty"`
LLMReasoning string `json:"llm_reasoning,omitempty"` LLMReasoning string `json:"llm_reasoning,omitempty"`
// LLMRanked is the model's full ranked candidate-index list; LLMChosenRank // LLMChoice is the 1-based number the model picked from the candidate list;
// is the 1-based position in it that produced this action (1 = the model's // LLMChosenAction is the action description it echoed for that number. The
// top pick; >1 means earlier picks were invalid and skipped). Together they // runner strict-skips when the echo disagrees with the numbered entry, so on
// let the replay UI reconcile the reasoning with the executed action: the // a recorded action the two always agree — the replay UI shows them to
// reasoning describes the model's top pick, so a ChosenRank > 1 is why the // confirm the reasoning matched the executed action.
// prose can name a different target than the one acted on. LLMChoice int `json:"llm_choice,omitempty"`
LLMRanked []int `json:"llm_ranked,omitempty"` LLMChosenAction string `json:"llm_chosen_action,omitempty"`
LLMChosenRank int `json:"llm_chosen_rank,omitempty"`
} }
type BoundsRecord struct { type BoundsRecord struct {