# Enterprise Completeness

Before closing every phase, the Framework **must** verify the dimensions below. If anything required for the **current phase** is missing, it **must** be implemented before status may become Complete.

Companion docs: [enterprise-phase-discovery.md](enterprise-phase-discovery.md) · [definition-of-done.md](definition-of-done.md) · [mandatory-phase-artifacts.md](mandatory-phase-artifacts.md) · [quality-gates.md](quality-gates.md) · [ADR-018](../architecture/adr/ADR-018.md) · [ADR-019](../architecture/adr/ADR-019.md).

## Completeness Dimensions

| Dimension | Pass means |
| --- | --- |
| Discovery completeness | Discovery Record present; Missing→Implement gaps closed; boundaries respected |
| Business completeness | All in-scope / Discovery-promoted capabilities delivered; CRUD-only rejected; domain rules enforced |
| Architectural completeness | Boundaries, layering, ADRs, FE/BE, DB-per-service respected |
| API completeness | REST + health + capabilities/metrics as required; OpenAPI accurate; list UX (page/filter/sort/search) |
| Permission completeness | Every privileged route mapped; permission tree documented; denial tests |
| Capability completeness | Discoverable features exposed; entitlement keys documented when gated |
| Event completeness | State changes that matter cross-service emit outbox events; catalog updated |
| Migration completeness | Owning-service Alembic revision(s); upgrade smoke; notes in handover |
| Repository completeness | Tenant-scoped persistence; soft-delete defaults; no business logic in repos |
| Validation completeness | Edge + domain validators; illegal transitions rejected with stable codes |
| Security completeness | Authn/authz; no secret leakage; provider credentials owned correctly |
| Performance completeness | Indexes; no obvious N+1; hot paths validated or justified N/A |
| Documentation completeness | Phase, registries, manifests, reference, handover current |
| Testing completeness | Unit, integration, architecture, security, tenant, docs tests as required |
| Tenant isolation | Schema + query + API + negative tests |
| Provider abstraction | External systems behind protocols; registry updated |
| Integration completeness | Only API / Events / Provider interfaces — no foreign DB or duplicated logic |
| Operational readiness | Health, metrics/logging, config, jobs when required |
| Developer experience | Service README, OpenAPI, clear errors, runnable tests |
| Maintainability | Clear layering, no drive-by refactors, patterns match sibling services |
| Self Audit | Scope check, TODO scan, layering/tenancy/secrets/events verified |

## Automatic Verification Procedure

1. Confirm [enterprise-phase-discovery.md](enterprise-phase-discovery.md) Record and closed gaps.
2. Walk [mandatory-phase-artifacts.md](mandatory-phase-artifacts.md) for every in-scope aggregate/API.
3. Walk [definition-of-done.md](definition-of-done.md) checklist.
4. Run [quality-gates.md](quality-gates.md) (includes Discovery + expanded enterprise gates).
5. Record results in the phase handover **Enterprise Completeness Sign-Off**.
6. If any required item fails: implement the missing work, then re-verify (Automatic Repair Loop).

## Failure Policy

| Situation | Action |
| --- | --- |
| Missing required artifact for current phase | Implement it now; do not mark Complete |
| Artifact belongs to a future phase | Leave it out; document under Out of Scope / Known Limitations |
| Artifact belongs to another service | Integrate via API/Events/Providers only ([boundary-rules.md](boundary-rules.md)) |
| Roadmap text is high-level | Derive production components for this phase only — do not invent next-phase products |

## Sign-Off Block (copy into handover)

```markdown
### Enterprise Completeness Sign-Off

- [ ] Discovery completeness
- [ ] Business completeness
- [ ] Architectural completeness
- [ ] API completeness
- [ ] Permission completeness
- [ ] Capability completeness
- [ ] Event completeness
- [ ] Migration completeness
- [ ] Repository completeness
- [ ] Validation completeness
- [ ] Security completeness
- [ ] Performance completeness
- [ ] Documentation completeness
- [ ] Testing completeness
- [ ] Tenant isolation
- [ ] Provider abstraction
- [ ] Integration completeness
- [ ] Operational readiness
- [ ] Developer experience
- [ ] Maintainability
- [ ] Self Audit
```

## Related Documents

- [Enterprise Phase Discovery](enterprise-phase-discovery.md)
- [Quality Gates](quality-gates.md)
- [Definition of Done](definition-of-done.md)
- [Boundary Rules](boundary-rules.md)
- [Phase Handover](phase-handover.md)
