Work History Addition

L3
ModelContextProtocolNotionOnline Resume

Add a Research Assistant position to the Work History section with consistent formatting and university logo.

Created by Xiangyan Liu
2025-07-27
Database ManipulationTemplate PopulationCross Reference LinkingVisual Formatting

Model Ranking

Click on the dots to view the trajectory of each task run
Model
Run Results
Pass@4
Pass^4
Avg Time
Avg Turns
Input Tokens
Output Tokens
Total Tokens
Claude
claude-4-1-opus
0
/1
--
211.4s
16.0
438,871
3,223
442,094
Claude
claude-4-sonnet
0
/4
158.2s
19.0
414,812
3,357
418,169
DeepSeek
deepseek-chat
0
/4
247.8s
21.0
342,572
2,556
345,128
Gemini
gemini-2-5-pro
0
/4
72.6s
5.0
36,326
2,281
38,607
OpenAI
gpt-5
0
/4
383.6s
18.5
300,534
21,464
321,998
Grok
grok-4
0
/4
-
-
-
-
-
MoonshotAI
k2
0
/4
161.4s
13.8
164,690
2,011
166,701
OpenAI
o3
0
/4
173.0s
19.0
260,133
10,886
271,019
Qwen
qwen-3-coder
0
/4
153.9s
20.3
412,836
3,227
416,062

Task State

Notion Workspace
This task is executed based on this Notion workspace
This workspace is cloned from notion official template marketplace.View Original Template

Instruction



Verify

*.py
Python
import sys
from notion_client import Client
from tasks.utils import notion_utils


def verify(notion: Client, main_id: str = None) -> bool:
    """
    Verifies that the new work history entry for 'Research Assistant' has been added correctly.
    """
    page_id = None
    if main_id:
        found_id, object_type = notion_utils.find_page_or_database_by_id(
            notion, main_id
        )
        if found_id and object_type == "page":
            page_id = found_id

    if not page_id:
        page_id = notion_utils.find_page(notion, "Online Resume")
    if not page_id:
        print("Error: Page 'Online Resume' not found.", file=sys.stderr)
        return False

    all_blocks = notion_utils.get_all_blocks_recursively(notion, page_id)

    def find_image_url_under_heading(blocks, heading_text, notion_client):
        heading_index = -1
        for i, block in enumerate(blocks):
            block_type = block.get("type")
            if block_type == "heading_1":
                if heading_text in notion_utils.get_block_plain_text(block):
                    heading_index = i
                    break

        if heading_index == -1:
            return None

        for i in range(heading_index + 1, len(blocks)):
            block = blocks[i]
            if block.get("type") in ["heading_1", "heading_2", "heading_3"]:
                break
            if block.get("type") == "image" and block.get("image", {}).get("file"):
                return block.get("image", {}).get("file", {}).get("url")
            if block.get("type") == "column_list":
                column_list_id = block["id"]
                columns = notion_utils.get_all_blocks_recursively(
                    notion_client, column_list_id
                )
                for column in columns:
                    if column.get("type") == "column":
                        column_id = column["id"]
                        column_blocks = notion_utils.get_all_blocks_recursively(
                            notion_client, column_id
                        )
                        for inner_block in column_blocks:
                            if inner_block.get("type") == "image" and inner_block.get(
                                "image", {}
                            ).get("file"):
                                return (
                                    inner_block.get("image", {})
                                    .get("file", {})
                                    .get("url")
                                )
        return None

    def get_block_annotations(block):
        block_type = block.get("type")
        if not block_type:
            return {}
        block_content = block.get(block_type)
        if not block_content:
            return {}
        rich_text_list = block_content.get("rich_text", [])
        if not rich_text_list:
            return {}
        return rich_text_list[0].get("annotations", {})

    education_image_url = find_image_url_under_heading(all_blocks, "Education", notion)
    if not education_image_url:
        print(
            "Error: Could not find the image in the 'Education' section.",
            file=sys.stderr,
        )
        return False

    heading_text = "Work History"
    heading_index = -1
    for i, block in enumerate(all_blocks):
        if block.get(
            "type"
        ) == "heading_1" and heading_text in notion_utils.get_block_plain_text(block):
            heading_index = i
            break

    if heading_index == -1:
        print(f"Error: Could not find the '{heading_text}' heading.", file=sys.stderr)
        return False

    for i in range(heading_index + 1, len(all_blocks)):
        block = all_blocks[i]
        if block.get("type") in ["heading_1", "heading_2", "heading_3"]:
            break

        if block.get("type") == "column_list":
            column_list_id = block["id"]
            columns = notion_utils.get_all_blocks_recursively(notion, column_list_id)
            if len(columns) < 2:
                continue

            for column in columns:
                if column.get("type") == "column":
                    if column.get("column", {}).get("width_ratio") == 0.125:
                        image_column = column
                    elif column.get("column", {}).get("width_ratio") == 0.875:
                        text_column = column

            image_column_blocks = notion_utils.get_all_blocks_recursively(
                notion, image_column["id"]
            )
            text_column_blocks = notion_utils.get_all_blocks_recursively(
                notion, text_column["id"]
            )

            column_image_url = None
            for inner_block in image_column_blocks:
                if inner_block.get("type") == "image" and inner_block.get(
                    "image", {}
                ).get("file"):
                    column_image_url = (
                        inner_block.get("image", {}).get("file", {}).get("url")
                    )
                    break

            if (
                not column_image_url
                or column_image_url[:100] != education_image_url[:100]
            ):
                continue

            for j, inner_block in enumerate(text_column_blocks):
                if "Research Assistant" in notion_utils.get_block_plain_text(
                    inner_block
                ):
                    title_annotations = get_block_annotations(inner_block)
                    if j + 2 < len(text_column_blocks):
                        date_block = text_column_blocks[j + 1]
                        description_block = text_column_blocks[j + 2]

                        date_text = "January - August 2023"
                        description_text = "Assisted in conducting user experience research projects at my bachelor’s program, supporting data collection, analyzing user feedback, and preparing research reports. Developed strong skills in research methodologies and improved collaboration with interdisciplinary teams."

                        date_annotations = get_block_annotations(date_block)
                        description_annotations = get_block_annotations(
                            description_block
                        )

                        if (
                            date_text in notion_utils.get_block_plain_text(date_block)
                            and description_text
                            in notion_utils.get_block_plain_text(description_block)
                            and title_annotations.get("bold")
                            and date_annotations.get("italic")
                            and date_annotations.get("color") == "gray"
                            and description_annotations.get("color") == "default"
                            and description_annotations.get("italic") != True
                            and description_annotations.get("bold") != True
                        ):
                            print("Success: Verified new work history entry.")
                            return True

    print("Failure: Could not verify the new work history entry.", file=sys.stderr)
    return False


def main():
    """
    Executes the verification process and exits with a status code.
    """
    notion = notion_utils.get_notion_client()
    main_id = sys.argv[1] if len(sys.argv) > 1 else None
    if verify(notion, main_id):
        sys.exit(0)
    else:
        sys.exit(1)


if __name__ == "__main__":
    main()