Skip to content

hypatia baseline: type casing mismatch — structural_drift/git_state emit uppercase codes (SD022/GS007) that violate the baseline schema's type pattern #477

Description

@hyperpolymath

The mismatch

.machine_readable/hypatia-baseline.schema.json requires the finding type to match ^[a-z][a-z0-9_]*$ (lowercase snake_case). Most hypatia rules honour that (banned_language_file, secret_detected, unwrap_without_check, …), but two rule modules emit uppercase mnemonic codes:

  • structural_drift → "SD022"
  • git_state → "GS007"

So any baseline entry that must match one of those findings has to use the literal uppercase value — which then fails strict validation against the schema. It's an internal inconsistency between hypatia's output and the estate schema, not a defect in any consuming repo's baseline.

Where it surfaced

While making validate-hypatia-baseline actually work (standards #455 → #464 → #466) and greening hyperpolymath/neurophone's gate (neurophone#173), its .hypatia-baseline.json needed entries for real SD022/GS007 findings. Those entries carry the uppercase type verbatim so they match hypatia's actual output — at the cost of strict schema-validity. (Each such entry already carries an inline note flagging this.)

Current impact: low

The gate does not ajv-validate the baseline (scripts/apply-baseline.sh only requires a JSON array and matches on the literal type string), so nothing is broken today. This is a latent correctness/consistency gap, not an outage.

Proposed fix — at source (preferred), then interim

  1. Source fix (hypatia — not in the current session's repo scope): normalise structural_drift/git_state to emit lowercase snake_case type codes consistent with every other rule module (e.g. structural_drift_unresolved_path, git_state_extra_branches, or at minimum sd022/gs007). This is the "solution at source" — the schema is right; the output is the outlier.
  2. Interim (standards): if a source fix isn't imminent, either (a) relax the schema type pattern to ^[A-Za-z][A-Za-z0-9_]*$ and document the two uppercase exceptions, or (b) add an explicit enum/note in docs/HYPATIA-BASELINE-FORMAT.adoc acknowledging the current uppercase codes.

Filing here (standards is the schema owner + baseline consumer) because the hypatia repo is outside this session's scope. Recommend the hypatia-side normalisation; the interim schema relaxation is a one-line change if you want the entries to validate cleanly in the meantime.

Discovered during the neurophone hypatia-baseline greening, 2026-07-03.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions