Skip to content

Claude/calm product truth contract 2sxory - #55

Merged
Eilodon merged 2 commits into
mainfrom
claude/calm-product-truth-contract-2sxory
Aug 4, 2026
Merged

Claude/calm product truth contract 2sxory#55
Eilodon merged 2 commits into
mainfrom
claude/calm-product-truth-contract-2sxory

Conversation

@Eilodon

@Eilodon Eilodon commented Aug 4, 2026

Copy link
Copy Markdown
Owner

No description provided.

claude added 2 commits August 4, 2026 03:56
…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.
@Eilodon
Eilodon merged commit b96342b into main Aug 4, 2026
10 checks passed
@Eilodon
Eilodon deleted the claude/calm-product-truth-contract-2sxory branch August 4, 2026 04:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants