| 1 | # Casting Reference |
| 2 | |
| 3 | On-demand reference for Squad's casting system. Loaded during Init Mode or when adding team members. |
| 4 | |
| 5 | ## Universe Table |
| 6 | |
| 7 | | Universe | Capacity | Shape Tags | Resonance Signals | |
| 8 | |---|---|---|---| |
| 9 | | The Usual Suspects | 6 | small, noir, ensemble | crime, heist, mystery, deception | |
| 10 | | Reservoir Dogs | 8 | small, noir, ensemble | crime, heist, tension, loyalty | |
| 11 | | Alien | 8 | small, sci-fi, survival | space, isolation, threat, engineering | |
| 12 | | Ocean's Eleven | 14 | medium, heist, ensemble | planning, coordination, roles, charm | |
| 13 | | Arrested Development | 15 | medium, comedy, ensemble | dysfunction, business, family, satire | |
| 14 | | Star Wars | 12 | medium, sci-fi, epic | conflict, mentorship, legacy, rebellion | |
| 15 | | The Matrix | 10 | medium, sci-fi, cyberpunk | systems, reality, hacking, philosophy | |
| 16 | | Firefly | 10 | medium, sci-fi, western | frontier, crew, independence, smuggling | |
| 17 | | The Goonies | 8 | small, adventure, ensemble | exploration, treasure, kids, teamwork | |
| 18 | | The Simpsons | 20 | large, comedy, ensemble | satire, community, family, absurdity | |
| 19 | | Breaking Bad | 12 | medium, drama, tension | chemistry, transformation, consequence, power | |
| 20 | | Lost | 18 | large, mystery, ensemble | survival, mystery, groups, leadership | |
| 21 | | Marvel Cinematic Universe | 25 | large, action, ensemble | heroism, teamwork, powers, scale | |
| 22 | | DC Universe | 18 | large, action, ensemble | justice, duality, powers, mythology | |
| 23 | | Futurama | 12 | medium, sci-fi, comedy | future, robots, space, absurdity | |
| 24 | |
| 25 | **Total: 15 universes** — capacity range 6–25. |
| 26 | |
| 27 | ## Selection Algorithm |
| 28 | |
| 29 | Universe selection is deterministic. Score each universe and pick the highest: |
| 30 | |
| 31 | ``` |
| 32 | score = size_fit + shape_fit + resonance_fit + LRU |
| 33 | ``` |
| 34 | |
| 35 | | Factor | Description | |
| 36 | |---|---| |
| 37 | | `size_fit` | How well the universe capacity matches the team size. Prefer universes where capacity ≥ agent_count with minimal waste. | |
| 38 | | `shape_fit` | Match universe shape tags against the assignment shape derived from the project description. | |
| 39 | | `resonance_fit` | Match universe resonance signals against session and repo context signals. | |
| 40 | | `LRU` | Least-recently-used bonus — prefer universes not used in recent assignments (from `history.json`). | |
| 41 | |
| 42 | Same inputs → same choice (unless LRU changes between assignments). |
| 43 | |
| 44 | ## Casting State File Schemas |
| 45 | |
| 46 | ### policy.json |
| 47 | |
| 48 | Source template: `.squad/templates/casting-policy.json` |
| 49 | Runtime location: `.squad/casting/policy.json` |
| 50 | |
| 51 | ```json |
| 52 | { |
| 53 | "casting_policy_version": "1.1", |
| 54 | "allowlist_universes": ["Universe Name", "..."], |
| 55 | "universe_capacity": { |
| 56 | "Universe Name": 10 |
| 57 | } |
| 58 | } |
| 59 | ``` |
| 60 | |
| 61 | ### registry.json |
| 62 | |
| 63 | Source template: `.squad/templates/casting-registry.json` |
| 64 | Runtime location: `.squad/casting/registry.json` |
| 65 | |
| 66 | ```json |
| 67 | { |
| 68 | "agents": { |
| 69 | "agent-role-id": { |
| 70 | "persistent_name": "CharacterName", |
| 71 | "universe": "Universe Name", |
| 72 | "created_at": "ISO-8601", |
| 73 | "legacy_named": false, |
| 74 | "status": "active" |
| 75 | } |
| 76 | } |
| 77 | } |
| 78 | ``` |
| 79 | |
| 80 | ### history.json |
| 81 | |
| 82 | Source template: `.squad/templates/casting-history.json` |
| 83 | Runtime location: `.squad/casting/history.json` |
| 84 | |
| 85 | ```json |
| 86 | { |
| 87 | "universe_usage_history": [ |
| 88 | { |
| 89 | "universe": "Universe Name", |
| 90 | "assignment_id": "unique-id", |
| 91 | "used_at": "ISO-8601" |
| 92 | } |
| 93 | ], |
| 94 | "assignment_cast_snapshots": { |
| 95 | "assignment-id": { |
| 96 | "universe": "Universe Name", |
| 97 | "agents": { |
| 98 | "role-id": "CharacterName" |
| 99 | }, |
| 100 | "created_at": "ISO-8601" |
| 101 | } |
| 102 | } |
| 103 | } |
| 104 | ``` |