Repository navigation
feat(dispatcher): re-sync a consumer's copied contract when its producer merges - #135
Merged
Merged
Conversation
…cer merges A consumer's copy of a SahajCloud file — the generated Payload types in WeMeditateWeb and SahajAtlasWeb, the atlas URL contract in the WordPress plugin — has one correct content, and nothing brought it up to date but a Thursday survey ticket that then waited for a human verb and a session. Two jobs join dispatcher.yml. On a merged PR, `contracts-plan` lists its files and names each consumer whose `contractSync.sources` it touched. For each, `contracts-sync` checks out the consumer's main, runs the consumer's own sync command, and opens one bot draft PR on `contractSync.branch` — or adds a commit to the open one, so a fix-ci commit there survives. Nothing runs for any other event, so there is no cost between merges. The loop then carries the PR like any other: CI, fix-ci if the new shape breaks the consumer, then your approval and auto-merge. A PR that changes no more files than the copy has skips the critic, with a comment saying why. Once fix-ci touches consumer code the count grows and the critic runs. Every value comes from `contractSync` in loop-config.json, which the skill-side PR adds. Until it merges this job finds no producer and does nothing. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A consumer's copy of a SahajCloud file now re-syncs itself: the moment a SahajCloud PR that touches it merges, the dispatcher opens one bot PR per affected consumer. No ticket, no verb, no session in the common case.
Merge after #132. It adds the
contractSyncvalues this job reads. Until then the job finds no producer and does nothing, so the order is safe either way.The failure it prevents
WeMeditateWeb and SahajAtlasWeb commit SahajCloud's generated
payload-types.ts, and the WordPress plugin commits the atlas URL contract. Each copy has exactly one correct content, and nothing brought it up to date except Thursday's survey filing aTask, which then waited for a proposal review, a humanimplementverb and a session to run one command. Meanwhile the consumer's types were quietly wrong — no build error, just a stale shape — for up to a week.What it does
contracts-planruns on a merged PR. It lists the PR's files, a rename's old name included, and names each consumer whosecontractSync.sourcesit touched. It runs only for a merge into the producer's default branch.contracts-syncruns once per named consumer. It checks out the consumer'smain, runs the consumer's own sync command (pnpm run types:cms, or thecurlfor the URL contract), and:contractSync.branchwhen the copy changed;fix-cicommit there survives;fix-ciif the new shape breaks the consumer, then your approval and auto-merge.fix-citouches consumer code the file count grows, and the critic runs as usual.Nothing runs for any other event, so there is no cost between merges. Every value, including the commands, comes from
loop-config.jsononmain; the job never checks out a PR head.Gate
node --test dispatcher/test/*.test.mjs→ 88 pass, including 8 new cases incontracts.test.mjs.actionlintondispatcher.yml→ clean.gh, for all three paths: drift with no PR (branch force-pushed, draft PR created), already current (exit, nothing written), and drift with an open PR (commit on top, pushed).Notes for reviewer
claude/*branch and opens one PR in a consumer, withSYDEVS_BOT_PAT, from commands named inloop-config.json. Please check that you are happy with that reach.payload-types.ts.BOT_DISPATCH=dryskips the sync job, and the plan job's log names the consumers it would have synced.🤖 Generated with Claude Code