Buffaly Logo
Deterministic Learning Arc

Learning Session:
From Ad Hoc Work to Deterministic Code

Buffaly takes on a task it could not predict beforehand, works through it in context, learns a reusable skill from that ad hoc success, and then converts the method into a code-based skill that runs deterministically. That progression is what turns exploration into dependable execution.

Sessions 3-30 through 3-30-5
Task-Specific Cost 79.7% Lower by Code Stage
Progression Ad hoc → learned skill → code-based skill
Executive summary

One business question, four stages of internalization

Every stage still answers the same operational question. What changes is how much of the method Buffaly has retained, structured, and made reusable.

Business question

How many patients are ready to be imported for a target office based on the relevant eligibility score logic?

Why determinism matters

Buffaly turns one-off success into repeatable execution

The important transition is not simply from expensive to inexpensive. It is from a task that had to be figured out on the fly to a capability that can be run again as explicit code.

This page compares only task-specific work, with a fixed 9,900-token setup excluded from every stage. That keeps the comparison consistent and the gains easy to read.

Learning Progression

FOUR FULL STAGES

1. Ad hoc task solved in context

Stage 1 - task-specific cost 24,924

Buffaly answered the question by working through the real task in context instead of relying on a predefined function.

  1. Buffaly started with the plain-language business question rather than a predefined function.
  2. It explored the real data path, inspected the relevant JSON score structure, and found the actual scoring fields that mattered.
  3. It moved from the initial exploration path to the canonical target and returned the working answer.
  4. This stage proves Buffaly can reason through an unfamiliar operational question in context.
Session

FairPath Demos 3-30

2. Reusable skill captured

Stage 2 - task-specific cost 23,124

The successful ad hoc method was retained as a reusable skill so Buffaly no longer had to rediscover the workflow from scratch.

  1. The ad hoc workflow was turned into a reusable skill.
  2. A fresh session could ask the same question and reuse the learned method instead of rediscovering it.
  3. This demonstrates that Buffaly can retain the task in an agent-native form, not just answer it once.
Skill

ToGetFairPathPatientImportEligibilityGte3CountsByOrganizationSkill

Session 3-30-3

3. Learned skill refined with better context

Stage 3 - task-specific cost 9,499

Once the reusable skill existed, Buffaly could tighten the workflow, add better guidance, and cut away wasted work.

  1. The learned workflow was refined with more concrete guidance and better target information.
  2. Buffaly corrected the query shape issue that surfaced during refinement and reran the workflow cleanly.
  3. This stage shows that reusable behavior can be tuned for efficiency before it becomes code.
Issue

ORDER BY with UNION correction during refinement

Session 3-30-4

4. The method became a code-based skill

Stage 4 - task-specific cost 5,065

The learned method stopped being just remembered behavior and became explicit code that Buffaly could execute deterministically.

ToGetFairPathPatientImportEligibilityGte3CountsByOrganizationDeterministic
__TOTAL__
  1. The learned task was turned into a deterministic ProtoScript-backed action.
  2. The code path computes thresholded counts directly and emits reusable results, including __TOTAL__.
  3. This is how the workflow becomes deterministic: a once-ad-hoc method is turned into a reusable code-based skill.
Artifact

ToGetFairPathPatientImportEligibilityGte3CountsByOrganizationDeterministic - Session 3-30-5

Separate trust story

HIPAA-safe output without flattening records into unstructured AI text

The learning curve above is the main story. Paired with it is a separate trust demonstration: Buffaly can operate over native patient data and emit only the allowed fields for administrative export instead of flattening protected records into unstructured AI text. That means learning speed and data safety can be shown together without mixing the two stories.

What this progression shows
Ad hoc work becomes reusable

The first win does not stay trapped in one session. Buffaly retains the method so the task can be reused instead of rediscovered.

Reusable becomes explicit

Once the method is understood, Buffaly can tighten it, structure it, and prepare it to become code rather than leaving it as loose workflow memory.

Explicit code becomes deterministic

When the workflow becomes a code-based skill, the task is no longer an ad hoc guess. It becomes a reusable deterministic capability.

Working concept page built from recovered FairPath demo sessions and redacted for presentation use.