Exercise 02: Tiered Pipeline¶
Objective¶
Act as the planner and run 3 NOTIF scenarios through the pipeline, routing each to the correct tier of subagents.
Tiered Routing Required
This exercise must use the correct tiered subagent_types. Trivial issues use jg-worker-fast, jg-tester-fast, jg-reviewer-fast. Standard issues use jg-subplanner, jg-worker, jg-tester, jg-reviewer. Complex issues use jg-subplanner-high, jg-worker-high, jg-reviewer-high. The grader verifies tier routing.
Required Reading
- Expert walkthrough scenario -- the 3 NOTIF issues
- Expert walkthrough routing log -- reference routing decisions
- Agent Registry -- tier routing table
- Custom Agents | Cursor Docs -- Agent definitions with
subagent_typefor dispatching tiered agents - Developing Features | Cursor Learn -- End-to-end feature development with agents
- Agent Skills | Cursor Docs -- How the
jg-pipeline-artifact-ioskill guides artifact I/O during pipeline execution
In Cursor, use subagent_type to dispatch tiered agents. The artifact structure (plan.json, worker-result.json, etc.) and tier_used tracking are identical across environments.
In Claude Code, tiered routing maps to model selection per stage. Instead of subagent_type="jg-worker-fast", you would prompt a faster/cheaper model directly. The artifact structure (plan.json, worker-result.json, etc.) and tier_used tracking are identical.
Context¶
3 issues from the notification system scenario, each at a different complexity level:
| Issue | Description | Tier |
|---|---|---|
| NOTIF-001 | Define notification API contract | Trivial -> Fast |
| NOTIF-002 | Implement notification service | Standard |
| NOTIF-003 | Add real-time WebSocket delivery with rate limiting | Complex -> High |
Tasks¶
NOTIF-001 (Fast tier)¶
- Create
sandbox/.pipeline/NOTIF-001/ - Skip subplanner (trivial tasks skip planning)
- Delegate to
jg-worker-fast: implementsandbox/src/notifications/types.ts(TypeScript interfaces) andsandbox/docs/api/notifications.md(API doc). Writeworker-result.jsonwithtier_used: "fast"and"produced_by": "jg-worker-fast". - Delegate to
jg-tester-fast: Phase 1 only (lint, typecheck). Writetest-result.jsonwithtier_used: "fast". - Delegate to
jg-reviewer-fast: scope check. Writereview-result.jsonwithtier_used: "fast". - Delegate to
jg-git: branch, commit. Writegit-result.json.
NOTIF-002 (Standard tier)¶
- Create
sandbox/.pipeline/NOTIF-002/ - Delegate to
jg-subplanner: writeplan.json. - Delegate to
jg-worker: implement service and tests. Writeworker-result.jsonwithtier_used: "standard"and"produced_by": "jg-worker". - Delegate to
jg-tester: Phase 1 + Phase 2. Writetest-result.jsonwithtier_used: "standard". - Delegate to
jg-reviewer: full review. Writereview-result.jsonwithtier_used: "standard". - Delegate to
jg-git: branch, commit. Writegit-result.json.
NOTIF-003 (High tier)¶
- Create
sandbox/.pipeline/NOTIF-003/ - Delegate to
jg-subplanner-high: writeplan.jsonwithrisk_notes. - Delegate to
jg-worker-high: implement WebSocket handler, rate limiter, notification pusher, and tests. Writeworker-result.jsonwithtier_used: "high"and"produced_by": "jg-worker-high". - Delegate to
jg-tester: Phase 1 + Phase 2. Writetest-result.json. - Delegate to
jg-reviewer-high: architecture and security review. Writereview-result.jsonwithtier_used: "high". - Delegate to
jg-git: branch, commit. Writegit-result.json.
Required Schema Fields¶
Every worker-result.json must include ALL of these keys (even for trivial tasks):
- status (string): "completed", "failed", or "escalate"
- files_changed (array): list of files modified
- blockers (array): empty array [] if none
- summary (string): description of work done
Do NOT omit blockers or summary -- the schema validator will reject the artifact.
Validation
python3 docs/expert/tutorials/verify.py --exercise 02
Checks: all 15 artifacts exist (5 per issue), pass Expert schema.py, tier_used values correct per issue, NOTIF-001 has no plan.json, worker-result.json produced_by matches expected agent per tier.
Reflection
- How did you decide which tier to route each issue to?
- What if NOTIF-001 turned out to need tests? Would you reclassify?
- Compare the total artifacts produced vs a single-tier approach. What's the overhead vs benefit?
Answer
NOTIF-001 (Fast): 5 artifacts, NO plan.json. Worker uses jg-worker-fast with tier_used: "fast". Tester uses Phase 1 only.
NOTIF-002 (Standard): 6 artifacts including plan.json. Worker uses jg-worker with tier_used: "standard". Full Phase 1 + 2 testing.
NOTIF-003 (High): 6 artifacts including plan.json with risk_notes. Worker uses jg-worker-high with tier_used: "high". Full testing + architecture review.
Common mistakes: including plan.json for NOTIF-001 (trivial skips planning), wrong produced_by values, omitting blockers or summary from worker-result.json.