All docs
Docs
Labs

Contract-to-Cash lab

A demo-specific comparison of contract billing logic with app-owned glue versus Synapsor durable run state.

Overview

Demo-specific comparison, not a general database benchmark.

The Contract-to-Cash demo reviews invoice adjustments across renewal, amendment, side-letter, overage, and annual-upfront scenarios. It compares Synapsor plus an LLM lane against a Postgres plus app-glue plus LLM lane, with a rules-only lane as a baseline for the easy case.

The Postgres lane can reach the same target decisions, but the application owns retrieval, filters, evidence assembly, proposal workflow, audit, and replay glue. The Synapsor lane uses compact slots, hidden session bindings, selected hybrid evidence, reason codes, write proposals, branch state, settlement policy, and replay records as durable run state.

The metrics below come from the seeded demo artifact at docs/labs/contract-to-cash-metrics-20260519.json, generated from the current Contract-to-Cash demo code. They show this demo's input-token and app-glue reduction; they are workflow-specific and should not be read as a latency claim or a universal cost claim.

Contract workflow ownership

The comparison is about where close-period trust logic lives.

Postgres + app glue + LLM
  • App assembles invoice rows, raw clauses, policy chunks, approval rules, and replay scaffolding
  • App owns close-period tenant filters and billing guardrails
  • App owns proposal workflow, audit rows, and replay reconstruction
  • The prompt carries larger repeated context
Synapsor + LLM
  • DB binds tenant, principal, current case, customer, contract, invoice, branch, and close period
  • DB prepares compact slots and selected evidence lookup records
  • DB stages invoice adjustments as write proposals on branches
  • DB keeps settlement and replay semantics close to the data

Synapsor DBMS table design

The Synapsor lane is modeled so contract, invoice, usage, evidence, proposal, and replay state can be governed close to the rows being reviewed.

Tuple hot/reference tables
  • customers: customer_id, tenant_id, customer_name - hot_state
  • contracts: contract_id, tenant_id, customer_id, contract_number, status - hot_state
  • invoices: invoice_id, tenant_id, customer_id, contract_id, invoice_number, status, total_amount_cents - hot_state
  • c2c_exception_cases: case_id, tenant_id, customer_id, contract_id, invoice_id, close_period, case_type, risk_level, status - hot_state
Tuple log/audit tables
  • c2c_adjustment_proposals: adjustment_id, case_id, customer_id, contract_id, invoice_id, close_period, proposal_state, proposed billing/revenue adjustment - hot_state
  • c2c_audit_events: audit_id, case_id, actor, action, payload, created_at - audit_log
  • Synapsor-native branch state: auto branch, diff, settlement, commit, merge, replay record
  • Synapsor-native evidence/write proposal resources stay linked to the case, invoice, and proposal lookup ids
Hybrid knowledge table
  • contract_clause_chunks: chunk_id, tenant_id, contract_id, amendment_id, clause_type, title, status, body - searchable_knowledge
  • revenue_policy_chunks: chunk_id, tenant_id, policy_id, topic, status, allowed_role, body - searchable_knowledge
  • Hybrid retrieval selects contract clauses, side letters, credits, usage approval rules, and revenue policy chunks
  • Hidden bindings keep tenant, close_period, customer_id, contract_id, and invoice_id out of model-controlled arguments

Contract-to-Cash table relationship diagram

The diagram uses the local Contract-to-Cash Synapsor SQL schema plus Synapsor-native evidence, branch, settlement, and replay resources.

Contract-to-Cash schema relationship diagramTable relationship diagram showing core rows, reference data, knowledge chunks, evidence, proposals, settlement, branches, and audit/replay tables.1:N1:Ncurrent invoicetermsclausespoliciescase contextinvoice factssupportsproposal targetstageauditrun logcustomerscustomer_id PKtenant_idcustomer_namecontractscontract_id PKcustomer_id FKcontract_numberinvoicesinvoice_id PKcontract_id FKtotal_amount_centsc2c_exception_casescase_id PKinvoice_id FKclose_periodcontract_clause_chunkschunk_id PKcontract_idbody hybridrevenue_policy_chunkschunk_id PKtopic/statusbody hybridevidence recordssource idspolicy chunksreplay snapshotc2c_adjustment_proposalsadjustment_id PKinvoice_id FKproposal_statebranch + settlementauto branchdiff/settlemerge recordc2c_audit_eventsaudit_id PKcase_id FKaction/payloadcore rowsreferenceknowledgeproposal/audit

Sample seed data

Representative seeded cases from the local Contract-to-Cash demo. These are controlled demo cases for explaining workflow ownership, not production customer data.

Close cases
  • C2C-1001 Acme Robotics | Mid-quarter Analytics upgrade plus unapplied SLA credit | expected billing adjustment -$7,000.00
  • C2C-1002 BetaCloud | Clean monthly renewal | no adjustment required
  • C2C-1003 Northstar Health | Side-letter concession applied to the wrong line | reclass adjustment required
  • C2C-1004 MedNova Labs | Usage overage above approval threshold | billing hold required
  • C2C-1005 OmniWorks | Annual upfront billing with ratable revenue requirement | revenue schedule required
Evidence and policy rows
  • POL-REV-001 | Revenue recognition five-step model
  • POL-REV-002 | Ratable subscription treatment
  • POL-REV-004 | Usage overage approval
  • POL-REV-006 | Approval thresholds
  • CC-ACME-003 | SLA service credit clause
  • CR-ACME-SLA-05 | Approved SLA credit not applied

Seeded demo measured averages

Source artifact: docs/labs/contract-to-cash-metrics-20260519.json. These seeded demo metrics are workflow-specific.

CategoryMetricPostgres + app laneSynapsor laneResult
Token pressureAverage input tokens5,6411,19778.8% fewer input tokens
Token pressureAverage output tokens75863815.8% fewer output tokens
Token pressureAverage total tokens6,3991,83571.3% fewer total tokens
Workflow overheadAverage tool calls12.41.885.5% fewer tool calls
Workflow overheadAverage DB round trips16.01.888.8% fewer DB round trips
Workflow overheadElapsed in seeded lane2.16s average1.10s averagedemo harness only, not a speed claim
Workflow overheadApp-owned glue LOC3185483.0% less app-owned glue
Trust and audit outputReplay records05Synapsor lane keeps replay records
Trust and audit outputWrite proposal objects4 app-managed proposal rows4 wrp:// proposalsSynapsor stages write proposals on branches
Trust and audit outputApp-owned policy checks4 ownership points0 app-owned pointssettlement logic moves into a Synapsor policy
Trust and audit outputRules-only baselineclean renewal passesmessy cases route to reviewLLM lane handles side letters, credits, approvals, and recognition nuance

Case-level input-token results

Seeded demo cases from the Contract-to-Cash artifact.

CategoryMetricPostgres + app laneSynapsor laneResult
CasesC2C-1001 Acme Robotics6,4781,5324,946 saved, 76.4%
CasesC2C-1002 BetaCloud5,2821,0414,241 saved, 80.3%
CasesC2C-1003 Northstar Health5,5111,1444,367 saved, 79.2%
CasesC2C-1004 MedNova Labs5,4921,1374,355 saved, 79.3%
CasesC2C-1005 OmniWorks5,4421,1294,313 saved, 79.3%

Adjustment proposal lifecycle

The Synapsor lane keeps contract-sensitive invoice adjustments branch-staged until policy or review allows settlement.

Adjustment proposal lifecycleContract-to-Cash binds customer, contract, invoice, and close-period state before staging invoice adjustments for settlement or review.invoice mainadjustment branchinvoicestatecontractcontextclose periodboundadjustmentproposaltermsvalidatedsettlegreen onlyholdmanual reviewmergeor replaycustomer + contract + invoice
1
main

Closed-period invoice state stays unchanged while the case is evaluated.

2
context

Synapsor binds tenant, close period, invoice, customer, and contract state outside model-controlled text.

3
proposal

The capability stages an adjustment proposal with evidence lookup records and reason codes.

4
settlement

Rules can auto-settle only deterministic low-risk outcomes; messy terms remain human-review required.

5
replay

The adjustment decision can be replayed with the original evidence and policy version.

Developer notes

  • This page is based on seeded demo measurements, not a universal benchmark.
  • The measured token savings come from compact Synapsor context and handles in this workflow.
  • Close-period destructive changes stay behind proposals, settlement policies, and review.
  • The page does not make general replacement, HA, SLA, compliance, serverless, or horizontal-scaling claims.