Repository navigation
fix(ts): withhold member-initializer credit for bare-call owners - #8497
Conversation
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>
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
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
left a comment
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Decision
- Needs reviewer attention before upstream: findings remain.
Confirmed findings
- Optional-chaining (
helper?.price() and non-null assertion (helper!.price() negatives assumets_observed_bare_referencerejects 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 dedicatedoptional_chainingrule, notts_observed_bare_reference), the test could pass for the wrong reason. Submaterial sincets_observed_bare_referenceis 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 assertsassert_trusted_relationonly when the smokeprice(150)is unrelated byextract_tests. The localns = fakeLib()plus aprice(150)smoke creates a real bare-call relation toprice, so the gate holds via that smoke rather than thens.priceinitializer. This means the test would not flag a regression in whichextract_testsstarted 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.
|
Reply to the github-actions review on Optional / non-null member negatives. These are not a separate optional-chaining rule. Both the value guard and the alias path call Constructor / arrow-function owners. There is no Shadowed-namespace Namespace preservation / receiver plumbing. Duplicated 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. |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Classification of the Ready-time required-check failure on head inherited combined-tree, not candidate. Head stays frozen. Evidence:
Independent repair owners already exist:
Do not fold that test-arity patch into #7813. After one of those (or equivalent) lands on |
…lias-member-342d Co-authored-by: Steven Zimmerman, CPA <EffortlessSteven@users.noreply.github.com>
EffortlessSteven
left a comment
There was a problem hiding this comment.
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.
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
There was a problem hiding this comment.
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 onts_observed_bare_referencerejecting 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_ownershort-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.
|
Reply to the github-actions review on 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 11 tests. Confirmed on this head ( Optional / non-null. namespace_receivers plumbing. Computed once in Shadowed-namespace trust gate. Intentional, same shape as #7507. The smoke Shared negative fixture shape. Each case still has a distinct initializer ( Parked "frozen at 7537f5e / pending #8500". Stale. #8500 landed as |
EffortlessSteven
left a comment
There was a problem hiding this comment.
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
Summary
TypeScript's one-hop alias observation path credited
const r = helper.price(150)as an observation of a bare-call ownerexport function price, becausets_observed_local_aliases_ownerusedts_references_identifier, which counts member segments. A smokeprice(150)plus an assertion ofrcould therefore readexposed.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 readexposed; 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-reporiprwork. Confirm the change belongs here:ripr-swarmSource-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 ownerprice; method owners keep member-segment alias credit.Candidate Relationships
Candidate branch (GitHub PR head is authoritative after publication):
cursor/ts-bare-call-alias-member-342dStack parent or prerequisite PR (if any): none for the TypeScript claim. Combined-tree compile depended on independent #8500; that PR landed as
aed1fd122and 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:
Production delta:
ts_observed_local_aliases_ownernow sharests_masked_observes_ownerwith the TypeScript owner-name shadow checks miss catch, parameter, for-of and multi-declarator bindings (false exposed) #7507 value guard.ts_observed_bare_referenceorts_observed_namespaced_owner_call.ts_references_identifier.Evidence/support delta:
typescript/tests/issue7813_alias_member_tests.rs(declared frommod.rs, nottests.rs, to avoid colliding with fix(typescript): read a concise-arrow or parenthesized ternary condition as its predicate boundary (#8464) #8476).changelog.d/7813-ts-alias-member-initializer.md.Single acceptance criterion:
const r = helper.price(150); expect(r).toBe(140)with a smokeprice(150)must not readexposedforexport function price;const r = helper.price(150); expect(r).toBe(130)for an instance/static method owner namedpricemust stayexposed.Non-goals:
tests.rs,probe_shape.rs, TypeScriptrelated_tests.rs,classify/*,owner_pin, Python, or other fenced surfaces.Support-tier Impact
docs/status/SUPPORT_TIERS.mdClaim/proof notes:
Policy Impact
Ledger or exception notes:
Proof
Result, failures, or skipped proof:
7537f5e39and again oncafec70e9.precommit: pass on the TypeScript claim commits. Goldens skipped: no output-surface or golden file changed vs origin/main.rustcE0061 in fencedclassify/reveal.rswhile that 1-arg call still lived on main. Independent fix(reveal): pass the diff-touched argument in two setup-unwrap tests #8500 landed asaed1fd122. This branch merged that main;cargo check -p ripr --lib --testsnow passes. This PR still does not authorclassify/reveal.rsvs main.Claim Boundary
What may be claimed after this PR? What must not be claimed yet?
pricemember as an observation of a bare-call ownerprice.Exact candidate SHA:
cafec70e95d31657c227a80c88d79fb25cfb69c9Rollback
Revert this PR. The previous alias path re-admits member-initializer over-credit for bare-call owners.
Spec-Test-Code Traceability
crates/ripr/src/analysis/language/typescript/tests/issue7813_alias_member_tests.rscrates/ripr/src/analysis/language/typescript/classifier.rs(ts_masked_observes_owner,ts_observed_local_aliases_owner)Static Language Check
killed,survived,untested,proven, andadequate.CI Economics
n/a — ordinary analyzer behavior PR; no workflow, policy-gate, or lane changes.
Engineering Check
panic,unwrap,expect,todo, orunimplementedin production code.panic,unwrap,expect,todo, orunimplementedin tests.Gates
Local focused proof passed on
cafec70e9after merging landed #8500. Ready requests hosted required checks on this head. Merge still waits for published-headREVIEW_READYplus those required checks.Extension changes: n/a
Continuation record