Skip to content

docs(maintenance): find Claude-workflow callers by inventory; keep mac-diagnostics' callers - #30

Merged
docdyhr merged 1 commit into
mainfrom
docs/maintenance-caller-inventory
Oct 26, 2026
Merged

docdyhr merged 1 commit into
mainfrom
docs/maintenance-caller-inventory

Conversation

@docdyhr

@docdyhr docdyhr commented Oct 26, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • The re-tag scope check (MAINTENANCE.md, "Re-tagging v1") now loops over the output of workflow-consumers.sh, not a hand-written <callers> list. The inventory finds callers by their uses: target, so a caller saved under another file name still counts. Exit 2 means the list may be incomplete. A written list was wrong twice: on 2026-10-21 ("all 3 consumers") and on 2026-10-23, when mac-diagnostics was missing.
  • Records the decision to keep mac-diagnostics' two Claude callers, made 2026-10-26, the same way pigame's are kept. Each has its own weekly schedule:, both run green, and the orchestrator does not cover the repo, so none of the 10-21 retirement reasons applies. The status run does real work: its Claude job ran 41 s on 2026-10-26. The merger stops at "Nothing to do" when there is no Dependabot PR.
  • The reusable-workflow table gives the callers as a dated snapshot and points to the inventory for the current list.

Type of change

  • Bug fix
  • New feature
  • Refactor / code quality
  • Documentation
  • CI / tooling
  • Dependency update

Checklist

  • Tests added or updated for new behaviour (docs only)
  • Full test suite passes locally: the new loop was run read-only under bash and zsh with claude-status-check.yml and contents. Inventory exit 0; pigame 1, mac-diagnostics 1.
  • Docs updated if user-facing behaviour changed (README, CHANGELOG)
  • No secrets or credentials in this PR

Related issues

None in this repo. Follow-up to #27 (the 2026-10-21 retirement). mac-diagnostics is in neither the tier table nor the orchestrator list; whether it gets a tier is a separate decision.

🤖 Generated with Claude Code

Summary by Sourcery

Make reusable-workflow maintenance rely on caller inventory and document the retained mac-diagnostics workflows.

Bug Fixes:

  • Replace the error-prone hand-maintained caller list with inventory-based consumer discovery for re-tagging checks.

Enhancements:

  • Document mac-diagnostics as an intentional retained caller of both reusable Claude workflows and clarify its operating rationale.
  • Document inventory command semantics, including incomplete-read handling, and use its results when validating caller permissions before re-tagging.
  • Update reusable-workflow caller information to distinguish dated snapshots from the current inventory.

Documentation:

  • Update MAINTENANCE.md with current caller snapshots, inventory-based re-tagging guidance, and the mac-diagnostics retention decision.

…c-diagnostics' callers

The re-tag procedure looped over a hand-written caller list, which was
wrong twice (2026-10-21 "all 3 consumers"; 2026-10-23 mac-diagnostics
missing). The scope check now loops over workflow-consumers.sh output,
which finds callers by their uses: target and exits 2 when any repo or
file was unreadable.

Record the 2026-10-26 decision to keep mac-diagnostics' two callers:
they have their own schedules, run green, and the orchestrator does not
cover the repo, so none of the 10-21 retirement reasons applies.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sourcery-ai

sourcery-ai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates MAINTENANCE.md to make reusable-workflow consumer discovery reliable and actionable through the local inventory script, including safe handling of incomplete results, and records why mac-diagnostics' two Claude workflow callers remain in service.

Flow diagram for safe reusable-workflow re-tagging

flowchart TD
    A[Run workflow-consumers.sh] --> B{Inventory exit code}
    B -->|2| C[Stop: list may be incomplete]
    B -->|0| D[Read each caller permissions block]
    D --> E{Every required scope count is 1?}
    E -->|No| F[Do not re-tag]
    E -->|Yes| G[Re-tag reusable workflow v1]
Loading

File-Level Changes

Change Details Files
Replace the manually maintained consumer list in the re-tagging procedure with inventory-driven discovery and explicit exit-status handling.
  • Document inventory lookup by reusable-workflow uses: target, independent of caller filename.
  • Pipe inventory results into permission checks for each discovered caller.
  • Require inventory exit 0, alongside complete scope coverage, before re-tagging.
  • Clarify that exit 2 indicates an incomplete inventory rather than no consumers.
MAINTENANCE.md
Document the decision to retain mac-diagnostics as an active caller of both reusable Claude workflows.
  • Record the dated snapshot of pigame and mac-diagnostics as callers.
  • Explain mac-diagnostics' independent schedules, successful runs, actual status-check work, and no-op merger behavior.
  • Point current caller discovery to the inventory while retaining the table as historical context.
MAINTENANCE.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai 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.

Hey - I've found 3 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="MAINTENANCE.md" line_range="67" />
<code_context>

 ```bash
-for r in <callers>; do gh api "repos/docdyhr/$r/contents/.github/workflows/<caller-file>.yml" --jq .content | base64 -d | grep -c '<new-scope>: read'; done
+bash ~/.claude/skills/_shared/workflow-consumers.sh docdyhr <reusable-file>.yml > /tmp/callers.txt; echo "inventory exit $?"   # must be 0
+awk '$1 == "CONSUMER" {print $2, $3}' /tmp/callers.txt | while read -r r f; do
+  printf '%s %s: ' "$r" "$f"; gh api "repos/$r/contents/$f" --jq .content </dev/null | base64 -d | grep -c '<new-scope>: read'
</code_context>
<issue_to_address>
**Predictable temporary file can clobber data**

When A local attacker can create `/tmp/callers.txt` before the maintainer runs the procedure on a system that follows the symlink, the shell follows a pre-created `/tmp/callers.txt` symlink and truncates its target before running the inventory, allowing a local attacker to overwrite a file writable by the maintainer.

Create the output with `mktemp` and restrictive permissions, then use that generated path for the inventory and subsequent read.
</issue_to_address>

### Comment 2
<location path="MAINTENANCE.md" line_range="19-20" />
<code_context>
 |---|---|---|
-| `claude-dependabot-merge.yml` | Headless Claude Dependabot auto-merge. Only pigame (T4) still calls it (see below) | v1 |
-| `claude-status-check.yml` | Repo health check (PRs, CI, issues, alerts, branches). Only pigame (T4) still calls it (see below) | v1 |
+| `claude-dependabot-merge.yml` | Headless Claude Dependabot auto-merge. Callers on 2026-10-26: pigame and mac-diagnostics (see below); for the current list, run the inventory under Re-tagging | v1 |
+| `claude-status-check.yml` | Repo health check (PRs, CI, issues, alerts, branches). Callers on 2026-10-26: pigame and mac-diagnostics (see below); for the current list, run the inventory under Re-tagging | v1 |

 Caller templates for new consumers: `workflow-templates/`
</code_context>
<issue_to_address>
**Private repository activity disclosed**

When MAINTENANCE.md is published in a publicly readable repository, unauthenticated readers can learn the private repository’s name, its weekly workflow schedules, and that its Claude status job ran on a specific date, giving them operational details about a repository they otherwise cannot see.

Avoid naming the private repository or publishing its workflow schedule and run details in public documentation.

Also at `MAINTENANCE.md:34`.
</issue_to_address>

### Comment 3
<location path="MAINTENANCE.md" line_range="68" />
<code_context>
 ```bash
-for r in <callers>; do gh api "repos/docdyhr/$r/contents/.github/workflows/<caller-file>.yml" --jq .content | base64 -d | grep -c '<new-scope>: read'; done
+bash ~/.claude/skills/_shared/workflow-consumers.sh docdyhr <reusable-file>.yml > /tmp/callers.txt; echo "inventory exit $?"   # must be 0
+awk '$1 == "CONSUMER" {print $2, $3}' /tmp/callers.txt | while read -r r f; do
+  printf '%s %s: ' "$r" "$f"; gh api "repos/$r/contents/$f" --jq .content </dev/null | base64 -d | grep -c '<new-scope>: read'
+done
</code_context>
<issue_to_address>
**Caller paths with spaces are truncated**

When an inventory result contains a caller workflow path with whitespace, `awk` prints the repo and path as whitespace-separated fields, and `read` splits them again, so the path is truncated before `gh api` receives it. The check targets the wrong file and cannot verify that caller's scope.

Preserve the caller path as a single value when parsing the inventory and passing it to `gh api`.
</issue_to_address>

Sourcery assessment

Approval pending. 3 findings to address first.

Blocking findings: MAINTENANCE.md:67, MAINTENANCE.md:20, MAINTENANCE.md:68


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread MAINTENANCE.md

```bash
for r in <callers>; do gh api "repos/docdyhr/$r/contents/.github/workflows/<caller-file>.yml" --jq .content | base64 -d | grep -c '<new-scope>: read'; done
bash ~/.claude/skills/_shared/workflow-consumers.sh docdyhr <reusable-file>.yml > /tmp/callers.txt; echo "inventory exit $?" # must be 0

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Medium · Predictable temporary file can clobber data

When A local attacker can create /tmp/callers.txt before the maintainer runs the procedure on a system that follows the symlink, the shell follows a pre-created /tmp/callers.txt symlink and truncates its target before running the inventory, allowing a local attacker to overwrite a file writable by the maintainer.

Create the output with mktemp and restrictive permissions, then use that generated path for the inventory and subsequent read.

Prompt for AI agents
In `MAINTENANCE.md` at line 67:

**Predictable temporary file can clobber data**

When A local attacker can create `/tmp/callers.txt` before the maintainer runs the procedure on a system that follows the symlink, the shell follows a pre-created `/tmp/callers.txt` symlink and truncates its target before running the inventory, allowing a local attacker to overwrite a file writable by the maintainer.

Create the output with `mktemp` and restrictive permissions, then use that generated path for the inventory and subsequent read.

Comment thread MAINTENANCE.md
Comment on lines +19 to +20
| `claude-dependabot-merge.yml` | Headless Claude Dependabot auto-merge. Callers on 2026-10-26: pigame and mac-diagnostics (see below); for the current list, run the inventory under Re-tagging | v1 |
| `claude-status-check.yml` | Repo health check (PRs, CI, issues, alerts, branches). Callers on 2026-10-26: pigame and mac-diagnostics (see below); for the current list, run the inventory under Re-tagging | v1 |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Medium · Private repository activity disclosed

When MAINTENANCE.md is published in a publicly readable repository, unauthenticated readers can learn the private repository’s name, its weekly workflow schedules, and that its Claude status job ran on a specific date, giving them operational details about a repository they otherwise cannot see.

Avoid naming the private repository or publishing its workflow schedule and run details in public documentation.

Also at MAINTENANCE.md:34.

Prompt for AI agents
In `MAINTENANCE.md` at lines 19-20:

**Private repository activity disclosed**

When MAINTENANCE.md is published in a publicly readable repository, unauthenticated readers can learn the private repository’s name, its weekly workflow schedules, and that its Claude status job ran on a specific date, giving them operational details about a repository they otherwise cannot see.

Avoid naming the private repository or publishing its workflow schedule and run details in public documentation.

Also at `MAINTENANCE.md:34`.

Comment thread MAINTENANCE.md
```bash
for r in <callers>; do gh api "repos/docdyhr/$r/contents/.github/workflows/<caller-file>.yml" --jq .content | base64 -d | grep -c '<new-scope>: read'; done
bash ~/.claude/skills/_shared/workflow-consumers.sh docdyhr <reusable-file>.yml > /tmp/callers.txt; echo "inventory exit $?" # must be 0
awk '$1 == "CONSUMER" {print $2, $3}' /tmp/callers.txt | while read -r r f; do

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Medium · Caller paths with spaces are truncated

When an inventory result contains a caller workflow path with whitespace, awk prints the repo and path as whitespace-separated fields, and read splits them again, so the path is truncated before gh api receives it. The check targets the wrong file and cannot verify that caller's scope.

Preserve the caller path as a single value when parsing the inventory and passing it to gh api.

Prompt for AI agents
In `MAINTENANCE.md` at line 68:

**Caller paths with spaces are truncated**

When an inventory result contains a caller workflow path with whitespace, `awk` prints the repo and path as whitespace-separated fields, and `read` splits them again, so the path is truncated before `gh api` receives it. The check targets the wrong file and cannot verify that caller's scope.

Preserve the caller path as a single value when parsing the inventory and passing it to `gh api`.

@docdyhr
docdyhr merged commit 8ec70dd into main Oct 26, 2026
2 checks passed
@docdyhr
docdyhr deleted the docs/maintenance-caller-inventory branch October 26, 2026 23:36
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