Supported finding
The known revenue subtotal is 140 fictional units across 4 of 5 rows. One price is missing and customer C2 has conflicting keys, so complete revenue and the customer-segment join remain blocked.
AI & automation / Evidence-based workflows
A local Python tool interface that carries definitions, source checks and unresolved limits into its results.
Question
How can an agent-facing tool return useful analysis without treating an incomplete result as ready for release?
Synthetic example · Five transactions · Local Python execution
The known revenue subtotal is 140 fictional units across 4 of 5 rows. One price is missing and customer C2 has conflicting keys, so complete revenue and the customer-segment join remain blocked.
Carry coverage and blockers alongside the number. Resolve the missing price and customer-key conflict before using the result as a complete total or segment analysis.
A local Python tool using synthetic inputs. Model-service integration and production deployment are outside this example.
Fixed recorded values. The illustrative scenarios below do not recalculate or replace these results.
| Row | Quantity | Unit price | Discount | Revenue, fictional units |
|---|---|---|---|---|
| T1 | 2 | 100 | 10% | 180 |
| T2 · return | -1 | 100 | 10% | -90 |
| T3 | 1 | 50 | 0% | 50 |
| T4 | 1 | Unknown | 0% | Unknown |
| T5 | 1 | 0 | 0% | 0 |
| Known subtotal · 4/5 rows | — | — | — | 140 |
An observed zero counts as known. A missing price does not. Row coverage is 80%; this does not mean 80% of revenue is known.
| Group | Successes | Eligible | Conversion |
|---|---|---|---|
| A | 1 | 10 | 10% |
| B | 90 | 100 | 90% |
| Pooled | 91 | 110 | 82.7273% rounded |
The simple average of the two group percentages is 50%; it gives the groups equal weight and is not the pooled rate. In the customer dimension, C2 maps to both B and C. The required many-to-one join fails, so no customer-segment output is produced.
Five explanatory scenarios. This browser does not run Python, call a model or verify your local files.
Recorded values explained; no new execution.
Known subtotal: 140 fictional units across 4 of 5 rows. Complete revenue is unknown; the customer join is blocked by duplicate C2.
Resolve missing price and conflicting customer keys through the data owner; preserve the qualified subtotal.
Three permitted tools, with one JSON request and response per process.
inspect_inputsanalyzeverify_resultTests cover stale inputs, malformed requests, tampering, output boundaries, writer ownership and cancellation before commit.
Hashes detect changed files; they do not prove source accuracy. The local application boundary is not an operating-system sandbox.
This user-directed learning project was developed with AI assistance. The source package documents implementation, testing and attribution. It carries no open-source licence grant.
No model account, API key or paid service is needed.
Python executor, synthetic CSVs, contracts, tests, recorded evidence and the original standalone presentation source.
Python standard library · Tested on Python 3.12.14 for Windows.
Local tool execution only. The package does not reproduce a real model host, native BI workflow or production service.
Extract the ZIP and run from its root. Choose a fresh output directory for each demonstration.
Download project sourcepython -B -m unittest discover -s tests -v python -B examples/run_demo.py --workspace . --output-dir runs/my-review
The demo performs inspection, analysis and verification. Existing run directories are not overwritten.