Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .ripr/allow-attributes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
27 changes: 15 additions & 12 deletions crates/ripr/src/analysis/language/perl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Comment thread
EffortlessSteven marked this conversation as resolved.
Resolved
)]

use crate::analysis::AnalysisOptions;
use crate::analysis::diff::ChangedFile;
Expand Down Expand Up @@ -522,8 +526,8 @@ fn packet_to_findings(packet: &PerlFactPacket) -> Vec<crate::domain::Finding> {
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
Expand Down Expand Up @@ -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}"));
}
}
Expand Down Expand Up @@ -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
Expand Down
7 changes: 0 additions & 7 deletions crates/ripr/src/analysis/language/perl/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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\"",
Expand Down Expand Up @@ -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\"",
Expand Down Expand Up @@ -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!(
Expand All @@ -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");
Expand All @@ -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(),
Expand All @@ -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!(
Expand Down Expand Up @@ -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(),
Expand Down
16 changes: 8 additions & 8 deletions crates/ripr/tests/perl_two_binary_harness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> {
// 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") {
Expand Down
Loading