The Collaborative Partner

Refill

A caregiver is fighting a parent's specialty-medication refill denial. Refill asks the questions a pharmacy would, computes eligibility itself, and only issues a one-page packet when its own arithmetic agrees with the model's claimed date. The page below ran the project's real end-to-end demo just now, server-side.

network calls: 0 GCP credentials: none API key: none demo exit: 0
PASSED - the full refill loop ran; the wrong date was vetoed and only the correct one got a packet.
==============================================================================
REFILL — offline end-to-end demo
Collaborative Partner track. Zero network, zero GCP, zero API key.
Validator: a deterministic eligibility calculator. If Gemini's claimed
next-eligible date disagrees with the arithmetic, no packet is issued.
==============================================================================
  # idempotency backend: MemoryBackend (FirestoreBackend in prod)
  # artifact backend:    LocalBackend at /tmp/agentspine-artifacts-uw4u1bro (GcsBackend in prod)
  # profile memory:      InMemoryMemoryService (FirestoreMemoryService in prod)

------------------------------------------------------------------------------
ACT 1: INTAKE — parse the denial letter, then ask only what's missing
------------------------------------------------------------------------------
  -> parsed the synthetic denial letter (no PHI, fabricated fixture)
     medication.................. Enbrel (etanercept) 50mg/mL
     ndc......................... 58406-0435-1
     plan........................ Standard
     last_fill_date.............. 2026-01-01
     days_supply................. 30
     denial_reason............... Refill too soon. Our records show your last fill was wit...
  -> clarifying questions the agent still needed to ask
     questions asked............. ['prior_attempts']
     ready for eligibility....... True
  -> the deterministic calculator (this is the veto, no model involved)
     last_fill + days_supply..... 2026-01-01 + 30d
     plan early-refill grace..... 2d (standard)
     CALCULATOR next eligible.... 2026-01-29

------------------------------------------------------------------------------
ACT 2: REJECT — the model asserts a date the arithmetic contradicts
------------------------------------------------------------------------------
  -> Gemini's claimed next-eligible date (the fake model output)
     MODEL claims................ 2026-01-24
     CALCULATOR says............. 2026-01-29
     disagreement................ 5 days
  -> the same claim through the ADK tool the live agent calls
     tool response............... DISAGREE: calculator computed 2026-01-29, which differs from you...
  # the model is instructed to relay this verbatim and may not retry
  # with a different guess -- the calculator's arithmetic is final.
  VALIDATOR: REJECTED
     reason: model-claimed next-eligible date disagrees with the deterministic calculator
     tick status................. rejected
  ARTIFACTS: 0 (no packet.pdf was produced)

------------------------------------------------------------------------------
ACT 3: ACCEPT — the model's claim matches the calculator
------------------------------------------------------------------------------
     MODEL claims................ 2026-01-29
     CALCULATOR says............. 2026-01-29
  VALIDATOR: PASSED
     reason: model-claimed date matches calculator
     tick status................. complete
     run_id...................... bc6eebb6647444f4...
  ARTIFACTS: 2
     /tmp/agentspine-artifacts-uw4u1bro/chase/bc6eebb6647444f4b5995984116c2133718cd8a81e036ac6fc988cdeca87ca83/log.jsonl
     /tmp/agentspine-artifacts-uw4u1bro/chase/bc6eebb6647444f4b5995984116c2133718cd8a81e036ac6fc988cdeca87ca83/packet.pdf
     packet.pdf bytes............ 2597
     is a real PDF............... True
  # the packet's next-eligible date is the CALCULATOR's date by
  # construction: artifact_fn reads it out of verdict.evidence, and
  # run_tick only calls artifact_fn on a passing verdict.
  # Refill drafts a packet and a phone script. It never submits to a payer.

------------------------------------------------------------------------------
ACT 4: IDEMPOTENCY — the Scheduler fires again for the same chase
------------------------------------------------------------------------------
     deterministic run_id........ bc6eebb6647444f4...
     matches act 3............... True
     tick status................. skipped_complete
     chase folders now........... 1

------------------------------------------------------------------------------
ACT 5: FOLLOW-UP — work that outlives the HTTP request
------------------------------------------------------------------------------
     log entries before.......... 1
     log entries after........... 2
       event..................... packet_issued
       event..................... followup_drafted
  -> the same follow-up tick again (idempotent)
     log entries................. 2

------------------------------------------------------------------------------
ACT 6: MEMORY — the second chase is shorter, and 'forget' really forgets
------------------------------------------------------------------------------
     facts remembered............ ['plan_quirk', 'prior_attempts']
     questions run 1............. 1
     questions run 2............. 0
  # fewer questions is a measured fact, not a vibe: the dialogue state
  # machine skips any field profile memory already knows.
  -> caregiver says 'forget that'
     forget_fact returned........ True
     facts now active............ ['plan_quirk']
     second forget (no-op)....... False

==============================================================================
SUMMARY
  model date disagrees with calculator........ REJECTED, 0 packets
  model date matches calculator............... ACCEPTED, packet.pdf written
  duplicate scheduler tick.................... skipped_complete, still 1 packet
  follow-up tick.............................. 1 appended entry, repeat is a no-op
  second chase with memory.................... 1 -> 0 questions
  forget_fact................................. fact gone from active retrievals
  network calls............................... 0
  GCP credentials required.................... none
==============================================================================

Delete the eligibility calculator and act 2 turns into act 3:
the wrong date gets a packet printed on it. That is the whole project.

Re-run the demo Source on GitHub

The verdicts above (REJECT when the model's date disagrees with the calculator, ACCEPT plus a real packet.pdf when it agrees, idempotent re-ticks, and memory that asks fewer questions the second time) come from the production validator, not from this page. Delete the eligibility calculator and act 2 turns into act 3: the wrong date gets a packet printed on it. That is the whole project.