diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a23e18dad..accf52621 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -8,6 +8,7 @@ on: # All of .github, not just workflows: check-model-pins scans the whole dir. - '.github/**' - 'tests/**' + - 'docs/initiatives/agent-ingress-collapse-markets.md' # read by agent_ingress_markets_package.bats - 'prompts/**' - 'agents/**' - 'personas/**' @@ -25,6 +26,7 @@ on: paths: - 'scripts/**' - 'tests/**' + - 'docs/initiatives/agent-ingress-collapse-markets.md' # read by agent_ingress_markets_package.bats - 'prompts/**' - '.github/workflows/**' - '.github/**' # check-model-pins scans all of .github @@ -77,6 +79,7 @@ jobs: run: | scripts/run-bats.sh \ tests/test_duplicate_decl_gate.bats \ + tests/agent_ingress_markets_package.bats \ tests/test_vendored_installed_tools.bats \ tests/fleet_report.bats \ tests/fleet_stub_drift.bats \ diff --git a/AGENTS.md b/AGENTS.md index cfa459407..ad7b2e225 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -230,6 +230,10 @@ calling it a regression, and treat CI as authoritative.** agentic workflow compilation. It is not covered by the org template and must not be removed by template syncs. If the org template gains a `gh-aw-compile` equivalent, remove this exception and defer to the template instead. +- **Exception:** the `lint.yml` `paths:` filters (pull_request and push) carry the repo-specific entry + `docs/initiatives/agent-ingress-collapse-markets.md`, which is read by + `tests/agent_ingress_markets_package.bats` (#2038). It must not be removed as template drift on a sync; + without it, documentation-only edits to the package skip the suite that validates it. - **Exception:** `token-report.yml` (weekly Token Cost Observatory report) is a documented repo-specific workflow with no corresponding org template in `standards/workflows/`. It must not be removed by template syncs. If the org template gains a token-report equivalent, remove this exception and defer to the diff --git a/docs/initiatives/agent-ingress-collapse-markets.md b/docs/initiatives/agent-ingress-collapse-markets.md index f6f8e7994..499ee8ecf 100644 --- a/docs/initiatives/agent-ingress-collapse-markets.md +++ b/docs/initiatives/agent-ingress-collapse-markets.md @@ -45,7 +45,9 @@ of per-role Class-1 caller stubs on `main`, read live on 2026-09-29: The collapse is **behavior-preserving**: each job in the ingress copies its source stub's pin, `permissions:`, `secrets:`, and event subscription verbatim, -modulo the mechanical `on:`→union / per-role `if:` reconstruction below. +modulo the mechanical `on:`→union / per-role `if:` reconstruction below. The +one exception is the ADR-0010 concurrency re-rendering, which changes how +non-PR events are grouped for `pr-auto-review` and `pr-review` (stated in §4b). --- @@ -107,13 +109,14 @@ reconstructs that role's original subscription. > collapse must not silently "fix" a pin in the same change that moves it; the > corrections are separate follow-ups. > -> **Design-point flag — job-level `concurrency:` (see §4).** Three source stubs -> carry a *workflow-level* `concurrency:` block. A single collapsed workflow -> cannot host three workflow-level groups, so they are rendered as **job-level** -> `concurrency:` below. ADR-0007's enumerated ingress schema -> (`on:`/`permissions:`/`jobs:` with `uses`/`with`/`secrets`/`if`/`permissions`/ -> `name`) does **not** list `concurrency:`. This needs an explicit ruling before -> merge (§4). +> **Job-level `concurrency:` — ruled by ADR-0010, accepted (see §4).** Three +> source stubs carry a *workflow-level* `concurrency:` block. A single collapsed +> workflow cannot host three workflow-level groups, so they are rendered as +> **job-level** `concurrency:` below. ADR-0010 admits this one key into +> ADR-0007's ingress schema, with bounds. Each group is a role-prefixed literal +> head plus event-payload parts only, and each `cancel-in-progress` is a literal +> boolean. The `pr-auto-review` and `pr-review` blocks were re-rendered to those +> bounds (#2038). §4b states what this changes for non-PR events. ```yaml # ───────────────────────────────────────────────────────────────────────────── @@ -207,15 +210,16 @@ jobs: && contains(fromJSON('["submitted","dismissed"]'), github.event.action)) || github.event_name == 'check_suite' || github.event_name == 'workflow_run' - # Workflow-level concurrency in the source stub → job-level here (see §4). + # Workflow-level concurrency in the source stub → job-level here, bounded per + # ADR-0010. PR events keep their per-PR slot; check_suite / workflow_run + # share one slot per head SHA (no run_id — see §4b). concurrency: group: >- - ${{ - (github.event_name == 'pull_request' && format('pr-auto-review-ready-check-pr-{0}', github.event.pull_request.number)) - || (github.event_name == 'pull_request_review' && format('pr-auto-review-ready-check-pr-{0}', github.event.pull_request.number)) - || format('pr-auto-review-ready-check-unique-{0}', github.run_id) + pr-auto-review-ready-check-${{ + (github.event.pull_request.number && format('pr-{0}', github.event.pull_request.number)) + || format('sha-{0}', github.event.check_suite.head_sha || github.event.workflow_run.head_sha) }} - cancel-in-progress: ${{ github.event_name == 'pull_request' || github.event_name == 'pull_request_review' }} + cancel-in-progress: true permissions: pull-requests: read checks: read @@ -239,14 +243,17 @@ jobs: || (github.event_name == 'repository_dispatch' && github.event.action == 'pr-review-mention') ) && (github.event_name != 'check_suite' || github.event.check_suite.pull_requests[0] != null) + # Job-level concurrency, bounded per ADR-0010: payload parts only (no inputs.*, + # no run_id). A sweep with no PR shares the 'enumerate' slot. The fallback is + # NOT 'batch', because the pinned reusable declares pr-review-batch (§4b). concurrency: group: >- pr-review-${{ (github.event.pull_request && github.event.pull_request.number) || (github.event.check_suite && github.event.check_suite.pull_requests[0] && github.event.check_suite.pull_requests[0].number) - || inputs.pr_url + || github.event.inputs.pr_url || (github.event.client_payload && github.event.client_payload.pr_url) - || github.run_id + || 'enumerate' }} cancel-in-progress: true permissions: @@ -324,7 +331,7 @@ vars/secrets/needs/hashFiles/repo-identity/default_branch/standing-labels. --- -## 4. Design-point flag — job-level `concurrency:` needs a ruling +## 4. Job-level `concurrency:` — ruled: ADR-0010 (accepted) `pr-auto-review.yml`, `pr-review.yml`, and `ci-failure-analyst.yml` each carry a **workflow-level** `concurrency:` block in their source stubs; `dev-lead.yml` @@ -334,22 +341,109 @@ cancellation, so §3 renders each as a **job-level** `concurrency:` block — GitHub Actions supports job-level concurrency, and it preserves each role's grouping in isolation. -**The ruling needed:** ADR-0007's enumerated ingress schema is -`on:`/`permissions:`/`jobs:` (with `uses`/`with`/`secrets`/`if`/`permissions`/ -`name`). It does **not** enumerate `concurrency:`. Two readings: - -1. **Allow job-level `concurrency:`** as a non-logic, declarative grouping key - (it carries no `steps:`/`run:` and is not a repo-state reach) — the reading - §3 assumes, because dropping it would regress the duplicate-run collapse the - source stubs added (#1126, cancelled-runs fix). -2. **Forbid it** as outside the enumerated schema — which would force the - concurrency grouping down into each reusable. - -**Recommendation:** ratify reading (1) with a one-line schema addendum to -ADR-0007 (concurrency is a declarative grouping key, not logic). Do this -*before* the markets PR merges, so the ingress is not blocked on an unresolved -schema question. Reading (2) is viable but is a reusable change per role and -should not gate the pilot. +**The ruling (delivered):** +[ADR-0010](../architecture/adr/0010-ingress-job-level-concurrency-and-exhaustive-schema.md), +status **accepted** (Solution Architect ruling #2001, accepted in #2036). It +extends ADR-0007 without superseding it. It admits exactly one key, +`concurrency:`, into ADR-0007's ingress schema, with these bounds: + +- `group` reads only the event-payload surface a job-level `if:` may read. It is + checked by the same `viif_forbidden` predicate. +- `cancel-in-progress` is a literal boolean (`true` or `false`), never an + expression. +- Every result the group can begin with carries the role name as a prefix + (`-…`). +- The group does not match a group that the role's pinned reusable declares. + +ADR-0010 also records that ADR-0007's schema is an **exhaustive allowlist**. +This package therefore uses no `strategy:`, `env:` or `continue-on-error:`. The +ADR-0007 addendum this section used to recommend was not available, because an +accepted ADR is immutable. ADR-0010 is the delivered form of that reading. + +### 4a. Conformance of the §3 blocks + +| Role | `group` (leading literal) | `cancel-in-progress` | Pinned reusable's groups | Collision | +| --- | --- | --- | --- | --- | +| `pr-auto-review` | `pr-auto-review-ready-check-…` | `true` | none (`pr-auto-review-reusable.yml@pr-auto-review/v1-stable`) | none | +| `pr-review` | `pr-review-…` | `true` | `pr-review-pr-{…}`, `pr-review-batch` (`pr-review.yml@pr-review/stable`) | none (see the `enumerate` note in §4b) | +| `ci-failure-analyst` | `ci-failure-analyst-…` (unchanged) | `false` (unchanged) | none (`ci-failure-analyst-reusable.yml@7974717…`) | none | +| `dev-lead`, `pr-review-mention` | no caller block | — | — | — | + +Both guards pass on the §3 ingress as rendered: `scripts/validate-ingress-if.sh` +(event surface, role prefix, literal boolean) and +`scripts/validate-caller-inputs.sh` (no collision at the pinned ref). +`tests/agent_ingress_markets_package.bats` extracts the §3 YAML from this file +and runs both guards on it, so the package cannot drift out of conformance +unnoticed. + +### 4b. What changes versus the source stubs (the cost of dropping `run_id`) + +ADR-0010 forbids the `github.run_id` and `inputs.*` fallbacks. Without +`run_id`, an event that names no PR no longer gets its own slot that is never +cancelled. Each role resolves this as follows. + +**`pr-auto-review`.** The source stub used `pr-auto-review-ready-check-pr-` +for `pull_request` and `pull_request_review`, with cancel enabled. It gave every +`check_suite` and `workflow_run` event a unique `…-unique-` slot that was +never cancelled. + +- PR events are **unchanged**. They use `pr-auto-review-ready-check-pr-` with + `cancel-in-progress: true`. +- Non-PR events now **share one slot per commit**: + `pr-auto-review-ready-check-sha-`, keyed on + `check_suite.head_sha` or `workflow_run.head_sha`. Uniqueness is not kept in + the reusable, because `pr-auto-review-reusable.yml` declares no concurrency at + its pin. +- **Behavior change:** a later `check_suite` or `workflow_run` completion for + the **same head SHA** now cancels an in-flight readiness check for that SHA. + Before, both ran to completion. Events for different SHAs still run in + parallel. PR events and non-PR events still never share a slot (`pr-…` and + `sha-…`). +- **Why the cancellation is acceptable:** the readiness check only reads the + state of that commit. The later event sees at least as many completed checks, + so the cancelled run's answer was already stale. The visible cost is a + `cancelled` run in the Actions log when several suites complete close + together. +- **Why not `cancel-in-progress: false`:** the value is one literal for the + whole job. `false` would make PR events queue behind a run for a stale head + instead of superseding it, which changes the source stub's PR-event behavior. +- **Edge case:** a payload with no `head_sha` (not expected for these two + events) resolves to the single literal slot `pr-auto-review-ready-check-sha-`. + +**`pr-review`.** The source stub used +`pr-review-` +with cancel enabled. + +- Every event that names a PR is **unchanged**. That covers `pull_request`, + `pull_request_review`, `check_suite` (the `if:` already drops a check_suite + with no PR), `workflow_dispatch` with `pr_url`, and a `pr-review-mention` + dispatch with `client_payload.pr_url`. They use the same slot as before with + `cancel-in-progress: true`. For a `workflow_dispatch` run, + `github.event.inputs.pr_url` is the event payload and holds the value the + source stub read through the `inputs` context. The `inputs` context itself is + not read. +- A `workflow_dispatch` with no `pr_url` (a whole-repo sweep, including dry + runs), or a mention dispatch with no `client_payload.pr_url`, now **shares one + literal slot, `pr-review-enumerate`**. +- **Behavior change:** a later sweep now **cancels an in-flight sweep**, and the + latest request wins. Before, each sweep had a unique caller slot. Sweeps still + ran one at a time with one pending, through the reusable's own + `pr-review-batch` group (cancel off), so a second sweep queued instead of + cancelling the first. A dry-run sweep and a live sweep now cancel each other. + Do not start one while the other is in flight. +- **Uniqueness inside the reusable:** the reusable keeps its own per-PR and + per-SHA slots (`pr-review-pr-…`) and its `pr-review-batch` slot. Nothing is + added to it. +- **Why the fallback is `enumerate` and not `batch`:** a caller literal of + `batch` would resolve to `pr-review-batch`, the reusable's own group, and the + caller would queue behind or cancel its own nested run. The ADR-0010 stem check + would not catch that, because the stems `pr-review-` and `pr-review-batch` + differ. The regression test pins the `enumerate` literal. + +**`ci-failure-analyst`.** Unchanged: +`ci-failure-analyst-${{ github.event.check_run.head_sha }}` with +`cancel-in-progress: false`. It already conformed, so its behavior does not +change. --- @@ -461,8 +555,11 @@ performed here. 3. **Run the #1725 if-linter** over `agent-ingress.yml` — every job `if:` must pass as a pure event filter (validates the three "ALLOW-consistent" predicates in §3a). -4. **Resolve the §4 concurrency ruling** — job-level `concurrency:` must be - ratified (or the blocks removed and pushed into the reusables) before merge. +4. **§4 concurrency ruling — ratified** (ADR-0010, accepted). Job-level + `concurrency:` is permitted within ADR-0010's bounds. Re-run + `validate-ingress-if.sh` and `validate-caller-inputs.sh` over + `agent-ingress.yml`. Both must pass: bounded groups, literal + `cancel-in-progress`, no collision with a group the pinned reusable declares. 5. **Confirm byte-identity** of each job block against the canonical agent-ingress template once published (§9) via `caller_stub_freeze.sh` / `fleet_monitor.sh` role-path. @@ -484,7 +581,9 @@ can block a merge: Both `agent-ingress.yml` and the old stubs fire → each role runs *twice* per event. Wasteful and log-noisy, but not a correctness or gating failure (agentic roles are idempotent per-head-SHA; `pr-review`/`pr-auto-review` concurrency - groups collapse duplicates). **Rollback:** revert the ingress add; the stubs + groups collapse duplicates only where the old and new groups coincide — PR-keyed + events; the old `check_suite`/`workflow_run` stub groups were unique per run, so + those events may still double-run in this window). **Rollback:** revert the ingress add; the stubs alone resume normal single dispatch. - **State B — stubs deleted, ingress not yet added (coverage gap window).** No event-driven agent runs in markets until the ingress lands. No required @@ -554,6 +653,10 @@ its owner. Activation lands after the markets PR merges and the canonical template is published — this package hands both artifacts to that follow-up. +The Bats ingress checks use trimmed reusable snapshots. Changes to checked +inputs or concurrency declarations behind channel refs are not detected until +the snapshots are refreshed. + --- ## 10. Companion issue for `petry-projects/markets` (prepared; filing is remaining) @@ -586,7 +689,8 @@ docs/initiatives/agent-ingress-collapse-markets.md atomic ruleset rename in §8d in the same PR. - Run the #1725 if-linter over agent-ingress.yml (every job if: is a pure event filter — §3a). -- Confirm the §4 job-level concurrency ruling is ratified. +- The §4 job-level concurrency ruling is ratified (ADR-0010, accepted). Confirm + validate-ingress-if.sh and validate-caller-inputs.sh pass on agent-ingress.yml. - Keep the 6 carve-out stubs (§2b) and both required-gate stubs (§2c) untouched. ## Known follow-ups (do NOT bundle into this PR — §5) @@ -610,6 +714,6 @@ docs/initiatives/agent-ingress-collapse-markets.md | Companion issue filed in markets | **Prepared, not filed** | Cross-repo write from `.github-private` not available in this run. Body is committed in §10. | | Canonical `agent-ingress.yml` template published | **Deferred (§9b)** | Write to `petry-projects/.github`; cross-repo. | | `STUB_REGISTRY` rows activated in fleet_monitor.sh | **Prepared, not applied (§9a)** | Would 404 against an unpublished canonical path and can't be ALIGNED-verified pre-collapse (§9c). | -| §4 job-level concurrency schema ruling | **Flagged, needs decision** | ADR-0007 schema doesn't enumerate `concurrency:`; recommendation is reading (1). | +| §4 job-level concurrency schema ruling | **Ratified — ADR-0010, accepted** | ADR-0010 admits bounded job-level `concurrency:`. §3 was re-rendered to the bounds (#2038), and §4b states the non-PR-event behavior change. | | pin corrections (§5a/§5b) | **Named, not applied** | Behavior-preserving collapse must not change pins; separate follow-ups. | | Dedicated baseline doc at the brief's cited path | **Does not exist (§1)** | Not fabricated; real baseline is the reference file + live stubs. | diff --git a/tests/agent_ingress_markets_package.bats b/tests/agent_ingress_markets_package.bats new file mode 100644 index 000000000..8ac8ac61e --- /dev/null +++ b/tests/agent_ingress_markets_package.bats @@ -0,0 +1,122 @@ +#!/usr/bin/env bats +# Regression test for the markets collapse package (#2038, ADR-0010): the §3 +# `agent-ingress.yml` in docs/initiatives/agent-ingress-collapse-markets.md must +# pass BOTH ingress guards as rendered, so the package cannot drift back to a +# non-conforming concurrency block (run_id / inputs.* fallbacks, expression +# cancel-in-progress). The §3 YAML is extracted from the doc itself — the test +# reads the package, not a copy of it. +# +# The pinned reusables are resolved from trimmed snapshots +# (tests/fixtures/agent-ingress/markets-pinned-reusables/) via VCI_RESOLVE_DIR so +# the collision check is deterministic and offline. Changes to checked inputs or +# concurrency declarations behind channel refs are not fetched; refresh the +# snapshots to test those changes. + +SCRIPT_DIR="$(cd "$(dirname "$BATS_TEST_FILENAME")/.." && pwd)" +PACKAGE="$SCRIPT_DIR/docs/initiatives/agent-ingress-collapse-markets.md" +SNAPSHOTS="$SCRIPT_DIR/tests/fixtures/agent-ingress/markets-pinned-reusables" + +setup() { + ROOT="$(mktemp -d)" || { echo "Failed to create temp dir" >&2; return 1; } + mkdir -p "$ROOT/.github/workflows" + INGRESS="$ROOT/.github/workflows/agent-ingress.yml" + # The first ```yaml fence after the "## 3." heading is the §3 ingress. + awk ' + /^## 3\./ { in3 = 1; next } + in3 && /^## / { exit } + in3 && !open && /^```yaml$/ { open = 1; next } + open && /^```$/ { exit } + open { print } + ' "$PACKAGE" > "$INGRESS" +} + +teardown() { + rm -rf "$ROOT" +} + +@test "markets §3: the ingress block is extracted and declares the five role jobs" { + [ -s "$INGRESS" ] + run yq -r '.jobs | keys | sort | join(",")' "$INGRESS" + [ "$status" -eq 0 ] + [ "$output" = "ci-failure-analyst,dev-lead,pr-auto-review,pr-review,pr-review-mention" ] +} + +@test "markets §3: validate-ingress-if.sh passes (pure if:, bounded concurrency)" { + VIIF_ROOT="$ROOT" run bash "$SCRIPT_DIR/scripts/validate-ingress-if.sh" + echo "$output" + [ "$status" -eq 0 ] + [[ "$output" == *"ingress-if: OK"* ]] +} + +@test "markets §3: every snapshot's recorded uses: target is still the ingress's pin (PINNED-USES)" { + local uses rec n=0 + for rec in "$SNAPSHOTS"/*.yml; do + uses="$(sed -n 's/^# PINNED-USES: //p' "$rec")" + yq '.jobs[].uses' "$INGRESS" | grep -qxF "$uses" + n=$((n + 1)) + done + [ "$n" -ge 4 ] +} + +@test "markets §3: each role job uses the target recorded in its own snapshot" { + local expected + expected="$(sed -n 's/^# PINNED-USES: //p' "$SNAPSHOTS/pr-auto-review-reusable.yml")" + [ -n "$expected" ] + [ "$(yq -r '.jobs["pr-auto-review"].uses' "$INGRESS")" = "$expected" ] + + expected="$(sed -n 's/^# PINNED-USES: //p' "$SNAPSHOTS/ci-failure-analyst-reusable.yml")" + [ -n "$expected" ] + [ "$(yq -r '.jobs["ci-failure-analyst"].uses' "$INGRESS")" = "$expected" ] +} + +@test "markets §3: validate-caller-inputs.sh passes against the pinned reusables (no collision)" { + VCI_ROOT="$ROOT" VCI_RESOLVE_DIR="$SNAPSHOTS" run bash "$SCRIPT_DIR/scripts/validate-caller-inputs.sh" + echo "$output" + [ "$status" -eq 0 ] + [[ "$output" == *"pr-review' concurrency group does not collide"* ]] + [[ "$output" == *"pr-auto-review' concurrency group does not collide"* ]] + [[ "$output" == *"ci-failure-analyst' concurrency group does not collide"* ]] +} + +@test "markets §3: every concurrency group is role-prefixed and every cancel-in-progress is a literal boolean" { + source "$SCRIPT_DIR/scripts/validate-ingress-if.sh" + local job group cancel stem n=0 + for job in pr-auto-review pr-review ci-failure-analyst; do + IFS=$'\x1f' read -r group cancel < <(viif_job_concurrency "$INGRESS" "$job") + [ -n "$group" ] + [[ "$cancel" == "true" || "$cancel" == "false" ]] + while IFS= read -r stem; do + [[ "$stem" == "$job"-* ]] + n=$((n + 1)) + done < <(viif_group_stems "$group") + done + [ "$n" -ge 3 ] +} + +@test "markets §3: no group falls back to github.run_id or the inputs.* context" { + run yq '.jobs[].concurrency.group // ""' "$INGRESS" + [ "$status" -eq 0 ] + [[ "$output" != *"run_id"* ]] + # github.event.inputs.* is the workflow_dispatch payload; a bare inputs.* is not. + ! printf '%s\n' "$output" | grep -Eq '(^|[^.[:alnum:]_])inputs\.' +} + +@test "markets §3: pr-review's shared fallback slot is not the reusable's pr-review-batch" { + # The collision check compares literal stems (a tripwire, ADR-0010). A caller + # fallback of 'batch' would resolve to the reusable's own 'pr-review-batch' + # group while passing the stem check, so pin the chosen literal here. + run yq '.jobs["pr-review"].concurrency.group' "$INGRESS" + [ "$status" -eq 0 ] + [[ "$output" == pr-review-* ]] + [[ "$output" != *"'batch'"* ]] + # PR-identity branches must stay, in order, ahead of the 'enumerate' fallback. + local re="pull_request\\.number.*check_suite\\.pull_requests\\[0\\]\\.number.*inputs\\.pr_url.*client_payload\\.pr_url.*'enumerate'" + printf '%s' "$output" | tr '\n' ' ' | grep -Eq "$re" +} + +@test "markets §3: ci-failure-analyst concurrency is unchanged" { + run yq -r '.jobs["ci-failure-analyst"].concurrency.group' "$INGRESS" + [ "$output" = 'ci-failure-analyst-${{ github.event.check_run.head_sha }}' ] + run yq '.jobs["ci-failure-analyst"].concurrency["cancel-in-progress"]' "$INGRESS" + [ "$output" = "false" ] +} diff --git a/tests/fixtures/agent-ingress/markets-pinned-reusables/ci-failure-analyst-reusable.yml b/tests/fixtures/agent-ingress/markets-pinned-reusables/ci-failure-analyst-reusable.yml new file mode 100644 index 000000000..f393b504f --- /dev/null +++ b/tests/fixtures/agent-ingress/markets-pinned-reusables/ci-failure-analyst-reusable.yml @@ -0,0 +1,15 @@ +# PINNED-USES: petry-projects/.github-private/.github/workflows/ci-failure-analyst-reusable.yml@79747178007d3238bb3afddf7f4d952a293987bd +# SNAPSHOT (trimmed) of petry-projects/.github-private +# .github/workflows/ci-failure-analyst-reusable.yml @ 79747178007d3238bb3afddf7f4d952a293987bd, +# read 2026-10-02 for #2038. The reusable declares NO concurrency group at +# workflow or job level; the markets caller forwards no with: inputs. +name: CI Failure Analyst (reusable) + +on: + workflow_call: {} + +jobs: + analyze: + runs-on: ubuntu-latest + steps: + - run: echo snapshot diff --git a/tests/fixtures/agent-ingress/markets-pinned-reusables/dev-lead-reusable.yml b/tests/fixtures/agent-ingress/markets-pinned-reusables/dev-lead-reusable.yml new file mode 100644 index 000000000..a76463e43 --- /dev/null +++ b/tests/fixtures/agent-ingress/markets-pinned-reusables/dev-lead-reusable.yml @@ -0,0 +1,20 @@ +# PINNED-USES: petry-projects/.github-private/.github/workflows/dev-lead-reusable.yml@dev-lead/v139-stable +# SNAPSHOT (trimmed) of petry-projects/.github-private +# .github/workflows/dev-lead-reusable.yml @ dev-lead/v139-stable, read 2026-10-02 +# for #2038. Only the agent_ref input the markets caller forwards is kept; the +# markets dev-lead job declares no caller concurrency group. +name: Dev-Lead (reusable) + +on: + workflow_call: + inputs: + agent_ref: + type: string + required: false + default: "" + +jobs: + dispatch: + runs-on: ubuntu-latest + steps: + - run: echo snapshot diff --git a/tests/fixtures/agent-ingress/markets-pinned-reusables/pr-auto-review-reusable.yml b/tests/fixtures/agent-ingress/markets-pinned-reusables/pr-auto-review-reusable.yml new file mode 100644 index 000000000..9da8a97e4 --- /dev/null +++ b/tests/fixtures/agent-ingress/markets-pinned-reusables/pr-auto-review-reusable.yml @@ -0,0 +1,15 @@ +# PINNED-USES: petry-projects/.github/.github/workflows/pr-auto-review-reusable.yml@pr-auto-review/v1-stable +# SNAPSHOT (trimmed) of petry-projects/.github +# .github/workflows/pr-auto-review-reusable.yml @ pr-auto-review/v1-stable, +# read 2026-10-02 for #2038. The reusable declares NO concurrency group at +# workflow or job level; the markets caller forwards no with: inputs. +name: PR Auto Review (reusable) + +on: + workflow_call: {} + +jobs: + ready-check: + runs-on: ubuntu-latest + steps: + - run: echo snapshot diff --git a/tests/fixtures/agent-ingress/markets-pinned-reusables/pr-review.yml b/tests/fixtures/agent-ingress/markets-pinned-reusables/pr-review.yml new file mode 100644 index 000000000..7b47cdaf6 --- /dev/null +++ b/tests/fixtures/agent-ingress/markets-pinned-reusables/pr-review.yml @@ -0,0 +1,58 @@ +# PINNED-USES: petry-projects/.github-private/.github/workflows/pr-review.yml@pr-review/stable +# SNAPSHOT (trimmed) of petry-projects/.github-private +# .github/workflows/pr-review.yml @ pr-review/stable (776c9585c8fff87a1ffefd469137791ab6467e61), +# read 2026-10-02 for #2038. Only the parts the two ingress guards read are kept: +# the workflow_call inputs (validate-caller-inputs.sh) and the workflow-level +# concurrency group verbatim (the ADR-0010 collision rule). Re-snapshot if the +# markets §3 pin moves. +name: PR Review Agent + +on: + workflow_call: + inputs: + agent_ref: + type: string + required: false + default: "" + pr_url: + type: string + required: false + default: "" + dry_run: + type: string + required: false + default: "" + force_review: + type: string + required: false + default: "" + +concurrency: + group: >- + ${{ + (inputs.pr_url + || github.event.client_payload.pr_url + || (github.event.pull_request.number && format('{0}/pull/{1}', github.repository, github.event.pull_request.number)) + || (github.event.check_suite.pull_requests[0].number && format('{0}/pull/{1}', github.repository, github.event.check_suite.pull_requests[0].number))) + && format('pr-review-pr-{0}{1}', + inputs.pr_url + || github.event.client_payload.pr_url + || (github.event.pull_request.number && format('{0}/pull/{1}', github.repository, github.event.pull_request.number)) + || (github.event.check_suite.pull_requests[0].number && format('{0}/pull/{1}', github.repository, github.event.check_suite.pull_requests[0].number)), + (github.event.pull_request.head.sha + || github.event.check_suite.head_sha + || github.event.client_payload.sha) + && format('-{0}', + github.event.pull_request.head.sha + || github.event.check_suite.head_sha + || github.event.client_payload.sha) + || '') + || 'pr-review-batch' + }} + cancel-in-progress: false + +jobs: + review: + runs-on: ubuntu-latest + steps: + - run: echo snapshot