There are many experiments,
each experiemnts has a scope and conditions
each condition has a st of actions

Each condition is checked based on the scope

- request is checked once very early (new hook?) and temp saved into $CFG 
- session is checked once after after_require_login and the result is saved into the session

All of this will be stored into whatever db data model we want, but once it is changed I want to bake that into a $CFG->
var so that we can use this very early in the moodle bootstrap and without incurring another db call or muc call.

So I'd just serialize the data into json and jam it into the var, this also gives us an easy way of forcing it via config.php too

{
  name: 'xsendfile experiment 1',
  shortname: 'xsendfile1',
  scope: 'request',
  conditions: [
    {
      value: 60  // 60% hit this
      ipwhiteist: '123.123.123/256'
      set: [
        {
          plugin: 'core',
          name: 'foo',
          value: 'bar
        }
        {
          plugin: 'auth_saml2', // this works by temp copying into forced_plugin_settings
          name: 'foo'
          value: 'bar'
        }
      ]
    },
    {
      value: 20 // 20% hit this
    }
  ]
}
  
  




name - eg Test xsendfile
shortname = 'xsendfile' (this becomes the param name)
scope: param only, request, session, host?
enabled - on

condition(s)
 - value 's3' (if param = s3 then force on)
 - 60% - 60% of the time this will fire
 - value sets, (can be more than 1)
  - $CFG->foo = 'bar', on plugin config

 - if there is more than 1 condition, the % must total <= 100%


security

doesn't apply to admin user in this session, in case you frig something and need to disable

test mode, query param to force it to apply

cannot override forced config

blacklist, maint mode





