Skip to content

Docs self-healing workflow improvements: Add ultra-light Haiku triage before Router#3065

Merged
pwizla merged 1 commit intomainfrom
repo/self-healing-triage-step
Apr 16, 2026
Merged

Docs self-healing workflow improvements: Add ultra-light Haiku triage before Router#3065
pwizla merged 1 commit intomainfrom
repo/self-healing-triage-step

Conversation

@pwizla
Copy link
Copy Markdown
Collaborator

@pwizla pwizla commented Apr 16, 2026

Summary

  • New Triage step (Haiku, ~$0.01): reads only PR title + body, decides "might need docs?" yes/no
  • Eliminates obvious "no" cases (internal refactors, race condition fixes, etc.) before the Router loads its heavy context (router.md + sidebars.js + llms.txt + diffs)
  • When Triage says "no" to all PRs: Router is never invoked → $0.01 instead of $0.10

Pipeline (4 stages)

bash filter → Triage (Haiku ~$0.01) → Router (Haiku ~$0.05-0.10) → Drafter (Sonnet ~$0.50-0.70)
     $0          title+body only          + diff + sidebars           only if targets found

Each stage is a gate: if it eliminates everything, subsequent stages don't run.

Estimated cost comparison per nightly run

Scenario Before this PR After
All PRs are chores (bash filter) $0.00 $0.00
PRs pass bash but are internal fixes ~$0.10 (Router with Haiku) ~$0.01 (Triage)
PRs need Router analysis ~$0.10 ~$0.11 ($0.01 triage + $0.10 router with Haiku)
PRs need full drafting ~$0.60 ~$0.61

Test plan

  • workflow_dispatch with internal-only PRs → Triage says "no", Router NOT invoked
  • workflow_dispatch with a feature PR → Triage says "yes", Router runs
  • Verify /tmp/triage-results.json format
  • Check summary shows triage eliminations

🤖 Generated with Claude Code

New step reads only PR title + body (no diff, no sidebars, no agent
prompts) and decides if the PR might need docs. Obvious "no" cases
(internal refactors, race condition fixes, etc.) are eliminated
before the Router loads its heavier context.

Pipeline: bash filter → Triage (Haiku ~$0.01) → Router (Haiku ~$0.05)
→ Drafter (Sonnet, only if needed)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
documentation Ready Ready Preview, Comment Apr 16, 2026 8:41pm

Request Review

@github-actions github-actions Bot added internal PRs created by the Strapi core team pr: new content PRs for new product features or new documentation sections source: repo PRs/issues not targeting a specific documentation but rather affecting the whole repo labels Apr 16, 2026
@pwizla pwizla self-assigned this Apr 16, 2026
@pwizla pwizla added pr: chore and removed pr: new content PRs for new product features or new documentation sections labels Apr 16, 2026
@pwizla pwizla added this to the 6.22.0 milestone Apr 16, 2026
@pwizla pwizla marked this pull request as ready for review April 16, 2026 20:42
@pwizla pwizla requested a review from derrickmehaffy as a code owner April 16, 2026 20:42
@pwizla pwizla merged commit ea12f59 into main Apr 16, 2026
12 checks passed
@pwizla pwizla deleted the repo/self-healing-triage-step branch April 16, 2026 20:42
pwizla added a commit that referenced this pull request Apr 17, 2026
The Write tool is denied by permissionMode: default in
claude-code-action. Triage and Router must use Bash heredoc
to write their result files to /tmp/.

Fixes #3065

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
pwizla added a commit that referenced this pull request Apr 17, 2026
Haiku treated the previous prompt as a role description and waited
for instructions. Rewritten to say "Execute these steps NOW" with
no preamble. Also removed chatty framing.

Fix #3065

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
pwizla added a commit that referenced this pull request Apr 17, 2026
Previously fell back to passing all PRs to Router, wasting tokens.
Now stops cleanly and reports the failure in the summary.

Fixes #3065

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
pwizla added a commit that referenced this pull request Apr 17, 2026
…Sat only (#3066)

* Fix: instruct agents to write files via Bash, not Write tool

The Write tool is denied by permissionMode: default in
claude-code-action. Triage and Router must use Bash heredoc
to write their result files to /tmp/.

Fixes #3065

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Make triage prompt imperative so Haiku acts immediately

Haiku treated the previous prompt as a role description and waited
for instructions. Rewritten to say "Execute these steps NOW" with
no preamble. Also removed chatty framing.

Fix #3065

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Stop pipeline if Triage fails to produce results

Previously fell back to passing all PRs to Router, wasting tokens.
Now stops cleanly and reports the failure in the summary.

Fixes #3065

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Skip PRs with flag: documentation label in self-healing

PRs manually flagged for documentation by humans are skipped by
the automation — they're already identified and will be handled
via /autodoc. Shown in the summary as "Manually flagged for docs".

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Move label check before title filter in self-healing pipeline

PRs with flag: documentation are now separated first, so they
always appear in the summary even if their title would have been
filtered. Order: label check → title filter → idempotency → Claude.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Run self-healing Tue-Sat only (no weekend merges on strapi/strapi)

Saves 2 unnecessary runs per week. Tuesday morning covers Monday
merges, Saturday morning covers Friday merges.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
pwizla added a commit that referenced this pull request Apr 17, 2026
* Fix: instruct agents to write files via Bash, not Write tool

The Write tool is denied by permissionMode: default in
claude-code-action. Triage and Router must use Bash heredoc
to write their result files to /tmp/.

Fixes #3065

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Make triage prompt imperative so Haiku acts immediately

Haiku treated the previous prompt as a role description and waited
for instructions. Rewritten to say "Execute these steps NOW" with
no preamble. Also removed chatty framing.

Fix #3065

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Stop pipeline if Triage fails to produce results

Previously fell back to passing all PRs to Router, wasting tokens.
Now stops cleanly and reports the failure in the summary.

Fixes #3065

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Add ignore list for self-healing workflow

New .github/self-healing-ignore.json lets Pierre temporarily exclude
specific strapi/strapi PRs from automation. The workflow reads the
file and skips matching PR numbers before title filtering.

First entry: #25886 (strapi.ai namespace, decision pending).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Add clickable link to ignored PRs in summary

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Move ignore list to first position in pipeline

Order: ignore list → label check → title filter → idempotency → ...
Summary follows the same order.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
pwizla added a commit that referenced this pull request Apr 17, 2026
* Fix: instruct agents to write files via Bash, not Write tool

The Write tool is denied by permissionMode: default in
claude-code-action. Triage and Router must use Bash heredoc
to write their result files to /tmp/.

Fixes #3065

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Make triage prompt imperative so Haiku acts immediately

Haiku treated the previous prompt as a role description and waited
for instructions. Rewritten to say "Execute these steps NOW" with
no preamble. Also removed chatty framing.

Fix #3065

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Stop pipeline if Triage fails to produce results

Previously fell back to passing all PRs to Router, wasting tokens.
Now stops cleanly and reports the failure in the summary.

Fixes #3065

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Add Slack notification to #documentation-ops after each run

Posts a summary to Slack via incoming webhook with:
- Run result (no PRs / triage skip / router skip / PRs created)
- Links to created doc PRs
- Errors if any
- Link to the GitHub Actions run for details

Non-blocking: if webhook fails, run still succeeds.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Use :noted: for created PRs, add failure notification

- :noted: instead of 🎉 when doc PRs are created
- 🚨 message when any step fails
- Checks job.status for failure detection

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Use custom Slack emojis for notifications

:pepe_alarm: for failures, :frog_shrug: for router skip,
⚠️ for errors.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
pwizla added a commit that referenced this pull request Apr 17, 2026
…tails (#3073)

* Fix: instruct agents to write files via Bash, not Write tool

The Write tool is denied by permissionMode: default in
claude-code-action. Triage and Router must use Bash heredoc
to write their result files to /tmp/.

Fixes #3065

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Make triage prompt imperative so Haiku acts immediately

Haiku treated the previous prompt as a role description and waited
for instructions. Rewritten to say "Execute these steps NOW" with
no preamble. Also removed chatty framing.

Fix #3065

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Stop pipeline if Triage fails to produce results

Previously fell back to passing all PRs to Router, wasting tokens.
Now stops cleanly and reports the failure in the summary.

Fixes #3065

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Upgrade Slack notification to use Bot API with threaded details

Replace incoming webhook with chat.postMessage API for thread support.
Main message stays short (result + View run + see thread). Thread reply
contains the full breakdown: pre-filtering, triage, router, drafter.

Requires SLACK_BOT_TOKEN and SLACK_DOCUMENTATION_OPS_CHANNEL_ID secrets.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
pwizla added a commit that referenced this pull request Apr 17, 2026
…ep Summary for thread (#3074)

* Fix: instruct agents to write files via Bash, not Write tool

The Write tool is denied by permissionMode: default in
claude-code-action. Triage and Router must use Bash heredoc
to write their result files to /tmp/.

Fixes #3065

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Make triage prompt imperative so Haiku acts immediately

Haiku treated the previous prompt as a role description and waited
for instructions. Rewritten to say "Execute these steps NOW" with
no preamble. Also removed chatty framing.

Fix #3065

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Stop pipeline if Triage fails to produce results

Previously fell back to passing all PRs to Router, wasting tokens.
Now stops cleanly and reports the failure in the summary.

Fixes #3065

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Fix Slack newlines and use Step Summary for thread detail

Use printf to convert \n to real newlines in main message.
Thread reply now reads the GitHub Step Summary directly and
converts Markdown to Slack mrkdwn format.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@pwizla pwizla changed the title Add ultra-light Haiku triage before Router Docs self-healing workflow improvements: Add ultra-light Haiku triage before Router Apr 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal PRs created by the Strapi core team pr: chore source: repo PRs/issues not targeting a specific documentation but rather affecting the whole repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant