@@ -91,30 +91,56 @@ User:
9191- Do not expand scope beyond the PR
9292- Do not modify ` start_of_day ` folders unless requested
9393
94- ## MAIN BRANCH EXECUTION GUARD
94+ ## WORKSTREAM BRANCH EXECUTION GUARD
9595
9696Before any BUILD execution, Codex must verify the current git branch.
9797
9898Rules:
99- - The required execution branch is :
99+ - Approved execution branches are :
100100 - ` main `
101- - If the current branch is not ` main ` :
101+ - approved team workstream branches
102+ - Approved team workstream branch format:
103+ - ` team/<TEAM>/<workstream> `
104+ - Workstream branch examples:
105+ - ` team/ALPHA/game-hub `
106+ - ` team/BETA/messages `
107+ - ` team/GAMMA/admin `
108+ - The repository must be clean before file changes.
109+ - The current branch must not be detached HEAD.
110+ - The current branch must have an origin upstream unless a new PR branch has just been created from an approved execution branch.
111+ - Local branch HEAD must match origin branch HEAD when an origin upstream exists.
112+ - TEAM ownership must match the approved workstream branch and requested PR scope.
113+ - PR scope must stay inside TEAM ownership.
114+ - If the current branch is neither ` main ` nor an approved team workstream branch:
102115 - HARD STOP.
103116 - Do not create code changes.
104117 - Do not create implementation PRs.
105118 - Do not create ZIP artifacts.
106119 - Do not continue execution.
120+ - If the repository is dirty, HARD STOP.
121+ - If the current branch is detached HEAD, HARD STOP.
122+ - If local branch HEAD does not equal origin branch HEAD when an origin upstream exists, HARD STOP.
123+ - If the current branch is ahead of origin or has unpushed commits, HARD STOP.
124+ - If TEAM ownership mismatches the branch or scope, HARD STOP.
125+ - If cross-team scope is attempted without explicit Master Control assignment, HARD STOP.
107126- Codex must report:
108127 - current branch
109- - expected branch (` main ` )
128+ - expected branch (` main ` or approved ` team/<TEAM>/<workstream> ` )
110129 - local branches found
111- - Codex may continue only after the user explicitly returns to ` main ` .
130+ - upstream branch
131+ - local/origin sync PASS/FAIL
132+ - TEAM ownership PASS/FAIL
133+ - Codex may continue only after the user explicitly moves to ` main ` or an approved team workstream branch and all guard checks pass.
112134
113135Exception:
114- - Explicit branch-audit or branch-comparison PRs may inspect non-main branches but must not perform implementation work on them.
136+ - Explicit branch-audit or branch-comparison PRs may inspect unapproved branches but must not perform implementation work on them.
115137
116138Required report output:
117139- Current branch
140+ - Expected branch
141+ - Upstream branch
142+ - Local/origin sync PASS/FAIL
143+ - TEAM ownership PASS/FAIL
118144- Branch validation PASS/FAIL
119145
120146## SLIDER VALUE VISIBILITY REQUIREMENT
@@ -1988,8 +2014,8 @@ Codex owns Git execution for implementation PRs.
19882014
19892015Required workflow:
199020161 . Verify current branch.
1991- 2 . Checkout main.
1992- 3 . Pull latest main .
2017+ 2 . Checkout ` main ` or the approved team workstream branch .
2018+ 3 . Pull latest approved execution branch .
199320194 . Verify clean repository.
199420205 . Create PR branch.
199520216 . Implement changes.
@@ -1999,7 +2025,7 @@ Required workflow:
1999202510 . Create Pull Request automatically.
2000202611 . Resolve merge conflicts if encountered.
2001202712 . Re-run validation after conflict resolution.
2002- 13 . Merge PR.
2028+ 13 . Merge PR only after explicit owner/EOD approval .
2003202914 . Return to main.
2004203015 . Pull latest main.
2005203116 . Continue to next approved PR.
@@ -2009,7 +2035,9 @@ Rules:
20092035- Do not ask the user if a branch should be pushed.
20102036- Treat PR creation as required.
20112037- Treat branch push as required.
2012- - Treat merge as required after validation passes.
2038+ - Treat merge as required only after validation passes and explicit owner/EOD approval is provided.
2039+ - Local-only commits are prohibited as completed workstream state.
2040+ - Every completed PR scope must be committed and pushed before Codex continues to another PR.
20132041- If GitHub prompts ` Would you like to create a Pull Request? ` , answer YES automatically.
20142042- If merge conflicts occur:
20152043 - preserve latest main
@@ -2025,15 +2053,58 @@ Required Git workflow report fields:
20252053- merge result
20262054- final main commit
20272055
2056+ ## GITHUB AUTHORITATIVE WORKSTREAM RULE
2057+
2058+ GitHub is the authoritative workstream record.
2059+
2060+ Rules:
2061+ - GitHub branches, commits, and pull requests are the authoritative record for active and completed Codex workstreams.
2062+ - Local-only commits are prohibited.
2063+ - A PR scope is not complete until its scoped changes are committed and pushed to GitHub.
2064+ - Every completed PR scope must be committed and pushed before Codex continues to another PR.
2065+ - Push failure is a hard stop until resolved.
2066+ - A branch ahead of origin is a hard stop because it contains unpushed commits.
2067+ - Detached HEAD execution is prohibited for PR work.
2068+ - Ownership mismatch is a hard stop.
2069+ - This rule does not authorize merging.
2070+ - EOD merge approval remains owner-controlled and requires explicit approval.
2071+
2072+ Start-gate sync validation:
2073+ - PASS when:
2074+ - current branch is not detached
2075+ - repository is clean
2076+ - current branch has an origin upstream
2077+ - ` local == origin `
2078+ - local branch HEAD equals origin branch HEAD
2079+ - TEAM ownership matches the requested PR scope
2080+ - FAIL when:
2081+ - current branch is detached HEAD
2082+ - repository is dirty
2083+ - branch is ahead of origin
2084+ - branch has unpushed commits
2085+ - local branch HEAD does not equal origin branch HEAD
2086+ - push failure is unresolved
2087+ - TEAM ownership mismatches the requested PR scope
2088+
2089+ Required report output:
2090+ - current branch
2091+ - upstream branch
2092+ - local commit
2093+ - origin commit
2094+ - local/origin sync PASS/FAIL
2095+ - push result
2096+ - TEAM ownership PASS/FAIL
2097+
20282098## OWNER-CONTROLLED STABLE AND MERGE APPROVAL
20292099
20302100Stable promotion and merge approval are owner-controlled.
20312101
20322102Rules:
20332103- Codex may prepare scoped changes, reports, validation evidence, ZIP artifacts, branches, and PRs.
2034- - Codex must not merge a PR or mark a workstream stable without explicit approval from the assigned Team Alpha or Team Beta owner.
2104+ - Codex must not merge a PR or mark a workstream stable without explicit approval from the assigned Team Alpha, Team Beta, or Team Gamma owner.
20352105- Master Control may recommend sequencing or assignment, but affected workstream owners control stable and merge approval.
20362106- This targeted section supersedes older automatic-merge wording when approval ownership is in question.
2107+ - EOD merge approval remains owner-controlled and requires explicit approval.
20372108
20382109## CODEX INSTRUCTION ENFORCEMENT START GATE
20392110
@@ -2047,14 +2118,19 @@ Required instruction reads:
20472118
20482119Required pre-change report:
20492120- Codex must report instruction compliance as ` PASS ` or ` FAIL ` before making file changes.
2050- - The report must include branch, clean status, PR TEAM owner, implementation path, validation scope, required report list, and ZIP requirement.
2121+ - The report must include branch, expected branch, upstream branch, local/origin sync status, clean status, PR TEAM owner, implementation path, validation scope, required report list, and ZIP requirement.
20512122- Any ` FAIL ` is a hard stop unless the PR explicitly scopes branch audit or recovery documentation without implementation.
20522123
20532124Hard stops before changes:
2054- - If the current branch is not ` main ` , HARD STOP.
2125+ - If the current branch is neither ` main ` nor an approved team workstream branch , HARD STOP.
20552126- If the repository is not clean before the PR branch is created, HARD STOP.
2127+ - If the current branch is detached HEAD, HARD STOP.
2128+ - If local branch HEAD does not equal origin branch HEAD when an origin upstream exists, HARD STOP.
2129+ - If the current branch is ahead of origin or has unpushed commits, HARD STOP.
2130+ - If a previous push failed and remains unresolved, HARD STOP.
20562131- If the PR name does not include a required TEAM token, HARD STOP.
20572132- If the PR TEAM owner does not match the team ownership map in ` PROJECT_MULTI_PC.txt ` , HARD STOP.
2133+ - If cross-team scope is attempted without explicit Master Control assignment, HARD STOP.
20582134- If the PR asks for implementation and the implementation path is wrong, HARD STOP.
20592135- If a PR asks for functional parity and only placeholder-only work is possible, HARD STOP and report the missing source or blocker.
20602136- If scoped validation is skipped without a documented reason, HARD STOP.
0 commit comments