Skip to content

fix(workflow): atomic task-call contract in Plan Activate Step 2c (#1678) - #1687

Merged
bradygaster merged 1 commit into
devfrom
squad/plan-activate-atomic-task-calls
Aug 12, 2026
Merged

bradygaster merged 1 commit into
devfrom
squad/plan-activate-atomic-task-calls

Conversation

@bradygaster

Copy link
Copy Markdown
Collaborator

Root Cause

The watchdog fires ~20 s after the last visible model output. In the live failed canary run 31555893180, the agent composed all task bodies in one reasoning burst after epic creation completed — then the post-result idle window expired before the first create-issue task call was ever made.

Exact Mitigation

Added an ATOMIC CONTRACT to Step 2c that mandates: compose one task body → call create-issue immediately → verify returned issue number → repeat. This breaks the silent inter-call gap that triggered the watchdog.

Also:

  • Compact body spec: one-sentence scope, 1–2 acceptance criteria, one context line (parent, size, deps) — reduces per-task reasoning time
  • Step 2d fallback: if created task count is below expected, immediately call report_incomplete with created={N}, expected={M}, and last verified issue number — never noop; re-runs are idempotent via title match

Evidence — Run 31555893180

Watchdog fired after epic creation; zero task issues created. This patch eliminates the reasoning burst that caused the gap.

Prompt Bytes

File Bytes
workflows/squad.md 34,017
shared/squad.md 6,688
shared/planning-ontology.md 15,231
shared/planning-policy.md 3,910
Total 59,846

Ceiling: ~80,000 B — ~20 KB headroom.

Tests

7 new focused tests added to test/gh-aw-quality.test.ts:

  • Atomic CONTRACT heading present
  • Immediate call after compose required
  • Explicit no-batch rule
  • Compact body (one sentence + 1–2 ACs)
  • report_incomplete called with created/expected counts
  • Never noop on mismatch
  • Idempotent re-run via title match

All 44 tests pass (37 pre-existing + 7 new).

Compile Status

gh aw compile not available in this environment; workflow markdown is valid. .lock.yml not regenerated (prompt-body-only change).

Live Rerun

A live rerun on a fresh plan is still required to confirm end-to-end task creation completes before watchdog fires.

Files Changed (2)

  • workflows/squad.md
  • test/gh-aw-quality.test.ts

Notes

)

Root cause: watchdog timeout triggered ~20s after epic creation when all task
bodies were composed before the first create-issue call — the agent had already
exceeded the post-result idle window before making any task API calls.

Mitigation: add an explicit ATOMIC CONTRACT to Step 2c requiring each task body
to be composed, called, and verified before the next — eliminating the gap
between epic completion and first task API call.

Changes:
- workflows/squad.md: ATOMIC CONTRACT note in 2c; compact body spec (one
  sentence + 1-2 ACs + one context line); explicit no-batch rule; 2d
  incomplete fallback now calls report_incomplete with counts, never noops,
  and states idempotent re-run via title match
- test/gh-aw-quality.test.ts: 7 new focused tests locking atomic contract,
  compact body, no-batch rule, report_incomplete fallback

Evidence: live failed canary run 31555893180 — watchdog fired after epics,
before task creation.

Prompt bytes (squad.md + imports): 59,846 / ~80,000 ceiling → 20 KB headroom.
Existing 37 tests remain green; total 44 passed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings August 12, 2026 02:27
@bradygaster bradygaster added the skip-changelog Skip changelog enforcement for this PR label Aug 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🟡 Impact Analysis — PR #1687

Risk tier: 🟡 MEDIUM

📊 Summary

Metric Count
Files changed 2
Files added 0
Files modified 2
Files deleted 0
Modules touched 2

🎯 Risk Factors

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

📦 Modules Affected

root (1 file)
  • workflows/squad.md
tests (1 file)
  • test/gh-aw-quality.test.ts

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

@github-actions

github-actions Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

🛫 PR Readiness Check

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

PR Scope: 🔧 Infrastructure

⚠️ 2 item(s) to address before review

Status Check Details
✅ Single commit 1 commit — clean history
✅ 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 1 unresolved Copilot thread(s) — fix and resolve before merging
✅ CI passing All checks passing

Files Changed (2 files, +45 −2)

File +/−
test/gh-aw-quality.test.ts +38 −0
workflows/squad.md +7 −2

Total: +45 −2


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

@bradygaster bradygaster left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

FIDO Quality Review — PR #1687 e372c14d

✅ APPROVE (via comment — same-author restriction)


Checklist Results

Check Result
Based on latest dev (includes #1685/#1686 via dbb878da) ✅
Changed files: workflows/squad.md + test/gh-aw-quality.test.ts only ✅
No changeset; skip-changelog label present ✅
All 7 new tests pass; total 44 green ✅
All 37 prior tests remain green ✅
CI: all checks pass (test: pending at review time; others all pass) ✅

Atomic Contract Wording (Step 2c)

For each task: compose ONLY that task's body → call create-issue immediately → verify the returned issue number → then move to the next task.
DO NOT compose or buffer multiple task bodies before making calls. One compose → one call → one verify, repeated per task.

Assessment: Unambiguous and minimal. The sequential constraint is stated twice (positive and negative form), removing any inference gap about batching. Minimizes post-result idle latency because the first API call happens immediately after the first body is composed.


report_incomplete Fallback (Step 2d)

If created count is below expected: call report_incomplete immediately with created={N}, expected={M}, and the last verified issue number — never noop.

Assessment: Correctly configured. No contradictory summary behavior (no language suggesting partial success or silent continuation). Idempotent re-run via title match is explicit.


Prompt Byte Budget — KEY FINDING

The commit message states: 59,846 / ~80,000 ceiling → 20 KB headroom

The ~80,000 figure is a safety budget, not the hard production ceiling.

Live measurement at e372c14d:

  • workflows/squad.md: 34,017 bytes
  • workflows/shared/squad.md: 6,690 bytes
  • workflows/shared/planning-ontology.md: 15,231 bytes
  • workflows/shared/planning-policy.md: 3,910 bytes
  • Combined total: 59,848 bytes (58.4 KB)

The test suite correctly uses the hard production ceiling of 102,400 bytes (100 KB), enforced at GH_AW_PROMPT_CEILING_BYTES = 100 * 1024. The ~80,000 in the commit message is an informal safety budget (~78% of ceiling), not a ceiling. Tests enforce the correct value.

Headroom vs hard ceiling: 42,552 bytes (41.6 KB) — well above the 5 KB regression guard.

The commit message should ideally read "59,846 / ~80,000 (safety budget) vs 102,400 hard ceiling" but this is documentation-level only; the test assertion is correct.


No-Batch Prohibition & Compact Body Bounds

  • Explicit DO NOT compose or buffer multiple task bodies prohibition present ✅
  • Body spec: "one sentence describing scope; 1-2 acceptance criteria; one compact context line" — sufficient semantic preservation for issue triage without verbosity that triggers batching temptation ✅

Prior Hardening Integrity

All pre-existing tests (safe-output config, mode dispatch, shared imports, planning state machine, frontmatter schema, hardening behaviors) pass without regression. No imports removed.


Brittle Assertion Risk

The 7 new tests are regex-based against prose in squad.md. They will break if the exact phrases "ATOMIC CONTRACT", "never noop", "idempotent via title match", or "1-2 acceptance criteria" are paraphrased. This is intentional lock behavior — acceptable and desirable for a behavioral contract. Not brittle in a bad sense.


Verdict

APPROVE. All blockers resolved. Exact byte evidence: 59,848 / 102,400 bytes, 41.6 KB headroom. 44/44 tests pass. No regressions. The ~80,000 figure in the commit message is a safety budget annotation, not an error in the ceiling enforced by tests.

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

Hardens the Plan Activate portion of the Squad agentic workflow to prevent watchdog timeouts between epic creation and task issue creation by enforcing an atomic “compose → call → verify” loop and adding an explicit incomplete-activation fallback.

Changes:

  • Adds an explicit ATOMIC CONTRACT to Step 2c to prevent batching task bodies before create-issue calls.
  • Compacts the task issue body requirements to reduce token/output overhead during activation.
  • Adds/updates quality tests to enforce the new Step 2c/2d requirements in workflows/squad.md.
Show a summary per file
File Description
workflows/squad.md Adds atomic one-task-at-a-time contract for task creation and strengthens self-validation/fallback guidance.
test/gh-aw-quality.test.ts Adds regression tests asserting the atomic contract language and the incomplete-activation fallback requirements are present.

Review details

Tip

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

  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread workflows/squad.md
- Size: Project field if available, else body line

**2d. Self-Validation:** Compare created counts vs expected. If mismatch: report partial activation with counts, note idempotent re-run.
**2d. Self-Validation:** Compare created/recognized task count vs expected. If created count is below expected: call `report_incomplete` immediately with `created={N}`, `expected={M}`, and the last verified issue number — never noop. Re-runs are idempotent via title match.
@bradygaster
bradygaster merged commit d157cb6 into dev Aug 12, 2026
18 checks passed
@bradygaster
bradygaster deleted the squad/plan-activate-atomic-task-calls branch August 20, 2026 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog Skip changelog enforcement for this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: plan activate creates epics but stops before task issues (token exhaustion)

2 participants