score() is the CCAC quality model for .gui — Clean, Consistent, Accessible, Comprehensible — local, deterministic, zero-AI, advisory and never a gate.

/score

qualityCCAC quality report

The CCAC quality model — a read-only, advisory quality report. The kit produces a number and takes no action; what you do with it is your policy.

It measures how good the file is, not how good the design is — like an HTML validator, not a design critic. All four levels (Clean, Consistent, Accessible, Comprehensible) are local, deterministic, and zero-AI. A low score is still a valid, packable file.

Signature

score(xml: string, ctx?: ScoreContext): ScoreOutput
scorePackage(bytes: Uint8Array, ctx?: ScoreContext): ScoreOutput
isGateFailure(out: ScoreOutput): out is GateFailure

Use cases

  • CI quality gate — your threshold, your decision to fail.
  • Warning badge in an app on known-bad output.
  • Batch triage — flag or auto-discard low-scoring generated files.

Score locally — no injection needed

import { score } from '@dotgui/kit/score'

const out = score(markup)
if (!('error' in out) && 'score' in out.clean) console.log(out.clean.score)

Consumer-defined policy (the kit never decides this)

import { scorePackage, isGateFailure } from '@dotgui/kit/score'

const out = scorePackage(bytes)
if (isGateFailure(out)) throw new Error('broken file')
// e.g. fail CI below a bar — your call, not the kit's
if (!('status' in out.accessible) && out.accessible.score < 70) process.exit(1)