Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions engineering/audits/SPIKE-002-EXECUTION-PLAN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# SPIKE-002 Execution Plan — Borrowed-Lab Protocol

> **Context (2026-07-21):** a complete Apple lab is available via a collaborator — Mac + iPhone + Apple Watch Ultra. This plan adapts the [SPIKE-002 protocol](SPIKE-PLAN-002-010.md) and the [locked pre-registration](SPIKE-002-PREREGISTERED-PREDICTIONS.md) to that reality. The pre-registration is NOT edited (lock holds); results resolve against it with device-class noted.

## Workflow & responsibilities

```
Founder PC (Windows) → GitHub (PRs) → Collaborator's Mac → Xcode → iPhone → Watch Ultra → logs/results → GitHub
```

- **Founder (Windows):** architecture, RFCs, state machine, algorithms, experiment definitions, reviews every PR.
- **Collaborator (Mac):** pull, build in Xcode, deploy to simulator/device, execute experiment scripts, capture logs, push results. Needs repo collaborator access.
- **Claude:** generates Swift/watchOS code, fixes build errors, writes adapters, interprets logs, produces patches — on either machine via Claude Code.

## Evidence rules (binding, from the frozen doctrine + advisor)

1. Every result is labeled exactly one of: **`simulated`** (desk/replay), **`simulator`** (Xcode watch simulator), **`hardware`** (physical device). Only `hardware` resolves pre-registered predictions.
2. **Never invent hardware results.** If a step needs a physical watch, produce the experiment + expected observations, and wait for the device run. A missing result is reported NOT-EXERCISED — never inferred.
3. Every PR states what was validated, at which evidence level, on which device class (**Ultra ≠ Series-4 floor** — Ultra results are flagged `device-class: Ultra`, battery results especially).
4. Logs land in the repo (spike-evidence directory) with timestamps; interpretations reference raw logs, not memories of them.

## Prerequisites (file/start BEFORE Day 1)

- [ ] **A1 filed on the company's paid Apple Developer account** — fall-detection entitlement (~2–3 days) + critical-alerts request. The entitlement attaches to OUR app ID/team; do not build spike evidence on a personal team that can't carry it. **This gates Day 5.**
- [ ] Collaborator added to the GitHub repo; Xcode signed into the company team.
- [ ] For the **managed-watch phase (Day 6): a second Apple Account + watch cellular plan (eSIM)** — Family Setup requires the watch to be wiped, re-provisioned as a family member's device with its own number. Collaborator's informed consent required (their device is wiped and restored after).

## Day plan (maps to pre-registered predictions)

| Day | Work | Predictions exercised | Evidence level |
|---|---|---|---|
| 1 | Minimal watchOS app; deploy to Ultra; watch↔iPhone↔backend round-trip | pipeline sanity | hardware |
| 2 | Read accelerometer/gyro (CMBatchedSensorManager — Ultra qualifies, Series 8+); heart rate where available; timestamped logging | **P5** (sensor quality vs corpus assumptions), **P6** (HealthKit reads) | hardware |
| 3 | Motion sessions: walk/run/sit/lie; controlled safe-fall surrogates onto padding (NO risk to persons — these test OUR logging, not Apple's detector) | **P5** corpus traces (first own recordings — SPIKE-010 seed) | hardware |
| 4 | Background execution matrix (foreground/background/terminated/Low Power); notifications; connectivity drops; battery log over the day | **P2**, **P3**, **P4** (flag: Ultra battery ≫ floor), **P7** (forced-reboot recovery run) | hardware |
| 5 | *(entitlement granted)* Fall-API test, **paired mode**: simulated fall → native UI → `didDetect` + resolution delivery timing | P1 paired-baseline (not the decider) | hardware |
| 6 | **Family Setup reconfiguration**: wipe, re-provision as managed watch, reinstall app from watch App Store, repeat Day-5 fall-API test + LTE upload with iPhone absent | **P1 — THE decider** (RFC-005), **P3** true no-phone leg | hardware |
| 7 | Restore collaborator's watch; write results report scoring every pre-registered row (CONFIRMED/FALSIFIED/PARTIAL/NOT-EXERCISED + both priors' Brier) | calibration measurement | — |

**Sequencing logic:** Days 1–4 need no entitlement and no reconfiguration — they run immediately while A1 clears. Day 6 is the only day that answers the question the spike is named for; everything before it de-risks that day. If Day 6 cannot happen (consent/eSIM/logistics), the spike still resolves P2–P7 and **P1 is reported NOT-EXERCISED — not assumed** — and RFC-005 stays conditional.

**Out of scope, explicitly:** production algorithms (post-spike, per advisor), old-hardware floor (needs Series-4-class device later), SPIKE-007/008 (need A2/critical-alerts).
59 changes: 59 additions & 0 deletions implementation/harness/cases/CASE-000001.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"schemaVersion": "case-v0.1",
"caseId": "CASE-000001",
"title": "Platform fall, unresponsive wearer - must escalate",
"traceId": "trace-001-platform-fall-unresponsive",
"subject": {
"profile": "elder-alone"
},
"groundTruth": {
"outcome": "EMERGENCY",
"basis": "synthetic_design",
"notes": "Designed canonical H-01 shape: platform fall event followed by no wearer response."
},
"expected": {
"version": 1,
"outcome": "guardian_escalation",
"statePath": [
"SUSPECTED",
"COUNTDOWN",
"ALERTING",
"ESCALATING"
],
"mustNever": [
"suppression of escalation by context confidence"
],
"derivedFrom": [
"SRS-403",
"SRS-501",
"D17",
"H-01"
],
"review": {
"reviewedBy": "pair-architect (Claude), founder execution charter 2026-07-21",
"date": "2026-07-21",
"reason": "Initial migration from 6-trace corpus; expectations transcribed from trace prose descriptions + SRS/doctrine derivations, v1."
}
},
"pinnedBehavior": {
"goldenHash": "36a6c783f38bcdc72d7bcc23ebe04c39d4c25f9df51b7ca345b8ec25668a6607",
"baselineRef": "harness/baseline/golden-hashes.json"
},
"adjudication": {
"status": "NOT_EXECUTED",
"note": "Ground-truth adjudication NOT_EXECUTED: the CaseKit runner does not exist yet (I1 commit 2). Pin is live via VV-101 (baseline MATCH). The laboratory does not claim adjudications its instrument cannot yet perform."
},
"provenanceClass": "SIMULATED",
"links": {
"hazards": [
"H-01"
],
"vv": [
"VV-101",
"VV-102"
],
"doctrine": [
"D17"
]
}
}
52 changes: 52 additions & 0 deletions implementation/harness/cases/CASE-000002.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"schemaVersion": "case-v0.1",
"caseId": "CASE-000002",
"title": "Fall, wearer cancels during countdown - must resolve without escalation",
"traceId": "trace-002-fall-wearer-cancels",
"subject": {
"profile": "elder-alone"
},
"groundTruth": {
"outcome": "NON_EMERGENCY",
"basis": "synthetic_design",
"notes": "Wearer is fine and cancels; agency honored."
},
"expected": {
"version": 1,
"outcome": "resolved_no_escalation",
"statePath": [
"SUSPECTED",
"COUNTDOWN",
"RESOLVED"
],
"mustNever": [
"escalation after valid wearer cancel"
],
"derivedFrom": [
"IF-HUM-01",
"H-02"
],
"review": {
"reviewedBy": "pair-architect (Claude), founder execution charter 2026-07-21",
"date": "2026-07-21",
"reason": "Initial migration from 6-trace corpus; expectations transcribed from trace prose descriptions + SRS/doctrine derivations, v1."
}
},
"pinnedBehavior": {
"goldenHash": "bec0212ec8881b2a3cfee52db46adb0defc9f66f331e2c114b3c61c2b64f1217",
"baselineRef": "harness/baseline/golden-hashes.json"
},
"adjudication": {
"status": "NOT_EXECUTED",
"note": "Ground-truth adjudication NOT_EXECUTED: the CaseKit runner does not exist yet (I1 commit 2). Pin is live via VV-101 (baseline MATCH). The laboratory does not claim adjudications its instrument cannot yet perform."
},
"provenanceClass": "SIMULATED",
"links": {
"hazards": [
"H-02"
],
"vv": [
"VV-101"
]
}
}
50 changes: 50 additions & 0 deletions implementation/harness/cases/CASE-000003.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"schemaVersion": "case-v0.1",
"caseId": "CASE-000003",
"title": "Quiet ADL day - must stay idle",
"traceId": "trace-003-adl-quiet-day",
"subject": {
"profile": "elder-alone"
},
"groundTruth": {
"outcome": "NON_EMERGENCY",
"basis": "synthetic_design",
"notes": "Ordinary daily living; the false-positive floor case."
},
"expected": {
"version": 1,
"outcome": "no_incident",
"statePath": [
"IDLE"
],
"mustNever": [
"any escalation"
],
"derivedFrom": [
"H-02",
"SRS-903"
],
"review": {
"reviewedBy": "pair-architect (Claude), founder execution charter 2026-07-21",
"date": "2026-07-21",
"reason": "Initial migration from 6-trace corpus; expectations transcribed from trace prose descriptions + SRS/doctrine derivations, v1."
}
},
"pinnedBehavior": {
"goldenHash": "4ef1a6681ca41a813246bd6a7efe26c6ce592fc5a802bf43b211307f31f1c481",
"baselineRef": "harness/baseline/golden-hashes.json"
},
"adjudication": {
"status": "NOT_EXECUTED",
"note": "Ground-truth adjudication NOT_EXECUTED: the CaseKit runner does not exist yet (I1 commit 2). Pin is live via VV-101 (baseline MATCH). The laboratory does not claim adjudications its instrument cannot yet perform."
},
"provenanceClass": "SIMULATED",
"links": {
"hazards": [
"H-02"
],
"vv": [
"VV-101"
]
}
}
52 changes: 52 additions & 0 deletions implementation/harness/cases/CASE-000004.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"schemaVersion": "case-v0.1",
"caseId": "CASE-000004",
"title": "Evidence gap markers - unknown state, no false alarm",
"traceId": "trace-004-gap-markers",
"subject": {
"profile": "elder-alone"
},
"groundTruth": {
"outcome": "COVERAGE_LOSS",
"basis": "synthetic_design",
"notes": "Gaps in evidence stream; silence must not be read as OK."
},
"expected": {
"version": 1,
"outcome": "unknown_state_surfaced",
"statePath": [
"IDLE",
"UNKNOWN"
],
"mustNever": [
"treating gap as OK",
"false escalation from gap alone"
],
"derivedFrom": [
"H-04",
"SRS-701"
],
"review": {
"reviewedBy": "pair-architect (Claude), founder execution charter 2026-07-21",
"date": "2026-07-21",
"reason": "Initial migration from 6-trace corpus; expectations transcribed from trace prose descriptions + SRS/doctrine derivations, v1."
}
},
"pinnedBehavior": {
"goldenHash": "c7ef2ba86abb5beb9c164ef0c91a92451ad6d7a5d63eada1a7f569c4d1e3bc17",
"baselineRef": "harness/baseline/golden-hashes.json"
},
"adjudication": {
"status": "NOT_EXECUTED",
"note": "Ground-truth adjudication NOT_EXECUTED: the CaseKit runner does not exist yet (I1 commit 2). Pin is live via VV-101 (baseline MATCH). The laboratory does not claim adjudications its instrument cannot yet perform."
},
"provenanceClass": "SIMULATED",
"links": {
"hazards": [
"H-04"
],
"vv": [
"VV-101"
]
}
}
67 changes: 67 additions & 0 deletions implementation/harness/cases/CASE-000005.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"schemaVersion": "case-v0.1",
"caseId": "CASE-000005",
"title": "Predecessor stillness-veto fall (real incident) - zero suppression",
"traceId": "trace-005-predecessor-stillness-veto-fall",
"subject": {
"profile": "elder-alone",
"notes": "Real fall cancelled by predecessor Table-Mode/stillness veto 27s post-impact (AUDIT-003)."
},
"groundTruth": {
"outcome": "EMERGENCY",
"basis": "field_incident",
"notes": "An unconscious elder still wrist matched a watch-on-a-table profile; the alert was cancelled. The RFC-003 litmus."
},
"expected": {
"version": 1,
"outcome": "guardian_escalation",
"statePath": [
"SUSPECTED",
"COUNTDOWN",
"ALERTING",
"ESCALATING"
],
"mustNever": [
"context/stillness veto of a life-critical event",
"suppression by degrees (confidence lowered below threshold)"
],
"derivedFrom": [
"D17",
"RFC-003",
"SRS-403",
"H-01"
],
"review": {
"reviewedBy": "pair-architect (Claude), founder execution charter 2026-07-21",
"date": "2026-07-21",
"reason": "Initial migration from 6-trace corpus; expectations transcribed from trace prose descriptions + SRS/doctrine derivations, v1."
}
},
"pinnedBehavior": {
"goldenHash": "a50a232f7ece40820575267e3817379230445b7172adaadef147d701301a6655",
"baselineRef": "harness/baseline/golden-hashes.json"
},
"adjudication": {
"status": "NOT_EXECUTED",
"note": "Ground-truth adjudication NOT_EXECUTED: the CaseKit runner does not exist yet (I1 commit 2). Pin is live via VV-101 (baseline MATCH). The laboratory does not claim adjudications its instrument cannot yet perform."
},
"provenanceClass": "REPLAY_DERIVED",
"links": {
"hazards": [
"H-01"
],
"rfcs": [
"RFC-003"
],
"vv": [
"VV-101",
"VV-102"
],
"doctrine": [
"D17"
],
"audits": [
"AUDIT-003"
]
}
}
60 changes: 60 additions & 0 deletions implementation/harness/cases/CASE-000006.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"schemaVersion": "case-v0.1",
"caseId": "CASE-000006",
"title": "Predecessor 1h45m battery blackout (real incident) - coverage loss surfaced, no false alarm",
"traceId": "trace-006-predecessor-coverage-blackout",
"subject": {
"profile": "elder-alone",
"notes": "Real low-battery silent blackout from the predecessor (AUDIT-003)."
},
"groundTruth": {
"outcome": "COVERAGE_LOSS",
"basis": "field_incident",
"notes": "Sensing silently dead for 1h45m; the H-04 shape: silent coverage loss must become visible."
},
"expected": {
"version": 1,
"outcome": "coverage_loss_surfaced",
"statePath": [
"IDLE",
"UNKNOWN"
],
"mustNever": [
"treating blackout as OK",
"false escalation from blackout alone"
],
"derivedFrom": [
"H-04",
"SRS-701",
"RFC-006"
],
"review": {
"reviewedBy": "pair-architect (Claude), founder execution charter 2026-07-21",
"date": "2026-07-21",
"reason": "Initial migration from 6-trace corpus; expectations transcribed from trace prose descriptions + SRS/doctrine derivations, v1."
}
},
"pinnedBehavior": {
"goldenHash": "ead1bd453ef970939ebd4b58fc23f0f2558f4c21eb08c877bca5803a23658423",
"baselineRef": "harness/baseline/golden-hashes.json"
},
"adjudication": {
"status": "NOT_EXECUTED",
"note": "Ground-truth adjudication NOT_EXECUTED: the CaseKit runner does not exist yet (I1 commit 2). Pin is live via VV-101 (baseline MATCH). The laboratory does not claim adjudications its instrument cannot yet perform."
},
"provenanceClass": "REPLAY_DERIVED",
"links": {
"hazards": [
"H-04"
],
"rfcs": [
"RFC-006"
],
"vv": [
"VV-101"
],
"audits": [
"AUDIT-003"
]
}
}
Loading