Commit 6fad4cc
committed
Drop model-authored agentLabel from the approval log (CL-5666 review fix)
A sub-agent's task-dispatch description is free text the model composes
itself, only ever .trim()ed, never constrained to a closed set. It had been
flowing verbatim into approvals.jsonl as agentLabel, which is on-by-default
and append-forever -- unlike rule (a closed set) and segments (a count),
nothing stops it from carrying a path, a token, or content the model just
read. Dropped the field entirely: volume, rule mix, mode split, and timing
all still work without it, and no concrete question needed a per-agent
breakdown badly enough to justify the risk.
Added a hard size cap on the serialized record (512 bytes) as defense in
depth -- every real field is a fixed enum, a count, or a timestamp, so a
well-formed line should never come close to it; an oversized line is
dropped rather than truncated, so no partial secret survives. Added the
missing test: a fake secret embedded in a sub-agent's dispatch description,
driven through the gate, asserted absent from the serialized record; and a
test that a rule field stuffed with 10k chars (simulating a future
regression) is dropped by the cap rather than logged.
Also corrected the doc comment's claim about rule provenance: alongside the
existing auto-shell-policy.ts/classify.ts rule names, this file defines its
own small set of fixed literals (auto-allowed-tool, non-interactive,
mega-chain) for decisions those modules don't otherwise name -- still a
closed set, just not literally reused from elsewhere.1 parent b06a563 commit 6fad4cc
4 files changed
Lines changed: 93 additions & 30 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
374 | 374 | | |
375 | 375 | | |
376 | 376 | | |
377 | | - | |
| 377 | + | |
378 | 378 | | |
379 | 379 | | |
380 | 380 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
12 | 17 | | |
13 | 18 | | |
14 | 19 | | |
| |||
143 | 148 | | |
144 | 149 | | |
145 | 150 | | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
146 | 207 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
17 | 23 | | |
18 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
19 | 27 | | |
20 | 28 | | |
21 | 29 | | |
| |||
51 | 59 | | |
52 | 60 | | |
53 | 61 | | |
54 | | - | |
55 | | - | |
56 | 62 | | |
57 | 63 | | |
58 | 64 | | |
| |||
77 | 83 | | |
78 | 84 | | |
79 | 85 | | |
80 | | - | |
81 | 86 | | |
82 | 87 | | |
83 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
84 | 97 | | |
85 | 98 | | |
86 | 99 | | |
| |||
118 | 131 | | |
119 | 132 | | |
120 | 133 | | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
121 | 138 | | |
122 | 139 | | |
123 | 140 | | |
| |||
148 | 165 | | |
149 | 166 | | |
150 | 167 | | |
151 | | - | |
152 | 168 | | |
153 | 169 | | |
154 | 170 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
413 | 413 | | |
414 | 414 | | |
415 | 415 | | |
416 | | - | |
417 | 416 | | |
418 | 417 | | |
419 | 418 | | |
420 | 419 | | |
421 | 420 | | |
422 | 421 | | |
423 | | - | |
424 | 422 | | |
425 | 423 | | |
426 | 424 | | |
| |||
494 | 492 | | |
495 | 493 | | |
496 | 494 | | |
497 | | - | |
| 495 | + | |
498 | 496 | | |
499 | 497 | | |
500 | 498 | | |
501 | | - | |
| 499 | + | |
502 | 500 | | |
503 | 501 | | |
504 | 502 | | |
505 | | - | |
506 | | - | |
507 | | - | |
508 | | - | |
509 | | - | |
510 | | - | |
| 503 | + | |
511 | 504 | | |
512 | 505 | | |
513 | 506 | | |
| |||
617 | 610 | | |
618 | 611 | | |
619 | 612 | | |
620 | | - | |
621 | | - | |
622 | | - | |
623 | | - | |
624 | | - | |
625 | | - | |
| 613 | + | |
626 | 614 | | |
627 | 615 | | |
628 | 616 | | |
| |||
638 | 626 | | |
639 | 627 | | |
640 | 628 | | |
641 | | - | |
642 | 629 | | |
643 | 630 | | |
644 | 631 | | |
| |||
685 | 672 | | |
686 | 673 | | |
687 | 674 | | |
688 | | - | |
| 675 | + | |
689 | 676 | | |
690 | 677 | | |
691 | 678 | | |
| |||
695 | 682 | | |
696 | 683 | | |
697 | 684 | | |
698 | | - | |
699 | 685 | | |
700 | 686 | | |
701 | 687 | | |
| |||
0 commit comments