Skip to content

Add docs-quality-sweep workflow - #6255

Merged
theletterf merged 1 commit into
mainfrom
add-docs-quality-sweep-workflow
May 5, 2026
Merged

theletterf merged 1 commit into
mainfrom
add-docs-quality-sweep-workflow

Conversation

@theletterf

Copy link
Copy Markdown
Member

Summary

Installs the seven-sweep orchestrator from elastic/docs-actions@v1 (release 1.15.2). Triggered manually via workflow_dispatch. Runs all seven sweeps in parallel by default, or any subset via the sweeps input.

gh workflow run docs-quality-sweep.yml -f sweeps=all
gh workflow run docs-quality-sweep.yml -f sweeps=frontmatter,typos

Seven jobs run in parallel; each opens its own labeled fix-issue in this repo (or noop if the slice is clean):

Sweep Label Default behavior
frontmatter docs-fix:frontmatter Audits frontmatter completeness + description quality on a rotating slice
applies-to docs-fix:applies-to Validates applies_to correctness
openings docs-fix:openings Vague H1 / weak opening / missing prerequisites
style docs-fix:style Vale + Elastic style guide; includes tortured-sentence detection
typos docs-fix:typos codespell scan over the whole repo
staleness docs-fix:staleness Stale content / screenshots / broken external links / EOL versions
coherence docs-fix:coherence Duplicate / contradictory content vs. published docs

All issues also carry the parent label docs-quality-sweep. Each sweep auto-closes its prior fix-issue (close-older-issues: true).

Where the issues land

Issues from this install are filed in this repo (public). A companion install in elastic/docs-content-internal#1136 runs the same sweeps against this repo's content but files its findings privately.

You'd typically use one or the other, not both — running both means each scan generates two parallel issues per finding. Possible setups:

  • Public-only — keep this PR, drop the internal install. Easier for contributors to see + act on findings; nothing about the audit is hidden.
  • Internal-only — close this PR, keep the internal install. Triage stays in the docs-content team's private repo.
  • Both, scoped differently — public install runs only the safe-to-publish sweeps (typos, staleness); internal install runs the rest. Subset selectable via sweeps input on each side.

Worth deciding before merging.

Pre-flight (already done)

  • All eight labels created in this repo (docs-quality-sweep, docs-fix:frontmatter, docs-fix:applies-to, docs-fix:openings, docs-fix:style, docs-fix:typos, docs-fix:staleness, docs-fix:coherence).
  • COPILOT_GITHUB_TOKEN already configured for existing agentic workflows (docs-issue-scope, docs-triage, docs-ai-menu).

Known upstream blocker

The four sweeps that import skills from elastic/elastic-docs-skills (frontmatter, applies-to, openings, style) currently fail at the agent step's APM bundle unpack — see github/gh-aw#30252 (open, no fix yet). Affects gh-aw's own CI as well; we've added our repro in a comment there.

The three deterministic / MCP-only sweeps (typos, staleness, coherence) work today. So this PR is mergeable now and immediately useful for those three; the four APM ones will start working once #30252 is fixed upstream and a new gh-aw release lands.

Test plan

  • Merge this PR.
  • Dispatch with sweeps=typos first — full-repo codespell scan, fast feedback. Confirm a docs-fix:typos issue lands here (or noop if no findings).
  • Dispatch with sweeps=typos,staleness,coherence — confirms the three working sweeps in parallel.
  • Dispatch with sweeps=all after #30252 is fixed and a new gh-aw release advances v1. Confirm all seven sweeps land their fix-issues here.
  • Once stable, decide whether to add a schedule: trigger.

🤖 Generated with Claude Code

Installs the seven-sweep orchestrator from elastic/docs-actions@v1
(release 1.15.2). Triggered manually via workflow_dispatch — runs
all seven sweeps (frontmatter, applies-to, openings, style, typos,
staleness, coherence) in parallel, or any subset via the `sweeps`
input.

The default `source-repo` is empty, so the sweeps audit this repo
when run from here. Fix-issues are filed in this repo (calling
repo) via the auto-provided GITHUB_TOKEN. Only `COPILOT_GITHUB_TOKEN`
is needed (already configured here for the existing docs-issue-scope
/ docs-triage / docs-ai-menu installs).

Companion install in elastic/docs-content-internal already exists
(elastic/docs-content-internal#1136). That one runs the sweeps
against this repo and files findings privately. This install runs
the sweeps against this repo and files findings here, in public —
useful when the team wants the audit + fix-issue trail visible to
contributors.

Pre-flight before first run:
1. The eight `docs-quality-sweep` and `docs-fix:*` labels need to
   exist in this repo. Created in a separate step.
2. `COPILOT_GITHUB_TOKEN` already configured.

See agentic-workflows/docs-quality-sweep/README.md in
elastic/docs-actions for full input docs.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@theletterf
theletterf requested a review from a team as a code owner May 5, 2026 09:44
@theletterf
theletterf requested a review from reakaleek May 5, 2026 09:44
@github-actions

github-actions Bot commented May 5, 2026

Copy link
Copy Markdown
Contributor

Elastic Docs AI PR menu

Check the box to run an AI review for this pull request.

  • Review docs changes (docs-review). Status: not started.

Powered by GitHub Agentic Workflows and docs-actions. For more information, reach out to the docs team.

@theletterf
theletterf merged commit 5bda6fd into main May 5, 2026
11 checks passed
@theletterf
theletterf deleted the add-docs-quality-sweep-workflow branch May 5, 2026 09:45
theletterf added a commit that referenced this pull request May 5, 2026
…n` master (#6271)

## Summary

Refactors the docs-quality-sweep installation to work around
[github/gh-aw#30338](github/gh-aw#30338).

The current orchestrator (merged via #6255) uses `workflow_call` to fan
out to seven gh-aw reusable workflows in parallel. gh-aw v0.71.x derives
a single artifact prefix per orchestrator run from `github.workflow +
github.run_id`, both of which are identical for every reusable
workflow_call invocation in one run. Result: all seven sub-workflows
upload and download the **same** `<prefix>-activation.zip` and
`<prefix>-agent.zip`. Last activation wins the race; every agent loads
the same prompt. Three of the seven fix-issues from the first run came
back with frontmatter-audit findings regardless of which sweep was
supposed to run (#6266 / #6267 / #6268).

Until upstream lands a fix, this PR dispatches each sweep as its own
independent workflow run.

## New layout

| File | Role |
|---|---|
| `docs-quality-sweep.yml` (modified) | Master dispatcher. Triggers on
`workflow_dispatch`. One job that uses `gh workflow run` to fire each
selected sub-workflow. Exits in seconds. |
| `docs-frontmatter-sweep.yml` (new) | Calls
`elastic/docs-actions/.github/workflows/gh-aw-docs-frontmatter-sweep.lock.yml@v1`.
|
| `docs-applies-to-sweep.yml` (new) | Calls the applies-to reusable. |
| `docs-openings-sweep.yml` (new) | Calls the openings reusable. |
| `docs-style-sweep.yml` (new) | Calls the style reusable. |
| `docs-typos-sweep.yml` (new) | Calls the typos reusable. |
| `docs-staleness-sweep.yml` (new) | Calls the staleness reusable. |
| `docs-coherence-sweep.yml` (new) | Calls the coherence reusable. |

Each sub-workflow has its own \`github.workflow\` and its own
\`github.run_id\`, so the artifact prefix gh-aw computes is now distinct
per sweep — no collision.

## UX

`gh workflow run docs-quality-sweep.yml -f sweeps=all` still works as
the single dispatch point. The master prints \`→ dispatching
docs-<name>-sweep.yml\` for each selected sweep and exits in a few
seconds; the sub-runs appear separately in the Actions tab.

Selective dispatch still works via the \`sweeps\` input:

\`\`\`bash
gh workflow run docs-quality-sweep.yml -f sweeps=frontmatter,typos
\`\`\`

Sub-workflows can also be dispatched directly without going through the
master, e.g. for retrying just one sweep:

\`\`\`bash
gh workflow run docs-style-sweep.yml
\`\`\`

That wasn't possible with the previous \`workflow_call\` orchestrator.

## Why \`GITHUB_TOKEN\` is enough

\`workflow_dispatch\` and \`repository_dispatch\` are explicit
exceptions to the "GITHUB_TOKEN can't trigger workflows" rule (per the
GitHub Actions docs). The master uses the auto-provided token; no PAT or
App token needed. The master itself only needs \`actions: write\`; the
sub-workflows retain \`actions: read\` + \`issues: write\` for fix-issue
creation.

## Trade-offs vs. the old orchestrator

| | old (\`uses:\`) | new (\`gh workflow run\`) |
|---|---|---|
| Single dispatch point | ✓ | ✓ |
| Artifact-name isolation | ❌ collides (gh-aw#30338) | ✓ each sub-run
independent |
| Visible as one workflow run | ✓ | master + 7 separate sub-runs |
| Per-sweep retry without re-running everything | ❌ | ✓ |
| \`sweeps=…\` filter | ✓ | ✓ |
| Number of files in this repo | 1 | 8 |

The 8-file footprint is the only real regression and it's bounded —
they're trigger templates, not maintained logic.

## Test plan

- [ ] Merge this PR.
- [ ] Dispatch \`docs-quality-sweep.yml\` with \`sweeps=typos\`
(cheapest, no APM). Confirm the master run finishes in under a minute
and a separate \`Docs typos sweep\` run appears in the Actions tab.
- [ ] Confirm the new typos issue lands here (no longer capped at 20 —
should reflect ~all codespell findings once docs-actions PR #132 ships).
- [ ] Dispatch with \`sweeps=frontmatter,style\`. Confirm two separate
sub-runs appear, each with distinct artifact names
(\`<unique-prefix-A>-activation.zip\` for frontmatter,
\`<unique-prefix-B>-activation.zip\` for style — verify in the agent
step logs).
- [ ] Confirm the resulting two fix-issues have **distinct** content —
frontmatter findings in the frontmatter issue, style findings in the
style issue. This is the regression we're trying to fix.
- [ ] Once happy, dispatch with \`sweeps=all\` and confirm seven
sub-runs each produce a category-correct fix-issue.

## Related

- gh-aw issue:
[github/gh-aw#30338](github/gh-aw#30338)
- docs-actions PR adding the underlying sweep prompts:
[elastic/docs-actions#132](elastic/docs-actions#132)
(open) — improves the per-sweep output once the agent prompts are no
longer cross-contaminating.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant