solid-a2a
Use when maintaining @jeswr/solid-a2a intent translation, SHACL validation, protocol documents or upgrade handshakes, including validation resource limits and worker packaging.
- License 许可
- MIT
- 所属仓库
- jeswr/solid-sdk
- 最近更新
- 2026-11-15
- Stars
- ★ 2
- Forks
- 0
01 前言 Front Matter
- name
- solid-a2a
- description
- Use when maintaining @jeswr/solid-a2a intent translation, SHACL validation, protocol documents or upgrade handshakes, including validation resource limits and worker packaging.
02 资源文件 59
- 参考文档docs/MODEL-PROVENANCE.md1.5 KB
- 许可证LICENSE1.0 KB
- 参考文档package.json2.4 KB
- 参考文档README.md12.0 KB
- 脚本scripts/build-deps.mjs5.7 KB
- 脚本scripts/build-dist.mjs7.5 KB
- 脚本scripts/sanitize-dist.mjs15.3 KB
- 脚本src/canonical.ts2.3 KB
- 脚本src/handshake.ts14.2 KB
- 脚本src/index.ts4.4 KB
- 脚本src/intent.ts9.0 KB
- 脚本src/iri.ts4.9 KB
- 脚本src/protocol.ts9.8 KB
- 脚本src/rdf-canonize.d.ts1.3 KB
- 脚本src/serialize.ts2.0 KB
- 脚本src/shape.ts8.2 KB
- 脚本src/translate.ts18.9 KB
- 脚本src/types.ts10.7 KB
- 脚本src/validate.ts3.5 KB
- 脚本src/validationCore.ts24.8 KB
- 脚本src/validationDataset.ts2.1 KB
- 脚本src/validationInputs.ts2.4 KB
- 脚本src/validationLimits.ts7.6 KB
- 脚本src/validationTransfer.ts2.1 KB
- 脚本src/validationWorker.ts1.0 KB
- 脚本src/validationWorkerClient.ts17.2 KB
- 脚本src/vocab.ts12.8 KB
- 脚本src/wrappers.ts14.8 KB
- 其他test/__snapshots__/characterization.test.ts.snap56.1 KB
- 脚本test/characterization.test.ts9.0 KB
- 脚本test/dist-sanitize.test.ts16.9 KB
- 脚本test/edge.test.ts6.1 KB
- 脚本test/fixtures/validation-heap.mjs1.7 KB
- 脚本test/fixtures/validation-idle.mjs438 B
- 脚本test/fixtures/validation-package.mjs610 B
- 脚本test/fixtures/validation-payload.mjs2.7 KB
- 脚本test/fixtures/validation-round3.mjs2.1 KB
- 脚本test/fixtures/validation-worker.mjs664 B
- 脚本test/handshake.test.ts10.3 KB
- 脚本test/hardening.test.ts24.3 KB
- 脚本test/intent.test.ts6.2 KB
- 脚本test/iri-hardening.test.ts13.3 KB
- 脚本test/iri-injection.test.ts5.6 KB
- 脚本test/namespace.test.ts14.4 KB
- 脚本test/protocol.test.ts9.9 KB
- 脚本test/translate.test.ts15.3 KB
- 脚本test/validate.test.ts5.3 KB
- 脚本test/validation-aliases.test.ts18.6 KB
- 脚本test/validation-identity.test.ts10.1 KB
- 脚本test/validation-pool.test.ts16.2 KB
- 脚本test/validation-round2.test.ts14.4 KB
- 脚本test/validation-round3.test.ts11.7 KB
- 脚本test/validation-timeout.test.ts6.4 KB
- 脚本test/validation-transfer.test.ts2.1 KB
- 脚本test/validationPaths.ts866 B
- 脚本test/validationWorkerSetup.ts2.2 KB
- 参考文档tsconfig.build.json222 B
- 参考文档tsconfig.json596 B
- 脚本vitest.config.ts524 B
03 SKILL.md 正文
<!-- AUTHORED-BY Codex GPT-6.1-Sol -->
solid-a2a
This package is security-critical. Read README.md for the public contracts.
- Preserve
validateIntent's async, never-throw report contract. Refused inputs, exhausted budgets, invalid timeout options, timeouts and worker failures returnconforms: falsewith a diagnostic inresults; there is no validation exception type or error code. src/validationCore.tsowns the step-model pre-check and shared 20,000-operation budget across validator datasets;validationLimits.tsowns quad-count, term and aggregate character caps (1 Mi data / 4 Mi shapes, escape-weighted UTF-16 code units). Count N-Quads expansion before encoding; never allocate escaped strings just to meter them. Refuse unsafe/relative IRIs and malformed BCP 47 tags on both execution paths. Keep these protections in the worker and in the browser fallback.- Node validation uses a lazy bounded pool, defaulting to min(2, availableParallelism())
workers and 64 queued calls. Preserve configurable
ValidationWorkerPoolsize (1–8)/queue bounds, per-worker resource limits (512 MiB old / 16 MiB young / 4 MiB stack), ready-before-dispatch warming and idleunref(). Worker warm-up has an independent configurablestartupTimeoutMs(default 10000), surviving short caller deadlines. Count queue wait, input preparation and startup against each call's deadline (2000 ms by default, integer 1–2147483647). Refuse a full queue and late reports. Retire workers after a posted job times out or a worker crashes/fails; await termination with at most 100 ms grace before settling the call. Queued expiry or expiry during encoding must leave unused workers alive. Keep retiring workers against the pool cap until termination succeeds or exit is observed, even when terminate rejects or hangs.closeValidationPool()closes the shared pool, andpool.close()refuses pending calls and awaits termination with bounded grace. Successful workers are reused; closed instances stay closed. Submission is module-internal, never a public uncappedrun(). Weakly cache encoded shapes by the original input object, comparing all term fields and rechecking limits on reuse so mutable inputs cannot retain a stale policy. Seed each request's blank-node map from the shape encoding; data must not mutate the cache. Check the deadline before each graph encoding. The combined footprint includes parsed terms, graph indexes and validation views, not just text; do not infer an 8x heap margin from transfer size. At size 8, old-generation limits alone total 4 GiB. - Shared quad-count, aggregate character and term caps in
validationLimits.tsrun before copying/converting or serializing on the caller as well as in the worker. Repeat the checks at dispatch to catch term mutations during queue wait/startup. Bound dataset iteration and structured intent lowering too. Raw duplicate quads count toward the input cap. Keep input adapters invalidationInputs.ts; workers receive N-Quads and must not import intent translation or the general fetch/serialization dependency graph during startup. N3 Parser/Writer handle the bounded validation transfer. - The build ships Node ESM, with
dist/validationWorker.jsbesidedist/index.js. Bundlers must separately copy/emit the worker asset and configure a pool'sworkerUrlor trustedworkerFactory. Factories receive the URL and resource limits and return fresh Node-compatible Workers speaking the shipped ready/request/report protocol. Missing worker_threads or worker assets must give actionable configuration diagnostics, fail closed and never silently fall back to in-process work. Keep Node builtins lazy. execution: "in-process"explicitly opts into weaker synchronous metering with no wall-clock guarantee; browser pages use it by default. Other non-Node runtimes require an explicit execution choice and otherwise fail closed. Preserve all input/operation protections there. There is no shipped browser Web Worker entry.validationTransfer.tsuses N3 Writer/Parser N-Quads, including literal language AND RDF 1.2 direction. Relabel ALL blank nodes to safeb<n>identifiers with a single map shared by data and shapes. Parse withblankNodePrefix: ""to preserve that cross-graph identity. Reports must name the caller's blank nodes, notb<n>: the worker lists blank-node term fields in an internalblankNodesmarker, and the client maps only those fields back through the job's own request map (never shared or cached), strips the marker, and retires the worker on a malformed marker or unknown label. N3fromTerm/fromQuaddrop direction and must not be used on the transfer path. Preserve named graphs, datatype IRIs and literal values. Namespace normalization must preserve direction too and remain confined to disposable validation views; hashing and serialization retain the original graph.scripts/build-dist.mjsbundles and sanitizes both entrypoints. Both package test scripts build first: native workers cannot execute Vitest transforms, so worker tests use fresh built output.test/validationPaths.tsalso runs the entire conformance, alias, namespace and hardening matrix directly against the sourcevalidateGraphsfunction. Do not replace these source core tests with dist imports. The slow-validator hook exists only in test fixtures; keep it out of the public API and production worker.
Validate changes with the existing conformance, alias and hardening tests plus
test/validation-timeout.test.ts, test/validation-pool.test.ts and
test/validation-round2.test.ts, test/validation-round3.test.ts and
test/validation-identity.test.ts. These suites simulate
an infinitely busy synchronous validator, check actual termination and parent responsiveness, and cover timeout options,
concurrency, queue admission/expiry, shutdown, resource limits, worker configuration,
direction preservation, messageerror, crash replacement, syntax injection, cache invalidation,
escape-heavy caller loop gaps and sampled heap at the quad caps. Follow the root gate requirements
and keep changes inside the authorized package scope.
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.