Skip to content

STP-SIM-001 Deterministic Simulation Protocol

Status: Final draft prepared for handoff (pending review)
Version: 0.9
Owner: BionicLoop engineering
Prepared by: BionicLoop engineering Reviewer: ____
Approver: ____
Decision date: ____
Effective date: ____
Baseline freeze SHA: ____
Last updated: 2026-04-06 15:20 EDT

Revision History

Version Date Author Summary of Changes
0.1 2026-03-27 Engineering Initial deterministic simulation protocol draft
0.9 2026-04-06 BionicLoop engineering Added handoff-ready document-control metadata for the software package

1. Purpose

Define the protocol for deterministic medium-fidelity simulation runs used to verify runtime safety logic before real-device execution.

2. Scope

This protocol owns:

  • TV-SIM-001
  • TV-SIM-002
  • TV-SIM-003
  • TV-SIM-004
  • TV-SIM-005

It complements, but does not replace, real-device validation.

3. References

4. Roles

  • Author: BionicLoop engineering
  • Executor: engineering or QA delegate
  • Reviewer: quality / design assurance
  • Approver: submission-quality owner

5. Prerequisites

  • Deterministic simulation harness is buildable and runnable
  • Scenario fixtures are locked for the run label
  • Output directory is defined in formal or working STR lane before execution

6. Environment

  • Host: macOS development workstation
  • Tooling: simulation harness scripts and checked-in project/package state
  • No live hardware required

7. Procedure

7.1 Setup

  1. Record git SHA, harness script version, and output path.
  2. Select formal vs working evidence lane.
  3. Record scenario seed and fixture set for the run.

7.2 Execution

  1. Execute the simulation harness for all required TV-SIM-* scenarios.
  2. Capture generated:
  3. run context
  4. expected outputs
  5. actual outputs
  6. diffs
  7. summarized results
  8. Review failures for determinism, not just exit-code status.

7.3 Failure / Deviation Handling

  1. If output is nondeterministic, record as harness/protocol failure before accepting behavioral conclusions.
  2. If a scenario is missing required artifacts, rerun is required.

8. Expected Results

  • Each TV-SIM-* scenario produces a complete STR-style artifact bundle.
  • Runtime cadence, degraded-input, BG/meal interplay, and alert churn expectations match stored expected outputs.

If cloud-log review support is used for a simulation run, start an Integration Log Session in Home Settings before the scenario begins and stop it immediately after completion.

9. Pass / Fail Criteria

  • Pass when all selected simulation scenarios pass and generate complete traceable artifacts.
  • Fail when any scenario output diverges without approved rationale or artifacts are incomplete.

10. Evidence to Capture

  • run-context
  • results
  • expected
  • actual
  • diff
  • scenario-to-test trace map
  • if cloud-log review support was used:
  • test_run_id
  • UTC time window
  • selected upload threshold
  • explicit note that the session was started before execution and stopped after execution
  • STR target path:
  • Docs/Quality/Evidence/Formal/STR-SIM-001/<run-label>/

11. Traceability

TV-* ID Purpose
TV-SIM-001 Anchored cadence across reconnect/relaunch
TV-SIM-002 Step-0 gate and degraded CGM execution
TV-SIM-003 Pump-unavailable command-block behavior
TV-SIM-004 Meal/BG/reconnect timing interplay
TV-SIM-005 Alert lifecycle churn / dedupe / clear