[P0] Registry destruction does not reclaim loader state despite merged #133 #156
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nsaspy/prolog-rlm#156
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Regression
The restored aggregate PlUnit gate from #151/#152 executes the previously skipped
rlm_tool_loadertests and proves the merged #133/#67 cleanup claim is false on the repository CI runtime.Observed failures include:
destroy_reclaims_loader_idempotency_state_automatically:loaded_tool_pack/4rows remain aftertool_registry_destroy/1;destroy_cleanup_is_scoped_to_the_destroyed_registry: destroyed-registry rows remain;repeated_registry_churn_does_not_retain_loader_state: 64 retained rows instead of 0.Current implementation
rlm_tool_loaderrelies on:and attempts to infer completed
retractall/1lifecycle events. The real SWI 9.0.4 CI execution does not satisfy the assumed callback contract here, so registry-owned loader state leaks.Required fix
Replace the fragile listener trick with an explicit generic registry-destroy hook owned by
rlm_tool, while preserving dependency direction:Core must not import the loader. Hook failure must not leave the core registry alive, and cleanup must remain idempotent.
Acceptance
tool_registry_destroy/1automatically removes allloaded_tool_pack/4rows for that registry;rlm_tool -> rlm_tool_loaderimport/circular business dependency;test/run_tests.plis the merge oracle;Discovered during post-false-green remediation after #60.
Completed on current main through the explicit generic registry-destroy hook integrated in #177. Focused lifecycle/security verification passed 24/24 and source inspection confirms dependency direction remains rlm_tool_loader -> rlm_tool only. PR #157 was closed as superseded.