Current Task

Sprint 3 Execution Guide

This task creates ONLY:

docs/02-architecture/SPRINT3_EXECUTION_GUIDE.md

This is a documentation task only.

Do NOT implement code.

Do NOT modify source files.

Do NOT modify Sprint 3 Planning.

Do NOT create the Prompt Library.

Do NOT continue to implementation.

Wait for approval after completing this document.

---

Mandatory Reading

Governance

- AI.md v1.1
- AI_DEVELOPMENT_SYSTEM.md
- WORKFLOW.md
- PROJECT.md

Architecture

- ADR v1.0
- DBP_v1.1
- MASTER_IMPLEMENTATION_BACKLOG_v1.1

Sprint Documents

- SPRINT3_PLANNING.md

Previous Execution Guides

- SPRINT1_EXECUTION_GUIDE.md
- SPRINT2_EXECUTION_GUIDE.md

Previous Architecture Reviews

- SPRINT1_ARCHITECTURE_REVIEW.md
- SPRINT2_ARCHITECTURE_REVIEW.md

Use Sprint 2 Execution Guide as the baseline style.

---

Objective

Create the official Sprint 3 Execution Guide.

The guide defines HOW Sprint 3 implementation will be executed.

It does NOT redefine architecture.

It does NOT redefine planning.

It governs implementation workflow only.

---

Required Sections

1. Purpose

Define the role of this execution guide.

Clarify that it supplements Sprint 3 Planning and never replaces it.

---

2. Sprint Workflow

Document the execution lifecycle:

Planning

↓

Execution Guide

↓

Prompt Library

↓

Single Task Prompt

↓

Implementation

↓

Implementation Review

↓

Human Approval

↓

Git Commit

↓

Git Push

↓

Implementation Memory

↓

Next Task

---

3. Dependency Rules

State clearly:

No task may begin until:

- previous task approved
- previous task committed
- previous task pushed
- working tree clean

Dependency order always overrides numeric task IDs.

---

4. Workspace Development Rules

Document:

Workspace provisioning

Workspace middleware

Checklist evaluation

Phase evaluation

must be implemented independently.

No task may implement another task's responsibility.

---

5. Service Layer Rules

Reinforce:

Controller

↓

Service

↓

Model

Controllers never contain:

- SQL
- business rules

Models never contain:

- presentation logic

Views never contain:

- queries

Services coordinate all business workflows.

---

6. Middleware Rules

WorkspaceMiddleware

must:

- implement MiddlewareInterface
- remain stateless
- never execute business logic
- never perform provisioning
- only validate access boundaries

---

7. Transaction Rules

Workspace provisioning must:

- beginTransaction()

- commit()

- rollBack()

Every child record must be created inside one atomic transaction.

No partial provisioning.

---

8. Workspace Boundary Rules

Reinforce:

Workspace is the highest tenant boundary.

Cross-workspace access prohibited.

Every workspace query must include isolation.

Super Admin bypasses only through approved administration workflows.

---

9. Security Checklist

Include implementation verification for:

✓ CSP

✓ Rate limiting

✓ Workspace isolation

✓ SQL parameterization

✓ Transactions

✓ Audit logging

✓ escape_html()

✓ Logger

✓ Flash messages

✓ Middleware

✓ Session integrity

---

10. Implementation Review Workflow

Require:

- php -l

- security review

- acceptance criteria

- dependency verification

- implementation report

before Human Approval.

---

11. Git Workflow

AI never performs:

- git add

- git commit

- git push

Human Approver only.

---

12. Memory Workflow

Every implementation task produces:

docs/ai/memory/

Include:

- implementation summary

- design decisions

- dependency verification

- deviations

- lessons

---

13. Conflict Protocol

If any documentation conflict occurs:

STOP

Identify documents

Explain conflict

Wait for approval

Never modify frozen kernel without approval.

Reuse all approved architectural clarifications from Sprint 2.

Do NOT reopen resolved conflicts.

---

14. Quality Gates

Require verification of:

- scope boundaries

- files expected

- kernel freeze

- dependency order

- security checklist

- acceptance criteria

before implementation is considered complete.

---

15. Sprint Exit Criteria

Sprint 3 closes only after:

- all tasks completed

- architecture review accepted

- implementation memories written

- documentation synchronized (if required)

- repository clean

---

Review Requirements

Perform a complete consistency review.

Verify:

- numbering

- cross references

- terminology

- task IDs

- workflow order

- governance consistency

Correct editorial issues only.

---

Output

Produce only:

SPRINT3_EXECUTION_GUIDE.md

Provide:

1. Execution Workflow Summary

2. Security Workflow Summary

3. Dependency Workflow Summary

4. Completion Workflow Summary

5. Sprint Exit Criteria

6. Editorial Improvements Recommended

Do NOT create any implementation prompt.

Do NOT continue to Prompt Library.

Wait for Human Approval.