Commit 3fe2f4f
authored
fix(provenance): report why a projection was refused, at the point of refusal (#6483)
* fix(provenance): report why a projection was refused, at the point of refusal
A refusal fails closed and reaches the user as one fixed sentence. The guard
that caused it may have tripped many frames — or a whole process — earlier, and
the incompleteness latch is one-way, so by then the causing call has long
returned. #6478 recorded the reason when the guard tripped, but marking
early-returns once a registry is already incomplete, so a run that inherits an
incomplete registry refused with nothing recorded anywhere. That is the case
production actually hits.
Retain reasons on the registry and report them where the refusal happens. The
reason is recorded before the already-incomplete return so a causal chain
accumulates, and before the silence checks so a by-design origin that logs
nothing when marked is still nameable at refusal. Propagation inherits through
markIncomplete's source argument, and copying incomplete input paths carries
their reasons, so a fork cannot latch without its cause.
Route all 68 refusal sites through one choke point that logs boundary, cause,
input path and workspace before throwing. It returns never, so callers still
narrow; messages and thrown types are unchanged at every site. Records carry a
cause discriminator, since a latched registry and a caller-side cross-check of
the projection's own output both arrive here and only the former has reasons.
No behaviour change.
* fix(provenance): stop registry-less refusals deduplicating across requests
A refusal with no registry aborts the request rather than iterating, so it
reaches the reporter at most once per request. Remembering it for the process
silenced every later request, including the one being investigated.
* improvement(provenance): inherit copied-path reasons once per copy
Semantics are unchanged — reasons are still inherited only when at least one
incomplete path was actually copied — but the source set is walked once rather
than once per copied path.1 parent 4b2412b commit 3fe2f4f
15 files changed
Lines changed: 918 additions & 93 deletions
File tree
- apps/sim
- app/api/mcp/serve/[serverId]
- executor
- handlers
- agent
- evaluator
- mothership
- pi
- router
- utils
- lib
- copilot/request/lifecycle
- guardrails
- knowledge
- tools
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
| |||
293 | 294 | | |
294 | 295 | | |
295 | 296 | | |
296 | | - | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
297 | 304 | | |
298 | 305 | | |
299 | 306 | | |
| |||
939 | 946 | | |
940 | 947 | | |
941 | 948 | | |
942 | | - | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
943 | 953 | | |
944 | 954 | | |
945 | 955 | | |
| |||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| 33 | + | |
| 34 | + | |
32 | 35 | | |
33 | 36 | | |
34 | 37 | | |
| |||
82 | 85 | | |
83 | 86 | | |
84 | 87 | | |
85 | | - | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
86 | 94 | | |
87 | 95 | | |
88 | 96 | | |
| |||
95 | 103 | | |
96 | 104 | | |
97 | 105 | | |
98 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
99 | 112 | | |
100 | 113 | | |
101 | 114 | | |
| |||
213 | 226 | | |
214 | 227 | | |
215 | 228 | | |
216 | | - | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
217 | 234 | | |
218 | 235 | | |
219 | | - | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
220 | 242 | | |
221 | | - | |
| 243 | + | |
222 | 244 | | |
223 | 245 | | |
224 | 246 | | |
| |||
232 | 254 | | |
233 | 255 | | |
234 | 256 | | |
235 | | - | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
236 | 263 | | |
237 | 264 | | |
238 | 265 | | |
| |||
241 | 268 | | |
242 | 269 | | |
243 | 270 | | |
244 | | - | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
245 | 277 | | |
246 | 278 | | |
247 | 279 | | |
248 | 280 | | |
249 | 281 | | |
250 | | - | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
251 | 288 | | |
252 | 289 | | |
253 | 290 | | |
254 | 291 | | |
255 | 292 | | |
256 | 293 | | |
257 | 294 | | |
258 | | - | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
259 | 301 | | |
260 | 302 | | |
261 | 303 | | |
262 | | - | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
263 | 310 | | |
264 | 311 | | |
265 | 312 | | |
| |||
283 | 330 | | |
284 | 331 | | |
285 | 332 | | |
286 | | - | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
287 | 342 | | |
288 | 343 | | |
289 | | - | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
290 | 350 | | |
291 | 351 | | |
292 | 352 | | |
293 | | - | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
294 | 359 | | |
295 | 360 | | |
296 | 361 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
81 | 82 | | |
82 | 83 | | |
83 | 84 | | |
84 | | - | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
85 | 91 | | |
86 | 92 | | |
87 | 93 | | |
| |||
Lines changed: 54 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
53 | 58 | | |
54 | 59 | | |
55 | 60 | | |
| |||
234 | 239 | | |
235 | 240 | | |
236 | 241 | | |
237 | | - | |
238 | | - | |
239 | | - | |
| 242 | + | |
| 243 | + | |
240 | 244 | | |
241 | | - | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
242 | 251 | | |
243 | 252 | | |
244 | 253 | | |
| |||
249 | 258 | | |
250 | 259 | | |
251 | 260 | | |
252 | | - | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
253 | 267 | | |
254 | 268 | | |
255 | 269 | | |
| |||
293 | 307 | | |
294 | 308 | | |
295 | 309 | | |
296 | | - | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
297 | 316 | | |
298 | 317 | | |
299 | 318 | | |
300 | 319 | | |
301 | 320 | | |
302 | 321 | | |
303 | | - | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
304 | 328 | | |
305 | 329 | | |
306 | 330 | | |
307 | 331 | | |
308 | | - | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
309 | 338 | | |
310 | 339 | | |
311 | 340 | | |
| |||
316 | 345 | | |
317 | 346 | | |
318 | 347 | | |
319 | | - | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
320 | 353 | | |
321 | 354 | | |
322 | 355 | | |
| |||
640 | 673 | | |
641 | 674 | | |
642 | 675 | | |
643 | | - | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
644 | 682 | | |
645 | 683 | | |
646 | 684 | | |
| |||
767 | 805 | | |
768 | 806 | | |
769 | 807 | | |
770 | | - | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
771 | 814 | | |
772 | 815 | | |
773 | 816 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
| |||
172 | 173 | | |
173 | 174 | | |
174 | 175 | | |
175 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
176 | 182 | | |
177 | 183 | | |
178 | 184 | | |
| |||
431 | 437 | | |
432 | 438 | | |
433 | 439 | | |
434 | | - | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
435 | 446 | | |
436 | 447 | | |
437 | 448 | | |
| |||
0 commit comments