Every rule fired correctly. My agent was still confidently wrong.
TL;DR. My agent weighed who said what, and every rule in it fired exactly as written. It still told a user the opposite of what the person in charge had just said, and called it confirmed. Two safety rules collided with
TL;DR. My agent weighed who said what, and every rule in it fired exactly as written. It still told a user the opposite of what the person in charge had just said, and called it confirmed. Two safety rules collided with a document the agent had found on its own. My first fix was for the wrong bug, and its unit test passed anyway.
If your agent retrieves documents, weighs sources against each other, or runs more than one guardrail, this is a bug worth looking for in your own code:
- Evidence your agent finds itself is old news with a new timestamp.
- Safe rules can combine into an unsafe answer. Test them together, not one at a time.
- A test built on guessed numbers can pass while the bug lives. Rebuild the real state.
Here's how it happened.
Sunday, 7:30pm. The class rep posts: "Update from Dr Ade: the CSC 505 test has moved to Friday 4 December, same time, Hall B."
My agent read it, and told the student: "keep preparing for Thu 3 Dec." When the student asked, it said the test was on Thursday, and confirmed.
The model wasn't the problem. Neither was the data. Two fair rules, each written to keep students safe, met each other and produced a confident wrong answer.
This is that debugging story, and the one two days before it that went the other way.
Written for the Near Miss side quest of AgentWare 2026, run by Hackathon Raptors (@partnerships_raptors).
What Homing does
In a Nigerian university, classes run on WhatsApp and Telegram groups. Venue changes, cancelled lectures and new test dates arrive in the middle of hundreds of messages, often second-hand: "Dr Ade said in class it's now Friday."
Homing watches those groups for you. It reads every message, file and photo, keeps your deadlines, and tells you only what matters. When people disagree about a date, it weighs them.
The split that matters for this story:
- The model proposes. Meta's Muse Spark labels each message ("this is a deadline") with a quote, and plans the research for each test.
-
Code decides. Code checks every quote word for word, reads every date, and decides whether a date is settled or disputed with fixed evidence rules in
verify/evidence.py. No model call is involved in that decision.
Each claim about a date gets points:
| Evidence | Points |
|---|---|
| Posted by a rep or in the official channel | 3 |
| First-hand from a classmate ("I was there") | 2 |
| Passed on, or no source | 1 |
| Quotes the lecturer | +1 |
| A document (the course outline, a photo of the sheet) | +2 |
| Each other person agreeing (up to 2) | +1 |
| The newest claim | +1 |
Claims that give the same date form a position. One rule sits above all the others: while a date is disputed, plan for the earliest date anyone gave. Early costs nothing. Late costs marks.
Near miss 1 (hour 17): a rule to stop noise silenced the safe answer
The first live test, on 28 November, in a real Telegram group:
11:32 classmate: "CSC 505 assignment 1 is due tomorrow by 10am" (no source: 1 point)
11:34 classmate: "Dr Ade said in class today that the CSC 505
assignment 1 is now Friday" (first-hand 2 + lecturer 1 + newest 1 = 4)
Homing's alert: "due Fri 04 Dec", settled.
That is the dangerous direction. If the first message was right, a student who trusted Homing turns up a day late.
Why. I had a rule to stop noise: only a position worth 2 or more points can dispute a date. It exists so a lone "isn't it Thursday?" can't unsettle the rep. But here it also threw away the only earlier date, so the later one won unopposed. A rule written to protect the student had quietly switched off the rule it was there to protect.
Fix (47bf11f). When the heavier side means less work (a later date, or "cancelled") and no rep, official channel or document backs it, any earlier date keeps it disputed, however weak. The same live test now reads:
CSC 505 assignment 1: Sun 29 Nov 10:00 or Fri 04 Dec, not settled yet.
Good. Safer. Tested. And it set up the next near miss.
Near miss 2 (hour 52): the agent's own research overruled the rep
Two days later I recorded the demo: a made-up class, three weeks of messages, real model answers. I read the student's messages the way a judge would. Week 2 ends with the rep's update moving the test to Friday. Week 3 ended with this:
โ ๏ธ CSC 505 Test: someone says it's cancelled
It's not from the rep or official group, so keep preparing for Thu 3 Dec.
Thursday. After the rep had said Friday.
The first diagnosis was wrong
Week 3 had a new message: Femi, a classmate, saying "I heard the CSC 505 test is cancelled." A lone, unsourced rumour. It was the newest message, so it took the "newest claim" point away from the rep's update. That looked like the whole story.
So I fixed that. A lone, unbacked "cancelled" can't move a date, so now it can't take the newest-claim point either. That's a good rule. I wrote a unit test with a rep, a rumour and some weights. It passed.
I re-ran the demo. Still Thursday.
The test passed because I had guessed the weights. The real data had something my guess didn't.
The real cause, found by rebuilding the real state
So I stopped guessing. I rebuilt the evidence from the demo's own database, claim by claim:
| Who | Says | Points |
|---|---|---|
| The course outline (a PDF, shared in week 1) | "Test 1: Thursday 3 December" | document |
| Ada, the rep, Monday | "next week Thursday by 10am" | rep + lecturer |
| Tolu, a classmate, Tuesday | "the CSC 505 test is next week Friday" | first-hand + lecturer |
| Ada, the rep, Sunday | "Update from Dr Ade: moved to Friday" | rep + lecturer |
| Position totals | Thursday 5, Friday 5 | a tie |
Where did the course outline come from? Nobody posted it as a claim. Homing's own study-kit planner found it. When a test appears, Homing opens a "case" for it and goes digging on its own: it searches the chats, reads the course outline, notes the format and venue, and matches past questions. In the outline it found "Test 1: Thursday 3 December", and correctly, by the rules, added it as evidence for the date.
Then the rules did exactly what they said:
- The outline's document points made Thursday as heavy as Friday. A tie.
- A tie is disputed.
- Disputed means plan for the earliest date: Thursday. That was the fix from near miss 1.
Every step followed the rules. The answer was still wrong.
The rule was wrong, not the model
What would a person in that class say? Friday, obviously. The rep's Sunday message isn't one more vote. It passes on the lecturer's change, and it replaces the older outline and the rep's own earlier word. Time order matters, and it matters most when the source is the official one.
Fix (4836f70). When the rep or the official channel speaks after everyone else, their side wins a tie and settles it:
- if (margin >= SETTLE_MARGIN and (not less_work or top.backed)) or (official_update and margin > 0):
+ if (margin >= SETTLE_MARGIN and (not less_work or top.backed)) or (official_update and margin >= 0):
Plus the ordering, so a tied position that holds the official last word comes first:
# positions sort by weight, then "holds the official last word", then the earliest date (simplified)
key=lambda p: (-p.weight, p.key not in last_word, p.due_at)
And the unit test no longer uses guessed weights. It uses the demo's real claims:
def test_the_reps_newest_word_settles_a_tie_with_older_claims_and_a_document():
"""The demo's real claims: the course outline and the rep's first word say Thursday;
Tolu, then the rep's later "Update from Dr Ade: moved to Friday" say Friday. 5 against 5.
The rep spoke after everyone else, passing on the lecturer's change: that settles it."""
...
assert decision.status == "settled" and decision.planning_due_at == FRI
rumour = claim(7, "Femi Adeyemi", 176, None, cancels=True)
decision = decide([*claims, rumour], NOW)
assert decision.status == "settled" and decision.planning_due_at == FRI # a lone rumour changes nothing
The demo now says:
โ
Settled: CSC 505 Test is due Fri 4 Dec, not Thu 3 Dec, 10am
Ada Okafor (rep) posted this in CSC 505 Announcements today at 7:30pm:
โ Update from Dr Ade: the CSC 505 test has moved to Friday 4 December, same time, Hall B.
โ
It's from the rep, so it's confirmed.
โ ๏ธ CSC 505 Test: someone says it's cancelled
It's not from the rep or official group, so keep preparing for Fri 4 Dec.
What I'd tell anyone building an agent that weighs evidence
1. Evidence your agent finds itself is old news with a new timestamp. The course outline was written weeks before the rep's update. The agent found it on Friday, so it felt fresh. A document is a snapshot of when it was written, not of when your agent read it. If your agent researches on its own, every piece of evidence it adds needs the date it was true, not the date it was found.
2. Safe rules collide. "Plan for the earliest date" is safe on its own. "Let the agent add documents it finds" is helpful on its own. Together they produced a confirmed wrong date. Testing each rule against the story it was written for isn't enough. Test them together, on the messiest real sequence you have.
3. A test built on guessed numbers can pass while the bug lives. My first unit test was green and wrong. The fix only came from rebuilding the real state from the database. Now the test is that real state.
4. Keep the decision in code, with a reason attached. Both bugs took minutes to find once I looked, because the decision wasn't hidden inside a model's answer. It was a function with weights, positions and a reason string, and every decision is written to the run's trace with that reason. Today's says: "The rep or the official channel spoke after everyone else, and their side is at least as heavy." If a model had been deciding "settled or disputed", I'd have been arguing with its judgment instead of fixing one line.
5. Write down what the user should see before you run anything. I found near miss 2 only because I read the demo's output as a student would, against what I expected them to get. That habit became 56 "student journeys". Each has the exact message the student should get, written before it runs, and each goes through the real live path. These four now cover this story:
| Journey | What happens | Expected |
|---|---|---|
| A7 | Someone relays the lecturer: a second date | Disputed, plan for the earlier date |
| A8 | Then the rep settles it | Settled, the rep's date |
| A9 | A lone "it's cancelled" rumour | Not confirmed, keep preparing |
| A11 | A rumour after the rep settled a dispute | Still settled, keep preparing |
All 56 pass.
What I haven't fixed
- The points are hand-set. In 45 days of my own class's real messages there wasn't one real dispute about a date, so these weights are tuned on a few cases, mostly made up. The next real dispute will teach me something.
- The rep can be wrong. Homing trusts the rep's last word. If the rep posts the wrong date, Homing will confirm it. It says who said it every time, so the student can see why.
- A tie between two classmates still falls back to the earliest date. That's safe, but it can be wrong in the other direction.
Try it yourself
No API key needed. The demo replays the three weeks from recorded model answers:
git clone https://github.com/Isreal-Oparanti/Homing-agent.git
cd Homing-agent
uv sync
uv run homing demo --mock
uv run pytest tests/test_evidence.py -q
Code: github.com/Isreal-Oparanti/Homing-agent ยท Video: youtu.be/w0Vln_CFbJk
Built for AgentWare 2026 (Research & Study track), run by Hackathon Raptors. Thanks to @partnerships_raptors for running the Near Miss: the bugs that almost shipped teach more than the ones that never existed.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes โ full credit and traffic to the original publisher.