@afixt/foundation
v0.1.0
Published
Shared types, fingerprint algorithm, and configuration primitives for the AFixt accessibility-testing ecosystem.
Readme
@afixt/foundation
Shared types, fingerprint algorithm, and configuration primitives for the AFixt accessibility-testing ecosystem.
This package is the base layer every other AFixt library builds on. It runs
anywhere (Node, browser, edge) and has zero knowledge of the hosted Revenant
platform. Connected-mode integrations layer @revenant/sdk on top of this for
platform communication.
What's in here
fingerprint— a stable, version-stamped hash used to deduplicate findings across scans, contexts, and integrations. The fingerprint is what makes "is this finding the same one I saw yesterday?" answerable everywhere.types— shared JSDoc type definitions forAfixtFinding,AfixtScanResult, andSubScopeso every integration speaks the same shape.
Install
npm install @afixt/foundationUse
import { computeFingerprint, FINGERPRINT_VERSION } from '@afixt/foundation';
const fingerprint = computeFingerprint({
targetUrl: 'https://example.com/about',
ruleId: 'img-alt',
selector: 'img.hero',
elementSignature: 'img[src=hero.jpg]',
subScopeType: 'content',
});
console.log(fingerprint); // 64-char sha256 hex
console.log(FINGERPRINT_VERSION); // 1Stability
The fingerprint algorithm carries an explicit FINGERPRINT_VERSION. When the
algorithm changes, the version bumps. Consumers persist the version alongside
the hash so old fingerprints stay matchable and new ones don't silently
mis-attribute.
License
MIT. See LICENSE.
