#!/usr/bin/env bash
set -euo pipefail
# Run with an authenticated glab against gitlab.com. All data is synthetic.
project=$(glab api -X POST projects -f name=sigma-composer-proof-45908 -f visibility=private -f initialize_with_readme=true)
id=$(printf '%s' "$project" | python3 -c 'import sys,json; print(json.load(sys.stdin)["id"])')
glab api -X POST "projects/$id/repository/branches" -f branch=sigma -f ref=main >/dev/null
printf '%s' '{"branch":"sigma","commit_message":"Add sample","actions":[{"action":"create","file_path":"sample.txt","content":"Synthetic proof data"}]}' |
  glab api -X POST "projects/$id/repository/commits" --input - >/dev/null
glab api -X POST "projects/$id/merge_requests" -f source_branch=sigma -f target_branch=main -f title=ΟΣΑ >/dev/null
printf '%s' "$project" | python3 -c 'import sys,json; p=json.load(sys.stdin); print("Project ID:",p["id"]); print("Remote:",p["http_url_to_repo"])'
