AI Engineer World's Fair 2026:Loopcraft × Harness Engineering 定义 2026 AI 工程主线 · 干货攻略

  • 链接: https://www.latent.space/p/aiewf26trends
  • 分类: x-tips
  • 来源: X @swyx
  • 作者: Jay
  • 更新: 2026-09-25

这是什么

AI Engineer World's Fair(AIEWF)是全球规模最大的 AI 工程垂直会议,2026 年已于 6 月 29 日至 7 月 2 日在旧金山 Moscone West 举行。2026 年是分水岭:大会规模达 6,000+ 工程师、300 位演讲嘉宾、29 个分论坛、100+ 参展商——从三年前「AI Agent」仅占 1 个 track,膨胀到需要 9 个 track 才能容纳同等范围的讨论(来源:dev.to/hanzla)。

但 2026 年的 AIEWF 不是摊大饼——它有清晰的三日结构:Loopcraft → Verification → Harness Engineering。这三个词不是三个平行话题,而是一个架构的三个层次。


为什么值得关注

@swyx 的开场 Keynote:Loopcraft

AIEWF 联合创始人 swyx 在首日发表了开场演讲 "Loopcraft: The Art of Stacking Loops",将 AI 工程的演进路径总结为:

从 chat(对话),到 tools(工具调用),到 goals(目标导向),再到 automations(自动化),最后到 persistent loops(持久循环)。

「Loopcraft」成为首日出现频率最高的词汇——Latent.Space 日报用「Loops, loops and more loops」来形容当天的讨论氛围。Geoffrey Huntley 在会上提出了 now-canonical 的观点:"everything is a ralph loop"——一切皆循环,循环即工程。

Software Factories track 围绕「持久 agent loop 持续运行并对照 spec 检查」这一场景构建全日议程,标志行业已从「单次 prompt-response」范式迁移到「持续运行、可观测、有边界的 agent 系统」。

中场转折:Verification Gap

第二个工作日,数据揭示了行业的核心矛盾:

  • Greptile 数据显示:AI 生成的代码已占合并 PR 的 27.6%(十四个月前还不到 1%)
  • Sonar 披露:其中约 48% 在合并前经过了显式人工审查

生成速度已经远超审查速度——这个缺口必须由基础设施(而非人工警惕)来填补。

闭幕 Keynote:Harness Engineering

第三日闭幕 keynote 由 Anthropic Labs 联合负责人 Mike Krieger 领衔,主题正是 Harness Engineering。Coverage 将整场大会四天的债务总结为:「通过基础设施和治理来偿还」。Krieger 的构建哲学被总结为一个词:"frontier-far"——做离前沿足够远的事。


核验过程

官方来源

  1. Latent.Space ——「5 Trends That Defined AI Engineering at World's Fair 2026」:swyx 官方渠道发布的综述,覆盖大会首日 Loopcraft 主题、中间 Verification Gap 数据、闭幕 Harness Engineering;是本攻略的核心引用源。

  2. Lilian Weng Blog(lilianweng.github.io/posts/2026-07-04-harness)——「Harness Engineering for Self-Improvement」(Jul 2026):Lilian Weng 距 2023 年经典博文「LLM Powered Autonomous Agents」三年后的续篇,系统性梳理了 harness 的定义、设计模式和 RSI 路径;AIEWF 2026 闭幕 keynote 直接引用此框架。

  3. TrueFoundry 复盘文(truefoundry.com/blog/aiewf-2026-loops-harness-engineering):独立第三方工程视角,对大会三日弧线(loops → verification → harness)做了架构级解读,并提供了「Harness = bounded + verified + recorded by construction」的核心操作化定义。

  4. AIEWF 官方 schedule(ai.engineer/worldsfair/schedule):公开可查,列明 Mike Krieger 的 Anthropic Labs 日程安排。

交叉验证结论

数据点 原帖主张 官方/第三方来源 核验结论
6,000+ engineers Latent.Space / swyx AI21 Labs、Atlan 均独立引用同一数字 ✅ 确认为官方数据
300 speakers / 29 tracks Latent.Space AI21 Labs 官网同引 ✅ 确认
100+ expo partners Latent.Space 同上 ✅ 确认
AI-generated PR: 27.6% Latent.Space 引 Greptile 数据 原文描述为"Greptile's dataset showed",TrueFoundry 复述同引 ✅ 确认为会上公布数据
48% explicitly reviewed Latent.Space 引 Sonar 数据 TrueFoundry 复述同引 ✅ 确认为会上公布数据
"Everything is a ralph loop" Latent.Space 引 Geoffrey Huntley 仅 Latent.Space 单源标注为"now-canonical claim" ⚠️ 引用为社群观点,标记为原帖主张
Krieger "build frontier-far" Latent.Space 引 chatforest.com coverage 仅单一来源引用 ⚠️ 引用为二手报道,标注为原帖主张
Lilian Weng 31 min 阅读时间 Weng 博文元数据 Web fetch 确认 ✅ 确认

Lilian Weng:Harness Engineering 三大设计模式

Lilian Weng 在 2026 年 7 月的博文中系统化定义了 harness——「围绕基础模型的系统,负责编排执行、决定模型如何思考和规划、调用工具和行动、感知和管理上下文、存储产物、评估结果」。这与成功产品(如 Claude Code、Codex)的实际架构完全吻合。

她在文中归纳了三个核心设计模式:

Pattern 1: Workflow Automation(工作流自动化)

定义模型可以操作、测试和迭代的工作流。标准循环为:plan → execute → observe/test → improve,循环直到目标达成。典型参考:Karpathy 的 autoresearch repo。

关键洞见:模型通过「agent runtime」(而非静态 prompt 模板)来分析自己的轨迹和失败案例,并在运行时迭代进展。

Pattern 2: File System as Persistent Memory(文件系统作为持久记忆)

Harness 不应将所有工作流和日志塞进上下文,而应将丰富状态和产物保持在文件中。长期 agent 运行产生的 artifact(实验日志、代码 diff、论文摘要、错误栈、过往 rollout 轨迹)往往远超过模型训练时使用的上下文窗口长度。

文件管理(读、写、编辑)本身就是 LLM 的基础技能,用简单文件形式管理持久记忆可以自然受益于模型能力的提升。

Pattern 3: Sub-agent and Backend Jobs(子 Agent 与后端任务)

Harness 可以并行生成多个子 agent 来执行,并监控后端任务。当主 agent 需要搜索多个假设、并发运行实验或将孤立子任务委托出去而不污染主上下文时,此模式尤其有用。

核心设计原则:让并行性显式且可检查。如果子 agent 输出只存在于瞬时聊天上下文中,它们很快就会变得过时和隐藏。如果以文件、日志和状态记录的形式存储,模型可以在中断后恢复并对自己的执行历史进行推理。


上手步骤:如何构建你的第一个 Harness

以下是基于 Lilian Weng 三模式和 AIEWF 2026 最佳实践提炼的操作路线。

Step 1:建立最小 Plan-Execute-Observe 循环

import subprocess
from typing import Literal

def run_harness_loop(task: str, max_steps: int = 10):
    """Minimal harness loop: plan -> execute -> observe -> improve"""
    state = {"task": task, "history": [], "iterations": 0}

    for i in range(max_steps):
        # 1. Plan: model decides next action
        plan = model.generate_plan(state)

        # 2. Execute: run the planned action
        result = execute_action(plan, state)

        # 3. Observe: get feedback
        observation = observe_result(result, state)

        # 4. Check: has goal been reached?
        if check_goal(observation, state):
            print(f"Goal reached in {i+1} steps")
            return observation

        # 5. Improve: update state for next iteration
        state = update_state(state, plan, result, observation)
        state["iterations"] += 1

    print(f"Max steps ({max_steps}) reached")
    return state["history"]

Step 2:引入文件系统持久化

import json
from pathlib import Path

class HarnessState:
    def __init__(self, session_dir: str):
        self.session_dir = Path(session_dir)
        self.session_dir.mkdir(parents=True, exist_ok=True)
        self.log_file = self.session_dir / "rollout_log.jsonl"
        self.memory_file = self.session_dir / "persistent_memory.md"

    def save_step(self, step_data: dict):
        """Append step to durable log"""
        with open(self.log_file, "a") as f:
            f.write(json.dumps(step_data) + "\n")

    def load_memory(self) -> str:
        """Read persistent memory file"""
        if self.memory_file.exists():
            return self.memory_file.read_text()
        return ""

    def update_memory(self, new_content: str):
        """Write updated memory"""
        self.memory_file.write_text(new_content)

Step 3:设置 Verification Gate(对应 Verification Gap)

AIEWF 2026 的核心警示:生成 > 审查,必须用机器替代人工 vigilance。

def verification_gate(
    output: str,
    eval_prompt: str,
    threshold: float = 0.8
) -> bool:
    """
    Automated verification before commit.
    Addresses AIEWF 2026's key insight: generation has 
    outrun review — the gap must be closed by infrastructure.
    """
    judge_response = model.evaluate(
        instruction=eval_prompt,
        output=output
    )
    score = parse_score(judge_response)  # 0.0 - 1.0

    if score < threshold:
        raise VerificationFailedError(
            f"Output score {score:.2f} below threshold {threshold}"
        )
    return True

Step 4:引入子 Agent 并行化

from concurrent.futures import ThreadPoolExecutor

def parallel_search(harness, queries: list[str], max_workers: int = 4):
    """Spawn sub-agents to test multiple hypotheses in parallel"""
    results = []

    with ThreadPoolExecutor(max_workers=max_workers) as executor:
        futures = {
            executor.submit(search_and_synthesize, q, harness): q 
            for q in queries
        }

        for future in futures.as_completed(futures):
            query = futures[future]
            try:
                result = future.result()
                results.append(result)
                harness.state.save_step({
                    "type": "subagent_result",
                    "query": query,
                    "result": result
                })
            except Exception as e:
                harness.state.save_step({
                    "type": "subagent_error",
                    "query": query,
                    "error": str(e)
                })

    return merge_results(results)

Step 5:定义 Bounding(边界约束)

HARNESS_CONFIG = {
    "max_steps": 20,          # Step ceiling — bounds worst case in dollars
    "max_tokens_per_step": 4096,
    "stall_detection": {
        "no_progress_threshold": 3,  # Consecutive steps without improvement
        "action": "interrupt_and_alert"
    },
    "budget": {
        "max_cost_cents": 500,
        "track_per_step": True
    },
    "verification": {
        "enabled": True,
        "threshold": 0.8,
        "fail_on_reject": True
    }
}

坑与适用边界

⚠️ Harness 不会让弱模型变强

这是 AIEWF 2026 和 Lilian Weng 双重强调的边界:Harness 改变的是失败经济学,不是消除失败。一个设计再好的 harness 也无法弥补基础模型能力不足或任务分解错误的问题。Harness 的价值在于:让确定的失败更快、更便宜、更可观测。

⚠️ Loop 堆叠的风险:Token Bonfire

swyx 提出了「Loopcraft」的概念,但 AIEWF 2026 也直接点出了代价:堆叠循环(stacked loops)如果缺乏 step ceilings、budget controls 和 stall detection,会从「智能系统」变成「烧钱机器」。AIEWF 2026 TrueFoundry 复盘文的原话:「a stacked loop has a worst case measured in dollars and pages rather than invoices」——最坏情况下按页数和美元计费。

⚠️ Verification Gap 的规模还在扩大

27.6% → 48% 的比例意味着超过一半的 AI 生成代码处于无审查状态进入代码库。48% 这个数字本身也不意味着安全——它只是「显式审查」,不保证「有效审查」。Review debt 正在成为 AI 工程团队的隐性技术债。

适用边界

  • 适用:多步骤任务、需要多次试错的长程任务、需要并发探索的场景、需要在中断后恢复的工作流
  • 不适用:简单的一次性任务(harness 开销大于收益)、对延迟敏感的实时响应、需要强确定性的安全关键系统

一句话结论

AIEWF 2026 确认了 2026 年 AI 工程的主线:模型不再是产品,harness 才是——Loopcraft 定义如何让 agent 持续运转,Harness Engineering 定义如何让运转可信、可观测、可持续,而 Verification Gap 的量化数据(27.6% AI-PR + 48% review rate)让这个转变从口号变成了工程债务。