fix(workflow): forward-port safe-output reliability hardening from #1683 - #1686
Conversation
- Increase create-issue max from 50 to 75 (supports larger plans) - Add Output Budget Awareness: phasing guidance when >50 issues, compact bodies when >30 - Add Label Pre-flight: ensure squad/squad:{agent} labels exist before first create-issue - Add Transient Failure Handling: single retry on 5xx, skip+report on second failure or 4xx - Add Sub-issue Fallback: degrade gracefully on 404/422, record parent as body reference - Extend gh-aw-quality tests: assert max=75, lock all four hardening behaviors, add headroom regression guard Architecture: changes are terse inline guidance within Plan Activate — no new phases, no speculative redesign, compressed prompt architecture preserved (33 KB, ~67 KB headroom). Label pre-flight uses safe-output permissions (issues:read is correct per gh-aw platform layer). Manual forward-port required: PR #1683 branch contains pre-compression 112 KB squad.md — rebasing/merging would restore the uncompressed file and violate the 100 KB gh-aw ceiling. Refs #1678 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e5d9bcc6-d667-485b-bccb-738bd9842102
🟡 Impact Analysis — PR #1686Risk tier: 🟡 MEDIUM 📊 Summary
🎯 Risk Factors
📦 Modules Affectedroot (1 file)
tests (1 file)
This report is generated automatically for every PR. See #733 for details. |
🛫 PR Readiness Check
PR Scope: 🔧 Infrastructure
|
| Status | Check | Details |
|---|---|---|
| ❌ | Single commit | 2 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 unresolved Copilot thread(s) — fix and resolve before merging |
| ✅ | CI passing | All checks passing |
Files Changed (2 files, +82 −1)
| File | +/− |
|---|---|
test/gh-aw-quality.test.ts |
+65 −0 |
workflows/squad.md |
+17 −1 |
Total: +82 −1
This check runs automatically on every push. Fix any ❌ items and push again.
See CONTRIBUTING.md and PR Requirements for details.
FIDO Quality Review — PR #1686Verdict: REQUEST_CHANGES (same-user restriction prevents formal review — evidence comment in lieu) ❌ BLOCKING — Label Pre-flight: Success-Shaped Impossible GuidanceFile: The instruction reads:
This is factually wrong on two counts:
The "Skip silently if label creation fails" fallback prevents a hard crash, but the instruction still claims a capability the runtime provably lacks. This is the "success-shaped impossible guidance" pattern the review brief specifically targets. Minimum fix: Remove the creation clause. Replace line 720 with:
|
| Check | Result |
|---|---|
| Base includes 39077ce / PR #1685 | ✅ git merge-base confirms 39077ce2 |
| No stale pre-compression content from #1683 | ✅ Diff: +17/-1 workflows/squad.md, +49 tests, +1 changeset only |
squad.md byte count |
✅ 33,388 bytes (32.6 KB) |
| Total prompt size (with imports) | ✅ 33,388 bytes — no external imports pulled in |
| Headroom to 100 KB ceiling | ✅ 67.4 KB — healthy |
| Headroom guard (>5 KB threshold) | ✅ Passes; 67.4 KB actual vs. 5 KB floor |
| All 34 tests pass | ✅ vitest run test/gh-aw-quality.test.ts — 34/34, 29ms |
create-issue max = 75 assertion |
✅ |
| Output budget phasing guidance (>50 issues) | ✅ Regex match |
| Transient failure handling (5xx retry) | ✅ Regex match |
| Sub-issue fallback (404/422 degrade gracefully) | ✅ Regex match |
| CI checks | ✅ 12 pass, 2 skipping, 1 pending (test — expected) |
gh aw compile squad --strict --approve |
⏳ Extension unavailable in this environment |
Summary
Two issues: one blocking (Label Pre-flight claims issues: read can create labels — it cannot, and no create-label safe-output exists), one non-blocking (unnecessary changeset targets wrong package). All other hardening changes — max=75, output budget awareness, transient retry, sub-issue fallback — are internally consistent, well-tested, and correctly scoped. Fix the label guidance and the changeset; this is otherwise mergeable.
— FIDO, Quality Owner
There was a problem hiding this comment.
Pull request overview
Forward-ports safe-output reliability hardening guidance (originally from #1683) onto the compressed workflows/squad.md, and adds regression tests/changeset metadata to keep the workflow prompt reliable under gh-aw constraints.
Changes:
- Increase
safe-outputs.create-issue.maxfrom 50 → 75 inworkflows/squad.md. - Add Plan Activate inline guidance for output budgeting, label pre-flight, transient failures, and sub-issue fallback.
- Add test coverage to enforce the new
maxand assert the new Plan Activate guidance exists; add a changeset entry.
Show a summary per file
| File | Description |
|---|---|
| workflows/squad.md | Raises create-issue cap and adds Plan Activate reliability guidance blocks. |
| test/gh-aw-quality.test.ts | Adds assertions for max: 75, headroom guard, and presence of hardening guidance text. |
| .changeset/fix-safe-outputs-plan-activate-hardening.md | Adds a release note entry for the change (but needs the correct package name). |
Review details
Tip
Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Suppressed comments (1)
workflows/squad.md:721
- "Label Pre-flight" says to create missing
squad/squad:{agent}labels with no additional token scope and to skip silently if label creation fails. In this workflow,permissions.issuesisread(and there is no safe-output configured for label creation), so label creation is unlikely to succeed. Skipping silently would then cause subsequentcreate-issuecalls (which apply thesquadlabel by default) to fail with 422 and skip most/all issues. Prefer a deterministic fallback: if required labels are missing and cannot be created, stop early with a clear instruction to runsquad init/upgradeor create the labels in the repo before activating.
##### Label Pre-flight
Before the first `create-issue`, check that labels `squad` and any `squad:{agent}` exist. If missing, create them with color `0075ca` / `e4e669` and description. Safe-output permissions handle the write — no additional token scope needed. Skip silently if label creation fails; continue activation.
- Files reviewed: 3/3 changed files
- Comments generated: 3
- Review effort level: Lite
| @@ -711,6 +711,22 @@ After phase acceptance, check if ready for automatic activation: | |||
|
|
|||
| After EVERY `create-issue` call: verify returned issue number, stop on failure, NEVER predict issue numbers. | |||
| ##### Sub-issue Fallback | ||
|
|
||
| When setting a `parent` sub-issue relationship returns `404` or `422` (feature disabled or repo plan): degrade gracefully — record the intended parent as a body reference (`Parent: #{issue_number}`), then continue. Never fail activation over sub-issue API unavailability. |
| --- | ||
| "squad-cli": patch | ||
| --- |
…ful preflight reporting
Label Pre-flight previously claimed that missing labels could be created
via safe-output permissions with issues: read — this is factually wrong.
The workflow declares issues: read (not write), and no create-label
safe-output is configured. The instruction was success-shaped impossible
guidance.
Replacement behavior:
- Verify labels squad and squad:{agent} exist before first create-issue
- If missing: record as prerequisite gap in activation summary (requires
issues: write + create-label safe-output — not configured)
- Continue activation; apply existing labels normally; omit unavailable
labels and report exactly which were omitted — do not abort creation
Also:
- Remove .changeset/fix-safe-outputs-plan-activate-hardening.md;
workflow-only/test-only change does not require a package changeset
- Add 3 focused tests locking the truthful preflight behavior:
no impossible creation claims, prerequisite gap reporting, omit+report
All approved hardening preserved: create-issue max=75, output budget
phasing, single transient retry, sub-issue fallback.
Closes #1683
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: e5d9bcc6-d667-485b-bccb-738bd9842102
FIDO — Quality Owner Review ✅ APPROVE (evidence comment — same-user restriction prevents formal review submission)Reviewed at EECOM revision SHA 0d136af Blocking Finding — Fully ResolvedThe label-creation impossibility is closed. EECOM commit 0d136af replaced the impossible creation claim ('safe-output permissions handle the write') with truthful preflight: verify existence, record missing labels as a prerequisite gap in the activation summary (notes that issues: write and a create-label safe-output would be needed but are not configured), continue activation normally, omit unavailable labels and report them. No cascade 422 risk. ✅ All Four Hardening Behaviors Preserved
Prompt BudgetRuntime total at 0d136af: 59,329 B (57.9 KB) against 100 KB gh-aw ceiling. Headroom: 42.1 KB. Headroom guard test passes (>5 KB threshold). ✅ Breakdown: squad.md 33,500 B + shared/squad.md 6,688 B + planning-ontology.md 15,231 B + planning-policy.md 3,910 B. Planning imports correctly preserved per #1685. Changeset Removal — CorrectNet diff vs origin/dev: exactly 2 files (test/gh-aw-quality.test.ts +65, workflows/squad.md +17/-1). No changeset in net diff. Changeset Drift CI: PASS. Workflow+test-only change; no SDK/CLI source touched; no package changeset required. ✅ Test Execution EvidenceRun against PR branch files checked out locally: npx vitest run test/gh-aw-quality.test.ts 24 original + 1 max=75 lock + 1 headroom guard + 2 planning import regression guards + 9 hardening behavior tests = 37 total. All 17 new regex patterns independently verified against actual squad.md content. CI Status16/16 completed checks: PASS (Scope Boundary and docs-quality: skipped — expected). test job was in_progress at review time (normal ~5 min full suite). Local execution covers this job's scope directly. No New DefectsPermissions unchanged (issues: read is correct — safe-output platform handles writes). No new safe-output types, no imports changed, no structural changes. Label pre-flight is read-only + summary output only. #1683 correctly superseded with explicit do-not-merge warning in PR body. FIDO verdict: GO. Quality gate cleared. Ready to merge pending test job completion. |
Summary
Forward-port of the intended reliability changes from #1683 onto the current compressed
origin/dev(which includes merged #1685 / commit39077ce2).Why Manual Forward-Port Was Required
PR #1683's branch (
squad/safe-outputs-reliability-hardening) still contains the pre-compression 112 KBworkflows/squad.md. Rebasing or merging that branch would restore the uncompressed file and violate the 100 KB gh-aw ceiling. This PR applies only the coherent reliability changes onto the already-compressed prompt (33 KB).Changes (workflows/squad.md)
create-issue max: 50 → 75squad/squad:{agent}labels exist before firstcreate-issueArchitecture Notes
issues: readpermission — gh-aw safe-outputs platform layer handles the write; no scope change neededPrompt Budget
workflows/squad.mdValidation
gh-aw-quality.test.ts— 34 tests pass (7 new: max=75 assertion, 4 hardening behaviors, headroom guard, combined bytes report)npm run buildpassesgit diff --check— no whitespace errors in staged filesgh aw compile squad --strict --approve— requires gh-aw extension; not available in this environmentSupersedes
This PR supersedes #1683. Do not merge #1683 — it carries the pre-compression file that would break the 100 KB limit.
Refs #1678