OOKNET                             [ /  search the index  ]  
──────────────────────────────────────────────────────────────────────────────────────
══════════════════════════════════════════════════════════════════════════════════════
OOKNET   [ /  search  ]  
────────────────────────────────────────────────
════════════════════════════════════════════════
 
HASH      8e94892f8ac6
DATE      2025-07-21
SUBJECT   nix: define spec template in mkMassSim
FILES     4 CHANGED
HASH      8e94892f8ac6
DATE      2025-07-21
SUBJECT   nix: define spec template in mkMassSim
FILES     4 CHANGED
 

diff --git a/CLAUDE.md b/CLAUDE.md
deleted file mode 100644
index 5a2a5e5..0000000
--- a/CLAUDE.md
+++ /dev/null
@@ -1,179 +0,0 @@
-# CLAUDE.md
-
-This file provides guidance to Claude Code (claude.ai/code) when working with cod
e in this repository.
-
-## Project Overview
-
-This is a Nix-based data pipeline for generating World of Warcraft simulation lea
derboards and statistics. The project uses the wowsims CLI engine to create a theo
rycrafting website similar to bloodmallet, showing spec performance rankings and t
rinket data for WoW Mists of Pandaria.
-
-### Project Vision
-- Generate spec simulation leaderboards across different encounter types
-- Provide trinket performance data and rankings
-- Serve results via static website with JSON data files
-- Automate updates via GitHub Actions when upstream wowsims changes
-- Use Nix for reproducible builds and server configuration
-
-## Development Environment
-
-### Setup
-- Use `nix develop` to enter the development shell which provides `wowsimcli`
-- The project uses a Nix flake with inputs from the wowsims MoP fork
-
-### Key Commands
-- `nix develop` - Enter development environment with wowsimcli available
-- `wowsimcli sim --infile input.json` - Run simulation with input file
-- `wowsimcli sim --infile input.json --outfile results.json` - Save results to fi
le
-- `nix flake show` - Show available flake outputs
-- `nix build` - Build packages (future: website and data generation)
-
-## Architecture
-
-### Core Structure
-- `nix/lib/` - Core simulation library functions
-- `nix/lib/default.nix` - Main library exports (target, encounter, player, raid)
-- `nix/lib/extend.nix` - Extends nixpkgs lib with sim functions
-- `docs/` - Example JSON configurations for CLI input
-
-### Key Components
-
-#### Player Configuration (`nix/lib/player.nix`)
-- `mkPlayer` function creates player configurations from:
-  - Race, class, spec selection
-  - Gearsets loaded from wowsims JSON files
-  - APL (Action Priority List) rotations
-  - Consumables, talents, glyphs, professions
-  - Challenge mode support
-
-#### Target/Encounter System (`nix/lib/target.nix`)
-- Predefined target types: `defaultRaidBoss`, `smallTrash`, `largeTrash`
-- Configurable mob stats, damage, and mechanics
-
-#### Simulation (`nix/lib/simulation.nix`)
-- `mkSim` function creates full simulation configurations
-- Supports iterations, random seeds, different sim types
-
-### Data Sources
-- Gearsets: `${wowsims}/ui/${class}/${spec}/gear_sets/${gearset}.gear.json`
-- APLs: `${wowsims}/ui/${class}/${spec}/apls/${apl}.apl.json`
-- References external wowsims repository for game data
-
-## File Organization
-- Configuration examples in `docs/example_cli_input_windwalker.json`
-- Nix library functions organized by domain (player, target, encounter, simulatio
n)
-- No traditional package.json or test files - this is a pure Nix project
-
-## Input JSON Schema
-
-The wowsimcli expects complex JSON input files with this hierarchy:
-
-### Top-Level Structure
-```json
-{
-  "requestId": "string",
-  "type": "SimTypeIndividual", 
-  "raid": RaidConfig,
-  "encounter": EncounterConfig,
-  "simOptions": SimulationOptions
-}
-```
-
-### Key Schema Components
-- **Raid**: Contains 5 parties (25-person raid), each with 5 player slots, plus r
aid-wide buffs/debuffs
-- **Player**: Complex nested structure with equipment (16 slots), consumables, ta
lents, spec-specific options, and APL rotations
-- **Equipment**: Items with IDs, gems, enchants, reforging, tinkers
-- **APL (Action Priority Lists)**: Deep conditional logic trees for spell rotatio
n decisions
-- **Encounter**: Target configuration, fight duration, execute phases, enemy stat
s
-- **Enumeration Patterns**: Prefixed types like "RaceBloodElf", "ClassMonk", "Mob
TypeMechanical"
-
-### Critical Details
-- Equipment items use game database IDs for items/gems/enchants
-- APL system uses complex nested conditions (and/or/cmp operators)
-- Stats arrays are fixed-length (22 elements for target stats)
-- Empty `{}` objects serve as placeholders for unused slots
-- Spec-specific config uses dynamic keys like `"windwalkerMonk": {...}`
-
-## Data Pipeline
-
-### Planned Workflow
-1. **Input Generation**: Nix functions create JSON input files matching wowsims s
chema
-2. **Simulation**: wowsimcli processes inputs and generates result data
-3. **Aggregation**: Results are collected into static JSON files for website cons
umption
-4. **Website**: Static site serves leaderboards and trinket data
-5. **Automation**: GitHub Actions trigger updates when upstream wowsims changes
-
-### Target Simulations
-- **Encounter Types**: Single Target, Multi-Target, Short Single Target
-- **Scope**: All specs initially, trinket comparisons later
-- **Output**: JSON files for web frontend consumption
-
-## Composable Component Design
-
-### Class Component Pattern
-The project uses a layered composition approach for building reusable class confi
gurations:
-
-```nix
-{
-  lib,
-  components,
-  ...
-}: let
-  inherit (lib.sim.player) mkPlayer;
-  inherit (components.consumables) agilityDps;
-
-  # Spec-specific builder function
-  mkWindwalker = {
-    race,
-    apl,
-    gearset, 
-    talents,
-  }: mkPlayer {
-    class = "monk";
-    spec = "windwalker";
-    inherit race gearset talents apl;
-    consumables = agilityDps;  # Shared consumable set
-  };
-
-  # Organized configurations by tier and scenario
-  windwalker = {
-    talents = {
-      xuen = "213322";  # Single target build
-      rjw = "233321";   # AoE build
-    };
-    p1 = {
-      singleTarget = mkWindwalker {
-        race = "orc";
-        apl = "default";
-        gearset = "dw_p1_bis";
-        talents = windwalker.talents.xuen;
-      };
-      aoeOrc = mkWindwalker {
-        race = "orc";
-        apl = "default"; 
-        gearset = "dw_p1_bis";
-        talents = windwalker.talents.rjw;
-      };
-    };
-  };
-in windwalker
-```
-
-### Design Benefits
-- **Shared Defaults**: Common consumables, base configurations
-- **Scenario Organization**: Grouped by content tier (p1, p2) and encounter type
-- **Talent Variants**: Named talent configurations for different playstyles
-- **Race Flexibility**: Easy to create variants for different races
-- **Inheritance Chain**: `mkWindwalker` ? `mkPlayer` ? JSON output
-
-## Working with the Code
-- Build reusable Nix components following the layered composition pattern
-- Create spec builders that inherit from `mkPlayer` with sensible defaults
-- Organize configurations by content tier and encounter scenario
-- Keep individual functions small and focused for maintainability
-- Test changes by entering `nix develop` and running `wowsimcli` with generated c
onfigs
-- All simulation data comes from the referenced wowsims fork
-- Challenge mode can be enabled on equipment for different stat scaling
-
-## Future Development
-- GitHub Actions integration for automated simulation updates
-- Website packaging and server configuration via Nix
-- Trinket simulation expansion beyond basic spec rankings
\ No newline at end of file

diff --git a/CLAUDE.md b/CLAUDE.md
deleted file mode 100644
index 5a2a5e5..0000000
--- a/CLAUDE.md
+++ /dev/null
@@ -1,179 +0,0 @@
-# CLAUDE.md
-
-This file provides guidance to Claude Code 
(claude.ai/code) when working with code in t
his repository.
-
-## Project Overview
-
-This is a Nix-based data pipeline for gener
ating World of Warcraft simulation leaderboa
rds and statistics. The project uses the wow
sims CLI engine to create a theorycrafting w
ebsite similar to bloodmallet, showing spec 
performance rankings and trinket data for Wo
W Mists of Pandaria.
-
-### Project Vision
-- Generate spec simulation leaderboards acr
oss different encounter types
-- Provide trinket performance data and rank
ings
-- Serve results via static website with JSO
N data files
-- Automate updates via GitHub Actions when 
upstream wowsims changes
-- Use Nix for reproducible builds and serve
r configuration
-
-## Development Environment
-
-### Setup
-- Use `nix develop` to enter the developmen
t shell which provides `wowsimcli`
-- The project uses a Nix flake with inputs 
from the wowsims MoP fork
-
-### Key Commands
-- `nix develop` - Enter development environ
ment with wowsimcli available
-- `wowsimcli sim --infile input.json` - Run
 simulation with input file
-- `wowsimcli sim --infile input.json --outf
ile results.json` - Save results to file
-- `nix flake show` - Show available flake o
utputs
-- `nix build` - Build packages (future: web
site and data generation)
-
-## Architecture
-
-### Core Structure
-- `nix/lib/` - Core simulation library func
tions
-- `nix/lib/default.nix` - Main library expo
rts (target, encounter, player, raid)
-- `nix/lib/extend.nix` - Extends nixpkgs li
b with sim functions
-- `docs/` - Example JSON configurations for
 CLI input
-
-### Key Components
-
-#### Player Configuration (`nix/lib/player.
nix`)
-- `mkPlayer` function creates player config
urations from:
-  - Race, class, spec selection
-  - Gearsets loaded from wowsims JSON files
-  - APL (Action Priority List) rotations
-  - Consumables, talents, glyphs, professio
ns
-  - Challenge mode support
-
-#### Target/Encounter System (`nix/lib/targ
et.nix`)
-- Predefined target types: `defaultRaidBoss
`, `smallTrash`, `largeTrash`
-- Configurable mob stats, damage, and mecha
nics
-
-#### Simulation (`nix/lib/simulation.nix`)
-- `mkSim` function creates full simulation 
configurations
-- Supports iterations, random seeds, differ
ent sim types
-
-### Data Sources
-- Gearsets: `${wowsims}/ui/${class}/${spec}
/gear_sets/${gearset}.gear.json`
-- APLs: `${wowsims}/ui/${class}/${spec}/apl
s/${apl}.apl.json`
-- References external wowsims repository fo
r game data
-
-## File Organization
-- Configuration examples in `docs/example_c
li_input_windwalker.json`
-- Nix library functions organized by domain
 (player, target, encounter, simulation)
-- No traditional package.json or test files
 - this is a pure Nix project
-
-## Input JSON Schema
-
-The wowsimcli expects complex JSON input fi
les with this hierarchy:
-
-### Top-Level Structure
-```json
-{
-  "requestId": "string",
-  "type": "SimTypeIndividual", 
-  "raid": RaidConfig,
-  "encounter": EncounterConfig,
-  "simOptions": SimulationOptions
-}
-```
-
-### Key Schema Components
-- **Raid**: Contains 5 parties (25-person r
aid), each with 5 player slots, plus raid-wi
de buffs/debuffs
-- **Player**: Complex nested structure with
 equipment (16 slots), consumables, talents,
 spec-specific options, and APL rotations
-- **Equipment**: Items with IDs, gems, ench
ants, reforging, tinkers
-- **APL (Action Priority Lists)**: Deep con
ditional logic trees for spell rotation deci
sions
-- **Encounter**: Target configuration, figh
t duration, execute phases, enemy stats
-- **Enumeration Patterns**: Prefixed types 
like "RaceBloodElf", "ClassMonk", "MobTypeMe
chanical"
-
-### Critical Details
-- Equipment items use game database IDs for
 items/gems/enchants
-- APL system uses complex nested conditions
 (and/or/cmp operators)
-- Stats arrays are fixed-length (22 element
s for target stats)
-- Empty `{}` objects serve as placeholders 
for unused slots
-- Spec-specific config uses dynamic keys li
ke `"windwalkerMonk": {...}`
-
-## Data Pipeline
-
-### Planned Workflow
-1. **Input Generation**: Nix functions crea
te JSON input files matching wowsims schema
-2. **Simulation**: wowsimcli processes inpu
ts and generates result data
-3. **Aggregation**: Results are collected i
nto static JSON files for website consumptio
n
-4. **Website**: Static site serves leaderbo
ards and trinket data
-5. **Automation**: GitHub Actions trigger u
pdates when upstream wowsims changes
-
-### Target Simulations
-- **Encounter Types**: Single Target, Multi
-Target, Short Single Target
-- **Scope**: All specs initially, trinket c
omparisons later
-- **Output**: JSON files for web frontend c
onsumption
-
-## Composable Component Design
-
-### Class Component Pattern
-The project uses a layered composition appr
oach for building reusable class configurati
ons:
-
-```nix
-{
-  lib,
-  components,
-  ...
-}: let
-  inherit (lib.sim.player) mkPlayer;
-  inherit (components.consumables) agilityD
ps;
-
-  # Spec-specific builder function
-  mkWindwalker = {
-    race,
-    apl,
-    gearset, 
-    talents,
-  }: mkPlayer {
-    class = "monk";
-    spec = "windwalker";
-    inherit race gearset talents apl;
-    consumables = agilityDps;  # Shared con
sumable set
-  };
-
-  # Organized configurations by tier and sc
enario
-  windwalker = {
-    talents = {
-      xuen = "213322";  # Single target bui
ld
-      rjw = "233321";   # AoE build
-    };
-    p1 = {
-      singleTarget = mkWindwalker {
-        race = "orc";
-        apl = "default";
-        gearset = "dw_p1_bis";
-        talents = windwalker.talents.xuen;
-      };
-      aoeOrc = mkWindwalker {
-        race = "orc";
-        apl = "default"; 
-        gearset = "dw_p1_bis";
-        talents = windwalker.talents.rjw;
-      };
-    };
-  };
-in windwalker
-```
-
-### Design Benefits
-- **Shared Defaults**: Common consumables, 
base configurations
-- **Scenario Organization**: Grouped by con
tent tier (p1, p2) and encounter type
-- **Talent Variants**: Named talent configu
rations for different playstyles
-- **Race Flexibility**: Easy to create vari
ants for different races
-- **Inheritance Chain**: `mkWindwalker` ? `
mkPlayer` ? JSON output
-
-## Working with the Code
-- Build reusable Nix components following t
he layered composition pattern
-- Create spec builders that inherit from `m
kPlayer` with sensible defaults
-- Organize configurations by content tier a
nd encounter scenario
-- Keep individual functions small and focus
ed for maintainability
-- Test changes by entering `nix develop` an
d running `wowsimcli` with generated configs
-- All simulation data comes from the refere
nced wowsims fork
-- Challenge mode can be enabled on equipmen
t for different stat scaling
-
-## Future Development
-- GitHub Actions integration for automated 
simulation updates
-- Website packaging and server configuratio
n via Nix
-- Trinket simulation expansion beyond basic
 spec rankings
\ No newline at end of file
 

diff --git a/nix/apps/simulation/default.nix b/nix/apps/simulation/default.nix
index 3195272..db651e1 100644
--- a/nix/apps/simulation/default.nix
+++ b/nix/apps/simulation/default.nix
@@ -20,6 +20,7 @@
       encounterType = "raid";
       targetCount = "single";
       duration = "long";
+      template = "singleTarget";
     };
 
     dps-p1-raid-three-long = mkMassSim {
@@ -30,6 +31,7 @@
       encounterType = "raid";
       targetCount = "three";
       duration = "long";
+      template = "multiTarget";
     };
 
     dps-p1-raid-cleave-long = mkMassSim {
@@ -40,6 +42,7 @@
       encounterType = "raid";
       targetCount = "cleave";
       duration = "long";
+      template = "cleave";
     };
 
     dps-p1-raid-ten-long = mkMassSim {
@@ -50,6 +53,7 @@
       encounterType = "raid";
       targetCount = "ten";
       duration = "long";
+      template = "multiTarget";
     };
   };
 

diff --git a/nix/apps/simulation/default.nix
 b/nix/apps/simulation/default.nix
index 3195272..db651e1 100644
--- a/nix/apps/simulation/default.nix
+++ b/nix/apps/simulation/default.nix
@@ -20,6 +20,7 @@
       encounterType = "raid";
       targetCount = "single";
       duration = "long";
+      template = "singleTarget";
     };
 
     dps-p1-raid-three-long = mkMassSim {
@@ -30,6 +31,7 @@
       encounterType = "raid";
       targetCount = "three";
       duration = "long";
+      template = "multiTarget";
     };
 
     dps-p1-raid-cleave-long = mkMassSim {
@@ -40,6 +42,7 @@
       encounterType = "raid";
       targetCount = "cleave";
       duration = "long";
+      template = "cleave";
     };
 
     dps-p1-raid-ten-long = mkMassSim {
@@ -50,6 +53,7 @@
       encounterType = "raid";
       targetCount = "ten";
       duration = "long";
+      template = "multiTarget";
     };
   };
 
 

diff --git a/nix/apps/simulation/mkMassSim.nix b/nix/apps/simulation/mkMassSim.nix
index 69ac672..5651ab1 100644
--- a/nix/apps/simulation/mkMassSim.nix
+++ b/nix/apps/simulation/mkMassSim.nix
@@ -10,7 +10,7 @@
 }: let
   inherit (lib.sim.simulation) mkSim;
 
-  getAllDPSSpecs = classes: let
+  getAllDPSSpecs = classes: template: let
     dpsSpecs = {
       death_knight = ["frost" "unholy"];
       druid = ["balance" "feral"];
@@ -36,10 +36,10 @@
                   && lib.hasAttr "template" classes.${className}.${specName}
                   && lib.hasAttr "p1" classes.${className}.${specName}.template
                   && lib.hasAttr "raid" classes.${className}.${specName}.template
.p1
-                  && lib.hasAttr "singleTarget" classes.${className}.${specName}.
template.p1.raid
+                  && lib.hasAttr template classes.${className}.${specName}.templa
te.p1.raid
                 then {
                   inherit className specName;
-                  config = classes.${className}.${specName}.template.p1.raid.sing
leTarget;
+                  config = classes.${className}.${specName}.template.p1.raid.${te
mplate};
                 }
                 else null
             )
@@ -58,11 +58,12 @@
     encounterType ? "raid",
     targetCount ? "single",
     duration ? "long",
+    template ? "singleTarget",
   }: let
     # Get the list of specs based on the specs parameter
     specConfigs =
       if specs == "dps"
-      then getAllDPSSpecs classes
+      then getAllDPSSpecs classes template
       else if builtins.isList specs
       then specs
       else throw "specs must be 'dps' or a list of spec configurations";

diff --git a/nix/apps/simulation/mkMassSim.n
ix b/nix/apps/simulation/mkMassSim.nix
index 69ac672..5651ab1 100644
--- a/nix/apps/simulation/mkMassSim.nix
+++ b/nix/apps/simulation/mkMassSim.nix
@@ -10,7 +10,7 @@
 }: let
   inherit (lib.sim.simulation) mkSim;
 
-  getAllDPSSpecs = classes: let
+  getAllDPSSpecs = classes: template: let
     dpsSpecs = {
       death_knight = ["frost" "unholy"];
       druid = ["balance" "feral"];
@@ -36,10 +36,10 @@
                   && lib.hasAttr "template"
 classes.${className}.${specName}
                   && lib.hasAttr "p1" class
es.${className}.${specName}.template
                   && lib.hasAttr "raid" cla
sses.${className}.${specName}.template.p1
-                  && lib.hasAttr "singleTar
get" classes.${className}.${specName}.templa
te.p1.raid
+                  && lib.hasAttr template c
lasses.${className}.${specName}.template.p1.
raid
                 then {
                   inherit className specNam
e;
-                  config = classes.${classN
ame}.${specName}.template.p1.raid.singleTarg
et;
+                  config = classes.${classN
ame}.${specName}.template.p1.raid.${template
};
                 }
                 else null
             )
@@ -58,11 +58,12 @@
     encounterType ? "raid",
     targetCount ? "single",
     duration ? "long",
+    template ? "singleTarget",
   }: let
     # Get the list of specs based on the sp
ecs parameter
     specConfigs =
       if specs == "dps"
-      then getAllDPSSpecs classes
+      then getAllDPSSpecs classes template
       else if builtins.isList specs
       then specs
       else throw "specs must be 'dps' or a 
list of spec configurations";
 

diff --git a/nix/pkgs/testRaid.nix b/nix/pkgs/testRaid.nix
index 6ab0f7a..6daae51 100644
--- a/nix/pkgs/testRaid.nix
+++ b/nix/pkgs/testRaid.nix
@@ -12,16 +12,18 @@
   # quickly sim a single spec for testing purposes
   inherit (lib.sim.simulation) mkSim;
 
-  class = "druid";
-  spec = "balance";
+  class = "shaman";
+  spec = "elemental";
+  encounterType = "raid";
+  targetCount = "cleave";
 
   raid = mkSim {
     requestId = "raidSimAsync-f2cf5e22118a43c7";
-    iterations = 1000;
-    player = classes.${class}.${spec}.template.p1.raid.singleTarget;
+    iterations = 10000;
+    player = classes.${class}.${spec}.template.p1.${encounterType}.multiTarget;
     buffs = buffs.full;
     debuffs = debuffs.full;
-    encounter = encounter.raid.long.singleTarget;
+    encounter = encounter.${encounterType}.long.threeTarget;
   };
   testRaid = writeShellApplication {
     name = "testRaid";

diff --git a/nix/pkgs/testRaid.nix b/nix/pkg
s/testRaid.nix
index 6ab0f7a..6daae51 100644
--- a/nix/pkgs/testRaid.nix
+++ b/nix/pkgs/testRaid.nix
@@ -12,16 +12,18 @@
   # quickly sim a single spec for testing p
urposes
   inherit (lib.sim.simulation) mkSim;
 
-  class = "druid";
-  spec = "balance";
+  class = "shaman";
+  spec = "elemental";
+  encounterType = "raid";
+  targetCount = "cleave";
 
   raid = mkSim {
     requestId = "raidSimAsync-f2cf5e22118a4
3c7";
-    iterations = 1000;
-    player = classes.${class}.${spec}.templ
ate.p1.raid.singleTarget;
+    iterations = 10000;
+    player = classes.${class}.${spec}.templ
ate.p1.${encounterType}.multiTarget;
     buffs = buffs.full;
     debuffs = debuffs.full;
-    encounter = encounter.raid.long.singleT
arget;
+    encounter = encounter.${encounterType}.
long.threeTarget;
   };
   testRaid = writeShellApplication {
     name = "testRaid";
 
[ BACK TO LOG ]
──────────────────────────────────────────────────────────────────────────────────────
OOKNET
────────────────────────────────────────────────
OOKNET