WEBVTT

1
00:00:00.000 --> 00:00:02.797
An agent finishes a task and reports on its own work:

2
00:00:02.797 --> 00:00:05.014
every call I made stayed within my grants,

3
00:00:05.014 --> 00:00:07.811
and the portal refused the one call it did not cover.

4
00:00:08.150 --> 00:00:09.555
That summary is a claim.

5
00:00:09.555 --> 00:00:13.361
Before you act on it, check it against the record the team keeps.

6
00:00:14.400 --> 00:00:15.975
When a whole team runs agents,

7
00:00:15.975 --> 00:00:19.651
the controls you kept around your own agent move into shared services.

8
00:00:20.000 --> 00:00:25.292
Four pieces recur: a tool portal, a model gateway, cost per accepted change,

9
00:00:25.292 --> 00:00:26.754
and a routing policy.

10
00:00:26.754 --> 00:00:31.419
Each one concentrates authority, so one review reaches every agent,

11
00:00:31.419 --> 00:00:33.091
and so does one mistake.

12
00:00:33.433 --> 00:00:37.599
For each piece, the same two steps: the record's agent summary is the claim,

13
00:00:37.599 --> 00:00:39.244
and then you check the record.

14
00:00:40.282 --> 00:00:46.078
A tool portal is one service that lists which tools exist and who may call each one,

15
00:00:46.078 --> 00:00:47.733
and records every grant.

16
00:00:48.082 --> 00:00:52.901
The record holds one task, three grants, and a session of five calls.

17
00:00:52.901 --> 00:00:57.579
The task: read the log of a failed build in one example repository,

18
00:00:57.579 --> 00:01:00.093
and open a draft pull request there.

19
00:01:00.432 --> 00:01:02.304
Match each call to a grant.

20
00:01:02.304 --> 00:01:03.898
Four calls are allowed.

21
00:01:03.898 --> 00:01:08.057
One has no grant, so it is denied, and the tool did not run.

22
00:01:08.057 --> 00:01:09.443
The summary is true.

23
00:01:10.482 --> 00:01:13.139
Now list what each grant can reach.

24
00:01:13.139 --> 00:01:17.770
Grant G2 reads code in every repository, two of them private.

25
00:01:17.770 --> 00:01:19.213
The task needs one.

26
00:01:19.549 --> 00:01:23.105
The build log told the agent to compare a settings file,

27
00:01:23.105 --> 00:01:28.248
so call three read a private repository the task never needed, and G2 allowed it.

28
00:01:28.248 --> 00:01:30.280
The check exits one: over-broad.

29
00:01:30.615 --> 00:01:34.026
When the grant itself reaches further than the task, every call passes.

30
00:01:34.365 --> 00:01:37.768
So treat a grant like code: an owner, a reason,

31
00:01:37.768 --> 00:01:40.954
and a test that a call outside it is denied.

32
00:01:40.954 --> 00:01:45.154
Narrow G2 to the one repository, and the check exits zero:

33
00:01:45.154 --> 00:01:49.136
call three is now the denied call that tests the grant.

34
00:01:50.181 --> 00:01:56.678
A model gateway is one controlled place between code that wants a model and the service that answers.

35
00:01:56.678 --> 00:01:58.672
Describe it by what it refuses.

36
00:01:59.015 --> 00:02:01.844
Only the gateway holds the provider key.

37
00:02:01.844 --> 00:02:04.391
It sends only to routes on its list.

38
00:02:04.391 --> 00:02:08.706
And it refuses, before sending, a request past the run's cap.

39
00:02:09.048 --> 00:02:13.406
The record's policy allows four requests and three thousand tokens per run,

40
00:02:13.406 --> 00:02:14.626
on two listed routes.

41
00:02:14.626 --> 00:02:17.299
The summary: all six runs followed the policy.

42
00:02:18.347 --> 00:02:20.098
Replay the policy over each run,

43
00:02:20.098 --> 00:02:22.944
adding each request's reservation before it is sent.

44
00:02:22.944 --> 00:02:26.118
Then search the lines the agent's side logged for the key.

45
00:02:26.464 --> 00:02:27.851
The check exits one.

46
00:02:27.851 --> 00:02:30.418
In run two, a fifth request was sent.

47
00:02:30.418 --> 00:02:32.915
Run four used a route nobody listed.

48
00:02:33.264 --> 00:02:36.962
Run three is the gateway working: a thousand tokens remained,

49
00:02:36.962 --> 00:02:41.995
and the third request was still refused, because it could have used twelve hundred.

50
00:02:42.330 --> 00:02:45.356
And run six matches the policy on every request,

51
00:02:45.356 --> 00:02:48.445
yet leaks the key into a log on the agent's side.

52
00:02:48.445 --> 00:02:52.101
A policy replay and a key search are two different checks.

53
00:02:53.145 --> 00:02:56.960
Run three shows the rule that makes a cap protect anything:

54
00:02:56.960 --> 00:02:59.933
reserve a request's worst case before sending,

55
00:02:59.933 --> 00:03:03.036
and settle to the actual amount after the reply.

56
00:03:03.379 --> 00:03:08.381
In course-made units: the cap is ten, each request reserves four,

57
00:03:08.381 --> 00:03:10.304
and each reply costs one.

58
00:03:10.304 --> 00:03:12.151
Seven requests are sent.

59
00:03:12.151 --> 00:03:17.230
The eighth is refused: three units remain, and it could cost four.

60
00:03:17.579 --> 00:03:19.703
Now request two loses its reply.

61
00:03:19.703 --> 00:03:25.079
The gateway cannot tell whether it was charged, so the whole reservation is kept,

62
00:03:25.079 --> 00:03:27.270
and the fifth request is refused.

63
00:03:27.612 --> 00:03:33.480
A timeout marks where observation stopped; it does not show that nothing happened.

64
00:03:33.480 --> 00:03:36.343
And a cap is a hard stop, not a warning.

65
00:03:37.378 --> 00:03:39.313
A run's total measures one run.

66
00:03:39.313 --> 00:03:43.744
A team needs to know what an accepted change cost: every run behind it,

67
00:03:43.744 --> 00:03:47.115
failed and retried attempts included, the review time,

68
00:03:47.115 --> 00:03:49.549
and the runs spent on rejected changes.

69
00:03:49.895 --> 00:03:55.186
The summary says a change costs about three units: the total of a single run.

70
00:03:55.528 --> 00:04:01.163
The record shows twenty-four units across seven runs, and three accepted changes.

71
00:04:01.163 --> 00:04:06.659
That is eight units per accepted change, not three, with twenty review minutes.

72
00:04:07.695 --> 00:04:12.903
A routing policy sends each task to the cheapest route that passes the evaluator.

73
00:04:12.903 --> 00:04:17.211
Good enough is a measurement: the same frozen cases on both routes,

74
00:04:17.211 --> 00:04:18.626
compared case by case.

75
00:04:18.961 --> 00:04:24.071
The summary: all three tasks moved to a cheaper route without losing quality.

76
00:04:24.071 --> 00:04:28.252
And all three choices satisfy the policy's ninety percent rule.

77
00:04:28.595 --> 00:04:30.037
Only one is supported.

78
00:04:30.037 --> 00:04:34.037
In the first task, the cheaper route passes eleven of twelve,

79
00:04:34.037 --> 00:04:37.446
and loses the one case the current route gets right.

80
00:04:37.795 --> 00:04:41.998
In the third, the cheaper route's results are for an older revision.

81
00:04:41.998 --> 00:04:45.646
Rerun the frozen cases whenever a route or a model changes.

82
00:04:46.694 --> 00:04:50.084
Operating agents includes the day something breaks.

83
00:04:50.084 --> 00:04:54.205
On the example dashboard, a revision goes live at ten-oh-five,

84
00:04:54.205 --> 00:04:56.798
and a user reports a slow project page.

85
00:04:56.798 --> 00:05:01.185
Before anyone changes code, an agent drafts a root-cause analysis.

86
00:05:01.527 --> 00:05:04.814
It makes three claims, each citing lines of a request log:

87
00:05:04.814 --> 00:05:08.724
the revision broke imports; the project page slowed from ten-oh-five;

88
00:05:08.724 --> 00:05:11.331
and the cause is one database query per build.

89
00:05:11.331 --> 00:05:14.618
It proposes a rollback, and automatic retries for imports.

90
00:05:15.659 --> 00:05:20.286
For each claim, predict first: confirmed, refuted or cannot tell,

91
00:05:20.286 --> 00:05:22.350
and the line that decides it.

92
00:05:24.193 --> 00:05:25.358
Then run the check.

93
00:05:25.358 --> 00:05:28.488
For each five-minute window it prints the requests,

94
00:05:28.488 --> 00:05:32.109
the server errors and the ninety-fifth percentile duration.

95
00:05:32.109 --> 00:05:34.563
It counts and prints; it does not judge.

96
00:05:34.909 --> 00:05:36.794
Give each claim one outcome.

97
00:05:36.794 --> 00:05:39.822
Confirmed: the log shows the claim as stated.

98
00:05:39.822 --> 00:05:43.389
Refuted: the log shows something the claim rules out.

99
00:05:43.389 --> 00:05:48.840
Cannot tell: no field in this log could show it, so name the missing observation.

100
00:05:49.876 --> 00:05:53.604
A cited line supports a claim only if its time,

101
00:05:53.604 --> 00:05:56.777
path and status say what the claim says.

102
00:05:56.777 --> 00:05:57.966
Open every one.

103
00:05:58.309 --> 00:06:02.194
And a change that starts when a revision goes live confirms the timing,

104
00:06:02.194 --> 00:06:02.960
not the cause.

105
00:06:03.309 --> 00:06:05.673
So act only on what you confirmed.

106
00:06:05.673 --> 00:06:09.774
A mitigation that rests on timing alone must be reversible,

107
00:06:09.774 --> 00:06:12.416
and end with a check of the user path.

108
00:06:12.416 --> 00:06:16.240
A code repair waits for a check that can see its cause.

109
00:06:17.276 --> 00:06:18.568
A second incident.

110
00:06:18.568 --> 00:06:24.027
The dashboard receives a retry for build forty-two: the transaction commits,

111
00:06:24.027 --> 00:06:25.607
and job J81 is queued.

112
00:06:25.607 --> 00:06:29.126
Then the reply is lost, and the client times out.

113
00:06:29.476 --> 00:06:33.905
So the operator retries: the same operation, with the same operation key,

114
00:06:33.905 --> 00:06:34.876
delivered again.

115
00:06:34.876 --> 00:06:37.606
The unprotected handler creates a second job.

116
00:06:37.942 --> 00:06:42.666
The client's timeout cannot separate a failed request from a lost reply.

117
00:06:42.666 --> 00:06:45.553
The persisted job and its operation key can.

118
00:06:46.592 --> 00:06:49.256
Write the requirement before any repair.

119
00:06:49.256 --> 00:06:52.852
The same key and build again returns the existing job,

120
00:06:52.852 --> 00:06:55.582
even when two deliveries arrive together.

121
00:06:55.582 --> 00:06:58.578
The same key for another build is a conflict.

122
00:06:58.578 --> 00:07:00.243
A new key gets a new job.

123
00:07:00.592 --> 00:07:04.504
Suppose the agent proposes the obvious repair: look the key up,

124
00:07:04.504 --> 00:07:06.925
and insert a job only if none is found.

125
00:07:06.925 --> 00:07:09.409
Its summary says the duplicate is fixed.

126
00:07:09.409 --> 00:07:12.203
On the incident as it happened, that is true.

127
00:07:13.242 --> 00:07:16.338
Verify with a regression that replays all four rows.

128
00:07:16.338 --> 00:07:21.042
On the incident build, one row of four meets the requirement, and it exits one:

129
00:07:21.042 --> 00:07:22.173
the check can fail.

130
00:07:22.509 --> 00:07:25.671
On the agent's proposal: three of four, exit one.

131
00:07:25.671 --> 00:07:27.800
The reported sequence now passes.

132
00:07:27.800 --> 00:07:33.091
But when two requests arrive together, both look the key up before either inserts,

133
00:07:33.091 --> 00:07:34.640
and two jobs are stored.

134
00:07:34.976 --> 00:07:39.266
A regression that replayed only the reported sequence would have accepted this repair.

135
00:07:39.609 --> 00:07:43.187
The real repair lets the database enforce a unique key,

136
00:07:43.187 --> 00:07:47.220
stored with the job in one statement: four of four, exit zero.

137
00:07:47.559 --> 00:07:49.458
Keep the three results together.

138
00:07:49.458 --> 00:07:53.970
A test that has only ever passed cannot show that it would catch the defect.

139
00:07:55.007 --> 00:07:59.933
An agent that keeps acting in a deployed system is one more service to operate.

140
00:07:59.933 --> 00:08:05.046
Give it scoped credentials, a budget, and a switch that stops it without a deploy.

141
00:08:05.046 --> 00:08:07.477
Log what it read, proposed and changed,

142
00:08:07.477 --> 00:08:11.218
and keep irreversible operations behind a person's approval.

143
00:08:11.557 --> 00:08:12.839
Put it in the runbook.

144
00:08:12.839 --> 00:08:15.053
Its retries need the same idempotency,

145
00:08:15.053 --> 00:08:19.248
and its grants and caps are the portal and the gateway you just checked.

146
00:08:20.291 --> 00:08:24.433
So a summary is a claim until you check it against the record.

147
00:08:24.433 --> 00:08:27.240
A cited line is a claim until you open it.

148
00:08:27.240 --> 00:08:30.782
And a recovery is proved by a test that failed first.

149
00:08:31.124 --> 00:08:31.754
A citation,

150
00:08:31.754 --> 00:08:36.856
a fluent explanation or a successful demonstration does not supply a missing observation.

151
00:08:36.856 --> 00:08:40.295
State the next check, and why it would change your decision.

152
00:08:40.641 --> 00:08:42.059
One question to try.

153
00:08:42.059 --> 00:08:46.880
An on-call agent asks the deployment tool to roll back one revision.

154
00:08:46.880 --> 00:08:50.780
The call times out, so it sends the same request again,

155
00:08:50.780 --> 00:08:53.119
but the first call had completed.

156
00:08:53.119 --> 00:08:58.012
What must the second call return, and which effect must it not cause?
