Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

These exercises practice retrieving what the Module 3 reading explained, after you finish Lab 3. They aren’t graded. Write each answer on paper first, score any prompt you write with the prompt rubric, and then check your answer. Prompts have more than one good answer, so compare yours with the reasoning, not the wording. The hints and answers are in the collapsed blocks; open the first hint only when you are stuck, and an answer only after you have one of your own.

Worked example: rewriting a vague prompt

A clerk sends “Answer the customer.” with the ticket “Can I borrow a bike while mine is repaired?” Rewrite it by asking the rubric’s five questions in turn:

  1. Task: answer one customer’s question about a loan bicycle.

  2. Audience and purpose: the customer reads the reply by email, so it needs plain sentences.

  3. Context: the handbook’s section H04 says the shop has two loan bicycles, a rider signs a loan form first, and a loan is due back by 17:00 the same day.

  4. Constraints: with only two loan bicycles, the reply can’t promise one.

  5. Output and success: at most three sentences, and the reply must say that a clerk confirms availability.

Answer a customer who asked about borrowing a bicycle during a repair. The reply goes to the
customer by email, so write plain sentences without shop terms.

Shop policy (handbook section H04): the shop has two loan bicycles. A rider signs the loan form
before collecting one. A loan bicycle is due back by 17:00 the same day.

Write at most three sentences. Because the shop has only two loan bicycles, say that a clerk will
confirm whether one is free, rather than promising one.

Customer: Can I borrow a bike while mine is repaired?

The draft scored 1 for task and 1 for context (the ticket, without the policy), and 0 elsewhere: 2 out of 10. The revision scores 2 on each criterion, because each step above added one criterion’s evidence. That records a clear prompt, not a tested one.

Exercise P3.1 (LO-3.1, ★, about 10 minutes)

Rewrite “Check this” for a clerk who needs to find duplicate charges on an invoice. Name the evidence that counts.

Hint 1

What would the clerk accept as proof that one charge was billed twice?

Hint 2

Specify two charges with the same reference, rather than two products with the same price.

Answer

Ask for pairs of lines with the same charge reference and amount. Return the references, or “none” if no pair qualifies. One version:

Check this invoice for duplicate charges, for a billing clerk who refunds any charge billed
twice. Count two lines as duplicates only when they have the same charge reference and the same
amount. Two lines for the same product at the same price aren't duplicates if their references
differ, because a customer can buy two tubes. Return each duplicated reference on its own line,
or exactly "none" if no pair qualifies.

Invoice: <the invoice's lines>

The evidence that counts is the reference with the amount: a reference identifies one charge, so the same reference twice means one charge was billed twice. The clerk’s purpose, refunds, explains why false alarms matter. “none” gives the empty case an answer that code can check.

The common mistake is to name “the same product” or “the same price” as the evidence. That flags a customer who bought two tubes, and a refund for a real purchase costs the shop money. A second mistake is to leave out the “none” case, so a clean invoice gets a paragraph instead of a checkable answer.

Worked example: placing text in a request

A reply prompt for receipt requests has five pieces of text. Sort them by how long each one applies:

TextHow long it appliesWhere it goes
“You reply to customers of a bicycle repair shop.”Every requestsystem
The receipt policy: a receipt copy needs an invoice reference (H03)Until the shop changes itsystem
“Reply in English or Spanish, as the customer asks.”Every requestsystem
“Reply in Spanish.”This request onlyThe user’s turn
The ticketThis request onlyThe user’s turn

The question is never “Is this text important?” Every piece is. The question is whether it holds for every request the program sends.

Exercise P3.2 (LO-3.2, ★★, about 15 minutes)

A queue manager changes the policy for every ticket. A dispatcher sends a new ticket. Where does each text go?

Hint 1

Consider how frequently each changes.

Hint 2

One text applies to every ticket from now on. The other applies to one request.

Answer

Keep the revised policy in the system field and put the ticket in the user turn.

The policy applies to every ticket from now on, so it belongs with the other stable rules. It changed once, and it stays fixed until the next change. Record the change as a new version of the prompt, as Module 4 shows, so you can tell which tickets saw which policy. The ticket changes with every request, so it belongs in the user’s turn.

The common mistake is to put the new policy in the user’s turn because it is new or urgent. How recently a rule changed doesn’t decide where it goes; how long it applies does. A policy pasted into each ticket is also a copy that no one reviews, and copies drift apart.

Worked example: valid but wrong, and right but invalid

A customer asks for the receipt for a brake repair, as in ticket T14. A queue contract that prioritizes the active request gives Label: billing. Here are four outputs, judged by the format check and by comparison with the reference label, billing:

OutputFormatMeaning
Label: billingvalidright
Label: repairvalidwrong
Billing.invalidright
Label: refundinvalidwrong

Your parser should recognize the shape of Label: repair too, because the shape is all it checks. The labeled ticket is how you decide which valid output is correct.

Exercise P3.3 (LO-3.3, ★★, about 15 minutes)

Construct a valid but wrong output and an invalid but semantically right one for T11, a request about a charge for a returned part.

Hint 1

Decide T11’s reference label first. Is the customer asking about a part, or about a charge?

Hint 2

T11 belongs to billing.

Answer

Valid but wrong: Label: repair. Right label, wrong format: The answer is billing.

T11 reads “I was charged for a part I returned,” and the customer wants the charge fixed, so its reference label is billing. Label: repair passes the format check, because it is one of the three exact strings, and fails the comparison with the reference. The answer is billing. names the right queue, so a person reading it would route correctly, but the format check rejects it. Label: account, label: billing, and Label: billing with a trailing newline work too.

A common mistake is an “invalid” output that is also wrong, such as Label: refund. It fails both checks, so it can’t show that they are independent. Another is to label T11 repair because it mentions a part: the part is the topic, but the charge is the request.

Exercise P3.4 (LO-3.1, LO-3.3, ★★★, about 25 minutes)

Write a two-sentence policy for a ticket that asks about two active issues. Design a visible check of your choice.

Hint 1

The reading’s two-topic rule assumed one issue was finished. What if neither is?

Hint 2

Choose one priority rule or an explicit fallback.

Answer

One policy chooses the first explicit request. A ticket asking first about a receipt and then a flat tire should yield exactly Label: billing.

As two sentences: “When a ticket asks about two active issues, route it to the queue of the first explicit request. Return only that one label, and the dispatcher forwards the other issue.” The check is a test case with its reference label. Add the same two requests in the other order, expecting Label: repair, because a policy based on order should change its answer when the order changes. Without that second case, a prompt that always picks billing for receipts would pass too.

An explicit fallback works as well, such as a fourth value, Label: review, for a person to sort. The output contract then has four values, so the parser and its tests must accept the new one.

The common mistake is a policy no check can test, such as “use your judgment.” Another is a test with only one order, which can’t tell a rule about order from a rule about topics.