Skip to content

fix(test): update consult tests to match current consult-mode behavior#94

Closed
diberry wants to merge 1 commit intodevfrom
squad/fix-consult-tests
Closed

fix(test): update consult tests to match current consult-mode behavior#94
diberry wants to merge 1 commit intodevfrom
squad/fix-consult-tests

Conversation

@diberry
Copy link
Copy Markdown
Owner

@diberry diberry commented Mar 28, 2026

Updates consult tests to match current consult-mode behavior.

Fork PR for Copilot review gate.

@diberry diberry force-pushed the squad/fix-consult-tests branch from be02218 to 40b40f1 Compare March 29, 2026 21:03
@diberry
Copy link
Copy Markdown
Owner Author

diberry commented Mar 29, 2026

✅ Approved: Consult Tests Fix ## Summary These changes correctly align test assertions with the actual consult-mode implementation. Both the SDK and CLI test changes are accurate and well-justified. ## Detailed Review ### 1. CLI Test Change (test/cli/consult.test.ts:202) ✅ CORRECT Changed personal squad directory from .squadpersonal-squad Verification: Matches getPersonalSquadRoot() in packages/squad-sdk/src/sharing/consult.ts:316: typescript export function getPersonalSquadRoot(): string { return path.resolve(resolveGlobalSquadPath(), 'personal-squad'); } The comment clarification is helpful: (init --global bootstraps personal-squad/) --- ### 2. SDK Test Changes (test/sdk/consult.test.ts:510-523) ✅ CORRECT Old Assertions Removed: - expect(content).toContain('Coordinator Identity'); - expect(content).toContain('Team Mode'); New Assertions Added: - expect(content).toContain('.squad/decisions.md'); - expect(content).toMatch(/^---\r?\n/); Why This Matters: The previous assertions assumed the full template would always be available. The new assertions test portable consult-mode behavior that works regardless of template availability: - Both template AND fallback contain .squad/decisions.md reference (proving local squad context is always available) - Both paths guarantee valid YAML frontmatter starting with --- (the regex correctly handles Windows \r\n and Unix \n) This makes the tests more robust and resilient to deployment variations. --- ### 3. Implementation Verification ✅ ALIGNED getConsultAgentContent() Implementation (consult.ts:139-185): - ✅ Template path branch (142-162): Includes full template with "Coordinator Identity" and "Team Mode" - ✅ Fallback path (165-184): Includes .squad/decisions.md reference and valid frontmatter with --- Both code paths produce valid agent files—the test now verifies the common elements that matter. --- ### 4. No Missing Coverage The test suite adequately covers: - ✅ Consult mode preamble ("Consult Mode Active", "Skip Init Mode") - ✅ Local context references (.squad/decisions.md, .squad/agents/) - ✅ Valid markdown frontmatter - ✅ Git exclude setup (lines 525+) - ✅ Previous test (lines 500-507) verifies .squad/agents/ references --- ## Verdict: ✅ Approve These changes are technically correct, well-aligned with implementation, and improve test resilience. No issues detected. --- Review Notes: - FIDO authored the fix, so review came from Flight (Lead) - Architecture principle: Tests should verify behavior, not implementation details (template availability)

@diberry diberry added squad:pr-needs-review PR lifecycle: awaiting team review and removed squad:pr-needs-review PR lifecycle: awaiting team review labels Mar 31, 2026
@diberry diberry marked this pull request as ready for review April 1, 2026 03:39
@diberry diberry added the squad:pr-needs-preparation PR lifecycle: needs rebase and squash label Apr 1, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@diberry diberry force-pushed the squad/fix-consult-tests branch from 40b40f1 to 4daecee Compare April 1, 2026 04:12
@diberry diberry added squad:pr-needs-review PR lifecycle: awaiting team review and removed squad:pr-needs-preparation PR lifecycle: needs rebase and squash labels Apr 1, 2026
@diberry
Copy link
Copy Markdown
Owner Author

diberry commented Apr 1, 2026

🔧 Preparation Complete

  • Rebased against upstream/dev
  • Rebuilt branch — removed 232 stowaway files (was 234 files, now 2)
  • Squashed from 14 → 1 commit
  • Naming convention: fix(test):
  • CI green (9/9 checks passed, docs-quality skipped)
  • File audit: 2 test files — clean

⚠️ No linked issue found. Branch squad/fix-consult-tests has no issue number.

Advancing to squad:pr-needs-review.

@diberry diberry closed this Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

squad:pr-needs-review PR lifecycle: awaiting team review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant