Repository navigation
feat(guardian): verify callbacks and bound retention - #7
Conversation
Co-authored-by: gagan114662 <[email protected]> Signed-off-by: gagan114662 <[email protected]>
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
There was a problem hiding this comment.
📋 Review Summary
I reviewed the Guardian lifecycle change that adds callback-proven health, cursor generations, continuous findings retention, and E2E coverage. The main concerns are in the backend retention/health logic: compaction can drop findings written concurrently by callbacks, and historical findings can overwrite a current broken health state as active.
🔍 Findings
🟠 High 1 · 🟡 Medium 1
| .and_then(|()| target.sync_all()) | ||
| .map_err(|error| format!("failed to persist retained Guardian storage: {error}"))?; | ||
| set_private_permissions(&temporary, 0o600)?; | ||
| std::fs::rename(&temporary, path) |
There was a problem hiding this comment.
🟠 High
This replacement races with the callback writer: any Numbat hook that appends after read_to_end (or holds an append fd to the old inode while this rename happens) writes records that are not present in retained, and the rename then makes those security findings unreachable. Continuous compaction needs coordination with writers or a strategy that does not replace the actively appended file after taking a snapshot.
| if !batch.findings.is_empty() && batch.health.state != "active" { | ||
| batch.health = active_health(); | ||
| write_health(&app, &agent_pubkey, &batch.health); |
There was a problem hiding this comment.
🟡 Medium
This upgrades every non-active health state based on any retained historical finding. If Numbat is later uninstalled (unsupported/disconnected) or retention fails and the worker writes stale, the next read that returns an old finding overwrites that current failure with active, falsely reporting Guardian monitoring as healthy.
Co-authored-by: gagan114662 <[email protected]> Signed-off-by: gagan114662 <[email protected]>
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
Summary
Verification at exact head
1f8b7a49f0e6dada6ff6be846ade97d2705a03acpnpm check: passedThe first Tauri and Playwright attempts were sandbox-blocked on localhost binds; the unchanged tree passed both with local-network permission.
Originating Buzz channel: 2db0f46d-71e4-46c2-9798-3b248dac5fff