Skip to content

feat(labels): add cloud-routine and agentic-workflows source labels#340

Merged
JacobPEvans merged 2 commits into
mainfrom
feat/attribution-labels
May 24, 2026
Merged

feat(labels): add cloud-routine and agentic-workflows source labels#340
JacobPEvans merged 2 commits into
mainfrom
feat/attribution-labels

Conversation

@JacobPEvans
Copy link
Copy Markdown
Owner

@JacobPEvans JacobPEvans commented May 24, 2026

Summary

Adds two new labels to labels.yml so automated PRs and issues across the estate can identify their source at a glance:

  • cloud-routine (blue 1D4ED8) — applied by Claude Code cloud routines from JacobPEvans/claude-code-routines.
  • agentic-workflows (emerald 10B981) — applied by reusable workflows from JacobPEvans/ai-workflows.

The existing label-sync.yml workflow propagates both to every public repo on push to main, so routines and workflows can apply them without per-repo gh label create calls.

Why

Today the user can see ~30 automated PRs/issues per week landing across the estate but can't filter or tell at a glance which came from a cloud routine vs. an ai-workflows GHA. These two labels are the binary source distinction. Specific routine/workflow identity goes in the PR title suffix (e.g. [routine:distributor], [aw:ci-fix]) and the body Provenance block — those edits land in follow-up PRs in the routine and workflow repos respectively.

Test plan

  • Merge PR
  • Watch label-sync.yml run on push to main
  • Spot-check: gh label list --repo JacobPEvans/claude-code-routines | grep -E 'cloud-routine|agentic-workflows' returns both
  • Spot-check the same in 2-3 more public repos

Assisted-by: Claude

Two new labels for attribution of automated PRs/issues:

- cloud-routine (blue) — applied by Claude Code cloud routines from
  JacobPEvans/claude-code-routines.
- agentic-workflows (emerald) — applied by reusable workflows from
  JacobPEvans/ai-workflows.

The existing label-sync.yml workflow propagates both to every public
repo on push to main, so routines and workflows can apply them
without per-repo `gh label create` calls.

Assisted-by: Claude <noreply@anthropic.com>
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces two new standardized labels to the repository's configuration to improve the traceability of automated contributions. By distinguishing between issues and PRs generated by cloud routines versus reusable agentic workflows, the team can better monitor and manage automated activity across the organization.

Highlights

  • New Label Addition: Added 'cloud-routine' and 'agentic-workflows' labels to the central repository configuration.
  • Improved Visibility: Enables easier filtering and identification of automated PRs and issues across the repository estate.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.


Two labels added to the list, / So automation won't be missed. / With colors bright and purpose clear, / The source of work will now appear.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

JacobPEvans added a commit to dryvist/claude-code-routines that referenced this pull request May 24, 2026
Every PR and issue created by a cloud routine now carries the same
three-layer attribution: title suffix, body Provenance block, and
the cloud-routine label.

Title suffix:
  chore(ci): add gh-aw-pin-refresh.yml [routine:distributor]
  docs(int_homelab): polish README [routine:daily-polish]
  [routine:custodian] Repo health audit - 2026-05-23

No emoji in titles or bodies (soul rule). Conventional-commit prefix
preserved so release-please continues to parse it. Emoji remain in
Slack output only, where the rule allows them.

Body footer (every PR + every issue):
  ## Provenance
  - Generated by: [Routine Name](link) - cron description
  - Triggered: what fired this run (cron + task lottery if any)
  - Why this PR/issue: one-line rationale
  - State: link to state gist
  - Label: cloud-routine

Label: cloud-routine, defined in JacobPEvans/.github/labels.yml in
a companion PR. Propagates to every public repo via the existing
label-sync.yml workflow - routines do not gh-label-create per repo.

PRs are now review-ready, not draft. Draft purgatory blocked the
ai-workflows review path (claude-review, final-pr-review,
ai-merge-gate) from picking up routine PRs; review-ready opens them
to the normal flow. Conductor still does not auto-merge them - its
allowlist is bot-author-specific and excludes routine bot identity.

Files touched:
- routines/daily-polish.prompt.md - drop emoji title, branch
  becomes docs/daily-polish/<repo>-<date> (was chore/daily-polish,
  collided across runs).
- routines/sentinel.prompt.md - drop emoji title, drop draft.
- routines/custodian.prompt.md - repo-audit issue gets
  [routine:custodian] prefix + Provenance + label.
- routines/inspector.prompt.md - drop draft, add suffix/block/label.
- routines/quartermaster.prompt.md - same.
- routines/archivist.prompt.md - same; private-docs issue too.
- routines/distributor.prompt.md - same.
- routines/issue-solver.prompt.md - drop emoji prefix from title
  and from abandon-comment; drop draft. PR title becomes
  fix(<repo>): <issue title> (#<NNN>) [routine:issue-solver].
- .github/workflows/issue-solver.yml - rename job to
  'open a review-ready PR'.
- CLAUDE.md - new Attribution conventions section under Hard
  rules. Future routines inherit the convention.

Apothecary, Conductor, Morning Briefing, Weekly Scorecard not
touched: they do not create PRs or issues directly.

Companion PRs:
- JacobPEvans/.github#340 defines the cloud-routine label.
- JacobPEvans/ai-workflows attribution PR will follow.

Assisted-by: Claude <noreply@anthropic.com>
Adds the [aw:gh-aw-pin-refresh] title suffix, the agentic-workflows
label, and a Provenance block to the PR body so the source of every
gh-aw pin-refresh PR is self-evident in the consumer repo's PR queue.

Pairs with JacobPEvans/ai-workflows attribution PR (composite-action
preamble + per-workflow source_slug) and JacobPEvans/claude-code-routines
attribution PR (cloud-routine label + Provenance blocks).

Assisted-by: Claude <noreply@anthropic.com>
@JacobPEvans JacobPEvans merged commit ed4114f into main May 24, 2026
2 checks passed
@JacobPEvans JacobPEvans deleted the feat/attribution-labels branch May 24, 2026 14:34
JacobPEvans added a commit to dryvist/ai-workflows that referenced this pull request May 24, 2026
…Rs/issues (#232)

* feat(attribution): unified PR/issue provenance across ai-workflows

Every PR and issue created by an ai-workflows workflow now identifies
itself with three layers: title suffix [aw:<workflow-basename>], a
Provenance block at the bottom of the body, and the agentic-workflows
label. Pairs with the cloud-routine attribution in
JacobPEvans/claude-code-routines and the label definitions in
JacobPEvans/.github#340.

Composite-action injection (keystone):

  .github/actions/run-claude-code/action.yml gains a `source_slug`
  input. When non-empty, compose-prompt.sh prepends
  attribution-preamble.md to Claude's prompt, instructing the model
  to add the title suffix, Provenance block, and label to every PR
  or issue it creates. Review-only callers (final-pr-review) leave
  source_slug empty and get no preamble.

  No inline scripts: prompt composition is in
  .github/actions/run-claude-code/compose-prompt.sh (the no-scripts
  rule blocks multi-line bash in YAML).

Per-workflow source_slug values:

  ci-fix                  -> aw:ci-fix
  post-merge-tests        -> aw:post-merge-tests
  post-merge-docs-review  -> aw:post-merge-docs-review
  code-simplifier         -> aw:code-simplifier
  issue-resolver          -> aw:issue-resolver

  issue-resolver also gains `gh pr edit` and `gh issue edit` in its
  allowed_tools so Claude can apply the agentic-workflows label.

Hardcoded creators (do not go through the composite):

  ci-fail-issue: create-failure-issue.js builds the issue title as
    `[aw:ci-fail-issue] fix: CI failure on main (...)` and appends a
    Provenance block. Labels gain `agentic-workflows` alongside the
    existing type:ci/priority:high/size:s/ai:created set.
  gh-aw-sync-upstream: PR title gets `[aw:gh-aw-sync-upstream]`,
    body gains a Provenance block, `agentic-workflows` added to
    labels.
  gh-aw-pin-refresh: shared reusable workflow lives in
    JacobPEvans/.github/.github/workflows/_gh-aw-pin-refresh.yml,
    updated separately on the .github attribution-labels branch.

Out of scope: lock.yml workflows are auto-generated from .md prompts
on gh-aw-sync-upstream runs; they pick up the attribution preamble
automatically once the composite change lands. issue-triage/hygiene/
sweeper/auto-resolve modify existing issues rather than create new
ones, so no provenance footer is added (would clutter every triaged
issue with the same block).

Assisted-by: Claude <noreply@anthropic.com>

* fix(attribution): address gemini review feedback on compose-prompt

Three findings from gemini-code-assist on PR #232:

HIGH (sed injection): compose-prompt.sh used `sed -e "s|{{...}}|$VAR|g"`
which interprets the replacement string. A `|`, `/`, `&`, or backslash
in any value would escape the template. Switch to bash parameter
expansion (`${var//pattern/replacement}`) which treats the replacement
literally and has no delimiter to collide with.

MEDIUM (predictable heredoc delimiter): the GITHUB_OUTPUT block used
`EOF_COMPOSED_PROMPT_$$` (PID-based). USER_PROMPT could in principle
include that line and escape the output block. Switch to a 32-character
random hex delimiter sourced from /dev/urandom per invocation.

MEDIUM (gh tools): document in the `source_slug` input description
that callers passing a non-empty slug MUST include `Bash(gh pr edit:*)`,
`Bash(gh issue edit:*)`, etc. in `allowed_tools` so Claude can apply
the `agentic-workflows` label after PR/issue creation. The existing
wildcard `Bash(gh pr:*)` used by post-merge-tests, post-merge-docs-review,
and code-simplifier already covers PR labeling.

Assisted-by: Claude <noreply@anthropic.com>

* refactor(attribution): remove compose-prompt script, use existing infra

The prior commits added a custom compose-prompt.sh that injected an
attribution preamble into Claude's prompt, instructing Claude to add
title suffixes, Provenance body blocks, and labels to every PR/issue.

This duplicated infrastructure that already exists:

- `.github/prompts/_provenance-footer.md` is the canonical AI Provenance
  footer for PR bodies. Every PR-creating Claude prompt
  (post-merge-tests, post-merge-docs-review, code-simplifier,
  issue-resolver) already includes this footer with envsubst-rendered
  variables.
- `ci-fix.md` injects `AI-Provenance: workflow=... run=... event=...
  actor=...` directly into commit messages (PR-level provenance is N/A
  there since ci-fix commits to existing PR branches, not new ones).
- `.github/scripts/render-prompt.sh` already handles variable
  substitution via envsubst.

What was actually missing was the LABEL — and that is handled
declaratively in a companion PR in `JacobPEvans/.github` that adds a
single `auto-label-bot-content.yml` workflow firing on
`pull_request: opened` and `issues: opened`. No per-workflow change is
needed; the label is applied by author identity.

Reverting:
- Delete `compose-prompt.sh` and `attribution-preamble.md`
- Remove the `source_slug` input from the composite action
- Remove the "Compose prompt with attribution preamble" step
- Drop `source_slug:` lines from ci-fix.yml, post-merge-tests.yml,
  post-merge-docs-review.yml, code-simplifier.yml, issue-resolver.yml
- Drop the extra `Bash(gh pr edit:*),Bash(gh issue edit:*)` that
  issue-resolver picked up — Claude already uses gh pr create; the
  label is applied org-wide by the auto-label workflow.

Kept (still declarative, no new scripts):
- `ci-fail-issue/create-failure-issue.js` already adds
  `agentic-workflows` to its labels list and appends a Provenance
  block to the issue body.
- `gh-aw-sync-upstream.yml` already declares the title suffix, full
  Provenance block, and `agentic-workflows` label directly in YAML
  inputs to `peter-evans/create-pull-request@v8`.

Assisted-by: Claude <noreply@anthropic.com>
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