← SIMRANJAISWAL.INTHE ENGINE ROOM · 05 · PRICING

The discount that asks permission

In the pricing case, the leak was found after the fact: a corridor per category, drawn from the quotes that had already gone out. This engine is the corridor at the moment the quote is written. Inside it, the quote goes. Below it, the quote asks permission and must say why. Below the margin floor, it does not go at all. And a monitor watches the stream for the rep whose discounts are quietly growing. It is running below, in your browser, on 600 quotes you can make as generous as you like.

◆ LIVE ENGINE · RUNS IN YOUR BROWSER · PYTHON REFERENCE PUBLIC
0QUOTES IN THE REFERENCE STREAM · 12 REPS · 12 WEEKS
0CORRIDORS · ONE PER CATEGORY · FLOOR = COST ÷ 0.9 · TARGET = FLOOR + 10
0MARGIN PROTECTED · NET OF DEALS LOST · REFERENCE RUN · ₹ LAKH
0REPS NAMED BY THE DRIFT MONITOR, WITH THE QUOTE THAT DID IT
01 · THE JOB

A discount is not wrong. An unexplained one is. The corridor that took quote-to-order conversion up 27% worked because reps knew where the line was; this engine draws the line inside the quoting tool, so the line holds when nobody is watching.

Pricing leaks are polite. Nobody steals; a rep gives 4% to close by Friday, then 6% because last time worked, and by the quarter's end the "habit" is the price. In the pricing case, a pocket-price waterfall found that money after it was gone and a corridor per category stopped the bleed — quote-to-order conversion rose 27%, because a quote inside a corridor is a quote the customer does not haggle with. The Pricing Guardrail is that corridor made into a gate: three outcomes at quote time, a reason code on every request, a 4-hour SLA that escalates itself, and a tie-out that will not publish the week's numbers if the decisions do not add up. SEAL and WATCH of the Leak Ledger, written as rules.

02 ·THE ENGINEONE GATE, THREE DOORS, A MONITOR ON THE STREAM
AT QUOTE TIME · THE QUOTED PRICE IS COMPARED TO THE CATEGORY CORRIDOR · INSIDE → APPROVE · BELOW THE FLOOR → A REQUEST WITH A REASON CODE, ANSWERED IN 4 H OR ESCALATED · BELOW THE MARGIN FLOOR → BLOCKED AND RE-PRICED · THE DRIFT MONITOR READS EVERY QUOTE AND NAMES THE REP WHOSE LAST TEN ARE OUT OF LINE.

The engine is deliberately boring: no price optimisation, no model of willingness to pay, no threshold tuned by feel. The corridor is arithmetic on cost, the reason codes are three words, the approval probabilities are printed, and the drift monitor is one z-score whose formula sits in the table below. That is what makes a guardrail survivable: when it stops a quote, the rep can see which sentence stopped it and what price would have passed.

03 ·THE RULESWHAT "APPROVED" MEANS, EXACTLY
STEPRULEWHAT IT DOES
CorridorPer category, as a share of list: floor = ceil(cost ÷ 0.9 × 100) ÷ 100; target = floor + 0.10; ceiling = listFive corridors from five cost ratios (55–71% of list). Change cost and the corridor moves; nothing else does.
1 · BLOCKQuoted share < cost × 1.03Below the margin floor. The quote is re-priced to the corridor floor and never reaches the customer.
2 · APPROVEQuoted share ≥ floorInside the corridor. Goes out in under a second, no human involved.
3 · NEEDS APPROVALElse, with one reason in this order: VOLUME (qty ≥ 12) · COMPETITOR (a competitor quote is attached) · STRATEGIC (a flagged account) · NO REASONA request with a reason. No reason → declined automatically, re-priced to the floor.
SLAThe approver answers within 4 h with p = 0.8; otherwise the request escalates one levelA request never sits. The escalation is counted, because escalations are how you find the approver who is the bottleneck.
GrantGranted with p = 0.7 VOLUME · 0.85 COMPETITOR · 0.9 STRATEGIC; declined → re-priced to the floorThe synthetic approver. In life the probabilities are the approvers' own history.
Drift monitorFrom a rep's 10th quote: z = (mean of their last 10 discounts − mean of the category means of those 10 quotes) ÷ (population sd of all discounts so far ÷ √10); flag when z > 2Names the rep and the quote that did it. It cannot tell drift from habit — a rep who always discounted heavily is flagged at their 10th quote, which is the point.
Margin protectedΣ over blocked + declined quotes of (floor − quoted share) × list × qty, net of an assumption printed on the slider: re-pricing to the floor loses 15% of those deals, and a lost deal forgoes the margin it carried as quotedThe number the page leads with. Gross is in results.json too.
Tie-out600 = approve + granted + declined + escalated → granted + escalated → declined + blockedIf it breaks, the week's report is not published.
# the gate, in this order — the sentence a sales head can disagree with (engine.py)
if Q["share"] < C["cost"] * block_mult:
    Q["decision"] = "BLOCK"; Q["outcome"] = "REPRICED"; return        # below the margin floor
if Q["share"] >= C["floor"]:
    Q["decision"] = "APPROVE"; return                             # inside the corridor
Q["decision"] = "NEEDS_APPROVAL"
if Q["qty"] >= 12:      Q["reason"] = "VOLUME"
elif Q["competitor"]:   Q["reason"] = "COMPETITOR"
elif Q["strategic"]:    Q["reason"] = "STRATEGIC"
else:
    Q["reason"] = "NO REASON"; Q["outcome"] = "AUTO_DECLINED"; return
escalated = rng.random() >= SLA_P                              # answered within 4 h with p 0.8
granted   = rng.random() < GRANT_P[Q["reason"]]                  # 0.7 · 0.85 · 0.9 by reason
04 ·RUN ITTHE ENGINE, LIVE, ON A STREAM YOU CONTROL
SEED
A 600-QUOTE STREAM IS GENERATED FROM THE PRINTED RULES AND PUT THROUGH THE GATE IN YOUR BROWSER. NOTHING LEAVES THIS PAGE.
MARGIN PROTECTED · NET OF DEALS LOST

Run the stream to see what the gate stops.

THE DECISION LADDER

Two things to try. Switch the guardrail off and the big number turns into the margin that leaks: the same 600 quotes, the same reps, nobody asking. Then drag the corridor floor to cost ÷ 0.85: the floors rise, the blocks and requests multiply, and margin protected climbs — but watch the approval load per week and the deals-lost slider, because a corridor tight enough to catch everything is a corridor the sales team routes around. The floor is a business decision, so it is a slider, not a constant.

05 ·WHAT IT FINDSTHE REFERENCE RUN · SEED 42

What the gate stopped, by category

REQUESTS GRANTED · DECLINED · BLOCKED — APPROVED OUTRIGHT PRINTED ABOVE
GRANTEDDECLINEDBLOCKED

Where each rep sits

MEAN DISCOUNT ● · LAST TEN ○ · FLAGGED IN RED · ▲ DRIFTING BY CONSTRUCTION · THE CORRIDOR FLOOR AS A LINE

The leak by rep, before and after the gate

₹ QUOTED BELOW THE CORRIDOR FLOOR · BEFORE THE GUARDRAIL (GREY) · WHAT STILL GOT THROUGH ON A GRANTED REQUEST (GOLD)

The reps the monitor named

The leak by rep

06 ·WATCHHOW IT RUNS WHEN NOBODY IS LOOKING
WHENWHAT HAPPENSWHO SEES IT
At quote timeThe quoted price meets the category corridor inside the quoting tool. APPROVE goes out; NEEDS APPROVAL opens a request with its reason; BLOCK re-prices to the floor and says which sentence did it.The rep, in under a second, with the price that would have passed.
Within 4 hThe SLA clock. An unanswered request escalates one level and is counted as an escalation against the approver.The approver, then their manager. The escalation count is how you find the bottleneck.
NightlyThe drift monitor recomputes every rep's last-ten z against the population; the day's decisions are tied out: quotes = approve + granted + declined + escalated + blocked. Any gap → no publish.The sales head gets the flagged reps with the quote that flagged them. A tie-out failure is the engine finding a bug in itself.
WeeklyThree numbers on one page: requests per week, margin that still leaked on granted requests, reps flagged. The corridor is not touched.Leadership — the WATCH stage of the Leak Ledger.
MonthlyCorridor review: floors move only when cost moves. A floor that is asked for permission more than five times a week is a floor to revisit, not to route around.Finance and sales, together, with the leak-by-rep table on the table.
07 · THE TAKEAWAY

The corridor found the leak once; the guardrail keeps it found. The value is not the ₹1.6 lakh this stream protected in twelve weeks — it is that the request carries a reason, the reason carries a probability, the block carries the price that would have passed, and the rep whose habit is drifting is named at their 34th quote instead of at the year-end review. Make the floor a decision, the reason a word, and the tie-out refuse to lie, and the discount stops being the price.

THE STREAM IS SYNTHETIC AND GENERATED FROM THE RULES PRINTED IN engine.py (SEED 42; CORRIDOR AND THRESHOLDS AS SHOWN ON THE SLIDERS). NO CLIENT DATA, NO REAL REPS, NO REAL PRICES. THE ENGINE LOGIC IS THE REAL SHAPE OF THE PRICE CORRIDOR SIMRAN BUILT FOR A B2B MEDICAL-EQUIPMENT PROCUREMENT PLATFORM; THE 27% CONVERSION FIGURE IS AS REPORTED IN THAT CASE. THE APPROVER PROBABILITIES AND THE 15% DEALS-LOST ASSUMPTION ARE ASSUMPTIONS, PRINTED. THE BROWSER ENGINE IS A LINE-FOR-LINE PORT OF THE PYTHON AND REPRODUCES results.json EXACTLY ON THE REFERENCE SETTINGS — THE STATUS LINE ABOVE SAYS SO WHEN IT DOES.

Discounts that nobody approved? A pricing guardrail is a two-to-four-week SEAL: your categories, your costs, your reason codes — a corridor inside the quoting tool, an SLA that escalates itself, and a monitor that names the drift before the quarter does.

Start with a TRACE → engine.py README results.json The case it came from →