Skip to content

Commit f31bdb4

Browse files
committed
OWNER 010 add Codex ZIP completion contract
1 parent 8327d4e commit f31bdb4

10 files changed

Lines changed: 298 additions & 1069 deletions

dev/build/ProjectInstructions/PROJECT_INSTRUCTIONS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,4 @@ That file owns Start of Day, PLAN_PR, BUILD_PR, APPLY_PR, and invalid command be
102102
- `repository/canonical_repository_structure.md` owns all folder placement and file-placement rules.
103103
- `standards/CODEX_WORKFLOW_COMMANDS.md` owns Start of Day, PLAN_PR, BUILD_PR, APPLY_PR, and invalid command behavior.
104104
- `bootstrap/codex_start_of_day_bootstrap.md` owns Start-of-Day bootstrap architecture.
105+
- `addendums/codex_artifact_and_reporting_standard.md` owns the Codex Completion Contract and ZIP outcome rules.

dev/build/ProjectInstructions/addendums/codex_artifact_and_reporting_standard.md

Lines changed: 63 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,68 @@
44

55
Standardize Codex deliverables, completion reporting, and artifact generation.
66

7-
## ZIP Artifact Requirement
7+
## Codex Completion Contract
88

9-
Every Codex execution must produce a repo-structured ZIP artifact and the required reports.
9+
Every Codex execution must produce at least one repository-structured ZIP artifact and the required reports.
1010

11-
This applies regardless of result:
11+
Each PR attempted by Codex must produce exactly one ZIP artifact representing that PR's final outcome.
12+
13+
Missing ZIP means the Codex run did not complete correctly.
14+
15+
Canonical ZIP location:
16+
17+
```text
18+
dev/workspace/zips/
19+
```
20+
21+
ZIP outcome suffixes:
22+
23+
- `_delta.zip` = success
24+
- `_REVIEW.zip` = review-only
25+
- `_FAILED.zip` = validation or execution failure
26+
- `_HARD_STOP.zip` = governance or precondition hard stop
27+
28+
## Stacked PR Rule
29+
30+
Stacked PR work produces one ZIP per attempted PR.
31+
32+
If PR 1 succeeds and PR 2 hard-stops, produce:
33+
34+
```text
35+
PR_...001-..._delta.zip
36+
PR_...002-..._HARD_STOP.zip
37+
```
38+
39+
Do not start later stacked PRs after a failure or hard stop.
40+
41+
## ZIP Contents
42+
43+
Success ZIP contents must include:
44+
45+
- changed files
46+
- diff
47+
- PR report
48+
- validation report
49+
- requirement checklist
50+
51+
Failing PR ZIP contents must include:
52+
53+
- hard stop or failure report
54+
- branch/worktree status
55+
- validation output if run
56+
- requirement checklist
57+
- changed files and diff if changes occurred
58+
59+
Review-only ZIP contents must include:
60+
61+
- review report
62+
- branch/worktree status
63+
- requirement checklist or review checklist when applicable
64+
- supporting evidence files when applicable
65+
66+
## Applicability
67+
68+
The Codex Completion Contract applies regardless of result:
1269

1370
- success
1471
- completion
@@ -23,17 +80,11 @@ This applies regardless of result:
2380

2481
No exceptions.
2582

26-
Minimum ZIP contents:
83+
Minimum repository-structured ZIP rules:
2784

28-
- changed or preserved repo files from the run, stored at repo-relative paths
85+
- changed, preserved, or outcome evidence repo files from the run, stored at repo-relative paths
2986
- required reports under `dev/reports/`
3087

31-
ZIP artifacts must be written under:
32-
33-
```text
34-
dev/workspace/zips/
35-
```
36-
3788
Reports must remain flat under `dev/reports/`. Use descriptive filenames that include the PR, team, runner, or lane context instead of nested team or runner report folders.
3889

3990
Optional:
@@ -107,6 +158,6 @@ unless explicitly requested.
107158

108159
## No ZIP Means Incomplete
109160

110-
A task is not considered complete until the ZIP artifact is generated and reported.
161+
A task is not considered complete until the required ZIP artifact or artifacts are generated and reported.
111162

112163
If execution stops before implementation, validation, or commit, the stop result must still include the repo-structured ZIP and reports that document the hard stop, blocker, validation failure, or no-change result.

dev/build/ProjectInstructions/addendums/pr_workflow.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ Official PLAN_PR, BUILD_PR, APPLY_PR, Start of Day, and invalid command behavior
1111

1212
`dev/build/ProjectInstructions/standards/CODEX_WORKFLOW_COMMANDS.md`
1313

14+
The Codex Completion Contract for ZIP artifacts lives in:
15+
16+
`dev/build/ProjectInstructions/addendums/codex_artifact_and_reporting_standard.md`
17+
1418
This file owns PR lifecycle governance. It must not duplicate command phase rules.
1519

1620
## Standard Flow
@@ -112,11 +116,9 @@ Closed gates:
112116
- If validation fails, stop and report.
113117
- If conflict occurs, stop and report.
114118
- If OWNER decision is required, stop and report.
115-
- Every Codex execution must produce a repo-structured ZIP under `dev/workspace/zips/`.
116-
- The ZIP rule applies to implementation, audit, report-only, validation-only, governance, cleanup, hard-stop, blocked, validation-failure, partial-completion, new-information, and no-change runs.
117-
- The ZIP must include all changed or preserved repo files from the run and must not replace required reports under `dev/reports/`.
118-
- If no repo files changed, Codex must still create a ZIP containing the report that proves the no-change, hard-stop, blocked, validation-failure, or partial-completion result.
119-
- No exceptions.
119+
- Every PR lifecycle state must satisfy the Codex Completion Contract when Codex executes work for that state.
120+
- ZIP artifacts belong under `dev/workspace/zips/` and must not replace required reports under `dev/reports/`.
121+
- Stacked PR chains produce one final outcome ZIP per attempted PR and stop before later PRs after failure or hard stop.
120122

121123
## Batch Governance Mode
122124

dev/build/ProjectInstructions/bootstrap/codex_start_of_day_bootstrap.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ The bootstrap loads:
3535

3636
The bootstrap must not create branches, commit files, move files, or run implementation work by itself.
3737

38+
Start-of-Day bootstrap must satisfy the Codex Completion Contract in `dev/build/ProjectInstructions/addendums/codex_artifact_and_reporting_standard.md` with a review-only ZIP unless a hard stop occurs.
39+
3840
## Wrapper Responsibilities
3941

4042
The wrapper performs:
@@ -87,7 +89,7 @@ If a chat instruction conflicts with Project Instructions:
8789

8890
- Stop.
8991
- Do not continue the PR.
90-
- Produce the required ZIP artifact when the active artifact rules require one.
92+
- Produce the required ZIP artifact according to the Codex Completion Contract.
9193
- Document the conflict in the run summary or PR report.
9294
- Ask for OWNER direction.
9395

dev/build/ProjectInstructions/standards/CODEX_WORKFLOW_COMMANDS.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ Start of Day reports:
5050

5151
Start of Day may recommend the next execution phase, but it must not execute that phase.
5252

53+
Start of Day must satisfy the Codex Completion Contract in `dev/build/ProjectInstructions/addendums/codex_artifact_and_reporting_standard.md`. Because Start of Day is read-only discovery, its ZIP outcome is review-only unless another outcome is explicitly documented.
54+
5355
## Execution Phases
5456

5557
PLAN_PR, BUILD_PR, and APPLY_PR are Codex PR execution phases after Start of Day. They are not part of Start of Day.
@@ -84,6 +86,7 @@ Rules:
8486
- Identify the correct branch or start point.
8587
- Identify the intended PR name, purpose, and scope.
8688
- Identify required validation and reporting.
89+
- Identify the required ZIP outcome path from the Codex Completion Contract.
8790
- HARD STOP on unclear scope.
8891
- HARD STOP if Project Instructions conflict with the requested plan.
8992

@@ -96,7 +99,7 @@ Rules:
9699
- Use the latest Project Instructions.
97100
- Stay inside the approved PR purpose.
98101
- Create required reports.
99-
- Create the required repo-structured ZIP artifact when the active artifact rules require one.
102+
- Create the required repo-structured ZIP artifact for the attempted PR according to the Codex Completion Contract.
100103
- Run scoped validation required by the PR and Project Instructions.
101104
- HARD STOP on wrong branch.
102105
- HARD STOP on dirty worktree when the PR requires a clean start.
@@ -111,7 +114,7 @@ APPLY_PR is the merge and closeout phase.
111114
Rules:
112115
- Verify CI status, validation status, and mergeability before merge.
113116
- Verify the PR merge state is clean.
114-
- Verify required reports and ZIP artifacts exist.
117+
- Verify required reports and Codex Completion Contract ZIP artifacts exist.
115118
- Merge only when Project Instructions and OWNER direction allow the merge.
116119
- Update local `main` after merge.
117120
- Report final branch, worktree status, local/origin sync status, final commit, and blockers.
Lines changed: 18 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,32 @@
11
# PR_26179_OWNER_010-canonical-project-folder-instructions
22

3-
Updated: 2026-06-28T02:32:48Z
3+
Updated: 2026-06-28T02:44:56Z
44
Team: OWNER
55
Branch: PR_26179_OWNER_010-canonical-project-folder-instructions
66
Scope: Documentation/governance only. No runtime code or production pages changed.
77

88
## Summary
9-
- Standardized active Project Instructions team names to Owner, Alfa, Bravo, Charlie, Delta, and Golf.
10-
- Removed active Alpha/Gamma wording and speculative non-canonical team lists from Project Instructions.
11-
- Updated Start of Day examples to Owner, Alfa, Bravo, Charlie, Delta, and Golf.
12-
- Made `PROJECT_STATE.md` repository-truth oriented by removing transient current PR/current branch/worktree-style status.
13-
- Clarified Start of Day as read-only discovery only and separated it from PLAN_PR, BUILD_PR, and APPLY_PR execution phases.
14-
15-
## Team Naming Result
16-
- Canonical active teams: Owner, Alfa, Bravo, Charlie, Delta, Golf.
17-
- Active ProjectInstructions grep for Alpha/Gamma/non-canonical team names: PASS, no historical exceptions remain.
18-
- OWNER remains as approval authority wording where it is not used as a team name.
19-
20-
## PROJECT_STATE.md Result
21-
- Required fields present: `project_state_version`, `last_updated`, `repository_status`, `current_main_commit`, `project_instructions_version`, `repository_structure_version`, `canonical_layout_version`, `active_teams`, `latest_owner_pr`, `latest_structure_pr`, `valid_top_level_folders`, `valid_dev_folders`, `known_technical_debt`.
22-
- Removed transient fields: `current_pr`, active branch, current worktree status, today's task, and backlog task list.
23-
24-
## Lifecycle Clarification Result
25-
- Start of Day is read-only discovery only and may recommend the next phase without executing it.
26-
- PLAN_PR, BUILD_PR, and APPLY_PR are Codex PR execution phases after Start of Day.
27-
- Lifecycle documented as Start of Day {Team} -> PLAN_PR -> BUILD_PR -> APPLY_PR.
9+
- Added the Codex Completion Contract to the artifact/reporting standard.
10+
- Defined canonical ZIP location as `dev/workspace/zips/`.
11+
- Defined outcome suffixes: `_delta.zip`, `_REVIEW.zip`, `_FAILED.zip`, and `_HARD_STOP.zip`.
12+
- Clarified one ZIP per attempted PR, with at least one repository-structured ZIP for every Codex execution.
13+
- Added stacked PR ZIP handling and failure/hard-stop ZIP content requirements.
14+
- Updated Start of Day, PLAN_PR, BUILD_PR, APPLY_PR, and PR workflow references to the completion contract.
15+
16+
## Completion Contract Result
17+
- SSoT: `dev/build/ProjectInstructions/addendums/codex_artifact_and_reporting_standard.md`.
18+
- Every Codex execution must produce at least one repository-structured ZIP.
19+
- Each PR attempted by Codex must produce exactly one final outcome ZIP.
20+
- Missing ZIP means the Codex run did not complete correctly.
21+
- Grep for conflicting `exactly one repository-structured ZIP` wording: PASS, no conflicting wording found.
2822

2923
## Changed Files
3024
```
31-
M dev/build/ProjectInstructions/PROJECT_STATE.md
32-
M dev/build/ProjectInstructions/TEAM_START_COMMANDS.md
33-
M dev/build/ProjectInstructions/addendums/branch_lock_governance.md
34-
M dev/build/ProjectInstructions/addendums/multi_team.md
35-
M dev/build/ProjectInstructions/addendums/naming_registry.md
25+
M dev/build/ProjectInstructions/PROJECT_INSTRUCTIONS.md
26+
M dev/build/ProjectInstructions/addendums/codex_artifact_and_reporting_standard.md
3627
M dev/build/ProjectInstructions/addendums/pr_workflow.md
37-
M dev/build/ProjectInstructions/addendums/project_instructions_single_source_eod_lock.md
38-
M dev/build/ProjectInstructions/addendums/team_backlog_sod_eod_standard.md
39-
M dev/build/ProjectInstructions/addendums/team_release_readiness.md
40-
M dev/build/ProjectInstructions/addendums/team_start_and_release.md
41-
M dev/build/ProjectInstructions/addendums/tool_mvp_stacked_pr_standard.md
42-
M dev/build/ProjectInstructions/backlog/BACKLOG_MASTER.md
28+
M dev/build/ProjectInstructions/bootstrap/codex_start_of_day_bootstrap.md
4329
M dev/build/ProjectInstructions/standards/CODEX_WORKFLOW_COMMANDS.md
44-
M dev/build/ProjectInstructions/team_assignments/ACTIVE_TEAM_REGISTRY.md
45-
M dev/build/ProjectInstructions/team_assignments/TEAM_ASSIGNMENTS.md
46-
M dev/build/ProjectInstructions/team_assignments/team_ownership.md
4730
M dev/reports/codex_changed_files.txt
4831
M dev/reports/codex_review.diff
4932
M dev/reports/PR_26179_OWNER_010-canonical-project-folder-instructions.md
@@ -55,7 +38,7 @@ M dev/reports/PR_26179_OWNER_010-canonical-project-folder-instructions_validatio
5538
- `git diff --check`: PASS.
5639
- `npm run validate:canonical-structure`: PASS.
5740
- `node ./dev/scripts/run-platform-validation-suite.mjs`: PASS, 8/8 scenarios.
58-
- Grep ProjectInstructions for Alpha/Gamma/non-canonical team names: PASS, no historical exceptions.
41+
- Grep for `exactly one repository-structured ZIP`: PASS, no replacement needed beyond SSoT wording.
5942

6043
## Blockers
6144
None.
Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
# PR_26179_OWNER_010-canonical-project-folder-instructions Requirement Checklist
22

3-
Updated: 2026-06-28T02:32:48Z
3+
Updated: 2026-06-28T02:44:56Z
44

55
- [x] Continued on current branch.
66
- [x] Documentation/governance only.
77
- [x] Runtime code not modified.
88
- [x] Production pages not modified.
9-
- [x] Canonical teams set to Owner, Alfa, Bravo, Charlie, Delta, Golf.
10-
- [x] Active Alpha references replaced.
11-
- [x] Active Gamma references replaced or removed.
12-
- [x] Non-canonical active team-name examples removed.
13-
- [x] Start of Day examples updated.
14-
- [x] PROJECT_STATE.md transient current PR/current branch/worktree fields removed.
15-
- [x] PROJECT_STATE.md required repository-truth fields present.
16-
- [x] Start of Day documented as read-only discovery only.
17-
- [x] PLAN_PR, BUILD_PR, and APPLY_PR documented as execution phases after Start of Day.
18-
- [x] Lifecycle Start of Day -> PLAN_PR -> BUILD_PR -> APPLY_PR documented.
9+
- [x] Codex Completion Contract documented.
10+
- [x] Every Codex execution requires at least one repository-structured ZIP.
11+
- [x] Each attempted PR requires exactly one final outcome ZIP.
12+
- [x] Missing ZIP means the Codex run did not complete correctly.
13+
- [x] Canonical ZIP location documented as `dev/workspace/zips/`.
14+
- [x] ZIP suffixes documented.
15+
- [x] Stacked PR ZIP rule documented.
16+
- [x] Failure/hard-stop ZIP contents documented.
17+
- [x] Success ZIP contents documented.
18+
- [x] Start of Day, PLAN_PR, BUILD_PR, and APPLY_PR docs reference the completion contract.
19+
- [x] Conflicting exactly-one-per-execution wording checked.
1920
- [x] git diff --check passed.
2021
- [x] npm run validate:canonical-structure passed.
2122
- [x] node ./dev/scripts/run-platform-validation-suite.mjs passed.
22-
- [x] Alpha/Gamma/non-canonical team-name grep passed with no historical exceptions.
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
# PR_26179_OWNER_010-canonical-project-folder-instructions Validation Report
22

3-
Updated: 2026-06-28T02:32:48Z
3+
Updated: 2026-06-28T02:44:56Z
44

55
## Commands
66
- `git diff --check`: PASS
77
- `npm run validate:canonical-structure`: PASS
88
- `node ./dev/scripts/run-platform-validation-suite.mjs`: PASS, 8/8 scenarios
9-
- `rg` Alpha/Gamma/non-canonical team-name grep: PASS, no historical exceptions
10-
- `rg` PROJECT_STATE transient-field grep: PASS
9+
- `rg 'exactly one repository-structured ZIP' dev/build/ProjectInstructions`: PASS, no conflicting wording remains
1110

1211
## Scope Checks
1312
- Runtime code changed: NO
1413
- Production pages changed: NO
1514
- Documentation/governance only: YES
1615

1716
## Notes
18-
- OWNER remains as approval authority wording where it is not used as a team name.
19-
- PROJECT_STATE.md now describes repository truth rather than the current PR branch.
17+
- Completion contract SSoT is `dev/build/ProjectInstructions/addendums/codex_artifact_and_reporting_standard.md`.
18+
- Command and PR workflow docs point to the contract instead of duplicating ZIP rules.
2019

2120
## Blockers
2221
None.
Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,17 @@
11
PR_26179_OWNER_010-canonical-project-folder-instructions
2-
Updated: 2026-06-28T02:32:48Z
2+
Updated: 2026-06-28T02:44:56Z
33
Branch: PR_26179_OWNER_010-canonical-project-folder-instructions
44

55
Changed files staged for this update:
6-
M dev/build/ProjectInstructions/PROJECT_STATE.md
7-
M dev/build/ProjectInstructions/TEAM_START_COMMANDS.md
8-
M dev/build/ProjectInstructions/addendums/branch_lock_governance.md
9-
M dev/build/ProjectInstructions/addendums/multi_team.md
10-
M dev/build/ProjectInstructions/addendums/naming_registry.md
6+
M dev/build/ProjectInstructions/PROJECT_INSTRUCTIONS.md
7+
M dev/build/ProjectInstructions/addendums/codex_artifact_and_reporting_standard.md
118
M dev/build/ProjectInstructions/addendums/pr_workflow.md
12-
M dev/build/ProjectInstructions/addendums/project_instructions_single_source_eod_lock.md
13-
M dev/build/ProjectInstructions/addendums/team_backlog_sod_eod_standard.md
14-
M dev/build/ProjectInstructions/addendums/team_release_readiness.md
15-
M dev/build/ProjectInstructions/addendums/team_start_and_release.md
16-
M dev/build/ProjectInstructions/addendums/tool_mvp_stacked_pr_standard.md
17-
M dev/build/ProjectInstructions/backlog/BACKLOG_MASTER.md
9+
M dev/build/ProjectInstructions/bootstrap/codex_start_of_day_bootstrap.md
1810
M dev/build/ProjectInstructions/standards/CODEX_WORKFLOW_COMMANDS.md
19-
M dev/build/ProjectInstructions/team_assignments/ACTIVE_TEAM_REGISTRY.md
20-
M dev/build/ProjectInstructions/team_assignments/TEAM_ASSIGNMENTS.md
21-
M dev/build/ProjectInstructions/team_assignments/team_ownership.md
2211

2312
Working tree status at report generation:
24-
M dev/build/ProjectInstructions/PROJECT_STATE.md
25-
M dev/build/ProjectInstructions/TEAM_START_COMMANDS.md
26-
M dev/build/ProjectInstructions/addendums/branch_lock_governance.md
27-
M dev/build/ProjectInstructions/addendums/multi_team.md
28-
M dev/build/ProjectInstructions/addendums/naming_registry.md
13+
M dev/build/ProjectInstructions/PROJECT_INSTRUCTIONS.md
14+
M dev/build/ProjectInstructions/addendums/codex_artifact_and_reporting_standard.md
2915
M dev/build/ProjectInstructions/addendums/pr_workflow.md
30-
M dev/build/ProjectInstructions/addendums/project_instructions_single_source_eod_lock.md
31-
M dev/build/ProjectInstructions/addendums/team_backlog_sod_eod_standard.md
32-
M dev/build/ProjectInstructions/addendums/team_release_readiness.md
33-
M dev/build/ProjectInstructions/addendums/team_start_and_release.md
34-
M dev/build/ProjectInstructions/addendums/tool_mvp_stacked_pr_standard.md
35-
M dev/build/ProjectInstructions/backlog/BACKLOG_MASTER.md
16+
M dev/build/ProjectInstructions/bootstrap/codex_start_of_day_bootstrap.md
3617
M dev/build/ProjectInstructions/standards/CODEX_WORKFLOW_COMMANDS.md
37-
M dev/build/ProjectInstructions/team_assignments/ACTIVE_TEAM_REGISTRY.md
38-
M dev/build/ProjectInstructions/team_assignments/TEAM_ASSIGNMENTS.md
39-
M dev/build/ProjectInstructions/team_assignments/team_ownership.md

0 commit comments

Comments
 (0)