Skip to content

Scope: single agent, quality gate + docs impact, no sizing - #341

Merged
theletterf merged 2 commits into
mainfrom
scope-quality-and-docs-impact
Sep 15, 2026
Merged

theletterf merged 2 commits into
mainfrom
scope-quality-and-docs-impact

Conversation

@theletterf

@theletterf theletterf commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Rewrites gh-aw-issue-scope around what the team actually wants from it: judge whether an issue is ready, work out which docs pages it touches and how to tackle them with the information available, and ask the questions that would sharpen the scope. Everything about time, effort, ownership, and benefit is gone.

What changed and why

The 2026-09-15 analysis of every production and sandbox run found the workflow's structure was doing less than its prompt claimed. Scope has run three times in production since August, all via the AI-menu checkbox. Across those runs and the Sep 10 Luna sandbox battery:

  • The elastic-docs MCP server was never called — under either engine, even after Move issue-scope to GPT-5.6 Luna via OpenRouter #337 fixed the tool names and the tools were delivered. The agent read repo files via GitHub instead. Step 4 now makes search_docs mandatory and first, before any get_file_contents, and a run with no search_docs call cannot be 🟢.
  • The APM-installed skills were never invoked, so the apm job ran on every execution for nothing. Import and job removed.
  • Sub-agent delegation depended on engine. Codex spawned the three sub-agents; Claude ran everything in the parent. The highest-quality production comment came from the run that ignored the delegation contract. Collapsed to one agent, matching the triage precedent.
  • No linked PR forced 🟠 by design, which downgrades the typical docs issue — most have no engineering PR. Linked code is now evidence, not a prerequisite: no PR caps target confidence at Medium and reports Not verifiable against code, but a well-formed issue can still be 🟢.
  • "Not assessable" is gone. It existed for "both sub-agents errored"; with one agent that is a workflow failure, and the run-failure status message covers it.

Removed

Sizer sub-agent, ## 📋 Cost & benefit, effort buckets (hours, weeks: *), ownership, audience/degree/benefit confidence, synergies, bill of materials, good-for-ai, the Impact column (a sizing proxy). add-labels.allowed is now ["human-needed"] only, max: 1, create-if-missing: false.

Kept

Engine block (Luna via OpenRouter on codex), threat detection on copilot sonnet with the blanked OPENAI_BASE_URL, the four snake_case elastic-docs tools, quality bar, network allowlist, concurrency, all workflow_call inputs. The 🔴 gate template is unchanged.

New comment shape (🟢)

Summary · Request accuracy · Recommended docs targets (Page / URL / Action / Confidence / Why) · How to tackle this · Scope boundary · Questions to go deeper. 🟠 is the same sections minus whatever could not be assessed, closing with Questions to resolve before rerunning /scope. Both are team-facing; the author is never mentioned.

Lock verification

Compiled with pinned gh-aw v0.88.7, zero warnings. Jobs: pre_activation activation agent detection safe_outputs conclusion — no apm. GH_AW_SAFE_OUTPUTS_CONFIG shows add_labels.allowed: ["human-needed"], create_if_missing: false, max: 1. Zero ## agent: blocks in the lock.

Testing

Draft until the sandbox battery passes: well-formed issue with no PR (expect 🟢 with questions, ≥1 search_docs in the rpc log), well-formed with a linked PR (🟢), vague (🔴 + human-needed only), borderline (🟠). Forcing the MCP at prompt level is wording, and wording is a weak lever on this class of model — if the battery shows zero search_docs calls, the fallback is dropping repos from the github toolsets so the MCP is the only path to page content. Results will be posted here.

Companion changes to follow: docs-ai-tools registry entry, and removal of the dead project-instructions-path line from the docs-content and docs-content-internal callers (the file it names has never existed).

🤖 Generated with Claude Code

Related to #399

Remove every sizing concern from issue-scope: the sizer sub-agent, the
Cost & benefit section, effort buckets, ownership, audience, bill of
materials, and good-for-ai. Scope now judges issue quality, searches the
Elastic docs corpus for affected pages, verifies the request against any
linked code, says how to tackle the work, and lists questions to go
deeper.

Structural changes from the 2026-09-15 analysis:
- One agent. The three sub-agents delegated under codex and not under
  Claude, and the best production comment came from the run that did
  the work itself.
- Docs MCP search is mandatory and first. It had never been called in
  any run under either engine.
- Drop the APM import and its job. The installed skills were never
  invoked.
- Linked code is evidence, not a prerequisite. No PR caps confidence at
  Medium instead of forcing a partial outcome.
- Labels: human-needed on the red quality gate only, create-if-missing
  false. Drop "Not assessable" — with one agent that is a run failure.

Compiled with gh-aw v0.88.7, zero warnings. README and example updated;
example drops the dead project-instructions-path.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@theletterf theletterf self-assigned this Sep 15, 2026
@theletterf theletterf added fix enhancement New feature or request and removed fix labels Sep 15, 2026
@theletterf
theletterf marked this pull request as ready for review September 15, 2026 12:49
@theletterf
theletterf requested a review from a team as a code owner September 15, 2026 12:49
@theletterf
theletterf requested a review from akira28 September 15, 2026 12:49
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@theletterf

Copy link
Copy Markdown
Contributor Author

Sandbox battery: 4/4

Caller test-scope.yml on this branch, four fresh issues, one per outcome path. Every run: six jobs and no apm, spawn_agent = 0, detection_result.json present with a clean verdict, exactly one add_comment, first line matches the template byte-for-byte, no @ mention of the author, no sizing vocabulary anywhere in the output.

Issue Case Outcome search_docs Order Labels requested AIC
#137 snapshot rename_pattern well-formed, no PR 🟢 2 (+1 related, +4 by URL) docs search idx 8 → first repo read idx 15 none 7.98
#138 PromQL POST well-formed, links elasticsearch#148974 🟢 3 (+3, +3) + search_commits/get_commit idx 8 → 17 none 9.93
#139 "Update the observability docs" vague 🔴 gate 0 — gate stopped before search, as designed — ["human-needed"] 3.45
#140 "enrollment token page needs work" borderline 🟠 3 (+2, +3) idx 8 → 16 none 6.83

Runs: 34970645431, 34970646183, 34970650321, 34970652907.

The docs MCP is now actually used. In all three non-red runs the first elastic-docs.search_docs call precedes the first github.get_file_contents — the prompt-level forcing held, so the toolset fallback described above is not needed. This is the first time the server has been called in any scope run, sandbox or production.

The no-PR rule change works as intended. #137 has no linked code and came out 🟢 with Medium-capped targets, where the previous contract forced 🟠. #138, with a linked PR, verified against the commit and correctly reported Partially accurate — the blanket wording is already gone from the published page, and only the Grafana cross-link remains. That is the same conclusion the Aug 24 sonnet run reached on docs-content#8057, at 10 AIC instead of 54.

Questions land where intended. #140's Questions to resolve before rerunning /scope are the quality-bar gaps folded in ("What exact wording, step, or concept … is confusing?", "What should a reader be able to do after the change?"). #138's Questions to go deeper are placement and versioning decisions a maintainer would actually need to make.

Cost: 3.45–9.93 AIC across the four, against the Sep 10 Luna baseline of 8 (gate) / 13 (partial). README updated with the measured range. Sandbox caller restored to @v1.

Marking ready for review. Companions: elastic/docs-ai-tools#12 (registry), elastic/docs-content#8300 and elastic/docs-content-internal#1799 (drop the dead project-instructions-path). Label deletions in the consumer repos come after this ships and v1 moves.

@theletterf
theletterf merged commit daa832d into main Sep 15, 2026
7 checks passed
@theletterf
theletterf deleted the scope-quality-and-docs-impact branch September 15, 2026 13:01

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes: the current prompt includes contradictory step-ordering constraints that force non-deterministic behavior.


What is this? | From workflow: PR Review

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

linked changes, to check whether that page needs updating.

### 1. Use the supplied context
Do not call `get_file_contents` or read any repository source file until you have recorded at

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[HIGH] Step ordering conflict makes the MCP-first rule self-contradictory

Step 1 and Step 2 require repository reads before Step 4 (for example reading .github/CODEOWNERS and the project-instructions file), but Step 4 says to perform docs MCP research "before any other research" and forbids repository file reads before the first search_docs result. In a compliant run, the agent has to violate one side of this contract, which can produce inconsistent behavior and incorrect outcome selection.

Suggested change
Do not call `get_file_contents` or read any repository source file until you have recorded at
Do not call `get_file_contents` for additional repository research until you have recorded at least one `search_docs` result set. Required context reads in Step 1 and Step 2 (for example `.github/CODEOWNERS` and the optional project-instructions file) are allowed before this gate.

prwhelan pushed a commit to prwhelan/docs-content that referenced this pull request Nov 16, 2026
…elastic#8300)

Small cleanup from the Scope workflow analysis: `docs-scope.yml` passes
`project-instructions-path: .github/scope-instructions.md`, but that
file has never existed in this repository. The reusable workflow
tolerates a missing file and continues, and its default is the same path
— so this line changes nothing and just reads like configuration that
isn't.

Removing it. If we ever want repo-specific scope instructions, adding
the file at the default path is all it takes; no caller change needed.

Pairs with elastic/docs-actions#341, which reworks Scope itself, but
does not depend on it.

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

Related to elastic/docs-actions#399

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant