Skip to content

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

Closed

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

Activity

  1. changed the title [-]infra: validate --all fails on main; decide what synced trees are exempt from[/-] [+]infra: clear outstanding validate --all violations at their source[/+] on Aug 26, 2026
  2. marc0olo commented on Aug 27, 2026

    @marc0olo
    ContributorAuthor

    Both halves are done, so closing. One nuance worth recording, because it changes when the last errors disappear.

    The 4 hand-written violations are fixed in #357: two em-dashes replaced, and the mo:base rule corrected to match the import path inside code fences rather than legitimate prose mentions in the base-to-core migration table.

    The 7 in the synced II spec are fixed at the source in dfinity/internet-identity#4284, merged 2026-08-26. Verified: docs/ii-spec.mdx on II main now has zero em-dashes.

    They will not clear on the next sync run, though. scripts/sync-ii-spec.mjs pins to the newest release-YYYY-MM-DD tag, and we are already on it:

    newest dated release tag: release-2026-08-21   (7 em-dashes)
    our pin:                  release-2026-08-21
    II main:                  0 em-dashes
    

    So there is nothing to sync today. The fix arrives when Internet Identity cuts its next dated release containing that commit, which .github/workflows/sync-ii-spec.yml picks up automatically on its weekly check. Until then npm run validate reports 7 errors on main, all in docs/references/internet-identity-spec.md, and none from hand-written content.

    Verify at any time with:

    npm run validate                       # expect 7, all in internet-identity-spec.md
    git ls-remote --tags https://github.com/dfinity/internet-identity.git \
      | sed 's|.*refs/tags/||' | grep -E '^release-[0-9]{4}-[0-9]{2}-[0-9]{2}$' | sort | tail -1

    The decision this issue set out to make, normalize at sync time or exempt via the allowlist, was answered by fixing it upstream instead: the published text and the canonical spec stay identical, and no exemption was added. If II ever reintroduces em-dashes there, the choice comes back, and postprocess-motoko.mjs already shows what normalizing looks like.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions