Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 87 additions & 8 deletions dev/build/ProjectInstructions/PROJECT_INSTRUCTIONS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,77 @@
# Startup Contract

Before performing ANY task, Codex must:

- Read `dev/build/ProjectInstructions/PROJECT_INSTRUCTIONS_VERSION.md`.
- Read the latest `dev/build/ProjectInstructions/PROJECT_INSTRUCTIONS.md` from the repository.
- Treat repository Project Instructions as the only authoritative source.
- Discard previously remembered Project Instructions before every Codex task.
- Never allow conversation memory to override repository instructions.
- Load all referenced instruction documents required by this file and the task.
- Validate canonical paths.
- Validate branching model.
- Validate ZIP and report locations.

Every Codex response must begin with:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve strict machine-readable response formats

For review or validation runs where the caller requires a strict JSON or other machine-readable payload, this unconditional prefix makes it impossible to satisfy the caller while also following Project Instructions, and the new section explicitly applies to Review and Validation outcomes. In those contexts the startup prose corrupts the response before the required payload can be parsed, so the contract needs an exception or alternate artifact-based proof for schema-constrained outputs.

Useful? React with 👍 / 👎.


```text
Startup Validation
==================

Reading latest (v<version>) Project Instructions... PASS

Instruction Source
------------------
Repository ........ PASS
Cached Memory ..... DISCARDED

Canonical paths
---------------
Reports .......... dev/reports
ZIPs ............. dev/workspace/zips

Branching model
---------------
Owner ............ Independent PRs allowed
Teams ............ Stacked PRs by default

Legacy path check
-----------------
tmp/ ............. PASS (not used)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Do not mark the required tmp ZIP path unused

The root /workspace/HTML-JavaScript-Gaming/AGENTS.md Packaging rule says every BUILD ZIP output path is <project folder>/tmp/<TASK_NAME>_delta.zip, but this mandatory startup block now tells BUILD tasks that tmp/ is not used. Because the block applies to BUILD outcomes, agents following it will omit the ZIP location required by the repo-level instructions unless this is reconciled or the precedence is made explicit.

Useful? React with 👍 / 👎.

docs_build/ ...... PASS (not used)

Project Instructions loaded successfully.
```

If Codex cannot determine the current version or cannot validate canonical paths, it must STOP before performing any work.

Failure response example:

```text
Startup Validation
==================

Unable to determine Project Instructions version.

STOP

Project Instructions were not successfully loaded.
```

This startup validation applies to every Codex task and outcome:

- PLAN
- BUILD
- APPLY
- Review
- Audit
- Governance
- Validation
- Read-only
- Hard stop
- No-op
- Partial completion

# Project Instructions

## Purpose
Expand Down Expand Up @@ -41,23 +115,25 @@ Rules:

## Current Version/Date

- Project Instructions Version: 2026-06-28.PR_26172_OWNER_034
- Project Instructions Version: 2026.06.28.001
- Date: 2026-06-28
- Owner: OWNER

## Required Read Order

1. Always read `dev/build/ProjectInstructions/PROJECT_INSTRUCTIONS.md`.
2. Always read `dev/build/ProjectInstructions/PROJECT_STATE.md`.
3. Always read `dev/build/ProjectInstructions/repository/canonical_repository_structure.md`.
4. For Codex workflow command interpretation, read `dev/build/ProjectInstructions/standards/CODEX_WORKFLOW_COMMANDS.md`.
5. For Start of Day, read `dev/build/ProjectInstructions/bootstrap/codex_start_of_day_bootstrap.md`.
6. Load team, backlog, database, runtime, theme, or other specialist documents only when the current task requires them.
1. Always read `dev/build/ProjectInstructions/PROJECT_INSTRUCTIONS_VERSION.md`.
2. Always read `dev/build/ProjectInstructions/PROJECT_INSTRUCTIONS.md`.
3. Always read `dev/build/ProjectInstructions/PROJECT_STATE.md`.
4. Always read `dev/build/ProjectInstructions/repository/canonical_repository_structure.md`.
5. For Codex workflow command interpretation, read `dev/build/ProjectInstructions/standards/CODEX_WORKFLOW_COMMANDS.md`.
6. For Start of Day, read `dev/build/ProjectInstructions/bootstrap/codex_start_of_day_bootstrap.md`.
7. Load team, backlog, database, runtime, theme, or other specialist documents only when the current task requires them.

## Load Graph

```text
PROJECT_INSTRUCTIONS.md
|-- PROJECT_INSTRUCTIONS_VERSION.md
|-- PROJECT_STATE.md
|-- repository/canonical_repository_structure.md
|-- standards/CODEX_WORKFLOW_COMMANDS.md
Expand All @@ -76,6 +152,7 @@ PROJECT_INSTRUCTIONS.md

## When-To-Load Rules

- `PROJECT_INSTRUCTIONS_VERSION.md`: always.
- `PROJECT_INSTRUCTIONS.md`: always.
- `PROJECT_STATE.md`: always.
- `repository/canonical_repository_structure.md`: always.
Expand Down Expand Up @@ -109,6 +186,7 @@ That file owns Start of Day, PLAN_PR, BUILD_PR, APPLY_PR, and invalid command be

## Referenced Documents

- Project Instructions version: `dev/build/ProjectInstructions/PROJECT_INSTRUCTIONS_VERSION.md`
- Project state: `dev/build/ProjectInstructions/PROJECT_STATE.md`
- Repository folder placement SSoT: `dev/build/ProjectInstructions/repository/canonical_repository_structure.md`
- Codex workflow commands: `dev/build/ProjectInstructions/standards/CODEX_WORKFLOW_COMMANDS.md`
Expand All @@ -130,7 +208,8 @@ That file owns Start of Day, PLAN_PR, BUILD_PR, APPLY_PR, and invalid command be

## Single Source Of Truth Decisions

- `PROJECT_INSTRUCTIONS.md` owns the manual entry point, required read order, load graph, stop gates, execution modes, and pointers.
- `PROJECT_INSTRUCTIONS_VERSION.md` owns the current Project Instructions version and startup version proof.
- `PROJECT_INSTRUCTIONS.md` owns the manual entry point, startup contract, required read order, load graph, stop gates, execution modes, and pointers.
- `PROJECT_STATE.md` owns machine-friendly project state metadata.
- `repository/canonical_repository_structure.md` owns all folder placement and file-placement rules.
- `standards/CODEX_WORKFLOW_COMMANDS.md` owns Start of Day, PLAN_PR, BUILD_PR, APPLY_PR, and invalid command behavior.
Expand Down
13 changes: 13 additions & 0 deletions dev/build/ProjectInstructions/PROJECT_INSTRUCTIONS_VERSION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Project Instructions Version

Current Project Instructions Version: 2026.06.28.001

Last Updated: 2026-06-28

## Breaking Changes Summary

- Codex startup validation is mandatory before every task outcome.
- Project Instructions versions are repository-owned and increment independently of PR numbers.
- Codex must read this version file and the latest repository copy of `PROJECT_INSTRUCTIONS.md` before performing work.
- Codex must discard previously remembered Project Instructions and treat the repository copy as authoritative.
- Codex must validate canonical report and ZIP paths, branching model, and legacy path avoidance before work proceeds.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# PR_26179_OWNER_012-project-instructions-startup-validation Branch Validation

## Result

PASS

## Checks

| Check | Result | Notes |
| --- | --- | --- |
| Stacked PR model identified | PASS | This PR depends on PR #256. |
| Started from documented previous PR branch | PASS | Started from `PR_26179_OWNER_011-team-stacked-pr-policy`. |
| Worktree clean before branch creation | PASS | Verified before branch creation. |
| PR branch created | PASS | `PR_26179_OWNER_012-project-instructions-startup-validation`. |
| 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,12 @@
# PR_26179_OWNER_012-project-instructions-startup-validation Manual Validation Notes

## Notes

- Confirmed the Startup Contract is the first section in `PROJECT_INSTRUCTIONS.md`.
- Confirmed `PROJECT_INSTRUCTIONS_VERSION.md` exists in the active Project Instructions folder.
- Confirmed Project Instructions version uses repository-owned `2026.06.28.001` format rather than PR-number format.
- Confirmed the startup response block includes `Instruction Source`, `Repository ........ PASS`, and `Cached Memory ..... DISCARDED`.
- Confirmed the Startup Contract says conversation memory must never override repository instructions.
- Confirmed the startup response block uses `dev/reports` and `dev/workspace/zips`.
- Confirmed the legacy path check calls out `tmp/` and `docs_build/` as not used.
- Confirmed no runtime or product files were modified.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# PR_26179_OWNER_012-project-instructions-startup-validation Report

## Purpose

Strengthen the Project Instructions startup contract so every Codex task proves it loaded the latest Project Instructions before performing work.

## Branching Model

- Model: Stacked PR
- Previous PR dependency: `PR_26179_OWNER_011-team-stacked-pr-policy` / PR #256
- Starting branch: `PR_26179_OWNER_011-team-stacked-pr-policy`
- Merge order: PR #255, then PR #256, then this PR

## Governance Outcome

- Added `dev/build/ProjectInstructions/PROJECT_INSTRUCTIONS_VERSION.md`.
- Replaced PR-shaped Project Instructions versioning with repository-owned version `2026.06.28.001`.
- Added a mandatory Startup Contract at the top of `PROJECT_INSTRUCTIONS.md`.
- Required Codex to read the version file and latest repository Project Instructions before every task.
- Required Codex to discard remembered Project Instructions in favor of the repository copy.
- Added explicit startup output for `Instruction Source`, proving repository instructions are used and cached memory is discarded.
- Documented that conversation memory must never override repository instructions.
- Required startup validation for canonical paths, branching model, ZIP/report locations, and legacy path avoidance.
- Added failure behavior when the version or canonical paths cannot be determined.
- Documented that the startup validation applies to PLAN, BUILD, APPLY, Review, Audit, Governance, Validation, Read-only, Hard stop, No-op, and Partial completion outcomes.

## Runtime Impact

None. This PR changes documentation/governance only.

## ZIP

- `dev/workspace/zips/PR_26179_OWNER_012-project-instructions-startup-validation_delta.zip`
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# PR_26179_OWNER_012-project-instructions-startup-validation Requirement Checklist

| Requirement | Result | Notes |
| --- | --- | --- |
| Create `PROJECT_INSTRUCTIONS_VERSION.md` | PASS | Added under `dev/build/ProjectInstructions/`. |
| Version file contains current version | PASS | `2026.06.28.001`. |
| Version format is repository-owned, not PR-owned | PASS | Version increments independently of PR numbers. |
| Version file contains last updated | PASS | `2026-06-28`. |
| Version file contains breaking changes summary | PASS | Added concise startup validation summary. |
| Add mandatory Startup Contract at top of `PROJECT_INSTRUCTIONS.md` | PASS | Added before the main Project Instructions heading. |
| Require reading version file and latest Project Instructions | PASS | Included in Startup Contract. |
| Require repository copy as authoritative and discard memory | PASS | Included in Startup Contract. |
| Conversation memory must never override repository instructions | PASS | Included in Startup Contract. |
| Require loading referenced instruction documents | PASS | Included in Startup Contract. |
| Require canonical path, branching model, ZIP/report validation | PASS | Included in Startup Contract. |
| Add mandatory response block | PASS | Added exact startup validation response format with Instruction Source section. |
| Add failure behavior | PASS | Added STOP example and pre-work stop rule. |
| Apply to every Codex task type | PASS | Listed all requested task/outcome types. |
| Do not modify implementation code | PASS | Documentation/governance only. |
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# PR_26179_OWNER_012-project-instructions-startup-validation Validation Report

## Validation

- `git diff --check`: PASS
- `npm run validate:canonical-structure`: PASS
- Project Instructions grep for startup validation contract: PASS
- Project Instructions grep for repository-owned version format and Instruction Source output: PASS

## Playwright

Not impacted. No runtime, UI, API, database, or product page files changed.
18 changes: 6 additions & 12 deletions dev/reports/codex_changed_files.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
# git status --short
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/codex_artifact_and_reporting_standard.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-team-stacked-pr-policy_branch-validation.md
A dev/reports/PR_26179_OWNER_011-team-stacked-pr-policy_manual-validation-notes.md
A dev/reports/PR_26179_OWNER_011-team-stacked-pr-policy_report.md
A dev/reports/PR_26179_OWNER_011-team-stacked-pr-policy_requirement-checklist.md
A dev/reports/PR_26179_OWNER_011-team-stacked-pr-policy_validation-report.md
M dev/build/ProjectInstructions/PROJECT_INSTRUCTIONS.md
M dev/build/ProjectInstructions/PROJECT_INSTRUCTIONS_VERSION.md
M dev/reports/PR_26179_OWNER_012-project-instructions-startup-validation_manual-validation-notes.md
M dev/reports/PR_26179_OWNER_012-project-instructions-startup-validation_report.md
M dev/reports/PR_26179_OWNER_012-project-instructions-startup-validation_requirement-checklist.md
M dev/reports/PR_26179_OWNER_012-project-instructions-startup-validation_validation-report.md
Comment on lines +2 to +7

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Refresh the changed-files manifest for this commit

For ea1c0965^..ea1c0965, several files are added and codex_review.diff is modified, but this manifest reports the new version/report files as M and omits both the added branch-validation report and the modified diff artifact. If this file is packaged or used to audit the PR scope, consumers miss required files and cannot distinguish newly created artifacts from pre-existing ones, so regenerate it from the actual PR-base diff/status before closeout.

Useful? React with 👍 / 👎.


# git ls-files --others --exclude-standard
(no output)
Expand Down
Loading
Loading