The browser cannot set the price
The server reads the product and price from the catalog. A client-provided value cannot determine the order total.
server/commerce.ts · createOrderMK / ENGINEERING NOTES
Engineering decisions inside MK • DΞV itself: trust boundaries, order states and recovery from failure.
The interface has one button. Behind it are eligibility checks, a server-owned price, a separate payment request and delivery only after verification.
01 / STATE MACHINE
A simplified local model. No real payments, provider requests or file delivery.
The server reads the product and price from the catalog. A client-provided value cannot determine the order total.
server/commerce.ts · createOrderPayment confirmation, state changes and delivery scheduling are written in a transaction. Unique identifiers handle repeated events.
server/commerce.ts · confirmA failed delivery can be retried without paying again. Late and ambiguous transfers require separate review.
server/jobs.ts · server/commerce.tsAutomated tests cover duplicate events, order access, unverified payments and missing inventory. They validate logic, not production-scale traffic.
tests/payment.test.mjs02 / THE BUILD
This diagram describes the current MK • DΞV implementation. Third-party case architectures are not disclosed without verification.
03 / DECISIONS, NOT BUZZWORDS
The form should explain errors immediately. Requests can bypass the form, so the server cannot trust browser validation.
One rules module is used before submission and before storage. Access, consent and rate limits are checked on the server.
// server/api.ts
const errors = validateBrief(details);
if (Object.keys(errors).length) {
return json({
error: 'Invalid brief',
fields: Object.keys(errors)
}, 400);
}Shared rules reduce drift, but do not replace tests or server controls. Not every business rule belongs in client code.