Two deadlines that looked fine: building BeagleDocs with Kiro for Kiroween 2026

🎃 I wrote this post for the Kiroween 2026 hackathon. The project is BeagleDocs, submitted in the Frankenstein category.
A scholarship guide says applications are due in two weeks. A separate email from your referee says she needs three weeks to write a letter. Each document looks fine on its own. Read together, they mean you are already late, and nothing in your inbox or calendar will tell you.
I'm a student at UBC, and that kind of split deadline is normal in student paperwork: scholarship guides, co-op offers, study-permit letters, course outlines, half of them arriving as email attachments. I built BeagleDocs to read all of those documents together, find every deadline and requirement, link each one to the exact sentence it came from, and warn me when a chain of tasks can't fit before its due date.
TL;DR
- 🐶 BeagleDocs reads your paperwork together and finds deadline chains that can't be met.
- 🔗 Every item links to the exact sentence it came from. No matching quote, no item.
- 🛠️ Kiro built two modules unattended from specs (68 and 27 tests), and a hook caught a one-bit C++/Python mismatch.
- 🧪 Try it: live demo, no login (the first load takes about 30 s) · code
What it does
You upload PDFs, Word files, scans or photos, or connect Gmail read-only. BeagleDocs extracts deadlines, requirements, amounts and effort estimates, builds one dependency graph across documents, and runs critical-path analysis on it. In the demo semester, send CV → three-week reference letter → submit application comes out 10 days short, and that shows up as a conflict card on the first screen:
An item is stored only if its quote matches the document text at known offsets. Click the evidence and the document opens with that sentence highlighted:
There is an agent that can plan ("what do I need to do in the next two weeks?"), but anything that leaves the app, like an email draft or a calendar export, becomes an approval card. The model never sends anything by itself.
🧟 The Frankenstein part
A C++20 engine bound into a Python service, a pure-Python twin of every engine function, Postgres row-level security, a React UI, Azure, Gmail, calendar feeds and an MCP server:
How I worked with Kiro
For the modules that stood on their own, the loop looked like this:
1. Write rules a machine can check
My first steering files said things like "write secure code". That does nothing. The version that worked reads like a test plan. From .kiro/steering/tech.md:
Every DB query on tenant data takes
workspace_id; usepapertrail.db.scoped_session(workspace_id).
A hook, a test or a reviewer can verify that sentence. Once I rewrote the four steering files (product, tech, structure, security) in that style, every Kiro session started with the same trust rules: no extracted item without a matching quote, never invent a date or amount, LLM calls only through one gateway.
2. Specs that an agent could finish alone
The temporal engine (finding dates like "within 10 business days of your offer" or "on or before March 3") was the first thing I handed to Kiro completely. The spec lists every date form it must handle and the traps it must skip:
- The system SHALL NOT treat bare years (
2027), times alone, money ($1,500), or version numbers (1.2.3) as dates.
I ran it unattended with Kiro CLI and a custom agent:
kiro-cli chat --agent spec-implementer --no-interactive \ "Implement the spec in .kiro/specs/temporal-engine/ ..." The first run planned the whole module and then couldn't write a single file, because my agent profile didn't allow writes. That was my mistake, and a useful one. Instead of giving it full access, I allowed writes only under the API package, its tests and the spec folder (toolsSettings.write.allowedPaths), and resumed the same session with --resume.
| Module | How | Result |
|---|---|---|
| Temporal engine | Kiro CLI, unattended, then --resume | 53 unit tests + 7 Hypothesis properties, 68 passing, mypy strict clean |
| Daily digest | Kiro CLI, one unattended run | module, route and 27 tests |
Kiro's own tests caught one bug that it fixed: "on or before" was scored as a strong deadline cue because the inner word "before" matched. My review caught another: the timezone regex ran case-insensitively, so "Pacific" was being cut to "Paci".
What I learned: when the acceptance criteria are exact, my review is about edge cases instead of structure. For UI work that touched many files, going interactive was faster, and I wrote a spec afterwards (agent-core) so the hooks had something to check against.
3. The hook that found a one-bit bug
Every engine function in C++ has a pure-Python reference with the same signature, and Hypothesis checks that they agree. This hook runs those checks whenever I touch the C++:
{ "name": "C++ engine parity check", "when": { "type": "fileEdited", "patterns": ["engine/src/**/*.cpp", "engine/include/**/*.hpp", "engine/bindings/**/*.cpp"] }, "then": { "type": "runCommand", "command": "uv sync -q --reinstall-package ptcore && uv run pytest services/api/tests/property -q" } } It failed on BM25 scores that differed in the last bit of a double. On Apple Silicon, Clang was contracting a*b + c into a single fused multiply-add instruction, which rounds once instead of twice. An example-based test would never have noticed. The fix was -ffp-contract=off, and the spec got a new requirement that results be bit-identical across platforms. That bug is the reason I'd now write a parity property for any two implementations of the same thing.
4. Building the beagle with a spec in the IDE
The last feature was the beagle companion: a small dog in the corner of every page that shows what the agent is doing. It sniffs while the agent works, smiles when an answer is verified, raises an alert when deadlines can't all be met, and falls asleep when you leave.
I did this one in the Kiro IDE spec view, from requirements to design to 11 tasks, in one session, with 16 unit tests and 8 UI tests.
The spec changed twice because of what I saw in the browser. A standing conflict kept the beagle in "alert" forever and hid every other state, so we rewrote the state priority. The first alert bubble was a 250-character sentence, so the spec gained a rule: bubbles are at most 80 characters. Both edits are in tasks.md, which I like better than a spec that pretends it was right the first time.
👻 The outage in deadline week
While recording the demo, the live site went down. The database provider returned spendLimitReached. The cause was in my own code: the worker polls the Postgres job queue and sleeps one second when idle (IDLE_SLEEP = 1.0). That is at least 86,400 queries a day from one idle worker, and that provider bills per query. Nothing was broken in a test; it was a cost model I never checked.
| Before | After | |
|---|---|---|
| Database | Prisma Postgres, billed per query | Azure Database for PostgreSQL Flexible Server (Standard_B1ms), fixed monthly price |
| Idle worker cost | grows with every poll | the same whether it polls or not |
With Kiro in the IDE, I created the server, enabled pgvector, ran migrations 0001 to 0005, confirmed row-level security is forced on all 12 tenant tables, swapped the connection secret on both Container Apps, and ran a smoke test against the live site. The lesson I wrote down: check what an idle loop costs on every host it might run on.
🔒 Guardrails for the agent, not just the app
For the release work I gave Kiro broad shell access in permissions.yaml, but denied git commit, git push, git merge, rm, sudo, terraform apply and az ... delete. Deny wins over allow. So Kiro could inspect, build, deploy an image and read logs, and I made every commit and merge myself.
During that stretch it noticed a PR of mine had been merged into a feature branch instead of main and opened the correct one. Secrets for Gmail OAuth and SMTP never appeared in the chat: I put them in local files and Kiro read them straight into Container Apps secrets.
One surprise: workspace trust, the autonomy mode and permission rules are three separate layers. Until I trusted the workspace, steering didn't load and every command asked for approval, whatever my rules said.
🔁 Using the product inside its own build loop
BeagleDocs ships an MCP server with whats_next, conflicts, search_documents and ask_agent. I registered it in .kiro/settings/mcp.json, and Kiro called conflicts on the demo workspace and got back the same 10-days-short chain the UI shows.
That let Kiro check a change against real plan output, not only unit tests.
📊 Numbers, all from the repo
| Measure | Result |
|---|---|
| Hybrid retrieval Recall@3 | 0.933 (BM25-only and vector-only: 0.867) |
| Stored quotes that match their source | 1.0 |
| Extraction F1, held-out documents | 0.875 |
| Tests | about 240: 188 Python, 22 C++, 30 web |
Disclosure
I used more than one AI tool. Claude Code wrote a large share of the backend and frontend. Kiro did the steering, the specs and custom agents, the six hooks, the temporal engine and daily digest (Kiro CLI), the beagle companion (Kiro IDE), and the release and operations work. The video narration is AI-generated with Kokoro TTS, and the brand images were made with an image model.
What I'd tell myself at the start
- Write each rule so a hook can check it.
- Give agents the smallest write scope that works, and widen it on purpose.
- Put a property test between any two implementations that are supposed to agree, because that's where the strange bugs hide.
If you try the demo, I'd love to hear which deadline it found that you would have missed. 🐾
starstarrr / BeagleDocs
BeagleDocs: finds deadlines buried across your paperwork, with the exact source sentence. Kiroween 2026.
BeagleDocs
Formerly PaperTrail; the repository, the Python package and the demo URL keep the old name.
Don't get haunted by a deadline buried in your paperwork.
BeagleDocs reads the documents that run your life (scholarship guides, offer letters, study permits, bills syllabi, emails), finds every deadline and requirement with the exact sentence it came from, connects them across documents into one dependency graph, and warns you before a deadline becomes impossible. An agent plans your next steps, drafts emails and prepares calendar entries, and anything that leaves BeagleDocs waits for your approval.
Built for Kiroween 2026 (category: Frankenstein). Live demo: papertrail-api…azurecontainerapps.io (first load can take ~30 s while it wakes up) · Video: 2:42 demo on YouTube
Why it's different
| Typical "chat with your PDFs" | BeagleDocs | |
|---|---|---|
| Output | Free-text answers | Structured obligations: kind, due date, effort, amount, verified quote + offsets |
| Scope | One document at a time | Cross-document context: a |










