GPT-5 finding
Reverse map (campaignId -> configName) is not updated after new campaign creation; ad sets referencing campaignId may not update state
mediumbughigh
- scripts/postprocess-admanage-create.sh:71-74
- scripts/postprocess-admanage-create.sh:110
- scripts/postprocess-admanage-create.sh:181-185
ID_TO_NAME is only seeded from the initial state file and is never updated after creating a new campaign. If an ad set payload supplies a direct campaignId without parentCampaignConfigName referencing a campaign created earlier in the same run, the reverse lookup fails and the state write is skipped/no-op.
Recommendation
Update ID_TO_NAME after each successful campaign creation: `ID_TO_NAME["$campaign_id"]="$cfg_name"`. Optionally, rebuild the map from STATE_FILE after campaign phase completes.