SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2604.19572 · 2026

A Self-Evolving Framework for Efficient Terminal Agents via Observational Context Compression

Wei Zhang, Hkust, Jian Yang, Chenghua Lin, Yizhi Li, Ruibin Yuan, Riza Batista-Navarro, Siwei Wu, Kang Zhu, Boyu Feng, Jincheng Ren, Shu Xu

arXiv · PDF · Open in the Atlas

Code that ran

6 of 6 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; 1 honoured the contract we drafted, 2 violated it and 0 have no contract verdict; 3 failures of our instrument; 0 no recorded run), measured 2026-11-24; 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/2604.19572.json · badge: /api/ran/2604.19572.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
multimodal-art-projection/TACO canonical (classifier label)
classifier basis: census
6 ran · 0 no recorded run
FunctionStatusWhere it lives
compare_numeric Ran
ran, violated the contract we drafted
multimodal-art-projection/TACO/adapters/dabstep/scorer.py
code served (permissive licence) · get_code("de19ee7afd87e58d")
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 bool, 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 math

def compare_numeric(num1: float, num2: float) -> bool:
    if num1 == num2:
        return True
    if num1 < 1 and num2 < 1:
        return math.isclose(num1, num2, rel_tol=0.0001, abs_tol=0.0001)
    dec_places1 = len(str(num1).split('.')[-1]) if '.' in str(num1) else 0
    dec_places2 = len(str(num2).split('.')[-1]) if '.' in str(num2) else 0
    round_to = min(dec_places1, dec_places2)
    rounded1 = round(num1, round_to)
    rounded2 = round(num2, round_to)
    if rounded1 == rounded2:
        return True
    return math.isclose(num1, num2, rel_tol=0.0001, abs_tol=0.0001)

ARGS = {
    "num1": 3.14159,
    "num2": 3.14160,
}
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 bool, 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
extract_numeric Ran
ran, honoured the contract we drafted
multimodal-art-projection/TACO/adapters/dabstep/scorer.py
code served (permissive licence) · get_code("5b8eb1533af10264")
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 float, 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 re
from typing import Union

def extract_numeric(value: str) -> Union[float, None]:
    value = value.replace(',', '').replace('$', '')
    match = re.search('(\\d*\\.\\d+|\\d+\\.?\\d*)%?', value)
    if match:
        num_str = match.group(1)
        try:
            return float(num_str)
        except ValueError:
            return None
    return None


# Test cases for the extract_numeric function
ARGS = {
    'value': '1,234.56'
}
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 float, 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
get_task_category Ran
ran; our contract draft was wrong, not the code
multimodal-art-projection/TACO/adapters/bfcl/generate_parity_sample.py
code served (permissive licence) · get_code("62f29b2074bb2f0a")
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 torch
import numpy as np

# Construct arguments for get_task_category function
# The function takes a source_id string and extracts the task category

ARGS = {
    "source_id": "simple_python_0"
}

# Additional test cases to verify the function works correctly
test_cases = [
    "simple_python_0",
    "live_simple_0-0-0",
    "live_complex_task_1-2-3",
    "another_category_42",
    "no_number_suffix"
]
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — 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
is_numeric_with_commas Ran
ran, violated the contract we drafted
multimodal-art-projection/TACO/adapters/dabstep/scorer.py
code served (permissive licence) · get_code("a62495edc6f98b22")
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 bool, ndim 0, 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

def is_numeric_with_commas(value: str) -> bool:
    v = value.strip()
    pattern = '\n      ^\\$?\n      (?:\n         \\d{1,3}(?:,\\d{3})+(?:\\.\\d+)?\n       | \\d+[.,]\\d+\n      )\n      $\n    '
    return bool(re.match(pattern, v, re.VERBOSE))

ARGS = {
    "value": "$1,234.56"
}
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 bool, ndim 0, dtype family float — no output shape is stated: observe_signature.py could not observe it (import:TypeError)
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_task_ids_from_bfcl Ran
ran; our contract draft was wrong, not the code
multimodal-art-projection/TACO/adapters/bfcl/generate_parity_sample.py
code served (permissive licence) · get_code("8ee53879e7ca7e6c")
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 defaultdict. 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
from pathlib import Path
from collections import defaultdict
import tempfile
import os

# Create a temporary directory structure that mimics BFCL layout
temp_dir = tempfile.mkdtemp()
bfcl_root = Path(temp_dir)
data_dir = bfcl_root / 'bfcl_eval' / 'data'
data_dir.mkdir(parents=True, exist_ok=True)

# Create sample BFCL data files for a few categories
sample_data = {
    'simple_python': [
        {'id': 'simple_python_1', 'function': 'test_func_1'},
        {'id': 'simple_python_2', 'function': 'test_func_2'},
    ],
    'simple_java': [
        {'id': 'simple_java_1', 'function': 'test_func_3'},
    ],
    'parallel': [
        {'id': 'parallel_1', 'function': 'test_func_4'},
        {'id': 'parallel_2', 'function': 'test_func_5'},
        {'id': 'parallel_3', 'function': 'test_func_6'},
    ],
}

for category, entries in sample_data.items():
    data_file = data_dir / f'BFCL_v4_{category}.json'
    with open(data_file, 'w', encoding='utf-8') as f:
        for entry in entries:
            f.write(json.dumps(entry) + '\n')

ARGS = {
    'bfcl_root': bfcl_root,
}
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 defaultdict — a defaultdict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a defaultdict 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
stratified_sample Ran
ran; our contract draft was wrong, not the code
multimodal-art-projection/TACO/adapters/bfcl/generate_parity_sample.py
code served (permissive licence) · get_code("4b1bef41af5fc1d1")
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 random

RANDOM_SEED = 42

def stratified_sample(category_ids: dict[str, list[str]], sample_size: int, seed: int=RANDOM_SEED) -> list[str]:
    """
    Perform stratified random sampling across all categories.

    Args:
        category_ids: Dictionary of {category: list of task IDs}
        sample_size: Total number of samples to draw
        seed: Random seed for reproducibility

    Returns:
        List of sampled task IDs
    """
    random.seed(seed)
    total = sum((len(ids) for ids in category_ids.values()))
    sampled_ids = []
    for category, ids in category_ids.items():
        count = len(ids)
        category_sample_size = round(sample_size * count / total)
        if category_sample_size == 0 and count > 0:
            category_sample_size = 1
        category_samples = random.sample(ids, min(category_sample_size, count))
        sampled_ids.extend(category_samples)
    random.shuffle(sampled_ids)
    return sampled_ids


# Setup code
ARGS = {
    "category_ids": {
        "category_a": ["task_1", "task_2", "task_3", "task_4"],
        "category_b": ["task_5", "task_6", "task_7"],
        "category_c": ["task_8", "task_9"]
    },
    "sample_size": 5,
    "seed": 42
}
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

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 distinct functions with an identity, 6 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 6 later) and 0 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.

FunctionAlso present inEarliest-datedOthers named
compare_numeric 2 other papers
2 later
2605.26457 (2026-05)
Verus-SpecGym: An Agentic Environment for Evaluating Specification Autoformalization
2609.14857 (2026-09)
MODULARRSI: MODULAR AND GENERALIZABLE RE-CURSIVE HARNESS SELF-IMPROVEMENT
extract_numeric 2 other papers
2 later
2605.26457 (2026-05)
Verus-SpecGym: An Agentic Environment for Evaluating Specification Autoformalization
2609.14857 (2026-09)
MODULARRSI: MODULAR AND GENERALIZABLE RE-CURSIVE HARNESS SELF-IMPROVEMENT
is_numeric_with_commas 2 other papers
2 later
2605.26457 (2026-05)
Verus-SpecGym: An Agentic Environment for Evaluating Specification Autoformalization
2609.14857 (2026-09)
MODULARRSI: MODULAR AND GENERALIZABLE RE-CURSIVE HARNESS SELF-IMPROVEMENT
get_task_category 1 other paper
1 later
2609.14857 (2026-09)
MODULARRSI: MODULAR AND GENERALIZABLE RE-CURSIVE HARNESS SELF-IMPROVEMENT
load_task_ids_from_bfcl 1 other paper
1 later
2609.14857 (2026-09)
MODULARRSI: MODULAR AND GENERALIZABLE RE-CURSIVE HARNESS SELF-IMPROVEMENT
stratified_sample 1 other paper
1 later
2609.14857 (2026-09)
MODULARRSI: MODULAR AND GENERALIZABLE RE-CURSIVE HARNESS SELF-IMPROVEMENT

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-24.

Repositories linked to this paper

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

Abstract

Terminal observations are not ordinary long-context text: they are heterogeneous, low-information-density execution traces in which sparse but exact evidence (e.g., error messages and file paths) is interleaved with large amounts of redundant terminal output. For long-horizon CLI agents, retaining raw observations rapidly increases context cost and can dilute critical signals, while LLM-based summarization or fixed heuristics often fail to adapt across heterogeneous terminal tasks and may discard precise task-relevant evidence. We propose TACO, the first selfevolving Terminal Agent Compression framework, which treats compression rules as reusable, preservation-aware knowledge acquired from interaction trajectories. Rather than relying on manually designed rules, static pruning, or task-specific compressor training, TACO autonomously discovers, refines, and reuses structured compression rules from agent interaction trajectories. Our global rule pool mechanism accumulates effective rules across tasks, while intra-task rule evolution adapts them online to the current workflow. This allows TACO to filter redundant terminal observations while preserving exact task-relevant evidence. Across six benchmarks, including TB 1.0, TB 2.0, SWE-Bench Lite, CompileBench, DevEval, and CRUST-Bench, TACO consistently maintains or improves task success across models and agent scaffolds. On TerminalBench, TACO yields 1%-4% absolute accuracy gains under standard evaluation and improves accuracy by 2%-3% under matched token budgets. On downstream benchmarks, it reduces total token consumption by 12%-27% while maintaining or improving task success. These results show that self-evolving observation compression can unlock latent capability in existing CLI agents by allocating context budget toward task-relevant evidence, without model fine-tuning or human-crafted compression rules. The code for TACO is available at https://github.com/multimodal-art-projection/TACO.git.

For agents

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

get_harvested_code_for_paper("2604.19572")
get_code_for_paper("2604.19572")
have("2604.19572")

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

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

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

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

Connect an agent — have() is free.