Static reading edition · s04-01
Delegate independent work with a clear contract
Choose a useful subtask, give it sufficient context and retain responsibility for the integrated result.
Understand the approach
Delegation is useful when independent work can proceed against a clear shared contract. The capstone has two implementation files: starter/normalize.cjs converts status strings, while starter/report.cjs aggregates already normalized records. Package B does not need to wait for A's implementation because CONTRACT.md defines B's input in advance. The parent retains integration and the final decision about whether the combined result meets the contract.
Read the actual starter before assigning roles. normalizeStatus currently lowercases without trimming; buildReport currently sums every task's minutes. The supplied four-record dataset therefore produces done=1 and doneMinutes=80. The intended result is total=4, done=2 and doneMinutes=55. These distinct causes justify two bounded packages with separate owned files. Assigning both workers the whole lab would introduce an unnecessary collision.
A useful brief names its input, owned file, interface, expected evidence and exclusions. Give A the normalization boundary cases and B the normalized-record requirements. Ask each to return its diff and actual checks. Then run the combined candidate and boundary tests yourself. Sequential implementation is a valid comparison; the local simulation is explicitly not agent activity. State which method actually produced the candidate instead of inferring delegation from a tidy ledger.
native-agent-guide.md supplies the actual client walkthrough: open the disposable capstone project in the app, send the exact two-owner prompt, inspect each subagent thread from its activity and keep the combined check with the main agent. CLI uses /subagents; the IDE can show a background-agent panel. A and B receive CONTRACT.md plus their exact starter paths, not an unbounded fix-everything assignment. Return actual paths, diffs and observed checks. Current releases document subagents by default; this exercise needs no invented experimental team flag.
Two independent work packages meet at one interface
The parent supplies the frozen normalized-task interface. Owner A fixes status normalization while owner B fixes aggregation against that interface. Their code and evidence meet at integration, where the four learner candidate tests check the combined result.
Practice and acceptance
Parallelism is justified by independent inputs and disjoint ownership; the final result depends on both packages.
About your environment
Checked 21 October 2026. Use current Codex delegation controls; the exercise assumes only the provided practice project.
Try it step by step
- Run the capstone starter and read its actual failed checks before assigning work.
- Read CONTRACT.md and identify the independent normalization and report interfaces.
- Assign A only starter/normalize.cjs and B only starter/report.cjs; reserve integration for the parent.
- Implement the packages sequentially or use actual Codex subagents in the disposable copy, preserving the frozen contract.
- Run the combined starter after edits, inspect both files and reconcile actual output with the target; identify unrun client behavior.
A useful starting example
Illustration · adapt before use.
In a disposable copy of labs/delegation-capstone, read CONTRACT.md and work-packages.json. Establish the broken baseline first. Delegate A to own starter/normalize.cjs and B to own starter/report.cjs; neither may edit the other's file, runner, fixtures or tests. Each returns its changed file, observed boundary checks and remaining gaps. Keep integration with the parent. After both return, inspect the combined diff and run node labs/delegation-capstone/run.cjs starter and node --test labs/delegation-capstone/candidate.test.cjs from the extraction root. Report actual agent activity and actual results.One bug report, two independent packages
The fixture contains padded statuses and incomplete tasks with effort.
node labs/delegation-capstone/run.cjs starter
node labs/delegation-capstone/run.cjs solutionStarter: total=4, done=1, doneMinutes=80; passed=false
Reference: total=4, done=2, doneMinutes=55; passed=trueThese are observed code outputs. They say nothing about how many agents implemented the solution.
Your turn
In a disposable capstone copy, fix both starter modules against the frozen contract without opening the solution first. Use work-packages.json to divide ownership. If you delegate in Codex, retain actual child handoffs; if you implement sequentially, say so. Deliver the combined candidate's real report and boundary evidence, not only two proposed briefs.
Try the exercise before opening its reference answer. Use a disposable practice folder.
Divide a real two-module implementation
Extract into a new practice folder and keep the included labs folder. Run these commands from that extraction root, or from the course folder, using an existing Node.js installation.
- Command 1 text
node labs/delegation-capstone/run.cjs starterCheck: Intentional exit 1: done=1 and doneMinutes=80.
- Command 2 text
node labs/delegation-capstone/run.cjs solutionCheck: Exit 0: total=4, done=2, doneMinutes=55; five integrated checks pass.
- Command 3 text
node --test labs/delegation-capstone/candidate.test.cjsCheck: The unedited starter intentionally fails 4 candidate checks; all 4 should pass after both fixes.
Parallelism is justified by independent inputs and disjoint ownership; the final result depends on both packages.
Check your result
- A and B own different implementation files against the same frozen interface.
- The edited candidate returns total=4, done=2, doneMinutes=55 and preserves source inputs.
- The report identifies actual sequential, simulated or Codex-delegated work without inventing agent activity.
Reference answer & rubric Try the exercise before opening
A trims/lowercases and validates statuses; B validates normalized records and sums only completed effort. They can work independently because their interface is fixed.
- Reproduce starter done=1 and doneMinutes=80; locate the separate normalization and aggregation defects.
- Implement A without editing B or fixtures.
- Implement B against normalized inputs without adding normalization to it.
- Compose the modules via run.cjs and require total=4, done=2, doneMinutes=55 with no source mutation.
Check your understanding
Which division fits the capstone once the interface is frozen?
- Both workers rewrite both starter files without an owner.
- One worker invents the contract while the other changes tests to match.
- A owns normalization, B owns aggregation, and the parent checks their combined result.
Reveal the answer and explanation
Answer 3: A owns normalization, B owns aggregation, and the parent checks their combined result.
A and B can work independently against the frozen interface with disjoint file ownership; integration waits for both outputs.
Take this quiz in the interactive lesson to save your answer in the browser.
When it does not work
Both workers edit the runner to make their code fit.
Likely cause: Ownership and the shared interface were not fixed first.
What to try: Restore the runner in the practice copy and assign one owner per implementation file.
Two passing child summaries are treated as final completion.
Likely cause: No integrated candidate was checked.
What to try: Run the actual combined files and retain its output; inspect failures even when individual reports sound complete.
Common mistakes
- Splitting a tiny sequential task into many agents without a time or quality benefit.
- Assuming separate agent threads automatically provide separate copies of project files.
Source mapping & differences · equivalent
Codex supports delegated agent workflows, but context, permission inheritance and client controls must follow Codex behavior.
Source topic: Overview ↗Go to the source
Official documentation, checked 21 October 2026. Product names, controls and availability may vary with your version, platform or account.
Completion and quiz progress are saved
only in the interactive course.