Commit f3cb478
committed
fix: close 4 findings from Oracle audit wave 6 (key-files + resilience)
Two read-only Oracles (resilience spine: overflow/fallback/retry; key-files
subsystem). NO P0s — the periphery is converging. Cores verified safe (no builtin
fallback fan-out, retryable-only iteration, OpenCode+Pi subagent termination
parity, storage/versioning/validator/atomic-commit, XML escaping, AFT detection).
4 source-confirmed fixes; design/cache-adjacent items banked (D19-D21).
- Key-files child session deleted before validation (identify-key-files.ts).
Completes the wave-3 retention-on-failure fix, which Oracle Q found incomplete:
runKeyFilesLlm set succeeded=true on text-extraction and deleted the child
session — BEFORE validateLlmOutput runs. An LLM that returned text but failed
validation (bad JSON / doc / out-of-candidate path) lost its session, defeating
debugging. Moved cleanup ownership to runKeyFilesTask: delete only after
validation + commit succeed (taskCompleted), retain on any failure.
- Stale pinned key-file persists forever (identify-key-files.ts). The no_change
short-circuit only checked every candidate is pinned, NOT that every pinned row
is still a valid candidate — so a file that dropped out of the candidate set
(renamed / below min_reads / doc-lockfile under an older policy) kept being
injected. Added the reverse-membership clause so a stale row falls through to
the LLM re-run, which validates against the candidate allow-set and drops it.
- abortChildRun could hang and mask the original error (model-suggestion-retry.ts).
The best-effort child-session abort awaited client.session.abort() unbounded; a
wedged abort endpoint would hang the caller and hide the timeout/abort error we
need to surface. Race it against a 3s timer (the abort still proceeds
server-side).
- Documented the overflow-detection plausible-limit floor (overflow-detection.ts):
evaluated raising it to the [20k,3M] trusted-limit band but kept 1024 — overflow
detection honors a provider EXPLICITLY stating its limit, and real 4096/8192
local models exist (a test asserts 4096 is accepted); the band would discard a
legitimate small-model signal. Comment-only.
Banked: detected-limit not model-keyed + missing Anthropic ">N maximum" extractor
(P-1/design), validation-aware fallback for dreamer/sidekick empty-output (P-2,
touches fallback design), transform-wrapper snapshot-restore (P-6 — its fix is the
full-array clone-per-pass the user rejects; needs a targeted-catch design),
persistent-storage fail-open-vs-closed (P), key-files injection-cache project key
+ Pi project-switch m1 replay (Q — cache-adjacent). See oracle-loop-findings.md.
Gate: plugin 2176/0, Pi tsc clean, tsc+biome clean.1 parent ad54f36 commit f3cb478
3 files changed
Lines changed: 85 additions & 48 deletions
File tree
- packages/plugin/src
- features/magic-context
- key-files
Lines changed: 67 additions & 46 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
464 | 464 | | |
465 | 465 | | |
466 | 466 | | |
467 | | - | |
| 467 | + | |
468 | 468 | | |
469 | 469 | | |
470 | 470 | | |
| |||
477 | 477 | | |
478 | 478 | | |
479 | 479 | | |
480 | | - | |
481 | | - | |
482 | | - | |
483 | | - | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | | - | |
489 | | - | |
490 | | - | |
491 | | - | |
492 | | - | |
493 | | - | |
494 | | - | |
495 | | - | |
496 | | - | |
497 | | - | |
498 | | - | |
499 | | - | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
500 | 489 | | |
501 | | - | |
502 | | - | |
503 | | - | |
504 | | - | |
505 | | - | |
506 | | - | |
507 | | - | |
508 | | - | |
509 | | - | |
510 | | - | |
511 | | - | |
512 | | - | |
513 | | - | |
514 | | - | |
515 | | - | |
516 | | - | |
517 | | - | |
518 | | - | |
519 | | - | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
520 | 513 | | |
521 | 514 | | |
522 | 515 | | |
| |||
557 | 550 | | |
558 | 551 | | |
559 | 552 | | |
560 | | - | |
561 | | - | |
562 | | - | |
563 | | - | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
564 | 565 | | |
565 | 566 | | |
566 | 567 | | |
| |||
585 | 586 | | |
586 | 587 | | |
587 | 588 | | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
588 | 594 | | |
589 | 595 | | |
590 | 596 | | |
| |||
607 | 613 | | |
608 | 614 | | |
609 | 615 | | |
610 | | - | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
611 | 621 | | |
612 | 622 | | |
613 | 623 | | |
614 | 624 | | |
615 | 625 | | |
616 | 626 | | |
617 | 627 | | |
| 628 | + | |
618 | 629 | | |
619 | 630 | | |
620 | 631 | | |
| |||
629 | 640 | | |
630 | 641 | | |
631 | 642 | | |
632 | | - | |
| 643 | + | |
| 644 | + | |
633 | 645 | | |
| 646 | + | |
634 | 647 | | |
635 | 648 | | |
636 | 649 | | |
| |||
640 | 653 | | |
641 | 654 | | |
642 | 655 | | |
| 656 | + | |
643 | 657 | | |
644 | 658 | | |
645 | 659 | | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
646 | 667 | | |
647 | 668 | | |
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
73 | 76 | | |
74 | 77 | | |
75 | 78 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
9 | 14 | | |
10 | 15 | | |
11 | 16 | | |
| |||
171 | 176 | | |
172 | 177 | | |
173 | 178 | | |
174 | | - | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
175 | 188 | | |
176 | 189 | | |
177 | 190 | | |
| |||
0 commit comments