Task configuration:
{"task_id": "11", "task_name": "\u6dfb\u52a0\u5e26\u6709\u6709\u5e8f\u5217\u8868\u5361\u7247", "description": "\u6dfb\u52a0\u4e00\u4e2a\u95ee\u7b54\u9898\u5361\u7247\uff0c\u95ee\u9898\u4e3aThree largest countries in the world,\u5176\u4e2d\u5bf9largest\u52a0\u7c97, \u7b54\u6848\u4f7f\u7528\u6709\u5e8f\u5217\u8868\uff0c\u5206\u522b\u586b\u5165Russia,Canada, China", "application_info": {"name": "anki", "executable_path": "/home/agent/anki/out/pyenv/bin/python", "args": ["/home/agent/anki/tools/run.py"], "cwd": "/home/agent/anki"}, "instruction_template": "\u6dfb\u52a0\u4e00\u4e2a\u95ee\u7b54\u9898\u5361\u7247\uff0c\u95ee\u9898\u4e3aThree largest countries in the world,\u5176\u4e2d\u5bf9largest\u52a0\u7c97,\u7b54\u6848\u4f7f\u7528\u6709\u5e8f\u5217\u8868\uff0c\u5206\u522b\u586b\u5165Russia,Canada, China", "evaluation_setup": {"scripts": [{"role": "hook", "path": "hooker.js", "dependency": ["../common/hooker_common.js"]}, {"role": "handler", "path": "handler.py"}], "timeout": 60}, "events": {"card_added": {"description": "\u6dfb\u52a0\u4e86\u5361\u7247", "is_key_step": true, "key_step_index": 1, "key_step_name": "\u6dfb\u52a0\u4e86\u5361\u7247"}, "card_format_correct": {"description": "\u5361\u7247\u683c\u5f0f\u5339\u914d", "is_key_step": true, "key_step_index": 2, "key_step_name": "\u5361\u7247\u683c\u5f0f\u5339\u914d"}, "card_format_wrong": {"description": "\u5361\u7247\u683c\u5f0f\u4e0d\u5339\u914d", "is_key_step": false}}, "sql_path": "/home/agent/.local/share/Anki2/sam/collection.anki2", "total_key_steps": 2, "mcp_servers": [{"command": "/home/agent/anki-mcp-server/.venv/bin/python", "args": ["/home/agent/anki-mcp-server/run_server.py"]}]}

Hook script:
const TRACE_FUNCTION = [
    "storage_add_card",
]
function initHooks() {
    // iterate function name and addr, init it.
    for (const function_name of TRACE_FUNCTION){
        initHook(function_name, TRACE_MAPS[function_name]);
    }
}
initHooks();
sendLog("info", "add hooks done");

Evaluation handler:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import os
import re
sys.path.append(os.path.dirname(__file__))
from common import *

def remove_html_tags(text):
    return re.sub(r'<[^>]+>', '', text)

def check_fields(note) -> bool:
    if re.findall(r'Three\s+<b>\s*largest\s*</b>\s+countries\s+in\s+the\s+world', note,re.DOTALL):
        return True
    return False

def check_fields2(note) -> bool:
    if re.findall(r"<ol>\s*<li>\s*Russia\s*</li>\s*<li>\s*Canada\s*</li>\s*<li>\s*China\s*</li>\s*</ol>",note,re.DOTALL):
        return True
    return False

def handle_storage_add_card(context: Context,message) -> Status:
    context.update_database()
    latest_card : Card = sorted(AnkiObjMap().array_by_type("card"),key=lambda x: x.mod,reverse=True)[0]
    note = latest_card.get_note()
    status = Status()
    status.emit(EventCardAdded())
    if len(note.fields) == 2:
        note = note.fields
        if not check_fields(note[0]):
            status.emit(EventCardFormatWrong(note[0],'Three <b>largest</b> countries in the world'))
            # status.mark_error()
            return status
        if not check_fields2(note[1]):
            status.emit(EventCardFormatWrong(note[1],"<ol><li>Russia</li><li>Canada</li><li>China</li></ol>"))
            # status.mark_error()
            return status
        status.emit(EventCardFormatCorrect())
    # else:
    #     status.mark_error()
    return status
TRACE_HANDLERS = {
    "storage_add_card": handle_storage_add_card,
}   
dependency_graph = {
    card_added_ : [],
    card_format_correct_ : [card_added_]
}
finished_list = [
    card_format_correct_
]

bind_handlers(TRACE_HANDLERS,dependency_graph,finished_list)