Skip to content

skills(nightly): drop marker, dedup PAT-scope-audit by title - #332

Merged
max-sixty merged 2 commits into
mainfrom
hourly/review-24950949808
Apr 26, 2026
Merged

max-sixty merged 2 commits into
mainfrom
hourly/review-24950949808

Conversation

@tend-agent

@tend-agent tend-agent commented Apr 26, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Per review feedback: drop the <!-- tend-pat-scope-audit --> marker entirely and dedup the PAT-scope-audit tracking issue by title instead. The agent searches PAT in:title before creating a new issue and updates the existing one if found. Less robust against title edits, but materially simpler — and removes the bang-escape surface that motivated the original PR.

Why this changed direction

The original PR added a "Marker handling — bang-escape mitigation" section to teach the agent which forms to use when the marker is bang-bearing. Maintainer feedback: easier to remove the bang-bearing literal from the recipe than to teach two safe forms around it. Title-based dedup costs robustness when the title is edited, but no marker means no Bash-tool exclamation-mark hazard, which removes the failure mode that triggered the PR.

Evidence the original failure was real

Run 24950611809 on max-sixty/worktrunk (2026-04-26 06:55Z): the nightly bot's marker-quoting search recipe was rewritten by the Bash preprocessor (<!-- → <\!--); jq raised invalid escape sequence "\!" and the search returned empty; the bot opened #2421 (body shipped with <\!-- corruption) and self-closed it as a duplicate of #2273 seven minutes later. Title-based dedup avoids both failure modes.

Test plan

  • CI pre-commit's forbid bang-backtick in plugin skill files guard passes (verified locally — 0 hits)
  • Next nightly on a worktrunk-shape adopter dedups against an existing PAT-scope-audit issue by title without creating a new one
  • No <!-- markers appear in newly opened PAT-scope-audit issues

The marker ``<\!-- tend-pat-scope-audit -->`` contains an exclamation
mark, so any Bash command that ships ``<\!--`` (a heredoc body, a jq
filter) gets the mark rewritten to backslash-bang by the running-in-ci
preprocessor. This silently breaks both directions of the dedup
workflow: jq parsing fails and returns no match, leading the agent to
open a duplicate; the duplicate's body ships with visibly corrupted
``<\\!--``.

Document the bang-safe forms: search by the bang-free substring
``tend-pat-scope-audit`` (the wrapping is purely for human-invisibility
in the rendered issue) and compose the body with the Write tool +
``--body-file``.

Observed on max-sixty/worktrunk run 24950611809 — bot self-closed the
created duplicate seven minutes after opening it.
@tend-agent tend-agent added the claude-behavior Behavioral issues found by review-reviewers label Apr 26, 2026
for dedup, list the values from `MISSING=`, and link step 8 of the
`install-tend` skill for remediation:
by the marker). The issue body must include the marker
`<!-- tend-pat-scope-audit -->` on its own line for dedup, list the values

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

do we actually need this comment at all? do we need it for dedup?

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.

Fair question — the marker is purely a dedup anchor, not load-bearing for anything else, and the whole bang-escape mitigation in this PR exists to work around a hazard the marker itself introduced. Three cleaner alternatives:

  1. Dedup by title. Pin the title to a fixed string (e.g. Bot PAT: missing OAuth scopes) and search by title. No marker, no bang-escape concern. Risk: a maintainer renaming the title silently breaks dedup the next nightly. The marker survives title edits.
  2. Dedup by label. Apply a tend-pat-scope-audit label and search via gh issue list --label tend-pat-scope-audit. Survives title edits, no bang-escape concern. Cost: one extra API call per nightly to ensure the label exists in each adopter repo (or a one-time setup step).
  3. Drop the <!-- wrapping and put tend-pat-scope-audit as visible plain text in the body (e.g. a footer line). Functionally equivalent to this PR but the identifier shows up in the rendered issue.

My read: option 2 (label-based) is the most robust — it survives title edits, works with gh issue list --label, and removes the bang-escape surface entirely. Happy to swap this PR for that approach if you prefer; want me to redo it as label-based dedup instead?

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

easiest approach is to just have PAT in the title and have the agent stochastically check whether one already exists when adding one

a bit less robust but much simpler

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.

Done — pushed 29daefe. Dropped the marker and the entire bang-escape mitigation section. The recipe now dedups by PAT in:title: agent searches before creating, updates the existing issue if one's open, and the example title is Bot PAT: missing scopes. Net diff vs main is +12/-9 instead of +44/-9. PR title and body updated to reflect the new approach.

Per review feedback on #332: simpler is better. Replace the
'<\!-- tend-pat-scope-audit -->' marker (and the bang-escape mitigation
section it required) with a title-based dedup — the agent searches
'PAT in:title' before creating a new tracking issue. Less robust against
title edits, but removes the bang-escape surface entirely and is
materially shorter.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
@tend-agent tend-agent changed the title skills(nightly): bang-safe marker handling for PAT-scope-audit dedup skills(nightly): drop marker, dedup PAT-scope-audit by title Apr 26, 2026
@max-sixty
max-sixty merged commit 40f4a56 into main Apr 26, 2026
5 checks passed
@max-sixty
max-sixty deleted the hourly/review-24950949808 branch April 26, 2026 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claude-behavior Behavioral issues found by review-reviewers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants