Case study

A project estimator on IntentSharp

An engineering firm estimates its projects with it: seven model-calling operations take a job from evidence extraction to a reviewer's verdict. A coding agent built it on IntentSharp 1.0.0-rc.3, and its developers then ported it to 1.0.

How it is built

What the application's source shows. Its code calls IntentSharp; what each operation asks, returns and may spend is in files.

  • One call, one set of limits. Its seven model-calling operations, from evidence extraction to the reviewer's verdict, run through one call with one set of limits: a timeout, attempts, model calls and output tokens.
  • Behavior in files. What it does lives in a bundle of definition files: the intents, the reviewer's profile, delivery and execution policies, a task catalog and four review checklists.
  • Changed while it ran. When the reviewer's stance had to change, the file changed, three times, on the running service, with no restart.
  • Tested with no key. It has 72 tests, 22 of them on scripted replies with no key.
  • Facts apart from decisions. It follows the evidence ledger pattern: the facts are immutable documents, and the decisions sit beside them.

Before and after, measured

The developers ported the application's intelligence layer to 1.0 and counted its lines. The conventional column is their estimate of the C# it would take to write the same guarantees by hand; the IntentSharp column is measured from the ported code and files.

ConcernConventional C#, estimated linesIntentSharp 1.0 and files, measured linesWhere it lives now
OpenAI transport: structured output, retry with backoff, timeouts, a size cap, error classes250 to 3500The library
JSON schema generation from the result types150 to 2500The library
The prompt envelope: intent, input, requirements, prior findings80 to 1200The library
The verification loop: parsing, rules, validators, attempt and call ceilings, a time budget200 to 2800The library
Instruction text for 7 intentsAbout 250 lines of C# strings0 of C#, 248 lines of YAMLThe intent files
Output vocabularies and boundsAbout 60 lines of hand checks0 of C#, in the YAML rulesThe intent files
Provider, endpoint and rolesAbout 2012, plus a 13-line JSON fileThe provider file
An offline, scripted test providerAbout 600The library
Context integrity checks: citations, known ids, traceability, a numeric floorAbout 60113The application, deliberately
A session per operation: budgets, receipts, model and profile bindingAbout 90103The application
Stage orchestrationAbout 6059The application
Definition capture, hashing, provenance and hot reload124124The application, in both
Knowledge-file validation128128The application, in both
Model discovery5050The application
Services and host wiring, with unchanged logicAbout 620626The application
C# in the AI path, in allAbout 2,200 to 2,5201,215
Definition files that reload while the service runs0261 lines in a 20-file bundle

In all: about 2,200 to 2,520 lines of C# in the AI path by the developers' estimate, against 1,215 lines measured on IntentSharp 1.0; and no definition files that reload, against 261 lines of them in a 20-file bundle. The estimate is the developers' own, for this application; it is not a measurement.

What changed in practice

The same application, written the conventional way and on IntentSharp 1.0, as its developers compared them.

  • Changing an instruction, a vocabulary or a bound. By hand it is code, a build, tests and a redeploy. Now it is an edit of the YAML and a new version number: the next operation uses it, and the snapshots are kept.
  • Whether a file edit can weaken a safety check. It cannot: the mandatory validators are enforced in code.
  • A rule violation fed back to the model. By hand, only if you build it. On IntentSharp it is built in.
  • Transport, retry and schema bugs. By hand they are yours; now they are the library's.
  • What it costs. A commercial dependency, and a paid license in production.
  • Behavior on scripted replies. Identical to the rc.3 build on the golden run of six frozen cases.

Make your first checked call.

dotnet add package IntentSharp