Skip to main content

Release Watchers — Process Overview

Reference doc for the automated doc-need detection built into this repo. Mirrors docs-om’s equivalent doc, adapted for this repo’s differences: one current version instead of per-directory versions, and three source repos instead of one.

Overview — the problem this solves

Before this existed, the gap between “code merged upstream” and “someone realizes a doc is needed” was entirely manual, and mostly only caught around release time. Two independent, symmetric workflows close that gap — one per release type, because they’re genuinely different problems with different cadences and risks.
Both watchers feed the same downstream: a human-triggered draft (/create-draft), then whatever review automation this repo has live.

Design principles

Same as docs-om’s:
  • Deterministic gates, never an AI judgment call for “should this run today” or “what version is current.”
  • Self-healing lookback, not a fixed day-count — both workflows ask “when did I last succeed?” via a Jobs-API walk checking whether a marker step (Ensure tracking labels exist, gated to non-dry, on-week-if-major runs only) actually ran to completion, not just whether the run reported success. This matters for both workflows, not just major: while FORCE_DRY_RUN is "true" (see “First live rollout” below), a scheduled run of either workflow still reports overall success while writing nothing, and a naive “most recent successful run” would silently advance the watermark past a window nothing was ever scanned-and-written for. A successful live workflow_dispatch from main with since seeds the baseline; later schedules recognize it. Live runs without a baseline or explicit since fail closed.
  • Current version comes from docs-om’s own published release notes, not a separately-maintained config file. Both repos track the same OpenMetadata release cycle, so there’s no need for this repo to keep its own copy of “what’s current” — it reads docs-om’s snippets/releases/latest.mdx directly (public repo, no token needed) and computes next-minor/next-major from it, deterministically, in bash.
  • Verify before notify — CONFIRMED / RULED OUT / NEEDS A LOOK / HELD, never a guess, backed by the real gh pr diff, not just PR metadata.
  • Dry-run is enforced structurally, not just by instruction — the notify job runs no model at all. .github/scripts/watcher-notify.sh only calls gh issue create/edit/comment when neither dry_run nor the FORCE_DRY_RUN safety switch (see “First live rollout” below) is active. In dry-run it writes what it would have created, updated, or commented to the run’s job summary instead.
  • Deterministic work stays out of the model. Listing PRs, dropping noise (tests, CI, lockfiles, assets, dependency bots), backport matching, the bug-fix exclusion, diff fetching and trimming, doc-coverage grepping, the Part B completeness check, and every issue write are plain bash/jq (watcher-prefetch.sh, watcher-assemble.sh, watcher-notify.sh). The model only judges prefiltered candidates and returns verdicts through --json-schema; URLs, counts, and tracking references are filled in from prefetch data, so the model cannot invent a PR or mis-count.
  • No guessing on ambiguity, ever — major-vs-minor classification, doc relevance, and feature completeness all have an explicit “I don’t know” outcome.
  • Write-capable steps are gated outside the model. create-draft.yml checks, in plain bash before Claude ever runs, that /create-draft was used as a standalone command (not incidental prose) and that the target issue was actually filed by this repo’s own watcher bot identity (github-actions[bot]) and carries a genuine watcher marker — an issue the watchers never filed can’t reach the agent that has push/PR-create credentials, no matter what a collaborator’s comment says or what a forged marker in an attacker-opened issue’s body claims.
  • Read-only and write-capable sessions run in separate jobs, not just separate steps. All three workflows split into a read-only job (where contributor-controlled upstream content actually gets read, by a model with local Write access) and a downstream write-capable job (issue create/edit/comment, or for create-draft.yml, git push + PR open). Because GitHub Actions gives every job its own fresh runner and workspace, the write-capable job never shares a filesystem with the read-only one: a planted file, a modified startup hook, anything a compromised read-only session could leave behind on disk simply isn’t there when the privileged job starts. The only thing that crosses the boundary is an explicit artifact (actions/upload-artifact / download-artifact), and it’s schema-validated twice: once by the read-only job before upload, once by the write-capable job after download, so a compromised read-only job can’t skip its own check by uploading something malformed. For the two watchers that artifact is summary.json, checked field-by-field against a fixed shape by .github/scripts/validate-watcher-summary.sh. For create-draft.yml — the one workflow where the read-only job also edits real files — the artifact is a git diff --binary patch, and every path it touches is checked against a fixed allowlist of doc-content directories (in the read-only job before packaging, and again in the write-capable job before git apply) before the patch is ever applied to the fresh checkout that gets pushed.
  • The cross-repo read wrapper validates arguments, not just the subcommand. .github/scripts/gh-source-read.sh restricts which gh subcommands the model can run under RELEASE_WATCHER_READ_TOKEN, but subcommand restriction alone isn’t enough — gh’s own --jq and --template flags can read process environment variables, so pr view ... --jq 'env.RELEASE_WATCHER_READ_TOKEN' would otherwise print the token itself even through an “allowed” subcommand (confirmed with a harmless --jq 'env.SENTINEL' probe). The wrapper now parses a fixed per-subcommand flag grammar — only --repo, --state, --base, --search, --limit, --json, each accepted at most once and only where the real prompts use it — and rejects everything else outright: unknown flags, --jq/--template, short-flag aliases, a duplicated --repo.

What’s different here vs. docs-om

  • One current version, not per-directory versions. Both current and next-minor/next-major versions are derived from docs-om’s published release notes (see Design principles above), not a per-directory config.
  • Three source repos, not one. SOURCE_REPOS (hardcoded directly in each workflow, since it changes rarely) lists open-metadata/OpenMetadata (public core), plus two private Collate repos: open-metadata/openmetadata-collate and open-metadata/ai-platform. Every scan step loops over all three.
  • The two private repos don’t maintain long-lived per-patch backport branches the way core does — they mostly develop on main, and Collate bundles a release from that state at release time. The Major Watcher’s classification logic (step A3, below) accounts for this explicitly: fewer backport matches for those two repos is expected, not a gap to fix.
  • One flat page tree, not per-version directories — create-draft.yml looks for the right page under connectors/, how-to-guides/, collate-ai/, ai-2-0/, deployment/, features/, etc., rather than picking a version directory first.

Token budget (lossless)

Measured on 2026-10-05 before this design: the minor scan alone took 79 turns and the notify session 30 more, because each tool turn resends the whole conversation and multi-MB gh outputs were paged in through the 30k-character tool limit. The current design cuts cost without dropping anything the model could need:
  • Every scanned PR reaches a model session. PRs the deterministic prefilter flags (noise titles and paths, dependency bots, and in major mode backport_found / bugfix_type) stay in the session’s index with the path of their full diff; the model can promote any of them.
  • Trimmed views, full files on disk. Each candidate’s view keeps one context line, lists schema/config/UI files first, drops imports, tests, lockfiles, and assets, and caps the diff (9 KB minor, 7 KB major). The complete body and untrimmed diff of every PR sit next to it, and the prompt requires reading them whenever a view is truncated or leaves out something the verdict depends on.
  • No session grows until it compacts. Candidates are split into chunks of about 160 KB of views; watcher-verify.sh runs one fresh claude -p session per chunk (Claude Code 2.1.285, pinned, with the same CLAUDE_CODE_OAUTH_TOKEN) and merges the verdicts.
  • Every candidate ends with a verdict. One a session skips becomes NEEDS A LOOK in the digest.
Local replays (Sonnet 5.5 high): minor window of 2026-10-01..05, 24 PRs and 21 candidates in one session, about $0.39. Major window of 2026-09-20..10-05, 666 PRs and 150 candidates in 9 sessions, about $0.48 per session measured on 2 of them, so roughly $4.3 per biweekly run. Cost scales with the number of candidates (about $0.015-0.025 each). Prompts and schemas live in .ai/release-watchers/: scan-system-prompt.md and verdicts.schema.json.

Workflow 1 — Minor Release Watcher

File: .github/workflows/minor-release-watcher.yml Schedule: 0 6 * * 1,4 — 06:00 UTC, every Monday and Thursday Scope: the current minor/patch line only (e.g. 2.0.1 → 2.0.2), across all three source repos. Never touches main.

Workflow 2 — Major Release Watcher

File: .github/workflows/major-release-watcher.yml Schedule: 0 6 * * 1 + ISO-week-parity gate — every other Monday Scope: main only, across all three source repos, targeting the next major version (computed from the current version, e.g. 2.0 → 2.1). Part A — scan for new major-bound doc needs. Same pipeline as the minor watcher, on main. In bash, a PR is flagged as minor-bound (and listed in the index as skipped) when its number is referenced from any MINOR_RELEASE_BRANCH PR (backport), or when its “Type of change” checks only Bug fix (or, without that section, its title is a conventional fix:), unless it carries a breaking signal. For the two Collate-only repos a missing backport is expected, so the verify step judges those on the change itself. Genuinely ambiguous cases become NEEDS A LOOK, never a guess. Part B — completeness check on already-tracked multi-PR features. Plain bash (watcher-prefetch.sh completeness): for each linked PR (noting its repo), find its tracking issue in that same repo, check the issue state and every PR referencing it, and post COMPLETE / INCOMPLETE / UNCLEAR back on the existing issue. Before the notify job can comment, a plain-bash step drops any check whose target isn’t an open issue filed by github-actions[bot] carrying more than one major-watcher marker, including the exact marker for every PR the check names.

Workflow 3 — Create Draft (on demand)

File: .github/workflows/create-draft.yml Trigger: comment /create-draft on any issue (OWNER/MEMBER/ COLLABORATOR only) Three jobs, each gated on the previous one:

First live rollout

Both watchers carry a workflow-level env: FORCE_DRY_RUN: "true". While set, this overrides dry_run regardless of trigger (schedule included), and the bash notify step skips every issue write — no model is involved in that decision. This makes the first pass after merging safe by construction: the schedule can fire for real before anyone tests it manually, and that run can only ever read and report. The intended sequence once merged:
  1. Run each workflow via workflow_dispatch from main.
  2. Open that run’s job summary in the Actions UI and sanity-check the dry-run preview against what’s actually open upstream — forced dry-run creates no digest issue to read instead (see “Design principles” above).
  3. Flip FORCE_DRY_RUN to "false" in its own separate, reviewable commit.
  4. Before the next schedule, run each workflow via workflow_dispatch from main with since set to a date before the oldest untracked change. Set force_run=true for the major watcher if it’s an off-week. Confirm each live run succeeds; these runs establish the baseline for later schedules. A live schedule before this catch-up fails without creating tracking issues rather than guessing a short window.

Schedule summary


Secrets and variables this depends on

No GitHub Projects board integration wired in.

Known limitations / what’s still open

  • No project-board integration.
  • Email notification not built.
  • The automatic TW-standards check is a separate, independent effort (PR #568) — not something this build created or depends on; the two can merge in either order.
  • First run of each workflow has no history to look back on — the first live dispatch needs an explicit since. A live run without it fails closed until a successful live baseline exists. Previews can use a fixed window (4 days minor, 15 major).
  • create-draft.yml’s real git-push/PR-open path has never executed successfully — issue_comment only fires from the default branch, so this can only be tested for real after merging.
  • The job-split / artifact-handoff / path-allowlist logic has only been tested locally, using a stub gh, a disposable local git repo, and hand-fed valid and malicious diffs/summaries, confirming the wrapper’s flag grammar, the schema validator, and the patch-path allowlist all reject what they should and accept what they should. None of it has executed inside a real GitHub Actions run yet (cross-job artifact upload/download, real runner isolation, real git apply against a live checkout); that’s still open, same caveat as the model step below.

Verified before this went anywhere near main

Everything below was checked on disposable branches (never a PR). Confirmed working, via real live-API calls:
  • The plain gh CLI commands both workflows depend on (label create, issue create/comment/edit/close) work against the live API on this repo specifically, not assumed from docs-om
  • RELEASE_WATCHER_READ_TOKEN genuinely has read access to both private source repos, the actual gh-source-read.sh wrapper script works end-to-end, and the token is genuinely incapable of writing
  • An earlier repo-variable lookback approach was confirmed broken (403, same root cause as docs-om) before being replaced with a gh run list / Jobs-API step-marker walk. The live-dispatch baseline and fail-closed behavior require separate verification before rollout.
  • The since override and the FORCE_DRY_RUN safety switch (gating logic, tool-list construction, and DRY_RUN resolution all confirmed on a disposable branch)
  • The version-derivation step: confirmed the cross-repo fetch of docs-om’s latest.mdx and the computed next-minor/next-major/branch values all match real, live data
  • The author-check fix on create-draft.yml: confirmed all three branches (bot-authored + real marker accepted; human-authored + forged marker rejected; bot-authored + no marker rejected)
  • The full three-repo scan manually walked against real live data on both the minor branch and main — confirming ai-platform’s near-idle 2.0 branch but active main, and a genuine candidate in openmetadata-collate that correctly required a real judgment call rather than an obvious rule-in/rule-out
NOT yet verified — and can’t be, before this merges: schedule, workflow_dispatch, and issue_comment only fire from a repo’s default branch. The actual model verify step (the part that reads real PRs and would create/update issues) has never executed successfully in a real run yet — only the surrounding bash/gh logic above has been proven live. See “First live rollout” above for how this is being handled safely.