Skip to content

feat(util): RFD R2+R4+R5 — surface precision marker + soundness check + live unsound detection - #463

Merged
Disentinel merged 1 commit into
mainfrom
feat/precision-marker-consumers
Jun 17, 2026
Merged

feat(util): RFD R2+R4+R5 — surface precision marker + soundness check + live unsound detection#463
Disentinel merged 1 commit into
mainfrom
feat/precision-marker-consumers

Conversation

@Disentinel

Copy link
Copy Markdown
Owner

Stacked on R1 (#462). Consumes the precision marker. TS-only (util + mcp); no rust/.dl/SCIP/guarantees.yaml.

  • R5traceEffects surfaces suspected_unsound[] + per-leaf precision: a member call whose receiver IS a non-relative import but resolved to a PURE ecma-GLOBAL::method (the axios.get→GLOBAL::get defect) is explicitly marked unsound (complementary to PART A fix(util): propagate effects-db effects through member calls on default-imported modules (SEP PART A) #460's effect-recovery).
  • R2 — precision class + candidateCount thread additively into find_calls (CallInfo.precision), the traceEffects result, and the MCP describe/trace-effects surfaces.
  • R4soundnessOf (precise | sound-superset | unsound) + checkResolutionSoundness(backend) hard-flags unsound resolutions as violations, even though they pass the ≤1-target is-a-function guarantee.

Verify (live /tmp/sep-test)

checkResolutionSoundness: hasUnsound=true  bySoundness={sound:1, sound-superset:3, unsound:1}
  violation: axios.get → GLOBAL::get  receiverModule=axios  basis=imported-default-method-to-ecma-global  verdict=unsound
traceEffects(fetchUser).suspected_unsound: [{ call_name:"axios.get", resolved_to:"GLOBAL::get", receiver_module:"axios" }]

Tests: ResolutionPrecisionConsumers (7) + R1 + trace-effects = 28/0; findCallsInFunction 26/0; ContextCommand 10/0.

Merge order (3-PR stack touching traceEffects.ts)

Merge #462 (R1) + #460 (PART A effect-recovery) to main first, then rebase this branch onto main (reconcile the processTarget receiver path — PART A recovers effects, R5 adds the unsound mark; complementary). After both land, a consumer sees BOTH the recovered IO:HTTP:REQUEST and the suspected-unsound flag.

🤖 Generated with Claude Code

…undness check, R5 unsound detection

Stacks on the R1 precision-marker primitive (resolutionPrecision.ts).

R5 — live suspected-unsound detection in traceEffects: when a member call's
receiver is a real non-relative import but the call resolved to a PURE/empty
ecma-GLOBAL via runtime-globals (the axios.get→GLOBAL::get suffix-collapse
defect), traceEffects now surfaces it. Adds TraceEffectsResult.suspected_unsound
(per-call UnsoundResolutionLeaf) and a per-leaf precision marker, reusing
classifyResolution + the R1 receiver walk. Complementary to PART A (which
recovers the EFFECTS via effects-db); R5 is the explicit PRECISION mark on top.

R2 — surface the marker in consumers (additive, optional fields only):
  - CallInfo.precision (findCallsInFunction / find_calls): classifies each
    resolved call WITHOUT the receiver walk → precise / heuristic-superset from
    fan-out + resolvedVia, never suspected-unsound (reserved for the full-walk
    paths).
  - LeafSource.precision + suspected_unsound on the traceEffects result shape.
  - MCP describe/get_function_details annotates non-precise resolutions; the
    trace-effects MCP handler renders per-leaf precision + a suspected-unsound
    block.

R4 — soundness taxonomy + util-layer invariant check: soundnessOf maps the
three precision classes onto {sound, sound-superset, unsound}, and
checkResolutionSoundness(backend) hard-flags every unsound resolution as a
violation — caught even though it passes the ≤1-target "is-a-function"
guarantee. A plain function, NOT a guarantees.yaml rule.

Tests: test/unit/ResolutionPrecisionConsumers.test.js (R2/R4/R5 against
FixtureStorageView backends mirroring the live sep-test graph). R1 marker test,
trace-effects, traceEffectsTaxonomy, and findCallsInFunction suites stay green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Disentinel
Disentinel force-pushed the feat/precision-marker-consumers branch from c6bc966 to 9dd6d2a Compare June 17, 2026 17:20
@Disentinel
Disentinel changed the base branch from spike/resolution-precision-marker to main June 17, 2026 17:21
@Disentinel Disentinel closed this Jun 17, 2026
@Disentinel Disentinel reopened this Jun 17, 2026
@Disentinel
Disentinel merged commit a8e4319 into main Jun 17, 2026
4 checks passed
@Disentinel
Disentinel deleted the feat/precision-marker-consumers branch June 17, 2026 18:08
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.

1 participant