STD: WT Rule (Associated Well Error)
Version: v1.0.0
Status: Draft
SRS Source: docusaurus/docs/srs/rules/rule-wt.md
Rule Name: WT (Well Transfer)
Domain: RULES-WT
Overview
This document specifies tests for the WT rule using decision tables and test vectors. The rule propagates error messages from failed control wells to associated patient wells and clears those errors when control failures are resolved.
Rule Characteristics:
- Pure business logic (no UI)
- Error propagation from controls to patients
- Distinguishes extraction vs non-extraction control types
- Configuration-dependent fallback mix behavior
- Automatic error clearing on resolution
Test Method: TM-API (per Test Plan Section 3.3 - Rules use automated API tests)
Verification Approach:
Rule verification is performed using data-driven test vectors. Each row in a decision table represents a complete verification scenario with defined inputs and expected outputs. This format enables exhaustive condition coverage while remaining concise and auditable.
Coverage Summary
| REQ ID | Title | Conditions | Test Vectors | Coverage | Gaps |
|---|
| REQ-RULES-WT-001 | Propagate Control Failure Errors | 8 | 10 | 100% | None |
| REQ-RULES-WT-002 | Clear Patient Well Errors | 4 | 5 | 100% | None |
| REQ-RULES-WT-003 | Check Fallback Mixes | 6 | 8 | 100% | None |
Totals: 3 REQs, 18 Conditions, 23 Test Vectors, 100% Coverage
| Variable | Type | Valid Values | Description |
|---|
control.has_error | bool | true, false | Control well has failed |
control.is_extraction | bool | true, false | Control is extraction type |
well.type | string | Control, Patient | Well type |
well.mix | string | mix1, mix2, ... | Mix identifier |
control.mix | string | mix1, mix2, ... | Control's mix |
patient.has_wt_error | bool | true, false | Patient has existing WT error |
config.fallback_shared_control | bool | true, false | Fallback setting enabled |
mapping.backup_mix | string? | null, mix1, mix2, ... | Backup mix from role-to-target mapping |
control.error_resolved | bool | true, false | Control error was resolved |
Output Variables
| Variable | Type | Description |
|---|
patient.error_message | string? | Error message set on patient well |
patient.error_code | string? | Error code (for fallback: INHERITED_CONTROL_FAILURE) |
patient.export_blocked | bool | Patient well is blocked from export |
patient.wt_error_cleared | bool | WT error was removed from patient |
REQ-RULES-WT-001: Propagate Control Failure Errors to Patient Wells
Acceptance Criteria Summary
- AC1: Non-extraction control failure sets specific error message
- AC2: Extraction control failure sets extraction-specific error message
- AC3: Error applies to all patient wells in same mix
- AC4: Error blocks export until resolved
- AC5: Rule distinguishes extraction from non-extraction controls
Decision Table: Error Message Selection
| TV | control.has_error | control.is_extraction | same_mix | expected_message | Covers |
|---|
| TV-001-001 | true | false | true | "An associated control has failed. That error must be resolved before this well can be exported." | AC1: Non-extraction error |
| TV-001-002 | true | true | true | "An associated extraction control has failed. That error must be resolved before this well can be exported." | AC2: Extraction error |
| TV-001-003 | true | false | false | null | AC3: Different mix - no propagation |
| TV-001-004 | true | true | false | null | AC3: Different mix - no propagation |
| TV-001-005 | false | false | true | null | Control has no error |
| TV-001-006 | false | true | true | null | Control has no error |
Decision Table: Export Blocking
| TV | control.has_error | same_mix | patient.export_blocked | Covers |
|---|
| TV-001-007 | true | true | true | AC4: Export blocked |
| TV-001-008 | true | false | false | AC4: Different mix - not blocked |
| TV-001-009 | false | true | false | No error - not blocked |
Decision Table: Control Type Distinction
| TV | control.has_error | control.is_extraction | message_contains_extraction | Covers |
|---|
| TV-001-010 | true | true | true | AC5: Extraction distinguished |
REQ-RULES-WT-002: Clear Patient Well Errors on Control Resolution
Acceptance Criteria Summary
- AC1: WT errors cleared when control error is resolved
- AC2: Clearing is automatic
- AC3: All associated patient wells have WT errors cleared
- AC4: Patient wells eligible for export after clearing (no other errors)
Decision Table: Error Clearing
| TV | patient.has_wt_error | control.error_resolved | same_mix | patient.wt_error_cleared | Covers |
|---|
| TV-002-001 | true | true | true | true | AC1, AC2: Auto-clear on resolution |
| TV-002-002 | true | false | true | false | Control not resolved |
| TV-002-003 | false | true | true | false | No WT error to clear |
| TV-002-004 | true | true | false | false | Different mix - not associated |
Decision Table: Export Eligibility After Clearing
| TV | wt_error_cleared | other_errors_exist | export_eligible | Covers |
|---|
| TV-002-005 | true | false | true | AC4: Eligible after clearing |
REQ-RULES-WT-003: Check Fallback Mixes for Control Errors
Acceptance Criteria Summary
- AC1: Fallback disabled - backup mix patients do NOT inherit control errors
- AC2: Fallback enabled - backup mix patients DO inherit control errors
- AC3: Error code is INHERITED_CONTROL_FAILURE for fallback errors
- AC4: Backup mix relationship defined in role-to-target mappings
Decision Table: Fallback Shared Control Configuration
| TV | config.fallback_shared_control | control.has_error | patient.mix | mapping.backup_mix | patient.error_code | Covers |
|---|
| TV-003-001 | false | true | mix2 | mix2 | null | AC1: Fallback disabled - no inheritance |
| TV-003-002 | true | true | mix2 | mix2 | INHERITED_CONTROL_FAILURE | AC2, AC3: Fallback enabled - inherits |
| TV-003-003 | true | false | mix2 | mix2 | null | No control error to inherit |
| TV-003-004 | true | true | mix3 | mix2 | null | Patient not in backup mix |
Decision Table: Primary vs Backup Mix
| TV | control.mix | patient.mix | mapping.backup_mix | config.fallback_shared_control | error_propagated | Covers |
|---|
| TV-003-005 | mix1 | mix1 | mix2 | true | true (via primary) | Primary mix - standard propagation |
| TV-003-006 | mix1 | mix2 | mix2 | true | true (via fallback) | Backup mix - fallback propagation |
| TV-003-007 | mix1 | mix2 | mix2 | false | false | AC1: Fallback disabled |
| TV-003-008 | mix1 | mix3 | mix2 | true | false | Neither primary nor backup |
Error Handling Test Vectors
Decision Table: Error Conditions
| TV | Condition | Expected Behavior | Covers |
|---|
| TV-ERR-001 | Missing mix association | Log warning, skip well | REQ-001 Error Handling |
| TV-ERR-002 | Well update failure | Retry once, then fail run with notification | REQ-001 Error Handling |
| TV-ERR-003 | Configuration read failure | Use default (fallback disabled), log error | REQ-003 Error Handling |
| TV-ERR-004 | Missing role-to-target mapping | Skip fallback check for that well | REQ-003 Error Handling |
Automation Status
| REQ ID | Test Method | Automation Status |
|---|
| REQ-RULES-WT-001 | TM-API | Automated |
| REQ-RULES-WT-002 | TM-API | Automated |
| REQ-RULES-WT-003 | TM-API | Automated |
Traceability to Existing Tests
| Requirement | Jira Tests | Status |
|---|
| REQ-RULES-WT-001 | BT-749, BT-750, BT-1523, BT-1557, BT-1558, BT-1559 | Existing |
| REQ-RULES-WT-002 | BT-1524, BT-1560, BT-1561, BT-1562 | Existing |
| REQ-RULES-WT-003 | BT-3940 | Existing |
Gap Analysis
Identified Gaps
| Gap | Requirement | Description | Priority | Owner |
|---|
| None | - | All requirements have existing Jira test coverage | - | - |
Coverage Notes
All three requirements have existing Jira test tickets that align with the test vectors defined in this STD. The test vectors provide a structured mapping to ensure complete condition coverage.