Browse the documentation
Sync contract
Status: implemented
. The sync runs from this repository alone, reads public GitHub, and writes one commit per run that changes something.Cadence and triggers
| Trigger | When |
|---|---|
schedule |
every 30 minutes, at minutes 07 and 37 |
push to main |
when sources.json, scripts/, src/, or the sync workflow itself changes |
workflow_dispatch |
by hand, any time |
repository_dispatch |
an event named docs-sources |
No source repository carries any integration, webhook, or credential for this hub. A merged pull request on a source lands here on the next run, inside the schedule’s window. Dispatch shortens the wait when a run is needed sooner.
GitHub’s own schedule timer is best-effort: platform load can delay or skip a scheduled run, and the manifest names what actually landed, run by run. A skipped interval is a delay, never a silence: every run reads every source’s head, so the first run that does fire repairs the whole gap. When a run is needed on demand, the dispatch trigger is the certain path.
Selection
sources.json names every source. Per source it pins:
files: exact paths copied at the repository root, such asREADME.md.roots: directories walked recursively, such asdocs/.extensions: the only suffixes allowed through, such as.mdand.json.
The extension gate is the text rule. With no .png or any other binary suffix allowed, only text can ever land under sources/. Explicit entries in files must match an allowed extension too, so the gate cannot be walked around.
What a run does
- Ask GitHub for every source’s
mainhead. Any failure stops the run before a byte is written: a source that cannot be checked is not synced blind. - Plan. A source syncs when it has no entry or its head moved; otherwise it skips.
- Verify skips. A skip is honest only when the on-disk copy still matches the manifest: same file set, same SHA-256 digests, same sizes. Drift forces a fresh copy from the tarball.
- Copy each moved source: download its
maintarball, extract, select files, and replacesources/<name>/wholesale, so deletions upstream propagate. - Record the manifest entry: head, per-file digest and size, and the run’s ISO timestamp.
- Write
manifest.json, regeneratedocs/sources-index.md, and write.sync-summary.txt. CI commits exactly what changed; a run with nothing to do writes nothing at all.
Manifest shape
{
"version": 1,
"generatedAt": "2026-11-22T10:00:00.000Z",
"sources": {
"seed": {
"name": "seed",
"head": "head sha of main",
"syncedAt": "2026-11-22T10:00:00.000Z",
"files": [{ "path": "README.md", "sha256": "64-hex digest", "bytes": 3150 }]
}
}
}
generatedAt moves only on runs that changed something. A source’s syncedAt marks the last run that copied it, and does not march forward on runs that skipped it.
Honesty rules
sources/is verbatim. Nothing under it is edited by hand, ever. A fix travels to the owning repository and back through the next sync.docs/sources-index.mdis generated the same way, and hand edits to it are overwritten by design.- A source whose head cannot be read, or whose tarball fails, keeps its last synced state while the run reports failure. Partial syncs never publish silently.