feat(session): extend Attempt with tier, timing, and verdict fields
This commit is contained in:
@@ -32,9 +32,14 @@ type Entry struct {
|
|||||||
type Attempt struct {
|
type Attempt struct {
|
||||||
Attempt int `json:"attempt"`
|
Attempt int `json:"attempt"`
|
||||||
Model string `json:"model"`
|
Model string `json:"model"`
|
||||||
|
Tier string `json:"tier"` // local | subagent | managed
|
||||||
|
DurationMs int64 `json:"duration_ms"`
|
||||||
|
WarmStart bool `json:"warm_start"` // model already loaded in llama-swap
|
||||||
|
Verified bool `json:"verified"`
|
||||||
|
Verdict string `json:"verdict,omitempty"` // accept | escalate | error
|
||||||
|
Feedback string `json:"feedback,omitempty"` // verifier feedback on escalation
|
||||||
OutputSummary string `json:"output_summary,omitempty"`
|
OutputSummary string `json:"output_summary,omitempty"`
|
||||||
RunnerOutput string `json:"runner_output,omitempty"`
|
RunnerOutput string `json:"runner_output,omitempty"`
|
||||||
Verified bool `json:"verified"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Append writes entry as a single JSON line to sessionsDir/{sessionID}.jsonl.
|
// Append writes entry as a single JSON line to sessionsDir/{sessionID}.jsonl.
|
||||||
|
|||||||
@@ -61,3 +61,22 @@ func TestRead_EmptyWhenNoFile(t *testing.T) {
|
|||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Empty(t, entries)
|
assert.Empty(t, entries)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestAttemptRoundTrip(t *testing.T) {
|
||||||
|
a := session.Attempt{
|
||||||
|
Attempt: 1,
|
||||||
|
Model: "ollama/devstral",
|
||||||
|
Tier: "local",
|
||||||
|
DurationMs: 4200,
|
||||||
|
WarmStart: true,
|
||||||
|
Verified: false,
|
||||||
|
Verdict: "escalate",
|
||||||
|
Feedback: "missing line references",
|
||||||
|
}
|
||||||
|
data, err := json.Marshal(a)
|
||||||
|
require.NoError(t, err)
|
||||||
|
|
||||||
|
var got session.Attempt
|
||||||
|
require.NoError(t, json.Unmarshal(data, &got))
|
||||||
|
assert.Equal(t, a, got)
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user