diff --git a/.ripr/allow-attributes.txt b/.ripr/allow-attributes.txt index 1ce8added88..a7c6a289032 100644 --- a/.ripr/allow-attributes.txt +++ b/.ripr/allow-attributes.txt @@ -16,3 +16,4 @@ xtask/src/main.rs|expect(clippy::expect_used)|1|xtask test module: production pa xtask/src/main.rs|expect(clippy::unwrap_used)|1|xtask test module: production paths receipted via policy/no-panic-allowlist.toml; tests share one module-level expect. crates/ripr/src/app/check.rs|allow(dead_code)|2|item 4b: PERL_FACTS_MAX_AGE_SECS + cached_packet_is_fresh retained for future content-keyed cache reuse; intentionally bypassed until content-hash key is implemented crates/ripr/src/analysis/repair_route.rs|allow(dead_code)|3|Typed new-test target selection is an explicit producer contract reserved until RustIndex supplies proposal facts; no renderer infers a target. +crates/ripr/src/analysis/language/perl/mod.rs|allow(dead_code)|1|Perl strict-actionability scaffold is feature-gated and exercised by tests before public projection is enabled; reviewed suppression in place of a cfg_attr wrapper the allow-attribute gate could not inventory. diff --git a/crates/ripr/src/analysis/language/perl/mod.rs b/crates/ripr/src/analysis/language/perl/mod.rs index 78816c0f0f1..326a508f017 100644 --- a/crates/ripr/src/analysis/language/perl/mod.rs +++ b/crates/ripr/src/analysis/language/perl/mod.rs @@ -5,6 +5,10 @@ //! exporter, a Perl runtime, or an LSP protocol session. Production routing //! lands only after the fact packet and strict actionability slices are //! fixture-backed. +#![allow( + dead_code, + reason = "Perl strict-actionability scaffold is feature-gated and currently exercised by tests before public projection is enabled" +)] use crate::analysis::AnalysisOptions; use crate::analysis::diff::ChangedFile; @@ -522,8 +526,8 @@ fn packet_to_findings(packet: &PerlFactPacket) -> Vec { id: ProbeId(probe_id.clone()), location: SourceLocation::new( std::path::PathBuf::from(&file.path), - owner.range.start_line as usize, - owner.range.start_column as usize, + owner.range.start_line, + owner.range.start_column, ), owner: owner .name @@ -878,7 +882,7 @@ impl PerlFactPacket { // before it is used as a canonical gap or receipt key. for (field, ids) in &id_checks { for id in ids { - if let Err(reason) = validate_stable_id(*id) { + if let Err(reason) = validate_stable_id(id) { return Err(format!("ingestion: malformed {field} ID `{id}` — {reason}")); } } @@ -980,19 +984,18 @@ impl PerlFactPacket { // that did not advertise `test_facts` is untrustworthy. Only // `test_facts` is enforced — SPEC-0064 defines no capability name // for changes/relations/files, so this check does not fabricate one. - if !self.tests.is_empty() || !self.oracles.is_empty() { - if !self + if (!self.tests.is_empty() || !self.oracles.is_empty()) + && !self .producer .capabilities .iter() .any(|capability| capability == "test_facts") - { - return Err( - "ingestion: packet carries tests/oracles but producer did not \ - advertise the `test_facts` capability" - .to_string(), - ); - } + { + return Err( + "ingestion: packet carries tests/oracles but producer did not \ + advertise the `test_facts` capability" + .to_string(), + ); } // 8. Fingerprint recomputation (Campaign 31 item 2): the declared diff --git a/crates/ripr/src/analysis/language/perl/tests.rs b/crates/ripr/src/analysis/language/perl/tests.rs index 8aa31f18d60..177c0c06c4e 100644 --- a/crates/ripr/src/analysis/language/perl/tests.rs +++ b/crates/ripr/src/analysis/language/perl/tests.rs @@ -1918,7 +1918,6 @@ fn perl_lsp_exporter_unavailable_stays_non_actionable() { fn relation_gate_accepts_direct_owner_call() { // Build a packet where the related test evidence has a DirectOwnerCall // relation kind — this must pass the strict-actionability gate. - let adapter = PerlAdapter; let packet_text = EXACT_RETURN_PACKET.replace( "\"relation_kind\": \"file_proximity\"", "\"relation_kind\": \"direct_owner_call\"", @@ -1948,7 +1947,6 @@ fn relation_gate_rejects_file_proximity_only() { // The reference packet uses DirectOwnerCall relations. To test the gate, // modify the relation_kind to file_proximity — this must fail strict // actionability with MissingStrongRelatedEvidence. - let adapter = PerlAdapter; let packet_text = EXACT_RETURN_PACKET.replace( "\"relation_kind\": \"direct_owner_call\"", "\"relation_kind\": \"file_proximity\"", @@ -2097,7 +2095,6 @@ fn ingestion_rejects_unavailable_packet_status() { "\"packet_status\": \"complete\"", "\"packet_status\": \"unavailable\"", ); - let adapter = PerlAdapter; let result = consume(&packet); let err = result.as_ref().err().map(String::as_str).unwrap_or(""); assert!( @@ -2114,7 +2111,6 @@ fn ingestion_rejects_unavailable_packet_status() { fn ingestion_rejects_wrong_producer_name() { let packet = EXACT_RETURN_PACKET.replace("\"name\": \"perl-lsp\"", "\"name\": \"bogus-producer\""); - let adapter = PerlAdapter; let result = consume(&packet); let err = result.as_ref().err().map(String::as_str).unwrap_or(""); assert!(result.is_err(), "wrong producer name must be rejected"); @@ -2134,7 +2130,6 @@ fn ingestion_rejects_dangling_relation_owner_id() { let packet = EXACT_RETURN_PACKET.replacen(needle, "perl:NONEXISTENT::Owner", count); // Restore the earlier occurrences (owners array + change's owner_id) back. let packet = packet.replacen("perl:NONEXISTENT::Owner", needle, count - 1); - let adapter = PerlAdapter; let result = consume(&packet); assert!( result.is_err(), @@ -2153,7 +2148,6 @@ fn ingestion_rejects_dangling_relation_change_id() { EXACT_RETURN_PACKET.replacen(needle, "\"change_id\": \"change:NONEXISTENT\"", count); // Restore the earlier occurrences (changes array) back to original. let packet = packet.replacen("\"change_id\": \"change:NONEXISTENT\"", needle, count - 1); - let adapter = PerlAdapter; let result = consume(&packet); let err = result.as_ref().err().map(String::as_str).unwrap_or(""); assert!( @@ -2186,7 +2180,6 @@ fn ingestion_accepts_unresolved_relation_change_id_sentinel() { #[test] fn ingestion_accepts_well_formed_reference_packet() { - let adapter = PerlAdapter; let result = consume(EXACT_RETURN_PACKET); assert!( result.is_ok(), diff --git a/crates/ripr/tests/perl_two_binary_harness.rs b/crates/ripr/tests/perl_two_binary_harness.rs index c6ca9d4dbf4..05e1421993e 100644 --- a/crates/ripr/tests/perl_two_binary_harness.rs +++ b/crates/ripr/tests/perl_two_binary_harness.rs @@ -79,15 +79,15 @@ fn ripr_bin() -> PathBuf { /// produced the packet, only that a valid `ripr-perl-facts-v1` JSON was emitted. fn producer_on_path() -> Option { // 1. Env override (highest priority). - if let Ok(path) = std::env::var("PERL_RIPR_FACTS") { - if !path.is_empty() { - return Some(path); - } + if let Ok(path) = std::env::var("PERL_RIPR_FACTS") + && !path.is_empty() + { + return Some(path); } - if let Ok(path) = std::env::var("RIPR_PERL_FACTS_EXPORTER") { - if !path.is_empty() { - return Some(path); - } + if let Ok(path) = std::env::var("RIPR_PERL_FACTS_EXPORTER") + && !path.is_empty() + { + return Some(path); } // 2. Canonical exporter. if which("perl-ripr-facts") {