Component evidence

AnchorRule (extensions/anchors.py)

gitingest_bytedance_deer-flow · backend/packages/harness/deerflow/extensions/anchors.py · python · MIT
automation

Utility for resolving middleware insertion points based on semantic anchors.

Source preview first 800 characters · full source over MCP
# Source: https://github.com/bytedance/deer-flow | License: MIT | Copyright 2025 Bytedance Ltd. and/or its affiliates
# Provided via justclaw.it.com; keep this notice with the code.
"""Translating semantic placements into concrete stack indices.

This is the only module that knows the shape of DeerFlow's middleware stack.
Restructuring the stack means updating the anchor table here; extensions,
which declare only what they need to observe, stay untouched.
"""

from __future__ import annotations

from collections.abc import Sequence
from dataclasses import dataclass
from typing import Literal

_Side = Literal[
    "outer",
    "inner",
    "outer_last",
    "inner_last",
    "inner_last_after",
    "start",
    "end",
]


@dataclass(frozen=True)
class AnchorRule:
    """One attempt at locat

... (truncated -- full source via MCP)