Repository navigation
feat(analysis): transfer alternative-of-plain-literals match arms exactly - #10311
EffortlessSteven wants to merge 5 commits into
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 17 minutes. View limit details
Comment |
EffortlessSteven
left a comment
There was a problem hiding this comment.
Self-review (author, COMMENT disposition: substantive self-check before merge; not independent review).
Surfaces and risks
analysis/classify/match_transfer.rs— the shape parser and evaluator. Risk class: false-positive exposure (crediting a test that cannot observe the change). Mitigation: the shape stays all-or-nothing; every|-component must pass the conservativeliteral_stringrule; a|inside quotes yields unbalanced fragments that refuse, so no mis-parse path; wildcard/binding/escaped components inside an alternative refuse the whole arm (unit-pinned).- Spec contract: RIPR-SPEC-0164 example #3 changed Reject → Accept; the corpus case already cites #3 and now matches the example text.
check-spec-formatandcheck-spec-numberingpass.
Oracle challenge
- The promoted row's truth is a runtime mutant kill on the exact pinned test (
tests_failed), soexposedis warranted, not a self-confirming static guess. - Removal control: the pre-change analyzer scores the same case
infection_unknown/limited(observed on main@894d639ac4 before the edit); the flip is attributable to this change, not environment.
Validation
verdict-corpus check(full rust, 653 cases) green with zero contradictions; missed-credit count recomputed independently (145) and pinned as the new ceiling.clippy -p ripr --lib --tests -- -D warningsclean; unit-test execution rides the hosted Rust gates.
Residuals
- The remaining 8 rows of #10304 are separate lanes; ranges/path patterns stay named limitations.
|
Ownership/integration reconciliation needed before treating this as an independent promotion. At the current heads, existing #10196 ( Please reconcile with the existing #10196 owner before further independent promotion: retain one canonical implementation/acceptance record for the overlapping alternative-pattern row, explicitly record any proposed split or replacement and preserve all broader #10196 acceptance and negative controls. No winner, closure, ownership transfer or merge is asserted by this comment. If this PR contributes incremental source-order tests or a materially distinct implementation advantage, identify that delta for the canonical owner rather than counting the row twice. The #10304 investigation correctly describes its measured main snapshot, but it omits this already-open implementation: four of its listed 0164 rows are claimed by #10196, not unowned work. Please reconcile that plan before assigning further overlapping lanes. The 653-case/145-ceiling and 636-case/140-ceiling figures belong to different recorded bases; they are not additive and do not establish a combined-current-main result. Re-measure the chosen integrated candidate after ownership is reconciled. No new writer, qualification run, branch edit, Ready change, review resolution or merge was performed for this coordination. |
|
|
|
|
Same check-changelog-fragments rejection class as #10311: 'Improved' is not a policy section. Co-authored-by: Claude <noreply@anthropic.com>
ca479c1 to
60cf509
Compare
A pipe inside a string literal is content, not an alternative separator: "a|b" stays one literal and keeps its exact-match credit instead of refusing the arm. Devin review on #10311 flagged the regression; a quote-aware split restores the credit with the same conservative validation everywhere else. Regression tests pin both the lone pipe-literal and a pipe inside one alternative. Co-authored-by: Claude <noreply@anthropic.com>
|
|
A pipe inside a string literal is content, not an alternative separator: "a|b" stays one literal and keeps its exact-match credit instead of refusing the arm. Devin review on #10311 flagged the regression; a quote-aware split restores the credit with the same conservative validation everywhere else. Regression tests pin both the lone pipe-literal and a pipe inside one alternative. Co-authored-by: Claude <noreply@anthropic.com>
b76303d to
857e9cd
Compare
There was a problem hiding this comment.
Verification questions
- Confirm the seeded thread reports overlapping production, spec, and corpus changes in #10196, so independent promotion should not proceed without canonical ownership reconciliation.
Refuted
- The PR description and changelog claim a ceiling of 145, while the changed coverage comment says 148.
- Splitting a pattern at every pipe could cut a Unicode literal at a byte boundary and cause undefined behavior.; refuted because: The implementation iterates Unicode scalar values and accumulates them in owned String buffers; no byte-index slicing or unsafe pointer arithmetic is used.
- This change could corrupt evidence while crossing a worker/async/GC/detach/transfer boundary.; refuted because: No such boundary or code path is changed; parsing and arm selection remain synchronous, in-process Rust operations.
- The PR body claims the missed-credit ceiling changed from 146 to 145, but the changed coverage file states 149 and its comment describes 148.
- This PR duplicates a canonical implementation already owned by #10196 and therefore should not be independently promoted.; refuted because: That objection concerns branch ownership/integration rather than the changed code's sibling-path correctness; the current diff still needs canonical reconciliation, but no code defect on the RIGHT side was established here.
- This lane should assess ArrayBuffer/TypedArray resize, detach, transfer, or stale length behavior in the changed production path.; refuted because: The change is entirely Rust string-pattern classification and has no active-view buffer or backing-store surface; the relevant analogous view concern is mutation of the parsed pattern set, which is avoided by immutable parsed arms.
- The PR's missed-credit baseline is consistently 146 before and 145 after the change.; refuted because: The diff contradicts that premise: the file changes 149 and its comment says 148. This objection therefore still requires reconciliation and is reported as a public finding rather than a failed objection.
Evidence gaps
- The corpus promotion and coverage-ceiling update depend on execution evidence whose receipt is scheduled but not yet available.
- The rippr sensor failed with exit code 2, so the changed Rust route lacks a successful compiler/sensor receipt in this packet.
- The coverage TOML removes the missed_credit_ceiling assignment without replacing it.
- Model proof intent was rejected by deterministic validation.
…0321) * fix(output): nest the context packet witness at the packet indent The witness is a serde-owned DTO that rendered through serde_json::to_string (compact), so showed the whole witness as one long line inside an otherwise expanded pretty-printed packet — the worst-read field in the drill-down output for humans. Render it with to_string_pretty and re-indent to the packet's two-space base, matching the hand-rendered fields around it. Whitespace-only change: the wire value is untouched (packet version contract stays 1.1), and a unit test pins both the nested shape and the JSON round-trip. Verified end-to-end against a real probe. Co-authored-by: Claude <noreply@anthropic.com> * docs(changelog): use the valid 'Changed' fragment section Same check-changelog-fragments rejection class as #10311: 'Improved' is not a policy section. Co-authored-by: Claude <noreply@anthropic.com> * changelog: name PR #10321 in the context witness fragment check-changelog-fragments requires every entry to cite an issue or PR. Co-authored-by: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Confirmed findings
- The coverage edit documents a ceiling of 148 but deletes the missed_credit_ceiling assignment, so the TOML table no longer declares the value required by the PR's stated 146 → 145 reduction.
Refuted
- The alternative implementation duplicates an already accepted canonical change in #10196.; refuted because: The duplication concern is real but is an integration/ownership blocker rather than a defect local to the changed RIGHT-side lines; it is parked for maintainer reconciliation rather than duplicated as an inline finding.
- Splitting at every pipe could corrupt a Unicode literal or cause undefined behavior.; refuted because: The implementation iterates Unicode scalar values and accumulates owned Strings without byte slicing or unsafe operations; quote-aware splitting also preserves pipes inside literals.
- The production change needs parallel expansion into sibling pattern helpers to avoid incomplete transfer.; refuted because: The seeded scope and specification explicitly define this slice as plain-string alternatives only; other pattern families remain named limitations, so broadening them would expand risk rather than satisfy the current acceptance delta.
- The change could introduce an ownership or aliasing hazard across an unsafe/native boundary.; refuted because: The touched path is safe, synchronous Rust code that creates and consumes owned Strings and Vec; no raw pointer, reference lifetime, shared mutation, thread, async, FFI, or unsafe boundary is added or changed.
- The changed coverage file appears to omit the ratchet assignment after updating its explanatory comment.
- The change could split a literal at a byte boundary and create an undefined-behavior-prone active view.; refuted because: The implementation iterates Unicode scalar values and accumulates owned String buffers; it performs no byte-index slicing, raw pointer arithmetic, or unsafe access.
Evidence gaps
- The available packet lacks the late cargo-test receipt and does not independently attest the claimed full corpus execution.
- The corpus promotion still depends on successful late cargo-test execution because the ripr sensor receipt failed.
- Model proof intent was rejected by deterministic validation.
Parked follow-ups
- Other pattern classes such as ranges, paths, non-string scrutinees, and mixed alternatives containing bindings, wildcards, or escapes remain outside this lane rather than being broadened here.
- This PR overlaps #10196's production, specification, and corpus promotion, so retaining two canonical implementations would create conflicting ownership and acceptance records.
|
|
|
|
4e79112 to
8cbc237
Compare
A pipe inside a string literal is content, not an alternative separator: "a|b" stays one literal and keeps its exact-match credit instead of refusing the arm. Devin review on #10311 flagged the regression; a quote-aware split restores the credit with the same conservative validation everywhere else. Regression tests pin both the lone pipe-literal and a pipe inside one alternative. Co-authored-by: Claude <noreply@anthropic.com>
|
|
…ctly RIPR-SPEC-0164#3 (spec-b-0164-alternative-pattern, first lane of alternative, so a helper arm like "word" | "term" => "alpha" left the caller-side boundary input unresolved and the corpus row abstained at infection_unknown even though the runtime mutant truth says the test discriminates. An alternative of plain string literals is statically exact: the arm matches when ANY constituent equals the scrutinee, and first-match source order stays authoritative. parse_arm now splits the pattern on '|' and requires every component to pass the same conservative literal_string rule; a guard, binding, path, escape, computed value, or any non-literal component inside the alternative (wildcard, binding, escaped literal) still refuses the whole match. Splitting cannot cut inside a literal: a '|' inside quotes still yields fragments that fail the balanced-quote rule, so the arm refuses conservatively rather than mis-parsing. - spec-b-0164-alternative-pattern row re-blessed: credited/exposed, outcome ideal; rust missed_credit_ceiling 146 -> 145 (ratchet) - RIPR-SPEC-0164 acceptance example #3 rewritten from Reject to Accept (the corpus case cites #3); mixed-alternative refusal unit-pinned - full rust verdict corpus check green; check-spec-format and check-spec-numbering pass Co-authored-by: Claude <noreply@anthropic.com>
check-changelog-fragments rejected 'Improved'; the policy's section list is Added / Changed / Deprecated / Removed / Fixed / Security / Docs / Internal CI. Co-authored-by: Claude <noreply@anthropic.com>
A pipe inside a string literal is content, not an alternative separator: "a|b" stays one literal and keeps its exact-match credit instead of refusing the arm. Devin review on #10311 flagged the regression; a quote-aware split restores the credit with the same conservative validation everywhere else. Regression tests pin both the lone pipe-literal and a pipe inside one alternative. Co-authored-by: Claude <noreply@anthropic.com>
The original substitution left BODY's "word" => "alpha" arm ahead of the later alternative, so "word" resolved to "alpha" under the first-match evaluator while the test expected "second" — Rust match semantics agree with the evaluator, not the fixture. Replace both literal arms so the earlier plain arm shadows only the alternative's "text" constituent and "word" still reaches the alternative. Both gate runs (#10143 lineage) had failed on this; the pipe-split fix is unrelated to it. Co-authored-by: Claude <noreply@anthropic.com>
… tree Main's #6485 netted the ceiling to 147 (two grid rows recovered, one bound-input abstention added); this branch resolves one more row (spec-b-0164-alternative-pattern). Keep both reason comments. Co-authored-by: Claude <noreply@anthropic.com>
8cbc237 to
46ba6e3
Compare
|
Bounded shared-ledger coordination request for this existing candidate: can its owner explicitly agree to defer only the numeric-ceiling-changing landing while canonical #10317 completes ONE refreshed migration qualification and its immediate landing/abort disposition? Its previous complete qualification passed, then current ledger edits conflicted again; #10222 records the repeated cost. Implementation, reviews and already-running checks can continue. No cancellation, general freeze, branch change or check waiver is requested. Please reply with agreement or identify a priority repair that must land first so it can be incorporated before the migration is frozen. Silence is not agreement; this request does not establish a hold by itself. Unrelated changes need not wait, and the window ends with that single attempt's landing/abort disposition. The separate existing #10196 ownership/overlap question remains unresolved; agreement here would not clear it. |
|
New concrete state for the existing ownership reconciliation: canonical #10196 merged at14:25:02UTC. Please compare this candidate's alternative-pattern row, spec and boundary controls with the actual landed implementation before any independent promotion. Preserve any additive evidence, but do not restack solely to merge the same behavior or replay a duplicate full qualification. This follows the existing unanswered6396286776 coordination; it does not silently transfer ownership or erase distinct residual controls. |
|
Closing as superseded, not merged. While this PR was in its final gate cycle, main landed #10196 (be652c8,
Verified on current main: the claimed corpus row Disposition: lane 1 of #10304 (spec-b-0164-alternative-pattern) is delivered by #10196; remaining lanes stay queued there. |
Problem
First lane of #10304. The bounded literal match-arm transfer (RIPR-SPEC-0164) refused any
|alternative pattern, so a helper arm like"word" | "term" => "alpha"left the caller-side boundary input unresolved (infection_unknown) even though the runtime mutant truth for the corpus case says the pinned test discriminates.spec-b-0164-alternative-patternsat attruth: discriminated / outcome: abstained(one of the 9 rows #10117 measured but did not earn).Change
analysis/classify/match_transfer.rs: an arm pattern may now be an alternative of plain string literals. The arm matches when ANY constituent equals the scrutinee; first-match source order stays authoritative (an earlier arm shadowing one constituent of a later alternative still wins). Every|-component must pass the same conservativeliteral_stringrule — a guard, binding, path, escape, computed value, or any non-literal component inside the alternative (wildcard, binding, escaped literal) refuses the whole match. Splitting cannot cut inside a literal: a|inside quotes yields fragments that fail the balanced-quote rule, so the arm refuses conservatively rather than mis-parsing.The fail-closed unit test that pinned "alternative pattern refuses" is split: genuinely unresolved shapes (guard, bare binding, computed call argument, escaped literal) keep their fail-closed pins; the alternative shape gains positive resolution, source-order shadowing, and mixed-alternative refusal tests.
RIPR-SPEC-0164's acceptance example #3 is rewritten from Reject to Accept — the corpus case cites
RIPR-SPEC-0164#3, and the example text now describes exactly what the case measures.Evidence
cargo xtask verdict-corpus check --language rust --cases spec-b-0164-alternative-pattern: row drifted exactly as intended (observed_verdictlimited → credited, classification infection_unknown → exposed, outcome abstained → ideal); row re-blessed, drift explanation stated here.cargo xtask verdict-corpus check --language rust: 653 cases green, false verdicts at the pre-existing 3/653 baseline, zero contradictions.spec-coverage.tomlwith a reason comment).cargo xtask check-spec-formatandcheck-spec-numbering: pass.cargo clippy -p ripr --lib --tests -- -D warnings: clean (typechecks the new unit tests; execution rides hosted Rust gates).Honesty notes
infection_unknown → exposedis warranted here because the corpus row's truth is a runtime mutant kill (tests_failedon the exact pinned test), i.e. the oracle provably observes the changed sink.Non-goals
Governing issue or accepted claim: #10304 (the 9 RIPR-SPEC-0164/0165 missed-credit rows), example RIPR-SPEC-0164#3.
Acceptance delta (one sentence): alternative-of-plain-literals match arms now transfer exactly, moving the spec-b-0164-alternative-pattern corpus row from abstained to ideal (exposed) and lowering the rust missed-credit ceiling 146 → 145.