@cedulon/audit

中文文档
0.17.0发布于 2026/10/31Apache-2.0TypeScriptES Module构建来源已验证近 30 天下载 6545

Reconcile a rail extract against the Cedulon receipt chain.

原始使用文档

@cedulon/audit

Compare a rail extract to the receipt chain and checkpoints. A settlement without a receipt is a finding.

import { audit } from "@cedulon/audit";

const report = audit({ receipts, checkpoints, settlements });
// report.summary is "audit: balanced" or lists findings

An unmatched receipt or row within the clock-skew allowance of a window edge, which no presented adjacent extract resolves or hardens, is reported as boundary-deferred rather than charged, and the warning's needs says which document would resolve it: the previous or following window's extract, or a receipt that names the row's ref.

import { auditWindows } from "@cedulon/audit";

const run = auditWindows({ windows: [w0, w1, w2], trust, issuerTrust });
// run.windows: each window's own report; run.findings: what the run adds

auditWindows audits consecutive windows as one run. Each window sees its neighbours' extracts and is anchored on the last checkpoint the previous window's audit attested. In the run's own findings, a row deferred at an inner edge either resolves, when the adjacent window carried a receipt for its ref, or becomes settlement-without-receipt, and only deferrals at the run's two outer edges leave the run conditional; each window's own report is returned as that window's audit made it. The rail pin, like the issuer pin, takes one key or a list of keys.

import { checkPresentedForm, presentedInRange } from "@cedulon/audit";

checkPresentedForm(bundle);                       // [] or { object, member, problem }[]
presentedInRange(input, report, fromMs, toMs);    // what was presented in [fromMs, toMs)

checkPresentedForm reads a bundle against the presented form the core draft fixes (section "The presented form") before an audit: missing and unlisted members, hex and base64 spelling, encoding, claims against the COSE octets, and the decoder floor. It does not verify signatures.

Repository: https://github.com/dogrucanemek-alt/cedulon

版本与发布记录

@cedulon/audit 共发布 19 个版本,首次发布于 2026/08/26;过去 12 个月发布了 19 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.17.0latest2026/10/318 天前
0.16.02026/10/2614 天前
0.15.02026/10/1624 天前
0.14.02026/10/1524 天前
0.13.12026/09/111 个月前
0.13.02026/09/052 个月前

关于 @cedulon/audit 的常见问题

@cedulon/audit 是什么?

Reconcile a rail extract against the Cedulon receipt chain.

如何安装 @cedulon/audit?

在项目目录运行 npm install @cedulon/audit,或使用 pnpm add / yarn add / bun add。

@cedulon/audit 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@cedulon/audit 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@cedulon/audit 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=20。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@cedulon/audit 可以商用吗?

@cedulon/audit 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@cedulon/audit 的下载量有多少?

根据 npm 官方下载统计,@cedulon/audit 在 2026/10/10 – 2026/11/08 这 30 天内被下载 6,545 次,日均约 218 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@cedulon/audit 还在维护吗?

最新版本 0.17.0 发布于 2026/10/31(8 天前);至今共发布 19 个版本,其中过去 12 个月发布了 19 个;首次发布于 2026/08/26。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。