Skip to content

chore: sync workflow templates - #5216

Closed
stranske wants to merge 1 commit into
phase-3from
sync/workflows-1e3e9c91aafb
Closed

chore: sync workflow templates#5216
stranske wants to merge 1 commit into
phase-3from
sync/workflows-1e3e9c91aafb

Conversation

@stranske

@stranske stranske commented May 4, 2026

Copy link
Copy Markdown
Owner

Sync Summary

Files Updated

  • autofix.yml: Autofix workflow - automatically fixes lint/format issues
  • agents-80-pr-event-hub.yml: PR event hub - consolidates PR meta, bot comments, and verify-to-issue handlers
  • agents-81-gate-followups.yml: Gate followups hub - consolidates keepalive and autofix followups
  • agents-keepalive-loop-reporter.yml: Keepalive reporter - posts summary when keepalive run fails or cancels
  • agents-autofix-dispatcher.yml: Autofix dispatch bridge - listens for Gate repository_dispatch events and triggers the autofix loop
  • agents-verifier.yml: Verifier - validates agent work meets acceptance criteria
  • agents-auto-label.yml: Auto-label - suggests/applies labels based on semantic matching (Phase 5A)
  • agents-guard.yml: Agents guard - enforces agents workflow protections (Health 45)
  • agents-auto-pilot.yml: Auto-pilot - end-to-end automation orchestrator (format → optimize → agent → verify)
  • state_fingerprint.py: Computes workflow state fingerprints for unchanged-state skip gates
  • sync_test_dependencies.py: Syncs test dependency pins - required by reusable CI workflow
  • detect-changes.js: Detects changed files for CI path-based filtering
  • keepalive_orchestrator_gate_runner.js: Orchestrator gate runner for keepalive
  • gate_summary.py: Gate summary renderer - generates PR gate check summary
  • path-classification.yml: Path classification config used by the path-classifier composite action
  • agent-event-eligibility/ (2 files): Agent event eligibility action - early no-op gate for agent workflows
  • path-classifier/ (2 files): Classifies changed PR paths for path-aware expensive job gating
  • LABELS.md: Label definitions and usage
  • CODEX_TOKEN_REFRESH.md: Codex OAuth token refresh guide
  • WORKFLOW_USER_GUIDE.md: Workflow user guide - explains the CI/agent system for repo consumers
  • removed consumer/.github/workflows/agents-pr-meta.yml: Remove deprecated PR metadata template workflow past the 2026-02-15 removal deadline (replaced by agents-80-pr-event-hub.yml)
  • removed consumer/.github/workflows/agents-keepalive-loop.yml: Remove deprecated keepalive loop template workflow past the 2026-02-15 removal deadline (replaced by agents-81-gate-followups.yml)
  • removed consumer/.github/workflows/agents-autofix-loop.yml: Remove deprecated autofix loop template workflow past the 2026-02-15 removal deadline (replaced by agents-81-gate-followups.yml)
  • removed consumer/.github/workflows/agents-bot-comment-handler.yml: Remove deprecated bot comment handler template workflow past the 2026-02-15 removal deadline (replaced by agents-80-pr-event-hub.yml)
  • removed consumer/.github/workflows/agents-verify-to-issue.yml: Remove deprecated verify-to-issue v1 template workflow past the 2026-02-15 removal deadline (replaced by agents-80-pr-event-hub.yml)
  • removed consumer/.github/workflows/agents-verify-to-issue-v2.yml: Remove deprecated verify-to-issue v2 template workflow past the 2026-02-15 removal deadline (replaced by agents-80-pr-event-hub.yml)

Files Skipped

  • pr-00-gate.yml: File exists and sync_mode is create_only
  • ci.yml: File exists and sync_mode is create_only
  • dependabot.yml: File exists and sync_mode is create_only
  • AGENTS.md: Repo keeps historical Agents.md casing to avoid case-only path conflicts
  • llm_slots.json: None

Review Checklist

  • CI passes with updated workflows
  • No repo-specific customizations were overwritten

Source: stranske/Workflows
Source SHA: 88aaa4f4dfde4c4c0f3c68fcc286709cea127eca
Template hash: 1e3e9c91aafb
Sync branch: sync/workflows-1e3e9c91aafb
Consumer repo: stranske/Trend_Model_Project
Manifest: .github/sync-manifest.yml

Automated sync from stranske/Workflows
Template hash: 1e3e9c91aafb

Changes synced from sync-manifest.yml
Copilot AI review requested due to automatic review settings May 4, 2026 23:47
@stranske stranske added sync Automated sync from Workflows automated Automated sync from Workflows labels May 4, 2026
@stranske
stranske temporarily deployed to agent-standard May 4, 2026 23:47 — with GitHub Actions Inactive
@stranske-keepalive

Copy link
Copy Markdown
Contributor

Health 45 Agents Guard stopped this pull request.

What we found

  • • .github/workflows/agents-autofix-loop.yml was deleted.
  • • .github/workflows/agents-bot-comment-handler.yml was deleted.
  • • .github/workflows/agents-keepalive-loop.yml was deleted.
  • • .github/workflows/agents-verify-to-issue-v2.yml was deleted.

Next steps

  • Restore the deleted or renamed workflows. These files cannot be moved or removed.
  • Push an update or re-run this workflow after addressing the issues.

Files seen in this run

  • .github/workflows/agents-80-pr-event-hub.yml (modified)
  • .github/workflows/agents-81-gate-followups.yml (modified)
  • .github/workflows/agents-auto-label.yml (modified)
  • .github/workflows/agents-auto-pilot.yml (modified)
  • .github/workflows/agents-autofix-dispatcher.yml (modified)
  • .github/workflows/agents-autofix-loop.yml (removed)
  • .github/workflows/agents-bot-comment-handler.yml (removed)
  • .github/workflows/agents-guard.yml (modified)
  • .github/workflows/agents-keepalive-loop-reporter.yml (modified)
  • .github/workflows/agents-keepalive-loop.yml (removed)
  • .github/workflows/agents-pr-meta.yml (removed)
  • .github/workflows/agents-verifier.yml (modified)
  • .github/workflows/agents-verify-to-issue-v2.yml (removed)
  • .github/workflows/agents-verify-to-issue.yml (removed)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5f692280c1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

expected-labels: >-
agent:auto,agent:codex,agent:claude,agent:copilot,
agents:auto-pilot,agents:keepalive
expected-actions: opened,synchronize,labeled

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Include all guard-triggered actions in eligibility gate

Expand the expected-actions list here to cover every action this workflow subscribes to (reopened, ready_for_review, and unlabeled), otherwise those events are always denied by agent-event-eligibility and the guard steps never run. That means the safety/status logic is skipped on legitimate guard triggers (for example, reopening a PR or removing an agent label), which can leave protected-file enforcement and guard status stale.

Useful? React with 👍 / 👎.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR syncs the repository’s GitHub Actions “consumer” workflows and supporting scripts/docs from stranske/Workflows (SHA 88aaa4f4dfde4c4c0f3c68fcc286709cea127eca), consolidating several deprecated agent workflows into the newer “event hub” + “gate followups” architecture while adding new gating primitives (event eligibility + state fingerprinting) to reduce unnecessary runs.

Changes:

  • Replaces legacy standalone agent workflows (PR meta, keepalive loop, autofix loop, verify-to-issue) with consolidated workflows: agents-80-pr-event-hub.yml and agents-81-gate-followups.yml.
  • Introduces state fingerprint gating (scripts/state_fingerprint.py) and applies it to agent workflows to skip unchanged-state re-runs.
  • Adds reusable composite actions/config for path classification and event eligibility; updates docs to reference the new consolidated workflows.

Reviewed changes

Copilot reviewed 28 out of 28 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
WORKFLOW_USER_GUIDE.md Updates troubleshooting references to consolidated workflows.
scripts/sync_test_dependencies.py Updates stdlib allowlist used for dependency syncing.
scripts/state_fingerprint.py Adds a new helper for workflow “unchanged-state” fingerprint gating.
docs/LABELS.md Updates workflow references for label-driven automation.
docs/CODEX_TOKEN_REFRESH.md Updates token refresh verification command to new workflow entrypoint.
.github/workflows/autofix.yml Adds event eligibility gating and safer job outputs for skipped context.
.github/workflows/agents-verify-to-issue.yml Removes deprecated legacy verify-to-issue workflow.
.github/workflows/agents-verify-to-issue-v2.yml Removes deprecated v2 verify-to-issue workflow (replaced by event hub).
.github/workflows/agents-verifier.yml Adds state fingerprint gate to avoid redundant verifier runs.
.github/workflows/agents-pr-meta.yml Removes deprecated PR meta workflow (replaced by event hub).
.github/workflows/agents-keepalive-loop.yml Removes deprecated keepalive loop workflow (replaced by gate followups).
.github/workflows/agents-keepalive-loop-reporter.yml Adds state fingerprint gating to reduce duplicate reporter posts.
.github/workflows/agents-guard.yml Adds event eligibility gating to avoid unnecessary guard runs.
.github/workflows/agents-bot-comment-handler.yml Removes deprecated bot-comment handler workflow (replaced by event hub).
.github/workflows/agents-autofix-loop.yml Removes deprecated autofix loop workflow (replaced by gate followups).
.github/workflows/agents-autofix-dispatcher.yml Converts dispatcher into an acknowledgement/bridge for consolidated handling.
.github/workflows/agents-auto-pilot.yml Routes orchestration dispatches to consolidated workflows and adds eligibility gating.
.github/workflows/agents-auto-label.yml Adjusts issue triggers and adds eligibility gating to avoid bot-trigger loops.
.github/workflows/agents-81-gate-followups.yml Consolidates keepalive/autofix followups and adds state fingerprint gating.
.github/workflows/agents-80-pr-event-hub.yml Adds event eligibility gating and conditions for consolidated handlers.
.github/scripts/keepalive_orchestrator_gate_runner.js Enhances keepalive gate runner (label self-heal, draft disposition handling, gate run inspection).
.github/scripts/gate_summary.py Adds python_required support for path-classifier-driven gating.
.github/scripts/detect-changes.js Hardens changed-file classification input handling and makes rate-limit wrapper best-effort.
.github/path-classification.yml Adds repo path classification configuration for workflow gating.
.github/actions/path-classifier/action.yml Adds composite action for classifying changed paths into categories.
.github/actions/path-classifier/classify.js Implements path classification logic for the composite action.
.github/actions/agent-event-eligibility/action.yml Adds composite action for early event eligibility gating.
.github/actions/agent-event-eligibility/eligibility.js Implements custom predicate evaluation + allow/deny gates for events/actors/labels.
Comments suppressed due to low confidence (1)

.github/workflows/agents-81-gate-followups.yml:970

  • attemptCount is now derived from prior runs of agents-81-gate-followups.yml. Since this workflow also handles non-autofix followups (and can run multiple times per head SHA for reasons unrelated to an autofix attempt), this risks inflating the autofix attempt counter and hitting the max-attempts gate prematurely. Consider tracking autofix attempts separately (e.g., via a dedicated marker/comment/variable) or filtering runs to only those that actually executed the autofix path.
            const workflowFile = 'agents-81-gate-followups.yml';
            // Reduce attempts for auto-escalated PRs (they weren't agent-initiated)
            const isEscalated = labels.includes('autofix:escalated');
              const maxAttempts = isEscalated
                ? Math.min(2, Number(outputs.max_attempts))
                : Number(outputs.max_attempts);
            const previousRuns = await paginateWithRetry(github.rest.actions.listWorkflowRuns, {
              owner,
              repo,
              workflow_id: workflowFile,
              head_sha: run.head_sha,
              per_page: 100,
              status: 'completed',

try {
github = await ensureRateLimitWrapped({ github: rawGithub, core, env: process.env });
} catch (error) {
core?.warning?.(`Failed to enable rate-limit wrapper for detect-changes: ${error.message}`);
required: false
default: ''
custom-predicate:
description: JMESPath-style predicate evaluated against the event payload. Must be truthy when supplied.
Comment on lines +156 to +159

if not payload:
return None
return json.loads(payload)
return args.func(args)
except RuntimeError as exc:
print(str(exc), file=sys.stderr)
return 1
Comment on lines +40 to +113
def compute_fingerprint(workflow_name: str, inputs: dict[str, Any]) -> str:
payload = {
"workflow": workflow_name,
"inputs": inputs,
"version": MARKER_VERSION,
}
canonical = json.dumps(payload, sort_keys=True, separators=(",", ":"), ensure_ascii=True)
return hashlib.sha256(canonical.encode("utf-8")).hexdigest()


def compare_fingerprint(
workflow_name: str,
current_inputs: dict[str, Any],
storage: FingerprintStorage,
) -> Decision:
current_hash = compute_fingerprint(workflow_name, current_inputs)
prior_hash = storage.read_fingerprint(workflow_name)

if prior_hash is None:
return Decision(True, "no-prior-fingerprint", current_hash, None)
if prior_hash == current_hash:
return Decision(False, "fingerprint-match", current_hash, prior_hash)
return Decision(True, "fingerprint-changed", current_hash, prior_hash)


def store_fingerprint(
workflow_name: str,
fingerprint_hash: str,
storage: FingerprintStorage,
) -> None:
storage.write_fingerprint(workflow_name, fingerprint_hash)


def _utc_now() -> str:
return dt.datetime.now(dt.UTC).replace(microsecond=0).isoformat().replace("+00:00", "Z")


def _marker_re(workflow_name: str) -> re.Pattern[str]:
escaped = re.escape(workflow_name)
return re.compile(
rf"<!--\s*{MARKER_PREFIX}:{escaped}:{MARKER_VERSION}\s+(\{{.*?\}})\s*-->",
re.DOTALL,
)


def _build_marker(workflow_name: str, fingerprint_hash: str) -> str:
payload = {"hash": fingerprint_hash, "ts": _utc_now()}
return (
f"<!-- {MARKER_PREFIX}:{workflow_name}:{MARKER_VERSION} "
f"{json.dumps(payload, sort_keys=True, separators=(',', ':'))} -->"
)


def _extract_hash(value: str | None, workflow_name: str) -> str | None:
if not value:
return None

candidates: list[str] = []
marker_match = _marker_re(workflow_name).search(value)
if marker_match:
candidates.append(marker_match.group(1))
stripped = value.strip()
if stripped.startswith("{"):
candidates.append(stripped)

for candidate in candidates:
try:
payload = json.loads(candidate)
except json.JSONDecodeError:
continue
fingerprint_hash = payload.get("hash") if isinstance(payload, dict) else None
if isinstance(fingerprint_hash, str) and re.fullmatch(r"[0-9a-f]{64}", fingerprint_hash):
return fingerprint_hash
return None
Comment on lines +250 to +260
diff_surface = [
{
"filename": item.get("filename", ""),
"status": item.get("status", ""),
"sha": item.get("sha", ""),
"additions": item.get("additions", 0),
"deletions": item.get("deletions", 0),
"changes": item.get("changes", 0),
}
for item in files
]
@stranske

stranske commented May 5, 2026

Copy link
Copy Markdown
Owner Author

Closing as stale because a newer sync workflow templates PR exists for this repository in the current cleanup campaign.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automated Automated sync from Workflows sync Automated sync from Workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants