harbor run -t openthoughts/tasktrove-exp-rpt-issue-issue-3734harbor download openthoughts/tasktrove-exp-rpt-issue-issue-3734Title: Fix simulate_tooltips.py to respect locale from settings.json (self-contained task)
Overview The current simulate_tooltips.py bug ignores the locale specified in settings.json and always uses a hard-coded locale. This causes NodeTooltip lines to display an incorrect locale when the settings.json locale differs from the hard-coded value. The task is to modify /app/ so that simulate_tooltips.py reads the locale from settings.json and uses it when emitting NodeTooltip lines, while keeping EdgeTooltip formatting intact. The benchmark script should continue to produce a log with the tooltips and an Elapsed time summary.
Before state (buggy behavior)
Files to inspect (before state)
data.json
{
"nodes": [
{ "id": "A", "value": 1 },
{ "id": "B", "value": 2 },
{ "id": "C", "value": 3 }
],
"edges": [
{ "source": "A", "target": "B", "value": 10 },
{ "source": "B", "target": "C", "value": 20 }
]
}
settings.json
{
"locale": "fr"
}
simulate_tooltips.py
import json
import sys
def main(data_path, settings_path, iterations):
with open(data_path) as f:
data = json.load(f)
# Bug: settings are ignored, locale is hard-coded
locale = "en" # should be loaded from settings_path
nodes = data.get("nodes", [])
edges = data.get("edges", [])
for i in range(iterations):
for n in nodes:
print(f"NodeTooltip: id={n['id']}, value={n['value']}, locale={locale}")
for e in edges:
print(f"EdgeTooltip: {e['source']}->{e['target']} value={e['value']}")
if __name__ == "__main__":
if len(sys.argv) != 4:
print("Usage: simulate_tooltips.py <data.json> <settings.json> <iterations>")
sys.exit(1)
main(sys.argv[1], sys.argv[2], int(sys.argv[3]))
benchmark.sh
#!/bin/bash
set -e
iterations=${1:-100}
mkdir -p logs
{ /usr/bin/time -f Elapsed=%E -a python3 simulate_tooltips.py data.json settings.json $iterations; } >> logs/benchmark.log 2>&1
Notes
What you should modify or create in /app/
Acceptance criteria
Deliverables
Note: Do not reveal any patch text or exact patch diffs in the task content. The agent should implement the fix by updating simulate_tooltips.py to read and apply locale from settings.json.