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:
- 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.
- 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
Problem
npm run validate(scripts/validate.js --all) reports violations onmainthat 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.
docs/references/internet-identity-spec.mddfinity/internet-identity)docs/guides/backends/data-persistence.mdxmo:baseis banneddocs/guides/backends/data-persistence.mdxdocs/guides/digital-assets/chain-key-tokens.mdxStatus
mo:baserule.The
mo:baserule was invertedcheckForbiddenPatternsskips fenced code, so the old/mo:base/pattern could only match prose. An actualimport Buffer "mo:base/Buffer";lives inside a fence and was never flagged, while naming the legacy library in prose was. Both hits onmainwere the base-to-core migration table indata-persistence.mdx, which is legitimate and mirrors the mapping in AGENTS.md. #357 changes the pattern to the import pathmo:base/and checks it inside fences.The 7 remaining: fix in
dfinity/internet-identityThey are not ours to edit.
docs/references/internet-identity-spec.mdis generated byscripts/sync-ii-spec.mjsfrom.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 therelease-2026-08-21spec sync (#350), mostly in the newii-app-metadatasection.Two ways to land it:
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.scripts/postprocess-motoko.mjsalready 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.mdshould 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'sSYNCEDallowlist (which today lists onlydocs/languages/motoko, while the II spec output is not listed and so is checked like a hand-written page).Related
.sources/strategy and owns the AGENTS.md changes