Skip to content

AI data market

Agent error recovery business data: the fix is logged, the why is not

By SourceX Editorial · Reviewed by Noah Loul ·

9 sections

Short answer

Business records teach agents to recover only when four links survive: the wrong state, the trigger that exposed it, a correction tied to the original, and an independent check that the fix held. In ERPNext's open-source schema, 79 of 84 submittable document types link an amendment to the cancelled original, yet none of 536 types records why anything was cancelled. Back sellers that can attach the trigger and the check.

Agent run

Agent error recovery

This page covers agent error recovery business data: the fix is logged, the why is not.Illustrative

Key takeaways

  • Business records teach recovery only when the wrong state, the trigger, a linked fix and an independent check all survive in the data.
  • ERPNext's schema links 79 of 84 submittable document types to the cancelled original, but none of its 536 types has a field for why something was cancelled.
  • By default ERPNext's ledger reversal keeps the original posting date and flags both entries cancelled; the immutable option keeps mistake and fix in their own periods.
  • Simulated recovery data works where an environment can judge correctness; policy-bound business mistakes still need attached triggers and outcomes.
  • Diligence should ask for link rates with denominators, trigger-matching methods, ledger settings by month and the evidence behind each corrected outcome.

When do business records hold a recovery an agent can learn?

Only when four things survive in the data: the wrong state as it stood, the signal that exposed it, a correction tied back to the original, and a check made by something other than the person who fixed it. Lose any one of the four and the record shows that work changed, not how a competent operator noticed a mistake and repaired it.

That is the test for agent error recovery business data, and it matters to investors because recovery is where trained agents still break. The authors of Agent-R (arXiv 2501.11425, January 2025) write that approaches built on behavior cloning from stronger experts often falter in real-world applications, mainly because the agents cannot recover from errors. Their answer was to manufacture recovery examples inside simulated environments. Anyone backing a business-data supplier has to ask whether real operating records hold something those simulators cannot produce, and whether it can be extracted at a cost a buyer will cover.

This piece tests the question where a business system's design can be read line by line: the open-source ERPNext schema and the Frappe framework beneath it. It counts what the schema keeps when someone fixes a mistake, maps those parts onto what an agent needs, follows the value chain from a correction record to a gradable example, and ends with the risks and the questions an investor should put to any seller.

The agent-task input map for repairing a mistake

An agent practicing repair needs six inputs, and business systems write only some of them by default. It must start from the wrong state, receive the signal a person received, choose among the corrections the business allows, act, and be scored on whether the resulting state is right.

Each row below names one input, the part of an agent task it fills (state, action, constraint or outcome), where business records usually hold it, and the gap a buyer tends to find when the export arrives:

The agent-task input map for repairing a mistake
Input the agent needsTask partWhere records usually hold itCommon gap
The wrong state as it stoodStateThe cancelled or reversed document, kept read-onlyLost in systems that edit records in place
The trigger that exposed the mistakeState (new evidence)Support tickets, email, reconciliation notes, free-text remarksNot linked to the correction, or never written down
Corrections the business allowsConstraintApproval limits, credit-note rules, closed accounting periodsWritten policy differs from what operators actually did
The corrective actionActionAn amendment, return, credit note or reversal linked to the originalLink missing when staff start a fresh document instead
The resulting stateOutcomeThe replacement document and the balances after it postsPeriod reports that filter cancelled entries out
An independent checkOutcomeThe ledger reversal, a bank match, the customer's next paymentHeld in another system or arriving weeks later

What ERPNext's schema keeps when someone fixes a mistake

It keeps the corrective action and its link to the original almost everywhere, and keeps no structured record of why. On ERPNext's development branch at commit d648cbc (October 26, 2026), 84 of 536 document types are submittable, meaning they move from draft to submitted to cancelled. Of those 84, 79 carry an Amended From link; the other five are ledger and balance tables that other documents write. None of the 536 has a field named for a cancellation reason.

The framework underneath enforces the trail. Frappe's document code sets a record's status to cancelled rather than deleting it, refuses edits with the message "Cannot edit cancelled document", and blocks an amendment unless the original has been cancelled first. Where a document type has change tracking switched on, Frappe's version log compares a new amendment with the cancelled document it replaces, so the field-level difference between the mistake and the fix is written without anyone typing it.

Money corrections get their own links. Six transaction types, among them Sales Invoice, Purchase Invoice and Delivery Note, carry a Return Against field that points a return or credit note at the document it corrects, and Journal Entry carries a Reversal Of link. Change tracking is on for 46 of the 84 submittable types; for the other 38 the version log keeps no field-level history of edits.

The counts come from reading every DocType definition file in the repository; the methods note gives the exact definitions behind each row:

What ERPNext's schema keeps when someone fixes a mistake
Part of the trailHow ERPNext records itDocument typesWhat it means for an agent dataset
Wrong state keptCancelling sets status 2; a cancelled record cannot be editedFramework rule covering all 84 submittable typesThe mistake survives as a read-only record
Fix linked to the originalAmended From link on the replacement79 of 84 submittable typesOriginal and fix join without guesswork
Return or reversal linkedReturn Against on returns and credit notes; Reversal Of on journals6 transaction types and 2 child tables; 1 journal typeMoney corrections join the invoice they fix
Field-level differenceVersion log, when change tracking is on46 of 84 submittable types (309 of 536 overall)What changed between mistake and fix is explicit
Ledger cancel flagIs Cancelled on ledger rows4 types, including GL Entry and Stock Ledger EntryThe accounting effect of a fix is traceable
Reason for cancellingNo dedicated field; free-text remarks on some types0 of 536 with a reason field; remarks on 17 of 84 submittableThe trigger must come from tickets, email or notes
Four links of a recovery trail drawn as a chain with ERPNext schema counts: wrong state kept in all 84 submittable types, trigger recorded in 0 of 536 types, fix linked in 79 of 84, and a ledger check flag in 4 types.
What ERPNext's schema records for each link of a recovery trail, counted from its DocType files at commit d648cbc (October 2026). Counts are document types, not records.

One ledger setting decides whether the mistake stays visible

ERPNext can fold a mistake out of period reports or keep it in view, depending on one setting that is off by default. When a submitted voucher is cancelled, the general ledger code copies each original entry, swaps debit and credit, and writes the remark "On cancellation of" followed by the voucher number. Under the default it flags both the originals and the reversals as cancelled, and the reversal keeps the original posting date unless another date is passed in.

The alternative is the setting labeled Enable Immutable Ledger. Its description in the Accounts Settings definition reads: "On enabling this cancellation entries will be posted on the actual cancellation date and reports will consider cancelled entries as well." In the code, reversals written under that setting stay active and take the cancellation date. A second setting, labeled "Delete Accounting and Stock Ledger entries on deletion of transaction", is also off by default; where an administrator turned it on, the ledger evidence can go with a deleted transaction.

For a recovery dataset the difference is large. Under the default, a report limited to active entries shows neither the mistake nor its correction, and the time between them collapses onto one posting date. Under the immutable setting, the mistake sits in the period where it happened and the fix in the period where someone caught it, which is exactly the lag an agent needs in order to learn when to look again. A supplier should say which setting applied to which months, because a switch partway through splits one archive into two regimes.

From correction record to gradable recovery: where value sits

Value sits in the joins and the check, not in the count of correction records. A raw archive of credit notes and amendments is the cheap end of the chain, and each later stage adds something an agent builder cannot pull from the system of record alone.

At a glance

From correction record to gradable recovery: where value sits

Software engineering shows what the last stages are worth. SWE-Gym (arXiv 2412.21139) turned 2,438 real GitHub issue tasks from 11 open-source repositories into a training environment by pairing each with an executable runtime and unit tests, and the test suites decide whether a sampled agent trajectory succeeded. The authors report absolute gains of up to 19 percent in resolve rate on SWE-Bench Verified and Lite after fine-tuning. The issues and the code were public before; the executable check is what made them trainable.

Business recovery data has no unit tests. Its nearest equivalents are ledger reversals, reconciliations and what the customer did next, and those sit in other tables or other systems from the correction. A seller that attaches them offers the gradable part of the chain; a seller that ships correction records alone offers the abundant part. The five stages run as follows:

  • Correction records: amendments, returns and reversals with their links, exported as the system wrote them. Plentiful wherever a company cancels rather than overwrites.
  • Joined trigger: the ticket, email, reconciliation note or approval comment that caused each correction, matched to it by a stated method with a measured error rate. Scarce, because the schema leaves it outside the document.
  • Replayable prior state: documents, balances and the policy in force just before the mistake, rebuilt so an agent can face the same situation.
  • Independent check: evidence from a second source that the corrected state held, such as the ledger after reversal, a matched payment or a closed dispute. This turns a demonstration into something a grader can score.
  • Licensed asset: sequences a buyer can replay and score, under terms that name training or evaluation as permitted uses.

Could simulated failures make real recovery records unnecessary?

For mistakes a simulator can judge, largely yes; for mistakes judged by policy and by what happened next in the business, the public evidence does not settle it. Agent-R builds recovery data with Monte Carlo tree search: the model identifies the first error step it can recognize in a failed trajectory, and that point is spliced onto a correct path sharing the same parent node. The authors report a 5.59 percent gain over baselines across three interactive environments and say agents learn to correct errors earlier.

That technique needs an environment able to declare a branch correct. Many business mistakes have no such judge: whether a credit note should have gone out depends on the contract, the approval limit and whether the customer paid afterwards. A record collection supplies those judgments only when the trigger and the outcome come attached, which is why the schema counts matter. A system that keeps every fix and no reason yields demonstrations of repair, not lessons in when repair is needed.

The strongest objection to the thesis is therefore narrower than it first looks: a record collection may lack the environment and the outcome evidence an agent needs. No public study yet compares agents trained on real business recovery sequences with agents trained on simulated ones. Treat the thesis as plausible where outcomes are policy-bound and checkable, weak where a simulator can grade the result, and unproven until that comparison is published.

Six ways the recovery-data thesis could fail

Six developments could make business recovery records worth far less than this argument suggests, and each points to evidence an investor can ask for before committing:

  • Simulators reach business tasks. If tree-search methods such as Agent-R extend to policy-bound work, synthetic recoveries could undercut real ones on price.
  • Triggers stay in free text. With no reason field among ERPNext's 536 document types and remarks on only 17 of 84 submittable ones, joining a correction to its cause may cost more than buyers will pay.
  • Configuration hides the mistake. A ledger run without the immutable setting folds error and fix onto one date, and a change of setting mid-archive leaves two regimes in one dataset.
  • Silent edits never appear. The 38 submittable ERPNext types without change tracking keep no field-level history, so a dataset tilts toward mistakes big enough to need a formal cancellation.
  • No environment to replay in. SWE-Gym's tasks became trainable once each had an executable runtime and tests; business sequences without a rebuildable prior state remain demonstrations.
  • Rights do not travel with the export. Correction trails name customers, vendors and staff, and the company's contracts and notices decide whether an outside AI use is allowed; holding the records does not settle that.

What to ask a recovery-data seller before investing

Ask for evidence on every link of the trail, each with a numerator and a denominator, rather than a total record count. A seller that cannot say how many of its corrections carry a trigger is pricing the abundant layer as if it were the scarce one.

SourceX is one application of this question. It arranges licenses for selected operating records that companies supply to AI developers, handling rights review, contracting and preparation, and the supplying company signs off on scope and terms before any data reaches SourceX. It has published no figures on recovery data. SourceX is raising from accredited investors under Rule 506(c); its company materials are available on request through the investors page. Put these questions to it and to any other seller:

Checklist · 7 items

  1. What share of correction records in scope link to their original, by document type, and how was that share computed?
  2. For what share is the trigger attached, from which system, by which matching method, and with what measured error rate?
  3. Which ledger and change-tracking settings applied in which months, and were any switched during the archive?
  4. Can the prior state, including the policy then in force, be rebuilt as of the moment before each mistake?
  5. What independent evidence confirms each corrected outcome, and how long after the fix does it usually arrive?
  6. How many corrections occurred per process against how many original documents, so a buyer can see the base rate?
  7. Which uses do the supplying company's contracts and notices permit, and who signed for them?

0 of 7 ticked. Tick each item as you go.

Methods note: how the ERPNext counts were made

Repository: github.com/frappe/erpnext, development branch, commit d648cbc dated October 26, 2026, read on October 27, 2026 from a shallow clone containing every DocType definition file (doctype/<name>/<name>.json) plus the general ledger module and the Accounts Settings definition. Framework behavior comes from github.com/frappe/frappe at commit cd78619 (October 27, 2026), files frappe/model/docstatus.py and frappe/model/document.py.

Definitions: submittable means is_submittable is 1; a fix link is a field named amended_from; a return link is return_against; a reversal link is reversal_of; a ledger cancel flag is is_cancelled; change tracking means track_changes is 1; a reason field is any field whose name contains cancel together with reason, remark, cause or why; free-text remarks are fields named remarks, remark, user_remark or custom_remarks. The counting script is filed with this article's review materials so the numbers can be rerun.

Not measured: how often companies fill these fields, any production ERPNext data, custom fields a company may add, and other ERP systems. A schema shows what a system can record, not what a given archive holds. The input map, the value chain and the risk list are editorial frameworks built on these counts and the two cited papers; Agent-R and SWE-Gym figures are as their authors report them.

Frequently asked questions

What counts as error recovery data for AI agents?

A sequence showing a wrong state, the signal that exposed it, the correction and evidence that the correction held. Business systems produce corrections constantly through amendments, credit notes and reversals, but the signal and the evidence often sit in other systems. Without them, the sequence shows that work changed, not why it had to.

Do ERP systems record why a document was cancelled?

In ERPNext's open-source schema, read at commit d648cbc in October 2026, none of the 536 document types has a field named for a cancellation reason, and 17 of the 84 submittable types offer free-text remarks. Other ERP systems were not examined, and companies can add custom fields of their own.

Can simulated failures replace real business recovery records?

Where a simulator can declare a path correct, methods such as Agent-R already generate recovery examples by splicing failed paths onto correct ones. For mistakes judged by contracts, approval limits and what a customer did next, no public study yet shows simulated recoveries matching real ones.

What makes a recovery example gradable?

An outcome check that does not depend on the person who made the fix, such as a ledger reversal, a matched payment, a reconciliation or a closed dispute. SWE-Gym shows the pattern in software, where unit tests decide whether an agent's attempt resolved a real GitHub issue.

Has SourceX published data on recovery records?

No. SourceX arranges licenses for selected business records that companies supply to AI developers, and it shares company information with investors directly rather than publicly. Investors evaluating it can request materials through sourcex.si/investors and should ask the same link-rate and trigger questions listed above.

Sources

  • ERPNext's DocType definitions at commit d648cbc (October 26, 2026): 536 document types, 84 submittable, 79 of them with an Amended From link, Return Against on six transaction types, Reversal Of on Journal Entry, change tracking on 46 submittable types and no field named for a cancellation reason. Source
  • ERPNext's Sales Invoice definition carries a read-only Amended From link, a Return Against link and an Is Return (Credit Note) flag. Source
  • Frappe defines document status 0 as draft, 1 as submitted and 2 as cancelled. Source
  • Frappe's cancel sets status 2 and saves, refuses edits to cancelled documents, allows an amendment only of a cancelled original, and compares an amendment with its original in the version log when change tracking is on. Source
  • ERPNext reverses ledger entries on cancellation by swapping debit and credit with the remark 'On cancellation of' the voucher, flagging entries as cancelled by default and posting active reversals on the cancellation date under the immutable ledger setting. Source
  • ERPNext's Accounts Settings define Enable Immutable Ledger, off by default, which posts cancellation entries on the actual cancellation date and makes reports consider cancelled entries, and a default-off option to delete ledger entries with a deleted transaction. Source
  • Agent-R (January 2025) argues behavior-cloning agents falter mainly from an inability to recover from errors, builds recovery data by splicing failed and correct paths found with Monte Carlo tree search, and reports a 5.59 percent gain across three interactive environments. Source
  • SWE-Gym pairs 2,438 real GitHub issue tasks from 11 repositories with executable runtimes and unit tests that decide trajectory success, and reports absolute resolve-rate gains of up to 19 percent on SWE-Bench Verified and Lite. Source

Request SourceX investor materials

SourceX shares company and commercial metrics with investors directly. Any offering is made only to verified accredited investors.

See if your company qualifies