Repository navigation
skills(nightly): drop marker, dedup PAT-scope-audit by title - #332
Conversation
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.
| 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 |
There was a problem hiding this comment.
do we actually need this comment at all? do we need it for dedup?
There was a problem hiding this comment.
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:
- 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. - Dedup by label. Apply a
tend-pat-scope-auditlabel and search viagh 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). - Drop the
<!--wrapping and puttend-pat-scope-auditas 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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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]>
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 searchesPAT in:titlebefore 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 raisedinvalid 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
forbid bang-backtick in plugin skill filesguard passes (verified locally — 0 hits)<!--markers appear in newly opened PAT-scope-audit issues