agent-mandate
Use when issuing or verifying owner mandates and approvals, evaluating ODRL policy sets, importing pilot JWS mandates, or adapting the policy-engine seam in @jeswr/agent-mandate.
- License 许可
- MIT
- 所属仓库
- jeswr/solid-sdk
- 最近更新
- 2026-11-15
- Stars
- ★ 2
- Forks
- 0
01 前言 Front Matter
- name
- agent-mandate
- description
- Use when issuing or verifying owner mandates and approvals, evaluating ODRL policy sets, importing pilot JWS mandates, or adapting the policy-engine seam in @jeswr/agent-mandate.
02 资源文件 35
- 参考文档package.json1.9 KB
- 参考文档README.md9.9 KB
- 脚本scripts/generate-legacy-fixture.mjs2.7 KB
- 脚本src/approval.ts6.2 KB
- 脚本src/codec.ts8.4 KB
- 脚本src/control.ts5.6 KB
- 脚本src/document.ts4.0 KB
- 脚本src/index.ts1.0 KB
- 脚本src/instant.ts528 B
- 脚本src/issue.ts261 B
- 脚本src/legacy.ts5.4 KB
- 脚本src/mandate.ts9.5 KB
- 脚本src/policy.ts13.0 KB
- 脚本src/rdf.ts5.0 KB
- 脚本src/sparq.ts12.3 KB
- 脚本src/testing.ts641 B
- 脚本src/types.ts3.2 KB
- 脚本src/verify.ts320 B
- 脚本test/approval.test.ts11.7 KB
- 脚本test/browser-bundle.test.ts1.1 KB
- 脚本test/control.test.ts17.7 KB
- 脚本test/document.test.ts6.5 KB
- 脚本test/exports.test.ts2.0 KB
- 参考文档test/fixtures/legacy.json4.4 KB
- 脚本test/hardening.test.ts7.3 KB
- 脚本test/helpers.ts9.2 KB
- 脚本test/instant.test.ts940 B
- 脚本test/legacy.test.ts13.1 KB
- 脚本test/mandate.test.ts24.6 KB
- 脚本test/policy.test.ts30.0 KB
- 脚本test/rdf.test.ts7.8 KB
- 脚本test/sparq.test.ts66.6 KB
- 参考文档tsconfig.json212 B
- 参考文档tsconfig.test.json201 B
- 脚本vitest.config.ts427 B
03 SKILL.md 正文
<!-- AUTHORED-BY Codex GPT-6.1-Sol -->
@jeswr/agent-mandate
Read README.md and agent DESIGN D3 / §4.2 before changing this security-critical surface. The public interfaces are in src/types.ts, src/mandate.ts, src/approval.ts and src/control.ts; ./testing contains explicit in-memory fakes. The optional Node-only sparq binary adapter is ./sparq.
Use issueMandate with Ed25519 (default) or explicit ecdsa-rdfc-2019 for a non-extractable
browser P-256 key, and a mandatory revocation status entry. Policies are embedded
in the signed credential graph. mandateToTurtle (historical name) / parseMandateCredential
transport the package-issued dataset losslessly as TriG (application/trig). Approvals use
the same transport. Proofs occupy named graphs and proofValue is a sec:multibase literal,
matching the standard Data Integrity context. Parsing is structural, so always run
createVcMandateVerifier.
The WebID key resolver and status resolver are mandatory injected seams. Never substitute
a verification method prefix heuristic or use a key supplied inside the document.
Only a mandate that passes integrity, owner/agent binding, validity and confirmed-clear status may reach PolicyEngine. Undefined means refuse-all. Expired/future/wrong-agent mandates refuse all authority. Any prohibition wins in every set, including against a broader requested action that covers the prohibited one. A set-valued operand under an isAnyOf permission constraint (or an isAllOf one with an unlisted value), missing context, unknown vocabulary, duties, engine failure and no matching rule require confirmation. A permit in withApproval still requires a separate verified approval. Accounting and transmissions belong to agent-executor.
Approval checks are ordered: exact ecdsa-rdfc-2019 suite / assertion purpose; WebID assertionMethod
and P-256 key; RDFC signature; proposal IRI; constant-work digest comparison; expiry using the
injected clock; approve/deny decision. Keep non-extractable key support. Browser signing uses
the ./approval and ./control subpaths with solid-vc's WebCrypto hashing and browser bundle.
src/mandate.ts must also bundle for browsers without Node builtins. Only ./sparq is Node-only.
Control statements use the agent-model vocabulary and require the same suite/key/signature
checks, then exact owner attribution and expiry. Claim readers are display only, never
authority. Do not implement alternate crypto here.
Legacy OwnerMandate JWS is import-only. Trust locally pinned keys, reject embedded keys and unexpected headers, enforce the pilot subset and require an injected revocation check. The test-only fixture generator must never persist private keys.
RDF reads/writes use typed @rdfjs/wrapper accessors; parsing uses @jeswr/fetch-rdf and serialization uses n3.Writer. Canonicalization and proof operations use @jeswr/solid-vc. All tests and scripts use synthetic example identities, generated test keys and injected I/O; never call live providers.
Maintain Node >=24, ESM/workspace dependencies, strict TypeScript, Biome, and 100% per-file coverage in every metric. Every decision-matrix row must name its expected decision and reason.
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.