Skip to content

infra: reduce .sources/ submodules to what the site actually needs, watch releases for the rest #355

Description

@marc0olo

Context

.sources/ currently holds 16 git submodules, 10 of them release-pinned. During the migration this was the right call: one person, no approvals, and everything an agent needed to verify a claim was on disk. In maintenance mode the cost profile has inverted. Every pinned repo is a recurring bump PR that needs review, and most of those repos contribute nothing to the built site.

This issue proposes a three-tier model and records what has to change in AGENTS.md as a result.

What actually depends on each submodule

Submodule Role Verdict
motoko Synced pages under docs/languages/motoko/ and 52 build-time <motokoExamples> file includes Keep
internetidentity scripts/sync-ii-spec.mjs writes references/internet-identity-spec.md and verifiable-credentials-spec.md Keep
examples Build-time snippet= extraction (plugins/remark-snippet.mjs). One page today, more planned Keep
icskills 16 of the 17 symlinks in .agents/skills/ point here Keep
dotskills .agents/skills/technical-documentation points here Keep
icp-cli Agent verification of CLI flags Convert
icp-cli-recipes Agent verification of recipe config Convert
icp-cli-templates Agent verification of template layout Convert
icp-js-sdk-docs Agent verification of JS SDK APIs Convert
motoko-core Agent verification of mo:core APIs Convert
cdk-rs Agent verification of ic-cdk APIs Convert
candid Agent verification of the Candid spec Convert
response-verification Agent verification of certification crates Convert
chain-fusion-signer Agent verification Convert
papi Agent verification Convert
ic-pub-key Agent verification Convert

So 5 stay, 11 convert. Note that icskills and dotskills are load-bearing rather than reference material: .agents/skills/ is a directory of symlinks into them, and AGENTS.md requires loading those skills before content work. (If we would rather install skills from skills.internetcomputer.org than vendor them, that is a separate discussion and would drop the count to 3.)

Also worth noting: .sources/examples is 265 MB and is a build dependency of exactly one page right now (guides/backends/https-outcalls.mdx, 6 snippets from 2 examples). Keeping it is a bet that <CodeExample> gets used more widely, which is the plan.

Proposed model

Tier 1: vendored content (submodule). motoko, internetidentity, examples, icskills, dotskills. Their bytes reach the built site or the agent workflow, so they stay on disk and keep their bump procedure.

Tier 2: vendored verification files (fetch, not submodule). For several repos, "verify against upstream" means reading one or two specific files. icp-cli is the clearest case: the rule is "verify every flag against .sources/icp-cli/docs/reference/cli.md", which is a single file out of a 5 MB repo. A sync job can fetch just those files at a pinned release into a small cache directory and record the version. This preserves the offline-verifiable property that the no-guessing rule depends on, at a fraction of the maintenance cost.

Tier 3: release watch only. Everything else. No vendoring: a pin file plus a weekly workflow that diffs upstream through the GitHub API and opens an issue when a new release lands, following the pattern already running in dfinity/icskills (.github/workflows/sync-upstream.yml plus scripts/sync-upstream-check.sh, which writes the diff into the issue body). We already run a narrower version of this here in sync-motoko.yml and sync-ii-spec.yml.

The trigger should be releases that require a content or version bump on the docs site, not every upstream commit. icp-cli-recipes is the motivating example: it is pinned to a June commit that predates the @dfinity/static-site recipe entirely, while upstream has shipped static-site-v0.3.3 and asset-canister-v2.3.0 since. A release watch would have caught that; a submodule that nobody bumps did not.

Required AGENTS.md changes

  1. Source material table (line ~215): split into the three tiers, with the fetch command for tier 2 and the watch-issue workflow for tier 3.
  2. "Always read from .sources/" rule: reword so it still forbids guessing and training-data recall, but points at the tier-2 cache for the repos that no longer have a submodule.
  3. CLI docs slug rule (line ~174): currently says the slug is 1.1, derived from "the major.minor of the pinned icp-cli release". With icp-cli moving to tier 2 or 3 there is no pinned release to derive it from, so the rule should key off the live docs-site root instead. The links themselves are already being moved to 1.3 in docs: bump icp-cli docs links to the 1.3 version slug #354.
  4. .agents/submodule-bumping.md: reduce to the five tier-1 repos and add the tier-2 refresh and tier-3 watch procedures.
  5. Drop the stale reference to docs/guides/tools/migrating-from-dfx.md, which no longer exists in docs/.

Open questions

  1. Tier 2 storage: a committed cache directory (reviewable diffs, slight repo growth) or fetch-on-demand by the agent (no repo growth, needs network and gives no diff to review)? I lean committed, because a diff in a bump PR is how a reviewer notices that a flag changed.
  2. Do we want the skills vendored at all, or installed from skills.internetcomputer.org?
  3. .sources/icp-cli is still pinned to v1.1.0 while v1.3.0 is out. Bumping it needs the CLI-verification pass in .agents/submodule-bumping.md. Do that once more before converting it to tier 2/3, or convert first and do the verification pass against the fetched file?

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