Commit 1bbbce7
committed
fix: close dashboard-backend findings from Oracle audit wave 5 (1 P0 + 5 P1/P2)
Three parallel read-only Oracles (Pi context-handler internals; dashboard Rust
backend; m[0]/m[1] cache-core). HEADLINE: the cache-core is verified SOUND — no
P0 history-loss or cache-hit replay leak (DEFER replay byte-stable, supersede-
delta + CAS correct, atomic paired persistence). The cache-core + Pi findings are
cache/migration-critical → banked for review (cache-stability-path rule). The
dashboard-Rust batch is fixed here.
P0:
- Project-identity fallback cache divergence (project_identity.rs). Rust cached a
dir:<md5> fallback for a non-git dir FOREVER in-process; after the dir gets
.git + first commit, TS re-resolves to git:<root> but Rust kept serving the
stale dir: — so dashboard filters/writes could target the WRONG project's
memories. Fixed: serve cached git: directly, but drop a cached dir: fallback the
moment has_git_dir() is true and re-resolve (mirrors TS resolveProjectIdentity).
Also: classify the pre-spawn dir check via fs::metadata so NotFound stays
deterministic (cacheable) but PermissionDenied/other are transient (uncached).
+regression test (no-git → git init+commit flips dir:→git: without cache clear).
P1:
- update_memory_status accepted arbitrary status strings (db.rs) — a malformed
"archive" (vs "archived") would make a memory vanish from active/permanent/
archived logic. Now reject anything outside the canonical set with a friendly
error before touching the DB.
- Dream-queue dedup not atomic (db.rs — a regression in my own wave-3 enqueue
dedup). dream_queue has no UNIQUE on project_path, so a DEFERRED check-then-
insert let two concurrent "dream now" clicks both insert. enqueue_dream +
delete_dream_queue_entry now take &mut Connection and run under BEGIN IMMEDIATE.
- Session-detail used p.worktree instead of s.directory (db.rs
get_opencode_session_detail) — global-bucketed git sessions (worktree "/")
mis-resolved identity and showed "/". Now derive identity/display/path from
s.directory (worktree fallback), matching list_opencode_sessions.
P2:
- open_readwrite could CREATE an empty DB if the file vanished (db.rs) — violates
the "dashboard never owns schema" boundary. Now open_with_flags(READ_WRITE |
NO_MUTEX) without CREATE.
Banked (need review): cache-core taxonomy refinements (O: /ctx-flush SOFT
violation, Pi eager-clear, hard-fold expiry determinism), Pi v25 tool-owner
cutover P0 (M), dashboard workspace share-category viewer filter (N-P1, product
semantics). See .alfonso/oracle-loop-findings.md.
Gate: dashboard rust 93+21+11+20/0, cargo check + fmt clean.1 parent 9de0699 commit 1bbbce7
4 files changed
Lines changed: 207 additions & 28 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
465 | 465 | | |
466 | 466 | | |
467 | 467 | | |
468 | | - | |
469 | | - | |
| 468 | + | |
| 469 | + | |
470 | 470 | | |
471 | 471 | | |
472 | 472 | | |
473 | 473 | | |
474 | 474 | | |
475 | | - | |
476 | | - | |
| 475 | + | |
| 476 | + | |
477 | 477 | | |
478 | 478 | | |
479 | 479 | | |
| |||
683 | 683 | | |
684 | 684 | | |
685 | 685 | | |
686 | | - | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
687 | 690 | | |
688 | 691 | | |
689 | 692 | | |
| |||
777 | 780 | | |
778 | 781 | | |
779 | 782 | | |
780 | | - | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
781 | 787 | | |
782 | 788 | | |
783 | 789 | | |
| |||
825 | 831 | | |
826 | 832 | | |
827 | 833 | | |
828 | | - | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
829 | 838 | | |
830 | 839 | | |
831 | 840 | | |
| |||
1128 | 1137 | | |
1129 | 1138 | | |
1130 | 1139 | | |
1131 | | - | |
1132 | | - | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
1133 | 1148 | | |
1134 | 1149 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
124 | 131 | | |
125 | 132 | | |
126 | 133 | | |
| |||
2728 | 2735 | | |
2729 | 2736 | | |
2730 | 2737 | | |
| 2738 | + | |
| 2739 | + | |
| 2740 | + | |
| 2741 | + | |
| 2742 | + | |
| 2743 | + | |
| 2744 | + | |
| 2745 | + | |
| 2746 | + | |
| 2747 | + | |
| 2748 | + | |
| 2749 | + | |
2731 | 2750 | | |
2732 | 2751 | | |
2733 | 2752 | | |
| |||
2893 | 2912 | | |
2894 | 2913 | | |
2895 | 2914 | | |
2896 | | - | |
| 2915 | + | |
| 2916 | + | |
| 2917 | + | |
| 2918 | + | |
| 2919 | + | |
| 2920 | + | |
2897 | 2921 | | |
2898 | 2922 | | |
2899 | 2923 | | |
| |||
3198 | 3222 | | |
3199 | 3223 | | |
3200 | 3224 | | |
3201 | | - | |
| 3225 | + | |
| 3226 | + | |
| 3227 | + | |
| 3228 | + | |
| 3229 | + | |
3202 | 3230 | | |
3203 | 3231 | | |
3204 | 3232 | | |
| |||
3459 | 3487 | | |
3460 | 3488 | | |
3461 | 3489 | | |
| 3490 | + | |
3462 | 3491 | | |
3463 | 3492 | | |
3464 | 3493 | | |
| |||
3469 | 3498 | | |
3470 | 3499 | | |
3471 | 3500 | | |
| 3501 | + | |
3472 | 3502 | | |
3473 | 3503 | | |
3474 | 3504 | | |
3475 | | - | |
| 3505 | + | |
3476 | 3506 | | |
3477 | 3507 | | |
| 3508 | + | |
| 3509 | + | |
| 3510 | + | |
| 3511 | + | |
| 3512 | + | |
| 3513 | + | |
| 3514 | + | |
| 3515 | + | |
| 3516 | + | |
3478 | 3517 | | |
3479 | 3518 | | |
3480 | 3519 | | |
| |||
3522 | 3561 | | |
3523 | 3562 | | |
3524 | 3563 | | |
3525 | | - | |
| 3564 | + | |
3526 | 3565 | | |
3527 | | - | |
| 3566 | + | |
3528 | 3567 | | |
3529 | 3568 | | |
3530 | 3569 | | |
3531 | | - | |
| 3570 | + | |
3532 | 3571 | | |
3533 | 3572 | | |
3534 | 3573 | | |
| |||
4377 | 4416 | | |
4378 | 4417 | | |
4379 | 4418 | | |
4380 | | - | |
| 4419 | + | |
4381 | 4420 | | |
4382 | 4421 | | |
4383 | 4422 | | |
| |||
4386 | 4425 | | |
4387 | 4426 | | |
4388 | 4427 | | |
| 4428 | + | |
| 4429 | + | |
| 4430 | + | |
| 4431 | + | |
4389 | 4432 | | |
4390 | | - | |
| 4433 | + | |
| 4434 | + | |
4391 | 4435 | | |
4392 | 4436 | | |
4393 | 4437 | | |
4394 | 4438 | | |
4395 | 4439 | | |
4396 | 4440 | | |
4397 | 4441 | | |
| 4442 | + | |
4398 | 4443 | | |
4399 | 4444 | | |
4400 | 4445 | | |
4401 | | - | |
| 4446 | + | |
4402 | 4447 | | |
4403 | 4448 | | |
4404 | 4449 | | |
4405 | | - | |
| 4450 | + | |
| 4451 | + | |
| 4452 | + | |
4406 | 4453 | | |
4407 | 4454 | | |
4408 | 4455 | | |
4409 | 4456 | | |
4410 | 4457 | | |
4411 | 4458 | | |
4412 | 4459 | | |
4413 | | - | |
4414 | | - | |
| 4460 | + | |
| 4461 | + | |
| 4462 | + | |
4415 | 4463 | | |
4416 | 4464 | | |
4417 | | - | |
| 4465 | + | |
| 4466 | + | |
| 4467 | + | |
4418 | 4468 | | |
4419 | 4469 | | |
4420 | 4470 | | |
| |||
6052 | 6102 | | |
6053 | 6103 | | |
6054 | 6104 | | |
6055 | | - | |
| 6105 | + | |
| 6106 | + | |
| 6107 | + | |
| 6108 | + | |
6056 | 6109 | | |
6057 | 6110 | | |
6058 | 6111 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
19 | 26 | | |
20 | 27 | | |
21 | 28 | | |
| |||
98 | 105 | | |
99 | 106 | | |
100 | 107 | | |
101 | | - | |
102 | | - | |
103 | | - | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
104 | 122 | | |
105 | 123 | | |
106 | 124 | | |
| |||
168 | 186 | | |
169 | 187 | | |
170 | 188 | | |
171 | | - | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
172 | 207 | | |
173 | 208 | | |
174 | 209 | | |
| |||
0 commit comments