Docs-sync as a backstage automation (on PR merge) - #29
Merged
Conversation
…merge Moves the docs-sync workflow off Mintlify's infra into backstage. When a PR merges into tella-fusion, the GitHub webhook now publishes a `github:pr_merged` internal event; a seeded code-mode "docs-sync" automation subscribes to it, spins up a worktree, reviews the merged PR's diff, updates the Mintlify docs in packages/core/webapp/docs, and opens a PR. - constants.ts: PR_MERGED_EVENT_KEY + DOCS_SYNC_AUTOMATION_NAME - prompts.ts: DOCS_SYNC_PROMPT (the docs-update spec, code-mode) - webhook.ts: fire the merge event, skipping bot-authored PRs so the docs-sync automation can never loop on its own merged PRs - index.ts: seed the docs-sync automation (enabled) on startup Reuses the existing automation + worktree machinery, mirroring the seeded review automation. Toggle it in the Automations UI. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
tella-butler
pushed a commit
that referenced
this pull request
Aug 12, 2026
A bare `#3` chipped as a PR reference in prose. The first fix required 4+ digits, which is right for tella-fusion (#5648) and wrong for every repo numbered under a thousand — opensession is at #92, tella-mac at #14. Measured over 120k transcript entries: 4+ digit `#numbers` are almost all PRs, while 1-3 digit ones are mostly stream and step indices (`stream #0`), CSS hex colours (`color: #333`), and rankings (`#29`). The legit short form carries its own evidence — `PR #92` is how the small-numbered repos are actually written. So a short number now links when something other than its digits says PR: a `PR`/`PRs` cue in front of it, a qualifier (`backstage#92`), or a PR the session list already knows for that repo. The cue is matched by the tokenizer (which cannot see behind its own match position) but re-emitted as prose, so the chip stays labelled `#92` rather than repeating the word next to the PR icon.
tella-butler
pushed a commit
that referenced
this pull request
Aug 12, 2026
The renderer can place `opensession#92` at any length, but a bare `#92` is a guess it declines to make for short numbers — `#3`, `#333` and `#29` are far more often a step, a hex colour or a ranking. Writing the repo id is the cheap half of that contract, so ask for it in the run instructions instead of leaning entirely on heuristics. Goes in the existing "Session UI rendering" section, so every run gets it.
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.
Moves the last Mintlify-hosted workflow off Mintlify's infra and into backstage, per Michiel. Instead of a GitHub Action (the earlier direction in tella-fusion #4376), docs-sync now runs as a code-mode backstage automation triggered when a PR merges into
tella-fusion.How it works
closed && mergedit fires agithub:pr_mergedinternal event with the PR number/title/branch/author.docs-syncautomation (code mode,eventKey: github:pr_merged) subscribes to that event. Each merge spins up a worktree offmain, and the agent runs the docs-update prompt: read the merged PR diff (gh pr diff), update the Mintlify docs underpackages/core/webapp/docs/, and open a PR — or do nothing if there's no user-facing change.This reuses the existing automation + worktree machinery (the same path cron/code automations use) and mirrors the seeded review automation, so it shows up in the Automations UI and can be toggled/edited there.
Changes
constants.tsPR_MERGED_EVENT_KEY+DOCS_SYNC_AUTOMATION_NAMEprompts.tsDOCS_SYNC_PROMPT— the docs-update spec (Johnny's prompt), adapted for a code-mode run that opens a PRwebhook.tsindex.tsdocs-syncautomation (enabled) on startupNotes / decisions
auto-docs-sync-*branches; the merge handler skips any PR whose author is the bot, so merging a docs-sync PR won't spawn another.claude-opus-4-8, matching the review automation..mintlify/workflows/docs-sync.md(dropping the GitHub Action approach).🤖 Generated with Claude Code