Skip to content

Pattern miner: Add job-discriminator concurrency tip for mixed schedule/dispatch archetypes - #328

Merged
pelikhan merged 1 commit into
mainfrom
pattern-miner/job-discriminator-tip-efa0c1c1b4833660
Oct 11, 2026
Merged

pelikhan merged 1 commit into
mainfrom
pattern-miner/job-discriminator-tip-efa0c1c1b4833660

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

What was mined

Upstream repos mined: githubnext-agentics (workflows directory) and github-gh-aw (.github/aw/ docs), per data/import-sources.json.

Recurring pattern: concurrency.job-discriminator: ${{ github.event_name == 'schedule' && 'scheduled' || github.run_id }} — used on workflows that combine a recurring schedule trigger with an on-demand trigger (manual workflow_dispatch inputs or slash_command), so the two trigger paths don't cancel each other's in-flight runs via the compiler's default job-level concurrency group.

Evidence (3 upstream workflow files use this exact expression):

  • /tmp/gh-aw/data/upstream/githubnext-agentics/files/workflows/repo-assist.md (line 42) — schedule + slash_command + workflow_dispatch
  • /tmp/gh-aw/data/upstream/githubnext-agentics/files/workflows/multi-device-docs-tester.md (line 32) — schedule + workflow_dispatch with typed inputs
  • /tmp/gh-aw/data/upstream/githubnext-agentics/files/workflows/vex-generator.md (line 49) — workflow_dispatch only, but the same discriminator is applied defensively

This is corroborated by explicit upstream documentation describing job-discriminator as a gh-aw extension specifically meant to prevent "fan-out cancellations when multiple workflow instances run concurrently with different inputs":

  • /tmp/gh-aw/data/upstream/github-gh-aw/files/.github/aw/syntax-core.md (lines 122-145), which lists ${{ github.event_name == 'schedule' && 'scheduled' || github.run_id }} under "Dispatched or scheduled fallback" as a common expression.

Why the existing library didn't cover it

I checked /tmp/gh-aw/data/current-library.json and grepped patterns/ for job-discriminator and concurrency — neither term appears anywhere in patterns/manifest.json, patterns/workflow-generation.json, or any patterns/archetypes/*.json file before this change. The closest existing tips (pre-activation MAX_OPEN_PRS gating, skip-if-match) address duplicate-output accumulation, not the separate problem of GitHub Actions' default concurrency group cancelling a manually-dispatched or slash-command run because it collides with a scheduled run (or vice versa).

What changed

Two small, additive refinements (no new archetype, no structural changes):

  • patterns/archetypes/repo-maintainer.json: added a tip recommending job-discriminator for workflows combining schedule + slash_command/dispatch triggers, matching this archetype's own recommended_triggers (reaction, slash_command, schedule) and its direct upstream match repo-assist.md.
  • patterns/archetypes/responsive-docs-tester.json: added a tip recommending job-discriminator for this archetype's direct upstream match multi-device-docs-tester.md, which combines schedule with workflow_dispatch inputs.

No other fields (metadata, anti_patterns, trigger_combos, research_findings, degraded_workflows, success_rate, count, top_repos) were touched, and no new archetype file or manifest entry was added.

Validation

  • npm test — 329 tests passed across 19 test files (one harmless ENOENT warning from the CI step-summary reporter trying to write outside this sandbox; unrelated to the change).
  • npm run build — production build completed successfully (✓ built in 123ms), both modified archetype JSON files compiled into dist/patterns/archetypes/.

Candidates deliberately left out

  • Discussion task mining (discussion-task-miner.md): only one upstream workflow demonstrates scanning Discussions to extract actionable issues from them, and I found no second corroborating upstream workflow or explicit "recommended pattern" documentation describing discussion-to-issue task extraction as a named pattern (upstream docs only describe create-discussion as an output type, not scanning discussions as input for task mining). Per the mining process rule requiring at least two upstream examples or one plus explicit supporting documentation, this did not meet the bar for a new archetype.
  • "All You Can Eat" pattern (workflow-patterns.md lines 88-133): already fully captured by the existing backlog-drip archetype, whose tips match the documented shape (max:1, skip-if-match on stable marker, expires, learn-from-closed-output) almost verbatim.
  • status-comment: boolean/object config: a real, documented feature, but it's a generic cross-cutting default (auto-true for slash_command/label_command) rather than a recurring distinguishing shape tied to any one archetype, so it didn't rank as the single highest-value refinement for this run.
  • MAX_OPEN_PRS pre-activation gate: already represented in the library via the existing "Add a pre-activation step that skips scheduled runs once too many open PRs share your title prefix" tips on code-improvement, documentation-updater, and repo-maintainer.

Generated by Pattern Miner · copilot · auto · 112.9 AIC · ⌖ 21.2 AIC · ⊞ 8.3K · ◷

…hetypes

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@pelikhan
pelikhan marked this pull request as ready for review October 11, 2026 19:39
@pelikhan
pelikhan merged commit 914f83d into main Oct 11, 2026
1 check passed
@pelikhan
pelikhan deleted the pattern-miner/job-discriminator-tip-efa0c1c1b4833660 branch October 11, 2026 19:39

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reviewer kind: ponytail (content/documentation perspective) — this PR only touches patterns/archetypes/*.json data files, with no TypeScript/JS or UI code changes, so the "matt-pocock" lens didn't apply.

Reviewed the two additive tips (job-discriminator guidance for repo-maintainer and responsive-docs-tester):

  • Both are valid, well-cited JSON edits (correct trailing commas, no structural changes to other fields).
  • The recommended concurrency.job-discriminator expression and rationale are accurate and consistent with the archetypes' own recommended triggers (schedule + slash_command / workflow_dispatch).
  • Wording is clear and actionable for someone authoring a workflow from this archetype.

No blocking issues found — nothing to change here.

Generated by Specialist PR Review for #328 · copilot · auto · 14.4 AIC · ⌖ 4.26 AIC · ⊞ 7.9K

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