Skip to content

fix(gh-aw): enforce activation agent bindings - #1865

Merged
bradygaster merged 4 commits into
devfrom
bradygaster-1801-binding-guard-wave
Aug 24, 2026
Merged

fix(gh-aw): enforce activation agent bindings#1865
bradygaster merged 4 commits into
devfrom
bradygaster-1801-binding-guard-wave

Conversation

@bradygaster

@bradygaster bradygaster commented Aug 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • emit machine-readable task/epic bindings in activation artifacts
  • validate actual issue labels in a read-only post-run workflow
  • fail closed on malformed, missing, empty, inconsistent, or unresolvable activation evidence

Tests

  • focused Vitest: 19 passed
  • gh aw compile workflows/squad.md reached workflow-reference validation, then hit the pre-existing missing local squad-implement-worker dependency

Working as Procedures (Prompt Engineer).

Closes #1801

Closes #1801

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings August 24, 2026 23:11
@github-actions

Copy link
Copy Markdown
Contributor

🟡 Impact Analysis — PR #1865

Risk tier: 🟡 MEDIUM

📊 Summary

Metric Count
Files changed 5
Files added 3
Files modified 2
Files deleted 0
Modules touched 4

🎯 Risk Factors

  • 5 files changed (≤5 → LOW)
  • 4 modules touched (2-4 → MEDIUM)

📦 Modules Affected

ci-workflows (1 file)
  • .github/workflows/squad-agent-binding-check.yml
root (2 files)
  • workflows/shared/squad-planning-ontology.md
  • workflows/squad.md
scripts (1 file)
  • scripts/check-agent-binding.mjs
tests (1 file)
  • test/check-agent-binding.test.ts

This report is generated automatically for every PR. See #733 for details.

@github-actions

github-actions Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

🛫 PR Readiness Check

ℹ️ This comment updates on each push. Last checked: commit d85c21b

PR Scope: 🔧 Infrastructure

⚠️ 2 item(s) to address before review

Status Check Details
Single commit 4 commits — consider squashing before review
Not in draft Ready for review
Branch up to date Up to date with dev
Copilot review No Copilot review yet — it may still be processing
Changeset present No source files changed — changeset not required
Scope clean No .squad/ or docs/proposals/ files
No merge conflicts No merge conflicts
Copilot threads resolved 2 active Copilot thread(s) resolved (3 outdated skipped)
CI passing All checks passing

Files Changed (5 files, +628 −5)

File +/−
.github/workflows/squad-agent-binding-check.yml +52 −0
scripts/check-agent-binding.mjs +234 −0
test/check-agent-binding.test.ts +315 −0
workflows/shared/squad-planning-ontology.md +13 −0
workflows/squad.md +14 −5

Total: +628 −5


This check runs automatically on every push. Fix any ❌ items and push again.
See CONTRIBUTING.md and PR Requirements for details.

@github-actions

Copy link
Copy Markdown
Contributor

🏗️ Architectural Review

⚠️ Architectural review: 1 info.

Severity Category Finding Files
ℹ️ info template-sync Template files changed in .github/workflows/ but not in other template locations. If these templates should stay in sync, consider updating the others too. Changed: .github/workflows/, Unchanged: templates/, .squad-templates/, packages/squad-cli/templates/

Automated architectural review — informational only.

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.

🟡 Changes recommended

The new workflow should pin/setup the Node version for deterministic execution, and the @copilot label policy enforced by the checker appears inconsistent with the repo’s established squad:copilot routing label.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR strengthens post-activation enforcement by requiring activation artifacts to emit machine-readable task/epic→issue bindings, and introducing a read-only workflow that validates those bindings against actual GitHub labels to fail closed on inconsistent activation evidence.

Changes:

  • Extend activation artifacts (activated / phases-activated) to include a structured, non-empty bindings array describing task/epic issue mappings and intended label outcomes.
  • Add a deterministic checker script plus Vitest coverage to parse activation structured data, load the roster, and validate binding↔label correspondence.
  • Add a post-run GitHub Actions workflow that gathers activation comments from the completed run and executes the checker with issues: read.
File summaries
File Description
workflows/squad.md Adds bindings to the safe-output schema and specifies the activation artifact binding contract.
workflows/shared/squad-planning-ontology.md Documents that activation safe-output data must include a mandatory bindings mapping for post-run validation.
scripts/check-agent-binding.mjs New checker that parses activation structured data, derives expected labels/omissions, and validates against live issue labels via the GitHub API.
test/check-agent-binding.test.ts New tests covering parsing, fail-closed behavior, and workflow wiring/permissions expectations.
.github/workflows/squad-agent-binding-check.yml New workflow_run-triggered read-only validation job that collects activation comments and runs the checker.
Review details

Suppressed comments (1)

workflows/squad.md:113

  • The safe-outputs schema defines bindings, but the top-level required: list does not require it. That means an activated/phases-activated artifact could still validate without bindings, despite later activation instructions stating bindings are mandatory and the post-run checker failing closed on missing/empty bindings.
    required:
      - squad_artifact
      - schema_version
      - origin_issue
      - phases
    additionalProperties: false
  • Files reviewed: 5/5 changed files
  • Comments generated: 4
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread workflows/squad.md Outdated
Comment thread workflows/squad.md Outdated
Comment thread scripts/check-agent-binding.mjs Outdated
Comment thread .github/workflows/squad-agent-binding-check.yml

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.

🟡 Changes recommended

The new binding-check workflow is configured to trigger on a non-existent workflow name (Squad), so the validation job will not run.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (2)

workflows/squad.md:98

  • The bindings[*].agents schema allows an empty array, and omission_reason is unconstrained. Since the checker enforces non-empty agents and only allows multi-owner|non-roster|copilot, tightening the safe-output schema here will catch malformed activation evidence earlier (during emission/validation) instead of only post-run.
            agents:
              type: array
              items:
                type: string
            label:

workflows/squad.md:1433

  • The epic binding example uses "label":"squad:{agent}", but epic bindings don’t carry an agent field (only agents). This can mis-specify the machine-readable output shape and lead to mismatched labels vs what the deterministic checker expects for single-owner epics.
`{"kind":"epic","issue":{created epic issue number},"epic":"{Epic identifier}","agents":["{distinct lowercased task agents}"],"label":"squad:{agent}"}` for a single roster owner, or omit `label` and set `"omission_reason":"multi-owner"` for multiple owners. For a task whose agent is not certified by TG-2, omit `label` and set `"omission_reason":"non-roster"`; for `@copilot`, use `"omission_reason":"copilot"`. Never omit a created issue from `bindings`, never infer an issue number, and never emit an empty array. The deterministic post-activation workflow treats missing, empty, malformed, or unresolved bindings as a failure.
  • Files reviewed: 5/5 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread .github/workflows/squad-agent-binding-check.yml
brady gaster added 3 commits August 24, 2026 16:35
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 38c1464f-cc45-4217-bd43-09655eee99c8
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 38c1464f-cc45-4217-bd43-09655eee99c8
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 38c1464f-cc45-4217-bd43-09655eee99c8
@bradygaster
bradygaster merged commit d140081 into dev Aug 24, 2026
17 checks passed
@bradygaster
bradygaster deleted the bradygaster-1801-binding-guard-wave branch September 9, 2026 19:44
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.

Plan validation self-clears: the checks table ships pre-filled ✅, and three surfaces disagree on what it contains

2 participants