fix(heal): harden healNatives against stale locations and opaque failures - #17
Merged
Merged
Conversation
…ures - Re-check each agentdb location with fs.existsSync immediately before installing: an upgrade earlier in the same sync can remove a location (agentic-flow/node_modules/agentdb vanished in the ruflo 3.29.0 tree), which previously surfaced as a spurious FAILED against a phantom path. - Include the tail of npm's stderr (capped, with exit-code fallback) in FAILED details for both agentdb locations and agentic-qe, so a real native-install failure is diagnosable from the sync output alone.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two hardening changes to
healNatives()insrc/lib/heal.mjs, prompted by a liveak syncincident during the ruflo 3.28.0 → 3.29.0 upgrade:Stale-location guard — each agentdb location is re-checked with
fs.existsSyncimmediately before installing. The upgrade step earlier in the same sync can remove a location between enumeration and heal (agentic-flow/node_modules/agentdbno longer exists in the 3.29.0 tree), which previously produced a spurious stickyFAILED … (data-loss writes)against a phantom path.Diagnosable failures —
FAILEDdetails now include the last two lines of npm's stderr (capped at 200 chars, exit-code fallback), for both agentdb locations and the agentic-qe root. The bareFAILEDmade the original incident undiagnosable from sync output alone.Verification
node --check+ module import passnode tests/statusline-segments.test.cjs— 20/20 passhealNatives()run on the healed machine returns{"ok":true,"detail":"already native everywhere"}(idempotence preserved)🤖 Generated with Claude Code