# Codex V1R2C2 Branch Sync Validation Instruction Instruction ID: v1r2c2-branch-sync-validation-v1 Version: v1 Target Agent: codex ## Objective Validate synchronization state of all git branches between local, origin (Gitea), and gitops remote. Identify divergent branches that need reconciliation. ## Preconditions - GitOps authentication healthy. - Run from workspace root (`/data/aios-gitops/workspace`). ## Validation Scope 1. **main branch sync**: local main == origin/main == gitops/main 2. **patch branch sync**: for each local branch, compare HEAD against origin and gitops remotes 3. **Current branch**: verify the active working branch is on the correct base 4. **Untracked files**: check for files that should be committed vs ignored ## Steps 1. Fetch all remotes. 2. Capture local branch HEAD hashes. 3. Capture remote origin branch HEAD hashes. 4. Capture remote gitops branch HEAD hashes. 5. For each branch, report: - Fully synced: local == origin == gitops - Divergent: local != origin or local != gitops - Missing remote: branch exists locally but not in remote 6. Check if current branch is based on main or is diverging. 7. List untracked files that may need governance. ## Return Format ``` Status: Workspace: /data/aios-gitops/workspace Main Sync: Main HEAD: Origin/main HEAD: Gitops/main HEAD: Divergent Branches: - : vs [origin|gitops] () Missing Remote Branches: - : Untracked File Count: Issues: - ``` ## Constraints - No force push. - No destructive actions. - No secret output. - Report only; do not auto-resolve discrepancies.