SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2606.26979 · 2026

How Much Static Structure Do Code Agents Need? A Study of Deterministic Anchoring

Li Li, Zhihao Lin, Mingyi Zhou, Yizhuo Yang, China Zhou

arXiv · PDF · Open in the Atlas

Code that ran

8 of 9 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 8 failures of our instrument; 1 no recorded run), measured 2026-11-23; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2606.26979.json · badge: /api/ran/2606.26979.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
mathieu0905/Code-Anchor canonical (classifier label)
classifier basis: census
8 ran · 1 no recorded run
FunctionStatusWhere it lives
div_no_nan Ran
ran; our contract draft was wrong, not the code
mathieu0905/Code-Anchor/evaluation/eval_metric.py
code served (permissive licence) · get_code("a301f8315a11f4f5")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Construct small tensors for the division operation
a = torch.tensor([[1.0, 2.0, 3.0, 4.0],
                   [5.0, 6.0, 7.0, 8.0]])

b = torch.tensor([[2.0, 2.0, 0.0, 4.0],
                   [0.0, 3.0, 7.0, 0.0]])

na_value = 0.0

ARGS = {
    "a": a,
    "b": b,
    "na_value": na_value
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
extract_visited_files_from_trace Ran
ran; our contract draft was wrong, not the code
mathieu0905/Code-Anchor/evaluation/compute_lexical_similarity.py
code served (permissive licence) · get_code("afb4a5c9b5c17839")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import json
import tempfile
from pathlib import Path

# Create a temporary trace file with valid JSON lines containing sed and rg commands
with tempfile.NamedTemporaryFile(mode='w', suffix='.jsonl', delete=False) as f:
    trace_file_path = Path(f.name)
    
    # Write valid trace events with sed command
    event1 = {
        'type': 'item.completed',
        'item': {
            'type': 'command_execution',
            'command': 'sed -n "1,10p" /path/to/file1.py'
        }
    }
    f.write(json.dumps(event1) + '\n')
    
    # Write valid trace events with rg command
    event2 = {
        'type': 'item.completed',
        'item': {
            'type': 'command_execution',
            'command': 'rg pattern src/module/file2.py'
        }
    }
    f.write(json.dumps(event2) + '\n')
    
    # Write another sed command with different file
    event3 = {
        'type': 'item.completed',
        'item': {
            'type': 'command_execution',
            'command': 'sed -n "5,15p" utils/helper.py'
        }
    }
    f.write(json.dumps(event3) + '\n')
    
    # Write duplicate file to test deduplication
    event4 = {
        'type': 'item.completed',
        'item': {
            'type': 'command_execution',
            'command': 'sed -n "1,10p" /path/to/file1.py'
        }
    }
    f.write(json.dumps(event4) + '\n')
    
    # Write invalid JSON line (should be skipped)
    f.write('invalid json line\n')
    
    # Write event with non-command_execution type (should be skipped)
    event5 = {
        'type': 'item.completed',
        'item': {
            'type': 'other_type',
            'command': 'sed -n "1p" ignored.py'
        }
    }
    f.write(json.dumps(event5) + '\n')

ARGS = {
    'trace_path': trace_file_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
load_jsonl Ran
ran; our contract draft was wrong, not the code
mathieu0905/Code-Anchor/evaluation/eval_metric.py
code served (permissive licence) · get_code("846475125bc11ceb")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import json
import tempfile
import os

# Create a temporary JSONL file with valid JSON lines
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, "test.jsonl")

# Write valid JSONL data
with open(temp_file, 'w', encoding='utf-8') as f:
    f.write(json.dumps({"key": "value1"}) + "\n")
    f.write(json.dumps({"key": "value2"}) + "\n")
    f.write("\n")  # blank line to test stripping
    f.write(json.dumps({"key": "value3"}) + "\n")

ARGS = {
    "path": temp_file
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
load_locbench_ground_truth Ran
ran; our contract draft was wrong, not the code
mathieu0905/Code-Anchor/evaluation/eval_localization_codex.py
code served (permissive licence) · get_code("b8d85cb28670acef")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import tempfile
from pathlib import Path

# Create a temporary JSONL file with test data
temp_dir = tempfile.TemporaryDirectory()
temp_path = Path(temp_dir.name) / "test_ground_truth.jsonl"

# Write test JSONL data
with open(temp_path, 'w') as f:
    f.write('{"instance_id": "instance_1", "edit_functions": ["src/module.py:MyClass.method", "src/utils.py:helper_func"], "gt_modules": ["src/module.py:MyClass", "src/utils.py:helper"]}\n')
    f.write('{"instance_id": "instance_2", "edit_functions": ["tests/test_file.py:test_case"], "gt_modules": []}\n')
    f.write('{"instance_id": "instance_3", "edit_functions": [{"path": "lib/core.py", "name": "CoreModule"}], "gt_modules": [{"path": "lib/core.py", "symbol": "Core"}]}\n')

ARGS = {
    "path": temp_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
load_predictions Ran
ran; our contract draft was wrong, not the code
mathieu0905/Code-Anchor/evaluation/eval_localization_codex.py
code served (permissive licence) · get_code("31ac00a4e3cb419d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import json
import tempfile
from pathlib import Path

# Create temporary directory and JSONL files for testing
temp_dir = tempfile.mkdtemp()
temp_path = Path(temp_dir)

# Create a sample JSONL file with prediction records
jsonl_file = temp_path / "predictions.jsonl"
with open(jsonl_file, 'w') as f:
    # Write sample records
    f.write(json.dumps({
        "instance_id": "test_instance_1",
        "found_files": ["src/module.py", "tests/test.py"],
        "found_modules": ["src/module.py:MyClass", "tests/test.py:TestClass"],
        "found_functions": ["src/module.py:MyClass.method", "src/module.py:helper_func"]
    }) + "\n")
    f.write(json.dumps({
        "instance_id": "test_instance_2",
        "found_files": ["lib/utils.py"],
        "found_modules": ["lib/utils.py:Utils"],
        "found_functions": ["lib/utils.py:Utils.process"]
    }) + "\n")

ARGS = {
    "pred_path": jsonl_file
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
normalized_dcg Ran
ran; our contract draft was wrong, not the code
mathieu0905/Code-Anchor/evaluation/eval_metric.py
code served (permissive licence) · get_code("86ce1ffed536db24")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Create small tensors for normalized_dcg
# pred_target and ideal_target should be 2D tensors with shape (batch_size, k)
# Using batch_size=2, k=4 for small tensors
batch_size = 2
k = 4

# Create pred_target: predicted relevance scores
# Values between 0 and 1, representing relevance predictions
pred_target = torch.tensor([
    [1.0, 0.8, 0.6, 0.4],
    [0.9, 0.7, 0.5, 0.3]
], dtype=torch.float32)

# Create ideal_target: ideal relevance scores (for DCG normalization)
# Usually sorted in descending order
ideal_target = torch.tensor([
    [1.0, 0.8, 0.6, 0.4],
    [1.0, 0.9, 0.7, 0.5]
], dtype=torch.float32)

ARGS = {
    "pred_target": pred_target,
    "ideal_target": ideal_target,
    "k": k
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
read_file_content Ran
ran; our contract draft was wrong, not the code
mathieu0905/Code-Anchor/evaluation/compute_lexical_similarity.py
code served (permissive licence) · get_code("7d9ea0c9038abad2")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import tempfile
from pathlib import Path

# Create a temporary directory with a test file
temp_dir = tempfile.mkdtemp()
repo_path = Path(temp_dir)

# Create a test file
test_file = repo_path / "test.txt"
test_file.write_text("Hello, World!")

# Define arguments for the function
ARGS = {
    "repo_path": repo_path,
    "filepath": "test.txt"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
tokenize Ran
ran; our contract draft was wrong, not the code
mathieu0905/Code-Anchor/evaluation/compute_lexical_similarity.py
code served (permissive licence) · get_code("0ec01bca2dc31602")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import re
from typing import List, Dict, Tuple, Set

def tokenize(text: str) -> List[str]:
    """Simple tokenization: split on whitespace and punctuation."""
    text = re.sub('#.*', '', text)
    text = re.sub('""".*?"""', '', text, flags=re.DOTALL)
    text = re.sub("'''.*?'''", '', text, flags=re.DOTALL)
    text = re.sub('"[^"]*"', '', text)
    text = re.sub("'[^']*'", '', text)
    tokens = re.findall('\\b[a-zA-Z_][a-zA-Z0-9_]*\\b', text.lower())
    return tokens


ARGS = {
    "text": "Hello world, this is a test string! It contains # comments and 'quoted strings'."
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
read_jsonl Not yet run
unverified (harvested, no recorded run)
mathieu0905/Code-Anchor/evaluation/eval_localization_codex.py
code served (permissive licence) · get_code("14b1625bd8d3d013")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 9 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

LLM-based code agents navigate repositories through keyword search but miss the structural relationships, such as call graphs, inheritance hierarchies, and configuration dependencies, that define how software actually works. This makes agent navigation stochastic and difficult to reproduce across runs. We investigate whether lightweight static analysis can provide deterministic anchors for these agents: stable structural facts injected as plain-text comments that constrain probabilistic exploration and make navigation more predictable. Starting from a strong baseline, Codex from OpenAI, we systematically inject varying granularities of structural annotations and measure their effects on localization, trajectory behavior, and run-to-run stability. Our study identifies what we call the deterministic anchoring effect: static structure helps less by making agents "smarter" and more by making their navigation disciplined and reproducible. Three observations support this finding: ❶ Anchoring works: lightweight call/inheritance topology improves function-level localization (+2.2pp Func@5) and shortens trajectories (-1.6 interaction rounds); ❷ Anchoring is scalesensitive: the optimal granularity and directionality depend on repository characteristics, where denser semantics show diminishing returns and hub-heavy projects benefit from inverse-only links that expose "who-calls-me" without forward edges; ❸ Anchoring stabilizes: tags raise link-following rate from 0.15-0.18 to 0.21-0.24, roughly halve run-to-run variance, and improve single-run reliability (Pass@1 +3.4 pp) on medium-scale repositories, at the cost of roughly 10% more input tokens. These observations suggest practical guidelines: default to lightweight topology on medium projects, prune forward edges in large repositories, and reserve dense tags for implicit-dependency cases. Code and traces are available in our repository: https://github.com/mathieu0905/Code-Anchor.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2606.26979")
get_code_for_paper("2606.26979")
have("2606.26979")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2606.26979.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2606.26979.svg)](https://syntology.ai/paper/2606.26979)

Connect an agent — have() is free.