Lesson 4 of 5
What happens when two workers change the same thing?
Every worker so far has written to its own files, by assignment. This lesson removes that rule to show what it was preventing, then puts it back in a general form. Two workers change the same paragraph of the recommendation, and one of the changes disappears. The lesson separates two questions that are easy to run together: how to keep workers from damaging each other's work, which is isolation, and how to make one result out of several, which is integration, and which belongs to someone.
Numbered links identify sources. Underlined terms offer a definition without leaving the lesson.
The collision: two workers, one paragraph
Suppose the treasurer, trying to save a step, lets F-Greenway write its findings straight into the costs paragraph of recommendation.txt instead of into its own facts file, while assignment R, running in another session, drafts the same paragraph from the returns already in. Here is the authored record of what the two sessions did to the file, in the trace format from module 3, with the two sessions' lines interleaved by time. Each write_file asked first and was approved; the ask lines are shown once and abbreviated after that.
1 [R: call] read_file recommendation.txt
2 [R: observation] (draft; costs paragraph empty)
3 [F-G: call] read_file recommendation.txt
4 [F-G: observation] (draft; costs paragraph empty)
5 [R: call] write_file recommendation.txt (whole file: costs paragraph
now holds Marlow and Fernbank figures)
6 [harness] Asking before a file write. [person] approved
7 [R: observation] written
8 [F-G: call] write_file recommendation.txt (whole file as read at line 4,
with Greenway figures in the costs paragraph)
9 [harness] asked; approved
10 [F-G: observation] written
The final state: recommendation.txt has a costs paragraph containing Greenway's figures and nothing about Marlow or Fernbank. R's paragraph existed between lines 7 and 10 and is gone. Neither session saw an error, and the person approved both writes, because each looked reasonable on its own. Each session read the file, changed its copy in context, and wrote the whole file back, and module 2's rule decided the outcome: a whole-file replacement leaves the contents supplied by that write. This course calls the event an : two workers change one stored thing from separate, stale views of it, and the later write replaces the earlier one without either worker knowing.
The outcome is specific to how the writes were made. A tool that rewrites a whole file from a copy in context loses the other worker's change entirely. Other arrangements fail differently: two partial edits to different lines can both survive, two edits to the same line can produce a conflict a version-control tool reports rather than silently resolves, and a write tool that checks the file has not changed since it was read can refuse the second write. What the arrangements share is that a worker acting on a stale view is the cause, and that the harness's write tool, not the worker's intention, decides what happens.
The two workers were in separate sessions. That protected nothing here. A session, as module 4 defined it, is the harness's record of one piece of work, separate from other sessions' records. The file is not in either session. It is on the host, and both sessions had a tool that writes it. Separate chat windows, separate conversations, separate machines connected to the same folder: none of these by itself isolates a file that both can write. Keeping one session per project is an organizing preference for the same reason; it separates contexts, and it separates folders and permissions only if something else does.
Separate sessions are not separate permissions either
A related assumption is that a worker's role limits what it can do. A worker called "reviewer" sounds as though it cannot edit; a worker called "fact-gatherer" sounds as though it cannot post. The name does nothing by itself. What a worker can do is set by several things at once: the harness's rules for its tools, which module 3 placed in the permission layer; the credentials the harness holds for each outside service, which module 2 introduced; and the the process runs in, module 5's term for the runtime, files, permissions and network the operating system gives it. A worker with no harness rule against posting can still be unable to post because the harness holds no credential for the board, or because the environment has no network route to it. A worker with every credential can still be stopped by a harness rule.
OpenCode's documentation for its agents feature shows the harness part of this in the product's own configuration. A reviewer agent there is read-only because its configuration denies editing and denies running commands, not because it is called a reviewer; when one agent starts another as a subtask, the child uses its own configured permissions rather than the parent's; and a setting that hides an agent from the interface controls only whether it is visible. 5 That is one product's configuration on the date it was read. What transfers is the check: for each worker, find what actually limits its actions, in the harness rules, the credentials and the environment, and treat any limit that exists only in the assignment's wording as an instruction, with everything module 3 and module 8 said about instructions.
Isolation: each worker changes only its own copy
The rule the assignments were following is isolation: each worker changes only a that no other worker changes, and the shared state is changed in one place, by one step, after the parts are combined. In the document case the working copy is the worker's own output file and its own page folder, and the shared document is written once by the integration step. Where the parts really are edits to one document, each worker gets its own copy of the document and the integration step merges them, which is harder, since two changes to the same paragraph still have to be reconciled by someone, but the reconciliation is now visible instead of silent.
Separate working copies are one remedy that fits this case. Others act on the write itself: a lock that lets one worker at a time hold a file, or a version check that makes a write fail if the file changed since it was read, so that the second writer has to read again; or, where there is no coordinator, a merge rule every worker follows before writing to a shared file. Which is available depends on the tools; the assignments used isolation because the harness in this case offers only plain reads and whole-file writes. Isolation also has a scope. It keeps workers from damaging each other's files. It does nothing about a shared outside service: two workers each posting to the board, or each sending an email to the same supplier, collide there whatever their folders look like, and that collision is handled by module 8's rules for external effects and by giving one worker the effect.
For code, version control, which module 2 introduced and the optional module 7 covers in use, provides isolated copies and an explicit merge with its own record. Anthropic's February 2026 account of building a C compiler with sixteen agents in parallel shows that isolation of files is not the whole story. The agents ran in separate containers, claimed tasks through lock files in a shared repository, and had no orchestrating agent; the author, Nicholas Carlini, still reports an episode in which several agents each hit the same bug, each fixed it, and overwrote one another's fixes, and the remedy he describes was not more locking but breaking the diagnosis into narrower, separately defined tasks checked against a reference compiler. 3 That is one author's report about one code project with a vendor's own models, and neither the agent count nor the outcome transfers. What transfers is that a collision can happen at the level of the task as well as the file: two workers can hold separate copies and still be doing the same work, and only the map, or the rules the workers follow, keeps them apart.
Integration is a separate responsibility
Isolation keeps the parts intact. It does not make one result out of them. The does that, and it is a piece of work with its own owner, its own checks and its own place in the map, not a matter of putting the returns end to end. Combining outputs by concatenating them produces a document with three costs paragraphs in three voices, two figures for one delivery charge, and a Fernbank verdict that one part calls met and another calls unknown.
The integration step for the supplier decision, which is assignment R, does four things. It checks each return against its assignment, as lesson 2 described. It resolves disagreements between returns by going to the origins: where two returns give different verdicts for one item, the saved page decides, as it did for Fernbank, and where the page cannot, the table records the disagreement rather than choosing silently. It writes one document from the reconciled table, in one voice, with every figure either traceable to a passage or derived by arithmetic the table shows. And it runs module 8's checks on that document before it goes anywhere: a program can confirm that every figure in the recommendation appears in the table or is a shown sum of table figures, and that every table cell names a passage or a derivation, and a person reads whether the recommendation follows from the table.
Those checks establish what they test and no more, as module 8 said of every checker. An integration step with all of them can still pass a recommendation whose one traced passage was misread, or whose rubric left out the item that mattered. The compiler account is useful on this point too: that project could run its agents unattended because it had a reference implementation whose output defined correctness for the cases the tests put to it, and the author warns that in unattended work it is easy to see tests pass and assume the job is done. 3 A reference is decisive for the cases it defines and silent elsewhere, and this open-ended recommendation has no complete reference answer. Its integration step has the rubric, the origins and a person, and it needs all three, because splitting the work multiplied the places an error could enter.
Carry this forward
- An edit collision is two workers changing one stored thing from stale views of it. With whole-file writes the last write replaces the earlier one silently; other write tools fail differently, and the tool, not the intention, decides. Separate sessions do not by themselves isolate a file both can write.
- A worker's role label limits nothing by itself. Its actions are bounded by the harness's rules, the credentials the harness holds, and the execution environment; a limit that exists only in the assignment's wording is an instruction.
- Isolation, each worker to its own working copy with the shared result written once, is one remedy; locks and version checks are others. Isolation protects files, not shared outside services.
- Integration is a separate responsibility with an owner: check each return, resolve disagreements at the origins, write one document, and run the checks on it. Concatenating returns is not integration, and integration with checks can still miss what the checks do not test.
Lesson check
Choose an answer for each question.
This is a practice check. Answers reset when you leave this page. Results are not saved and do not place you in another module or award a qualification.
The workers are isolated and the integration has an owner. What remains is to ask whether all of this was worth it, which the last lesson counts.
Sources · Reviewed 2026-09-29
- 5. OpenCode documentation: Agents
- 3. Nicholas Carlini, Anthropic (5 February 2026): Building a C compiler with a team of parallel Claudes
Sources support nearby explanations. Product details can change. Scenarios and model results are authored illustrations unless a lesson explicitly identifies a recorded execution. Module 7 identifies its offline code checks.