Current Task

Review and improve:

docs/02-architecture/SPRINT3_PLANNING.md

This is an editorial and architectural review only.

Do NOT implement code.

Do NOT create Sprint 3 Execution Guide.

Do NOT create Prompt Library.

Do NOT modify any source files.

Do NOT introduce new architecture.

The objective is to eliminate documentation ambiguities before Sprint 3 begins.

---

Mandatory Review

Review against:

- AI.md v1.1
- AI_DEVELOPMENT_SYSTEM.md
- WORKFLOW.md
- PROJECT.md
- ADR v1.0
- DBP v1.1
- MASTER_IMPLEMENTATION_BACKLOG_v1.1
- SPRINT1_ARCHITECTURE_REVIEW.md
- SPRINT2_ARCHITECTURE_REVIEW.md

Use the approved Sprint 2 architecture as the baseline.

---

Perform the following review:

### 1. View Architecture Consistency

Verify that every planned view location is compatible with the frozen BaseController::render() implementation.

If any Workspace view is documented under:

app/modules/Workspace/views/

replace it with the centralized architecture:

app/views/workspace/

following the approved AUTH-001 clarification.

This is NOT a new deviation.

It inherits the approved centralized view architecture established in Sprint 2.

---

### 2. Middleware Registration Consistency

Review every middleware reference.

Sprint 1 established that middleware registration uses fully-qualified class names.

Do not introduce middleware aliases unless they already exist in the frozen framework.

If "workspace" alias appears anywhere,
replace documentation with the actual middleware class:

App\Middleware\WorkspaceMiddleware

unless an existing alias mechanism is already documented.

---

### 3. Support Session Validation

Review the WorkspaceMiddleware specification.

If support_sessions is already defined in PDD v1.0,
retain it.

Otherwise:

remove the dependency entirely from Sprint 3.

Do not introduce undocumented database dependencies.

---

### 4. Workspace Boundary Principle

Add a new architecture subsection:

Workspace Boundary Principle

Document that:

- Workspace is the highest tenant isolation boundary.
- Couple and Crew requests must always remain inside one workspace.
- Every workspace-scoped query must include workspace isolation.
- Super Admin bypasses only through explicitly approved administration workflows.
- Cross-workspace reads, writes, updates and deletes are prohibited.

This is an architectural principle.

Not an implementation task.

---

### 5. WS-003 Clarification

Clarify that Workspace lifecycle evaluation consists of three logical stages:

Phase Evaluation

↓

Persistence

↓

Audit Logging

No implementation change.

Editorial clarification only.

---

### 6. Checklist Clarification

Clarify that:

WorkspaceService evaluates checklist state.

WorkspaceModel performs database queries.

Views never query the database directly.

---

### 7. Testing Improvements

Add one additional verification scenario.

When a workspace becomes archived or purged while a Couple or Crew session is active:

- WorkspaceMiddleware must deny access.
- The user must receive the appropriate response according to the architecture.
- No cross-workspace access may occur.

---

### 8. Exit Criteria

Add:

"No authenticated user can access resources belonging to another workspace."

---

### 9. Technical Debt Review

If Sprint 3 is not expected to introduce any new technical debt,
explicitly state:

"No new technical debt expected."

If new debt is discovered,
document it formally.

---

### 10. Consistency Review

Review the entire document for:

- section numbering
- terminology
- task IDs
- file paths
- middleware names
- cross references
- Sprint numbering
- wording consistency
- dependency order

Correct editorial inconsistencies only.

Do not change architecture.

---

Output

Provide a concise review report including:

1. Editorial Improvements
2. Architecture Clarifications
3. Repository Consistency Findings
4. Documentation Corrections
5. Numbering / Cross-reference Corrections
6. Governance Changes (if any)
7. Architecture Changes (if any)
8. Final Recommendation

If no further architectural issues remain:

Status:
FINAL

Version:
1.0 (Final)

Ready for:
SPRINT3_EXECUTION_GUIDE.md