Skip to content

docs: document workflow override mechanism with skip-review-label example - #278

Closed
tend-agent wants to merge 1 commit into
mainfrom
docs/workflow-override-example
Closed

tend-agent wants to merge 1 commit into
mainfrom
docs/workflow-override-example

Conversation

@tend-agent

Copy link
Copy Markdown
Collaborator

Summary

  • Documents the workflow_extra / jobs.<name> override mechanism in both the install-tend skill (where setup-stage users look for guidance) and docs/tend.example.toml (where README.md already points for advanced options).
  • Uses the skip-review-on-label pattern from Support skipping review on labeled PRs (e.g. tend:dismissed) #276 as the worked example, since it's the concrete need that prompted this gap report.
  • Adds test_skip_review_on_label_override to pin the exact override documented in both places (scalar replace of the review job's if:), so the example can't silently break.

The mechanism already exists in the generator and is spec'd in DESIGN.md § Extending generated workflows — #276 notes that it's just not surfaced where adopters see it during setup. A dedicated skip_review_label config option could still be added on top of this; intentionally leaving that call to a maintainer since the generic mechanism already covers the need without maintaining a second knob.

Closes #276 once merged (or leave open if a dedicated option is preferred).

Test plan

  • cd generator && uv run pytest — 159 passed
  • pre-commit on changed files — ruff/typos/format/trailing-ws clean
  • Render check: confirm the new section in tend.example.toml reads well alongside the existing ### review-runs block

…mple

The `workflow_extra` / `jobs.<name>` override mechanism existed in the
generator (and DESIGN.md) but was undocumented in the install-tend skill
and in tend.example.toml — the two places setup-stage users actually
read. Add a concrete "skip review on a tend:dismissed label" example to
both, plus a regression test.

Refs #276

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@tend-agent

Copy link
Copy Markdown
Collaborator Author

Closing — #277 landed first (merged at 2026-04-15T05:43:22Z) covering the same scope (docs in tend.example.toml, install-tend skill update, skip-review-label regression test). A parallel notifications-skill run on the same issue produced overlapping PRs; the other got there first.

@tend-agent tend-agent closed this Apr 15, 2026
tend-agent added a commit that referenced this pull request Apr 15, 2026
…ssue

The dedup check only looked at issue comments, so when tend-mention
handled an @-mention by opening a PR with `Refs #N` in the body (no
issue comment), the next tend-notifications run saw no bot response on
the issue and opened a duplicate PR.

Observed in run 24438580801 — `tend-notifications` opened PR #278 ~45min
after tend-mention had already opened PR #277 for the same request.
Both branches collided on `docs/workflow-override-example` and #278 was
closed as a duplicate after ~$4 of wasted work.

Add a third dedup check: for issue notifications, look at the timeline
for `cross-referenced` events from bot-authored PRs created after the
notification's `updated_at`.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@max-sixty
max-sixty deleted the docs/workflow-override-example branch April 15, 2026 15:54
max-sixty pushed a commit that referenced this pull request Apr 15, 2026
…ssue (#279)

## Summary

The notifications skill's dedup check only looks at issue comments and
PR reviews. When `tend-mention` handles an `@`-mention by opening a PR
with `Refs #N` in the body (and no issue comment), the next
`tend-notifications` run misses that signal and opens a duplicate PR.

## Evidence

Observed today in issue
[#276](#276):

| Time (UTC) | Event |
|---|---|
| 04:54:15 | `@max-sixty` commented on #276 with `@tend-agent` mention
asking for a PR |
| 04:54:19 | [`tend-mention` run
24437112906](https://github.com/max-sixty/tend/actions/runs/24437112906)
fires |
| 04:58:58 | tend-mention opens [PR
#277](#277) with `Refs #276` in
body — **no issue comment** |
| 05:40:46 | [`tend-notifications` run
24438413763](https://github.com/max-sixty/tend/actions/runs/24438413763)
starts — past the 10-min freshness gate |
| 05:40:xx | Dedup check: `gh api repos/.../issues/276/comments --jq
'[.[] \| select(bot login and created_at > 04:54:37)] \| length'`
returns `0` |
| 05:46:11 | Opens duplicate [PR
#278](#278) on the same branch
name `docs/workflow-override-example` |
| 05:59:16 | Closes #278 as duplicate after discovering #277 merged at
05:43:22 |

Direct cost: ~$4 of wasted API tokens on the second run, a confused
issue timeline, and a correction comment the maintainer had to read.

Classification: **structural** — the failure is deterministic. For any
`@tend-agent` mention that tend-mention handles by opening a PR with
`Refs #N` (no issue comment), the notifications skill will always miss
the dedup and produce a duplicate.

## Fix

Add a third dedup check for issue notifications: search the issue
timeline for `cross-referenced` events from bot-authored PRs created
after `NOTIF_UPDATED_AT`. GitHub emits these events when a PR body
references the issue (via `Refs #N`, `#N`, etc.), so this reliably
catches the tend-mention→PR path.

Verified against the real timeline for issue #276:

```
$ gh api "repos//issues/276/timeline" --jq '[.[] | select(.event == "cross-referenced") | {pr: .source.issue.number, author: .source.issue.user.login, created_at}]'
[{"pr":277,"author":"tend-agent","created_at":"2026-04-15T04:58:59Z"}, ...]
```

A dedup run at 05:40 with `NOTIF_UPDATED_AT=2026-04-15T04:54:37Z` would
have returned `length > 0` and correctly skipped.

## Gate assessment

- **Gate 1 (confidence)**: 1 occurrence today, classified **structural**
— one occurrence is sufficient per review-gates.md.
- **Gate 2 (magnitude)**: Targeted fix (one extra dedup query) — normal
evidence bar, met.

## Test plan

- [ ] Next `tend-notifications` run that processes an issue already
handled by `tend-mention` (via `Refs #N` PR) should skip and mark read
instead of opening a duplicate PR.
- [ ] Existing dedup on bot comments and PR reviews still works — the
new check is additive.

Co-authored-by: tend-agent <[email protected]>
Co-authored-by: Claude Opus 4.6 <[email protected]>
max-sixty pushed a commit that referenced this pull request May 2, 2026
…-check rationale (#364)

Surfaced by the rolling survey in `tend-nightly`. CLAUDE.md
skill-authoring guidance is explicit: "No specific past-run references.
Don't link GitHub Actions runs, cite session IDs, or quote durations
from individual incidents. They age into trivia and aren't useful when
the skill is reused."

The cross-reference timeline check rationale read `(observed in run
24438413763 which opened PR #278 duplicating PR #277)`. The structural
rule — the comments-only check misses bot-authored PRs that touch the
issue only via `Refs #N` in the body — survives without the run/PR
numbers.

## Test plan

Pure documentation; pytest suite green locally (`164 passed`). No
behavioral test feasible — the change is removing trivia from prose.

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.

Support skipping review on labeled PRs (e.g. tend:dismissed)

1 participant