fix: resolve NV sentinel collision for direct mock_file_check#97
Draft
Koan-Bot wants to merge 1 commit intocpan-authors:mainfrom
Draft
fix: resolve NV sentinel collision for direct mock_file_check#97Koan-Bot wants to merge 1 commit intocpan-authors:mainfrom
Koan-Bot wants to merge 1 commit intocpan-authors:mainfrom
Conversation
…allbacks FALLBACK_TO_REAL_OP (-1) collides with the legitimate NV value -1.0 (file modified exactly 1 day in the future). PR cpan-authors#87 fixed the mock_all_from_stat path via scalar ref wrapping, but direct mock_file_check callbacks still had the collision. Fix: make FALLBACK_TO_REAL_OP a dualvar (numeric -1, string "__OFC_FALLBACK__"). The Perl-layer _check() now uses string comparison for NV ops, distinguishing real -1.0 from the sentinel. Numeric comparisons (== -1) remain backward compatible. Closes cpan-authors#88 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
Complete fix for the -M/-C/-A sentinel collision where returning -1.0 from a direct
mock_file_checkcallback was indistinguishable fromFALLBACK_TO_REAL_OP.Why
PR #87 fixed the
mock_all_from_statpath via scalar ref wrapping, but the directmock_file_checkpath still had the collision. A callback returning -1.0 (file 1 day in the future) was silently treated as fallback. Closes #88.How
Make
FALLBACK_TO_REAL_OPa dualvar: numeric -1 (backward compat for== -1checks), string__OFC_FALLBACK__(unique sentinel). The Perl-layer_check()now uses string comparison for NV ops, cleanly distinguishing real -1.0 from the sentinel.Testing
nv-sentinel-collision.tcovering direct callbacks for -M/-A/-C returning exactly -1.0🤖 Generated with Claude Code
Quality Report
Changes: 4 files changed, 86 insertions(+), 4 deletions(-)
Code scan: clean
Tests: passed (0 Tests)
Branch hygiene: clean
Generated by Kōan post-mission quality pipeline