# ia_dev shared lib ## project_config.sh Sourced by deploy scripts and gitea-issues to resolve the current project **id** and the path to its JSON config. **Standalone usage:** scripts are run from ia_dev root. Source after setting `IA_DEV_ROOT` (path to ia_dev); `PROJECT_ROOT` is derived by scripts when needed from config (e.g. project_path in conf.json). **After sourcing:** `PROJECT_SLUG` and `PROJECT_CONFIG_PATH` are set (and exported). Config path is `projects//conf.json`. For token-based resolution, `PROJECT_ENV` is also set. **Project id resolution (no fallback):** 1. **MAIL_TO** (env): search all `projects/*/conf.json` for `tickets.authorized_emails.to` matching this address (string or list of env-keyed objects). The matching project directory name is the id. 2. **AI_AGENT_TOKEN** (env): search all `projects//.secrets//ia_token` for matching token; sets `PROJECT_SLUG` and `PROJECT_ENV` (project and environment). See `projects/README.md` for the config schema.