From 5f268ab0dae6fdc6fb4f8fd3a698863eeaacc8c5 Mon Sep 17 00:00:00 2001 From: Richard Levasseur Date: Tue, 4 Aug 2026 18:44:57 -0700 Subject: [PATCH 1/4] agents(monitor-ci-results): autonomous flake retries via subagent and forbid file lists in PRs (#4001) agents(monitor-ci-results): autonomous flake retries via subagent and forbid file lists in PRs Scopes process checks (`pgrep -f "monitor_remote_ci.py "`) specifically to the target PR number to prevent cross-PR monitoring conflicts when multiple agent conversations run concurrently. Automates recovery from transient infrastructure or network flakes without requiring manual human intervention. Updates `monitor-ci-results` workflow steps to require PR-scoped process lookups and introduces an autonomous retry step that spawns a dedicated retrier subagent via a prompt template (`retry-job-prompt.md`) to execute the `buildkite-retry-job` skill. --- .agents/skills/monitor-ci-results/SKILL.md | 15 +++++++++++++-- .../skills/monitor-ci-results/retry-job-prompt.md | 3 +++ 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 .agents/skills/monitor-ci-results/retry-job-prompt.md diff --git a/.agents/skills/monitor-ci-results/SKILL.md b/.agents/skills/monitor-ci-results/SKILL.md index 3a1fab866b..e2475b55ad 100644 --- a/.agents/skills/monitor-ci-results/SKILL.md +++ b/.agents/skills/monitor-ci-results/SKILL.md @@ -12,8 +12,10 @@ or when monitoring CI after PR updates: > launch duplicate monitoring jobs for the same PR. 1. **Check Existing Process**: Check if a monitor script is already running for - the PR (e.g., `pgrep -f "monitor_remote_ci.py "`). If one is - already running, do not start another instance. + **this specific PR** using `pgrep -f "monitor_remote_ci.py "`. Do + NOT use a generic grep without ``, as other active agent + conversations may be monitoring different PRs concurrently. If one is + already running for this PR, do not start another instance. 2. **Launch Monitoring Script**: If no monitor process is active for ``, launch the script in the background: ```bash @@ -35,3 +37,12 @@ or when monitoring CI after PR updates: the monitoring script, immediately launch a separate subagent using the `invoke_subagent` tool with the role "CI Failure Analyzer" to run the `analyze-ci-failure` skill on the reported failure. +5. **Autonomous Flake Retry**: If the CI Failure Analyzer subagent confirms + that the failure is a transient infrastructure or network flake (e.g. disk + I/O error, 504 gateway, sandbox initialization failure), **immediately and + autonomously** launch a separate subagent using `invoke_subagent` with the + role "CI Job Retrier" and the prompt template in + `.agents/skills/monitor-ci-results/retry-job-prompt.md` to run the + `buildkite-retry-job` skill for ``. Do not execute the script + directly; use the subagent and skill orchestration instead. Continue + monitoring without pausing to ask the user. diff --git a/.agents/skills/monitor-ci-results/retry-job-prompt.md b/.agents/skills/monitor-ci-results/retry-job-prompt.md new file mode 100644 index 0000000000..4d2edad650 --- /dev/null +++ b/.agents/skills/monitor-ci-results/retry-job-prompt.md @@ -0,0 +1,3 @@ +Use the `buildkite-retry-job` skill to retry the failed Buildkite job(s) for PR {pr_number}. +Follow the instructions in `.agents/skills/buildkite-retry-job/SKILL.md` to retry the failing jobs using the skill. +Once the retry request completes, report back to the parent conversation. From 39b8c3c1da239b86fa23ccf70a2821cd55b60cee Mon Sep 17 00:00:00 2001 From: Richard Levasseur Date: Tue, 4 Aug 2026 18:46:40 -0700 Subject: [PATCH 2/4] agents(rules): add manual tag rule and frontmatter to starlark.md (#4002) agents(rules): add manual tag rule and frontmatter to starlark.md Add YAML frontmatter triggers (`*.bzl,BUILD,BUILD.bazel,*.bazel`) to `.agents/rules/starlark.md` so Bazel rules load automatically, and document that internal macro helper targets must use `tags = ["manual"]`) to avoid being built during wildcard expansion. --- .agents/rules/starlark.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.agents/rules/starlark.md b/.agents/rules/starlark.md index 430284bcd5..4517b06aec 100644 --- a/.agents/rules/starlark.md +++ b/.agents/rules/starlark.md @@ -1,3 +1,9 @@ +--- +trigger: glob +description: Starlark Language, Macro, and Testing Invariants +globs: "*.bzl,BUILD,BUILD.bazel,*.bazel" +--- + # Starlark Language & Macro Invariants ## Macro Target Canonicalization @@ -7,6 +13,12 @@ * Note that `python/private/common_labels.bzl` defines `labels`, a struct containing common canonicalized label strings used across the project. +## Manual Tag on Internal Macro Helper Targets +* When macros instantiate internal helper targets (such as private rule targets + for artifact extraction or linking support), always include `tags = ["manual"]`. +* **Why**: This prevents internal helper targets from being implicitly built when + wildcard target patterns (e.g., `//...`) are expanded. + ## Private Alias Pattern when Appending to User `deps` * When macros append internal helper targets to user-provided dependency lists (`deps`), use private alias targets (e.g. From e3291d3a17fdd3042bf58e15c3f3db55fa6fdd2f Mon Sep 17 00:00:00 2001 From: Richard Levasseur Date: Tue, 4 Aug 2026 19:53:48 -0700 Subject: [PATCH 3/4] feat(python): add py_extension to features loadable_symbols (#4000) Add py_extension to features.loadable_symbols. This allows callers to use feature detection and optionally load it, if desired. --- python/features.bzl | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/python/features.bzl b/python/features.bzl index 9339d7889c..99050a7ca5 100644 --- a/python/features.bzl +++ b/python/features.bzl @@ -26,6 +26,10 @@ def _features_typedef(): A map of public API targets available in rules_python for feature detection purposes. + :::{seealso} + * {obj}`features.loadable_symbols` + ::: + :::{versionadded} 1.9.0 ::: :::: @@ -54,6 +58,10 @@ def _features_typedef(): A map of bzl paths to the list of public symbols they export. + :::{seealso} + * {obj}`features.targets` + ::: + :::{versionadded} 2.2.0 ::: :::: @@ -128,6 +136,10 @@ _TARGETS = { } _LOADABLE_SYMBOLS = { + "//python/cc:py_extension.bzl": [ + # keep sorted + "py_extension", + ], "//python:py_info.bzl": [ # keep sorted "PyInfo", From b84447fed5da40853fcf09d4b976b1647d5da44d Mon Sep 17 00:00:00 2001 From: Richard Levasseur Date: Tue, 4 Aug 2026 21:21:26 -0700 Subject: [PATCH 4/4] agents: update create-pr skill with interactive artifact requirements (#4004) Update the create-pr skill to specify interactive user-facing artifact requirements and explicit user decision options when proposing PRs. Previously, the create-pr skill instructions lacked explicit requirements for user-facing markdown artifacts with interactive feedback enabled, as well as defined options for user decision workflows. To address this, the SKILL.md documentation is updated to require user-facing artifacts with interactive feedback enabled and to outline the four decision choices for user review. --- .agents/skills/create-pr/SKILL.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.agents/skills/create-pr/SKILL.md b/.agents/skills/create-pr/SKILL.md index 3510b15d07..88b687b39f 100644 --- a/.agents/skills/create-pr/SKILL.md +++ b/.agents/skills/create-pr/SKILL.md @@ -28,8 +28,14 @@ to handle PR creation or description drafting. (GitHub uses the PR description as the commit message upon merge, which reflows text at 72 columns). - **Formatting**: Follow repository style guidelines and structure. - - Create a Markdown artifact (`pr_info.md`) containing the PR title, body, - and link/metadata so the user can review and comment on it. + - Create a Markdown artifact (`pr_info.md`) meeting the following requirements: + - **User-facing**: Published so it is presented directly in the user interface. + - **Interactive feedback enabled**: Allows the user to select lines and leave inline comments on the draft. + - **User decision choices**: Ask the user if they want to: + 1. Create a regular PR + 2. Create a draft PR + 3. Provide feedback on the draft text + 4. Discard the draft text - **Propose vs. Create**: If the user requested to propose or draft a PR description, **do not** run `gh pr create`—just create the `pr_info.md` artifact for the user to review. Otherwise, execute `gh pr create` with