跪拜 Guibai
← All articles
Android · AI Programming

From Human Gates to AI Referees: The Third Iteration of AI Coding Workflow Design

By TimeFine ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

AI coding workflows that shift judgment from human confirmation to an auditable, single-turn Referee let teams run more tasks without constant human babysitting, while keeping authority over rules and red cards in human hands. The thin-shell/core split also solves the problem of maintaining identical workflow rules across Claude Code, Codex, and DSH without drift.

Summary

The third installment in this series refines three existing AI coding workflows—serial dev-workflow, parallel dev-workflow-router, and bugfix-workflow—by adding an independent AI Referee agent. The Referee is tool-free, single-turn, receives fixed input, and outputs structured JSON, acting as a judgment layer separate from the main Agent and Reviewer. Green and yellow judgments let the workflow proceed without stopping; only red cards and standard changes require human intervention. This directly attacks the bottleneck where every Gate waited for a human.

The Referee's rule evolution shifts from AI self-review to recording human signals: when a similar human correction appears twice or more, the Referee generates a rule-change proposal that a human must approve, and it includes rollback options. Bugfix workflows get a four-axis traffic-light system (cause, solution, evidence, scope) with mandatory checks, where yellow can be explicitly authorized but red cannot. To manage multi-platform use across DSH, Claude Code, and Codex, the design separates a platform-neutral core layer from a thin shell of platform facts, and adds a drift-check script to enforce the boundary. Cost stays predictable: a typical task makes 0-2 Referee calls, maximum 4.

Takeaways
— The Referee is an independent agent with no tools, single-turn input/output, fixed structured JSON output, and no access to the main Agent's history.
— Green and yellow lights allow the workflow to continue without human confirmation; only red cards and standard changes stop the process for a human.
— Rule evolution now works by recording human signals; only when the same signature appears at least twice does the Referee generate a rule-change proposal, which only a human can approve.
— The bugfix workflow uses a four-axis traffic light: cause (RC1-3), solution (FX1-3), evidence (EV1-4), and scope (SC1-3), plus mandatory checks H1-H4 (e.g., incomplete key evidence = red, unverified goal = red).
— Yellow lights in bugfix workflows stop and require explicit human authorization to proceed; red lights cannot be authorized for direct fixes—only evidence supplement or hypothesis building can move them to yellow/green.
— Each task triggers at most 4 Referee calls; typical tasks use 0-2, with input sizes ranging from ~0.3k to ~2.8k tokens and outputs capped at 500 tokens.
— The multi-platform packaging splits rules into a platform-neutral core and a thin shell containing only platform facts (tool names, paths, ledger locations); the `check-drift.py` script rejects shells that copy judgment criteria or fail to reference the core.
— The landing order is: set three colors, define axes and mandatory checks, write Referee contract, build ledger, set self-evolution rules, split thin shell, add drift check, then run 5-10 real tasks before scaling.
Conclusions

The Referee's isolation is as much a cost-control measure as a correctness measure: keeping it tool-free and single-turn makes each judgment predictable in tokens and recomputable, which is what lets the workflow run unattended.

Making human signals the trigger for rule changes avoids the feedback loop where an AI system rationalizes its own mistakes during retrospective; a human's explicit correction is treated as ground truth, not something the AI re-evaluates.

The thin-shell/core pattern applies software-engineering discipline to AI prompt workflows, acknowledging that AI tools like Claude Code and Codex are deployment targets that need a single source of truth to avoid config drift.

The design assumes most engineering decisions do not require deep human judgment; it works well for tasks with clear acceptance criteria, but the author's own caveat about targeting real engineering suggests the bottleneck shifts to how well humans define the axes in the first place.

Concepts & terms
Referee
An independent, tool-free, single-turn AI agent that receives a fixed structured payload and outputs a structured JSON judgment. It is used to decide whether a requirement, solution, or fault hypothesis holds, without investigating files or code itself.
Gate
A checkpoint in a development workflow where a decision is required before proceeding. In this design, gates become automated for green/yellow judgments and only stop for red cards or standard changes.
Traffic light (judgment system)
A three-state decision system (green/yellow/red) for fault diagnosis. Green means cause located and solution ready; yellow means a reasonable hypothesis or candidate needs verification or authorization; red means neither cause nor solution is established.
Thin shell / core layer
A separation pattern where platform-neutral workflow rules live in a core directory, and each platform (DSH, Claude Code, Codex) has a minimal shell that only contains platform-specific facts like tool names and file paths. A drift-check script enforces that shells never duplicate core rules.
human_signal
A recorded event capturing a human's explicit correction, objection, or negative feedback during workflow execution, including the exact quote, verdict, evidence, and a signature for grouping similar cases. Signals accumulate; only when two or more share a signature does the Referee propose a rule change.
From the discussion
Featured comments
shushenghong

'Gate becoming formalized' is a sharp observation. Our trade-off is that daily tasks don't have human Gates; we only involve people in two places: when the agent is uncertain it stops and asks the person who assigned the task, and at the end, reviewing the diff of this branch against the task description; tasks interrupted for more than an hour ask the person whether to continue first, not letting it keep running on stale context. I want to ask: when the Referee judges red and returns to a human, does the human see the original payload or a summary reorganized by the main Agent?

TimeFine

First, to answer the question: The Referee receives the main Agent's payload, which mainly includes a comparison of old vs. new requirements and a comparison of technical solutions. The Referee uses scripts based on accumulated rules to judge each relationship, then aggregates the judgment results back to the main Agent. So note that judging red/yellow/green is the main Agent's job, not the Referee's. After the judgment, the main Agent shows the user a summary. Regarding the Gate settings: 1. After developing with AI for a long time, because humans gradually participate less, many requirements and details are actually forgotten. If a wrong original requirement combined with a wrong new requirement gets developed in, it's a serious contamination of the project, sometimes even harmful. That's why I set up the traffic-light rules. 2. The gate after code is written is because developers need real-device testing. Writing code and running it on a real device are two completely different things. This step can catch the AI's implementation issues from the start. Thanks for your comment!

See top comments, translated →
Source: juejin.cn ↗ Google Translate ↗ Backup ↗