diff --git a/README.md b/README.md index d2d81989..8bf2146a 100644 --- a/README.md +++ b/README.md @@ -838,13 +838,17 @@ codexometer --digbench-game P-1 ``` The published Codex condition is the default: `gpt-5.6-sol` with `high` -reasoning effort. Override it or the 30-minute hard limit explicitly: +reasoning effort. DigBench Scope labels both sides of that exact pairing, while +`xhigh` is identified as an enhanced Codexometer experiment and not a paper +condition. Codexometer allows two hours per game by default because +discovery runs can be substantially longer than ordinary coding benchmarks. +The headless form can set another finite boundary explicitly; for example: ```sh codexometer --digbench-game P-3 \ --digbench-model gpt-5.6-terra \ --digbench-effort medium \ - --digbench-timeout 20m + --digbench-timeout 12h ``` The command creates a fresh remote DigBench session, so invoking it is an @@ -864,13 +868,29 @@ the scoped dynamic-tool bridge. Step calls are safely retried using DigBench's idempotent `step_index` protocol; session creation is never automatically retried because that endpoint does not document idempotency. +The model-facing instructions retain Codexometer's session-isolation and useful +scratch-note guidance while following the agentic prompt published in the +[DigBench paper](https://arxiv.org/abs/2608.12593). Codex receives the API's task +description, including any objective or special-action guidance that does not +reveal the rules, plus `creative_toggle` when the state supplies it. Every move +is explicitly an observe → reason → one-action cycle: Codex is told to wait for +and inspect the authoritative result before choosing another move, including +when deliberately testing a sequence. Tool results sent back into the model are +compact game-state slices so repeated session metadata and schemas do not crowd +out useful history. This compaction does not discard game observations, legal +actions, limits, transitions, progress, or creative-mode state. The derived +`levels_beaten` score stays in the operator-facing transcript and UI rather than +being supplied to the model. + In the TUI, each selected game run appears immediately in the existing result table and can be opened while it is in progress. Its benchmark-only detail view shows every Codexometer-authored developer instruction, the complete game prompt with the session ID redacted, and the dynamic-tool definitions. It then presents each game exchange as a sanitized **Tool Request** and full **Tool Response**, followed by the concise **Move** and authoritative **State** representation, so -the solving workflow remains readable without losing protocol detail. The final +the solving workflow remains readable without losing protocol detail. The full +recorded response intentionally remains richer than the compact state returned +to the model. The final model response completes the visible `Policy → Prompt → Tools → Tool Request → Tool Response → Move → State → Final Response` workflow. The **Copy** control exports that complete captured view. DigBench diff --git a/internal/codex/digbench.go b/internal/codex/digbench.go index abb69708..38f72c85 100644 --- a/internal/codex/digbench.go +++ b/internal/codex/digbench.go @@ -13,9 +13,11 @@ import ( ) const ( - defaultDigBenchTimeout = 30 * time.Minute + // DefaultDigBenchTimeout gives discovery-heavy games enough room to finish + // while retaining a finite safety boundary. Headless callers can override it. + DefaultDigBenchTimeout = 2 * time.Hour defaultDigBenchProgressInterval = 15 * time.Second - digBenchDeveloperInstructions = "Play only the assigned DigBench session. Use its scoped tools for game access, keep useful notes in the isolated workspace if needed, and stop calling tools as soon as the game is done." + digBenchDeveloperInstructions = "Play only the assigned DigBench session. Use its scoped tools for game access, keep useful notes and hypotheses in the isolated workspace if needed, inspect every returned state before choosing the next move, and stop calling tools as soon as the game is done." ) var errDigBenchTimeout = errors.New("DigBench timeout reached") @@ -239,7 +241,7 @@ func (c Client) RunDigBench(ctx context.Context, service digBenchService, option return DigBenchResult{}, errors.New("DigBench game, model, and effort are required") } if options.Timeout <= 0 { - options.Timeout = defaultDigBenchTimeout + options.Timeout = DefaultDigBenchTimeout } runCtx, cancel := context.WithTimeoutCause(ctx, options.Timeout, errDigBenchTimeout) defer cancel() @@ -446,9 +448,9 @@ func (s *appServerSession) runDigBench( assignedSessionID, envelope.Params, &session, ) applyDigBenchSession(&result, session) - success := response["success"] == true + success := response.agent["success"] == true appendDigBenchInteraction(&result, startedAt, BenchmarkInteractionTool, formatDigBenchToolInteraction(tool, action, stepIndex, assignedSessionID, session.SessionID)) - appendDigBenchInteraction(&result, startedAt, BenchmarkInteractionToolResponse, formatDigBenchToolResponse(response, success, assignedSessionID, session.SessionID)) + appendDigBenchInteraction(&result, startedAt, BenchmarkInteractionToolResponse, formatDigBenchToolResponse(response.transcript, success, assignedSessionID, session.SessionID)) if success { if tool == "step" { appendDigBenchInteraction(&result, startedAt, BenchmarkInteractionMove, redactDigBenchText(action, assignedSessionID, session.SessionID)) @@ -457,7 +459,7 @@ func (s *appServerSession) runDigBench( emitDigBenchProgress(options.Progress, DigBenchProgressUpdate, result, startedAt) publishDigBenchSnapshot(options.Snapshot, result) } - if err := s.respond(envelope.ID, response); err != nil { + if err := s.respond(envelope.ID, response.agent); err != nil { return result, fmt.Errorf("respond to DigBench tool call: %w", err) } continue @@ -700,7 +702,7 @@ func digBenchDynamicTools() []map[string]any { }, { "type": "function", "name": "step", - "description": "Apply exactly one legal action to the assigned DigBench game session.", + "description": "Apply exactly one legal action to the assigned DigBench game session. Inspect the returned authoritative state before choosing and submitting the next move; never queue moves against states you have not observed.", "inputSchema": map[string]any{ "type": "object", "properties": map[string]any{ @@ -731,25 +733,106 @@ func formatDigBenchTools() string { } func formatDigBenchPrompt(session digbench.Session, sessionID string, redactState bool) string { - stateValue := any(session.State) + description := session.Description + creativeToggle := session.State.CreativeToggle + stateValue := any(digBenchModelState(session.State)) if redactState { + description = redactDigBenchText(description, session.SessionID) + if creativeToggle != nil { + redacted := redactDigBenchText(*creativeToggle, session.SessionID) + creativeToggle = &redacted + } stateValue = redactDigBenchJSONValue(stateValue, session.SessionID) } state, _ := json.Marshal(stateValue) return fmt.Sprintf(`We are not going to tell you the rules of this game—you have to figure them out for yourself. -The aim is to reach as high a level as possible. You advance by reaching unknown states. Each level has a limited number of steps; exhausting them or reaching certain states can cost a life. Losing all lives ends the game. - -Creative mode is available when "/" appears in the state's actions list. Use the step tool with action "/" to enter or leave it. Creative mode permits experimentation without consuming ordinary steps or lives, but has its own finite budget. +Levels, lives and steps: +- The aim is to reach as high a level as possible. For each level you reach you will be awarded a bonus. +- You advance levels by reaching certain states within the game. You will have to figure out what these are. +- Within each level, you have a limited number of steps. If you run out of steps, you lose a life. If you lose all your lives, the game is over. +- It is also possible to lose a life by reaching certain states within the game. -Your game session is already started: session_id=%q, game=%q. Do not start or choose another game. Use only get_session and step for game access, and pass this session_id to every call. +TASK DESCRIPTION (objective + any special actions, NOT the rules): +%s%s -Starting step_index: %d. Your first move must use step_index %d. -Initial state: +How you play—use the scoped DigBench tools to drive the game: +1. Your game session is ALREADY started for you: +session_id=%q, game=%q. You do NOT start or choose a game—you only have the "get_session" and "step" game tools, scoped to this one session, and you must pass this session_id to every call. Your starting state (step_index=%d) is: %s -Each move must use exactly one string from the latest state's actions list and the latest returned step_index plus one. Infer the rules from state changes, keep useful notes if helpful, and continue at a deliberate but efficient pace until state.done is true. Then stop making moves and give a concise debrief of the mechanics, objective, strategy, and uncertainties.`, - sessionID, session.Game, session.StepIndex, session.StepIndex+1, state) +2. Each turn, read the current state and reason from these fields: observation (the rendered screen), level, max_level, lives_left, steps_remaining, status, done, the actions list (your legal moves), and mode/creative_toggle/transition when present. + +3. Make a move with the "step" tool: session_id=%q, step_index=, action=. Your first move uses step_index=%d. A step_index mismatch is a conflict—always step off the server's last returned step_index. Use the "get_session" tool if you ever need to re-read the current state. + +4. Infer what each action does from how the state changes, and build on what you learn across turns. Keep useful notes and hypotheses in the isolated workspace when helpful. After each successful "step" call, wait for and inspect its returned authoritative state before deciding the next action. Never queue or precompute multiple future step calls against an unobserved state. You may deliberately test a sequence, but submit it one observed move at a time. + +Keep playing at a deliberate but efficient pace until the state's done is true (status game_over or completed). When the game is done, STOP making moves and write a concise debrief: the mechanics you discovered, the objective, useful strategies, and remaining uncertainties.`, + digBenchTaskDescription(description), digBenchCreativeModeInstruction(creativeToggle), + sessionID, session.Game, session.StepIndex, state, + sessionID, session.StepIndex+1) +} + +func digBenchTaskDescription(description string) string { + description = strings.TrimSpace(description) + if description == "" { + return "(none provided)" + } + return description +} + +func digBenchCreativeModeInstruction(toggle *string) string { + if toggle == nil || *toggle == "" { + return "" + } + action, _ := json.Marshal(*toggle) + return fmt.Sprintf(` + +Important: creative mode +At nearly any time, you can use a button to switch into "creative mode", where you can experiment safely without losing ordinary steps or lives. It may be necessary to use creative mode in order to discover the rules without running out of steps. Creative mode has its own finite budget. + +Call the "step" tool with action %s to enter creative mode. +Call the "step" tool with action %s again to return to survival mode. +Only submit %s when it appears in the state's actions list.`, action, action, action) +} + +// digBenchModelState keeps every game-relevant field while omitting repeated +// protocol/session metadata. The complete API payload remains in the sanitized +// benchmark transcript for auditability. +func digBenchModelState(state digbench.State) map[string]any { + modelState := map[string]any{ + "observation": state.Observation, + "level": state.Level, + "max_level": state.MaxLevel, + "lives_left": state.LivesLeft, + "steps_remaining": state.StepsRemaining, + "status": state.Status, + "done": state.Done, + "actions": state.Actions, + } + // These static limits are useful when planning experiments and were already + // visible in Codexometer's original model-facing response. + if state.MaxSteps != nil { + modelState["max_steps"] = state.MaxSteps + } + if state.StartingLives != nil { + modelState["starting_lives"] = state.StartingLives + } + if state.Mode != nil { + modelState["mode"] = state.Mode + } + if state.CreativeToggle != nil { + modelState["creative_toggle"] = state.CreativeToggle + } + if state.Transition != nil { + modelState["transition"] = state.Transition + } + return modelState +} + +type digBenchHandledToolCall struct { + agent map[string]any + transcript map[string]any } func handleDigBenchToolCall( @@ -760,7 +843,7 @@ func handleDigBenchToolCall( sessionID string, params json.RawMessage, current *digbench.Session, -) map[string]any { +) digBenchHandledToolCall { var call struct { ThreadID string `json:"threadId"` TurnID string `json:"turnId"` @@ -768,19 +851,19 @@ func handleDigBenchToolCall( Arguments json.RawMessage `json:"arguments"` } if err := json.Unmarshal(params, &call); err != nil { - return digBenchToolResponse(nil, fmt.Errorf("decode tool request: %w", err)) + return digBenchErrorToolCall(fmt.Errorf("decode tool request: %w", err)) } if call.ThreadID != threadID || call.TurnID != turnID { - return digBenchToolResponse(nil, errors.New("access denied: tool call belongs to another Codex turn")) + return digBenchErrorToolCall(errors.New("access denied: tool call belongs to another Codex turn")) } var common struct { SessionID string `json:"session_id"` } if err := json.Unmarshal(call.Arguments, &common); err != nil { - return digBenchToolResponse(nil, fmt.Errorf("decode %s arguments: %w", call.Tool, err)) + return digBenchErrorToolCall(fmt.Errorf("decode %s arguments: %w", call.Tool, err)) } if common.SessionID != sessionID { - return digBenchToolResponse(nil, errors.New("access denied: tool is scoped to the assigned session")) + return digBenchErrorToolCall(errors.New("access denied: tool is scoped to the assigned session")) } switch call.Tool { case "get_session": @@ -788,7 +871,7 @@ func handleDigBenchToolCall( if err == nil { *current = session } - return digBenchToolResponse(session, err) + return digBenchSuccessfulToolCall(session, digBenchCompactSession(session), err) case "step": var arguments struct { SessionID string `json:"session_id"` @@ -796,16 +879,46 @@ func handleDigBenchToolCall( Action string `json:"action"` } if err := json.Unmarshal(call.Arguments, &arguments); err != nil { - return digBenchToolResponse(nil, fmt.Errorf("decode step arguments: %w", err)) + return digBenchErrorToolCall(fmt.Errorf("decode step arguments: %w", err)) } response, err := service.Step(ctx, sessionID, digbench.StepRequest{Action: arguments.Action, StepIndex: arguments.StepIndex}) if err == nil { *current = response.Session } - return digBenchToolResponse(response, err) + return digBenchSuccessfulToolCall(response, digBenchCompactStep(response), err) default: - return digBenchToolResponse(nil, fmt.Errorf("unknown DigBench tool %q", call.Tool)) + return digBenchErrorToolCall(fmt.Errorf("unknown DigBench tool %q", call.Tool)) + } +} + +func digBenchSuccessfulToolCall(full, compact any, err error) digBenchHandledToolCall { + if err != nil { + return digBenchErrorToolCall(err) + } + return digBenchHandledToolCall{ + agent: digBenchToolResponse(compact, nil), + transcript: digBenchToolResponse(full, nil), + } +} + +func digBenchErrorToolCall(err error) digBenchHandledToolCall { + response := digBenchToolResponse(nil, err) + return digBenchHandledToolCall{agent: response, transcript: response} +} + +func digBenchCompactSession(session digbench.Session) map[string]any { + return map[string]any{ + "step_index": session.StepIndex, + "state": digBenchModelState(session.State), + } +} + +func digBenchCompactStep(response digbench.StepResponse) map[string]any { + compact := digBenchCompactSession(response.Session) + if response.InvalidAction != nil { + compact["invalid_action"] = *response.InvalidAction } + return compact } func digBenchToolResponse(value any, err error) map[string]any { diff --git a/internal/codex/digbench_test.go b/internal/codex/digbench_test.go index 7afd7366..7af2da69 100644 --- a/internal/codex/digbench_test.go +++ b/internal/codex/digbench_test.go @@ -42,9 +42,13 @@ func TestRunDigBenchBridgesScopedStepAndDetectsWin(t *testing.T) { seed := int64(42) framework := "engine-1" maxLevel := 3 + creativeToggle := "/" service := &fakeDigBenchService{session: digbench.Session{ Game: "P-1", SessionID: "session-1", Seed: &seed, FrameworkVersion: &framework, - State: digbench.State{Status: "in_progress", Level: 1, MaxLevel: &maxLevel, Observation: "___", Actions: []string{"b"}}, + State: digbench.State{ + Status: "in_progress", Level: 1, MaxLevel: &maxLevel, CreativeToggle: &creativeToggle, + Observation: "___", Actions: []string{"b"}, + }, }} usage := BenchmarkUsage{TotalTokens: 120, InputTokens: 100, OutputTokens: 20} server, requests := newFakeBenchmarkServer( @@ -166,9 +170,20 @@ func TestRunDigBenchTimeoutIncludesAppServerStartup(t *testing.T) { func TestDigBenchTranscriptPromptRedactsOnlyRuntimeSessionID(t *testing.T) { maxLevel := 3 + maxSteps := 100 + startingLives := 8 + mode := "creative" + creativeToggle := "/" + transition := "session-secret advanced" session := digbench.Session{ Game: "P-1", SessionID: "session-secret", StepIndex: 4, - State: digbench.State{Status: "in_progress", Level: 2, MaxLevel: &maxLevel, Observation: "session-secret sees ___", Actions: []string{"b", "session-secret-action"}}, + Description: "Reach the marked state for session-secret using the special action.", + State: digbench.State{ + Status: "in_progress", Level: 2, MaxLevel: &maxLevel, MaxSteps: &maxSteps, + StartingLives: &startingLives, Mode: &mode, CreativeToggle: &creativeToggle, + Transition: &transition, Observation: "session-secret sees ___", + Actions: []string{"b", "session-secret-action"}, + }, } runtimePrompt := digBenchPrompt(session) transcriptPrompt := digBenchTranscriptPrompt(session) @@ -178,12 +193,22 @@ func TestDigBenchTranscriptPromptRedactsOnlyRuntimeSessionID(t *testing.T) { if strings.Contains(transcriptPrompt, "session-secret") || !strings.Contains(transcriptPrompt, `session_id="[REDACTED]"`) { t.Fatalf("transcript prompt did not safely redact session: %q", transcriptPrompt) } - for _, shared := range []string{`game="P-1"`, "Starting step_index: 4", "Your first move must use step_index 5"} { + for _, shared := range []string{ + `game="P-1"`, "starting state (step_index=4)", "first move uses step_index=5", + "TASK DESCRIPTION (objective + any special actions, NOT the rules)", + "After each successful \"step\" call, wait for and inspect its returned authoritative state", + "Never queue or precompute multiple future step calls against an unobserved state", + `"creative_toggle":"/"`, `"max_steps":100`, `"starting_lives":8`, + } { if !strings.Contains(runtimePrompt, shared) || !strings.Contains(transcriptPrompt, shared) { t.Fatalf("prompt variants do not share %q", shared) } } - if !strings.Contains(runtimePrompt, `"observation":"session-secret sees ___"`) || !strings.Contains(transcriptPrompt, `"observation":"[REDACTED] sees ___"`) || !strings.Contains(transcriptPrompt, `"[REDACTED]-action"`) { + if !strings.Contains(runtimePrompt, "Reach the marked state for session-secret") || + !strings.Contains(runtimePrompt, `"observation":"session-secret sees ___"`) || + !strings.Contains(transcriptPrompt, "Reach the marked state for [REDACTED]") || + !strings.Contains(transcriptPrompt, `"observation":"[REDACTED] sees ___"`) || + !strings.Contains(transcriptPrompt, `"[REDACTED]-action"`) { t.Fatalf("state strings were not safely represented: %q", transcriptPrompt) } state := formatDigBenchState(session) @@ -192,6 +217,76 @@ func TestDigBenchTranscriptPromptRedactsOnlyRuntimeSessionID(t *testing.T) { } } +func TestDigBenchPromptMarksMissingTaskDescription(t *testing.T) { + prompt := digBenchPrompt(digbench.Session{Game: "P-1", SessionID: "session-1"}) + if !strings.Contains(prompt, "TASK DESCRIPTION") || !strings.Contains(prompt, "(none provided)") { + t.Fatalf("missing description was not represented explicitly: %q", prompt) + } + if strings.Contains(prompt, "Important: creative mode") { + t.Fatalf("creative-mode guidance was shown without a toggle: %q", prompt) + } +} + +func TestDigBenchPromptUsesProvidedCreativeToggle(t *testing.T) { + toggle := "creative-mode" + prompt := digBenchPrompt(digbench.Session{ + Game: "P-1", SessionID: "session-1", + State: digbench.State{CreativeToggle: &toggle}, + }) + for _, expected := range []string{ + "Important: creative mode", + `Call the "step" tool with action "creative-mode" to enter creative mode.`, + `Only submit "creative-mode" when it appears in the state's actions list.`, + } { + if !strings.Contains(prompt, expected) { + t.Fatalf("creative-mode guidance missing %q: %q", expected, prompt) + } + } + if strings.Contains(prompt, `action "/"`) { + t.Fatalf("creative-mode guidance used a hard-coded toggle: %q", prompt) + } +} + +func TestDigBenchAgentResponseIsCompactWhileTranscriptRetainsFullPayload(t *testing.T) { + framework := "engine-1" + seed := int64(42) + maxLevel := 5 + invalid := false + response := digbench.StepResponse{ + Session: digbench.Session{ + Description: "objective", FrameworkVersion: &framework, Game: "P-2", + MoveSchema: json.RawMessage(`{"type":"object"}`), Seed: &seed, + SessionID: "session-secret", StepIndex: 7, LevelsBeaten: 1, + State: digbench.State{Observation: "abc", Actions: []string{"x"}, Level: 2, MaxLevel: &maxLevel, Status: "in_progress"}, + }, + InvalidAction: &invalid, + } + handled := digBenchSuccessfulToolCall(response, digBenchCompactStep(response), nil) + agent := handled.agent["contentItems"].([]map[string]string)[0]["text"] + transcript := handled.transcript["contentItems"].([]map[string]string)[0]["text"] + for _, expected := range []string{`"step_index":7`, `"observation":"abc"`, `"actions":["x"]`, `"invalid_action":false`} { + if !strings.Contains(agent, expected) { + t.Fatalf("compact agent response missing %q: %s", expected, agent) + } + } + for _, excluded := range []string{"session-secret", "framework_version", "move_schema", "objective", `"seed"`, `"levels_beaten"`} { + if strings.Contains(agent, excluded) { + t.Fatalf("compact agent response retained %q: %s", excluded, agent) + } + } + for _, retained := range []string{"session-secret", "framework_version", "move_schema", "objective", `"seed"`, `"levels_beaten":1`} { + if !strings.Contains(transcript, retained) { + t.Fatalf("full transcript response lost %q: %s", retained, transcript) + } + } +} + +func TestDefaultDigBenchTimeoutAllowsLongDiscoveryRuns(t *testing.T) { + if DefaultDigBenchTimeout != 2*time.Hour { + t.Fatalf("default timeout = %s", DefaultDigBenchTimeout) + } +} + func TestDigBenchToolResponseTranscriptRedactsSensitiveIdentifiers(t *testing.T) { response := digBenchToolResponse(map[string]any{ "session_id": "session-secret", @@ -443,10 +538,10 @@ func TestDigBenchToolRejectsAnotherSession(t *testing.T) { "arguments": map[string]any{"session_id": "session-2", "step_index": 1, "action": "a"}, }) response := handleDigBenchToolCall(context.Background(), service, "thread-1", "turn-1", "session-1", params, ¤t) - if response["success"] != false || service.stepCalls != 0 { + if response.agent["success"] != false || service.stepCalls != 0 { t.Fatalf("response = %#v, calls = %d", response, service.stepCalls) } - content := response["contentItems"].([]map[string]string) + content := response.agent["contentItems"].([]map[string]string) if !strings.Contains(content[0]["text"], "access denied") { t.Fatalf("response = %#v", response) } diff --git a/internal/digbench/client.go b/internal/digbench/client.go index 68261519..8bcc32ae 100644 --- a/internal/digbench/client.go +++ b/internal/digbench/client.go @@ -45,6 +45,7 @@ type State struct { MaxLevel *int `json:"max_level"` MaxSteps *int `json:"max_steps"` Mode *string `json:"mode"` + CreativeToggle *string `json:"creative_toggle"` Observation string `json:"observation"` StartingLives *int `json:"starting_lives"` Status string `json:"status"` diff --git a/internal/digbench/client_test.go b/internal/digbench/client_test.go index 4facf0d0..c4303544 100644 --- a/internal/digbench/client_test.go +++ b/internal/digbench/client_test.go @@ -28,7 +28,7 @@ func TestStartSessionUsesBearerAndDecodesState(t *testing.T) { "session_id":"session-1","game":"P-1","step_index":0, "done":false,"levels_beaten":0,"seed":42,"framework_version":"abc", "state":{"status":"in_progress","done":false,"level":1,"max_level":3, - "observation":"___","actions":["a","b"]} + "mode":"creative","creative_toggle":"/","observation":"___","actions":["a","b","/"]} }`)) })) defer server.Close() @@ -42,6 +42,9 @@ func TestStartSessionUsesBearerAndDecodesState(t *testing.T) { if session.SessionID != "session-1" || session.Seed == nil || *session.Seed != 42 || session.State.MaxLevel == nil || *session.State.MaxLevel != 3 { t.Fatalf("session = %#v", session) } + if session.State.CreativeToggle == nil || *session.State.CreativeToggle != "/" { + t.Fatalf("creative toggle was not decoded: %#v", session.State) + } } func TestListGamesUsesBearerAndReturnsCompleteCatalog(t *testing.T) { diff --git a/internal/ui/benchmark.go b/internal/ui/benchmark.go index 010f453a..56085313 100644 --- a/internal/ui/benchmark.go +++ b/internal/ui/benchmark.go @@ -593,6 +593,9 @@ func (m Model) benchmarkScopeItems() []benchmarkScopeItem { for _, model := range m.benchmarkPlan.Models { selected := selectedModels[model.Model] label := " " + scopeCheckLabel(selected) + " " + model.DisplayName + if m.benchmarkSelectedSuiteExternal() && strings.EqualFold(model.Model, "gpt-5.6-sol") { + label += " // PUBLISHED CONDITION WITH HIGH" + } items = append(items, benchmarkScopeItem{ kind: benchmarkScopeModel, value: model.Model, label: label, efforts: append([]string(nil), model.Efforts...), selected: selected, @@ -605,9 +608,18 @@ func (m Model) benchmarkScopeItems() []benchmarkScopeItem { selectedEfforts := stringSetUI(m.benchmarkScope.Efforts) for _, effort := range m.benchmarkPlan.Efforts { selected := selectedEfforts[effort] + label := " " + scopeCheckLabel(selected) + " " + strings.ToUpper(effort) + if m.benchmarkSelectedSuiteExternal() { + switch strings.ToLower(effort) { + case "high": + label += " // PUBLISHED CONDITION WITH GPT-5.6 SOL" + case "xhigh": + label += " // ENHANCED // NOT PAPER CONDITION" + } + } items = append(items, benchmarkScopeItem{ kind: benchmarkScopeEffort, value: effort, selected: selected, - label: " " + scopeCheckLabel(selected) + " " + strings.ToUpper(effort), + label: label, }) } if m.benchmarkSelectedSuiteExternal() { @@ -1433,10 +1445,7 @@ func benchmarkResultValues(result codex.BenchmarkResult, rankings map[string]int if inProgress { outcome = "IN PROGRESS" if result.Provider == "digbench" { - game := strings.TrimSpace(strings.TrimPrefix(result.TaskName, "DIGBENCH")) - if game != "" { - outcome = fmt.Sprintf("IN PROGRESS (%s, %d)", game, result.CurrentLevel) - } + outcome = fmt.Sprintf("IN PROGRESS (LVL %d)", result.CurrentLevel) } } else if result.Stopped { outcome = "STOPPED" diff --git a/internal/ui/benchmark_test.go b/internal/ui/benchmark_test.go index bda77103..ff5cb782 100644 --- a/internal/ui/benchmark_test.go +++ b/internal/ui/benchmark_test.go @@ -172,7 +172,7 @@ func TestBenchmarkResultsCopyControlExportsMarkdownTable(t *testing.T) { if lines[1] != "| --- | --- | --- | --- | --- | --- | --- | --- |" { t.Fatalf("Markdown separator = %q", lines[1]) } - for _, want := range []string{"PIPE \\| TASK", "FAILED TASK", "IN PROGRESS (P-1, 4)", "~$0.0123"} { + for _, want := range []string{"PIPE \\| TASK", "FAILED TASK", "IN PROGRESS (LVL 4)", "~$0.0123"} { if !strings.Contains(clipboard, want) { t.Fatalf("Markdown export missing %q:\n%s", want, clipboard) } @@ -942,6 +942,40 @@ func TestDigBenchSuiteSupportsScopedAndAllCombinations(t *testing.T) { } } +func TestDigBenchScopeLabelsPublishedAndEnhancedEfforts(t *testing.T) { + client := codex.Client{DigBenchToken: "secret", DigBenchGames: []string{"P-1"}} + plan := codex.BenchmarkPlan{ + Models: []codex.BenchmarkModelOption{ + {Model: "gpt-5.6-sol", DisplayName: "GPT-5.6 Sol", Efforts: []string{"high", "xhigh"}}, + {Model: "gpt-5.6-terra", DisplayName: "GPT-5.6 Terra", Efforts: []string{"high", "xhigh"}}, + }, + Efforts: []string{"high", "xhigh"}, Games: []string{"P-1"}, + } + model := Model{benchmarkRunner: client, benchmarkPlan: plan, benchmarkScope: plan.AllScope(), benchmarkSelectedSuite: 2} + modelLabels := map[string]string{} + labels := map[string]string{} + for _, item := range model.benchmarkScopeItems() { + switch item.kind { + case benchmarkScopeModel: + modelLabels[item.value] = item.label + case benchmarkScopeEffort: + labels[item.value] = item.label + } + } + if !strings.Contains(modelLabels["gpt-5.6-sol"], "PUBLISHED CONDITION WITH HIGH") { + t.Fatalf("Sol model label = %q", modelLabels["gpt-5.6-sol"]) + } + if strings.Contains(modelLabels["gpt-5.6-terra"], "PUBLISHED") { + t.Fatalf("Terra model label = %q", modelLabels["gpt-5.6-terra"]) + } + if !strings.Contains(labels["high"], "PUBLISHED CONDITION WITH GPT-5.6 SOL") { + t.Fatalf("high effort label = %q", labels["high"]) + } + if !strings.Contains(labels["xhigh"], "ENHANCED") || !strings.Contains(labels["xhigh"], "NOT PAPER CONDITION") { + t.Fatalf("xhigh effort label = %q", labels["xhigh"]) + } +} + func TestBenchmarkSuitesSplitBuiltInCatalogAndConditionallyAddDigBench(t *testing.T) { plain := Model{benchmarkRunner: codex.Client{}} suites := plain.benchmarkSuites() @@ -1391,7 +1425,7 @@ func TestBenchmarkResultValuesShowLiveDigBenchGameAndLevel(t *testing.T) { result := codex.BenchmarkResult{ Provider: "digbench", TaskName: "DIGBENCH P-1", CurrentLevel: 4, } - if got := benchmarkResultValues(result, nil, true)[4]; got != "IN PROGRESS (P-1, 4)" { + if got := benchmarkResultValues(result, nil, true)[4]; got != "IN PROGRESS (LVL 4)" { t.Fatalf("live DigBench result = %q", got) } if got := benchmarkResultValues(result, nil)[4]; got != "LOSS" { diff --git a/intro-post.md b/intro-post.md index 92e8db20..63396eba 100644 --- a/intro-post.md +++ b/intro-post.md @@ -56,6 +56,8 @@ Codexometer also includes an experimental integration with [DigBench](https://di Supplying a `DIGBENCH_API_TOKEN` adds **DigBench** to the suite selector. Codexometer fetches the current game catalogue at launch rather than compiling a fixed list, so Scope can expose every game returned by DigBench alongside the model and reasoning controls. +The exact published `gpt-5.6-sol`/`high` condition is identified on both Scope controls; `xhigh` is marked as an enhanced, non-paper experiment. Each game receives a two-hour default allowance, with a different finite timeout available to headless runs. The model gets DigBench's task description and creative-mode metadata, a compact state-focused response after every action, and explicit guidance to inspect that response before choosing its next single move. The derived level score remains operator-facing, and Codexometer keeps the richer sanitized API exchange in the benchmark detail transcript. + Before a run, Codexometer shows the planned number of persisted remote sessions and asks for confirmation. During each game, the result table reports live game and level progress. Its detail view documents the solving workflow as safe prompts and tool definitions followed by each tool request, tool response, move, authoritative state, and final response. Win detection comes from the remote DigBench state rather than from interpreting the model’s prose. Without a DigBench token, the integration remains hidden and the normal Codexometer experience is unchanged. Tokens can be created from the [DigBench account page](https://digbench.ai/account/tokens). diff --git a/main.go b/main.go index 7cb21ae1..b37ea973 100644 --- a/main.go +++ b/main.go @@ -227,7 +227,7 @@ func run(args []string, stdout, stderr io.Writer, deps dependencies) int { digBenchGame = flags.String("digbench-game", "", "run one experimental DigBench game and exit") digBenchModel = flags.String("digbench-model", "gpt-5.6-sol", "Codex model for --digbench-game") digBenchEffort = flags.String("digbench-effort", "high", "reasoning effort for --digbench-game") - digBenchTimeout = flags.Duration("digbench-timeout", 30*time.Minute, "hard limit for --digbench-game") + digBenchTimeout = flags.Duration("digbench-timeout", codex.DefaultDigBenchTimeout, "hard limit for --digbench-game") printVersion bool ) flags.BoolVar(&printVersion, "version", false, "print the version and exit")