Config Reference

Each market/KPI folder must define a config.yml.

Example

market_code: CN
kpi: store_visits
owner: Winnie Chen
week_start: 7

artifact_name: CN-store_visits

model:
  source: external_rds
  path: data/local/model/_sv_info.rds
  object_path: model
  api_model_policy: use_one_consistent_model_for_predict_and_decomp
  update_strategy: explicit

mapping:
  source: model_rds
  object_path: tbl_map

inputs:
  raw_data: data/local/input/cn_raw_import.csv
  fixed_forecast: data/local/input/cn_fixed_forecast.csv

decomp:
  synergy_vars_regex: "^(m_|family_|fammed_|pro_|orgsoc_|pr_)"
  adstock_var_regex: "..."

validation:
  require_clean_session: true
  require_predict: true
  require_decomp: true
  forbid_local_paths: true
  forbid_hidden_imports: true

Required Top-Level Keys

  • market_code
  • kpi
  • owner
  • week_start
  • artifact_name
  • model
  • mapping
  • inputs
  • decomp
  • validation

Field Notes

market_code

  • short market identifier, for example CN, IT, UK

kpi

  • KPI folder name and logical build target

owner

  • named analyst or market owner

week_start

  • 1 for Monday
  • 7 for Sunday

artifact_name

  • human-readable artefact stem used by build logic

model.source

  • where the model object comes from
  • current scaffold assumes an external RDS-style source, but this can evolve

model.path

  • explicit path to the model artefact used by the market

model.object_path

  • object name or object-path identifier within the artefact

model.api_model_policy

  • expected consistency rule for predict/decomp

model.update_strategy

  • how model updates are handled, for example explicit replacement or inherited

mapping

  • where the mapping table comes from

inputs.raw_data

  • explicit market input artefact used by transform

inputs.fixed_forecast

  • fixed forecast input if applicable

decomp.*

  • market-specific decomp regex or configuration

validation.*

  • switches describing required validation behaviour

Current Limitation

The current repo validates config shape and week-start values. It does not yet validate a full schema of allowed values for every nested field.