WEBVTT

1
00:00:00.000 --> 00:00:02.541
A project proposal contains one rule.

2
00:00:02.541 --> 00:00:07.211
A report may read the reports folder, but it must never write there.

3
00:00:07.550 --> 00:00:11.318
Then someone gives an agent a direct request: add CSV export.

4
00:00:11.318 --> 00:00:15.641
The request does not say where the rule came from, or how to check it.

5
00:00:15.983 --> 00:00:18.021
So here is this week's question.

6
00:00:18.021 --> 00:00:20.887
How does a rule like that survive every step,

7
00:00:20.887 --> 00:00:23.434
from the request to the finished change?

8
00:00:24.483 --> 00:00:28.787
Between that request and a finished change there are four transitions,

9
00:00:28.787 --> 00:00:31.614
and the rule can disappear in any one of them.

10
00:00:31.950 --> 00:00:36.441
Research: the agent reads an old README, but not the current permission test.

11
00:00:36.783 --> 00:00:40.994
Plan: the plan says, add export, and drops the read-only boundary.

12
00:00:41.333 --> 00:00:44.398
Implement: the tool's schema exposes a path,

13
00:00:44.398 --> 00:00:47.184
with no description of the allowed root.

14
00:00:47.533 --> 00:00:50.727
Verify: the test checks that a CSV exists,

15
00:00:50.727 --> 00:00:54.454
but never attempts a write to the reports folder.

16
00:00:54.454 --> 00:00:58.104
And the generated code can still look plausible.

17
00:00:59.150 --> 00:01:02.874
The notes turn this into a check you can do on paper.

18
00:01:02.874 --> 00:01:07.091
Generate: write a one-paragraph plan for the export request.

19
00:01:07.091 --> 00:01:09.620
Verify: underline four things in it.

20
00:01:09.620 --> 00:01:10.674
The constraint.

21
00:01:10.674 --> 00:01:11.447
Its source.

22
00:01:11.447 --> 00:01:13.415
The implementation boundary.

23
00:01:13.415 --> 00:01:14.961
And the negative test.

24
00:01:15.300 --> 00:01:17.809
Here is a plan we wrote for this video.

25
00:01:17.809 --> 00:01:22.957
It reads well enough: add an export command, write the file where the user asks,

26
00:01:22.957 --> 00:01:24.887
and test that the file exists.

27
00:01:24.887 --> 00:01:26.238
Now try to underline.

28
00:01:26.238 --> 00:01:27.911
None of the four is there.

29
00:01:28.250 --> 00:01:29.906
Here is our second draft.

30
00:01:29.906 --> 00:01:31.165
It states the rule.

31
00:01:31.165 --> 00:01:36.200
It names the source: the proposal, and the permission test at this revision.

32
00:01:36.200 --> 00:01:39.844
It sets the boundary: only paths inside the out folder.

33
00:01:39.844 --> 00:01:42.560
And it has one test that must be refused.

34
00:01:42.560 --> 00:01:43.421
Four of four.

35
00:01:43.767 --> 00:01:46.142
If one is missing, the plan is incomplete,

36
00:01:46.142 --> 00:01:48.687
even when the generated code looks plausible.

37
00:01:48.687 --> 00:01:51.458
The rest of this video makes each underline real.

38
00:01:52.500 --> 00:01:57.923
Use three short artifacts rather than one unbounded prompt: research, a plan,

39
00:01:57.923 --> 00:01:59.472
and an implementation.

40
00:01:59.472 --> 00:02:02.642
Research asks: what is true at this revision?

41
00:02:02.642 --> 00:02:07.431
Its artifact is an evidence table, with paths, symbols and unknowns.

42
00:02:07.767 --> 00:02:12.344
Generate: ask for rows that name the export handler and its rejection test.

43
00:02:12.344 --> 00:02:16.128
In this example of ours, the draft comes back with three rows,

44
00:02:16.128 --> 00:02:17.898
and every row says confirmed.

45
00:02:18.233 --> 00:02:22.832
Verify: this export request is invented, so there is no file to open yet.

46
00:02:22.832 --> 00:02:26.045
Every row that said confirmed now says cannot tell.

47
00:02:26.045 --> 00:02:30.203
Later, in the studio, you check the rows against its case checker.

48
00:02:30.203 --> 00:02:33.919
In your own project, you open the file that each row names,

49
00:02:33.919 --> 00:02:36.124
at the revision you are working on.

50
00:02:36.467 --> 00:02:39.546
Mark an unknown explicitly rather than guessing.

51
00:02:39.546 --> 00:02:44.678
A plan is more useful when a reader can disagree with one row and run one check.

52
00:02:45.717 --> 00:02:49.717
The plan asks: what small change would satisfy the request?

53
00:02:49.717 --> 00:02:54.261
Its artifact holds ordered steps, boundaries, and acceptance cases.

54
00:02:54.261 --> 00:02:57.448
Write each case as observable input and output.

55
00:02:57.783 --> 00:02:59.040
The notes give three.

56
00:02:59.040 --> 00:03:03.885
In the first, the request names a file in the out folder, and the rows are valid.

57
00:03:03.885 --> 00:03:07.474
Then the file is created, and the command reports: exported.

58
00:03:07.817 --> 00:03:09.619
The second carries our rule.

59
00:03:09.619 --> 00:03:12.645
The request names a file in the reports folder.

60
00:03:12.645 --> 00:03:17.409
Then no file is written, and the command reports: refused, read-only root.

61
00:03:17.409 --> 00:03:20.628
This case can pass only when something is refused.

62
00:03:20.967 --> 00:03:23.492
In the third, a row is missing its ID.

63
00:03:23.492 --> 00:03:27.878
Again no file is written, and the command reports the invalid row.

64
00:03:27.878 --> 00:03:30.868
A specification that only says, export works,

65
00:03:30.868 --> 00:03:34.258
cannot reveal a missing refusal or a partial write.

66
00:03:35.300 --> 00:03:38.705
Implementation asks: what code expresses that plan?

67
00:03:38.705 --> 00:03:41.510
For an agent, part of that code is a tool.

68
00:03:41.510 --> 00:03:46.117
And a model sees four things about a tool: its name, its description,

69
00:03:46.117 --> 00:03:49.122
its input schema, and the message it returns.

70
00:03:49.122 --> 00:03:50.791
Treat them as a contract.

71
00:03:51.133 --> 00:03:53.948
Read this loose version as a model would.

72
00:03:53.948 --> 00:03:55.526
It writes a CSV report.

73
00:03:55.526 --> 00:03:59.645
Its path is any string, so the model can attempt any string.

74
00:03:59.645 --> 00:04:02.184
Our rule is nowhere in this contract.

75
00:04:02.533 --> 00:04:04.428
Now the revision in the notes.

76
00:04:04.428 --> 00:04:06.511
The name is a verb and an object.

77
00:04:06.511 --> 00:04:10.805
The description states the allowed root and the important exclusion.

78
00:04:10.805 --> 00:04:15.983
And the schema makes the rest machine-checkable: required fields, a closed object,

79
00:04:15.983 --> 00:04:17.624
and a pattern on the path.

80
00:04:17.967 --> 00:04:20.518
Two more checks apply to what comes back.

81
00:04:20.518 --> 00:04:25.435
An error identifies the bad field and the next repair; it is never a traceback.

82
00:04:25.435 --> 00:04:30.538
And a result returns the observation the next decision needs, including a refusal.

83
00:04:31.583 --> 00:04:33.532
Generate: propose two calls.

84
00:04:33.532 --> 00:04:39.167
One names a file in the out folder; the other names a file in the reports folder.

85
00:04:39.167 --> 00:04:42.994
Before you run anything, predict what each will return.

86
00:04:43.333 --> 00:04:47.275
Verify: validate both against the schema, and run the handler.

87
00:04:47.275 --> 00:04:49.690
This is our run of the studio's check.

88
00:04:49.690 --> 00:04:53.504
The first call reaches the handler and comes back: exported.

89
00:04:53.850 --> 00:04:55.813
The second never reaches it.

90
00:04:55.813 --> 00:05:01.070
The path fails the pattern, and the refusal names the field and the repair.

91
00:05:01.070 --> 00:05:04.715
A third call, with an unknown field, is refused too.

92
00:05:04.715 --> 00:05:08.781
Both are rejected before the handler, with no file effect.

93
00:05:09.117 --> 00:05:09.977
One caution.

94
00:05:09.977 --> 00:05:11.983
MCP names a protocol family:

95
00:05:11.983 --> 00:05:16.067
it connects a model application with tools and resources.

96
00:05:16.067 --> 00:05:19.292
The protocol does not make a vague tool safe.

97
00:05:19.292 --> 00:05:22.158
The handler still enforces its boundary,

98
00:05:22.158 --> 00:05:26.888
and the controller still has to pass the result back to the model.

99
00:05:27.933 --> 00:05:30.155
The last transition is verify.

100
00:05:30.155 --> 00:05:35.116
Generate: the smallest function that could satisfy the three cases.

101
00:05:35.116 --> 00:05:36.967
Here is a draft we wrote.

102
00:05:36.967 --> 00:05:41.780
And here is the test a plan without the rule would write: export,

103
00:05:41.780 --> 00:05:43.927
then check that a CSV exists.

104
00:05:43.927 --> 00:05:45.704
On our draft, it passes.

105
00:05:46.050 --> 00:05:50.352
Now run the three cases, each against a fresh temporary directory.

106
00:05:50.352 --> 00:05:51.461
The first passes.

107
00:05:51.461 --> 00:05:54.590
The second fails: the command reported exported,

108
00:05:54.590 --> 00:05:57.327
and a file now sits in the reports folder.

109
00:05:57.327 --> 00:06:02.021
The third fails too: the export crashed, and left a partial file behind.

110
00:06:02.367 --> 00:06:06.216
After a revision that refuses before it writes, all three pass.

111
00:06:06.216 --> 00:06:08.843
The existence test passed on both versions.

112
00:06:08.843 --> 00:06:11.898
Only the two negative cases could tell them apart.

113
00:06:12.233 --> 00:06:15.661
So rerun the acceptance cases after the last write.

114
00:06:15.661 --> 00:06:20.635
And record four things: the command, the exit status, the observed output,

115
00:06:20.635 --> 00:06:21.844
and your decision.

116
00:06:22.883 --> 00:06:27.363
There is one more place to lose a rule, and it is not a transition.

117
00:06:27.363 --> 00:06:29.035
It is the history itself.

118
00:06:29.035 --> 00:06:31.509
A context window is a working budget.

119
00:06:31.509 --> 00:06:35.454
Tool output, repeated reads and failed attempts consume it,

120
00:06:35.454 --> 00:06:39.934
and a later request can then miss the one constraint that mattered.

121
00:06:40.283 --> 00:06:44.831
The notes show this on a second example: one session of nineteen messages,

122
00:06:44.831 --> 00:06:45.814
written by hand.

123
00:06:45.814 --> 00:06:47.719
Its task has a rule of its own.

124
00:06:47.719 --> 00:06:52.574
That rule arrived once, inside an early tool result: do not edit the view file.

125
00:06:52.916 --> 00:06:56.767
A course-written script builds the next request from that history.

126
00:06:56.767 --> 00:07:00.092
Then a short policy, also course-written and not a model,

127
00:07:00.092 --> 00:07:02.659
picks the next edit from that context alone.

128
00:07:02.659 --> 00:07:06.567
In full mode, all nineteen messages are kept, and the check passes.

129
00:07:06.916 --> 00:07:10.126
In auto mode, the older tool results are cleared,

130
00:07:10.126 --> 00:07:12.877
and the line with the rule goes with them.

131
00:07:12.877 --> 00:07:14.188
Now the check fails.

132
00:07:14.188 --> 00:07:16.415
No model was called in either run.

133
00:07:16.415 --> 00:07:20.607
The history got shorter, and the rule was in the part that went.

134
00:07:21.650 --> 00:07:25.029
So before you shorten a history, generate a handoff.

135
00:07:25.029 --> 00:07:29.772
It holds the task, the source of each constraint, the current file state,

136
00:07:29.772 --> 00:07:34.061
the last failed check, what is still unknown, and the next action.

137
00:07:34.400 --> 00:07:35.424
Then verify it.

138
00:07:35.424 --> 00:07:38.499
Compare each line with the recorded messages,

139
00:07:38.499 --> 00:07:41.505
and rerun the check on the current revision.

140
00:07:41.505 --> 00:07:46.971
A summary that says, tests passed, without the tested revision, is not evidence.

141
00:07:47.316 --> 00:07:51.777
And when most entries are stale or contradictory, restart with a written handoff,

142
00:07:51.777 --> 00:07:53.209
and reread the next files.

143
00:07:53.209 --> 00:07:55.467
Compacting is a choice about information.

144
00:07:55.467 --> 00:07:59.487
It is not a guarantee that the model will remember the right information.

145
00:08:00.533 --> 00:08:01.670
Back to our rule.

146
00:08:01.670 --> 00:08:06.152
It survives when every transition keeps it somewhere you can check.

147
00:08:06.152 --> 00:08:09.898
The research names the permission test and its revision.

148
00:08:09.898 --> 00:08:12.574
The plan repeats the read-only boundary.

149
00:08:12.574 --> 00:08:14.648
The schema constrains the path.

150
00:08:14.648 --> 00:08:19.464
And the negative case attempts the write, and expects nothing to change.

151
00:08:19.800 --> 00:08:23.220
This week's project proposal asks for the core scenario,

152
00:08:23.220 --> 00:08:26.152
a scope boundary and your first observable case.

153
00:08:26.152 --> 00:08:31.222
The studio goes further: three to five cases that can fail, kept with the proposal,

154
00:08:31.222 --> 00:08:32.933
and one tighter tool schema.

155
00:08:32.933 --> 00:08:37.331
Finish with one line: accept, narrow, recheck or stop, and its evidence.

156
00:08:37.666 --> 00:08:38.645
So try it now.

157
00:08:38.645 --> 00:08:41.579
A later plan omits the read-only boundary.

158
00:08:41.579 --> 00:08:44.234
Which research artifact would you add?

159
00:08:44.234 --> 00:08:47.797
And which negative case, before any implementation?
