Skip to content

skills(running-tend): stop the consumers refresh deleting repos the search missed - #1096

Merged
max-sixty merged 2 commits into
mainfrom
fix/consumers-refresh-recall
Aug 30, 2026
Merged

max-sixty merged 2 commits into
mainfrom
fix/consumers-refresh-recall

Conversation

@tend-agent

Copy link
Copy Markdown
Collaborator

The weekly consumers.json refresh rebuilds the file wholesale from gh search code, so the file inherits the search's recall. Today's search returned 6 of the 8 listed consumers, and running the recipe as written would have deleted jakobtfaber/Faber2026 and max-sixty/cargo-affected — both live, both still carrying eight tend-*.yaml files — from the data the public site renders. This makes the search a discovery step only: candidates are the union of the search hits and the repos already listed, and a per-repo API check decides who stays.

Evidence and verification

The miss is in the index, not the query or the cap. The search returns 52 hits against a 100 cap, so nothing is crowded out; both repos simply return zero hits for max-sixty/tend while their workflow files demonstrably contain the ref:

$ gh search code 'max-sixty/tend' --repo max-sixty/cargo-affected
(no results)
$ gh api repos/max-sixty/cargo-affected/contents/.github/workflows/tend-review.yaml | ... | grep uses:
      - uses: max-sixty/tend/[email protected]

max-sixty/cargo-affected returns nothing for a bare tend query either — the repo is absent from the code index, not stale in it. #1093 observed the same 6-of-8 result independently and named this as out of scope for that PR.

Not a retry. #345 was closed on the principle that a retry wrapper around a transient search blip isn't worth keeping. This adds no retry and re-queries nothing: it stops treating search absence as evidence of removal, and moves the keep/drop decision onto an authoritative per-repo API check that an uninstall actually fails.

Verified. The recipe was extracted verbatim from the file and run under set -euo pipefail against real GitHub: 6 discovered, 8 candidates, 8 retained, output byte-identical to the committed data/consumers.json. The drop path was exercised separately against a repo with no matching workflows (octocat/Hello-World → count=0, dropped). uv run pytest passes (763), as does pre-commit on the changed file.

Out of scope, worth its own look: max-sixty/tend-integration satisfies both filters — 3 tend-*.yaml files and bot_name: tend-agent — and is absent from the list only because code search does not index it either. If it is ever indexed, the weekly refresh adds the test fixture to the public site's adopter list.

…earch missed

Code search returned 6 of 8 live consumers, so a wholesale rebuild would drop
two adopters from the data the website renders. Union the search hits with the
repos already listed, and decide retention on a per-repo API check instead.

@tend-agent tend-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The union is the right shape — a search that returns nothing now degrades to a no-op instead of a wipe, and moving the keep/drop decision onto a per-repo API check is the part that makes the file authoritative rather than a projection of the code index.

One residual path, in the inline note: || workflows=0 treats any non-zero gh api exit as an uninstall, and with stderr discarded a 403 or a 5xx is indistinguishable from a real 404. For the two repos this PR exists to protect, that deletion is permanent — the code index can't see them, so nothing re-adds them on a later run, and re-running the recipe within the same session reads its own already-pruned output back as the union input. Classifying the error is more machinery than this is worth; the cheap version is to say so in the step-3 comment and require a hand re-check before a removal lands.

Separately, worth a look rather than a change here: the block is now 40 lines and carries edge-case handling (|| workflows=0, ${workflows:-0}, the empty-array union), which is both triggers in running-in-ci's "Scripts over prose recipes" — "put the logic in a tested script ... for a repo overlay a scripts/ directory beside the skill". shellcheck on the extracted block is clean today, so nothing is broken; it's the trajectory that's notable, on the one recipe in this overlay that writes the data the public site renders.

Comment thread .claude/skills/running-tend/SKILL.md Resolved
…nstall

The step-3 keep/drop check swallows gh api errors (|| workflows=0), so a
403 or 5xx is indistinguishable from a real 404 and removes the repo.
Nothing re-adds a repo the code index can't see, so require a hand
re-check before a removal lands.
@tend-agent

Copy link
Copy Markdown
Collaborator Author

On the script-extraction point: agreed on the trajectory, not doing it here. Extracting the block into scripts/ beside the skill rewrites the same lines this PR changes, so it would either stack on an unmerged branch or have to be redone after a rebase — and it is a different concern from the recall bug. Leaving it as a follow-up once this lands: the recipe is 40 lines with three edge cases, it writes the file the public site renders, and a scripts/refresh-consumers.sh would get shellcheck and a test instead of being re-derived per session.

@max-sixty
max-sixty merged commit e3a9e56 into main Aug 30, 2026
10 checks passed
@max-sixty
max-sixty deleted the fix/consumers-refresh-recall branch August 30, 2026 22:48
max-sixty pushed a commit that referenced this pull request Aug 30, 2026
…earch missed (#1096)

The weekly `consumers.json` refresh rebuilds the file wholesale from `gh
search code`, so the file inherits the search's recall. Today's search
returned 6 of the 8 listed consumers, and running the recipe as written
would have deleted `jakobtfaber/Faber2026` and
`max-sixty/cargo-affected` — both live, both still carrying eight
`tend-*.yaml` files — from the data the public site renders. This makes
the search a discovery step only: candidates are the union of the search
hits and the repos already listed, and a per-repo API check decides who
stays.

<details><summary>Evidence and verification</summary>

**The miss is in the index, not the query or the cap.** The search
returns 52 hits against a 100 cap, so nothing is crowded out; both repos
simply return zero hits for `max-sixty/tend` while their workflow files
demonstrably contain the ref:

```
$ gh search code 'max-sixty/tend' --repo max-sixty/cargo-affected
(no results)
$ gh api repos/max-sixty/cargo-affected/contents/.github/workflows/tend-review.yaml | ... | grep uses:
      - uses: max-sixty/tend/[email protected]
```

`max-sixty/cargo-affected` returns nothing for a bare `tend` query
either — the repo is absent from the code index, not stale in it. #1093
observed the same 6-of-8 result independently and named this as out of
scope for that PR.

**Not a retry.** #345 was closed on the principle that a retry wrapper
around a transient search blip isn't worth keeping. This adds no retry
and re-queries nothing: it stops treating search absence as evidence of
removal, and moves the keep/drop decision onto an authoritative per-repo
API check that an uninstall actually fails.

**Verified.** The recipe was extracted verbatim from the file and run
under `set -euo pipefail` against real GitHub: 6 discovered, 8
candidates, 8 retained, output byte-identical to the committed
`data/consumers.json`. The drop path was exercised separately against a
repo with no matching workflows (`octocat/Hello-World` → `count=0`,
dropped). `uv run pytest` passes (763), as does `pre-commit` on the
changed file.

**Out of scope, worth its own look:** `max-sixty/tend-integration`
satisfies both filters — 3 `tend-*.yaml` files and `bot_name:
tend-agent` — and is absent from the list only because code search does
not index it either. If it is ever indexed, the weekly refresh adds the
test fixture to the public site's adopter list.

</details>

---------

Co-authored-by: tend-agent <[email protected]>
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.

2 participants