Blob: references/investigation-and-evidence.md
Investigation and evidence
Choose the next observation by the decision it can change. A useful investigation connects a question, competing explanations, a difference those explanations predict, and an observation of that difference.
Before adding another experiment, ask what its possible results would mean. If they all leave the next action unchanged, existing evidence may already be sufficient.
Distinguish a failed attempt from a missing capability
The ESP32 project used a microcontroller board to stream music and telemetry to browsers and receive LED controls. WebRTC DataChannels were intended to carry application messages alongside the media. A probe that sent no messages led to an SDK-limitation diagnosis. Rachel's earlier WebRTC work made that surprising. The probe had disabled automatic channel creation and omitted explicit local creation; adding it enabled transmission. Transport readiness and the existence of a channel were separate prerequisites.
Another silent send would have fit both explanations. Inspecting creation and negotiation distinguished incomplete initialization from an unsupported capability.
Apply the same reasoning to a new integration. Identify what the probe actually initialized, which state it reached, and where the expected behavior first diverged. If channel creation is already established, move to the next uncertain boundary. Prior experience narrows the search; it does not predetermine the defect.
The experience map provides background for recognizing these connections without asking Rachel to repeat it.
Make the prediction concrete
An investigation of the ASUS G14 laptop's keyboard controls captured USB input reports to determine how they encoded keys and modifiers. Comparing ordinary keys with modified keys produced these selected bytes:
| Input | Leading report bytes |
|---|---|
| Backspace | 5d 01 00 00 2a … |
| Space | 5d 01 00 00 2c … |
| Ctrl+Space | 5d 01 01 00 2c … |
If the interpretation is right, adding Ctrl should preserve Space's key code and change a modifier field. This comparison teaches more than collecting additional unrelated key presses. It turns a byte pattern into a model with a testable consequence.
Composer combines several live media inputs into a produced output. One WebRTC input failed to connect, and slow ICE gathering—the collection of possible network addresses—was proposed as the cause. The captured failed peer gathered in about 0.21 seconds while successful peers took about two seconds. That result weakened the explanation. The peer's session description also advertised H.264 settings that differed from the source feed, giving the investigation a more specific negotiation difference to isolate.
Keep the observation and the diagnosis at their own levels. An inconsistent offer is a reason to test negotiation; discovering it alone does not establish that it caused the failure.
Observe the stage that could explain the symptom
In a separate Composer investigation, the composed output sounded buzzy. The defect could have come from source quality, overload, transport loss, or disabled decoder recovery. A single-input run still showed substantial audio packet loss at the container's input receiver while using about 1.4 CPUs, weakening compositor saturation as the sole explanation. A browser receiving audio was another receiver on another path; its healthy counters did not establish healthy delivery to the container. Video counters described a different stream again.
The next useful distinction was library capability versus application configuration. The audio decoder supported forward error correction (FEC), which uses redundant information to recover missing audio, and packet-loss concealment, which synthesizes output for gaps. Both were disabled. The first recovery test injected packets faster than live playback and ended before the receiver's loss timers ran. With realistic pacing, it could exercise the recovery behavior under investigation.
Match the test's time, load, and lifecycle to the mechanism. A loss timer needs time to expire. A retry test needs an ambiguous result. A stale-ownership test needs ownership to change during the operation.
Establish where a failure is reachable
Vaskel is a messaging application whose video attachments open in a modal viewer. Clicking Play first requests permission to read the private file; the modal appears after that request completes. The modal blocks further clicks underneath it, which initially seemed to rule out overlapping opens. But two Play clicks could happen while permission requests were pending and before either modal existed. Responses arriving out of order could then mix one file's playback with another file's title and link.
Trace the full interaction, including the interval before the visible state appears. An invariant that holds after opening a modal says nothing about the requests already in flight.
Failure injection helps understand how code responds to a condition. Classifying it as a user-facing defect also requires a route by which that condition can occur. Source, platform behavior, a trace, or a focused reproduction can establish that route.
Use a reference for the claim it can answer
The ESP32 music project also needed to calculate a frequency spectrum while playing audio. It decoded audio and ran a fast Fourier transform on the board, compared the resulting frequency bands with an independent desktop calculation, and checked that radio playback continued. Numerical agreement and continued playback answered different questions: whether the analysis matched the reference and whether it fitted the live workload.
Make inputs and comparison conditions correspond. For clustering algorithms, equal random seeds do not necessarily produce equal initial centroids across implementations. Fix the starting centroids when testing initialization, and compare an invariant objective or aligned clusters rather than arbitrary label numbers.
When several things change at once, a better-looking result can establish progress without isolating the cause. Preserve the useful result and narrow the explanation accordingly.
Stop at the decision
Update the claim affected by the observation. Rejecting slow gathering leaves other transport explanations open. Recovering continuous audio leaves packet-loss counters meaningful. A passing route test with a mocked provider can establish local account binding while leaving real provider interoperability for another check.
Finish when the requested outcome and relevant checks are established. Continue for a failed check or a specific unresolved question that changes the work. This keeps investigation useful and makes the remaining uncertainty concrete.