@atcn/subledger 1.4.1 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,11 +1,14 @@
1
1
  # @atcn/subledger
2
2
 
3
- The ATCN Agent Work Subledger. It records a task's delegations, delivery claims and financial events. Charges are matched to work through stable references, and an event is attributed only when exactly one task or delegation matches. The package also covers:
3
+ The cost record behind [ATCN](https://github.com/fadnisnikhil/atcn): one record per AI agent job, called a task. Most people use it through [`@atcn/sdk`](https://www.npmjs.com/package/@atcn/sdk) or [`@atcn/local-runner`](https://www.npmjs.com/package/@atcn/local-runner); use this package directly to build or verify the documents yourself.
4
4
 
5
- - exceptions for unmatched, ambiguous, duplicate, over-budget and other conditions;
6
- - roll-up totals;
7
- - signed task closures and provider receipts;
8
- - `verifySubledgerDocument`, the offline verifier for those documents.
5
+ A task holds:
6
+
7
+ - **delegations:** pieces of the job handed to other agents or paid APIs;
8
+ - **delivery claims:** what each provider says happened, optionally signed by the provider;
9
+ - **financial events:** charges, fees, refunds, payments, estimates and holds.
10
+
11
+ Charges are matched to work through stable references (such as the provider's job id), and a charge is attributed only when exactly one task or delegation matches. Anything that doesn't add up becomes an **exception**: an unmatched or duplicate charge, billing after a cancellation, cost over budget or over the estimate, and more. The package also computes the totals, signs task closures and provider receipts, and verifies them offline.
9
12
 
10
13
  ```bash
11
14
  npm install @atcn/subledger
@@ -19,4 +22,6 @@ if (report.unsupported_schema_version) console.log("upgrade the verifier");
19
22
  console.log(report.valid);
20
23
  ```
21
24
 
22
- Supported subledger schema versions are `1.2` and `1.3`; see [COMPATIBILITY.md](../schema/COMPATIBILITY.md). Part of [ATCN](../../README.md). Apache-2.0.
25
+ The verifier recomputes the totals, the estimate-against-actual report and the open exceptions from the records in the document, so an issuer cannot quietly drop an inconvenient one.
26
+
27
+ Supported subledger schema versions are `1.2` to `1.5`; see [compatibility](https://github.com/fadnisnikhil/atcn/blob/main/packages/schema/COMPATIBILITY.md). Part of [ATCN](https://github.com/fadnisnikhil/atcn). Apache-2.0.