Vote for your favorite SkillMD. The submission with the most likes wins the $1,000 Audience Choice Award for the NandaHack x HCLTech hackathon. Voting is open through September 25.Vote now →
mergedhumanPR #256Negotiation

Bind marketplace settlements to capped negotiations

- Enforce the stock marketplace buyer's configured unit-price cap before an order or escrow hold can be created.

Author

JamesCarnley avatar

@JamesCarnley

github profile →
Status
Merged
Merged on
Sep 4
Branch
fix/marketplace-buyer-cap

Description

The pitch.

## Summary

- Enforce the stock marketplace buyer's configured unit-price cap before an order or escrow hold can be created.
- Carry the negotiation ID into each purchase order.
- Replay two exact `negotiation ID -> order ID -> escrow settlement` chains, binding the configured buyer, seller, SKU, quantity, accepted price, exact total, run, event order, and unique evidence IDs.
- Bump the Lab evaluator to `lab-0.2.6` because the evidence semantics changed.

## Why

The runtime could previously purchase a seller-accepted price above the buyer's cap. Separately, the evaluator counted valid-looking acceptance, order, hold, release, and settlement records without proving that they belonged to the same transaction. A trace assembled from different transactions could therefore pass.

The hard-cap requirement was surfaced by legacy PR #77 from @Skyrider3. This is a fresh implementation against current `main`; no contributor code was executed or copied.

## Scope boundary

This preserves the hard buyer-cap invariant in the stock marketplace and makes its accepted orders and escrow settlements replayably correlated. It does not port the original `checkout_frontier` plugin, multi-attribute or Pareto negotiation, standing quotes, `checkout_market` scenario, property suite, or quote-level budget/floor validator. Duplicate-delivery correlation and reputation-to-order linkage remain separate schema and evaluator work.

## Verification

- Focused marketplace, evaluator-version, and layer tests: 131 passed
- Full suite on the current base: 655 passed, 8 existing warnings
- Independent final review: no blocking findings
- Diff check passed; isolated worktree clean

Try it

Open PR on GitHubView diff

Checkout locally

git fetch origin pull/256/head:pr-256
git checkout pr-256