Skip to content

infra: clear outstanding validate --all violations at their source #356

Description

@marc0olo

Problem

npm run validate (scripts/validate.js --all) reports violations on main that no PR ever surfaces, because CI validates only the files changed in a PR. That CI scope is deliberate: it exists so known pre-existing violations do not block unrelated PRs. The fix is therefore to clear the violations at their source, not to change the CI scope.

State at the time of filing: 11 errors.

Count File Error Where the fix belongs
7 docs/references/internet-identity-spec.md em-dash in prose Upstream (dfinity/internet-identity)
2 docs/guides/backends/data-persistence.mdx mo:base is banned Validator (false positive)
1 docs/guides/backends/data-persistence.mdx em-dash in prose Internal
1 docs/guides/digital-assets/chain-key-tokens.mdx em-dash in prose Internal

Status

The mo:base rule was inverted

checkForbiddenPatterns skips fenced code, so the old /mo:base/ pattern could only match prose. An actual import Buffer "mo:base/Buffer"; lives inside a fence and was never flagged, while naming the legacy library in prose was. Both hits on main were the base-to-core migration table in data-persistence.mdx, which is legitimate and mirrors the mapping in AGENTS.md. #357 changes the pattern to the import path mo:base/ and checks it inside fences.

The 7 remaining: fix in dfinity/internet-identity

They are not ours to edit. docs/references/internet-identity-spec.md is generated by scripts/sync-ii-spec.mjs from .sources/internetidentity/docs/ii-spec.mdx, which contains exactly the same 7 em-dashes. Editing the output is pointless: the next sync restores them. They arrived with the release-2026-08-21 spec sync (#350), mostly in the new ii-app-metadata section.

Two ways to land it:

  1. Propose the change upstream in dfinity/internet-identity, so both repos converge and nothing has to be rewritten on sync. Preferred, but it asks another team to adopt a style rule that is ours.
  2. Normalize during the sync, the way scripts/postprocess-motoko.mjs already replaces em-dashes for Motoko. Entirely in our control and needs no coordination, but the published spec text then differs in punctuation from the canonical spec, which is a heavier thing to do to a specification than to a guide.

These are not exclusive; Motoko does normalization and upstream carries most of the style contract. Suggested order: propose upstream first, and add sync normalization only if it is declined or takes too long.

Instructions to update alongside

AGENTS.md should state the policy once it is decided: which synced targets are normalized at sync time, and that a new synced target has to be registered in the validator's SYNCED allowlist (which today lists only docs/languages/motoko, while the II spec output is not listed and so is checked like a hand-written page).

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions