WEBVTT

1
00:00:00.000 --> 00:00:01.207
When something fails,

2
00:00:01.416 --> 00:00:05.166
start with a reproducible
observation rather than a diagnosis.

3
00:00:05.677 --> 00:00:08.928
In this lesson, the program
rejects a synthetic input file.

4
00:00:09.206 --> 00:00:12.619
We will locate the failure layer,
propose competing explanations,

5
00:00:12.736 --> 00:00:15.290
and make one small change
that distinguishes them.

6
00:00:15.568 --> 00:00:19.318
Open checkpoint six in a new folder
and preserve its original files.

7
00:00:19.644 --> 00:00:22.337
The physical sensor is
not part of this exercise.

8
00:00:22.662 --> 00:00:25.437
Write the command and expected
behavior before running it.

9
00:00:25.762 --> 00:00:28.746
We are using the replay wrapper
with the invalid fixture.

10
00:00:29.071 --> 00:00:31.811
Save the actual process
exit immediately afterward,

11
00:00:32.020 --> 00:00:35.398
and preserve both ordinary
output and the error diagnostic.

12
00:00:35.909 --> 00:00:39.160
A useful symptom record names
the checkpoint, input file,

13
00:00:39.241 --> 00:00:43.247
exact command, expectation,
and observed result. Another

14
00:00:43.328 --> 00:00:47.171
engineer should be able to repeat it
without guessing which version you used.

15
00:00:47.496 --> 00:00:52.419
The supplied fixture contains a token
with a letter suffix: twenty-eight C.

16
00:00:52.628 --> 00:00:55.449
The adapter expects a
number without that suffix.

17
00:00:55.774 --> 00:00:59.292
The intended failing run
exits two and identifies

18
00:00:59.362 --> 00:01:02.183
the third file line as
an invalid sample number.

19
00:01:02.508 --> 00:01:06.153
A startup record and an earlier
valid sample may appear first.

20
00:01:06.595 --> 00:01:09.892
Partial output does not mean
that the rejected token became

21
00:01:09.927 --> 00:01:13.433
a valid temperature or that the
complete scenario succeeded.

22
00:01:13.816 --> 00:01:17.044
Locate the failure layer
before asking for a patch.

23
00:01:17.322 --> 00:01:20.004
A compiler failure prevents
a successful build.

24
00:01:20.283 --> 00:01:23.557
A linker problem prevents the
required pieces from combining.

25
00:01:23.882 --> 00:01:27.910
A missing runtime dependency can
prevent an executable from starting.

26
00:01:28.293 --> 00:01:31.881
Here, a line-number diagnostic
appears from the running adapter,

27
00:01:32.090 --> 00:01:34.911
which tells us execution
reached input parsing.

28
00:01:35.236 --> 00:01:39.567
That is evidence about where to inspect
next, not a physical sensor observation.

29
00:01:40.008 --> 00:01:44.873
Write at least two explanations. Perhaps
the fixture violates the supported format.

30
00:01:45.117 --> 00:01:48.321
Perhaps the parser wrongly
rejects an allowed numeric token.

31
00:01:48.762 --> 00:01:53.615
A third possibility is that policy
fails after receiving a valid sample.

32
00:01:54.056 --> 00:01:57.191
These explanations are not
equally supported once we read

33
00:01:57.226 --> 00:02:00.511
the diagnostic and code, but
stating them helps us choose

34
00:02:00.535 --> 00:02:03.867
an experiment instead of jumping
directly to a broad rewrite.

35
00:02:04.192 --> 00:02:07.559
Open the format description and
the relevant host adapter source.

36
00:02:07.884 --> 00:02:11.054
The small fixture language gives
temperature a documented unit

37
00:02:11.146 --> 00:02:14.177
and requires the complete
numeric token to be accepted.

38
00:02:14.502 --> 00:02:17.973
It does not support arbitrary
unit suffixes on each value.

39
00:02:18.414 --> 00:02:23.128
Explicit missing and nonfinite tokens
represent modeled input failures.

40
00:02:23.453 --> 00:02:26.518
Those valid event descriptions
are different from a malformed

41
00:02:26.588 --> 00:02:28.828
row that the adapter cannot interpret.

42
00:02:29.339 --> 00:02:32.706
Ask the assistant for a discriminating
test before permitting an edit.

43
00:02:33.310 --> 00:02:38.348
Supply the exact symptom, small fixture,
format requirement, and relevant code.

44
00:02:38.859 --> 00:02:42.075
Request a predicted observation
for each explanation.

45
00:02:42.354 --> 00:02:46.870
A suggestion such as try another
input is incomplete unless it names

46
00:02:46.917 --> 00:02:51.178
the input change, the command, and how
the outcome would affect the diagnosis.

47
00:02:51.561 --> 00:02:54.312
The explanation should lead
to an executable check.

48
00:02:54.637 --> 00:02:56.750
Choose the smallest useful change:

49
00:02:56.959 --> 00:03:00.976
make a copied fixture and remove only
the C suffix from the numeric token.

50
00:03:01.580 --> 00:03:03.368
Keep the original invalid file.

51
00:03:03.646 --> 00:03:07.141
Run the copied file through the
same source and executable path.

52
00:03:07.652 --> 00:03:09.509
This holds the toolchain, adapter,

53
00:03:09.533 --> 00:03:13.306
and policy constant while changing
the suspected malformed input.

54
00:03:13.747 --> 00:03:16.173
Successful acceptance
supports the input-format

55
00:03:16.255 --> 00:03:19.262
explanation without inventing
a new parser contract.

56
00:03:19.645 --> 00:03:22.350
Do not weaken the parser
to ignore every suffix.

57
00:03:22.628 --> 00:03:25.972
That could make this one line pass
while accepting malformed input

58
00:03:26.030 --> 00:03:30.140
that should remain rejected. It would
also change the question being tested.

59
00:03:30.465 --> 00:03:33.751
You would no longer be checking
whether the original token satisfied

60
00:03:33.785 --> 00:03:37.431
the existing language; you would
be designing a different language.

61
00:03:37.942 --> 00:03:42.179
Such a change needs a separate
requirement and its own acceptance cases.

62
00:03:42.620 --> 00:03:46.359
Do not replace the failed token with
zero simply to remove the error.

63
00:03:46.800 --> 00:03:49.470
Zero is a numeric reading
with its own meaning.

64
00:03:49.795 --> 00:03:52.686
It is not a neutral substitute
for an unknown value.

65
00:03:53.011 --> 00:03:58.038
If a scenario intends missing input, use
the documented missing representation.

66
00:03:58.549 --> 00:04:02.334
If it intends a particular temperature,
supply that temperature correctly.

67
00:04:02.938 --> 00:04:05.399
A plausible invented
reading can hide the very

68
00:04:05.492 --> 00:04:07.686
failure the program is meant to expose.

69
00:04:08.197 --> 00:04:12.713
After the corrected copy runs, execute
the original invalid fixture again.

70
00:04:12.992 --> 00:04:17.496
It should still be rejected. This paired
result matters: the intended numeric

71
00:04:17.555 --> 00:04:21.746
event is accepted while malformed
syntax remains outside the contract.

72
00:04:21.990 --> 00:04:23.441
Save both observations.

73
00:04:23.766 --> 00:04:27.748
A lone passing screenshot would not tell
a reviewer whether the parser had been

74
00:04:27.795 --> 00:04:31.591
weakened or whether the original
reproducer was ever exercised.

75
00:04:32.033 --> 00:04:34.772
Now update the diagnosis
using the evidence.

76
00:04:35.098 --> 00:04:39.242
The supported cause is a token outside
the documented fixture grammar.

77
00:04:39.567 --> 00:04:41.506
The correction changes that token,

78
00:04:41.680 --> 00:04:45.151
and the unchanged original
still reproduces rejection.

79
00:04:45.848 --> 00:04:49.784
This conclusion is narrower and more
useful than saying the sensor problem

80
00:04:49.853 --> 00:04:54.463
is fixed. No sensor was read,
no wiring was inspected,

81
00:04:54.672 --> 00:04:58.607
and no calibration or physical
timing was measured in this run.

82
00:04:59.118 --> 00:05:02.833
If the corrected file still fails,
preserve that contradiction.

83
00:05:03.344 --> 00:05:07.385
Check whether the command used the copied
filename, whether the working directory

84
00:05:07.431 --> 00:05:11.135
is correct, and whether the
intended executable was rebuilt.

85
00:05:11.645 --> 00:05:15.035
Do not repeat the same edit elsewhere
and call it a new experiment.

86
00:05:15.732 --> 00:05:18.971
The test may reveal that your
first explanation was incomplete,

87
00:05:19.180 --> 00:05:22.222
which is valuable information
when it is recorded accurately.

88
00:05:22.732 --> 00:05:25.263
The chapter also includes
a stale-policy fault.

89
00:05:25.705 --> 00:05:29.164
That failure occurs after valid
input has reached the policy,

90
00:05:29.373 --> 00:05:32.693
and it can produce perfectly
valid JSON with the wrong meaning.

91
00:05:33.077 --> 00:05:36.908
Its useful observations
include timestamp, state,

92
00:05:37.117 --> 00:05:40.809
error, and temperature availability.
Changing only the printed

93
00:05:40.867 --> 00:05:44.664
label could hide the symptom while
leaving recovery state incorrect.

94
00:05:45.174 --> 00:05:47.229
The same investigation method applies,

95
00:05:47.473 --> 00:05:50.979
but the discriminating test must
match that different failure layer.

96
00:05:51.490 --> 00:05:53.917
Write a concise report
from the raw evidence.

97
00:05:54.242 --> 00:05:57.156
Include the starting state,
original reproducer,

98
00:05:57.330 --> 00:06:01.266
competing explanations,
chosen test, actual result,

99
00:06:01.475 --> 00:06:04.946
bounded correction, regression
observation, and limits.

100
00:06:05.457 --> 00:06:07.651
An assistant can organize these pieces,

101
00:06:07.895 --> 00:06:10.426
but review each sentence
against the receipts.

102
00:06:10.809 --> 00:06:15.001
Replace unsupported claims of proof
with the precise behavior you observed,

103
00:06:15.175 --> 00:06:18.600
and keep an unexecuted
test labeled as a proposal.

104
00:06:19.111 --> 00:06:22.989
Your exercise is complete when another
reader can reproduce the failure,

105
00:06:23.314 --> 00:06:26.402
understand why the chosen
test distinguishes its cause,

106
00:06:26.576 --> 00:06:29.909
and assess the correction without
recovering your conversation.

107
00:06:30.605 --> 00:06:34.622
Preserve the original invalid
input and the corrected copy.

108
00:06:35.005 --> 00:06:38.906
In the module challenge, you will apply
this method independently to another

109
00:06:38.988 --> 00:06:43.655
seeded fixture failure and defend a small
fix with a complete evidence handoff.
