Repository navigation
Production Recap 4 · The lifecycle, the gates and the ambition ladder #27
akash-coded
started this conversation in
Exercises
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Exercise 4: The lifecycle and building the agent
Language: Python, concept, diagrams Topics: P0 to P3, gates, ambition ladder, doors, tools as contracts, the loop and its guard Level: applied (debugging enters here)
Fourth foundation. Reading and spotting are assumed now; you also find and fix bugs. Each fix is one specific change, given as an option.
Q1. A team ships to P3 with no eval suite and no instrumentation. Which gate did they fail, and the named consequence?
Show answer
A) A supervised MVP with instrumentation and an eval suite is the P2-to-P3 gate. Skip it and P3 cannot begin.
Q2. The agent can (i) show rebooking options and (ii) confirm a rebooking that charges a fare difference. Autonomy differs because:
Show answer
B) A two-way door can run on its own. A charge is a one-way door, so it needs a human. The axis is reversibility, not test coverage.
Q3. This loop has one defect that makes it unsafe before QA even starts. The fix is:
toolResultis missing itstoolUseId, so the model cannot bind itwhile Truehas no turn cap, so a mis-stepping model loops without endstopReasonshould be compared withend_turn, nottool_useShow answer
C) The id is present and the ordering is fine. The missing piece is a bound like
for turn in range(max_turns). No stop condition is a runaway.Q4. This loop returns the right answer for a Gold passenger but is still broken. The bug is:
assistant, notuserTOOLS[block["name"]]should be handed the whole tool-use block object, not only its parsed input dictionarytoolUseIdis hardcoded to"tool"instead ofblock["toolUseId"], so results do not bind to their callsShow answer
D) A fixed id happens to work with one call in flight, then binds results to the wrong call. Use
block["toolUseId"].Q5. Complete the agent loop. Bank: a) has enough b) needs data c) on error d) on approval
Show answer
blank 1 = b (needs data), blank 2 = a (has enough). The
T --> Medge is the loop-back: read the result, decide again.Q6. Order the six agent parts the way they were assembled, given that model access is already in place:
guardrails·tools·orchestration·instructions·memory·modelShow answer
A) Model, then the role and rules, then the tools, then session memory, then the loop that drives them, then the guardrails around it.
Q7. A handler runs the same three steps every time, no judgement, no branching. On the ambition ladder it is:
Show answer
B) Fixed steps with no judgement need no model at all. Climb only when a lower rung genuinely cannot do the job.
Q8. Two candidate wirings for the same agent. Which is correct?
flowchart TD subgraph X["Option 1"] Ua["A2UI"] --> Aa["Agent: loop, guardrails, memory"] Aa --> Ta["Tools"] Aa --> Ka["Knowledge Base"] end subgraph Y["Option 2"] Ub["A2UI"] --> Tb["Tools"] Tb --> Ab["Agent: loop, guardrails, memory"] Ab --> Kb["Knowledge Base"] endShow answer
C) The UI reaches the agent; the agent then calls tools and the knowledge base. In Option 2 the tools sit between the UI and the agent, which is wrong.
Q9. Match each gate to what must be true to pass it. Bank: a) value beats cost and the task needs an agent b) autonomy set, tools contracted, acceptance bar written c) supervised MVP runs, instrumentation on, eval suite exists d) eval passes the bar, guardrails hold, sign-off signed
Show answer
1 = a, 2 = b, 3 = c, 4 = d.
Q10. Which of these are one-way doors that need a human gate? (select all that apply)
Show answer
B and D. A charge and a refund are hard to undo. Showing options and reading a record are reversible.
Q11. Why is the P1-to-P2 acceptance bar called the hinge of the whole build?
Show answer
D) You cannot validate in P3 what you did not define in P1. The bar turns QA from an argument into an evidence check.
Q12. The brain looks up the booking, finds the cancellation cause, then fetches alternatives. For
cancel RZ73KP, options?the trajectory is:lookup_pnrthenget_cancellation_causethenget_alt_trainslookup_pnrthenget_alt_trainsget_alt_trainsthenlookup_pnrthenget_cancellation_causelookup_pnrthenget_cancellation_causeShow answer
A) Look up the booking, find why the train died, then fetch alternatives for the PNR and tier.
Q13. Match each loop line to its effect. Bank: a) records the model's turn in history b) binds the tool result to the call that asked for it c) ends the loop once the model stops asking for tools
Show answer
1 = a, 2 = b, 3 = c.
Q14. Why does the tool-use loop need a maximum-turn guard even before QA begins?
toolResultid to thetoolUseidShow answer
B) No stop condition means a runaway loop that burns tokens. The guard is also what makes did it stop an answerable question in QA.
Q15. True or False: a one-way door like a charge should sit behind a human gate, while a two-way door like showing options can run automatically.
Show answer
A) True. Autonomy follows reversibility: reversible actions can run on their own, irreversible ones get a human.
All reactions