Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Requirements Traceability Matrix

1. Purpose

The Requirements Traceability Matrix (RTM) connects PsyDian’s requirements with its design, implementation, testing, and final validation.

The purpose of the RTM is to ensure that:

Requirement
    ↓
Design
    ↓
Implementation
    ↓
Test
    ↓
Validation

Every important requirement should have a clear path to implementation and evidence.

The RTM also helps identify:

  • Requirements that are not implemented.
  • Features that have not been tested.
  • Tests that do not map to a requirement.
  • Documentation/design elements that have no corresponding requirement.
  • Scope that should be deferred instead of silently becoming mandatory.

2. Traceability Levels

PsyDian uses the following traceability chain:

Business Requirement
        ↓
Product Requirement
        ↓
Technical Requirement
        ↓
Architecture / Design
        ↓
Implementation Module
        ↓
Test Case
        ↓
Evidence

For project practicality, requirements can be traced using the identifiers defined in the BRD, TRD, security, testing, and other project documents.


3. Requirement ID Conventions

Recommended identifiers:

PrefixMeaning
BRBusiness Requirement
PRProduct Requirement
UXUser Experience Requirement
TRTechnical Requirement
SECSecurity Requirement/Test
APIAPI Requirement
DEPDeployment Requirement
COSTCost Requirement
OBSObservability Requirement
TESTTest Case
ADRArchitecture Decision Record

The exact identifiers may evolve as the documentation is consolidated.


4. Core Requirement Traceability

Requirement IDRequirementDesign / ComponentImplementation AreaTest / ValidationStatus
BR-001PsyDian shall boot as an x86_64 kernel in QEMU.Boot Architecturekernel/boot, kernel entryTEST-001Planned / In Progress
BR-002Users shall interact through a command-line shell.Shell Architecturekernel/shell, kernel/inputTEST-005, TEST-006Planned / In Progress
BR-003PsyDian shall provide kernel logging.Observability Designkernel/logger, kernel/serialTEST-002, TEST-003Planned / In Progress
BR-004PsyDian shall generate structured diagnostics.Diagnostic Architecturekernel/diagnosticsTEST-008, TEST-009, TEST-012Planned
BR-005PsyDian shall provide a controlled communication channel.Communication Protocolkernel/serial, protocol layerTEST-013, TEST-014Planned
BR-006Host-side AI Bridge shall process diagnostics.GenAI Architectureai-bridge/protocol, ai-bridge/diagnosticsTEST-013, TEST-015Planned
BR-007AI Bridge shall communicate with external AI service.API Specificationai-bridge/providerTEST-015, integration testPlanned
BR-008AI-assisted explanations shall be returned to the user.GenAI Architectureai-bridge/context, ai-bridge/prompt, shell outputTEST-016Planned
BR-009AI suggestions shall not bypass validation.Security Designshell/validation, ai-bridge/safetyTEST-019, TEST-020Planned
BR-010Privileged/destructive actions require confirmation.Security Architectureshell authorization/risk layerTEST-020Planned
BR-011Core functionality shall continue during AI failure.Reliability ArchitectureAI Bridge error pathTEST-018, TEST-023Planned
BR-012Builds shall be reproducible in QEMU environment.Deployment / CI/CDCargo/toolchain/QEMU scriptsCI + TEST-001In Progress
BR-013Optional voice shall reuse existing pipeline.GenAI / Voice ArchitectureVoice layerVoice integration testDeferred / Optional
BR-014Architecture shall support future extensions.HLD / LLDModule boundariesArchitecture reviewOngoing

5. Technical Requirement Traceability

Kernel

TR IDTechnical RequirementComponentTestEvidence
TR-001Boot x86_64 kernel in QEMUBootloader + KernelTEST-001QEMU boot log
TR-002Compile for x86_64-unknown-noneCargo / KernelKernel buildSuccessful build
TR-003Operate without stdKernelBuild validationSuccessful no_std build
TR-004Provide defined kernel entry pointkernel/main.rsTEST-001Kernel reaches entry
TR-005Provide serial outputSerial moduleTEST-002Serial log
TR-006Provide structured loggingLogger moduleTEST-003Log output
TR-007Support CPU exception handlingInterrupt moduleTEST-009Exception output
TR-008Support required hardware interruptsInterrupt moduleTEST-010Interrupt evidence
TR-009Process keyboard inputInput moduleTEST-006Typed input visible
TR-010Provide MVP memory managementMemory moduleTEST-011, TEST-012Allocation/memory evidence
TR-011Provide controlled panic handlerPanic moduleTEST-008Panic diagnostic
TR-012Generate structured diagnosticsDiagnostics moduleTEST-008, TEST-012Diagnostic record
TR-013Parse and validate commandsShell moduleTEST-004, TEST-005, TEST-007Command results
TR-014Display results and errorsShellTEST-005, TEST-007Shell output
TR-015Support command historyShellShell testHistory behavior
TR-016Support auto-completionShellShell testCompletion behavior
TR-017Expose controlled host communicationProtocol / SerialTEST-013, TEST-014Protocol logs
TR-018AI Bridge parses PsyDian messagesAI Bridge ProtocolTEST-013Bridge test output
TR-019Construct AI requestsContext / PromptTEST-015Request fixture
TR-020Use HTTPS/REST for AI providerProvider moduleIntegration testProvider response
TR-021Validate AI responsesValidation moduleTEST-016, TEST-017Validation result
TR-022AI commands pass through validationShell + SafetyTEST-019, TEST-020Execution/ rejection evidence
TR-023Require confirmation for dangerous actionsSecurity layerTEST-020Confirmation evidence
TR-024AI failure does not terminate kernelError handlingTEST-018, TEST-023Shell remains usable
TR-025Communication failures are controlledProtocolTEST-014Controlled error
TR-026Diagnostic messages use defined structureDiagnostics / ProtocolTEST-013Valid message fixture
TR-027Configuration outside kernel sourceConfigSecurity reviewRepository scan
TR-028Credentials not committedSecuritySecret scanCI security result
TR-029Reproducible QEMU build/runCI/CD / DeploymentBuild + smoke testCI artifacts
TR-030Optional voice reuses existing pipelineVoice moduleVoice integration testOptional

6. API Traceability

API IDRequirementDesignImplementationTest
API-001Construct validated AI requestsAI Bridge APIRequest builderAPI request test
API-002Use HTTPSExternal Provider InterfaceProvider clientLive/integration test
API-003Protect credentialsSecurity DesignHost configurationSecret scan
API-004Validate external responsesValidation layerResponse validatorAI response tests
API-005Handle timeout/transient failuresReliability designProvider clientTEST-018
API-006AI commands cannot bypass shellSecurity flowShell validationTEST-019, TEST-020
API-007Requests have traceable IDsObservabilityRequest ID generationObservability test
API-008Internal messages have versionsProtocolMessage envelopeProtocol test
API-009Provider-specific code is isolatedProvider abstractionProvider adapterArchitecture/code review
API-010Core shell continues during AI failureReliabilityError handlingTEST-023
API-011Request/response limitsValidationSize checksBoundary tests
API-012Sensitive request content is not unnecessarily loggedSecurityLogging policySecurity test
API-013Retry behavior is boundedReliabilityRetry policyFailure/retry test
API-014Optional health/status supportObservabilityBridge statusOptional
API-015Provider replacement is possibleProvider abstractionAdapter interfaceArchitecture review

7. Security Traceability

Security IDSecurity RequirementDesign ElementTest
SEC-001Invalid shell commands are rejectedShell validationTEST-004
SEC-002Oversized input is controlledInput limitsBoundary test
SEC-003Malformed protocol messages are rejectedProtocol validationTEST-014
SEC-004Unsupported protocol versions are rejectedVersion validationProtocol test
SEC-005Malformed AI responses are rejectedResponse validationTEST-017
SEC-006Privileged AI suggestions require confirmationRisk/authorization layerTEST-020
SEC-007Destructive AI suggestions are controlledSafety layerTEST-020
SEC-008Prompt injection is treated as untrusted dataPrompt/security boundaryPrompt injection test
SEC-009Missing credentials produce controlled errorConfig/error handlingProvider config test
SEC-010AI timeout is controlledRetry/timeout layerTEST-018
SEC-011Secrets are absent from logsLogging policySecret scanning
SEC-012Rate/resource control prevents uncontrolled generationAI Bridge limitsStress test
SEC-013AI Bridge failure does not break kernelFault isolationTEST-023
SEC-014Unexpected external response is rejectedValidationTEST-017

8. Deployment Traceability

DEP IDRequirementImplementationValidation
DEP-001Clean repository can build projectToolchain + CargoClean build
DEP-002Build bootable BIOS imageBootloader/build.rsImage generation
DEP-003Image runs in QEMUQEMU scriptsQEMU smoke test
DEP-004Serial output available on hostUART/QEMUSerial test
DEP-005AI Bridge runs separatelyai-bridge/Bridge startup test
DEP-006Bridge uses HTTPS/RESTProvider moduleAPI integration test
DEP-007Credentials remain outside kernel/repositoryConfig/securitySecret scan
DEP-008AI failure does not break core kernelReliability layerFailure test
DEP-009Stable builds have identifiable commits/tagsGitRelease review
DEP-010Useful artifacts retainedCI/CDArtifact inspection
DEP-011Known-good builds can be restoredGit tags/artifactsRollback test
DEP-012Demo environment is reproducibleDocumentation + scriptsFinal demo checklist

9. Observability Traceability

OBS IDRequirementImplementationValidation
OBS-REQ-001Structured kernel log levelsLoggerTEST-003
OBS-REQ-002Kernel errors produce diagnosticsDiagnosticsTEST-008/012
OBS-REQ-003Panic path attempts diagnostic outputPanic handlerTEST-008
OBS-REQ-004Communication events are traceableProtocol logsProtocol tests
OBS-REQ-005AI requests have identifiersRequest IDAI observability test
OBS-REQ-006AI latency is measurableTelemetryAI timing test
OBS-REQ-007AI errors differ from kernel errorsError taxonomyFailure tests
OBS-REQ-008Credentials are not loggedLogging policySecurity scan
OBS-REQ-009Diagnostics include severity/subsystemDiagnostic recordDiagnostic tests
OBS-REQ-010Core observability works without AIKernel loggerAI outage test
OBS-REQ-011Provider/model can be recordedAI telemetryAI evaluation
OBS-REQ-012End-to-end diagnostic path is traceableIDs/logsIntegration test

10. Test Traceability

Tests should map back to requirements rather than existing only as isolated checks.

Test IDScenarioRequirement(s) Covered
TEST-001Kernel bootBR-001, TR-001, TR-004, DEP-003
TEST-002Serial initialization/outputTR-005, DEP-004, OBS-REQ-001
TEST-003Logger outputBR-003, TR-006, OBS-REQ-001
TEST-004Unknown commandBR-002, TR-013, SEC-001
TEST-005Valid commandBR-002, TR-013, TR-014
TEST-006Keyboard inputTR-009
TEST-007Invalid argumentsTR-013, TR-014, SEC-001
TEST-008Controlled panicBR-004, TR-011, TR-012, OBS-REQ-003
TEST-009CPU exceptionTR-007, TR-012
TEST-010Hardware interruptTR-008
TEST-011Valid allocationTR-010
TEST-012Allocation failureBR-004, TR-010, TR-012
TEST-013Valid diagnostic messageBR-005, BR-006, TR-017, TR-018, TR-026
TEST-014Malformed protocol messageTR-018, TR-025, API-008, SEC-003
TEST-015AI request generationBR-006, BR-007, TR-019, API-001
TEST-016Valid AI responseBR-008, TR-021, API-004
TEST-017Malformed AI responseTR-021, API-004, SEC-005, SEC-014
TEST-018AI timeoutBR-011, TR-024, API-005, DEP-008
TEST-019Safe AI commandBR-009, TR-022, API-006
TEST-020Privileged/destructive suggestionBR-010, TR-023, API-006, SEC-006, SEC-007
TEST-021Prompt injectionSecurity Design, SEC-008
TEST-022Missing AI credentialsAPI-003, SEC-009
TEST-023AI Bridge unavailableBR-011, TR-024, API-010, SEC-013
TEST-024Voice fallbackBR-013, TR-030
TEST-025Repeated AI requestsAPI-011, API-013, SEC-012

11. Documentation Traceability

The following documents describe different parts of the same system:

DocumentPrimary PurposeRelationship
BRDBusiness/system requirementsDefines why and what
PRDProduct requirementsDefines product behavior and scope
UXUser interaction requirementsDefines shell/user experience
TRDTechnical requirementsDefines technical constraints and choices
HLDHigh-level architectureDefines major components and relationships
Data DesignData structures and lifecycleDefines runtime/protocol data
API SpecificationExternal/bridge interfaceDefines communication contracts
LLDLow-level implementation designDefines modules and implementation details
GenAI ArchitectureAI workflowDefines AI-specific design
Security DesignSecurity controlsDefines trust and safety boundaries
Testing StrategyVerification strategyDefines how requirements are tested
CI/CDAutomated validation/buildDefines delivery process
ObservabilitySystem visibilityDefines logs/metrics/tracing
DeploymentRuntime/build environmentDefines execution and release
Cost AnalysisCost boundariesDefines resource/cost assumptions
RoadmapDelivery scheduleDefines implementation order
Team ResponsibilitiesOwnershipDefines who implements/reviews what
ADRsArchitecture decisionsRecords why major decisions were made

12. Requirement Status Model

Use the following status values:

PLANNED
IN PROGRESS
IMPLEMENTED
TESTED
VERIFIED
DEFERRED
REJECTED
SUPERSEDED

Recommended progression:

PLANNED
   ↓
IN PROGRESS
   ↓
IMPLEMENTED
   ↓
TESTED
   ↓
VERIFIED

A requirement should not be marked VERIFIED solely because the code compiles.


13. Evidence Types

Acceptable requirement evidence may include:

  • Successful build output.
  • QEMU serial logs.
  • Automated test results.
  • Kernel screenshots.
  • QEMU screenshots.
  • AI Bridge test results.
  • Protocol fixtures.
  • Security scan output.
  • CI workflow results.
  • Performance measurements.
  • Final demonstration recording.
  • Git commit/tag references.

Evidence should identify the corresponding build or commit where practical.


14. Traceability During Development

When implementing a feature:

Requirement
    ↓
Find Design
    ↓
Identify Module
    ↓
Implement
    ↓
Create/Update Test
    ↓
Capture Evidence
    ↓
Update RTM

Example:

TR-012
Structured diagnostics
        ↓
LLD Diagnostic Module
        ↓
kernel/src/diagnostics/
        ↓
Diagnostic Record
        ↓
TEST-008 / TEST-012
        ↓
QEMU Diagnostic Output

15. Requirement Change Management

When a requirement changes:

Requirement Change
       ↓
Impact Analysis
       ↓
Check HLD
       ↓
Check LLD
       ↓
Check API / Security / Testing
       ↓
Update Implementation
       ↓
Update Tests
       ↓
Update RTM

The team should not change a requirement in one document while leaving dependent documentation unchanged.


16. Orphan Requirement Detection

A requirement is considered an orphan when it has no implementation or validation path.

Example:

Requirement
     ↓
No Design
     ↓
No Code
     ↓
No Test

Such requirements must be:

  • Implemented.
  • Explicitly deferred.
  • Removed/rejected.
  • Clarified.

17. Orphan Test Detection

A test that does not trace back to a requirement should be reviewed.

Test
 ↓
No Requirement

This does not automatically mean the test is useless. It may represent:

  • Regression testing.
  • Internal safety testing.
  • Implementation-specific validation.

However, its purpose should be documented.


18. Architecture Traceability

Major architectural decisions should map to ADRs.

Examples:

Rust kernel
   ↓
ADR-001

no_std
   ↓
ADR-002

x86_64
   ↓
ADR-003

QEMU
   ↓
ADR-004

Host-side AI Bridge
   ↓
ADR-006

Serial communication
   ↓
ADR-007

AI untrusted
   ↓
ADR-008

This creates a clear relationship between:

Requirement
 ↓
Architecture
 ↓
Decision

19. MVP Traceability

The most important MVP path is:

Boot
 ↓
Kernel
 ↓
Shell
 ↓
Diagnostics
 ↓
Communication
 ↓
AI Bridge
 ↓
External AI
 ↓
Validated Response
 ↓
Shell

Each stage must have:

Requirement
+
Design
+
Implementation
+
Test
+
Evidence

20. Final Traceability Matrix

AreaRequirementsDesignImplementationTestEvidence
Boot✓✓✓✓QEMU log
Kernel Init✓✓✓✓Serial output
Serial✓✓✓✓Host terminal
Memory✓✓✓✓Memory tests
Interrupts✓✓✓✓Exception/interrupt tests
Keyboard✓✓✓✓Shell interaction
Shell✓✓✓✓QEMU screenshot/log
Diagnostics✓✓✓✓Diagnostic record
Communication✓✓✓✓Protocol test
AI Bridge✓✓✓✓Bridge test
External AI✓✓✓✓Integration result
AI Validation✓✓✓✓Validation test
Security✓✓✓✓Security tests
CI/CD✓✓✓✓CI result
Observability✓✓✓✓Logs/metrics
Deployment✓✓✓✓Build/demo
VoiceOptional✓OptionalOptionalOptional

21. Final Verification Checklist

Before final project submission:

  • Every mandatory BRD requirement maps to at least one technical/design element.
  • Every mandatory technical requirement maps to implementation.
  • Every critical security requirement maps to a test.
  • Every major component has relevant tests.
  • Core MVP requirements have recorded evidence.
  • HLD and LLD match the implemented architecture.
  • API and protocol documentation match implementation.
  • Security documentation matches actual controls.
  • Testing documentation reflects actual test cases.
  • Roadmap status reflects actual completion.
  • Deferred features are explicitly marked.
  • No mandatory requirement is silently omitted.
  • No major implemented feature exists without documentation or validation.

22. Definition of Traceability Complete

PsyDian traceability is complete when the team can answer:

Why are we building this?
        ↓
BRD / PRD

What should it do?
        ↓
Requirements

How is it designed?
        ↓
HLD / LLD

Where is it implemented?
        ↓
Source Modules

How do we know it works?
        ↓
Tests

How do we prove it?
        ↓
Evidence

The RTM provides the connection between these layers and acts as the final verification map for the PsyDian MVP.