Projects Section Update

L3
ModelContextProtocolNotionOnline Resume

Reorganize the projects section by removing outdated projects and adding new relevant work with proper formatting.

Created by Xiangyan Liu
2025-07-27
Database ManipulationTemplate PopulationData AggregationVisual FormattingCross Reference Linking

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
OpenAI
gpt-5
3
/4
569.2s
14.0
311,010
27,836
338,845
OpenAI
o3
2
/4
212.2s
15.5
280,475
6,985
287,460
Claude
claude-4-1-opus
1
/1
--
181.7s
16.0
847,570
2,903
850,473
Claude
claude-4-sonnet
1
/4
210.7s
17.5
583,172
3,572
586,744
DeepSeek
deepseek-chat
0
/4
201.9s
18.0
415,685
1,633
417,318
Gemini
gemini-2-5-pro
0
/4
114.1s
10.8
165,226
7,414
172,640
Grok
grok-4
0
/4
-
-
-
-
-
MoonshotAI
k2
0
/4
156.0s
16.8
332,573
1,673
334,246
Qwen
qwen-3-coder
0
/4
137.9s
20.0
561,806
2,513
564,319

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 projects section has been reorganized correctly with cross-section references.
    """
    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

    # Find the Projects database
    projects_db_id = notion_utils.find_database_in_block(notion, page_id, "Projects")
    if not projects_db_id:
        print("Error: Database 'Projects' not found.", file=sys.stderr)
        return False

    # Find the Skills database to get the highest skill level
    skills_db_id = notion_utils.find_database_in_block(notion, page_id, "Skills")
    if not skills_db_id:
        print("Error: Database 'Skills' not found.", file=sys.stderr)
        return False

    # Query Skills database to find the highest skill level
    skills_results = notion.databases.query(database_id=skills_db_id).get("results", [])
    highest_skill_name = ""
    highest_skill_level = 0

    for skill_page in skills_results:
        properties = skill_page.get("properties", {})
        skill_name_prop = properties.get("Skill", {}).get("title", [])
        skill_level_prop = properties.get("Skill Level", {}).get("number")

        if skill_name_prop and skill_level_prop is not None:
            skill_name = skill_name_prop[0].get("text", {}).get("content", "")
            if skill_level_prop > highest_skill_level:
                highest_skill_level = skill_level_prop
                highest_skill_name = skill_name

    if not highest_skill_name:
        print("Error: Could not find any skills with skill levels.", file=sys.stderr)
        return False

    # Query Projects database
    projects_results = notion.databases.query(database_id=projects_db_id).get(
        "results", []
    )

    # Check that "Knitties eComm Website" is deleted
    for page in projects_results:
        properties = page.get("properties", {})
        name_prop = properties.get("Name", {}).get("title", [])
        if (
            name_prop
            and name_prop[0].get("text", {}).get("content") == "Knitties eComm Website"
        ):
            print(
                "Failure: 'Knitties eComm Website' project was not deleted.",
                file=sys.stderr,
            )
            return False

    # Check that "Zapier Dashboard Redesign" exists with correct properties
    zapier_project_found = False
    for page in projects_results:
        properties = page.get("properties", {})
        name_prop = properties.get("Name", {}).get("title", [])
        if (
            name_prop
            and name_prop[0].get("text", {}).get("content")
            == "Zapier Dashboard Redesign"
        ):
            zapier_project_found = True

            # Check description contains reference to UI Design Internship
            desc_prop = properties.get("Description", {}).get("rich_text", [])
            if not desc_prop:
                print("Failure: Zapier project has no description.", file=sys.stderr)
                return False

            description_text = desc_prop[0].get("text", {}).get("content", "")
            base_desc = "Led the complete redesign of Zapier's main dashboard, focusing on improved usability and modern design patterns. Implemented new navigation system and responsive layouts."
            if base_desc not in description_text:
                print(
                    "Failure: Zapier project description is missing base content.",
                    file=sys.stderr,
                )
                return False

            # Check date
            date_prop = properties.get("Date", {}).get("date", {})
            if (
                not date_prop
                or date_prop.get("start") != "2024-01-01"
                or date_prop.get("end") != "2024-06-30"
            ):
                print(
                    "Failure: Zapier project date range is incorrect.", file=sys.stderr
                )
                return False

            # Check tags
            tags_prop = properties.get("Tags", {}).get("multi_select", [])
            tag_names = {tag.get("name") for tag in tags_prop}
            if "UI Design" not in tag_names or "Enterprise" not in tag_names:
                print(
                    "Failure: Zapier project is missing required tags.", file=sys.stderr
                )
                return False

            # Check phone
            phone_prop = properties.get("Phone", {}).get("phone_number", [])
            if not phone_prop or phone_prop != "+44 7871263013":
                print(
                    "Failure: Zapier project phone number is incorrect.",
                    file=sys.stderr,
                )
                return

            # Check url
            url_prop = properties.get("Url", {}).get("url", [])
            if not url_prop or url_prop != "www.zinenwine.com":
                print("Failure: Zapier project url is incorrect.", file=sys.stderr)
                return

            # Check Enterprise tag color
            enterprise_tag_purple = False
            for tag in tags_prop:
                if tag.get("name") == "Enterprise" and tag.get("color") == "purple":
                    enterprise_tag_purple = True
                    break
            if not enterprise_tag_purple:
                print(
                    "Failure: Enterprise tag does not have purple color.",
                    file=sys.stderr,
                )
                return False

            break

    if not zapier_project_found:
        print(
            "Failure: 'Zapier Dashboard Redesign' project not found.", file=sys.stderr
        )
        return False

    # Find the Projects database block and verify blocks after it
    all_blocks = notion_utils.get_all_blocks_recursively(notion, page_id)

    # Find the Projects database block
    projects_db_index = -1
    for i, block in enumerate(all_blocks):
        if (
            block.get("type") == "child_database"
            and block.get("child_database", {}).get("title") == "Projects"
        ):
            projects_db_index = i
            break

    if projects_db_index == -1:
        print("Error: Could not find Projects database block.", file=sys.stderr)
        return False

    # Check blocks after Projects database
    if projects_db_index + 3 > len(all_blocks):
        print("Failure: Not enough blocks after Projects database.", file=sys.stderr)
        return False

    # Check divider block
    divider_block = all_blocks[projects_db_index + 1]
    if divider_block.get("type") != "divider":
        print(
            "Failure: Expected divider block after Projects database.", file=sys.stderr
        )
        return False

    # Check heading block
    heading_block = all_blocks[projects_db_index + 2]
    if heading_block.get("type") != "heading_2":
        print("Failure: Expected heading_2 block after divider.", file=sys.stderr)
        return False

    heading_text = heading_block.get("heading_2", {}).get("rich_text", [])
    if (
        not heading_text
        or heading_text[0].get("text", {}).get("content") != "Current Focus"
    ):
        print("Failure: Heading text is incorrect.", file=sys.stderr)
        return False

    # Check paragraph block with dynamic skill reference
    paragraph_block = all_blocks[projects_db_index + 3]
    if paragraph_block.get("type") != "paragraph":
        print("Failure: Expected paragraph block after heading.", file=sys.stderr)
        return False

    paragraph_text = paragraph_block.get("paragraph", {}).get("rich_text", [])
    if not paragraph_text:
        print("Failure: Paragraph block is empty.", file=sys.stderr)
        return False

    paragraph_content = paragraph_text[0].get("text", {}).get("content", "")

    # Check that paragraph contains the base text
    base_text = "The Zapier Dashboard Redesign represents my most impactful recent work, leveraging my expertise in"
    if base_text not in paragraph_content:
        print("Failure: Paragraph does not contain base text.", file=sys.stderr)
        return False

    # Check that paragraph references the highest skill
    skill_level_percent = int(highest_skill_level * 100)
    expected_skill_ref = f"{highest_skill_name} ({skill_level_percent}%)"
    if expected_skill_ref not in paragraph_content:
        print(
            f"Failure: Paragraph does not reference highest skill '{expected_skill_ref}'.",
            file=sys.stderr,
        )
        return False

    # Check that paragraph contains the ending text
    ending_text = (
        "enterprise-grade solutions that prioritize both aesthetics and functionality"
    )
    if ending_text not in paragraph_content:
        print(
            "Failure: Paragraph does not contain proper ending text.", file=sys.stderr
        )
        return False

    print(
        f"Success: Projects section has been reorganized correctly with cross-section references (highest skill: {highest_skill_name} at {skill_level_percent}%)."
    )
    return True


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()