SPEC-018 review fixes: agent_id persistence, managed fallback, HKEY typing #9
Reference in New Issue
Block a user
Delete Branch "fix/spec018-review-bugs"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Addresses the SPEC-018 Phase 1 code review (
reports/2026-06-03-spec018-review.md).Fixes
agent/src/config.rs) — agent_id persistence. The embedded-config path always wins inConfig::load, so the savedagent_idwas never read back, minting a new UUID on every restart (agent_id churn). AddedConfig::persisted_agent_id()to reuse a prior id from the on-disk TOML; only mint a new UUID when none exists.agent/src/main.rs) — managed fallback. Removed the non-functional in-process fallback inrun_permanent_agent_managed. A managed agent'scak_store is SYSTEM-only ACL'd, so a non-elevated in-process run cannot authenticate (load_cakpermission-denied, or enroll C1 read-back failure). Now returns an actionable "install elevated" error instead of pretending to provide an agent; misleading comments updated.agent/src/startup.rs) — HKEY typing. Replaced the fragiletransmute::<HANDLE, HKEY>with thewindowscrate's typedHKEYout-param; added SAFETY comments.Reviewed;
cargo check -p guruconnect --target x86_64-pc-windows-msvcclean. Related to #8 (deferred lower-severity items tracked there).