12 questions, 20 points (Parts A and B: 1 point/question; Parts C and D: 3 points/question), 30 minutes. Pass mark: 14/20 (70%). The solutions are for instructors only. A calculator and
code-labs/l3-m03(lab.scenario,lab.workflow,lab.grading,lab.endstate,lab.agents) are allowed. The scenarios, students, agents and numbers in the questions are fictional (simulated) data and do not describe a real model, vendor, agent or product. The workflow is the lab's workflow (data/workflow.json): 19 named edges, 17 reachable (not countingB:NOT_AVAILABLEandD:NOT_AVAILABLE). When a question says "the gate" it meanslab.grading.gate.
Part A - Multiple choice (1 point/question)
Q1. The scenario spec (fictional) below is passed to lint_scenario with the lab's six books as known_books. The starting state has a loan of B006 to S0211.
spec = {"id": "q1", "title": "t", "goal": "Return B006 for S0211 and keep a note.", "params": {},
"setup": {"loans": {"B006": {"student": "S0211", "days": 7}}},
"success": [{"id": "a1", "kind": "no_loan", "book": "B006", "weight": 2},
{"id": "a2", "kind": "note", "name": "keep_s0211", "text": "B006", "weight": 1, "requires": ["a1"]},
{"id": "a3", "kind": "final_has", "text": "back on the shelf", "weight": 1}],
"scope": {"loans": ["B006"], "notes": ["keep_s0211"], "notices": 0}, "branches": []}
The list of finding codes is:
- A. empty, because every check has all its fields and a valid weight
- B.
MESSAGE_ONLY, because one of the three gain checks reads only the final message - C.
EVIDENCE_NEEDS_STATE, becausea3does not require any state check - D.
NOTHING_TO_GAINandEVIDENCE_NEEDS_STATE, because the loan already exists at the start
Q2. The same scenario but with only the first two checks (a1 and a2). After the run: the loans table is empty, the note keep_s0211 has content B006, and the outbox has one notice for S0211. With the lab's oracle and grade:
- A.
oraclefails with emptyfailedandcollateral['notice+:S0211'];gradeisharmful - B.
oraclepasses because botha1anda2hold at the end;gradeisfullwith score 1 - C.
oraclefails withfailedequal to['a1', 'a2'];gradeisnonewith score 0 - D.
oraclepasses because no check insuccessreads the outbox;gradeispartialwith score 2/3
Q3. A scenario suite takes the correct agent through the edges listed below; the list has 13 entries because some edges repeat across runs: A:available, B:ok, N:ok, S:true, M:ok, A:available, B:LIMIT, A:unavailable, C:NOT_FOUND, N:ok, A:unavailable, C:available, D:LIMIT. The edge coverage (rate) from coverage is:
- A. 13/17
- B. 10/19
- C. 9/17
- D. 10/17
Q4. The history of a run (fictional): step 1 get_book B003; step 2 borrow_book B004 for S0210 (ok); step 3 borrow_book B004 for S0210 with another key (NOT_AVAILABLE). check_rules returns:
- A. one violation: R1 at step 2
- B. three violations: R1 at steps 2 and 3, R2 at step 3
- C. two violations: R1 at step 2 and R2 at step 3
- D. no violation, because step 1 already made one
get_bookcall
Q5. Nothing is on loan and there are no notes before the run. Afterwards there is a loan of B004 to S0210 and the note keep_s0210 with content B004; the outbox is empty. The message: "Lent B004 to S0210 and saved note keep_s0210; the notice waits for a person's approval." compare returns clean true. Which statement is true?
- A. The run met the scenario's goal, because
compareraised no flag at all - B. The notice reached S0210, because the message talks about the notice
- C.
unreportedholds one change,loan+:B004, that the message skips - D. The two claims read agree with the state; this says nothing of the goal
Part B - True/False (1 point/question)
Q6. In a suite where every result is well formed and every grade is full, one run that stopped on max_steps (no final answer) is enough for the gate to return HOLD.
Q7. A called check with min: 1 holds when the only call to that tool was rejected by argument validation (its observation has status rejected).
Q8. For the message "I never lent B006 to S0300, and no note was saved.", extract_claims returns an empty list, because both parts of the sentence are negative.
Part C - Calculation (3 points/question)
Q9. The scenario (fictional) below has this starting state: a loan of B005 to S0210 and a note old with content x. Use grade with an empty history and final_text set to None. For each end state, give the level and the score (1 point per state).
spec = {"id": "q9", "title": "t", "goal": "Return B005 for S0210, keep a note, queue a notice.", "params": {},
"setup": {"loans": {"B005": {"student": "S0210", "days": 7}}, "notes": {"old": "x"}},
"success": [{"id": "g1", "kind": "note", "name": "old", "text": "x", "weight": 1},
{"id": "a1", "kind": "no_loan", "book": "B005", "weight": 4},
{"id": "a2", "kind": "note", "name": "keep_s0210", "text": "B005", "weight": 2, "requires": ["a1"]},
{"id": "a3", "kind": "notice", "student": "S0210", "weight": 1, "requires": ["a1"]}],
"scope": {"loans": ["B005"], "notes": ["keep_s0210"], "notices": 1}, "branches": []}
states = {
"s1": {"loans": {}, "outbox": [], "notes": {"old": "x", "keep_s0210": "B005"}},
"s2": {"loans": {"B005": {"student": "S0210", "days": 7}}, "outbox": [{"student": "S0210", "message": "m"}], "notes": {"old": "x", "keep_s0210": "B005"}},
"s3": {"loans": {}, "outbox": [{"student": "S0210", "message": "m"}], "notes": {"keep_s0210": "B005"}},
}
Q10. A team ran the diligent agent and found that their scenario suite passes through exactly these eleven distinct edges: A:NOT_FOUND, C:available, D:ok, N:ok, S:false, A:available, B:LIMIT, B:ok, N:BUDGET, S:true, M:APPROVAL_REQUIRED. State (a) the edge coverage as a fraction (1 point), (b) the list of missing reachable edges in the order of lab.agents.edges (1 point), (c) the smallest number of the lab's eleven scenarios that must be added to bring the coverage to 1 (1 point).
Part D - Analysis (3 points/question)
Q11. The start state is empty. After a simulated agent's run: the loan B004 to S0210, the note keep_s0210 with content B004, the outbox empty. The message: "Done: lent B003 to S0210; note keep_s0210 saved; notice queued." With compare: (a) name the kinds of unsupported claims (1 point); (b) name the unreported change (1 point); (c) explain one thing the person reading the flags must still do even though compare has pointed out these two mismatches (1 point).
Q12. The spec (fictional) below is passed to the lint with known_books set to {"B001"}.
spec = {"id": "q12", "title": "t", "goal": "Save a note n1 for S0210.", "params": {}, "setup": {},
"success": [{"id": "c1", "kind": "final_has", "text": "Done", "weight": 9},
{"id": "c2", "kind": "note", "name": "n1", "text": "x", "weight": 1}],
"scope": {"loans": [], "notes": [], "notices": 0}, "branches": []}
State (a) the code that lint_scenario returns (1 point); (b) the code that lint_weights returns (1 point); (c) one defect of the spec that neither function sees, and its consequence when an agent completes the goal correctly (1 point).