A software factory needs two models

Abstract

Generation models make candidate software. Verification models decide what can be trusted for delivery.

AI coding is changing the economics of software production. What used to require days of engineering time can now become a runnable interface, a repository-level patch, or a first test suite in a few hours. Coding agents can read a repository, plan a task, edit files, execute commands, and iterate against the feedback they receive.

One consequence is easy to miss: code is becoming cheaper, while trusted delivery remains expensive.

A demo that runs and a system that can be merged, released, and maintained with confidence are still different things. The second requires answers to harder questions:

  • Does the change satisfy the request, rather than merely pass a local test?
  • Did it preserve permissions, compatibility, performance, and existing boundaries?
  • Is the available evidence sufficient, and what else should be checked?
  • Did the fix solve the original problem without creating a new regression?
  • When the evidence is incomplete, should the system repair itself, block delivery, or ask for human review?

The destination of a Software Factory should not be “an agent generated code.” It should be “the system can continuously produce deliverables that people can trust.”

That requires two kinds of model capability: generation and verification.

A software factory needs quality control, not only a production line

A factory does not remove inspection, sampling, process control, or release procedures because it has faster machines. A Software Factory should be designed the same way.

The generation model turns a request into a candidate implementation. It analyzes the task, retrieves context, proposes an approach, changes code, calls tools, writes tests, and tries to complete the work. Its objective is to increase the probability that something useful gets made.

But a candidate implementation is not trusted delivery. The verification model decides whether there is enough evidence to release it, identifies missing evidence, chooses the next check, and sends structured feedback to the generation model. Its objective is not to produce more code. It is to increase the probability that the result can be trusted.

“Two models” does not mean every system must deploy two completely separate sets of weights. It describes two functions and responsibilities that should not be collapsed:

DimensionGeneration modelVerification model
Core taskGenerate candidate code and an execution planDecide whether the result is trustworthy, how to prove it, and how to repair it
Optimization targetTask completion and implementation speedRisk calibration, evidence sufficiency, and deliverability
Main inputsRequirements, repository, tool feedback, and prior contextCandidate change plus tests, CI, logs, defects, runtime results, and policy
Main outputsCode, configuration, commands, tests, and patchesShip / Block / Human Review, an evidence chain, a verification plan, and repair guidance
Key dataCode, tasks, and execution tracesVerification Trace: evidence, defects, repairs, regressions, and the final decision

The shortest version is:

The generation model asks, “Can we make it?” The verification model asks, “Can we trust it enough to deliver it?”

A stronger generation model does not automatically create trusted delivery

As models improve, it is natural to assume that a sufficiently capable generation model will eventually write, test, review, and approve its own work.

That is a useful engineering intuition, but it is not enough for production reliability.

First, a generation model works inside a candidate space. It has to propose a useful path with incomplete requirements, limited context, and a finite execution budget. Even when a patch passes the available tests, it may not have covered maintainability, ownership boundaries, migration cost, backward compatibility, production behavior, or the future debugging burden.

Software quality is also not a single metric. A change can be functionally correct but wrong about permissions. Tests can pass while compatibility is broken. Local performance can improve while observability gets worse. A fix can remove the current defect and create a later maintenance problem. A generation model may attempt verification, but its own confidence cannot substitute for independent evidence.

This is why “the task is complete” and “the problem is actually solved” must remain separate claims. A green test suite is evidence. It is not automatically a complete account of the real software problem.

A stronger generation model will improve the quality of candidates. It will not remove the need for verification. In fact, the longer the task and the more complex the system it can change, the more valuable an independent verification layer becomes.

A harness is necessary, but a harness is not a verification model

A harness is the infrastructure that lets AI coding become useful beyond a demo. It provides tools, a sandbox, code execution, tests, retrieval, version control, observability, and permission boundaries. Without a harness, a model can only say that it wrote the code correctly. With one, it can run the code, execute checks, observe logs, reproduce a failure, and receive external feedback.

But a harness produces and executes evidence. It does not automatically decide what the evidence means.

A passing test does not by itself prove that the requirement is satisfied. A clean static scan does not prove that there is no security risk. A green CI pipeline does not prove that the intended revision was actually tested. Higher coverage does not prove that the important business risk was covered.

The verification model should decide:

  1. Which evidence the task needs most;
  2. Whether the available evidence is sufficient;
  3. Whether different signals contradict one another;
  4. Whether the risk has crossed a blocking threshold;
  5. Which check to run next, or how the generation model should repair the change.

The more accurate architecture is:

The generation model proposes a candidate
        ↓
The harness runs tests, scans, simulations, and observations
        ↓
The verification model aggregates evidence, judges risk, and chooses the next step
        ↓
The generation model repairs or continues verification
        ↓
The system records an auditable delivery decision

The harness is the execution layer of verification. The verification model is the intelligent layer that controls quality and release.

Self-checking is useful, but it is not independent verification

There is no need to reject same-model self-checking. Asking a generation model to inspect its diff, add tests, and revise its work can improve a first draft. It should be the first line of defense in an AI coding workflow.

But “self-checking is useful” does not mean “self-checking can own production release.”

When generation and judgment depend on the same model, the same context, and the same early assumptions, they can share the same blind spots. The model may misunderstand a permission rule, miss an undocumented business constraint, or fail to notice a dependency change. Calling the same model again does not automatically create new runtime evidence or an external ground truth.

The right relationship is:

Self-checking improves generation quality; independent verification carries release responsibility.

The generation model can inspect its own work. The verification model must still be able to use external evidence to reject, block, or correct its conclusion.

What does a verification model do?

A verification model is not merely a model that writes better review comments, and it is not a wrapper around static rules. It has at least four responsibilities.

1. Understand the delivery contract

The object of verification is not an isolated code fragment. It is the relationship between the requirement, the implementation, and the constraints around it.

The verification model needs to understand what the user asked for, how the existing system works, which boundaries the change touches, which behavior must not break, and what evidence could prove that the goal was reached.

2. Choose a verification strategy

Not every change needs the entire test suite, and not every risk can be found by unit tests.

The verification model should decide whether the change needs checks for permissions, state consistency, API compatibility, dependencies, performance, migration behavior, concurrency, recovery, or the user flow. When evidence is missing, it should produce an executable plan and invoke the harness.

3. Aggregate heterogeneous evidence

Diffs, test results, CI output, static scans, runtime logs, alerts, issues, repair history, and user feedback are all incomplete on their own.

The verification model organizes these signals into an evidence chain and asks whether they support or contradict the claim that the current artifact is deliverable.

4. Make a decision and guide repair

The output should not stop at “there may be a problem.” It should include:

  • Ship: the evidence is sufficient to merge or release;
  • Block: an unacceptable risk exists, with the evidence that supports the block;
  • Human Review: the evidence is incomplete or the business risk is high;
  • Repair Guidance: what the generation model should change, test, and verify again.

That is the difference between a verification model and an ordinary review product. A review product mainly produces suggestions. A verification model produces an explainable delivery decision.

From code data to a Verification Trace

Generation models learn from code, task descriptions, examples, and tool-use traces how to complete a task.

A verification model needs another distribution of data: evidence about why an artifact was trusted or rejected.

We call this a Verification Trace. A complete trace includes:

Task and constraints
→ Candidate code, configuration, and agent execution
→ Tests, CI, scans, logs, and monitoring evidence
→ Defect discovery and diagnosis
→ Repair attempts
→ Regression and re-verification results
→ Ship / Block / Human Review decision
→ The real result after delivery

This is different from “more code data.” Code tells a model what people wrote. A Verification Trace tells it which change was ultimately shown to be reliable, which change failed, where the evidence was, and how the system should correct itself.

Public issues, pull requests, CI fail/pass pairs, and repair histories can provide cold-start examples. Synthetic and active scenario construction can fill in long-tail cases such as permissions, payments, concurrency, state consistency, migrations, and regressions. Real user and enterprise environments can form private trace graphs without moving raw data outside the customer's boundary.

The principle is simple:

Customer data stays in its domain; verification knowledge can transfer.

The center can learn authorized abstractions, synthetic cases, aggregate signals, and general verification methods. The enterprise can retain private policy, code, logs, and complete evidence.

How verification improves generation

The value of a verification model is not limited to the final “reject.”

A real Software Factory forms a loop:

Generate
→ Execute
→ Observe
→ Verify
→ Intervene
→ Repair
→ Re-verify
→ Learn

When the verification model finds drift from the objective, redundant exploration, missing tests, an ineffective repair, or a likely regression, it can:

  • identify the missing verification step;
  • add or generate a targeted test;
  • stop an unverified change from being submitted;
  • return the agent to a requirement it overlooked;
  • provide an evidence-backed repair path;
  • preserve the process as training data for the next cycle.

The verification model is therefore an external control layer and a high-quality feedback source for the generation model.

It can also remain neutral across generation systems. Whether the candidate comes from Claude Code, Codex, Cursor, Qwen, Kimi, or an internal agent, the verification model should make a consistent quality decision from evidence rather than endorsing one generation ecosystem.

Why this is a window for verification models

The opportunity exists not because AI coding is weak, but because it is becoming strong and common.

When AI only completes a few lines, human review can absorb most of the risk. When agents start handling repository-level repairs, feature work, cross-file changes, and automated release, human review becomes the throughput bottleneck. Quality risk grows from a single function into a system-level delivery problem.

The market is already allocating budget to quality, review, and governance after generation. That shows demand for a layer beyond code creation, but it does not mean the verification problem has been solved. The open question is who can provide an independent, auditable, continuously improving delivery decision across models, tools, CI/CD systems, and private enterprise workflows.

That is the opportunity for verification models.

What should a verification model be tested on?

“Verification model” cannot remain a persuasive phrase. It must prove itself with a stricter standard than generation models.

At minimum, it should be tested on:

  1. Defect discovery: Can it find functional, regression, security, compatibility, state, and maintainability risks?
  2. Evidence sufficiency: Can it identify cases where tests pass but the evidence is still inadequate?
  3. Risk calibration: Does it block high-risk problems while avoiding excessive false positives on low-risk changes?
  4. Repair guidance: Does it help the generation model reach a trusted repair faster and with less rework?
  5. Long-term delivery: Does it reduce production defects, rollbacks, repeated repairs, and human review burden?

This is why new benchmarks matter. Traditional software benchmarks mostly ask whether an issue was fixed. A Software Factory also needs to measure trusted delivery across new features, maintenance, regression verification, and long-term evolution.

The prize is not a single leaderboard score. It is a better standard for deciding when AI-generated software can be trusted.

Conclusion: the next layer of software factories is verification

The first half of AI coding competes on who can generate software faster and more capably.

The next half will compete on who can turn a large supply of candidate code into reliable, auditable, continuously evolving delivery.

A Software Factory cannot have only a production line. It also needs quality control.

The generation model makes the candidate.
The harness runs the work and collects evidence.
The verification model understands the evidence, judges the risk, guides repair, and decides what can be trusted.

Generation makes software supply grow quickly. Verification decides how much of that supply can enter production.

Valkor is interested in this layer of AI-native software infrastructure: not replacing generation models, but giving the software they produce a more trustworthy, verifiable, and deliverable path into real systems.

References

  1. Lilian Weng. Harness Engineering for Self-Improvement, 2026.
  2. Yang et al. Are “Solved Issues” in SWE-bench Really Solved Correctly? An Empirical Study, 2025.
  3. Huang et al. Large Language Models Cannot Self-Correct Reasoning Yet, ICLR 2024.
  4. SWE-PRBench, 2026.
  5. GitHub Code Quality billing, 2026.
  6. Anthropic. Claude Code Review, 2026.

软件工厂需要两种模型

摘要

生成模型负责制造候选软件,验证模型负责判断哪些成果可以被信任并交付。

AI Coding 正在快速改变软件生产方式。过去需要数天完成的工作,现在可以在数小时内变成一个可运行的界面、一份仓库级补丁或第一版测试。Coding Agent 可以读取仓库、规划任务、修改文件、执行命令,并根据获得的反馈持续迭代。

其中一个容易被忽略的变化是:代码正在变得更便宜,可信交付仍然昂贵

一个能运行的 Demo,和一个可以被可信地合并、发布并维护的系统,仍然是两件不同的事。后者需要回答更困难的问题:

  • 这次改动是否真的满足需求,而不只是通过了局部测试?
  • 它是否保留了权限、兼容性、性能和已有边界?
  • 当前验证证据是否足够,还应该检查什么?
  • 这次修复是否解决了原问题,又是否引入了新的回归?
  • 当证据不足时,系统应该自动修复、阻断交付,还是请求人工复核?

Software Factory 的终点不应该是“Agent 生成了代码”,而应该是“系统可以持续地产生值得信任的交付物”。

这需要两种模型能力:生成验证

软件工厂需要质量控制,而不只是生产线

制造业的工厂不会因为拥有更快的机器,就取消质检、抽检、过程控制和放行制度。Software Factory 也应该如此设计。

生成模型负责把需求转化为候选实现。它分析任务、检索上下文、提出方案、修改代码、调用工具、编写测试并尝试完成工作。它的目标是提高“做出有用成果”的概率。

但候选实现不等于可信交付。验证模型负责判断是否有足够证据支持发布,识别缺失的证据,选择下一项检查,并把结构化反馈传回生成模型。它的目标不是生成更多代码,而是提高结果被信任的概率。

“两种模型”并不意味着每个系统都必须部署两套完全独立的权重。它强调的是两种不应被混同的功能与责任:

维度生成模型验证模型
核心任务生成候选代码与执行方案判断产物是否可信、如何证明以及如何修复
优化目标完成任务、提升实现效率风险校准、证据充分性与可交付性
主要输入需求、代码库、工具反馈与历史上下文候选改动,以及测试、CI、日志、缺陷、运行结果与策略
主要输出代码、配置、命令、测试与补丁Ship / Block / Human Review、证据链、验证计划与修复指导
关键数据代码、任务与执行轨迹Verification Trace:证据、缺陷、修复、回归与最终裁决

最简洁的表述是:

生成模型负责回答“能不能做出来”;验证模型负责回答“能不能被信任地交付”。

更强的生成模型不会自动带来可信交付

随着模型能力提升,人们很自然会认为,只要生成模型足够强,它最终就能自己写好、测好、审好并批准自己的工作。

这是有价值的工程直觉,但不足以成为生产级可靠性的设计原则。

首先,生成模型面对的是一个候选空间。它需要在不完整的需求、有限的上下文和有限的执行预算下,尽快提出可行路径。即使补丁通过了现有测试,也不代表它覆盖了可维护性、所有权边界、迁移成本、向后兼容性、生产行为或未来调试负担。

软件质量也不是单一指标。一个改动可能功能正确,却错误地处理了权限;测试可能通过,却破坏了兼容性;局部性能有所提升,却让可观测性下降;修复当前缺陷,却留下后续维护问题。生成模型可以主动尝试验证,但自身的信心不能替代独立证据。

因此,“任务完成”和“问题真正解决”必须继续是两个不同的判断。测试变绿是一项证据,却不自动等于完整解决了真实的软件问题。

生成模型更强,当然会提升候选产物的质量,但它不会消除验证需求。恰恰相反:任务越长、模型能够修改的系统越复杂,独立验证层就越有价值。

Harness 必不可少,但 Harness 不是验证模型

Harness 是 AI Coding 从 Demo 走向实际工作的基础设施。它提供工具、沙箱、代码执行、测试、检索、版本控制、可观测性和权限边界。没有 Harness,模型只能说自己写对了;有了 Harness,模型才可以运行代码、执行检查、观察日志、复现故障并获得外部反馈。

但 Harness 负责产生和执行证据,并不会自动判断证据意味着什么。

测试通过,并不能单独证明需求已经满足。静态扫描没有告警,也不能证明不存在安全风险。CI 变绿,不能证明预期的版本真的被验证过。覆盖率提高,也不能证明关键业务风险已经覆盖。

验证模型需要判断:

  1. 当前任务最需要哪些证据;
  2. 已有证据是否足够;
  3. 不同信号之间是否互相矛盾;
  4. 风险是否已经超过阻断阈值;
  5. 下一步应该运行什么检查,或者生成模型应该如何修复。

更准确的架构是:

生成模型提出候选实现
        ↓
Harness 执行测试、扫描、仿真与观测
        ↓
验证模型聚合证据、裁定风险并选择下一步
        ↓
生成模型修复或继续验证
        ↓
系统记录可审计的交付结论

Harness 是验证系统的执行层;验证模型才是控制质量与发布的智能层。

同源模型自检有价值,但不能承担独立验证责任

没有必要否定同源模型自检。让生成模型检查 diff、补充测试并修改自己的工作,确实可以提高初稿质量,也应该成为 AI Coding 工作流的第一道防线。

但“自检有效”不等于“自检可以承担生产放行责任”。

当生成与判断依赖同一个模型、同一份上下文和同一组早期假设时,它们也会共享同样的盲点。模型可能误解权限规则、遗漏未写入文档的业务约束,或没有注意到依赖变化。再次调用同一个模型,并不会自动产生新的运行证据或外部事实。

正确的关系是:

自检负责提高生成质量;独立验证负责承担生产放行责任。

生成模型可以检查自己的工作,但验证模型仍然必须能够基于外部证据推翻、阻断或纠正它的结论。

验证模型到底做什么

验证模型不是一个更会写 review comment 的模型,也不是传统静态规则的包装。它至少承担四类责任。

1. 理解交付契约

验证对象不是孤立的代码片段,而是需求、实现和周围约束之间的关系。

验证模型需要理解用户提出了什么、已有系统如何工作、改动触及哪些边界、哪些行为不能被破坏,以及什么证据可以证明目标已经达成。

2. 决定验证策略

不是每次都需要跑完整测试,也不是所有风险都能由单元测试发现。

验证模型应该判断当前变更是否需要检查权限、状态一致性、接口兼容、依赖、性能、迁移、并发、恢复或用户流程。当证据缺失时,它应当生成可执行的验证计划并调用 Harness。

3. 聚合异构证据

Diff、测试结果、CI 输出、静态扫描、运行日志、告警、Issue、修复历史和用户反馈,单独看都不完整。

验证模型需要把这些信号组织成证据链,判断它们支持还是反驳“当前产物可以交付”这一结论。

4. 做出裁定并指导修复

输出不应该停留在“这里可能有问题”,而应该包括:

  • Ship:证据足够,可以合并或发布;
  • Block:存在不可接受的风险,并说明阻断证据;
  • Human Review:证据不完整,或业务风险较高,需要人工裁决;
  • Repair Guidance:生成模型应该修改什么、补什么测试、重新验证什么。

这就是验证模型与普通 review 产品的差异。Review 产品主要提供建议;验证模型的核心输出是可解释的交付决策。

从代码数据到 Verification Trace

生成模型主要从代码、任务描述、示例和工具使用轨迹中学习如何完成任务。

验证模型需要另一种数据分布:一个产物为什么被信任或被拒绝。

我们把这种数据称为 Verification Trace。一条完整的 Trace 至少包括:

任务与约束
→ 候选代码、配置与 Agent 执行轨迹
→ 测试、CI、扫描、日志和监控证据
→ 缺陷发现与问题定位
→ 修复尝试
→ 回归与复验结果
→ Ship / Block / Human Review 最终裁决
→ 交付后的真实结果

这与“更多代码数据”不同。代码告诉模型“人们写过什么”;Verification Trace 告诉模型“什么改动最终被证明可靠、什么改动失败、证据在哪里、系统应该怎样纠正”。

公开 Issue、PR、CI fail/pass pair 和修复记录可以提供冷启动样本。合成与主动构造可以补齐权限、支付、并发、状态一致性、迁移和回归等长尾场景。真实用户和企业环境则可以在原始数据不出域的前提下形成私有 Trace Graph。

原则很简单:

客户数据留在自己的环境中,验证知识可以迁移。

中心侧学习经授权的抽象模式、合成案例、聚合信号和可泛化的验证方法;企业侧保留私有策略、代码、日志和完整证据。

验证模型如何反向提升生成模型

验证模型的价值不止是最后一次“拒绝”。

真正的 Software Factory 应形成一个闭环:

Generate
→ Execute
→ Observe
→ Verify
→ Intervene
→ Repair
→ Re-verify
→ Learn

当验证模型发现目标漂移、冗余探索、测试不足、修复无效或潜在回归时,它可以:

  • 指定缺失的验证步骤;
  • 补充或生成针对性测试;
  • 阻止未经验证的变更提交;
  • 把 Agent 拉回被遗漏的需求约束;
  • 给出有证据支撑的修复路径;
  • 把整个过程沉淀为下一轮训练数据。

因此,验证模型是生成模型的外部控制层和高质量反馈源。

它也可以对不同生成系统保持中立。无论候选产物来自 Claude Code、Codex、Cursor、Qwen、Kimi,还是企业内部 Agent,验证模型都应该基于证据做出一致的质量判断,而不是替某一个生成生态背书。

为什么现在是验证模型的窗口期

这个机会并不是因为 AI Coding 还很弱,而是因为它正在变得足够强、足够普及。

当 AI 只能补全几行代码时,人工 review 可以吸收大部分风险;当 Agent 开始完成仓库级修复、功能开发、跨文件改造和自动化发布时,人工 review 会成为新的吞吐瓶颈,质量风险也会从单个函数放大到系统级交付。

行业正在为生成之后的质量、审查与治理分配明确预算。这说明生成之外确实存在一个市场需要的层,但并不意味着验证问题已经解决。真正的问题是:谁能在跨模型、跨工具、跨 CI/CD 和跨企业私有流程的环境中,提供独立、可审计、能够持续学习的交付裁决?

这正是验证模型的机会。

验证模型需要接受什么检验

“验证模型”不能只是一个有说服力的概念。它必须用比生成模型更严格的标准证明自己。

至少应接受五类检验:

  1. 缺陷发现能力:能否发现功能、回归、安全、兼容、状态和维护性风险?
  2. 证据充分性判断:能否识别“测试通过但证据仍然不足”的场景?
  3. 风险校准能力:高风险问题是否被优先阻断,低风险改动是否避免被过度误杀?
  4. 修复指导价值:能否让生成模型更快、更少返工地完成可信修复?
  5. 长期交付效果:是否降低线上缺陷、回滚、重复修复和人工 review 负担?

这也是为什么新的 benchmark 很重要。传统软件 benchmark 主要问“某个 issue 是否被修复”;Software Factory 还需要衡量新功能、维护修复、回归验证和长期演进中的可信交付。

真正值得争夺的不是一次排行榜分数,而是重新定义“AI 生成的软件何时可以被信任”的标准。

结语:软件工厂的下一层是验证

AI Coding 的上半场,竞争的是谁能更快、更强地生成软件。

下半场,竞争的是谁能把大量候选代码转化为可靠、可审计、能够持续演进的软件交付。

Software Factory 不能只有生产线,还必须拥有质量控制系统。

生成模型制造候选产物。
Harness 运行工作并收集证据。
验证模型理解证据、裁定风险、指导修复,并决定什么可以被信任。

生成能力让软件供给快速增长;验证能力决定这些供给中有多少能够真正进入生产环境。

Valkor 关注的正是这一层 AI-native 软件基础设施:不是替代生成模型,而是让生成模型产出的软件拥有更可信、更可验证、更可交付的路径进入真实系统。

参考文献

  1. Lilian Weng:《Harness Engineering for Self-Improvement》,2026。
  2. Yang 等:《Are “Solved Issues” in SWE-bench Really Solved Correctly? An Empirical Study》,2025。
  3. Huang 等:《Large Language Models Cannot Self-Correct Reasoning Yet》,ICLR 2024。
  4. SWE-PRBench》,2026。
  5. GitHub:《GitHub Code Quality billing》,2026。
  6. Anthropic:《Claude Code Review》,2026。