-
Notifications
You must be signed in to change notification settings - Fork 0
PR_26179_OWNER_011-pr-branching-model-docs #255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,9 +26,12 @@ This file owns branch lock enforcement and OWNER override handling; it must not | |
|
|
||
| ## Branch Rules | ||
|
|
||
| - Start from current `main`. | ||
| - Pull latest `origin/main` before creating a work branch. | ||
| - Do not create a PR branch unless current branch is `main`, worktree is clean, `main...origin/main` is `0 0`, and `HEAD` SHA matches the published EOD SHA. | ||
| - Identify the PR branching model before creating or continuing a PR branch. | ||
| - Independent PRs and new stacked workstreams start from current `main`. | ||
| - 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`. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This gate requires the specific direct dependency and dependency order to be documented in Useful? React with 👍 / 👎. |
||
| - Pull latest `origin/main` before creating an Independent PR branch or the first branch in a new stack. | ||
| - 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. | ||
| - HARD STOP if the current branch does not match the requested PR branching model. | ||
| - Follow the canonical START / WORK / END lifecycle in `dev/build/ProjectInstructions/addendums/project_instructions_single_source_eod_lock.md`. | ||
| - 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`. | ||
| - 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. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,22 +19,69 @@ This file owns PR lifecycle governance. It must not duplicate command phase rule | |
|
|
||
| ## Standard Flow | ||
|
|
||
| 1. Start from main. | ||
| 2. Pull latest origin/main. | ||
| 3. Verify clean worktree. | ||
| 4. Create a PR branch and PR identity. | ||
| 5. Mark lifecycle state as PR Open. | ||
| 6. Plan on the same PR branch. | ||
| 7. Build on the same PR branch. | ||
| 8. Validate the change. | ||
| 9. Commit with a clear OWNER/team message. | ||
| 10. Push the branch. | ||
| 11. Open or update the draft PR. | ||
| 12. Review the PR. | ||
| 13. OWNER approves merge. | ||
| 14. Merge to main. | ||
| 15. Pull latest main before starting the next unrelated workstream, or before a new PR when the work is not an OWNER-approved stacked/sequential workstream. | ||
| 16. Verify Main Verified and Closed gates. | ||
| 1. Identify the PR branching model: Independent PR or Stacked PR. | ||
| 2. Start from the required branch for that model. | ||
| 3. Pull or confirm the required base branch is current. | ||
| 4. Verify clean worktree. | ||
| 5. Create a PR branch and PR identity. | ||
| 6. Mark lifecycle state as PR Open. | ||
| 7. Plan on the same PR branch. | ||
| 8. Build on the same PR branch. | ||
| 9. Validate the change. | ||
| 10. Commit with a clear OWNER/team message. | ||
| 11. Push the branch. | ||
| 12. Open or update the draft PR. | ||
| 13. Review the PR. | ||
| 14. OWNER approves merge. | ||
| 15. Merge to main in the valid order for the PR model. | ||
| 16. Pull latest main before starting the next unrelated workstream, or before a new PR when the work is not an OWNER-approved stacked/sequential workstream. | ||
| 17. Verify Main Verified and Closed gates. | ||
|
|
||
| ## PR Branching Models | ||
|
|
||
| Every PR must declare one branching model before branch creation or branch continuation. | ||
|
|
||
| ### Independent PR | ||
|
|
||
| Use an Independent PR when the change has no direct dependency on another open PR. | ||
|
|
||
| Rules: | ||
| - Independent PRs must start from synchronized `main`. | ||
| - Independent PRs must target `main`. | ||
| - Independent PRs must not reuse another feature branch as their starting point. | ||
| - Codex must HARD STOP if the requested Independent PR starts from any branch other than `main`. | ||
| - Codex must return to synchronized `main` before starting the next unrelated Independent PR. | ||
|
|
||
| ### Stacked PR | ||
|
|
||
| Use a Stacked PR only when the PR has a direct dependency on the previous PR branch. | ||
|
|
||
| Rules: | ||
| - Stacked PRs may start from the previous PR branch when there is a direct dependency. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The stacked rules only tell agents to start the dependent branch from the previous PR branch; unlike the Independent PR section, they never define which base/target branch to use when opening the draft PR. In a real stack opened before the prior dependency merges, defaulting the PR target to Useful? React with 👍 / 👎. |
||
| - Stacked PRs must document the dependency order before BUILD begins. | ||
|
Comment on lines
+60
to
+61
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The new stacked-PR allowance lets a dependent PR start from the documented previous branch, but this same file still has the existing Next Day Start gate later on saying no team creates a PR branch until the current branch is Useful? React with 👍 / 👎. |
||
| - Stacked PR reports must name: | ||
| - the stack order | ||
| - the previous PR dependency | ||
| - the next PR dependency, if known | ||
| - the starting branch | ||
| - the intended merge order | ||
| - Stacked PRs must be reviewed in dependency order. | ||
| - Stacked PRs must be merged in dependency order. | ||
| - A later stacked PR must not merge before every prior dependency PR is merged. | ||
| - Codex must HARD STOP if the requested Stacked PR starts from a branch that is not the documented previous PR branch. | ||
| - Codex must HARD STOP if a Stacked PR lacks a documented dependency order. | ||
|
|
||
| ### Model Mismatch Hard Stop | ||
|
|
||
| Codex must verify the requested PR model before changing files. | ||
|
|
||
| HARD STOP when: | ||
| - an Independent PR is requested but the current/start branch is not `main` | ||
| - a Stacked PR is requested but the current/start branch is not the documented previous PR branch | ||
| - the request does not say whether the PR is Independent or Stacked and the start branch is not clearly valid | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This hard-stop only fires for an omitted model when the start branch is not clearly valid, but Useful? React with 👍 / 👎. |
||
| - a PR is described as stacked but no direct dependency or merge order is documented | ||
|
|
||
| When the model is unclear, Codex must report the current branch, expected starting branch, and the missing model/dependency information before making changes. | ||
|
|
||
| ## Daily Branch Workflow | ||
|
|
||
|
|
@@ -109,7 +156,7 @@ Closed gates: | |
| - Plan, Build, validation, reports, ZIP packaging, and closeout must stay tied to the same PR identity and source branch. | ||
| - Source branches are retained by default after merge and closeout. | ||
| - Do not mix unrelated scopes. | ||
| - Do not start dependent PRs until the required base PR is merged. | ||
| - Do not start dependent PRs until the required base PR is merged unless the work is an explicitly documented Stacked PR with a direct dependency on the previous PR branch. | ||
| - Return to `main` before starting an unrelated PR or new workstream. | ||
| - Do not return to `main` between PRs in the same OWNER-approved stacked/sequential workstream unless OWNER approves an EOD or intermediate merge checkpoint. | ||
| - A team must not begin another PR if its previous PR is not Closed. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # PR_26179_OWNER_011-pr-branching-model-docs Branch Validation | ||
|
|
||
| ## Result | ||
|
|
||
| PASS | ||
|
|
||
| ## Checks | ||
|
|
||
| | Check | Result | Notes | | ||
| | --- | --- | --- | | ||
| | Started from `main` | PASS | `main...origin/main` was `0 0`. | | ||
| | Worktree clean before branch creation | PASS | Verified before branch creation. | | ||
| | PR branch created | PASS | `PR_26179_OWNER_011-pr-branching-model-docs`. | | ||
| | Work stayed on PR branch | PASS | No direct commit to `main`. | | ||
| | Documentation/governance scope | PASS | Only Project Instructions and reports changed. | |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # PR_26179_OWNER_011-pr-branching-model-docs Manual Validation Notes | ||
|
|
||
| ## Notes | ||
|
|
||
| - Reviewed active Project Instructions for existing stacked/sequential branch wording. | ||
| - Added the canonical Independent PR vs Stacked PR model in `pr_workflow.md`. | ||
| - Updated adjacent branch and command governance documents to point enforcement at the requested PR model. | ||
| - Confirmed the old dependent-PR rule now allows the explicitly documented Stacked PR exception. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| # PR_26179_OWNER_011-pr-branching-model-docs Report | ||
|
|
||
| ## Purpose | ||
|
|
||
| Define Independent PRs and Stacked PRs in active Project Instructions. | ||
|
|
||
| ## Scope | ||
|
|
||
| Documentation/governance only. No implementation code, runtime files, API files, database files, or product pages changed. | ||
|
|
||
| ## Governance Outcome | ||
|
|
||
| - `pr_workflow.md` now owns the canonical Independent PR vs Stacked PR model. | ||
| - Independent PRs must start from synchronized `main`. | ||
| - Stacked PRs may start from the documented previous PR branch only when there is a direct dependency. | ||
| - Stacked PRs must document stack order, previous dependency, next dependency when known, starting branch, and merge order. | ||
| - Stacked PRs must be reviewed and merged in dependency order. | ||
| - Codex must HARD STOP when the requested PR model does not match the current/start branch. | ||
|
|
||
| ## Updated Documents | ||
|
|
||
| - `dev/build/ProjectInstructions/addendums/pr_workflow.md` | ||
| - `dev/build/ProjectInstructions/addendums/project_instructions_single_source_eod_lock.md` | ||
| - `dev/build/ProjectInstructions/addendums/branch_lock_governance.md` | ||
| - `dev/build/ProjectInstructions/addendums/branch_context_governance.md` | ||
| - `dev/build/ProjectInstructions/standards/CODEX_WORKFLOW_COMMANDS.md` | ||
| - `dev/build/ProjectInstructions/TEAM_START_COMMANDS.md` | ||
|
|
||
| ## ZIP | ||
|
|
||
| - `dev/workspace/zips/PR_26179_OWNER_011-pr-branching-model-docs_delta.zip` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # PR_26179_OWNER_011-pr-branching-model-docs Requirement Checklist | ||
|
|
||
| | Requirement | Result | Notes | | ||
| | --- | --- | --- | | ||
| | Define Independent PRs vs Stacked PRs | PASS | Added canonical model in `pr_workflow.md`. | | ||
| | Independent PRs must start from `main` | PASS | Documented in Independent PR rules. | | ||
| | Stacked PRs may start from previous PR branch with direct dependency | PASS | Documented in Stacked PR rules and branch gates. | | ||
| | Stacked PRs must document dependency order | PASS | Required before BUILD begins and in reports. | | ||
| | Stacked PRs must be reviewed and merged in order | PASS | Required in Stacked PR rules. | | ||
| | Codex hard-stops on starting branch/model mismatch | PASS | Added to PR workflow, branch context, branch lock, and command docs. | | ||
| | Do not change implementation code | PASS | Documentation/governance only. | |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # PR_26179_OWNER_011-pr-branching-model-docs Validation Report | ||
|
|
||
| ## Validation | ||
|
|
||
| - `git diff --check`: PASS | ||
| - `npm run validate:canonical-structure`: PASS | ||
| - Project Instructions grep for Independent/Stacked PR rules: PASS | ||
|
|
||
| ## Runtime Impact | ||
|
|
||
| No runtime, API, database, or product page files changed. Playwright was not impacted. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,22 @@ | ||
| # git status --short | ||
| A dev/reports/PR_26179_ALFA_010-tool-display-single-line-summary_eod-branch-validation.md | ||
| A dev/reports/PR_26179_ALFA_010-tool-display-single-line-summary_eod-closeout-report.md | ||
| A dev/reports/PR_26179_ALFA_010-tool-display-single-line-summary_eod-manual-validation-notes.md | ||
| A dev/reports/PR_26179_ALFA_010-tool-display-single-line-summary_eod-requirement-checklist.md | ||
| A dev/reports/PR_26179_ALFA_010-tool-display-single-line-summary_eod-validation-report.md | ||
| M dev/build/ProjectInstructions/TEAM_START_COMMANDS.md | ||
| M dev/build/ProjectInstructions/addendums/branch_context_governance.md | ||
| M dev/build/ProjectInstructions/addendums/branch_lock_governance.md | ||
| M dev/build/ProjectInstructions/addendums/pr_workflow.md | ||
| M dev/build/ProjectInstructions/addendums/project_instructions_single_source_eod_lock.md | ||
| M dev/build/ProjectInstructions/standards/CODEX_WORKFLOW_COMMANDS.md | ||
| A dev/reports/PR_26179_OWNER_011-pr-branching-model-docs_branch-validation.md | ||
| A dev/reports/PR_26179_OWNER_011-pr-branching-model-docs_manual-validation-notes.md | ||
| A dev/reports/PR_26179_OWNER_011-pr-branching-model-docs_report.md | ||
| A dev/reports/PR_26179_OWNER_011-pr-branching-model-docs_requirement-checklist.md | ||
| A dev/reports/PR_26179_OWNER_011-pr-branching-model-docs_validation-report.md | ||
| M dev/reports/codex_changed_files.txt | ||
| M dev/reports/codex_review.diff | ||
|
|
||
| # git ls-files --others --exclude-standard | ||
| (no output) | ||
|
|
||
| # git diff --stat | ||
| dev/reports/codex_changed_files.txt | 55 +- | ||
| dev/reports/codex_review.diff | 2819 +---------------------------------- | ||
| 2 files changed, 88 insertions(+), 2786 deletions(-) | ||
| dev/reports/codex_changed_files.txt | 22 ++- | ||
| dev/reports/codex_review.diff | 377 ++++++++++++++++++++++++++++-------- | ||
| 2 files changed, 310 insertions(+), 89 deletions(-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For branch continuation or review fixes after a PR branch already exists, the current branch is the active PR branch, not the original starting branch (
mainfor Independent PRs or the previous branch for Stacked PRs). This new stop condition compares the requested model to the current/start branch without exempting an already-created active PR branch, so a valid continuation onPR_<name>can hard-stop even when the previous branch-creation gate was satisfied.Useful? React with 👍 / 👎.