English source · 10 min
What is proved, what is reviewed and what is neither
This page answers one question per source file of the commerce core: is its rule proved by machine, does it call a proved rule, or neither? It is generated from the same manifest the proof check uses, so it cannot say more than the check verifies. It is not a claim that the shop is free of errors: 94.3 % of the Rust source files are unproved.
In numbers
| Count | Share of source files | Meaning | |
|---|---|---|---|
| Proved rules | 74 | Small pure decisions, translated from the production Rust source to Lean and proved there | |
| Proved properties | 217 | Statements about those rules that hold for every possible input | |
| Rule files | 8 | 0.4 % | The files that contain the proved rules |
| Reviewed callers | 84 | 4.7 % | Files that call a proved rule; a person reviewed how the rule is fed, the surrounding code is not proved |
| Comparison drivers | 9 | 0.5 % | Test programs that compare the compiled Rust rules with the Lean versions |
| Unproved files | 1686 | 94.3 % | Everything else: database access, HTTP, providers, the user interface server |
| All Rust source files | 1787 | 100 % |
A proved rule looks like this one, which caps a discount at the amount it is taken from:
pub fn discount_cap(total: u64, requested: u64) -> u64 {
total.min(requested)
}
The proof covers that function for all inputs. It does not cover the SQL that reads the total, the request that carries the discount or the code that stores the result. How the proofs connect to the application.
The money path
These are the files a price, an order total or a payment passes through.
"Uses floating point" counts files that contain the type f64; exact money
arithmetic uses whole minor units instead, so each such file is a place where
rounding still has to be argued by tests rather than by the type.
| Area | Files | Call a proved rule | Unproved | Use floating point |
|---|---|---|---|---|
| Money primitives and discounts | 15 | 6 | 9 | 2 |
| Cart and prices | 11 | 3 | 8 | 1 |
| Checkout, delivery and orders | 32 | 6 | 26 | 4 |
| Promotions | 1 | 0 | 1 | 1 |
| Payments and refunds | 38 | 3 | 35 | 0 |
| Currencies and taxes | 16 | 1 | 15 | 4 |
| Stock | 4 | 1 | 3 | 0 |
| Money path in total | 117 | 20 | 97 | 12 |
The money path is also checked by tests that are not shown here: the differential comparison against the original PHP price calculation and the registered HTTP and PostgreSQL suites. Testing describes them. This page does not show test coverage per file.
Every proved rule
Each rule links to its production source. "Used in" lists the reviewed files that call it.
Prices, stock, payments and refunds
23 rules, 94 proved properties. Source.
| Rule | What the source says about it | Proved properties | Used in |
|---|---|---|---|
admin_payment_admissible |
No comment in the source | 2: admin_payment_exact, admin_external_payment_denied |
components/checkout/src/domain/admin_order.rs |
amount_sum |
The sum of two amounts in minor units; it never wraps around. | 11: amount_sum_exact, amount_sum_bounded, amount_sum_not_below, amount_sum_comm, lines_fold_exact, lines_total_exact, lines_total_order_free, net_quote_total, gross_quote_total, quote_total_not_below_lines, quote_total_deterministic |
components/checkout/src/domain/cart_quote.rs, components/checkout/src/service/delivery.rs, components/pricing/src/domain/money.rs |
b2b_approval_admissible |
An approval requires a different employee, current authority, pending state and exact revision. | 2: b2b_approval_exact, b2b_self_approval_denied |
components/b2b/src/store/purchase.rs, components/b2b/src/service/approval.rs |
b2b_budget_admissible |
Spending cannot exceed a currency-bound unit budget, including existing allocations. | 6: b2b_budget_exact, b2b_budget_conserves, budget_sequence_bounded, budget_sequence_conservation, budget_lowered_limit_denied, budget_zero_at_exhaustion |
components/b2b/src/store/purchase.rs, crates/cognition/src/inference/budget.rs |
capture_admissible |
Captures and in-flight reservations together cannot exceed the original authorization. | 4: capture_exact, capture_bounded, capture_zero_denied, capture_run_bounded |
components/payments/src/store/capture_admission.rs |
checkout_contact_admissible |
No comment in the source | 2: financial_contact_required, checkout_contact_exact |
components/checkout/src/service/purchase/commit.rs |
checkout_review_admissible |
No comment in the source | 2: checkout_review_exact, checkout_review_stale_denied |
components/checkout/src/domain/review_binding.rs |
currency_context_admissible |
A quoted currency must be enabled, configured and have an admissible rate. | 2: currency_context_exact, currency_context_stale_denied |
components/pricing/src/types/currency.rs |
currency_scale_admissible |
No comment in the source | 2: currency_scale_exact, currency_scale_overflow_denied |
components/pricing/src/domain/money.rs |
discount_cap |
No comment in the source | 6: discount_bounded, discount_requested, discount_conservation, discount_exact, discount_monotone_requested, discount_idempotent |
components/pricing/src/domain/discount.rs |
external_amount_admissible |
Source amounts are bounded; a zero rate cannot carry nonzero tax. No tax-law inference. | 2: external_amount_exact, external_amount_tax_bounded |
components/pricing/src/domain/external_order.rs |
external_paid_total_admissible |
Paid imports require a positive, exactly reconciled source total. | 2: external_paid_total_exact, external_unpaid_denied |
components/pricing/src/domain/external_order.rs |
line_total |
The amount of quantity units at unit minor units each; it never wraps around. |
6: line_total_exact, line_total_bounded, line_total_zero, line_total_one, line_total_split, line_total_monotone |
components/pricing/src/domain/money.rs, components/pricing/src/domain/pricing.rs |
net_amount |
The net part of a gross amount in minor units; it is never negative. | 2: net_plus_tax_is_gross, net_not_above_gross |
components/checkout/src/domain/cart_quote.rs, components/checkout/src/service/delivery.rs, components/pricing/src/domain/quote.rs |
offer_honoured |
A signed offer is honoured only before it expires and only for the same cart, revision and total. | 4: offer_honoured_exact, offer_expired_denied, offer_changed_total_denied, offer_changed_revision_denied |
components/intelligence/src/service/signed_offer.rs |
pos_cash_admissible |
Cash change is bounded and nonnegative only under cashier authorization and a reviewed total. | 3: pos_cash_exact, pos_cash_conserves, pos_cash_unauthorized_denied |
components/pos/src/service/settlement.rs |
pos_discount_admissible |
No comment in the source | 2: pos_discount_exact, pos_discount_exceeds_denied |
components/shop/src/types/cart.rs |
refund_admissible |
No comment in the source | 6: refund_bounded, refund_zero_denied, refund_exact, refund_sequence_bounded, refund_lowered_capture_denied, refund_run_bounded |
components/payments/src/store/commands.rs, components/payments/src/domain/refunds.rs |
replay_admissible |
No comment in the source | 3: replay_same_cart, replay_open_fingerprint, replay_exact |
components/checkout/src/service/purchase/lock.rs |
reservation_admissible |
An order holds at most what it ordered: what it already holds plus a new reservation stays within the ordered quantity. | 9: reservation_exact, reservation_zero_denied, reservation_over_denied, reservation_step_bounded, reservation_run_bounded, reservation_step_conserves, reservation_run_conserves, reservation_release_idempotent, reservation_release_restores |
components/inventory/src/domain/lines.rs |
revision_admissible |
No comment in the source | 4: revision_exact, revision_exact_behavior, revision_run_monotone, revision_reuse_denied |
components/orders/src/http/transitions.rs, components/catalog/src/service/translation_apply.rs, components/intelligence/src/service/platform_ai.rs, components/shop/src/http/operator_quotas.rs, components/shop/src/http/operator_lifecycle.rs, components/orders/src/http/delivery_split.rs, components/intelligence/src/store/evidence.rs, components/checkout/src/domain/review_binding.rs |
rounded_quotient |
numerator / denominator in whole minor units, rounded to the nearest one with halves up (away from zero for a magnitude); a zero denominator counts as one. |
7: rounded_quotient_eq, rounded_quotient_nearest, rounded_quotient_half_up, scaled_round_trip, rounded_quotient_monotone, included_tax_within_gross, cash_round_nearest_multiple |
components/pricing/src/domain/decimal.rs, components/pricing/src/domain/pricing.rs |
stock_admissible |
No comment in the source | 5: stock_positive_bounded, stock_conservation, stock_exact, stock_sequence_bounded, stock_sequence_conservation |
components/checkout/src/service/purchase/price.rs, components/apps/src/service/external_orders.rs |
Orders, delivery and returns
11 rules, 35 proved properties. Source.
| Rule | What the source says about it | Proved properties | Used in |
|---|---|---|---|
cancellation_admissible |
No comment in the source | 2: cancellation_safe, cancellation_exact |
components/orders/src/domain/order_workflow.rs |
carrier_booking_admissible |
An open eligible parcel admits an empty or identical carrier intent, never another occupied booking. | 2: carrier_booking_exact, carrier_booking_occupied_denied |
components/shipping/src/domain/booking.rs |
completion_admissible |
No comment in the source | 2: completion_safe, completion_exact |
components/orders/src/domain/order_workflow.rs |
delivery_split_admissible |
Package splitting moves a strict positive subset of an open, nonterminal allocation. | 3: delivery_split_exact, delivery_split_closed_denied, delivery_split_all_denied |
components/shipping/src/domain/split.rs, components/orders/src/domain/order_workflow.rs |
download_admissible |
No comment in the source | 3: download_blocked_denied, download_payment_required, download_exact |
components/orders/src/http/downloads.rs |
manual_payment_admissible |
No comment in the source | 2: manual_payment_safe, manual_payment_exact |
components/orders/src/domain/order_transitions.rs |
order_edit_admissible |
No comment in the source | 3: terminal_edit_denied, order_edit_exact, order_run_fulfilment_denied |
components/orders/src/domain/order_workflow.rs |
order_transition_admissible |
An order moves only along a listed edge of its machine into a listed state, never out of a terminal state. | 7: order_transition_exact, order_transition_terminal_denied, order_step_listed, order_run_listed, order_step_terminal, order_run_terminal_absorbing, order_run_terminal_final |
components/orders/src/domain/order_workflow.rs |
payment_transition_admissible |
No comment in the source | 6: payment_transition_exact, payment_refunded_terminal, payment_pending_capture, payment_run_listed, payment_run_captured_kept, payment_run_refunded_final |
components/payments/src/domain/state.rs |
receipt_admissible |
No comment in the source | 2: receipt_exact, receipt_exact_behavior |
components/payments/src/domain/receipt_guard.rs |
reservation_release_admissible |
Uncaptured stock can be restored; an authorization requires provider-confirmed void evidence. | 3: reservation_release_exact, reservation_authorized_unvoided, reservation_captured_denied |
components/payments/src/store/order_ledger.rs |
Rights, shops and sessions
11 rules, 24 proved properties. Source.
| Rule | What the source says about it | Proved properties | Used in |
|---|---|---|---|
auth_factor_admissible |
Factor evidence is supplied only by the native verified-code or live personal-session handoff owners. | 2: auth_factor_exact, auth_factor_required_denied |
components/identity/src/store/sessions.rs |
channel_access_admissible |
Preview grants admit only simulations; public requests require an active channel and private requests a current merchant. | 4: channel_private_requires_identity, channel_paused_requires_preview, channel_preview_no_mutation, channel_access_exact |
components/marketing/src/service/channel_access.rs |
consent_admissible |
Optional processing requires an enabled purpose and a fresh affirmative receipt for this policy. | 1: consent_exact |
components/intelligence/src/service/consent.rs |
legal_checkout_admissible |
Strict checkout binds the current document version and separately requested digital delivery. | 1: legal_checkout_exact |
components/checkout/src/store/legal_snapshot.rs |
merchant_scope_admissible |
A merchant request acts for a shop only with a credential issued for that same shop. | 3: merchant_scope_exact, merchant_scope_other_shop_denied, merchant_scope_missing_credential_denied |
components/identity/src/lib.rs |
native_asset_bypass |
Only native public assets may skip identity; every hosted alias retains tenant/channel admission. | 2: native_asset_hosted_denied, native_asset_bypass_exact |
src/auth/middleware.rs |
persistent_key_admissible |
Permanent credentials and credential settings require a current personal administrator. | 2: persistent_key_exact, persistent_key_nonpersonal_denied |
components/identity/src/http/integrations.rs, components/apps/src/http/settings.rs |
platform_admissible |
Global administration requires a personal session and a current independent operator grant. | 2: platform_exact, platform_personal_required |
src/platform/auth.rs |
scope_admissible |
No comment in the source | 3: scope_authenticated_known, scope_explicit_no_escalation, scope_exact |
components/identity/src/domain/permissions.rs |
shop_request_admissible |
Availability fence: paused merchant reads and existing payment settlement may continue. | 2: shop_availability_exact, shop_archived_denied |
components/shop/src/service/availability.rs |
workspace_length_admissible |
A workspace ID has between 2 and 48 characters. | 2: workspace_length_exact, workspace_length_short_denied |
components/core/src/lib.rs |
Agent budgets
2 rules, 8 proved properties. Source.
| Rule | What the source says about it | Proved properties | Used in |
|---|---|---|---|
agent_preview_admissible |
No comment in the source | 6: agent_preview_exact, agent_inactive_denied, agent_private_requires_personal, agent_private_requires_owner, agent_expired_preview_denied, agent_live_independent_of_preview |
components/identity/src/store/agent_authority.rs |
planning_request_admissible |
No comment in the source | 2: planning_request_exact, planning_mutation_denied |
components/intelligence/src/service/agent_controls.rs |
AI prices, claims and experiments
5 rules, 13 proved properties. Source.
| Rule | What the source says about it | Proved properties | Used in |
|---|---|---|---|
ai_autonomy_admissible |
Budgeted autonomy requires explicit policy, current authority, price-only scope and all budgets. | 2: ai_autonomy_exact, ai_autonomy_disabled_denied |
components/intelligence/src/service/autonomy.rs, components/intelligence/src/domain/price_guardrails.rs |
ai_price_admissible |
Price admission proves only the explicit corridor and supplied domain guards; no model truth claim. | 2: ai_price_exact, ai_price_locked_denied |
components/intelligence/src/domain/price_guardrails.rs |
claim_render_admissible |
Only current, public, confirmed, unexpired source-bound claims may be rendered. | 2: claim_render_exact, claim_unconfirmed_denied |
components/intelligence/src/service/fact_compiler.rs, components/intelligence/src/domain/claim_batch.rs |
experiment_result_admissible |
An experiment may claim uplift only at the admissible final look, with enough units and a positive lower bound. | 3: experiment_result_exact, experiment_immature_denied, experiment_undersized_denied |
components/intelligence/src/domain/experiment_model.rs |
sovereign_request_admissible |
In sovereign mode a model request leaves the process only for the self-operated provider on a self-hosted endpoint. | 4: sovereign_request_exact, sovereign_foreign_provider_denied, sovereign_foreign_endpoint_denied, sovereign_off_admits |
crates/cognition/src/inference/sovereign.rs |
Rules and flows
8 rules, 13 proved properties. Source.
| Rule | What the source says about it | Proved properties | Used in |
|---|---|---|---|
customer_group_net |
Net presentation requires a currently configured group with an explicit business basis. | 2: customer_group_unknown_denied, customer_group_net_exact |
components/pricing/src/types/customer_group.rs |
destination_tax_admissible |
Destination tax rules require every configured jurisdiction and validity condition. | 1: destination_tax_exact |
components/pricing/src/service/tax.rs |
flow_delay_admissible |
A durable flow delay is bounded to thirty days. | 1: flow_delay_exact |
components/marketing/src/domain/pipeline.rs |
notification_retry_admissible |
A notification may be retried only after an explicit rate-limit rejection and before attempt eight. | 2: notification_retry_exact, notification_ambiguous_never_retry |
extensions/services/connectors/src/worker.rs |
resource_quota_admissible |
No comment in the source | 2: resource_quota_exact, resource_quota_zero_denied |
components/shop/src/http/operator_quotas.rs |
rule_authenticated |
A guest address never grants the authenticated-customer rule. | 2: rule_authenticated_exact, rule_guest_denied |
components/marketing/src/domain/rule_match.rs |
rule_boolean_comparison |
Explicit supported comparison operators select equality, inequality or emptiness. | 1: rule_comparison_exact |
crates/automation/src/rule_comparison.rs, components/marketing/src/domain/rule_match.rs |
rule_xor_count |
Exclusive OR admits precisely one matching child. | 2: rule_xor_exact, rule_xor_empty |
crates/automation/src/rules/evaluation.rs |
Apps and their sandbox
14 rules, 30 proved properties. Source.
| Rule | What the source says about it | Proved properties | Used in |
|---|---|---|---|
app_callback_admissible |
Original app consent and the creator's current core role must both permit a callback. | 2: app_callback_exact, app_callback_without_consent_denied |
components/apps/src/domain/callback_grant.rs |
app_configuration_release_admissible |
Operational receipts and customer/order extensions cannot become configuration release units. | 3: app_configuration_release_exact, app_configuration_release_operational, app_configuration_release_receipts |
components/apps/src/domain/core_extensions.rs |
app_core_reference_admissible |
Personal core references are private; only product references may be declared public. | 2: app_core_reference_private, app_core_reference_exact |
components/apps/src/domain/field_values.rs, components/apps/src/domain/reference_policy.rs |
app_flow_admissible |
Only an explicitly eligible private mutation action may be bound to a durable flow. | 2: app_flow_exact, app_flow_readonly_denied |
components/apps/src/service/flow_apps.rs |
app_package_authorized |
A package may use operator credentials only if its exact content is pinned or bundled. | 2: app_package_authority_exact, app_package_unapproved_denied |
components/apps/src/domain/approval.rs |
app_read_admissible |
GET app routes require declared read-only behavior and exclude managed mutations. | 2: app_read_safe, app_read_exact |
components/apps/src/domain/field_values.rs, components/apps/src/domain/action_policy.rs |
app_service_transport_admissible |
Private HTTP requires an exact operator-approved origin; unsafe URL parts are always denied. | 3: app_service_transport_exact, app_service_transport_unapproved_denied, app_service_transport_unsafe_denied |
components/apps/src/domain/service_policy.rs |
app_submission_admissible |
Public intake can only append to a private inbox in a live, cart-bound context. | 2: app_submission_exact, app_submission_private_live_cart |
src/apps/submissions.rs |
app_surface_admissible |
UI grants cannot outlive their immutable package or expand their server-selected action set. | 2: app_surface_exact, app_surface_stale_denied |
components/apps/src/http/surface_grants.rs, components/apps/src/store/surface_grants.rs |
app_tool_admissible |
An explicitly disabled agent action cannot be exposed or invoked, even to an authorized actor. | 2: app_tool_exact, app_tool_disabled |
components/apps/src/store/tool_catalogue.rs, components/apps/src/domain/mcp_views.rs |
job_completion_admissible |
A requested cancellation cannot be committed as a successful job completion. | 2: job_completion_exact, job_cancelled_success_denied |
components/apps/src/service/job_callbacks.rs |
native_lifecycle_admissible |
Declarative app lifecycles can only narrow the current native transition authority. | 2: native_lifecycle_safe, native_lifecycle_exact |
components/apps/src/domain/native_lifecycle.rs |
source_activation_admissible |
An active imported promotion requires a deliberately reviewed source mapping; ordinary promotions retain native admission. | 2: source_activation_exact, source_activation_unreviewed_denied |
components/marketing/src/types/promotion.rs |
wasm_resources_admissible |
Guest instances have bounded private and exported resources alike. | 2: wasm_resources_exact, wasm_tables_bounded |
crates/apps/src/sandbox.rs |
How this page stays current
python3 scripts/formal/coverage_page.py writes this page. The required quick
check runs it with --check and fails when the page differs from the
manifest, when a rule in the kernel is missing from the manifest, or when a
listed rule has no proved property. Adding a source file therefore changes
the numbers above in the same change.