You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Define the repository branching policy for Independent PRs and Stacked PRs.
10
+
11
+
This document owns PR branching model decisions. Other Project Instructions documents may point here, but must not duplicate the full policy.
12
+
13
+
## Independent PR
14
+
15
+
An Independent PR is a PR with no direct dependency on another open PR.
16
+
17
+
Rules:
18
+
- Independent PRs start from synchronized `main`.
19
+
- Independent PRs target `main`.
20
+
- Independent PRs must not reuse another feature branch as their starting point.
21
+
- Independent PR work must return to synchronized `main` before another unrelated Independent PR begins.
22
+
23
+
## Stacked PR
24
+
25
+
A Stacked PR is a PR with a direct dependency on a previous PR branch or active team workstream branch.
26
+
27
+
Rules:
28
+
- Stacked PRs may start from the previous PR branch when there is a direct dependency.
29
+
- Stacked PRs belong under the documented active workstream.
30
+
- Stacked PRs must document dependency order before BUILD begins.
31
+
- A later stacked PR must not merge before every prior dependency PR is merged.
32
+
33
+
## Owner Branching Rules
34
+
35
+
OWNER may create Independent PRs from synchronized `main` when the work has no direct dependency.
36
+
37
+
OWNER may also create Stacked PRs when dependency order, reviewability, or workstream continuity requires it.
38
+
39
+
OWNER stacked PRs must document the same dependency, review, and merge order required for all stacked work.
40
+
41
+
## Non-Owner Team Branching Rules
42
+
43
+
Non-Owner teams use Stacked PR workstreams by default.
44
+
45
+
Non-Owner teams include Alfa, Bravo, Charlie, Delta, Golf, and any future non-Owner canonical team.
46
+
47
+
Non-Owner team PRs must start from the active team workstream branch or the documented previous PR branch unless OWNER explicitly grants a standalone/no-dependency exception.
48
+
49
+
## Explicit Owner Exception Process For Team Independent PRs
50
+
51
+
A non-Owner team may create an Independent PR from `main` only when OWNER explicitly marks the task:
52
+
53
+
```text
54
+
standalone/no-dependency
55
+
```
56
+
57
+
The exception must be documented before branch creation and must name:
58
+
- team
59
+
- PR name
60
+
- reason the PR has no dependency
61
+
- confirmation that the branch starts from synchronized `main`
62
+
- confirmation that the PR targets `main`
63
+
64
+
Without that explicit exception, Codex must treat the non-Owner team PR as Stacked.
65
+
66
+
## Dependency Documentation Requirements
67
+
68
+
Every Stacked PR report must name:
69
+
- stack order
70
+
- previous PR dependency
71
+
- next PR dependency, if known
72
+
- starting branch
73
+
- intended merge order
74
+
- base branch
75
+
- source branch
76
+
77
+
## Review Order
78
+
79
+
Stacked PRs must be reviewed in dependency order.
80
+
81
+
A later stacked PR may be reviewed for context, but OWNER approval must respect dependency order unless OWNER explicitly grants an exception.
82
+
83
+
## Merge Order
84
+
85
+
Stacked PRs must be merged in dependency order.
86
+
87
+
A later stacked PR must not merge before all prior dependency PRs are merged and the stack base has been updated as required by GitHub.
88
+
89
+
## Hard-Stop Validation Rules
90
+
91
+
Codex must HARD STOP before changing files when:
92
+
- the requested Independent PR does not start from `main`
93
+
- a non-Owner team PR starts from `main` without OWNER `standalone/no-dependency` approval
94
+
- the requested Stacked PR does not start from the documented previous PR branch or active workstream branch
95
+
- the Stacked PR lacks dependency order documentation
96
+
- the current branch changes unexpectedly
97
+
- the requested branch model conflicts with OWNER instructions
98
+
99
+
The hard-stop report must include:
100
+
- current branch
101
+
- expected branch
102
+
- requested PR model
103
+
- missing dependency or exception details
104
+
- worktree status
105
+
106
+
## Examples
107
+
108
+
### Owner Independent PR
109
+
110
+
```text
111
+
PR: PR_26179_OWNER_020-doc-cleanup
112
+
Model: Independent PR
113
+
Start: main
114
+
Base: main
115
+
Reason: no direct dependency
116
+
```
117
+
118
+
### Owner Stacked PR
119
+
120
+
```text
121
+
PR #1: PR_26179_OWNER_021-policy-foundation
122
+
Base: main
123
+
124
+
PR #2: PR_26179_OWNER_022-policy-followup
125
+
Base: PR_26179_OWNER_021-policy-foundation
126
+
Model: Stacked PR
127
+
Merge order: #1, then #2
128
+
```
129
+
130
+
### Non-Owner Team Stacked PR
131
+
132
+
```text
133
+
PR #1: PR_26179_ALFA_030-tool-flow-foundation
134
+
Base: main
135
+
136
+
PR #2: PR_26179_ALFA_031-tool-flow-validation
137
+
Base: PR_26179_ALFA_030-tool-flow-foundation
138
+
Model: Stacked PR
139
+
Merge order: #1, then #2
140
+
```
141
+
142
+
### Non-Owner Team Independent Exception
143
+
144
+
```text
145
+
OWNER exception: standalone/no-dependency
146
+
Team: Bravo
147
+
PR: PR_26179_BRAVO_040-small-doc-fix
148
+
Start: main
149
+
Base: main
150
+
Reason: isolated documentation fix with no branch dependency
OWNER may create an Independent PR from synchronized `main` when the PR has no direct dependency.
46
+
That document owns Independent PR, Stacked PR, Owner branching, non-Owner team branching, explicit Owner standalone/no-dependency exceptions, dependency documentation, review order, merge order, hard-stop validation rules, and examples.
47
47
48
-
Non-Owner team PRs use Stacked PR workstreams by default. A non-Owner team PR may start from `main` only when OWNER explicitly marks that PR as `standalone/no-dependency` before branch creation.
49
-
50
-
If a non-Owner team PR is not explicitly marked `standalone/no-dependency`, Codex must treat it as Stacked and verify the active team workstream branch or documented previous PR branch before changing files.
51
-
52
-
### Independent PR
53
-
54
-
Use an Independent PR when the change has no direct dependency on another open PR.
55
-
56
-
Rules:
57
-
- Independent PRs must start from synchronized `main`.
58
-
- Independent PRs must target `main`.
59
-
- Independent PRs must not reuse another feature branch as their starting point.
60
-
- OWNER PRs may use the Independent PR model when the PR has no direct dependency.
61
-
- Non-Owner team PRs may use the Independent PR model only when OWNER explicitly marks the PR as `standalone/no-dependency`.
62
-
- Codex must HARD STOP if the requested Independent PR starts from any branch other than `main`.
63
-
- Codex must HARD STOP if a non-Owner team PR starts from `main` without an explicit OWNER `standalone/no-dependency` marker.
64
-
- Codex must return to synchronized `main` before starting the next unrelated Independent PR.
65
-
66
-
### Stacked PR
67
-
68
-
Use a Stacked PR only when the PR has a direct dependency on the previous PR branch.
69
-
70
-
Rules:
71
-
- Stacked PRs may start from the previous PR branch when there is a direct dependency.
72
-
- Non-Owner team PRs should use Stacked PR workstreams by default.
73
-
- A Stacked PR belongs under the active team workstream and must use the documented previous PR branch or active workstream branch as its starting point.
74
-
- Stacked PRs must document the dependency order before BUILD begins.
75
-
- Stacked PR reports must name:
76
-
- the stack order
77
-
- the previous PR dependency
78
-
- the next PR dependency, if known
79
-
- the starting branch
80
-
- the intended merge order
81
-
- Stacked PRs must be reviewed in dependency order.
82
-
- Stacked PRs must be merged in dependency order.
83
-
- A later stacked PR must not merge before every prior dependency PR is merged.
84
-
- Codex must HARD STOP if the requested Stacked PR starts from a branch that is not the documented previous PR branch.
85
-
- Codex must HARD STOP if a Stacked PR lacks a documented dependency order.
86
-
87
-
### Model Mismatch Hard Stop
88
-
89
-
Codex must verify the requested PR model before changing files.
90
-
91
-
HARD STOP when:
92
-
- an Independent PR is requested but the current/start branch is not `main`
93
-
- a non-Owner team PR starts from `main` without explicit OWNER `standalone/no-dependency` approval
94
-
- a Stacked PR is requested but the current/start branch is not the documented previous PR branch
95
-
- the request does not say whether the PR is Independent or Stacked and the start branch is not clearly valid
96
-
- a PR is described as stacked but no direct dependency or merge order is documented
97
-
98
-
When the model is unclear, Codex must report the current branch, expected starting branch, and the missing model/dependency information before making changes.
48
+
This PR workflow document must load and follow that policy, but it must not duplicate the full policy text.
99
49
100
50
All PR branching models remain subject to the Codex Completion Contract. Missing required ZIP output means the Codex run is incomplete.
0 commit comments