Skip to content

Commit 2603a8a

Browse files
committed
Replace main branch guard with workstream guard - PR_26171_GAMMA_010-replace-main-branch-guard-with-workstream-guard
1 parent e8845da commit 2603a8a

7 files changed

Lines changed: 534 additions & 1655 deletions

docs_build/dev/PROJECT_INSTRUCTIONS.md

Lines changed: 89 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -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

9696
Before any BUILD execution, Codex must verify the current git branch.
9797

9898
Rules:
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

113135
Exception:
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

116138
Required 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

19892015
Required workflow:
19902016
1. 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.
19932019
4. Verify clean repository.
19942020
5. Create PR branch.
19952021
6. Implement changes.
@@ -1999,7 +2025,7 @@ Required workflow:
19992025
10. Create Pull Request automatically.
20002026
11. Resolve merge conflicts if encountered.
20012027
12. Re-run validation after conflict resolution.
2002-
13. Merge PR.
2028+
13. Merge PR only after explicit owner/EOD approval.
20032029
14. Return to main.
20042030
15. Pull latest main.
20052031
16. 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

20302100
Stable promotion and merge approval are owner-controlled.
20312101

20322102
Rules:
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

20482119
Required 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

20532124
Hard 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.

docs_build/dev/PROJECT_MULTI_PC.txt

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,13 +524,44 @@ Governance, recovery, diagnostics, and instruction-hardening PRs:
524524
- Must document TEAM ownership compliance in the PR report.
525525
- Recovery reports must include TEAM ownership.
526526

527+
Workstream Branch Execution Guard:
528+
- Approved execution branches are `main` and approved team workstream branches.
529+
- Approved team workstream branch format:
530+
- `team/<TEAM>/<workstream>`
531+
- Workstream branch examples:
532+
- `team/ALPHA/game-hub`
533+
- `team/BETA/messages`
534+
- `team/GAMMA/admin`
535+
- Hard stops include dirty repo, unapproved branch, TEAM mismatch, cross-team scope, detached HEAD, local/origin mismatch, and unpushed commits.
536+
- TEAM ownership must match the approved workstream branch and requested PR scope.
537+
- Cross-team work remains prohibited unless Master Control splits or assigns each PR to the correct TEAM token.
538+
539+
GitHub Authoritative Workstream Rule:
540+
- GitHub is the authoritative workstream record.
541+
- GitHub branches, commits, and pull requests are the authoritative record for active and completed Codex workstreams.
542+
- Local-only commits are prohibited.
543+
- Every completed PR scope must be committed and pushed before Codex continues to another PR.
544+
- Start-gate sync validation is PASS only when the branch is clean and `local == origin`, meaning local HEAD equals origin HEAD.
545+
- Start-gate sync validation is FAIL when:
546+
- branch is ahead of origin
547+
- branch has unpushed commits
548+
- current branch is detached HEAD
549+
- push failure is unresolved
550+
- TEAM ownership mismatches the requested PR scope
551+
- Branch ahead of origin is a hard stop.
552+
- Push failure is a hard stop until resolved.
553+
- Ownership mismatch is a hard stop.
554+
- EOD merge approval remains owner-controlled and requires explicit approval.
555+
527556
Stable and merge approval:
528557
- Stable promotion and merge approval are controlled by the assigned Team Alpha, Team Beta, or Team Gamma owner.
529558
- Master Control may recommend sequencing, but Codex must not merge or mark stable without explicit owner approval for the affected workstream.
530559

531560
Hard stop rules:
532561
- If the PR name does not include a TEAM token, stop before changes.
533562
- If the TEAM token does not match the owner map or explicit Master Control assignment, stop before changes.
563+
- If the execution branch is neither `main` nor an approved team workstream branch, stop before changes.
564+
- If branch sync validation fails, stop before changes.
534565
- If the PR scope belongs to another TEAM owner, stop before changes.
535566
- If the PR crosses multiple team ownership areas, stop and require Master Control to split or assign the work.
536567
- If the requested implementation path conflicts with the active owner path, stop before changes.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Instruction Compliance Checklist - PR_26171_GAMMA_010
2+
3+
- PR has one purpose only: PASS
4+
- Exact PR name provided: PASS
5+
- PR name includes TEAM token `GAMMA`: PASS
6+
- Exact branch name provided: PASS
7+
- Branch started from latest `main`: PASS
8+
- `docs_build/dev/PROJECT_INSTRUCTIONS.md` read before changes: PASS
9+
- `docs_build/dev/PROJECT_MULTI_PC.txt` read before changes: PASS
10+
- Instruction enforcement start gate run before changes: PASS
11+
- Repository clean before branch creation: PASS
12+
- `main` local/origin sync verified before branch creation: PASS
13+
- TEAM ownership verified as Gamma governance/instruction-hardening work: PASS
14+
- Scope limited to requested governance docs: PASS
15+
- Main-only branch guard replaced: PASS
16+
- Main-only BUILD start hard stop removed: PASS
17+
- Approved workstream branches allowed: PASS
18+
- Required hard stops preserved: PASS
19+
- GitHub authoritative sync rule preserved: PASS
20+
- Local-only commits remain prohibited: PASS
21+
- Owner-controlled EOD merge approval preserved: PASS
22+
- Runtime code unchanged: PASS
23+
- Required reports created: PASS
24+
- Manual validation notes created: PASS
25+
- ZIP required and pending final packaging: PASS
26+
- Playwright skipped with reason documented: PASS
27+
- Samples skipped with reason documented: PASS
28+
- PR merge withheld until explicit EOD approval: PASS
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Manual Validation Notes - PR_26171_GAMMA_010
2+
3+
## Scope Review
4+
5+
Reviewed the governance docs after edit:
6+
- `docs_build/dev/PROJECT_INSTRUCTIONS.md`
7+
- `docs_build/dev/PROJECT_MULTI_PC.txt`
8+
9+
Confirmed:
10+
- `MAIN BRANCH EXECUTION GUARD` is no longer present.
11+
- `WORKSTREAM BRANCH EXECUTION GUARD` is present.
12+
- The main-only BUILD start hard stop is gone.
13+
- Execution is allowed from `main` or approved team workstream branches.
14+
- Approved branch format is `team/<TEAM>/<workstream>`.
15+
- Hard stops remain for dirty repo, unapproved branch, TEAM mismatch, cross-team scope, detached HEAD, local/origin mismatch, and unpushed commits.
16+
- GitHub authoritative sync governance remains present.
17+
- Local-only commits remain prohibited.
18+
- Runtime code was not changed.
19+
- EOD merge approval remains owner-controlled and requires explicit approval.
20+
21+
## Validation Notes
22+
23+
Static validation was sufficient because this PR updates governance documentation only.
24+
25+
Skipped lanes:
26+
- Playwright was not run because no UI route, component, or browser behavior changed.
27+
- Samples smoke was not run because samples are outside the requested docs/static validation scope.
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# PR_26171_GAMMA_010-replace-main-branch-guard-with-workstream-guard
2+
3+
## Summary
4+
5+
This PR replaces the main-only branch execution guard with a workstream branch execution guard.
6+
7+
Scope completed:
8+
- Replaced `MAIN BRANCH EXECUTION GUARD` with `WORKSTREAM BRANCH EXECUTION GUARD`.
9+
- Removed the main-only BUILD start hard stop.
10+
- Allowed execution from `main` or approved team workstream branches.
11+
- Added approved workstream branch format `team/<TEAM>/<workstream>`.
12+
- Preserved hard stops for dirty repo, unapproved branch, TEAM mismatch, cross-team scope, detached HEAD, local/origin mismatch, and unpushed commits.
13+
- Preserved GitHub authoritative workstream sync governance.
14+
- Preserved owner-controlled EOD merge approval.
15+
- Did not change runtime code.
16+
17+
## Start Gate
18+
19+
Instruction compliance start gate: PASS
20+
21+
- Read `docs_build/dev/PROJECT_INSTRUCTIONS.md`: PASS
22+
- Read `docs_build/dev/PROJECT_MULTI_PC.txt`: PASS
23+
- Checked out `main`: PASS
24+
- Pulled latest `main`: PASS
25+
- Verified current branch was `main` before creating PR branch: PASS
26+
- Verified repository was clean before creating PR branch: PASS
27+
- Verified `main` local/origin sync was `0 0`: PASS
28+
- Created PR branch from `main`: PASS
29+
- PR name includes TEAM token `GAMMA`: PASS
30+
- TEAM ownership verified as Gamma governance/instruction-hardening scope: PASS
31+
- Base `main` commit: `e8845dae6`
32+
33+
## Git Workflow
34+
35+
- PR branch: `pr/26171-GAMMA-010-replace-main-branch-guard-with-workstream-guard`
36+
- Branch created from: `main`
37+
- Branch push: pending at initial report generation
38+
- Pull request: pending at initial report generation
39+
- Merge status: not merged; EOD merge requires explicit owner approval
40+
- ZIP artifact path: `tmp/PR_26171_GAMMA_010-replace-main-branch-guard-with-workstream-guard_delta.zip`
41+
42+
## Validation
43+
44+
Requested validation scope was docs/static only.
45+
46+
Executed:
47+
- `git diff --check`: PASS
48+
- Targeted text check verifying the old main-only hard stop is gone.
49+
- Targeted text check verifying approved workstream branches are allowed.
50+
- Targeted text check verifying local-only commits remain prohibited.
51+
- Targeted text check verifying GitHub authoritative sync governance remains present.
52+
- Targeted text check verifying EOD merge approval remains owner-controlled.
53+
54+
Skipped:
55+
- Playwright: skipped by request; this PR modifies governance docs only.
56+
- Samples smoke: skipped by request; this PR modifies governance docs only.
57+
58+
## Required Reports
59+
60+
- `docs_build/dev/reports/codex_review.diff`
61+
- `docs_build/dev/reports/codex_changed_files.txt`
62+
- `docs_build/dev/reports/PR_26171_GAMMA_010-replace-main-branch-guard-with-workstream-guard.md`
63+
- `docs_build/dev/reports/PR_26171_GAMMA_010-replace-main-branch-guard-with-workstream-guard-manual-validation-notes.md`
64+
- `docs_build/dev/reports/PR_26171_GAMMA_010-replace-main-branch-guard-with-workstream-guard-instruction-compliance-checklist.md`

0 commit comments

Comments
 (0)