LEDGERMACHINE

Audit rule reference

What each finding means—and what it does not.

Ledgermachine findings are prompts for a product decision, not automatic errors. This reference explains what each rule notices, why it can matter, and when keeping the difference is the correct answer.

Evidence first Every finding points back to source. Intent wins A deliberate exception can be accepted. No silent repair Ledgermachine never edits the project.

01 / Tokens

Declared decisions versus direct values

These rules compare the token inventory with the values the source actually uses.

LM-TOKEN-001

Value matches a declared token

Flagged when A direct visual value resolves to exactly the same value as a declared token.

Decide Use the token unless the direct value must remain independent from theme or system changes.

LM-TOKEN-002

Value is close to a declared token

Flagged when A direct color is difficult to distinguish from a declared color token under the project’s color-distance setting.

Decide Merge it into the token if the small difference carries no real semantic or accessibility role.

LM-TOKEN-003

Several token names share one value

Flagged when Independent tokens in the same context and category resolve to one value without aliasing each other.

Decide Keep separate semantic names when their roles may diverge; otherwise alias them to one canonical token.

02 / Color

Palette distinctions people can actually see

Color rules normalize syntax and compare visual distance, opacity, frequency, and token ownership.

LM-COLOR-001

Colors may look indistinguishable

Flagged when A rare color sits very close to a more established color in perceptual color space.

Decide Keep both only if the subtle distinction communicates a state, layer, brand role, or accessibility requirement.

LM-COLOR-002

Color appears in one place

Flagged when An undeclared static color appears once and is not visually close to a declared palette token.

Decide Name its specific role or fold it into the established palette. One-off artwork and data visualization colors are often valid exceptions.

LM-COLOR-003

Similar opacity levels share one color

Flagged when One base color uses multiple alpha levels within a narrow visual range.

Decide Consolidate levels that do the same job; preserve levels that express distinct states or depth.

LM-COLOR-004

One color is written in several formats

Flagged when Different CSS notations normalize to the same color.

Decide Standardize the notation when it improves search and maintenance. Keep authored formats when a tool or color space requires them.

03 / Typography

A type system, not a pile of numbers

Typography rules compare declared scales, repeated roles, font support, and equivalent text-style signatures.

LM-TYPE-001

Font size may not belong to the type scale

Flagged when A rare font size sits close to an established or declared step.

Decide Align it when the text serves an existing role; keep it when the content hierarchy genuinely needs another step.

LM-TYPE-002

Line height may not belong to the type scale

Flagged when A rare line height is close to a repeated or declared line-height value.

Decide Reuse the role’s line height unless content density, language, or typeface metrics justify the difference.

LM-TYPE-003

Font weight falls between common steps

Flagged when A weight is near a common 100-step value and may not be supported as authored.

Decide Verify the loaded font’s axes. Variable fonts may make an in-between weight entirely intentional.

LM-TYPE-004

Font stack appears in one small area

Flagged when A font family is used much less often than the project’s dominant stack.

Decide Keep purposeful code, data, editorial, or display faces; remove accidental local stacks.

LM-TYPE-005

The same text style is declared two ways

Flagged when Several selectors produce the same text-style signature, but some use tokens while others repeat values directly.

Decide Prefer one declaration path so later typography changes do not split the roles apart.

04 / Spacing

A rhythm with room for real exceptions

Spacing rules compare numeric distance, frequency, units, and arbitrary utility syntax.

LM-SPACE-001

Spacing is close to an established step

Flagged when A rare undeclared spacing value lands near a token or frequently repeated step.

Decide Snap it to the scale unless geometry, optical alignment, or an external asset requires the offset.

LM-SPACE-002

Spacing appears in one place

Flagged when A static undeclared spacing value appears in one layout declaration.

Decide Confirm it as a local adjustment or replace it with the scale. Screen-reader-only geometry is excluded.

LM-SPACE-003

The same spacing uses different units

Flagged when Values in different units normalize to the same pixel size.

Decide Keep relative units when they must scale with text or context; otherwise use one convention.

LM-SPACE-004

A utility uses a custom spacing value

Flagged when An arbitrary utility introduces spacing outside the named utility scale.

Decide Use the nearest named utility when the difference is incidental; retain exact values for real geometry constraints.

05 / Shape

Edges and controls that speak the same language

Shape rules compare radii, border widths, and control-specific conventions.

LM-SHAPE-001

Corner radius is close to an established value

Flagged when A rare radius is numerically close to a declared or repeated radius.

Decide Reuse the established shape unless the component’s role needs a visibly different silhouette.

LM-SHAPE-002

Border width is close to an established value

Flagged when A rare border width is near an established step.

Decide Consolidate accidental differences; preserve widths that indicate focus, selection, or hierarchy.

LM-SHAPE-003

A control uses a different corner radius

Flagged when A button, field, toggle, or similar control differs from the control radius used most often.

Decide Keep the distinction only when it communicates a different control family or state.

06 / Effects

Depth, precedence, and layer intent

Effects rules compare shadow purpose, stacking scales, and forced cascade precedence.

LM-EFFECT-001

Similar shadows serve the same purpose

Flagged when Two shadows have nearly identical geometry and color signatures.

Decide Reuse one recipe unless the difference creates a clearly distinct elevation or focus state.

LM-EFFECT-002

A layer value sits far from the others

Flagged when A rare z-index is separated from the project’s other observed levels by a large gap.

Decide Name the overlay role and align it with the stacking scale; third-party widgets may need an explicit exception.

LM-EFFECT-003

Styles rely on !important

Flagged when A declaration forces precedence with !important.

Decide Confirm whether layers, specificity, or source order can express the intent. Utility and accessibility overrides can be legitimate.

07 / Responsive

Thresholds that correspond to actual layout changes

Responsive rules look at media queries, container queries, named scales, and context-only values.

LM-BREAKPOINT-001

Two responsive thresholds are very close

Flagged when Two media-query widths sit close enough that they may describe the same transition.

Decide Merge them when the layout change is shared; keep both when distinct breakpoints prevent a real failure.

LM-BREAKPOINT-002

Responsive threshold appears once

Flagged when A project with several breakpoints uses one threshold in a single rule.

Decide Confirm the unique transition or align it with the named responsive scale.

LM-BREAKPOINT-003

A utility uses a custom responsive threshold

Flagged when An arbitrary responsive utility uses a width outside the named breakpoint set.

Decide Prefer a named threshold when related layout changes should stay synchronized.

LM-CONTAINER-001

Two container thresholds are very close

Flagged when Container-query widths are within a narrow range.

Decide Merge them if the component changes in the same way; keep them when separate internal layouts truly need both.

LM-CONTAINER-002

A value appears only in a container query

Flagged when An undeclared visual value is used exclusively inside container-query states.

Decide Promote it when it belongs to the wider system; keep it local when the component owns the decision.

08 / Cascade

Ownership across cascade layers

These rules surface results that may be correct in the browser but surprising in the source.

LM-LAYER-001

A property changes between cascade layers

Flagged when The same selector and property receive different values in more than one named layer.

Decide Confirm which layer owns the final value and remove declarations that no longer have a distinct purpose.

LM-LAYER-002

An unlayered style wins over a layered style

Flagged when An unlayered declaration competes with a matching declaration inside a cascade layer.

Decide Keep the override only when its higher precedence is explicit and intentional.

09 / Components

One owner for each shared role

Component rules use source structure and visual signatures; they do not execute imported components.

LM-COMPONENT-001

More than one component may own the same role

Flagged when Several definitions share a component name or a page-local implementation overlaps a shared component role.

Decide Reuse the shared owner when the behavior is the same; preserve separate domain components when their responsibilities differ.

LM-COMPONENT-002

A local component differs from the shared version

Flagged when A local component’s visual signature adds or removes values compared with the shared owner of that role.

Decide Bring it back to the shared component or record why this context needs a maintained variant.

10 / History

Change relative to an explicit baseline

History rules only appear when the ledger has enough prior evidence to make the comparison honestly.

LM-DRIFT-001

Value was added after the baseline

Flagged when A normalized visual value is present now but absent from the pinned baseline scan.

Decide Confirm the new vocabulary as intentional or return the source to an established value.

LM-DRIFT-002

A repaired issue has returned

Flagged when A finding previously verified as repaired appears again in a later scan.

Decide Restore the repair, or record that the product decision changed. Regression status is ledger evidence, not guesswork.

LM-DRIFT-003

Fewer declarations use tokens than before

Flagged when Static token coverage drops by at least five percentage points from the comparison scan.

Decide Inspect the new direct values and restore token use where the bypass was not deliberate.

The reference is not the verdict

Inspect the evidence in your own source.

A rule explains why something deserves attention. The project ledger is where you decide whether to repair, plan, accept, or ignore it.

Open Ledgermachine