Repository navigation
fix(sync): sources sync on PUSH (a red build holds nothing) + prune only what the repo put there - #6122
Conversation
…import prunes only what it put there Policy sources-sync-on-push: the GitHub push webhook imports every sync source of that repository + branch AT the pushed commit (`after`), with each module judged alone by ModuleSyncDecision (unchanged => nothing, changed => synced, floor above the running platform => that module alone declined). A green workflow_run now only records BuildCompletion; it no longer imports (a green build of an older commit finishing after a newer push could move a Space backwards). GitSyncBranchReconcileService resolves each configured branch head every GitSync:BranchReconcileMinutes (default 10) and imports at that sha, so a lost delivery self-repairs. Measured on the control instance 2026-10-04/05: Plugins main was red from 14:39Z, no green build arrived, AI/_GitSync and Hosting/_GitSync froze 15 h; a manual update imported at once with 0 compile errors. Policy prune-requires-provenance: ComputePrunableNodes prunes a node only when it is in the prior import manifest, in every pruning mode. FullReplace used to prune every extra, and the same manual import pruned 16 runtime nodes (Hosting/Babysitter, Hosting/Queues/*). Unknown provenance is not prunable. Doc: Doc/Architecture/SourcesSyncOnPush; both policies registered in PolicyNotProse. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Test Results 18 files 18 suites 42m 17s ⏱️ Results for commit 4d3bf45. ♻️ This comment has been updated with latest results. |
Test Results (shard 0) 4 files 4 suites 3m 50s ⏱️ Results for commit 4d3bf45. |
Test Results (shard 2)1 862 tests 1 862 ✅ 5m 17s ⏱️ Results for commit 4d3bf45. |
Test Results (shard 1) 3 files 3 suites 6m 32s ⏱️ Results for commit 4d3bf45. |
Test Results (shard 3)1 629 tests 1 629 ✅ 6m 33s ⏱️ Results for commit 4d3bf45. |
Test Results (shard 5) 2 files 2 suites 8m 43s ⏱️ Results for commit 4d3bf45. |
Test Results (shard 4) 4 files 4 suites 11m 20s ⏱️ Results for commit 4d3bf45. |
test(ladder): rows F1–F4 — push imports, red build holds nothing, one incompatible module declined alone, runtime nodes survive (stacked on #6122)
What
Two policies. Both are registered in
PolicyNotProse, and the manual isDoc/Architecture/SourcesSyncOnPush.sources-sync-on-push. Apushto a sync source's configured branch imports every source of that repository and branch at the pushed commit (after), through the newUpdateToPushedCommitFromGitHub. Nothing waits for a CI verdict. Inside the import, each module is still judged byModuleSyncDecision.Decide:The other parts of the change:
workflow_runnow only recordsBuildCompletion, which the plugin catalog consumes. It no longer imports, because a green build of an older commit that finishes after a newer push would move the Space backwards.GitSyncBranchReconcileServiceruns everyGitSync:BranchReconcileMinutes(default 10). It callsGitHubWebhookProcessor.ReconcileBranches(), which does oneGetHeadShalookup per repository branch and then runs the same per-source selection at that sha. A lost webhook therefore repairs itself, and a source that is already on the head costs only the lookup.prune-requires-provenance.StaticRepoImporter.ComputePrunableNodesnow prunes a node only when that node is in the prior import manifest, in every pruning mode.FullReplaceused to prune every extra node. Nodes with unknown provenance are never pruned.Why (measured on memex.systemorph.com)
mainwas red from 2026-10-04 14:39Z.AI/_GitSyncandHosting/_GitSyncwere last attempted at 14:56Z, then nothing happened for 15 h. A manual update at 05:29Z imported immediately: 18 NodeTypes recompiled, 0 compile errors. The green-build trigger had re-introduced the whole-repository hold thatmodule-sync-per-manifest-hashremoved.Hosting/BabysitterandHosting/Queues/*.Overlap with open PRs
None of the five touches
GitHubWebhookProcessororComputePrunableNodes.ModuleSyncDecision,GitHubSyncServiceandModuleSyncPerManifestHash.md. This PR only addsGetBranchHeadnearAskBranchStateand changes one row of the lane table, so it should be a trivial textual merge.Local results (Release,
-warnaserror, one project per build)Builds: 0 warnings, 0 errors for each of GitSync, Graph.Test, Hosting.Test, Documentation.Test, Memex.Portal.Shared, Memex.Portal.Shared.Test, Messaging.Hub.Test and PluginTester.
Negative controls (actually run):
FullReplacerule fails 3 tests:ARuntimeNodeSurvivesAnImportTestand two inStaticRepoImporterSyncModeTest.BuildTriggeredSyncPinsTheBuiltCommitTest: the push-while-red test, and the test where a green build does not import but a push does.Not established
pushevents.-ci.0platform makes floors advisory, so the decline is pinned by a pure decision test on a pushed tree.Recycle after deploy
HostingandAINodeTypes pick up new sources through the import. No manual recycle is needed for this change.Pairs-with: none — no public type or member is removed; additions only (
UpdateToPushedCommitFromGitHub,GitHubSyncService.GetBranchHead,GitHubWebhookProcessor.ReconcileBranches).Implementers: none — no interface member added.
Mirror-sync: none — the two new keys
activity.gitsync.updateToPushedCommit.{title,fetching}are server-rendered activity lines; the React mirror sync (npm run sync:i18n -- --ref <merged core sha>) can ride the next routine sync.🤖 Generated with Claude Code