Module 3 · Planning, Context & Multi-agent Systems · scripted
The Task Is a Directory
From tree to filesystem
The decomposition tree we just built was a diagram. Now meet the most common way real systems make it physical — a pattern so natural it feels obvious the moment you see it, and so powerful it carries most serious agent projects today: give every task a directory.
The mapping
the task → a directory
its brief → a file of rich context (TASK.md)
its bar → a file of what must be true (CHECK.md,
plus check.sh when the bar is executable)
the work → files created inside, as it happens
its completion → a result file, written at the end
(RESULT.md)
its subtasks → subdirectories — same shape, recursively
The tree of tasks becomes a tree of folders.
Everything about the work becomes a document in the right room.Anatomy of one task directory
A leaf, opened up
Three documents define the task: what it is, what true means, and — when it exists — what happened. The work directory is scratch; the three documents are the contract.
Notice what the two top files really are. TASK.md is the brief
from the seam contract — rich context, self-contained, the child
asks no questions. CHECK.md is the evidence bar — and giving
it an executable form, check.sh, is the hard-evidence principle
made into a file you can run. The directory is the seam
contract, written down where the work will happen.
An agent is spawned into a room
Now the coordination move: to work on a task, spawn an agent whose world is that directory. Its first act is always the same — read the room:
You are working in portal/ingestion/ntnu-adapter/. Read your
task, do it, verify it, and write your result. Tools:
read_file, write_file, run_command — scoped to this
directory (plus read access to ../schema/).
⟨tool_use⟩
read_file(path = "TASK.md")⟨tool_result⟩
[the brief: format quirks, the A2-v1 interface pointer, scope]⟨tool_use⟩
read_file(path = "CHECK.md")⟨tool_result⟩
[the bar: conformance on 3 samples, UTC/meters, no silent drops]⟨tool_use⟩
write_file(path = "work/parse.py", content = "[the adapter]")⟨tool_use⟩
run_command(cmd = "./check.sh")⟨tool_result⟩
FAIL: sample-3: 2 rows dropped without log entries (trailing
summary rows discarded silently).⟨tool_use⟩
write_file(path = "work/parse.py", content = "[logs rejected
rows explicitly]")⟨tool_use⟩
run_command(cmd = "./check.sh")⟨tool_result⟩
PASS: 3/3 samples · 4,112 rows · UTC/meters confirmed ·
rejects logged (2). Log: work/sample-runs/run-9.log⟨tool_use⟩
write_file(path = "RESULT.md", content = "Adapter complete at
work/parse.py. Evidence: check.sh PASS 3/3 (run-9.log).
Note for parent: NTNU's summary rows are data-like — flagged
as rejects, worth a rule upstream.")The hierarchy is the visibility
Climb up a level and see what the folder tree is really doing:
The tree, as a coordination structure
This is the placement discipline, implemented by a filesystem.
Scope-by-subtree is carry/fork/file with mkdir: the child's
wall holds its room; the parent's wall holds result files, one
line and a handle each. And the coordinator's completion sweep is
almost embarrassingly simple:
Completion, as a directory walk
"Which subtrees are done?" is not a judgment call —
it is a find command:
done = RESULT.md present AND its evidence green
open = TASK.md without RESULT.md
suspect = RESULT.md present, check now failing
(the world moved — reopen the room)
The project's status dashboard is the tree itself.Why files
Step back and ask why this pattern keeps winning, and the answer is the course's oldest thesis wearing work clothes: everything is a document — so let the work be documents.
What the filesystem buys
Methodologies ride on the chassis
One more reason this pattern matters: it is a chassis, not a methodology. The structure — a room with a brief, a bar, work, and a result, nested — doesn't care how your domain likes to decompose. Your discipline's own scheme drops straight in:
Three methodologies, one chassis
Different fields, different names for the rooms, different bars on the walls. Same chassis: brief, bar, work, result, nested. The methodology chooses WHAT the tasks are; the pattern handles HOW work lives, closes, and composes.
- In Example 1, the agent passed a note upward inside RESULT.md. Trace where that note should go next — whose TASK.md or CHECK.md does it want to change, and who decides?
- What belongs in TASK.md versus the spawned agent's system message? Something must — and something must not — be in each. Draw the line and defend it.
Take the decomposition tree you built in the earlier fork and
make it physical. (1) Lay out the directories; write TASK.md and
CHECK.md for the root and two leaves — the bars as runnable
checks where the world can testify, critic prompts where it
can't. (2) Write the RESULT.md a finished leaf should produce,
evidence included. (3) Map your field's own methodology onto the
chassis: what are the rooms called, and what is the bar on each
wall? (4) Then the test of the pattern: hand your tree, cold, to
a colleague — can they tell you what's done, what's open, and
what's blocked, using nothing but ls and the documents?