@withboundary/sdk.
Use debug: true first
For a new contract, start with the built-in debug logger:
- Which rule failed?
- Did the model receive the repair message?
- Did it accept on the second or third attempt?
- Is the reject path carrying enough detail?
Use createConsoleLogger when you need more detail
debug: true is the default console logger. When you need to inspect prompt instructions, raw output, or cleaned output, pass createConsoleLogger directly:
Test rules without calling a model
Most contract bugs are rule bugs. Test them withverify() and plain objects:
Test the repair loop with a fake RunFn
Once rules pass, test the full loop with canned model responses:
Capture local metrics with ContractLogger
When console logs get noisy, write a small logger for the signals you care about:
What to log locally
In development, useful logs are usually:- contract name
- final
okstate - attempt count
- final failure category
- failing rule names or issue strings
- repair messages
- raw output only when debugging a specific issue
When to add the hosted SDK
Local logging is enough while one developer is tuning a contract. Add@withboundary/sdk when you need shared production visibility:
- acceptance rate over time
- top failing rules across traffic
- model or prompt regressions
- alerting when correctness degrades
- team debugging without searching server logs