@glyphp/conformance
v1.0.3
Published
Conformance suite — validate any Glyph server against the protocol spec
Downloads
779
Maintainers
Readme
@glyphp/conformance
An executable conformance suite for the Glyph Protocol. Point it at any Glyph server and it reports whether the server matches the spec.
CLI
glyph-conformance http://localhost:3100Exit code 0 if every check passes, 1 otherwise.
Library
import { runConformance, formatReport } from '@glyphp/conformance'
const report = await runConformance('http://localhost:3100')
console.log(formatReport(report))
console.log(report.passed) // booleanPass an in-process handler instead of hitting the network — useful in tests:
import { GlyphServer } from '@glyphp/server'
const server = new GlyphServer()
const report = await runConformance('http://glyph', { fetch: server.fetch })What it checks
The suite is non-destructive — it exercises discovery and error handling only, and never calls a glyph (which would require knowing valid inputs):
/healthreports a protocol version- the handshake accepts the supported protocol version and returns a valid
HandshakeResponse - the handshake rejects a version mismatch with
426 /lexiconreturns validLexiconEntryobjects- a glyph card validates against the schema
- a glyph card's signature and content hash verify
- an unknown glyph returns
404 NOT_FOUNDin theGlyphErrorenvelope - the bundled
Sanitizationschema validates representative samples
Response shapes are validated against the JSON Schemas bundled from
spec/schemas/.
What it does not check
Because the suite never calls a glyph, it never sees a SealedEnvelope or an
inspection report produced by a live call. The schema.sanitization check
confirms only that the Sanitization wire schema is published and
self-consistent — it does not prove that a server actually sanitizes its
output. Verifying inert-data behavior end to end requires invoking a glyph
with known-hostile input, which is destructive and therefore out of scope
here; 04-inert-data demonstrates it instead.
