Margin Retention
Every pricing decision, with its evidence.
margin-retention / quote-workbench
Connecting to API
Try:
—
Product
Qty
Discount
Line GM
8.0%
—
Loading…
Decision, margin and reasons, from the live API.
Gold rows: your quotes. Others: sample flow.
78
automated backend tests
7
core workflow views
0
autonomous price changes
100%
deterministic policy checks
Every decision has an owner.
01
Analyze
Cost, price, context.
02
Validate
Math and policy checks.
03
Submit
Analyst sends for review.
04
Approve
Manager decides.
05
Audit
Append-only record.
Built for explainability, not theater.
01
Correct math
Margin = (price − cost) / price.
02
Accountability
Submitter and approver are different people.
03
Fresh evidence
Any change forces revalidation.
04
Honest AI
Templates are labeled as templates.
05
Decision support
Never changes live prices.
A thin interface over hard rules.
React + TypeScript
Seven workflow views
↓ Typed API ↓
FastAPI
Workflow orchestration
↓
Margin math
Pure functions
Policy engine
Deterministic rules
Templates
Always labeled
↓
SQLite
Append-only audit events
def margin(price, cost):
if price <= 0:
raise ValueError()
return (price - cost) / price78 tests passed
Calculation · policy · workflow · service
Confidence comes from testable boundaries.
Deterministic calculations and policies
Staleness tracked as a first-class state
Append-only audit history
No autonomous production actions