Skip to content

infra: add sync:ii-spec script and port 16 upstream spec commits#249

Open
marc0olo wants to merge 6 commits into
mainfrom
infra/sync-ii-spec
Open

infra: add sync:ii-spec script and port 16 upstream spec commits#249
marc0olo wants to merge 6 commits into
mainfrom
infra/sync-ii-spec

Conversation

@marc0olo
Copy link
Copy Markdown
Member

@marc0olo marc0olo commented May 12, 2026

Summary

  • Adds scripts/sync-ii-spec.mjs — a deterministic sync script (same pattern as sync-motoko.sh) that transforms docs/ii-spec.mdx from dfinity/internet-identity into docs/references/internet-identity-spec.md
  • Transformations: strip MDX imports, remove H1, rewrite 8 absolute internetcomputer.org link patterns to relative paths, inline the Candid .did file in place of <CodeBlock>, inject frontmatter, append link-adaptation log comment
  • Bumps .sources/internetidentity from af980848 to 74ad617 (579 total upstream commits; 7 touched docs/ii-spec.mdx, 49 touched internet_identity.did)
  • Adds "sync:ii-spec": "./scripts/sync-ii-spec.mjs" to package.json
  • Adds .github/workflows/sync-ii-spec.ymlworkflow_dispatch workflow that fetches latest internet-identity main, filters for changes to the two spec files only, and opens a PR if relevant changes exist
  • Updates AGENTS.md: internetidentity bump row now points to npm run sync:ii-spec and the new workflow
  • Fixes scripts/validate.js: checkForbiddenPatterns now skips code blocks (same as checkEmdash), preventing false positives on URLs inside Candid code comments

Sync recommendation

sync from dfinity/internet-identity — docs/ii-spec.mdx, src/internet_identity/internet_identity.did

Adds scripts/sync-ii-spec.mjs — a deterministic 1:1 sync script that
transforms docs/ii-spec.mdx from dfinity/internet-identity into
docs/references/internet-identity-spec.md. Applies the same pattern as
sync-motoko: strip MDX imports, remove H1, inline the Candid .did file,
rewrite 8 absolute link patterns to relative paths, inject frontmatter.

Bumps .sources/internetidentity to af980848..74ad617 (16 commits) and
regenerates internet-identity-spec.md from the new pin.

Updates AGENTS.md: internetidentity row now says to run npm run sync:ii-spec
instead of manually applying patches; link-adaptation note updated to match.
@marc0olo marc0olo requested a review from a team as a code owner May 12, 2026 16:21
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 12, 2026

🤖 Here's your preview: https://uc7il-jaaaa-aaaam-ai2gq-cai.icp0.io

marc0olo added 5 commits May 12, 2026 18:26
…cope

Three corrections to the sync script:
- Add m flag to H1 regex so it matches after leading blank lines from import stripping
- Move Candid inlining after link rewriting so .did code comments are not rewritten
- Exclude code blocks from the remaining-links check (prose only)
- Restore sidebar order: 14 to match previous value
FETCH_HEAD is a file that could theoretically be overwritten between
steps if another fetch runs. Using the hash saved to step outputs is
safer and more explicit.
checkEmdash already tracks inFence state to skip code blocks.
checkForbiddenPatterns was missing the same logic, causing false
positives on URLs inside Candid/code block comments.
…nline

Consistent with ic.did / http-gateway.did: copy internet_identity.did to
public/references/internet-identity.did and replace the <CodeBlock> inline
with a prose download link. Reduces internet-identity-spec.md from 2075
to 736 lines. Workflow updated to stage the .did file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant