Skip to content

[scanner] Attention pilot: Hive-maintained Actions workflows update or skip when the runtime covers the condition #16363

Closed

Description

@hivecommons-hive

Scope

Hive-maintained GitHub Actions workflows that post comments duplicating runtime narration (e.g. the Actions refs reminder and author-mentioning follow-ups seen on #15966 and #15862) are changed to update/skip when the runtime already covers the condition. Document external bots (Prow) as outside Hive's control in src/docs/notifications.md.

Acceptance

  • Each affected workflow either edits its existing comment or skips when a hive:status card already carries the condition.
  • Docs list the migrated workflows and the Prow exclusion.

Note: the hive App token cannot push .github/workflows/* changes; the agent prepares the branch and a human (or a maintainer-pushed PR) lands the workflow files. Non-workflow parts (docs) can ship separately.

Part of #16270. Blocked by the flag/card child.

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

Activity

  1. added
    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
    on Nov 3, 2026
  2. hivecommons-hive commented on Nov 3, 2026

    @hivecommons-hive
    ContributorAuthor

    🔒 Claimed by agent scanner (agent on hive hosted-available-oke-11-placeholder-r05x). The claim lasts 2h0m0s without activity and renews while the work continues. Reply /unclaim to release, or /claim to take it over if you outrank the holder.

  3. hivecommons-hive commented on Nov 3, 2026

    @hivecommons-hive
    ContributorAuthor

    The hive App token cannot push .github/workflows/*, so a maintainer must apply this diff (git apply) on top of the companion PR, which adds .github/scripts/hive-status-card.sh that the workflow calls. Workflow touched: .github/workflows/issue-closed-reopen-hint.yml (skips when the hive:status card has issue-close, otherwise edits its own marker comment in place). The refs sweep needs no workflow edit: its logic lives in src/scripts/comment-merged-refs.sh, changed in the PR.

    diff --git a/.github/workflows/issue-closed-reopen-hint.yml b/.github/workflows/issue-closed-reopen-hint.yml
    index d0eea0c7c..38e8dbd73 100644
    --- a/.github/workflows/issue-closed-reopen-hint.yml
    +++ b/.github/workflows/issue-closed-reopen-hint.yml
    @@ -28,6 +28,9 @@ jobs:
         timeout-minutes: 5
         if: github.event.issue.user.login != github.event.sender.login
         steps:
    +      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
    +        with:
    +          sparse-checkout: .github/scripts
           - name: Comment
             env:
               GH_TOKEN: ${{ github.token }}
    @@ -38,10 +41,18 @@ jobs:
               REASON: ${{ github.event.issue.state_reason }}
             run: |
               set -euo pipefail
    +          # The runtime's close narration already says "Reply /reopen"; when
    +          # the hive:status card carries it, this comment would duplicate it.
    +          if .github/scripts/hive-status-card.sh has "${REPO}" "${ISSUE}" issue-close; then
    +            echo "hive:status card already carries the close narration; skipping."
    +            exit 0
    +          fi
               # Written to a file rather than inlined: a multi-line --body inside a
               # YAML block scalar picks up the block's indentation and renders as a
               # code block on GitHub.
    +          body_file="$(mktemp)"
               {
    +            printf '<!-- issue-closed-reopen-hint -->\n'
                 printf '@%s this issue was closed by @%s' "${REPORTER}" "${CLOSER}"
                 case "${REASON}" in
                   not_planned) printf ' as not planned' ;;
    @@ -51,5 +62,6 @@ jobs:
                 printf 'If this was closed by a merged PR, the fix only takes effect once it ships in a tagged release and your deployment updates to it — check your running version against the fix before concluding the fix failed.\n\n'
                 printf 'If you are still seeing the problem, comment `/reopen` and it will be reopened for you — you do not need write access. '
                 printf 'Please add what you are still observing (running version, logs, steps) so it is not closed the same way again.\n'
    -          } > /tmp/closed-hint.md
    -          gh issue comment "${ISSUE}" --repo "${REPO}" --body-file /tmp/closed-hint.md
    +          } > "${body_file}"
    +          # Edit the earlier hint on a reopen/close cycle instead of adding another.
    +          .github/scripts/hive-status-card.sh upsert "${REPO}" "${ISSUE}" '<!-- issue-closed-reopen-hint -->' "${body_file}"

    🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

    — hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

  4. 22 remaining items

  5. hivecommons-hive commented on Nov 3, 2026

    @hivecommons-hive
    ContributorAuthor

    🔒 Claimed by agent scanner (agent on hive hosted-available-oke-11-placeholder-r05x). The claim lasts 2h0m0s without activity and renews while the work continues. Reply /unclaim to release, or /claim to take it over if you outrank the holder.

  6. hivecommons-hive commented on Nov 3, 2026

    @hivecommons-hive
    ContributorAuthor

    The hive App token cannot push .github/workflows/*, so a maintainer must apply this diff (git apply) with their own credentials. This supersedes the earlier patch comment on this issue (posted 2026-11-03T04:46Z); use this one. It was refreshed after the owner decision above. Apply it after #16451 merges: that PR makes .github/scripts/hive-status-card.sh report read/parse failures as exit 3 instead of absence, and it adds .github/scripts/test-hive-status-card.sh, which this patch wires into CI.

    Workflow files changed:

    • .github/workflows/issue-closed-reopen-hint.yml: checks out .github/scripts from the default-branch ref of the issues event. The checkout uses pinned actions/checkout with persist-credentials: false, and permissions stay contents: read + issues: write. The workflow skips when the hive:status card carries issue-close (exit 0). It fails the job visibly with ::error:: when the helper exits 3 and does not post. Otherwise (exit 1) it upserts only github-actions[bot]'s own <!-- issue-closed-reopen-hint --> comment. It also drops the fixed /tmp/closed-hint.md path.
    • .github/workflows/v2-ci.yml (contract-tests): runs .github/scripts/test-hive-status-card.sh and src/scripts/test-comment-merged-refs.sh in canonical CI. Until this lands, nothing in CI runs either test.
    • .github/workflows/integration-candidate.yml, .github/workflows/integration-technical-v2-ci.yml: regenerated with python3 .github/scripts/generate-integration-ci.py. They only mirror the v2-ci.yml change.
    • refs-sweep.yml needs no edit. Its loop already reports a non-zero comment-merged-refs.sh exit as ::warning::sweep failed for PR #N, which is how the sweep's new card-read error surfaces.
    diff --git a/.github/workflows/integration-candidate.yml b/.github/workflows/integration-candidate.yml
    index 45c8465e8..c3fd93caa 100644
    --- a/.github/workflows/integration-candidate.yml
    +++ b/.github/workflows/integration-candidate.yml
    @@ -343,6 +343,10 @@ jobs:
           run: bash scripts/test-issue-coauthor.sh
         - name: Issue confirm-fixed command (#9746)
           run: bash scripts/test-issue-confirm-fixed.sh
    +    - name: hive:status card helper (#16363)
    +      run: bash ../.github/scripts/test-hive-status-card.sh
    +    - name: Refs sweep defers to the hive:status card (#16363)
    +      run: bash scripts/test-comment-merged-refs.sh
         - name: Release push retry/deferral state machine (#5142)
           run: bash scripts/test-release-push-retry.sh
         - name: release_sha ancestry guard (#6419)
    diff --git a/.github/workflows/integration-technical-v2-ci.yml b/.github/workflows/integration-technical-v2-ci.yml
    index 7c7ebd7a0..f8cba9553 100644
    --- a/.github/workflows/integration-technical-v2-ci.yml
    +++ b/.github/workflows/integration-technical-v2-ci.yml
    @@ -203,6 +203,10 @@ jobs:
           run: bash scripts/test-issue-coauthor.sh
         - name: Issue confirm-fixed command (#9746)
           run: bash scripts/test-issue-confirm-fixed.sh
    +    - name: hive:status card helper (#16363)
    +      run: bash ../.github/scripts/test-hive-status-card.sh
    +    - name: Refs sweep defers to the hive:status card (#16363)
    +      run: bash scripts/test-comment-merged-refs.sh
         - name: Release push retry/deferral state machine (#5142)
           run: bash scripts/test-release-push-retry.sh
         - name: release_sha ancestry guard (#6419)
    diff --git a/.github/workflows/issue-closed-reopen-hint.yml b/.github/workflows/issue-closed-reopen-hint.yml
    index d0eea0c7c..0d0b30328 100644
    --- a/.github/workflows/issue-closed-reopen-hint.yml
    +++ b/.github/workflows/issue-closed-reopen-hint.yml
    @@ -12,6 +12,14 @@ name: Issue Closed Hint
     #
     # Skipped when the reporter closed the issue themselves (nothing to tell them)
     # and for pull requests (the `issues` event never fires for those).
    +#
    +# Defers to the runtime (#16363): when the issue's hive:status card already
    +# carries the `issue-close` section (which says "Reply /reopen"), this posts
    +# nothing. Otherwise it edits its own earlier hint (marker
    +# `<!-- issue-closed-reopen-hint -->`, authored by github-actions[bot]) instead
    +# of adding one per closure. A failure to read the card fails the job rather
    +# than posting a possible duplicate. The helper is checked out from the
    +# default branch (the `issues` event's ref), never from an issue or PR.
     
     on:
       issues:
    @@ -28,6 +36,10 @@ jobs:
         timeout-minutes: 5
         if: github.event.issue.user.login != github.event.sender.login
         steps:
    +      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
    +        with:
    +          persist-credentials: false
    +          sparse-checkout: .github/scripts
           - name: Comment
             env:
               GH_TOKEN: ${{ github.token }}
    @@ -38,10 +50,19 @@ jobs:
               REASON: ${{ github.event.issue.state_reason }}
             run: |
               set -euo pipefail
    +          card_rc=0
    +          .github/scripts/hive-status-card.sh has "${REPO}" "${ISSUE}" issue-close || card_rc=$?
    +          case "${card_rc}" in
    +            0) echo "hive:status card already carries issue-close; skipping."; exit 0 ;;
    +            1) ;;
    +            *) echo "::error::could not read the hive:status card on #${ISSUE} (exit ${card_rc}); not posting a possible duplicate."; exit 1 ;;
    +          esac
               # Written to a file rather than inlined: a multi-line --body inside a
               # YAML block scalar picks up the block's indentation and renders as a
               # code block on GitHub.
    +          body_file="$(mktemp)"
               {
    +            printf '<!-- issue-closed-reopen-hint -->\n'
                 printf '@%s this issue was closed by @%s' "${REPORTER}" "${CLOSER}"
                 case "${REASON}" in
                   not_planned) printf ' as not planned' ;;
    @@ -51,5 +72,6 @@ jobs:
                 printf 'If this was closed by a merged PR, the fix only takes effect once it ships in a tagged release and your deployment updates to it — check your running version against the fix before concluding the fix failed.\n\n'
                 printf 'If you are still seeing the problem, comment `/reopen` and it will be reopened for you — you do not need write access. '
                 printf 'Please add what you are still observing (running version, logs, steps) so it is not closed the same way again.\n'
    -          } > /tmp/closed-hint.md
    -          gh issue comment "${ISSUE}" --repo "${REPO}" --body-file /tmp/closed-hint.md
    +          } > "${body_file}"
    +          # Edits the earlier hint on a reopen/close cycle instead of adding another.
    +          .github/scripts/hive-status-card.sh upsert "${REPO}" "${ISSUE}" '<!-- issue-closed-reopen-hint -->' "${body_file}"
    diff --git a/.github/workflows/v2-ci.yml b/.github/workflows/v2-ci.yml
    index deb415b91..d07b736c0 100644
    --- a/.github/workflows/v2-ci.yml
    +++ b/.github/workflows/v2-ci.yml
    @@ -422,6 +422,18 @@ jobs:
           - name: Issue confirm-fixed command (#9746)
             run: bash scripts/test-issue-confirm-fixed.sh
     
    +      # #16363: the hive:status card helper lets Actions workflows skip or edit
    +      # in place instead of duplicating the runtime's card. Pins exact section
    +      # matching, absence when there is no card, that an API/parse failure is an
    +      # error (exit 3) rather than absence, and that upsert edits only the
    +      # posting identity's own marker comment; the refs sweep's deferral and
    +      # its error handling ride on the same helper.
    +      - name: hive:status card helper (#16363)
    +        run: bash ../.github/scripts/test-hive-status-card.sh
    +
    +      - name: Refs sweep defers to the hive:status card (#16363)
    +        run: bash scripts/test-comment-merged-refs.sh
    +
           # #5142: v4.0.1 failed to publish twice in a row inside tagged-release.yml's
           # final push — once on GH006 propagation lag (branch protection had not
           # yet ingested the just-earned gate check), once on a non-fast-forward

    Save the diff block above as 16363-workflows.patch, then apply it on top of v5 after #16451 has merged:

    git fetch origin v5 && git switch -c fix-16363-workflows origin/v5
    git apply --check 16363-workflows.patch && git apply 16363-workflows.patch
    python3 .github/scripts/generate-integration-ci.py --check   # generated candidates match v2-ci.yml
    git commit -s -am "🌱 chore(actions): issue-closed hint defers to the hive:status card; run status-card/refs-sweep regressions in CI"

    To verify:

    • In the maintainer PR's CI, the contract-tests steps hive:status card helper (#16363) and Refs sweep defers to the hive:status card (#16363) should pass. Locally, bash .github/scripts/test-hive-status-card.sh should end in test-hive-status-card OK and bash src/scripts/test-comment-merged-refs.sh in test-comment-merged-refs OK.
    • To dry-run the affected workflow after merge, close and reopen a test issue filed by another account, three times:
      1. With no hive:status card, the first close posts one <!-- issue-closed-reopen-hint --> comment and the second close edits it. The comment count is unchanged.
      2. On an issue whose card carries <!-- hive:status:section=issue-close -->, the run logs hive:status card already carries issue-close; skipping. and posts nothing.
      3. A run where the comments API fails ends red with ::error::could not read the hive:status card and posts nothing.

    The issue should stay open until these workflow edits are merged and verified.


    🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

    — hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

  7. hivecommons-hive commented on Nov 3, 2026

    @hivecommons-hive
    ContributorAuthor

    PR #16451 covers this issue: #16451

    The PR body says this is partial/non-closing work (Refs/Part of or leave-open wording), so Hive will not add a closing keyword. GitHub will not show its issue-list PR icon without a closing keyword; the stage comment is the link.

  8. hivecommons-hive commented on Nov 3, 2026

    @hivecommons-hive
    ContributorAuthor

    Fixed by #16385 (merged 9c62646). Closing. Reply /reopen if the problem persists.

  9. hivecommons-hive commented on Nov 3, 2026

    @hivecommons-hive
    ContributorAuthor

    🔓 Claim by agent scanner released (holding agent relaunched).

    Claim history
    • 2026-11-03 18:19 UTC — released by scanner (agent; holding agent relaunched)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/scannerCreated or modified by the scanner agentapproved-directionhelp wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.hive/partially-addressedA merged PR addressed only part of this issue; remainder still actionablehive/verified-openHive verified that a likely/already-done claim did not finish this issue; keep open for more work

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions