Skip to content

Commit 154f027

Browse files
committed
Document team stacked PR policy
1 parent 32f6d67 commit 154f027

14 files changed

Lines changed: 290 additions & 227 deletions

dev/build/ProjectInstructions/TEAM_START_COMMANDS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ For Independent PRs and for the first PR in a new stacked workstream, no team cr
1717

1818
Dependent Stacked PRs may start from the documented previous PR branch only when `dev/build/ProjectInstructions/addendums/pr_workflow.md` defines the direct dependency and merge order.
1919

20+
OWNER PRs may start from synchronized `main` when independent.
21+
22+
Non-Owner team PRs use Stacked PR workstreams by default. A non-Owner team PR may start from `main` only when OWNER explicitly marks it `standalone/no-dependency`.
23+
2024
Use `dev/build/ProjectInstructions/` as the only active Project Instructions source.
2125
Read `dev/build/ProjectInstructions/addendums/team_backlog_sod_eod_standard.md` before implementation.
2226

dev/build/ProjectInstructions/addendums/branch_context_governance.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ At the start of work, report or validate:
2525
- active PR number/name or explicit `PLAN_ONLY`
2626
- requested PR branching model: Independent PR or Stacked PR
2727
- expected starting branch for the requested PR branching model
28+
- whether a non-Owner team PR has OWNER `standalone/no-dependency` approval when starting from `main`
2829
- previous PR Closed status unless this is an explicitly documented stacked PR chain
2930

3031
Session start must follow the canonical START phase in `dev/build/ProjectInstructions/addendums/project_instructions_single_source_eod_lock.md`.
@@ -35,6 +36,7 @@ Stop and report before changing files when:
3536

3637
- current branch does not match the expected branch
3738
- requested PR branching model does not match the current/start branch
39+
- a non-Owner team PR starts from `main` without OWNER `standalone/no-dependency` approval
3840
- local branch is behind or ahead unexpectedly
3941
- worktree has unrelated changes
4042
- active assignment is missing or unclear

dev/build/ProjectInstructions/addendums/branch_lock_governance.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,13 @@ This file owns branch lock enforcement and OWNER override handling; it must not
2929
- Identify the PR branching model before creating or continuing a PR branch.
3030
- Independent PRs and new stacked workstreams start from current `main`.
3131
- Dependent Stacked PRs may start from the documented previous PR branch only when a direct dependency and dependency order are documented in `dev/build/ProjectInstructions/addendums/pr_workflow.md`.
32+
- OWNER PRs may start from `main` when marked Independent and no direct dependency exists.
33+
- Non-Owner team PRs use Stacked PR workstreams by default.
34+
- A non-Owner team PR may start from `main` only when OWNER explicitly marks the PR as `standalone/no-dependency`.
3235
- Pull latest `origin/main` before creating an Independent PR branch or the first branch in a new stack.
3336
- Do not create an Independent PR branch unless current branch is `main`, worktree is clean, `main...origin/main` is `0 0`, and `HEAD` SHA matches the published EOD SHA.
3437
- HARD STOP if the current branch does not match the requested PR branching model.
38+
- HARD STOP if a non-Owner team PR starts from `main` without OWNER `standalone/no-dependency` approval.
3539
- Follow the canonical START / WORK / END lifecycle in `dev/build/ProjectInstructions/addendums/project_instructions_single_source_eod_lock.md`.
3640
- Keep work on the active branch until the PR is merged, the branch is retired, EOD closeout begins, or OWNER says to return to `main`.
3741
- For OWNER-approved stacked/sequential workstreams, PR branches/commits stay on the active team branch/workstream during the day and do not return to `main` between PRs.

dev/build/ProjectInstructions/addendums/codex_artifact_and_reporting_standard.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Every Codex execution must produce at least one repository-structured ZIP artifa
1010

1111
Each PR attempted by Codex must produce exactly one ZIP artifact representing that PR's final outcome.
1212

13-
Missing ZIP means the Codex run did not complete correctly.
13+
Missing ZIP means the Codex run is incomplete and did not complete correctly.
1414

1515
Canonical ZIP location:
1616

dev/build/ProjectInstructions/addendums/pr_workflow.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ This file owns PR lifecycle governance. It must not duplicate command phase rule
4141

4242
Every PR must declare one branching model before branch creation or branch continuation.
4343

44+
### Ownership Defaults
45+
46+
OWNER may create an Independent PR from synchronized `main` when the PR has no direct dependency.
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+
4452
### Independent PR
4553

4654
Use an Independent PR when the change has no direct dependency on another open PR.
@@ -49,7 +57,10 @@ Rules:
4957
- Independent PRs must start from synchronized `main`.
5058
- Independent PRs must target `main`.
5159
- 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`.
5262
- 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.
5364
- Codex must return to synchronized `main` before starting the next unrelated Independent PR.
5465

5566
### Stacked PR
@@ -58,6 +69,8 @@ Use a Stacked PR only when the PR has a direct dependency on the previous PR bra
5869

5970
Rules:
6071
- 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.
6174
- Stacked PRs must document the dependency order before BUILD begins.
6275
- Stacked PR reports must name:
6376
- the stack order
@@ -77,12 +90,15 @@ Codex must verify the requested PR model before changing files.
7790

7891
HARD STOP when:
7992
- 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
8094
- a Stacked PR is requested but the current/start branch is not the documented previous PR branch
8195
- the request does not say whether the PR is Independent or Stacked and the start branch is not clearly valid
8296
- a PR is described as stacked but no direct dependency or merge order is documented
8397

8498
When the model is unclear, Codex must report the current branch, expected starting branch, and the missing model/dependency information before making changes.
8599

100+
All PR branching models remain subject to the Codex Completion Contract. Missing required ZIP output means the Codex run is incomplete.
101+
86102
## Daily Branch Workflow
87103

88104
Team-neutral daily workflow:

dev/build/ProjectInstructions/addendums/project_instructions_single_source_eod_lock.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ For Independent PRs and for the first PR in a new stacked workstream, no team cr
5555

5656
For dependent Stacked PRs, the start branch may be the documented previous PR branch only when `dev/build/ProjectInstructions/addendums/pr_workflow.md` identifies a direct dependency and dependency order.
5757

58+
OWNER PRs may start from synchronized `main` when marked Independent and no direct dependency exists.
59+
60+
A non-Owner team PR may start from `main` only when OWNER explicitly marks the PR as `standalone/no-dependency`. Otherwise, non-Owner team PRs use Stacked PR workstreams by default and must start from the active team workstream branch or documented previous PR branch.
61+
5862
If any required check fails, or if the current branch does not match the requested PR model, stop before branch creation and restore the expected branch state or request OWNER direction.
5963

6064
## Branch Lifecycle (Canonical)

dev/build/ProjectInstructions/standards/CODEX_WORKFLOW_COMMANDS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ Rules:
103103
- Identify the correct branch or start point.
104104
- Identify whether the PR is Independent or Stacked.
105105
- For Stacked PRs, identify the previous PR branch and dependency order.
106+
- For non-Owner team PRs that start from `main`, identify the explicit OWNER `standalone/no-dependency` approval.
106107
- Identify the intended PR name, purpose, and scope.
107108
- Identify required validation and reporting.
108109
- Identify the required ZIP outcome path from the Codex Completion Contract.
@@ -116,13 +117,15 @@ BUILD_PR is the implementation phase.
116117
Rules:
117118
- Verify branch and worktree rules for the PR before changing files.
118119
- Verify the requested PR branching model before changing files.
120+
- Verify non-Owner team PRs are stacked by default unless OWNER marked the PR `standalone/no-dependency`.
119121
- Use the latest Project Instructions.
120122
- Stay inside the approved PR purpose.
121123
- Create required reports.
122124
- Create the required repo-structured ZIP artifact for the attempted PR according to the Codex Completion Contract.
123125
- Run scoped validation required by the PR and Project Instructions.
124126
- HARD STOP on wrong branch.
125127
- HARD STOP when the current/start branch does not match the requested Independent or Stacked PR model.
128+
- HARD STOP when a non-Owner team PR starts from `main` without OWNER `standalone/no-dependency` approval.
126129
- HARD STOP on dirty worktree when the PR requires a clean start.
127130
- HARD STOP on scope conflict.
128131
- HARD STOP on missing required Project Instructions.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# PR_26179_OWNER_011-team-stacked-pr-policy Branch Validation
2+
3+
## Result
4+
5+
PASS
6+
7+
## Checks
8+
9+
| Check | Result | Notes |
10+
| --- | --- | --- |
11+
| Stacked PR model identified | PASS | This PR depends on PR #255. |
12+
| Started from documented previous PR branch | PASS | Started from `PR_26179_OWNER_011-pr-branching-model-docs`. |
13+
| Worktree clean before branch creation | PASS | Verified before branch creation. |
14+
| PR branch created | PASS | `PR_26179_OWNER_011-team-stacked-pr-policy`. |
15+
| Work stayed on PR branch | PASS | No direct commit to `main`. |
16+
| Documentation/governance scope | PASS | Only Project Instructions and reports changed. |
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# PR_26179_OWNER_011-team-stacked-pr-policy Manual Validation Notes
2+
3+
## Notes
4+
5+
- Confirmed this policy PR is stacked on PR #255 because it refines the Independent PR vs Stacked PR model introduced there.
6+
- Confirmed the new text does not weaken dependency-order, review-order, or merge-order requirements.
7+
- Confirmed the Codex Completion Contract still requires ZIP output for all outcomes.
8+
- Confirmed missing ZIP output is now explicitly described as an incomplete Codex run.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# PR_26179_OWNER_011-team-stacked-pr-policy Report
2+
3+
## Purpose
4+
5+
Update active Project Instructions so OWNER may create independent PRs from `main`, while non-Owner teams use stacked PR workstreams by default.
6+
7+
## Branching Model
8+
9+
- Model: Stacked PR
10+
- Previous PR dependency: `PR_26179_OWNER_011-pr-branching-model-docs` / PR #255
11+
- Starting branch: `PR_26179_OWNER_011-pr-branching-model-docs`
12+
- Merge order: PR #255 first, then this PR
13+
14+
## Governance Outcome
15+
16+
- OWNER PRs may start from synchronized `main` when independent and no direct dependency exists.
17+
- Non-Owner team PRs use Stacked PR workstreams by default.
18+
- Non-Owner team PRs may start from `main` only when OWNER explicitly marks the PR as `standalone/no-dependency`.
19+
- Stacked PRs still must document dependency order, review order, and merge order.
20+
- Codex must hard-stop when a branch/model mismatch is detected.
21+
- Missing ZIP output is clarified as an incomplete Codex run.
22+
23+
## Updated Documents
24+
25+
- `dev/build/ProjectInstructions/addendums/pr_workflow.md`
26+
- `dev/build/ProjectInstructions/addendums/project_instructions_single_source_eod_lock.md`
27+
- `dev/build/ProjectInstructions/addendums/branch_lock_governance.md`
28+
- `dev/build/ProjectInstructions/addendums/branch_context_governance.md`
29+
- `dev/build/ProjectInstructions/standards/CODEX_WORKFLOW_COMMANDS.md`
30+
- `dev/build/ProjectInstructions/TEAM_START_COMMANDS.md`
31+
- `dev/build/ProjectInstructions/addendums/codex_artifact_and_reporting_standard.md`
32+
33+
## Runtime Impact
34+
35+
None. This PR changes documentation/governance only.
36+
37+
## ZIP
38+
39+
- `dev/workspace/zips/PR_26179_OWNER_011-team-stacked-pr-policy_delta.zip`

0 commit comments

Comments
 (0)