모델에 도구와 루프 제공하기
읽는 데 약 28분분 걸린다, 8절에 4개 예제이(가) 있음.
AI로 번역함. 영어 원문을 사람이 검증함. 우리가 책을 만드는 방식
영어판 2026.11.2판을 번역한 것이다. 원문 읽기
이 장을 마치면 모델에 세 가지 도구를 주고 루프 안에서 실행할 수 있다. 하나는 파일을 읽고, 하나는 테스트를 실행하며, 하나는 변경한 파일로 작업을 끝낸다. 루프는 모델이 작업을 끝낼 때, 단계를 모두 소진했을 때, 모델이 호출을 멈출 때 중단된다. 먼저 과제를 해결하는 스크립트 모델로 루프를 실행하고, 이어서 과제를 해결하지 못하는 녹화된 오픈 모델로 실행하여 그 모델이 어디에서 잘못되는지 확인한다.
이 장의 에이전트는 unitcraft을(를) 유지보수한다. 이 라이브러리는 3.5 kg처럼 텍스트로 쓴 물리량을 읽고, 변환하고, 서식에 맞춰 출력하는 작은 Python 라이브러리이다. 에이전트는 유지보수자가 등록한 이슈를 받아 라이브러리 코드에 대한 변경을 제안한다. 에이전트는 자신의 사본에서 공개된 테스트를 실행할 수 있지만, 변경이 완료로 인정되는지를 판정하는 숨겨진 검사는 결코 볼 수 없다. 이 분리는 의도적이다. 자신의 채점기를 읽을 수 있는 에이전트는 그 채점기를 학습하게 되며, 10장의 측정은 아무 의미도 없게 된다.
Andrew Ng은 2026년 11월 13일자 The Batch 379호의 편지에서 에이전트 하니스를 LLM을 감싸고 컨텍스트, 도구, 가드레일을 제공하는 코드라고 설명한다. 이 책도 같은 대상을 가리키는 데 이 용어를 쓴다. 판단은 모델이 내린다. 하니스는 루프와 도구, 그리고 그 도구가 할 수 있는 일에 대한 제한을 제공하며, 이 책의 대부분은 이 두 번째 부분을 다룬다.
첫 번째 과제인 T-01은 파일 하나를 고치는 작업이며, 변경은 unitcraft/format.py에 들어간다. 공개 테스트 모음은 tests/test_format.py에서 실패하고, 이슈는 다음과 같다. "format_quantity이(가) 끝자리 0을 버린다. 3.5 kg이 3.5 kg로 출력되는데, 기본값은 소수점 두 자리이다." 따라서 3.5 kg의 기대 출력은 3.50 kg이다. 사람이라면 unitcraft/format.py을(를) 열어 읽고, 변경한 다음 테스트를 다시 실행할 것이다. 에이전트는 단계 사이에 사람 없이 같은 일을 순서대로 해야 하며, 하니스는 모델이 실수하더라도 그 순서가 지켜지도록 보장해야 한다.
이 장은 과제 하나를 처음부터 끝까지 다룬다. 에이전트가 무엇을 가지고 시작하는지, 에이전트를 실행하는 루프, 에이전트가 호출하는 도구, 그리고 에이전트를 멈추는 첫 번째 규칙을 설명한다. 그런 다음 루프를 스크립트 모델과 녹화된 모델로 각각 한 번씩 실행하고 일어난 일을 센다.
에이전트가 하나의 과제에서 하는 일
에이전트는 두 개의 메시지로 시작한다. 하나는 에이전트의 도구와 그 인자를 명시한 시스템 프롬프트이고, 다른 하나는 이슈 텍스트이다. 과제에 관한 그 밖의 내용은 모델에 전달되지 않는다. 에이전트는 케이스 자체를 건드리지 않는다. 하니스는 실행마다 라이브러리의 임시 복사본을 만들며, 에이전트가 수행하는 모든 쓰기는 그 복사본에만 반영된다. 실행이 끝나면 복사본은 채점된 뒤 폐기되므로, 한 실행이 다음 실행에 변경 사항을 남길 수 없다.
수정이 완료된 것으로 인정되려면 두 가지 조건이 충족되어야 한다. 복사본에서 숨겨진 검사가 통과해야 하고, 실행이 finish 호출로 끝나야 한다. T-01의 숨겨진 검사는 H-01이며, 이슈 텍스트를 바탕으로 작성된 pytest 파일이다. 이 파일은 한 가지만 단언한다. format_quantity가 3.5, 0, 12 kg을 소수점 두 자리로 맞추어 각각 3.50 kg, 0.00 kg, 12.00 kg로 출력한다는 것이다. 하니스는 실행이 끝난 뒤 이 파일을 라이브러리의 새 복사본에 복사하므로, 에이전트는 이 파일을 읽지 못한다. 10장은 같은 규칙을 전체 과제 집합에 적용한다. 변경 사항을 케이스 라이브러리에 적용할지는 별개의 결정이며, 6장에서 승인 관문이 그 결정을 내린다.
이 규칙은 모델이 택할 수 있는 지름길 하나도 막는다. 눈에 보이는 테스트를 통과할 때까지 고치는 것이다. T-01의 과제 파일은 tests 폴더를 변경하지 않아야 한다고 명시한다. 그래서 채점기는 그 폴더를 케이스와 바이트 단위로 비교하며, 테스트를 수정하면 숨겨진 검사가 통과하더라도 그 실행은 완료로 인정되지 않는다. 수정 방법을 추측하는 모델은 부정을 저지를 의도 없이도 이 지름길에 손을 뻗을 수 있으며, 이 규칙은 그런 실행이 완료로 계산되지 않게 한다.
과제 파일에서 T-01을 불러오고 케이스의 파일을 나열하는 일은 짧은 예제 하나로 충분하다.
1"""The issue the agent starts from, task T-01, and the case's files in sorted order. The model reads only the2issue and the system prompt, so these are what its first request holds about the task."""3from lib.case import CASE, case_files, load_tasks45task = load_tasks(only=["T-01"])[0]6print("task:", task.id)7print("issue:", task.issue)8files = case_files(CASE)9print("case files:", len(files))10for name in files:11 print(" ", name)
python read-the-issue.pytask: T-01
issue: `format_quantity` drops the trailing zeros: 3.5 kg prints as `3.5 kg`, and the default is two places. CI is red on `tests/test_format.py`.
case files: 25
.github/workflows/test.yml
README.md
pyproject.toml
tests/test_arith.py
tests/test_cli.py
tests/test_convert.py
tests/test_format.py
tests/test_parse.py
tests/test_rounding.py
tests/test_table.py
tests/test_temperature.py
unitcraft/__init__.py
unitcraft/__main__.py
unitcraft/arith.py
unitcraft/cli.py
unitcraft/convert.py
unitcraft/errors.py
unitcraft/format.py
unitcraft/parse.py
unitcraft/prefixes.py
unitcraft/quantity.py
unitcraft/rounding.py
unitcraft/table.py
unitcraft/temperature.py
unitcraft/units.py
출력은 이슈를 먼저 보여 준 뒤 케이스의 파일을 정렬된 순서로 보여 준다. 이슈는 모델의 첫 요청에 담기는 과제 고유의 유일한 텍스트이므로, 이후의 모든 단계는 그 첫 요청에 무엇이 담겼는지에 달려 있다. 이 케이스에는 25 파일이 있으며, 에이전트는 자신의 복사본에서 그중 어느 것이든 읽을 수 있다.
작업 규칙: 실행은 그 실행 자신의 복사본과 그 과제의 검사로만 채점한다. 케이스 자체를 기준으로 채점해서는 안 된다. 케이스에 반영된 변경이 그것을 얻어 내지 못한 실행의 성과로 계산될 수 있기 때문이다.
이 부분은 아직 번역되지 않았으므로 영어로 표시된다.
A loop in about seventy lines
A model produces text, and the harness turns some of that text into actions. Each step sends the messages so far, along with the tool schemas, to the model. The reply comes back as text. The harness reads the tool call inside it, runs the tool on the scratch copy, appends the result to the messages, and goes around again. The model never runs anything itself. Anthropic's documentation for tool use states the contract in those terms: the model emits a structured request, the application runs the operation, and the result goes back into the conversation (How tool use works).
The loop is _loop in examples/lib/loop.py, about seventy lines. The file also holds rules for later chapters: the optional stops in Stops are off by default, and a reply cut off at the token limit is refused whatever the settings. None of this chapter's runs reach either. A step is one model call. A tool call is one request inside a step, and a reply can hold more than one. The loop acts on the first request and answers each other one with an error that says it was not run. Each request gets an ID from a counter, and the ID goes on the tool-result message that answers it. The assistant message that holds the reply carries no ID, and the trace keeps none. The trace, in lib/trace.py, holds one line per step: the step's number, the tool it called and what came back. Every reply stays in the messages too, which is why the model sees its own earlier steps on the next call, and why the request grows with each step.
The model's reply is plain text, and its tool call has a fixed shape: JSON inside <tool_call> tags. The chat template in the model file asks for that shape, a JSON object with a function name and arguments inside the tags (the model file at its pinned revision). The recorded replies use this shape, and the harness reads only what is inside the tags:
<tool_call>
{"name": "read_file", "arguments": {"path": "<case-relative path>"}}
</tool_call>
Text outside the tags is ignored, so a reply may carry prose before the call. A block that doesn't parse isn't run. The harness records it as a malformed call and hands the reason back to the model as an error result, so the model can try again.
Across the run the messages grow in a fixed order: the system prompt, the issue, then each reply followed by the result of its call. Nothing is summarised and nothing is dropped. That makes the transcript readable, and it makes the cost of each step grow with the one before it. Chapter 5 takes up what to do when that growth reaches the model's window. The runs in this chapter are short, and they don't need that yet.
ReAct interleaves written reasoning with actions, and Yao and colleagues reported that the reasoning helps a model keep and revise a plan, and handle exceptions (Yao et al., ReAct). This loop keeps the actions and asks the model for no reasoning between them. Its system prompt says "Reply with a tool call only," and the parser passes over any prose the model writes anyway.
Working rule: Keep every request and its result in the messages, and give each result the ID of the request it answers. A loop that drops a result leaves the model without an answer to its request, and the messages are where that gap shows.
두 개의 도구와 하나의 종료 도구
에이전트는 읽고, 테스트하고, 바꿔야 하므로 이 장은 각 작업에 도구를 하나씩 준다. 이 설계에서는 변경이 실행을 끝내므로, 변경 도구가 종료 도구를 겸한다.
| 도구 | 인자 | 반환 값 | 실행을 끝내는가? |
|---|---|---|---|
read_file |
path, 실행용으로 만든 사례 사본 안의 경로 |
파일의 텍스트 또는 오류 | 아니요 |
run_tests |
없음 | 사본에서 실행한 공개 테스트 모음의 집계와 실패한 테스트의 이름 | 아니요 |
finish |
path와 text, 곧 새 파일 전체 |
변경을 쓴 뒤의 집계와 실패한 테스트 | 예 |
read_file은 파일 전체를 반환하며, 사본 밖의 경로는 거부한다. run_tests는 사본에서 공개 테스트 모음을 실행하고, 전체 출력이 아니라 집계와 실패한 테스트의 이름을 반환한다. 제한 시간을 넘긴 테스트 모음은 프로세스 그룹과 함께 중단된다. finish는 파일 하나의 새 텍스트를 받아 사본에 쓰고, 공개 테스트 모음을 실행한 뒤 실행을 끝낸다. 쓰기가 거부되면 오류가 도구 결과로 돌아오고 실행은 계속되므로, 모델은 다시 시도할 수 있다.
이 장에서 도구는 하니스 자체의 프로세스 안에서 사본을 대상으로 실행된다. 7장에서는 이 도구들이 시작하는 유일한 명령인 테스트 실행을 샌드박스에서 수행한다.
파일을 읽는 도구는 어떤 경로를 읽을지 정해야 한다. 사례 밖의 경로 두 개로 read_file을 호출하면, 모델이 그런 경로를 요청했을 때 무엇을 돌려받는지 볼 수 있다.
1"""The read tool refuses a path outside the case, and the refusal comes back as text the model can read. Only reads2are tried, and a refused path never reaches the disk."""3from lib.case import CASE4from lib.tools import CH1, Workspace56ABSOLUTE = "/etc/secret.txt"7ws = Workspace(CASE)8for path in ("../secret.txt", ABSOLUTE):9 result = CH1.call(ws, "read_file", {"path": path})10 # An absolute path differs on every machine, so the output shows a placeholder for it.11 print("refused:", result.text.replace(ABSOLUTE, "<absolute path>"))
python tool-refusal.pyrefused: error: path outside the case: ../secret.txt
refused: error: path outside the case: <absolute path>
두 경로 모두 거부되며, 각 거부는 도구 결과로 돌아온다. 모델은 다음 단계에서 이를 다른 결과와 똑같이 읽으므로, 경로를 고쳐 다시 시도할 수 있다. 거부된 두 읽기 모두 디스크에 접근하지 않는다.
작업 규칙: 각 도구에는 하나의 작업만 맡기고, 실행을 끝낼 수 있는 것은 종료 도구뿐이게 한다. 거부된 읽기나 쓰기는 모델이 대응할 수 있는 오류로 돌려보내야 하며, 결코 루프를 멈추게 해서는 안 된다.
작업이 끝나거나 예산이 소진되면 멈춘다
종료 조건이 없는 루프는 누군가 멈출 때까지 실행되며, 단계마다 토큰이 든다. 그래서 모든 실행은 세 가지 방식 중 하나로 끝나고, 실행은 그 방식을 ended로 기록한다. 첫째, 모델이 finish를 호출하면 실행은 그 변경 사항과 함께 끝난다. 둘째, 실행이 단계 예산에 도달하면 끝난다. 이 장의 도구 집합에서 단계 예산은 여덟 단계이며, 이때 실행은 step_cap로 끝난다. 셋째, 모델이 도구 호출 없이 연속으로 두 번 응답하는 경우다. 이런 응답이 처음 나오면 도구 호출을 하나 요청하는 메시지와 함께 다시 시도한다. 두 번째 응답에서는 실행이 no_tool_call로 끝난다.
존재하지 않는 도구를 호출하면 오류 결과가 반환되고 실행은 계속된다. 루프는 잘못된 호출에서 멈추지 않는다. 그 호출을 한 단계로 세고, 오류를 돌려준 다음 다음 단계를 기다린다. 잘못된 호출을 계속하는 모델이 영원히 실행되지 않게 막는 것은 예산이다. 예산은 초가 아니라 모델 호출 횟수를 세므로, 같은 실행은 어떤 머신에서든 같은 단계에서 끝난다. 예산은 컨텍스트 크기와도 별개의 한도다. 컨텍스트 창에 여유가 남아 있어도 단계 예산에 도달할 수 있고, 반대로 창이 먼저 바닥날 수도 있다. 이 장은 컨텍스트 창을 한도로 강제하지 않는다.
2장에서 나머지 중단 규칙을 추가한다. 같은 호출을 반복하는 실행, 테스트 수치가 달라지지 않는데 수정만 계속하는 실행, 계속 진행하는 대신 사용자에게 질문해야 하는 실행을 다룬다. 이 장의 루프에는 이런 규칙이 없으므로, 반복에 빠진 모델은 여덟 번째 단계까지 반복한다.
작업 규칙: 실행을 시작하기 전에 단계 예산을 정하고, 이를 엄격한 한도로 취급한다. 예산에 도달한 실행은 마지막 단계가 어떻게 보이든 끝난 것이 아니며, 미완료로 보고해야 한다.
스크립트 모델로 실행하기
루프와 그 도구, 예산이 갖추어졌으니, 첫 실행에는 응답을 직접 작성한 모델을 사용한다. 스크립트 모델은 주어진 응답을 순서대로 돌려줄 뿐 다른 것은 하지 않는다. 그래서 루프를 검증하는 깔끔한 테스트가 된다. 실행에서 나타나는 결함은 모델이 아니라 루프의 결함이며, 이 실행은 모델이 무엇을 선택할지가 아니라 올바른 응답이 주어졌을 때 루프가 무엇을 하는지 보여 준다. T-01을 위한 스크립트 응답 네 개는 구현을 읽고, 그 테스트를 읽고, 보이는 테스트 모음을 실행하고, 수정된 파일로 마무리한다.
1"""Four scripted replies solve T-01 through the step loop: read the file, read its test, run the visible suite,2then finish with the fixed file. The model is scripted, so the output shows the loop's steps and not a model's choices."""3from lib.case import load_tasks4from lib.chapter1 import SOLUTION, call, report5from lib.models import ScriptedModel6from lib.tools import CH178task = load_tasks(only=["T-01"])[0]9model = ScriptedModel([10 call("read_file", path="unitcraft/format.py"),11 call("read_file", path="tests/test_format.py"),12 call("run_tests"),13 call("finish", path="unitcraft/format.py", text=SOLUTION.read_text(encoding="utf-8")),14])15run, done = report(model, task, CH1) # CH1: three tools, their system prompt and a budget of eight steps; report prints the trace and scores the run16assert done, "the scripted run should solve T-01"
python scripted-loop.pystep 1: read_file: 23 lines
step 2: read_file: 27 lines
step 3: run_tests: 8 failed, 22 passed
step 4: finish: 7 failed, 23 passed
steps: 4
tool calls: 4
ended: finish
이 실행은 T-01을 네 단계로 해결하는데, 이것이 스크립트 실행으로 증명할 수 있는 전부이다. 루프는 올바른 응답을 끝까지 전달하여 통과하는 검사에 이르게 한다. 수정된 파일은 사례 데이터와 함께 보관된 이 책의 자체 해답이며, 예제는 이 실행이 완료로 처리된다고 단언한다.
출력을 순서대로 읽는다. 각 줄은 호출 하나와 그 호출에서 돌아온 결과를 나타내므로, 줄들을 합치면 모델이 매 단계에서 무엇을 앞에 두고 있었는지 알 수 있다. 개수는 3단계와 4단계 사이에서 바뀐다. 수정으로 보이는 테스트 모음의 실패가 8개에서 7개로 줄고, 이슈가 설명하는 테스트는 이제 통과한다. 남은 7개는 같은 보이는 테스트 모음의 다른 테스트에서 실패한다. T-01에서 결과로 인정되는 검사는 H-01이며, 이 검사는 통과한다. 이 실행은 4단계를 거치며 도구 호출을 4번 수행한다. 단계마다 한 번씩이며, 실행은 finish로 끝난다.
작업 규칙: 어떤 모델로든 실행하기 전에 먼저 스크립트 모델로 루프를 실행한다. 스크립트 실행이 실패하면 결함은 하네스에 있으며, 모델 실행은 그 결함을 가릴 뿐이다. 스크립트 실행은 통과하는데 모델 실행이 실패하면 결함은 모델이나 프롬프트에 있다.
이 부분은 아직 번역되지 않았으므로 영어로 표시된다.
Run it on the recorded model
The recorded run comes from Qwen3-4B-Instruct-2507, an open model quantised to Q4_K_M and run on a CPU at temperature 0 with a fixed seed. Its replies were saved as the raw text it produced, in a recording whose manifest names the model, its revision, the prompt's hash and the token counts. Replay checks that each request matches the one the recording holds, where a request is the messages and tool schemas sent at that step, and then returns the recorded reply.
1"""The recorded run of T-01, replayed step by step: each request must match the one recorded, and the replies are2the recorded text, mistakes included. The run stops at the step cap without a finish, so the task is not done."""3from lib.case import load_tasks4from lib.chapter1 import Recorder, report5from lib.models import ReplayModel6from lib.tools import CH178from collections import Counter910task = load_tasks(only=["T-01"])[0]11model = Recorder(ReplayModel("chapter-1-t01", "T-01"))12run, done = report(model, task, CH1)13assert not done, "the recorded run should not solve T-01"14reasons = [reason for reply in model.replies for reason in reply.malformed]15print("malformed calls:", len(reasons))16for reason, count in sorted(Counter(reasons).items()):17 print(f" {count} x {reason}")18assert all('"text": """' in reply.text for reply in model.replies[2:]), "from step 3 the call's text opens with triple quotes"19print("prompt tokens:", run.prompt_tokens)20print("completion tokens:", run.completion_tokens)
python recorded-run.pystep 1: read_file: 23 lines
step 2: run_tests: 8 failed, 22 passed
step 3: malformed: error: malformed call
step 4: malformed: error: malformed call
step 5: malformed: error: malformed call
step 6: malformed: error: malformed call
step 7: malformed: error: malformed call
step 8: malformed: error: malformed call
steps: 8
tool calls: 8
ended: step_cap
malformed calls: 6
6 x not JSON (Expecting ',' delimiter)
prompt tokens: 13009
completion tokens: 2128
The recorded model never finishes. Its first two steps are valid calls: a read_file, then a run_tests. From the third step on, each reply is a finish call that carries a whole new file, and each of those calls fails to parse. That happens 6 times, all with one reason, and the run ends as step_cap after 8 steps and 8 tool calls. The harness returns each failure as an error result, and the model answers it with a finish call of the same shape.
The shape of each failing call looks like this. The file is left out, and the call's text is shown with ...:
<tool_call>
{"name": "finish", "arguments": {"path": "unitcraft/format.py", "text": """ ...the whole file...\""}}
</tool_call>
The value opens with three quotes. JSON reads the first two as an empty string, so the parser stops at the third, where it expects a comma. The value also closes with a single quote, after an escaped one.
The model's reading of the issue is wrong from step 2, and the format failure hides it. At step 2 the model writes that format_quantity "drops trailing zeros in the fractional part, which is correct" (the model's words, from step 2 of the recording's replies.jsonl). The file at step 3 keeps the bug: it still strips zeros from the fraction with frac.rstrip("0"). No finish call parses in this run, so that file never reaches the hidden check. A probe outside the book's examples ran the step 3 file, copied from its code block, in a copy of the case against H-01, using the pinned pytest 9.2.0:
FAILED test_t01.py::test_pads_to_two_places - AssertionError: assert '3.5 kg'...
The book's own solution passes the same check. So the change the model proposed was wrong, and only the format failure kept it from being checked.
The example asserts that the run did not count as done, and that from the third step on every reply carries its file in triple quotes inside the call. The stop tool is the one tool that carries a whole file, so the format failure sits there. Chapter 3 returns to that tool and changes how a change is sent, which removes the triple-quoted file, though small edits bring quoting trouble of their own. It does not answer the misreading at step 2: a change sent in the right form can still be wrong.
Working rule: Replay a recording the same way on every run, and never edit it to make a run pass. A failing recording shows what the model really did. The fix belongs in the harness, the prompt or the model choice, and the result of that fix is a new recording.
무엇이 잘못되고, 무엇을 세는가
재생된 실행의 기록된 실행은 두 가지 방식으로 실패한다. 첫 번째 실패는 루프가 잡아내지만 바로잡지는 않는다. 형식이 잘못된 호출은 각각 모델이 읽을 수 있는 오류 결과로 돌아왔고, 단계 예산이 실행을 끝냈다. 두 번째 실패는 잘못된 변경이다. 루프는 이것을 보지 못한다. finish 호출이 하나도 파싱되지 않으므로 변경이 실행되지 않기 때문이다. 이 기록에서 모델은 잘못된 도구를 호출한 적이 없고, 호출 없이 응답만 남기고 일찍 멈춘 적도 없다. 형식 실패가 예산이 소진될 때까지 반복되었고, 그 실패가 오독을 가렸다.
이 책의 모든 실행은 네 가지 수치로 설명한다. 단계는 모델 호출의 수를 세고, 도구 호출은 형식이 잘못된 호출을 포함하여 요청(requests)의 수를 센다. 두 토큰 수는 실행 중 모든 요청에 걸쳐 합산한 프롬프트 토큰과 모델이 생성한 완성 토큰이다. 토큰은 기록을 만들 때 고정된 모델 자체의 토크나이저로 세며, 그 수는 기록의 매니페스트에 저장된다. 재생은 저장된 수를 읽을 뿐 다시 토큰화하지 않는다. 기록된 실행에서 프롬프트 토큰은 13009이고 완성 토큰은 2128이다. 각 단계가 전체 대화 기록을 다시 보내기 때문에 프롬프트 총합은 크다.
작업 규칙: 모든 실행에서 단계와 도구 호출을 같은 방식으로 세어, 두 실행을 비교할 수 있게 한다. 실행이 예산에서 끝나면 프롬프트나 모델을 바꾸기 전에 오류 줄을 읽는다. 오류 줄을 보면 모델이 하나의 실수를 반복하고 있는지 알 수 있고, 그에 따라 하니스의 어느 부분을 살펴야 하는지 알 수 있다.
이 장의 결정
- 도구는 하니스 자체의 프로세스 안에서, 작업용 사본을 대상으로 실행된다. 이 정도면 루프를 보여 주기에 충분하지만, 방어 수단은 아니다. 샌드박스가 도구를 가두기 전까지 이 사본은 쓰기가 닿는 자리일 뿐이다.
- 중지 도구는 파일 하나의 새 텍스트 전체를 받는다. 중지 도구가 담을 수 있는 가장 단순한 변경이며, 녹화된 모델이 파서가 읽을 수 있는 형식으로 보내지 못하는 변경이기도 하다. 다른 중지 도구를 쓰려면 새로 녹화해야 한다.
- 단계 예산은 8이다. 이 장의 작업에 필요한 단계가 대략 네 번이므로 숫자를 작게 잡았다. 작업에 맞는 예산이면 헤매는 실행이 눈에 띈다.
- 녹화된 실행은 일어난 그대로 보여 준다. 형식 실패와 오독을 모두 책에 남긴다. 통과하도록 고친 녹화는 존재하지 않는 모델을 보여 주기 때문이다. 녹화의 원본 응답은 집계 옆에 함께 보관하므로, 파서가 각 응답을 어떻게 해석했는지 누구나 확인할 수 있다.
작업 규칙: 이 결정 중 무엇이든 바꾸기 전에, 그 변경이 이 장이 출력하는 숫자에 어떤 영향을 주는지 따져 보라. 단계 예산이 바뀌면 단계 수가 바뀌고, 중지 도구가 바뀌면 새 녹화가 필요하며, 샌드박스가 생기면 도구가 닿는 범위가 바뀐다. 변경은 해당 장의 기준에 맞춰 하고, 결과를 믿기 전에 스크립트 예제와 녹화 예제를 다시 실행하라.
이 판의 이 장
2026.11.2판예제 통과 2026년 11월 20이 장에서 4개 예제개 중 4개가 통과한다
영어판 2026.11.2판을 번역한 것이다.