Fix qualification session device reassociation - #6
Conversation
There was a problem hiding this comment.
2 issues found across 14 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/emuchef-app/src-tauri/src/handles.rs">
<violation number="1" location="apps/emuchef-app/src-tauri/src/handles.rs:73">
P2: Each qualification attempt leaves its session handle in this process-local map after discard or finalization. Add per-session removal when the candidate lifecycle ends, or bound this map like the other session stores.</violation>
</file>
<file name="apps/emuchef-app/src-tauri/src/qualification_mode.rs">
<violation number="1" location="apps/emuchef-app/src-tauri/src/qualification_mode.rs:1487">
P2: After a runtime-authority reset clears the process-local association, this lookup rejects an otherwise resumable session before it can re-establish its live device binding. Reassociate after authority reset, or make the binding flow trigger the full target validation when the association is absent.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| device_generation: u64, | ||
| session_epoch_by_handle: HashMap<String, u64>, | ||
| qualification_context_by_handle: HashMap<String, QualificationContextKey>, | ||
| qualification_device_by_session: HashMap<String, String>, |
There was a problem hiding this comment.
P2: Each qualification attempt leaves its session handle in this process-local map after discard or finalization. Add per-session removal when the candidate lifecycle ends, or bound this map like the other session stores.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/emuchef-app/src-tauri/src/handles.rs, line 73:
<comment>Each qualification attempt leaves its session handle in this process-local map after discard or finalization. Add per-session removal when the candidate lifecycle ends, or bound this map like the other session stores.</comment>
<file context>
@@ -70,6 +70,7 @@ pub struct SessionHandles {
device_generation: u64,
session_epoch_by_handle: HashMap<String, u64>,
qualification_context_by_handle: HashMap<String, QualificationContextKey>,
+ qualification_device_by_session: HashMap<String, String>,
last_inventory_count: Option<usize>,
}
</file context>
| .map_err(|_| safe_qualification_error("qualification_review_mismatch"))?; | ||
| let associated_device_handle = handles | ||
| .qualification_session_device_handle(&session_handle) | ||
| .ok_or_else(|| safe_qualification_error("qualification_review_mismatch"))? |
There was a problem hiding this comment.
P2: After a runtime-authority reset clears the process-local association, this lookup rejects an otherwise resumable session before it can re-establish its live device binding. Reassociate after authority reset, or make the binding flow trigger the full target validation when the association is absent.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/emuchef-app/src-tauri/src/qualification_mode.rs, line 1487:
<comment>After a runtime-authority reset clears the process-local association, this lookup rejects an otherwise resumable session before it can re-establish its live device binding. Reassociate after authority reset, or make the binding flow trigger the full target validation when the association is absent.</comment>
<file context>
@@ -1414,14 +1477,22 @@ pub fn bind_qualification_review(
+ .map_err(|_| safe_qualification_error("qualification_review_mismatch"))?;
+ let associated_device_handle = handles
+ .qualification_session_device_handle(&session_handle)
+ .ok_or_else(|| safe_qualification_error("qualification_review_mismatch"))?
+ .to_string();
+ let review = handles
</file context>
There was a problem hiding this comment.
All reported issues were addressed across 7 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Summary
Validation
make testreaches an unrelated existing synthetic qualification cleanup race (ENOTEMPTYintampered existing evidence bundle report blocks both promotions before canonical mutation); that test passes in isolationNo physical qualification, evidence, matrix, target, recipe, or profile state was changed.
Summary by cubic
Fixes restored qualification sessions so they can reassociate with the current process's live device instead of failing against the stale persisted device handle.
Bug Fixes
SessionHandlesowns the current-process session-to-device association.New Features
ayaneo.pocket_air_miniprofile (non_root), marked unqualified in the matrix.Denied) now register asnon_root; only failed root checks block target capture.Written for commit e4a6033. Summary will update on new commits.