Skip to content

fix(ts): withhold member-initializer credit for bare-call owners - #8497

Merged
EffortlessSteven merged 3 commits into
mainfrom
cursor/ts-bare-call-alias-member-342d
Oct 17, 2026
Merged

EffortlessSteven merged 3 commits into
mainfrom
cursor/ts-bare-call-alias-member-342d

Conversation

@EffortlessSteven

@EffortlessSteven EffortlessSteven commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

Summary

TypeScript's one-hop alias observation path credited const r = helper.price(150) as an observation of a bare-call owner export function price, because ts_observed_local_aliases_owner used ts_references_identifier, which counts member segments. A smoke price(150) plus an assertion of r could therefore read exposed.

The alias initializer now uses the same rule as the #7507 value guard: for a bare-call owner, only a bare occurrence or an unshadowed owner-module namespace call (ns.price() confirms. Method owners (obj.price, Cart.price) keep today's member-segment credit.

Verified on current main (91fce7efa) before the repair: five member-initializer cases read exposed; the four preservation controls already passed. After the repair, 11 tests pass, including optional/non-null/whitespace members, alias-rename, shadowed namespace, nested receiver, and method-owner controls.

Closes #7813

Swarm / Source Boundary

This PR targets EffortlessMetrics/ripr-swarm, the normal development trunk for trusted same-repo ripr work. Confirm the change belongs here:

  • ordinary feature, analyzer, editor, docs, spec, fixture, badge, dependency, or repo-ops development for ripr-swarm
  • repair or follow-up for a same-repo swarm PR
  • swarm-only CI, runner, routing, source-of-truth, or agent-operating surface
  • other swarm-scoped work:

Source-of-truth Links

Proposal: n/a (follow-up from bot-review triage on #7651 / #7507)
Spec: RIPR-SPEC-0243 observation guard / rule 6, aligned with the #7507 bare-call exception already in the value guard
ADR: n/a
Plan item: n/a
Governing issue or accepted claim: #7813
Acceptance delta: asserting a local initialized from helper.price(...) must not expose a bare-call owner price; method owners keep member-segment alias credit.

Candidate Relationships

Candidate branch (GitHub PR head is authoritative after publication): cursor/ts-bare-call-alias-member-342d
Stack parent or prerequisite PR (if any): none for the TypeScript claim. Combined-tree compile depended on independent #8500; that PR landed as aed1fd122 and is merged into this head. Duplicate #8502 is not folded in.
Proposed replacement of PR (if any; not yet accepted): none
Acceptance retained from a replaced candidate (if any): n/a
Accepted winner and losing candidate disposition (when decided): n/a

No equivalent open PR found for #7813 (ts_observed_local_aliases_owner / alias-via-member).

Scope

One TypeScript observation-guard rule: restrict member-segment matches on the one-hop alias initializer when the owner is a bare-call owner.

Scope Classification

This PR is scoped by:

  • One production behavior
  • One public contract
  • One architectural seam
  • Docs/spec/test-only evidence package
  • Other:

Production delta:

Evidence/support delta:

Single acceptance criterion:

  • const r = helper.price(150); expect(r).toBe(140) with a smoke price(150) must not read exposed for export function price; const r = helper.price(150); expect(r).toBe(130) for an instance/static method owner named price must stay exposed.

Non-goals:

Support-tier Impact

  • none
  • updates docs/status/SUPPORT_TIERS.md
  • changes a README, release, docs, CLI, JSON, editor, CI, or package claim

Claim/proof notes:

  • Static classification only. Does not claim runtime mutation kill/survive.

Policy Impact

  • none
  • doc artifacts
  • CI lane
  • package boundary
  • lint / Clippy
  • no-panic
  • file policy
  • generated artifact
  • dependency
  • process/network

Ledger or exception notes:

  • none

Proof

cargo xtask worktree doctor
# pass; branch current with origin/main at branch time (`91fce7efa`)
cargo test -p ripr --lib issue7813
# red on current main for the five member-initializer negatives;
# green after the repair (11 passed, including method-owner and namespace controls)
# re-run on cafec70e9 after merging #8500: 11 passed
cargo test -p ripr --lib issue7507
# 31 passed (no #7507 regression on 7537f5e39)
cargo check -p ripr --lib --tests
# pass on cafec70e9 (inherited E0061 gone after #8500)
cargo xtask precommit
# pass on `1349af197` (production commit); follow-up test-only commit is `7537f5e39`
cargo xtask verdict-corpus check --language typescript
# 169 cases; contradictions 0/169; no existing TypeScript corpus row moved

Result, failures, or skipped proof:

  • Focused tests: 11 passed on 7537f5e39 and again on cafec70e9.
  • Local precommit: pass on the TypeScript claim commits. Goldens skipped: no output-surface or golden file changed vs origin/main.
  • TypeScript verdict-corpus: 169 cases, 0 contradictions.
  • Inherited combined-tree failure: Ready-time Ripr Rust Small / Rust gates failed rustc E0061 in fenced classify/reveal.rs while that 1-arg call still lived on main. Independent fix(reveal): pass the diff-touched argument in two setup-unwrap tests #8500 landed as aed1fd122. This branch merged that main; cargo check -p ripr --lib --tests now passes. This PR still does not author classify/reveal.rs vs main.

Claim Boundary

What may be claimed after this PR? What must not be claimed yet?

  • May claim: the TypeScript value-family alias path no longer treats another receiver's price member as an observation of a bare-call owner price.
  • Must not claim: runtime mutation results, sufficiency of tests, or that every TypeScript over-credit class is closed.
  • Must not claim: SPEC-0243 rule-6 prose was rewritten.

Exact candidate SHA: cafec70e95d31657c227a80c88d79fb25cfb69c9

Rollback

Revert this PR. The previous alias path re-admits member-initializer over-credit for bare-call owners.

Spec-Test-Code Traceability

Static Language Check

  • Static output avoids killed, survived, untested, proven, and adequate.
  • Unknowns include stop reasons where applicable.

CI Economics

n/a — ordinary analyzer behavior PR; no workflow, policy-gate, or lane changes.

Engineering Check

  • No new panic, unwrap, expect, todo, or unimplemented in production code.
  • No new panic, unwrap, expect, todo, or unimplemented in tests.
  • New non-Rust programming files are allowlisted with owner, surface, and reason.
  • New generated, dependency, process-spawn, or network surfaces are allowlisted with owner and reason.
  • Errors are reported with actionable context.
  • Public JSON/schema changes are documented.

Gates

Local focused proof passed on cafec70e9 after merging landed #8500. Ready requests hosted required checks on this head. Merge still waits for published-head REVIEW_READY plus those required checks.

Extension changes: n/a

Continuation record

Owner / governing claim: #7813 / PR #8497
Candidate: PR #8497 / head cafec70e95d31657c227a80c88d79fb25cfb69c9 (7537f5e39 plus merge of origin/main including #8500 aed1fd122; TypeScript claim files unchanged)
Review: source/oracle COMMENT on 7537f5e39 still holds for the TypeScript delta; new COMMENT on cafec70e9 for integration-basis refresh; disposition REVIEW_INCOMPLETE until required hosted checks exist on cafec70e9
Validation: cargo check -p ripr --lib --tests pass on cafec70e9; issue7813 11 pass; GitHub merge ref 789019192 parents [f6e202fe4, cafec70e9] contains #8500
Dependency: #8500 landed; no remaining independent compile blocker
Next: Ready requests required checks on cafec70e9; wait for check-completed or failed; published-head review-pr; squash-merge only after REVIEW_READY and required checks green
Open in Web Open in Cursor 

The one-hop alias path used ts_references_identifier, so
`const r = helper.price(150)` counted as observing `export function
price`. Apply the #7507 bare-reference rule there; method owners keep
member-segment credit.

Closes #7813

Co-authored-by: Steven Zimmerman, CPA <EffortlessSteven@users.noreply.github.com>
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: 9ed7176a-0895-45c2-9aea-579c21e1a656
📥 Commits

Reviewing files that changed from the base of the PR and between be3a284 and 7537f5e.

📒 Files selected for processing: 4
  • changelog.d/7813-ts-alias-member-initializer.md
  • crates/ripr/src/analysis/language/typescript/classifier.rs
  • crates/ripr/src/analysis/language/typescript/mod.rs
  • crates/ripr/src/analysis/language/typescript/tests/issue7813_alias_member_tests.rs

Included review availability: This review used your included allowance. 2 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.

Summary by CodeRabbit

  • Bug Fixes
    • TypeScript exposure detection now distinguishes calls through another object from bare-function calls when evaluating aliases. This prevents member calls from incorrectly marking a bare-function owner as exposed, while preserving detection of genuine bare-function calls, namespace calls, and method references.
  • Tests
    • Added regression coverage for alias initializers, including optional chaining, shadowed imports, and nested receivers.

Walkthrough

The TypeScript value-observation guard and one-hop alias check now share owner-reference matching. Bare-function owners require a bare reference or a resolved namespace call. Method owners continue to match member references. Regression tests cover both behaviors and related initializer forms.

Changes

Alias owner matching

Layer / File(s) Summary
Shared owner matching
crates/ripr/src/analysis/language/typescript/classifier.rs
A shared helper matches method owners by identifier and bare-call owners by bare references or resolved namespace calls. The direct value guard uses the helper.
Alias initializer matching
crates/ripr/src/analysis/language/typescript/classifier.rs
The one-hop alias check passes owner-kind and namespace information to the matching logic. The initializer is checked after literals and comments are masked.
Regression coverage
crates/ripr/src/analysis/language/typescript/tests/issue7813_alias_member_tests.rs, crates/ripr/src/analysis/language/typescript/mod.rs, changelog.d/7813-ts-alias-member-initializer.md
Tests cover member initializers, bare and namespace calls, shadowed namespaces, and method owners. The test module is registered, and a changelog entry describes the matching rules.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix · Severity of issue fixed: Low

Merge Risk: ⚪ Minimal · up to 7537f

No actionable issue was identified with the alias-matching change; it is ready for normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 55.56% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 27 functions across 3 files. (1 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Linked Issues check Passed Issue #7813 requires the TypeScript one-hop alias path to reject helper.price(...) as evidence for a bare-call owner while preserving valid bare calls, owner-module namespace calls, and method-owner…
Out of Scope Changes check Passed The production change is limited to TypeScript observation matching. The added test module, module declaration, and changelog fragment directly support issue #7813. No unrelated product, policy, publi…
Title check Passed The title clearly and concisely describes the main TypeScript behavior change: preventing member-initializer credit for bare-call owners.
Description check Passed The description is complete and aligned with the template. It documents the summary, scope, acceptance criterion, non-goals, proof, traceability, rollback, policy impact, and current validation status…
Full details: Linked Issues check

Explanation

Issue #7813 requires the TypeScript one-hop alias path to reject helper.price(...) as evidence for a bare-call owner while preserving valid bare calls, owner-module namespace calls, and method-owner member calls. The reviewed changes implement shared matching through ts_masked_observes_owner and add focused tests for member, optional, non-null, whitespace, renamed, shadowed, nested, bare-call, namespace, instance-method, and static-method cases. The test evidence reports the focused suite passing.

Full details: Out of Scope Changes check

Explanation

The production change is limited to TypeScript observation matching. The added test module, module declaration, and changelog fragment directly support issue #7813. No unrelated product, policy, public API, or documentation changes are shown in the supplied change summary.

Full details: Description check

Explanation

The description is complete and aligned with the template. It documents the summary, scope, acceptance criterion, non-goals, proof, traceability, rollback, policy impact, and current validation status.

Full details: Docstring Coverage

Explanation

Docstring coverage is 55.56% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 27 functions across 3 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

I’m a rabbit with a test to run,
I check each owner, one by one.
Bare calls pass; stray members wait,
Method owners keep their state.
I nibble greens and hop away!

Comment @coderabbitai help to get the list of available commands.

Reject const r = ns.price(150) when ns is body-shadowed, and
const r = other.ns.price(150), so the namespaced-owner exception on
the alias path cannot credit a different receiver.

Co-authored-by: Steven Zimmerman, CPA <EffortlessSteven@users.noreply.github.com>

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

review-pr (author self-review, COMMENT)

GitHub cannot request changes from the author. This is not approval.

reviewed_head_sha: 7537f5e39b735c3b1785ad2ec1b89c2f4ac28cda
integration_basis: origin/main 91fce7efa at branch time; GitHub PR base is currently be3a2845 (behind-only; no restack)
claim_boundary: TypeScript value-family one-hop alias initializer must not credit a member segment as an observation of a bare-call owner; method owners keep member-segment credit.
changed_surfaces_and_semantic_owners_inspected:
- crates/ripr/src/analysis/language/typescript/classifier.rs (ts_changed_value_is_observed, ts_observed_local_aliases_owner, ts_masked_observes_owner)
- crates/ripr/src/analysis/language/typescript/mod.rs (test module declaration only)
- crates/ripr/src/analysis/language/typescript/tests/issue7813_alias_member_tests.rs
- changelog.d/7813-ts-alias-member-initializer.md
blocking_findings: none from source/oracle inspection
non_blocking_suggestions:
- SPEC-0243 rule 6 still says a member segment counts for the one-hop initializer. The #7507 value guard already diverged for bare-call owners; this PR aligns the alias path with that shipped exception. Spec prose is a separate contract-doc claim and would likely touch fenced traceability.
refuted_or_stale_findings: none yet that require a source-backed reply. gemini-code-assist quota is missing review for that provider, not a clean result. CodeRabbit was still processing this head.
proof_and_ci_observed:
- cargo test -p ripr --lib issue7813: 11 passed (red on main for five member-initializer negatives before the repair)
- cargo test -p ripr --lib issue7507: 31 passed
- cargo xtask precommit: pass on 1349af197; follow-up is test-only
- cargo xtask verdict-corpus check --language typescript: 169 cases, 0 contradictions
proof_or_review_missing:
- hosted required checks, artifacts, and external review on exact head 7537f5e39
affected_currentness_dimensions: production implementation, test stimulus, test oracle, public claim (changelog)
residual_assumptions_and_non_claims:
- changed_tokens still uses ts_references_identifier on the initializer RHS (pre-existing; the issue repro does not hit it)
- no runtime mutation claim; no SPEC-0243 prose rewrite
disposition: REVIEW_INCOMPLETE

Authority / provenance

Observation credit stays in classifier.rs. The alias path now calls the same ts_masked_observes_owner helper as the #7507 value guard, so the two cannot drift by copy-paste. Tests are declared from mod.rs rather than tests.rs to avoid colliding with #8476. Fenced files were not touched.

Stimulus / oracle grip

The issue repro was red on current main (const r = helper.price(150) with a smoke price(150) read exposed) and is green after the repair. Setup asserts owner kind, observed expression r, and a trusted relation before the class. Method-owner controls (OwnerKind::Method / ClassMethod) keep exposed. Namespaced-owner exception is pinned both positively (import * as ns; const r = ns.price(150)) and negatively (body-shadowed ns, nested other.ns.price). Optional / non-null / whitespace members and alias-rename helper.cost are negatives.

A fake that still used ts_references_identifier for bare-call alias initializers would fail the five original negatives. A fake that applied the bare rule to method owners would fail the instance/static controls. A fake that credited every namespace receiver, including a body-local shadow, would fail issue7813_shadowed_namespace_alias_initializer_is_not_exposed.

Rendered / contract / platform

Classification-only. No CLI, schema, golden, or platform branch. Goldens skipped by precommit because no output-surface file changed.

Exact-head CI

Hosted jobs for 7537f5e39 are not yet a current receipt. Gemini daily quota is missing review, not clean review.

Resume after hosted check-completed or failed on this SHA, then re-enter published-head review-pr before Ready / merge.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Decision

  • Needs reviewer attention before upstream: findings remain.

Confirmed findings

  • Optional-chaining (helper?.price() and non-null assertion (helper!.price() negatives assume ts_observed_bare_reference rejects both forms identically. The diff doesn't show the implementation; if those forms leak through a different code path (e.g., ?. is handled by a dedicated optional_chaining rule, not ts_observed_bare_reference), the test could pass for the wrong reason. Submaterial since ts_observed_bare_reference is the documented shared path.
  • PR body states the repair closes 'alias-via member' for bare-call owners but the method-owner preservation tests rely on owner_kind dispatch that lives outside this diff's helper signature; no regression test added for OwnerKind::Constructor or arrow-function owners which also flow through unshadowed_owner_namespace_receivers.

Verification questions

  • Confirm shadowed-namespace negative (issue7813_shadowed_namespace_alias_initializer_is_not_exposed) has a weak trust gate: the test asserts assert_trusted_relation only when the smoke price(150) is unrelated by extract_tests. The local ns = fakeLib() plus a price(150) smoke creates a real bare-call relation to price, so the gate holds via that smoke rather than the ns.price initializer. This means the test would not flag a regression in which extract_tests started emitting no relation for the body — coverage relies on the extractor.
  • Confirm namespace preservation test relies on ts_observed_namespaced_owner_call recognizing 'ns.price('; opposition cannot independently confirm the receiver-set plumbing from this diff alone — needs the focused test receipt.

Parked follow-ups

  • Shared helper centralizes the bare-call rule but owner_is_method dispatch is duplicated at both call sites; a third caller would need to recompute unshadowed_owner_namespace_receivers again — latent drift risk.

@EffortlessSteven

Copy link
Copy Markdown
Member Author

Reply to the github-actions review on 7537f5e39 (no inline threads). Classification: incorrect / non-blocking. Head stays frozen.

Optional / non-null member negatives. These are not a separate optional-chaining rule. Both the value guard and the alias path call ts_masked_observes_owner, which for a non-method owner uses ts_observed_bare_reference. That helper already rejects ?. and !. (and whitespace before the name). The tests go through classify_change, so a leak on a different path would still fail them. Submaterial as the review already notes.

Constructor / arrow-function owners. There is no OwnerKind::Constructor. Constructors are OwnerKind::Method with method_kind: Constructor; they keep member-segment credit via the same Method | ClassMethod arm the instance/static controls already pin. ArrowFunction is not a method: it takes the same owner_is_method == false arm as export function price, which the five member-initializer negatives already exercise. A third owner-kind table would not change that dispatch.

Shadowed-namespace assert_trusted_relation. Intentional, same shape as #7507 and the issue repro. The smoke price(150) keeps a trusted relation so the observation guard is the decision; not exposed without a related test would also pass for no_static_path. Setup fails if extraction drops the smoke call. That is fail-at-setup, not a weak oracle.

Namespace preservation / receiver plumbing. issue7813_namespace_alias_initializer_stays_exposed ran green on this head (cargo test -p ripr --lib issue7813, 11 passed). The shadowed and nested negatives discriminate receiver-set plumbing: crediting every ns including a body-local shadow would fail issue7813_shadowed_namespace_alias_initializer_is_not_exposed.

Duplicated owner_is_method dispatch. Incorrect on this diff. owner_is_method and namespace_receivers are computed once in ts_changed_value_is_observed and passed into both the direct check and ts_observed_local_aliases_owner. Matching itself lives in one helper, ts_masked_observes_owner.

CodeRabbit on the same head: no actionable comments. The docstring-coverage warning is not a repository gate and is not a reason to decorate test helpers.

@EffortlessSteven
EffortlessSteven marked this pull request as ready for review October 17, 2026 15:54
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@EffortlessSteven

Copy link
Copy Markdown
Member Author

Classification of the Ready-time required-check failure on head 7537f5e39:

inherited combined-tree, not candidate. Head stays frozen. classify/* stays out of this PR.

Evidence:

Independent repair owners already exist:

Do not fold that test-arity patch into #7813. After one of those (or equivalent) lands on main, reconcile the combined tree and re-qualify this unchanged TypeScript head. Behind-only movement is not a restack; this is a material failed combined-tree proof owned by those PRs.

@EffortlessSteven
EffortlessSteven marked this pull request as draft October 17, 2026 16:35
…lias-member-342d

Co-authored-by: Steven Zimmerman, CPA <EffortlessSteven@users.noreply.github.com>

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

review-pr (author self-review after #8500 combined-tree merge, COMMENT)

GitHub cannot request changes from the author. This is not approval.

reviewed_head_sha: cafec70e95d31657c227a80c88d79fb25cfb69c9
integration_basis: origin/main aed1fd122 (#8500 squash); GitHub merge ref 789019192 parents [f6e202fe4, cafec70e9] contains #8500. Later main 7adb0d66e is behind-only (cache sweep / timeout JSON / public-proof receipt); no restack.
claim_boundary: TypeScript value-family one-hop alias initializer must not credit a member segment as an observation of a bare-call owner; method owners keep member-segment credit.
changed_surfaces_and_semantic_owners_inspected:
- typescript/classifier.rs, mod.rs, tests/issue7813_alias_member_tests.rs, changelog fragment: identical to 7537f5e39 (zero TypeScript-claim diff in the merge commit)
- classify/reveal.rs: present from main via #8500; both setup_unwrap_row_* calls now pass None; this PR still does not author that file vs main
blocking_findings: none from source/oracle inspection of the TypeScript claim
proof_and_ci_observed:
- cargo check -p ripr --lib --tests: pass on cafec70e9 (E0061 gone)
- cargo test -p ripr --lib issue7813: 11 passed
- GitHub PR files vs origin/main: still the original 4 claim files
proof_or_review_missing:
- hosted required checks on exact head cafec70e9 (not yet requested; Draft)
affected_currentness_dimensions: integration basis only; production implementation, stimulus, oracle, and changelog unchanged from 7537f5e39
residual_assumptions_and_non_claims:
- no runtime mutation claim; no SPEC-0243 prose rewrite
disposition: REVIEW_INCOMPLETE

Prerequisite #8500 landed as aed1fd122. Combined tree was merged into this branch without folding classify/reveal.rs into the TypeScript claim. Ready will request required qualification on cafec70e9.

@EffortlessSteven
EffortlessSteven marked this pull request as ready for review October 17, 2026 16:40
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Decision

  • Needs reviewer attention before upstream: findings remain.

Confirmed findings

  • SPEC-0243 rule 6 prose still states a member segment counts for the one-hop initializer; the #7507/#7813 exception is implemented in code but not in the spec narrative. This is a documentation drift, not a behavior defect, and the PR explicitly defers spec prose to a separate contract-doc claim.

Verification questions

  • Confirm 11 tests pin both the over-credit negatives (member/optional/non-null/whitespace/alias-rename/shadowed-ns/nested-receiver) and the preservation controls (bare, ns, instance method, static method).
  • Confirm optional-chaining (helper?.price) and non-null assertion (helper!.price) negatives depend on ts_observed_bare_reference rejecting both forms, but the diff doesn't show that helper's implementation.
  • Confirm namespace_receivers is computed once per candidate and threaded into both the value-guard and alias-guard invocations of ts_masked_observes_owner; previously it was only built in the value-guard path.
  • Confirm issue7813_shadowed_namespace_alias_initializer_is_not_exposed only asserts assert_trusted_relation against the smoke price(150); a local const ns = fakeLib() reading still relies on local_identifier_declared_in_test_body to detect shadow. This is the same trust shape as #7507 and was already noted non-blocking.

Refuted

  • Helper extraction is over-engineering / creates a leaky abstraction (one helper serving two semantic paths).; refuted because: Both paths implement the same RIPR-SPEC-0243 owner-reference rule for bare-call owners vs method owners; the helper is a domain primitive, not a generic utility. Boundary placement is correct.

Parked follow-ups

  • All five member-initializer negatives share identical test source shape with only the member-initializer line varying; if ts_masked_observes_owner short-circuits on the first owner-name match, a regression in one branch could be hidden by matching via another path.
  • Author self-declares review disposition REVIEW_INCOMPLETE pending #8500/#8502 finalize_related_tests arity repair on main. PR body and continuation record both stay frozen at 7537f5e.

@EffortlessSteven

Copy link
Copy Markdown
Member Author

Reply to the github-actions review on cafec70e9 (no inline threads). Classification: incorrect / non-blocking / stale. Head stays frozen.

SPEC-0243 rule 6 prose. Agreed this is documentation drift, not a behavior defect. The PR non-goal already defers spec prose: the #7507 value-guard exception is already in production, and rewriting the sentence would likely touch fenced .ripr/traceability.toml. Not in this claim.

11 tests. Confirmed on this head (cargo test -p ripr --lib issue7813, 11 passed). Negatives: member, optional, non-null, whitespace, alias-rename, shadowed-ns, nested-receiver. Preservation: bare call, unshadowed ns.price, instance method, static method.

Optional / non-null. ts_observed_bare_reference (classifier.rs:614-640) rejects a match when the trimmed prefix ends with . (not ...), ?., or !.. Bare-call alias initializers call that helper through ts_masked_observes_owner. The tests go through classify_change, so a leak on another path still fails them.

namespace_receivers plumbing. Computed once in ts_changed_value_is_observed (lines 325-338) and passed into both ts_masked_observes_owner and ts_observed_local_aliases_owner. Not rebuilt at the alias call site.

Shadowed-namespace trust gate. Intentional, same shape as #7507. The smoke price(150) keeps a trusted relation so the observation guard is the decision. Setup fails if extraction drops the smoke call.

Shared negative fixture shape. Each case still has a distinct initializer (helper.price, helper?.price, helper!.price, helper. price, helper.cost). A fake that still credited any member segment would fail all five; a leak of only ?. would fail the optional test and pass the others.

Parked "frozen at 7537f5e / pending #8500". Stale. #8500 landed as aed1fd122. This head is cafec70e9 (that main merged in; TypeScript claim files unchanged vs 7537f5e39). cargo check -p ripr --lib --tests passes on this tree. Required hosted qualification is what remains, not the arity repair.

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exact-Head Review (Published Head)

reviewed_head_sha: cafec70e95d31657c227a80c88d79fb25cfb69c9
integration_basis: origin/main at 134e61053 (clean 3-way merge-tree verified, tree 9fd3e7c0)
claim_boundary: fix(ts): withhold member-initializer credit for bare-call owners #7813
changed_surfaces_and_semantic_owners_inspected:
  - crates/ripr/src/analysis/language/typescript/classifier.rs (typescript classifier owner: enforces bare-call reference rule on one-hop alias paths, withholding credit when helper.price initializes an alias for bare-call export function price while preserving method/class-method and namespace member credit)
  - crates/ripr/src/analysis/language/typescript/tests/issue7813_alias_member_tests.rs (comprehensive unit tests: covers member initializers, whitespace, alias renames, bare-call aliases, namespace imports, shadowed namespaces, nested receivers, instance methods, and static methods)
  - changelog.d/7813-ts-bare-call-alias-member.md (release changelog fragment)
blocking_findings: none
non_blocking_suggestions: none
refuted_or_stale_findings: none
proof_and_ci_observed:
  - GitHub Actions run 39050458318: Ripr Rust Small on GitHub Hosted / Rust gates SUCCESS (all 29 steps passed: formatting, clippy, 16.7k tests, doctests, fixtures, goldens)
  - Required gate status check Ripr Rust Small Result: pass (4s)
  - Linux x64 wheel, Python journeys, ub-review: all pass
  - Clean 3-way merge-tree with origin/main verified (tree 9fd3e7c0, 0 conflicts)
proof_or_review_missing: none
affected_currentness_dimensions: all dimensions current on exact head cafec70e
residual_assumptions_and_non_claims: bounded to TypeScript one-hop alias initialization paths without claiming full runtime mutation killing
disposition: REVIEW_READY

@EffortlessSteven
EffortlessSteven merged commit 0d84c44 into main Oct 17, 2026
34 checks passed
@EffortlessSteven
EffortlessSteven deleted the cursor/ts-bare-call-alias-member-342d branch October 17, 2026 18:10
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.

ts: alias-via-member initializer credits bare-call owners (follow-up to #7507)

2 participants