Testing & Quality Assurance
Relevant source files
The following files were used as context for generating this wiki page:
The Testing & Quality Assurance (QA) system for the TAMV ecosystem is governed by the QC-TAMV-01 Constitutional Quality Control System. This framework establishes non-negotiable technical invariants, architectural laws, and automated governance mechanisms designed to ensure structural coherence, visual integrity, and technical traceability across the Civilizatory Client. The system operates on the principle of "Automatic Governance," where architecture is enforced through automated linting, static analysis, and CI/CD pipelines rather than human discipline alone.
Sources: 02_MODULOS/M05_IA_TAMVAI/INTERNO/QC-TAMV-01-v1.1.md:14-25, 02_MODULOS/M05_IA_TAMVAI/INTERNO/QC-TAMV-01-v1.1.md:46-52
Architectural Invariants (QC-TAMV-01)
The project enforces nine core "Invariant Laws" (L1–L9) that serve as verifiable axioms. Failure to comply with these laws renders the client technically invalid, regardless of whether the code compiles or functions.
Constitutional Laws (L1–L9)
| Law | Name | Description | Target Files |
|---|---|---|---|
| L1 | Root Unico | ReactDOM.createRoot must exist only in src/main.tsx. | src/main.tsx |
| L2 | Router Unico | BrowserRouter must exist only in src/App.tsx. | src/App.tsx |
| S3 | Layout Unico | Layout.tsx is mounted exactly once, exclusively in App.tsx. | src/App.tsx |
| L4 | Route-Page Mapping | Each file in src/pages/* maps to one route; pages never import other pages. | src/pages/* |
| L5 | Logic-Free Pages | Pages must not contain business logic, persistent side-effects, or global state. | src/pages/* |
| L6 | Agnostic Modules | Modules in src/modules/* cannot import navigation or layout components. | src/modules/* |
| L7 | Controlled Init | Global services (Supabase, AI) initialize once in dedicated layers. | integrations/* |
| L8 | No View Overlap | Routes cannot render fragments of other routes simultaneously. | All Routes |
| L9 | Audited Exceptions | All exceptions must be explicitly declared, documented, and blocked from production. | N/A |
Sources: 02_MODULOS/M05_IA_TAMVAI/INTERNO/QC-TAMV-01-v1.1.md:57-95, eslint-plugin-tamv/index.js:14-165
Automated Quality Shield
The quality shield is implemented through a multi-layered validation stack executed via GitHub Actions and local scripts.
1. ESLint Constitutional Plugin (eslint-plugin-tamv)
This custom plugin blocks prohibited imports and structural violations. Key rules include:
tamv/no-reactdom-outside-main: Blocks root initialization outside the entry point.tamv/no-router-outside-app: Prevents routing logic in individual modules.tamv/no-page-to-page-import: Enforces flat page hierarchy.tamv/no-dao: Prohibits DAO-related terminology in favor of constitutional terminology, unless marked as[HISTORICAL].
Sources: eslint-plugin-tamv/index.js:14-340, TASKS-TAMV-MODULAR.md:13-16
2. Architectural Dependency Analysis
The scripts/check-architecture.ts script constructs a dependency graph of pages, core components, modules, and domains. It detects violations such as:
- Module-to-Router imports.
- Page-to-Page imports.
- Domain-to-Page imports.
The script outputs an architecture-report.json and exits with an error code if invariants are violated.
Sources: scripts/check-architecture.ts:16-55, scripts/check-architecture.ts:250-295
3. Semantic Constitutional Scanning
The scripts/scan-semantics.ts scanner identifies code patterns that violate the constitutional framework, such as "dark patterns," "predatory pricing," or "AI sovereignty" (where AI makes decisions without human audit).
Sources: scripts/scan-semantics.ts:16-46
4. Deca-V Operational Protocol
The "Escudo de Calidad MD-X5" (Deca-V) is an integral validation suite that runs 10 consecutive cycles of linting, type-checking, unit testing, and building to ensure environmental stability.
Sources: README.md:37-53
Verification Workflow
The following diagram illustrates the automated validation pipeline required for all Pull Requests (PRs) targeting protected branches.
The pipeline ensures that no code enters the repository without meeting constitutional and structural standards.
Sources: 02_MODULOS/M05_IA_TAMVAI/INTERNO/QC-TAMV-01-v1.1.md:139-150, PLAN-TAMV-MODULAR.md:183-191
End-to-End (E2E) Testing
The E2E suite, implemented via Playwright, focuses on critical user journeys and structural isolation.
Priority E2E Checklist
- Authentication: Real login flow with Supabase Auth.
- Social: Dynamic post publishing and real-time feed updates.
- AI Interaction: Usable chat responses from Isabella.
- Structural Integrity: Verification that
/does not show login components and/logindoes not show the global feed (data-testidvalidation).
Sources: E2E_CHECKLIST_TAMV.md:8-16, 02_MODULOS/M05_IA_TAMVAI/INTERNO/QC-TAMV-01-v1.1.md:113-120
Trusted Execution Environment (TEE) Auditing
For sensitive modules (Isabella AI, Stripe Economy, MSR Registry), the system implements a TEE Audit Runbook. This process ensures that critical code is executed in an isolated, verifiable environment.
TEE Audit Process Flow
This process provides a verifiable "Attestation" for every deployment of critical modules.
Sources: 02_MODULOS/M01_QC/INTERNO/TEE-AUDIT-RUNBOOK.md:19-45
Critical TEE Modules
| Module | Justification |
|---|---|
| Isabella LLM | Processes personal data and conversations. |
| Stripe / Economy | Handles real transactions and wallets. |
| MSR / BookPI | Certifies academic credentials on blockchain. |
| DEKATEOTL | Core security system protecting the ecosystem. |
Sources: 02_MODULOS/M01_QC/INTERNO/TEE-AUDIT-RUNBOOK.md:10-17
Technical Quality Metrics
The project tracks the following success metrics to determine the "Technical Validity" of the client:
- QA Coverage: 100% compliance with QC-TAMV-01 rules (lint/architecture).
- Structural Health: Zero page-to-page or module-to-router imports.
- Performance: Initial feed load < 300-500ms; Isabella AI response (P95) < 4s.
- Security: All critical modules must possess a valid, current TEE Attestation.
Sources: TASKS-TAMV-MODULAR.md:126-135, PLAN-TAMV-MODULAR.md:46-55
Testing and Quality Assurance in TAMV is not merely a set of checks but a Constitutional Guard that ensures every modification respects the project's core architecture and ethical principles. By automating these "Laws," the system provides a robust framework that supports both human and AI contributors while maintaining system integrity.