agent-audit
Use when working on the system-written audit ledger surface in @jeswr/agent-audit.
- License 许可
- MIT
- 所属仓库
- jeswr/solid-sdk
- 最近更新
- 2026-11-15
- Stars
- ★ 2
- Forks
- 0
01 前言 Front Matter
- name
- agent-audit
- description
- Use when working on the system-written audit ledger surface in @jeswr/agent-audit.
02 资源文件 42
- 脚本bin/audit.mjs176 B
- 脚本demos/css-process.mjs2.1 KB
- 脚本demos/css.ts7.4 KB
- 脚本demos/rdf.ts2.5 KB
- 参考文档demos/README.md4.4 KB
- 脚本demos/scenario.ts13.5 KB
- 参考文档demos/tsconfig.json166 B
- 脚本demos/walkthrough.ts4.6 KB
- 参考文档package.json1.9 KB
- 参考文档README.md14.9 KB
- 脚本src/cli.ts1.8 KB
- 脚本src/decision-record.ts1.3 KB
- 脚本src/file-ledger.ts4.3 KB
- 脚本src/index.ts843 B
- 脚本src/ledger.ts778 B
- 脚本src/prov.ts2.4 KB
- 脚本src/rdf.ts3.5 KB
- 脚本src/reader.ts12.6 KB
- 脚本src/records.ts4.1 KB
- 脚本src/stats.ts7.2 KB
- 脚本src/testing.ts1.6 KB
- 脚本src/transport.ts2.6 KB
- 脚本src/verify.ts6.4 KB
- 脚本src/writer.ts4.8 KB
- 脚本test/audit.test.ts17.8 KB
- 脚本test/browser.test.ts3.8 KB
- 脚本test/css-process.mjs2.0 KB
- 脚本test/css.test.ts8.1 KB
- 脚本test/demo-replay.mjs4.8 KB
- 脚本test/demo.test.ts3.3 KB
- 脚本test/exports.test.ts2.3 KB
- 脚本test/fixture.ts4.3 KB
- 其他test/fixtures/1.ttl860 B
- 其他test/fixtures/chain.ttl352 B
- 资产文件test/fixtures/stats.csv510 B
- 脚本test/ledger.test.ts8.2 KB
- 脚本test/mirror.test.ts18.6 KB
- 脚本test/stats.test.ts9.9 KB
- 脚本test/verify.test.ts9.6 KB
- 参考文档tsconfig.json212 B
- 参考文档tsconfig.test.json201 B
- 脚本vitest.config.ts427 B
03 SKILL.md 正文
<!-- AUTHORED-BY Codex GPT-6.1-Sol --> <!-- AUTHORED-BY Codex GPT-6 -->
@jeswr/agent-audit
Read agent DESIGN §2 / §5 and README.md before changing this security-critical API.
The root exports the bounded local ledger, PROV mirror, reader, auditor CLI and
A-045 task statistics (verify retained evidence before exporting body-free counts);
./verify is the pure browser-safe API for shared record schemas/types, seal,
checkedRecord, parseAuditEntry, parseAuditHead / auditHeadSchema,
verifyLedger, verifyRange and verifyLatestRange, plus kinds, bounds and scope
constants. Keep its entire runtime import graph free of Node builtins, fs,
process and Buffer; use TextEncoder for the 64 KiB UTF-8 record bound.
writeEntryGraph and writeHeadGraph share the daemon's exact PROV projection
through caller-supplied AuditProjectionNode wrappers, without importing RDF
parsers or n3. Reuse these writers in browser adapters; never copy the projection.
Node consumers must reuse it. Never duplicate validation in an app adapter.
Full retained ledgers require genesis or a matching checkpoint; explicit fetched
ranges verify only their supplied prefix. Latest nonempty ranges require a
published head; historical ranges pass an explicit through endpoint. Preserve
both scopes and never sort inputs before verification. Apps retain pod I/O,
exact PROV projection checks and UI shaping. Keep the compiled import-graph and
Node-global-free smoke tests passing.
./testing contains the conditional anonymous in-memory resource fixture.
Aggregate unassigned legacy records separately, including counter validation, instead
of dropping their measurements. JSON exposes unassigned counters and CSV uses an
empty-task summary row; never infer a task from model-selected proposal references.
Use one FileLedger writer per path. Preserve fsync-before-prune checkpoints, canonical hashes, detached snapshots and integrity checks before append. Never accept arbitrary record payloads: bodies and prompts stay outside the ledger and mirror. Recipients must be salted, account-bound hashes. Pod writes use injected ADR-003-compatible fetch, immutable conditional entry creation and ETag-conditional head updates; failures reject.
The auditor re-runs agent-mandate verification, policy evaluation per recipient and approval verification. Missing/ambiguous PROV, unknown status, unknown accounting, forged/reused/missing approvals and unsupported scope fail closed. Require a separate fresh approval even when the policy's autonomous set matches. Default requests are anonymous, DNS-pinned and refuse redirects; never widen grants or substitute trace claims for public-key/controller or revocation verification. Report historical-status and tail-completeness limits honestly. Use only generated synthetic keys and injected I/O in tests; the CSS fixture must remain loopback-only and memory-backed.
Follow ADR-001 D4: Node >=24, ESM exports, workspace dependencies, strict TypeScript, Biome, and Vitest. Maintain 100% branches/functions/lines/statements coverage.
Never use live providers or credentials in tests. Future fake implementations belong
in ./testing. Send implementations belong exclusively in channel send subpaths,
importable only by agent-executor and channel tests. Only agent-model-gateway may
import OpenAI or Anthropic SDKs; the gateway must never import agent-audit.
04 同仓库更多 Skills
storage-conformance
Work on @jeswr/storage-conformance, the shared storage conformance suite package in the Solid SDK workspace.
fetch-rdf-engine-tests
Maintain fetch-rdf's real Node WASM parser integration tests without introducing a reverse engine dependency in fetch-rdf.
alpha
Use when checking fixtures, including folded YAML descriptions.
widget
Use when testing package skills: YAML quoting works.
web-seo
Use when improving technical and entity SEO for a modern personal, portfolio, documentation, or marketing site, including crawlable HTML, canonical metadata, sitemap and robots, Person/ProfilePage JSON-LD, Core Web Vitals, and honest ranking expectations.
solid-wac
Use when implementing or auditing Solid server WAC authorization, ACL creation and inheritance, auxiliary-resource escalation, method-to-mode mapping, 401 versus 403 challenges, WAC-Allow, or defensive typed ACL parsing with @solid/object and @rdfjs/wrapper.