Skip to content

CLI casting bypasses CastingEngine template system #342

Closed

Description

@jsturtevant

Problem

The CastingEngine class (packages/squad-sdk/src/casting/casting-engine.ts) defines curated universe templates with:

  • Character pools with specific names
  • Personality backstories per character
  • Preferred role assignments
  • Universe capacity limits

However, when casting a team via Copilot CLI (squad init), the engine is completely bypassed:

  1. packages/squad-cli/src/cli/shell/coordinator.ts (lines 42-86) — buildInitModePrompt() hardcodes a prompt that lets the LLM pick any universe (e.g., "Alien, The Usual Suspects, Blade Runner, The Matrix, Heat, Star Wars"). No reference to CastingEngine, no universe allowlist enforcement.

  2. packages/squad-cli/src/cli/core/cast.ts (lines 218-280) — generateCharter() uses regex-based personalityForRole() to assign generic personalities by role type, ignoring the detailed per-character backstories in the template system.

  3. CastingEngine.castTeam() is never called during the init flow.

Impact

  • The CastingEngine class is effectively dead code when using Copilot CLI
  • No enforcement of universe allowlist — the LLM can suggest universes that don't exist in the template system
  • No character name pool — names are generated arbitrarily instead of selected from curated characters
  • Charter personalities are generic (regex-matched by role) instead of universe-specific

Expected Behavior

The CLI init flow should use CastingEngine to:

  1. Select a universe from the allowlist (scored by size_fit + shape_fit + resonance_fit)
  2. Allocate character names from that universe's character pool
  3. Use the template's personality backstories when generating charters

Files

  • Template system (unused): packages/squad-sdk/src/casting/casting-engine.ts
  • Hardcoded init prompt: packages/squad-cli/src/cli/shell/coordinator.ts:42-86
  • Hardcoded charter gen: packages/squad-cli/src/cli/core/cast.ts:218-280
  • Init flow entry: packages/squad-cli/src/cli/shell/index.ts:890-962

Activity

  1. github-actions commented on Mar 13, 2026

    @github-actions
    Contributor

    🏗️ Squad Triage — Flight (Lead)

    Issue: #342 — CLI casting bypasses CastingEngine template system
    Assigned to: DSKY (TUI Engineer)
    Reason: Issue relates to frontend/UI work

    @copilot evaluation: 🔴 Not suitable — issue involves work outside the coding agent's capability profile.

    Team roster:

    • Flight (Lead) → label: squad:flight
    • Procedures (Prompt Engineer) → label: squad:procedures
    • EECOM (Core Dev) → label: squad:eecom
    • FIDO (Quality Owner) → label: squad:fido
    • PAO (DevRel) → label: squad:pao
    • CAPCOM (SDK Expert) → label: squad:capcom
    • CONTROL (TypeScript Engineer) → label: squad:control
    • Surgeon (Release Manager) → label: squad:surgeon
    • Booster (CI/CD Engineer) → label: squad:booster
    • GNC (Node.js Runtime) → label: squad:gnc
    • Network (Distribution) → label: squad:network
    • RETRO (Security) → label: squad:retro
    • INCO (CLI UX & Visual Design) → label: squad:inco
    • GUIDO (VS Code Extension) → label: squad:guido
    • Telemetry (Aspire & Observability) → label: squad:telemetry
    • VOX (REPL & Interactive Shell) → label: squad:vox
    • DSKY (TUI Engineer) → label: squad:dsky
    • Sims (E2E Test Engineer) → label: squad:sims
    • Handbook (SDK Usability) → label: squad:handbook
    • Ralph (Work Monitor) → label: squad:ralph
    • @copilot (Coding Agent) → label: squad:copilot

    To reassign, remove the current squad:* label and add the correct one.

  2. github-actions commented on Mar 13, 2026

    @github-actions
    Contributor

    ⚠️ No squad member found matching label squad:fenster. Check .squad/team.md (or .ai-team/team.md) for valid member names.

  3. github-actions commented on Mar 13, 2026

    @github-actions
    Contributor

    📋 Assigned to EECOM (Core Dev)

    Issue: #342 — CLI casting bypasses CastingEngine template system

    EECOM will pick this up in the next Copilot session.

    For Copilot coding agent: If enabled, this issue will be worked automatically.
    Otherwise, start a Copilot session and say:
    EECOM, work on issue #342

  4. added 2 commits that reference this issue on Mar 15, 2026
    c0ab0e1
    69dc856
  5. williamhallatt commented on Mar 16, 2026

    @williamhallatt
    Contributor

    This issue appears to be functionally resolved by PR #417 (merged 2026-03-15), which wired augmentWithCastingEngine() into cast.ts. The PR includes 5 integration tests in casting-engine-integration.test.ts covering Usual Suspects, Ocean's Eleven, unrecognized universe, case-insensitive matching, and failure handling.

    The core changes in PR #417:

    • CastingEngine is now called during the CLI init flow
    • Universe allowlists are enforced
    • Character name pools are used instead of arbitrary LLM-generated names

    Consider closing this issue if the PR #417 resolution is satisfactory.

  6. bradygaster commented on Mar 16, 2026

    @bradygaster
    Collaborator

    Already shipped via PR #417 (CastingEngine wiring). Closing.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    go:needs-researchNeeds investigationpriority:p1This sprintsquadSquad triage inbox — Lead will assign to a membertype:bugSomething broken

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions