Claude/calm product truth contract 2sxory - #55
Merged
Conversation
…lity nightly caller_set_digest is the pure function WS-2 Phase 2's TOCTOU guard hashes caller sets with, but had zero direct tests (only exercised end-to-end via 2 gate-behavior integration tests on one fixed caller list). Add 3 focused tests locking in its documented order/dedup-independence guarantee and its sensitivity to a real set change. Also close a real gap found while auditing this repo's own benchmark suite: none of B2/B3/B4/B6/B7's correctness numbers were wired into any CI gate (thresholds.toml only covers architectural fitness metrics). B2 (self-repo Rust call-graph precision/recall vs a rust-analyzer SCIP oracle) is the one benchmark cheap enough to run nightly -- self-contained, pure-stdlib Python, no external corpus clone. Adds a b2-call-graph-quality job to the existing scip-nightly workflow (reusing its rust-analyzer install) plus scripts/check-b2-thresholds.sh, which fails the job if precision/recall/per-tier precision drop below floors set with headroom under the last real measurement. B7 (task-correctness) stays manual-only -- it clones and builds 6 external repos per run, too expensive to gate on a schedule without further infrastructure investment.
… import binding
Real, reproducible gap found by benchmarks/b7_task_correctness (express):
`utils.setCharset(...)` after `var utils = require('../lib/utils')` was
completely invisible to callers()/blast_radius, while the destructured
sibling call `setCharset(...)` (bare identifier) resolved fine. Root
cause: extract_file_data's tier-1 (ConservativeResolver::resolve_tier1)
only checks ctx.import_map keyed by the CALLEE name, and tier-2
(resolve_tier2) only checks ctx.type_map (a real type annotation) or
self/this -- neither ever asks whether the RECEIVER itself is a name this
file imported as a whole module (CommonJS require(), Python bare
`import os`, etc).
Adds a new fallback branch in extract_file_data: when a receiver-qualified
call is still Textual after tier-1/tier-2/the C# tier-2 fallback, check if
the receiver is a key in ctx.import_map: if so, derive a module_hint from
the imported module path's last segment (module_path_last_segment, next
to the existing module_hint_of) and let resolve_sites_to_edges's existing
file-stem filter narrow the already name-matched candidate list -- the
exact same mechanism Rust's `crate::module::function()` already uses.
Purely additive and fail-open: only fires when nothing else resolved the
call, only narrows an existing candidate set (never fabricates one), and
falls through to today's behavior unchanged when the hint matches
nothing.
New regression test constructs a real fixture with a same-named decoy in
a different file (different basename) to prove this actually improves
precision (Ambiguous 2-candidate -> exactly 1 correct edge), not just
that it compiles. Verified by temporarily disabling the new branch and
confirming the test fails without it. Full calm-core suite (957 tests)
green, clippy -D warnings clean.
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.
No description provided.