Inspiration
An editor has already licensed the visuals. Then the client changes the campaign from organic posts to paid advertising, adds countries or extends its duration. Buying the assets again wastes money; assuming the old permissions still apply leaves a gap. CutLedger makes that difference visible and purchasable.
What it does
An editor pastes a client revision. Gemini proposes structured usage changes and shows literal source evidence. The editor confirms or corrects the proposal before it affects a campaign revision. A deterministic backend compares that immutable revision against permissions already held and the merchant's supported policies.
The three-asset Northstar example needs two upgrades and already covers one asset: $8+$12+$0=$20. Prior eligible rights receive credit. Each quote binds the revision, policy and entitlement version for ten minutes. PayPal Sandbox hosts buyer approval; explicit capture confirmation lets the server capture and independently verify the order, merchant, currency and amount before it atomically issues revision-linked permissions. Historical grants remain immutable. Covered usage needs no new purchase, and unsupported television use blocks checkout rather than receiving an invented price.
How we built it
One Java 17/Spring Boot 3.5.16 modular application serves React 19.3.0/TypeScript 6.0.3/Vite 8.3.7 from the same origin. PostgreSQL 17.11 stores revisions, quotes, grants, durable provider operations and leased jobs. There are no brokers or separate agent services.
Gemini 3.5 Flash-Lite GenerateContent provides real structured extraction. The server validates the full canonical schema, exact evidence substrings, dates, enums, inherited fields and unresolved issues. Durable quotas, bounded retries, dispatch pacing and refresh recovery constrain cost and failure. The model has no pricing authority or payment tools.
PayPal Sandbox Ordersv2 is central to acquiring the additional rights. Durable operation identities are stored before sending. An uncertain result keeps the campaign locked; recovery reads provider resources instead of blindly sending another monetary operation. Signature-verified webhooks trigger independent provider verification. Database transactions and uniqueness constraints prevent partial or duplicate grant issuance.
AG Grid Community 36.2.0 presents held/requested scope, changed dimensions, sorting, filtering, a pinned server total and merchant-policy evidence. Mobile cards use the same backend result. APIMatic's PayPal Context Plugin informed operation lookup, request/header construction and retry boundaries in the Java adapter and its tests. AGStudio and Enterprise are not used.
Challenges
Provider availability and quota were real engineering constraints. The original model path repeatedly failed; documented alternatives were evaluated before explicitly adopting the accessible free-tier Flash-Lite model. Failed requests remain in the benchmark report. The application fails closed and offers a visibly labeled manual fallback; it never invents an AI success.
Payment uncertainty was another design constraint. A provider may capture successfully while the application loses the response or crashes before committing grants. The ledger separates durable monetary intent, external verification and atomic fulfillment so recovery can complete the same purchase safely.
What we accomplished
The reviewed backend passed 74 tests, including 32 PostgreSQL integration tests, plus provider-contract, canonical-validation, domain and configuration coverage. The latest local frontend passed nine browser checks against a clean, credential-free isolated installation. Earlier real-model verification is separate historical evidence, not a fresh test of judge credentials. Desktop, tablet and mobile states were inspected. Payment faults in automated tests use explicitly synthetic provider fixtures; there is no runtime mock-paid endpoint. Live-payment evidence is excluded from the source repository.
The 40-sample real-model benchmark met the agreed narrow thresholds: 21/23 explicit exact matches (91.3%) and 17/17 unsafe checkout blocks. Two provider 503 failures and one overcautious duration clarification remain disclosed. All 38 returned responses passed canonical schema/evidence validation. These are small synthetic benchmark results, not general accuracy or legal-understanding claims.
What we learned
A useful AI feature can have a deliberately narrow job. Evidence-backed proposals make a brief editable, while deterministic policies, immutable snapshots and explicit confirmation keep money and coverage auditable. Clear uncertainty is more valuable than an optimistic success state.
What's next
The reviewed source and 2:05 narrated video are public. A hosted Sandbox demo is available at https://cutledger-demo.onrender.com with private judge access. The hosted walkthrough passed two real Gemini interpretations, one independently verified USD20 Sandbox capture with two new grants, a $0 same-use assessment, unsupported television blocking after refresh, and both signed approval/capture webhook deliveries. Complete local setup remains a fallback. Verification used the same Linux computer and Brave browser, not an independent second machine or pristine provider profile. Broader catalogs, arbitrary legal-text interpretation and production-money use are outside this entry.
Testing and scope
Hosted Sandbox demo: https://cutledger-demo.onrender.com . Obtain the demo code and separate eligible Personal Sandbox buyer instructions in Devpost’s private judges/organizers testing field. Render Free sleeps after inactivity; allow several minutes for the first visit. Free quotas can interrupt availability. Complete local setup remains available at https://github.com/Samuel2143/CutLedger#judge-access ; installation is separate from the walkthrough. Paid hosting is not required.
Single fictional merchant, original demo artwork, fixed policies and Sandbox funds only. Merchant-policy comparison is not general legal clearance. Application code is MIT licensed; artwork has separate demo terms.
Demo video: https://www.youtube.com/watch?v=gtKnsMyU3TU Reviewed source: https://github.com/Samuel2143/CutLedger/commit/51dc1c24664f13f59fb7a384fc22cd2a0f646709
Built With
- ag-grid
- apimatic
- docker
- gemini
- java
- neon
- paypal
- postgresql
- react
- render
- spring-boot
- typescript
- vite