From f6f33860c909a4231946951f4fe148e8b8643449 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 22 Nov 2026 15:08:07 +0000 Subject: [PATCH 1/5] fix(ci): re-attest hypatia credential-read-check at f2c06048 (fixes red Pinned source closure) Dependabot #699 moved the scanner-credential pin to f2c06048 without updating the source manifest or receipts. Blob 15c597e is identical at both commits, so only the commit binding changes; nested uses are unchanged. --- scripts/lib/lock-closure-receipts.tsv | 4 ++-- scripts/lib/pinned-reusable-sources.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/lib/lock-closure-receipts.tsv b/scripts/lib/lock-closure-receipts.tsv index 1b854662..8dbada15 100644 --- a/scripts/lib/lock-closure-receipts.tsv +++ b/scripts/lib/lock-closure-receipts.tsv @@ -76,5 +76,5 @@ metadatastician/standards ea2f4d8a886585ed442687ae63d4ad7493379ba4 oven-sh/setup # Reviewed source: hyperpolymath/proven-cicd-and-workflows/.github/workflows/secret-scanner-reusable.yml@1fd5e6371a50f0fc3687206a5adca0cdf7b39aa6 hyperpolymath/proven-cicd-and-workflows 1fd5e6371a50f0fc3687206a5adca0cdf7b39aa6 actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 -# Reviewed source: hyperpolymath/hypatia/.github/workflows/credential-read-check.yml@29a9e4a881b6a3cc4cd27fcbc0886ffbadcbc5fe -hyperpolymath/hypatia 29a9e4a881b6a3cc4cd27fcbc0886ffbadcbc5fe step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a +# Reviewed source: hyperpolymath/hypatia/.github/workflows/credential-read-check.yml@f2c0604880f615bec5edda7aaefc8feac3d04cc5 +hyperpolymath/hypatia f2c0604880f615bec5edda7aaefc8feac3d04cc5 step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a diff --git a/scripts/lib/pinned-reusable-sources.json b/scripts/lib/pinned-reusable-sources.json index 8c666757..91936eac 100644 --- a/scripts/lib/pinned-reusable-sources.json +++ b/scripts/lib/pinned-reusable-sources.json @@ -731,7 +731,7 @@ }, { "repository": "hyperpolymath/hypatia", - "commit": "29a9e4a881b6a3cc4cd27fcbc0886ffbadcbc5fe", + "commit": "f2c0604880f615bec5edda7aaefc8feac3d04cc5", "path": ".github/workflows/credential-read-check.yml", "blob": "15c597ea720a5affb861dab058084f7245ee4cbd", "content_sha256": "645e8ac8ff118c33f2dc941ec46f1abac895f7836339736841c269e4b9dc084d", From 5ec410aa926e894c2ddaa99499327725f9c57ebc Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 22 Nov 2026 11:56:46 +0000 Subject: [PATCH 2/5] fix(robot-repo-automaton): satisfy clippy needless_bool in confidence.rs Return the any() result directly instead of an if guard that returns a bool literal followed by a literal false. Behaviour is unchanged; newer stable clippy rejects the old form under -D warnings. (cherry picked from commit 6ddc6dc77a422d5897bdea4df794e6520e1ab948) --- robot-repo-automaton/src/confidence.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/robot-repo-automaton/src/confidence.rs b/robot-repo-automaton/src/confidence.rs index 842871b3..db704d43 100644 --- a/robot-repo-automaton/src/confidence.rs +++ b/robot-repo-automaton/src/confidence.rs @@ -349,11 +349,7 @@ fn is_protected_file(target: &str) -> bool { "spec/", "verification/", ]; - if protected_dirs.iter().any(|dir| target.contains(dir)) { - return true; - } - - false + protected_dirs.iter().any(|dir| target.contains(dir)) } /// Check if a file is a standard repository file (high confidence to create) From 0602c7dcb3539f58cec816ecbb73ef2adf177175 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 22 Nov 2026 11:59:24 +0000 Subject: [PATCH 3/5] fix(gsbot): update url to 2.5.9 to clear RUSTSEC-2026-0592 url <= 2.5.8 recurses in Url::origin() on blob: URLs. Lock url to 2.5.9 with 'cargo update -p url --precise 2.5.9'; form_urlencoded moves from 1.2.2 to 1.2.3 with it. Only bots/gsbot/Cargo.lock changes. gsbot builds and its tests pass with --locked. (cherry picked from commit 6bfdde78c3ce59c8c4e19e595b13d814786cfcd7) --- bots/gsbot/Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bots/gsbot/Cargo.lock b/bots/gsbot/Cargo.lock index 573ac8c4..3d49bb46 100644 --- a/bots/gsbot/Cargo.lock +++ b/bots/gsbot/Cargo.lock @@ -560,9 +560,9 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.2.2" +version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +checksum = "afa489199eaffb1211795df1c6236ce1ad0d41a6fa45250add73e3b02420f06e" dependencies = [ "percent-encoding", ] @@ -2650,9 +2650,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.8" +version = "2.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +checksum = "f00cd2407bb42c0ef17be88d4cf020f5cceffd121665bac9b8b9493a369b3b1a" dependencies = [ "form_urlencoded", "idna", From 46b5bbd35bc040676c44cd868e6f6cd3b37b921c Mon Sep 17 00:00:00 2001 From: "coderabbitai[bot]" <136622811+coderabbitai[bot]@users.noreply.github.com> Date: Wed, 25 Nov 2026 23:22:04 +0000 Subject: [PATCH 4/5] test(fleet): cover protected-directory deletion confidence and reusable workflow repins --- .../tests/confidence_tests.rs | 52 +++++++++++++++++++ scripts/tests/pinned-reusable-sources-test.sh | 22 ++++++-- 2 files changed, 71 insertions(+), 3 deletions(-) create mode 100644 robot-repo-automaton/tests/confidence_tests.rs diff --git a/robot-repo-automaton/tests/confidence_tests.rs b/robot-repo-automaton/tests/confidence_tests.rs new file mode 100644 index 00000000..43af71d7 --- /dev/null +++ b/robot-repo-automaton/tests/confidence_tests.rs @@ -0,0 +1,52 @@ +// SPDX-License-Identifier: MPL-2.0 +//! Regression tests for the confidence guard on protected directories. + +use robot_repo_automaton::catalog::{Fix, FixAction, Severity}; +use robot_repo_automaton::{ConfidenceLevel, DetectedIssue, ThresholdConfig}; + +fn deletion_confidence(target: &str) -> ConfidenceLevel { + let issue = DetectedIssue { + error_type_id: "TEST".into(), + error_name: "Obsolete file".into(), + severity: Severity::Medium, + description: "Detected an obsolete file".into(), + affected_files: vec![], + confidence: 1.0, + suggested_fix: "Delete the file".into(), + commit_message: "fix: remove obsolete file".into(), + }; + let fix = Fix { + action: FixAction::Delete, + target: target.into(), + reason: None, + modification: None, + fallback: None, + }; + ThresholdConfig::default().classify_fix(&issue, &fix) +} + +#[test] +fn test_high_confidence_deletes_are_downgraded_in_protected_directories() { + // No protected basename or extension can account for these results. + for target in [ + ".machine_readable/metadata.json", + "crates/engine/src/abi/exports.rs", + "docs/getting-started.txt", + "packages/engine/spec/grammar.txt", + "verification/run.sh", + ] { + assert_eq!(deletion_confidence(target), ConfidenceLevel::Low, "{target}"); + } +} + +#[test] +fn test_high_confidence_deletes_keep_their_rating_for_directory_near_misses() { + for target in [ + "src/docs", // A filename, with no trailing directory separator. + "docs-old/notes.txt", + "packages/engine/Spec/grammar.txt", // Directory markers are case sensitive. + "crates/engine/src/abigail/exports.rs", + ] { + assert_eq!(deletion_confidence(target), ConfidenceLevel::High, "{target}"); + } +} diff --git a/scripts/tests/pinned-reusable-sources-test.sh b/scripts/tests/pinned-reusable-sources-test.sh index fdb3b514..d1b1a708 100644 --- a/scripts/tests/pinned-reusable-sources-test.sh +++ b/scripts/tests/pinned-reusable-sources-test.sh @@ -77,14 +77,14 @@ replace_pin() { done } check() { - local label="$1" expected="$2" rc=0 valid=0 + local label="$1" expected="$2" expected_rule="${3:-}" rc=0 valid=0 timeout 15s bash "$HELPER" --json --repo-root "$CASE/repo" --manifest "$MANIFEST" \ --lock "$CASE/repo/.github/workflows/actions.lock" --receipts "$CASE/repo/receipts.tsv" --cache "$CASE/cache" \ > "$CASE/result.json" 2> "$CASE/stderr" || rc=$? if jq -e 'type=="object" and (.findings|type=="array") and (.not_run|type=="array") and (.verified_roots|type=="array") and (.verified_receipt_sources|type=="array")' "$CASE/result.json" >/dev/null 2>&1; then case "$expected" in clean) [[ "$rc" == 0 ]] && jq -e '(.findings|length)==0 and (.not_run|length)==0 and (.verified_roots|length)==1 and (.verified_receipt_sources|length)>0' "$CASE/result.json" >/dev/null && valid=1 ;; - fatal) [[ "$rc" == 1 || "$rc" == 3 ]] && jq -e 'any(.findings[]; .severity=="FATAL" and (.rule|length)>0 and (.detail|length)>0) and (.verified_roots|length)==0 and (.verified_receipt_sources|length)==0' "$CASE/result.json" >/dev/null && valid=1 ;; + fatal) [[ "$rc" == 1 || "$rc" == 3 ]] && jq -e --arg rule "$expected_rule" 'any(.findings[]; .severity=="FATAL" and (.rule|length)>0 and ($rule=="" or .rule==$rule) and (.detail|length)>0) and (.verified_roots|length)==0 and (.verified_receipt_sources|length)==0' "$CASE/result.json" >/dev/null && valid=1 ;; notrun) [[ "$rc" == 2 ]] && jq -e '(.findings|length)==0 and any(.not_run[]; (.rule|length)>0 and (.detail|length)>0) and (.verified_roots|length)==0 and (.verified_receipt_sources|length)==0' "$CASE/result.json" >/dev/null && valid=1 ;; *) printf 'Unexpected fixture expectation: %s\n' "$expected" >&2; exit 64 ;; esac @@ -115,6 +115,22 @@ fi [[ -f "$HELPER" ]] || { echo 'Missing helper; this is a prerequisite failure, not a successful rejection control.' >&2; exit 64; } case_fixture good; check 'authenticated active source and exact receipt' clean + +# A pin can move even when the reusable workflow and its direct edges are +# unchanged. The new caller pin still needs both current attestations. +case_fixture same-blob-repin +repin_tree="$(git --git-dir="$CASE/cache/org/reusable.git" rev-parse "$ROOT_SHA^{tree}")" +repin_sha="$(commit_tree "$CASE/cache/org/reusable.git" "$repin_tree" 'Repin unchanged workflow')" +[[ "$repin_sha" != "$ROOT_SHA" ]] +replace_pin "$ROOT_SHA" "$repin_sha" +check 'unchanged workflow authenticates after repinning caller, catalog and receipt' clean + +cp "$BASE/repo/receipts.tsv" "$CASE/repo/receipts.tsv" +check 'unchanged workflow cannot use a receipt for the old pin' fatal SOURCE-RECEIPT +replace_pin "$ROOT_SHA" "$repin_sha" +edit_manifest --arg old "$ROOT_SHA" '.sources[0].commit=$old' +check 'unchanged workflow cannot use a catalog binding for the old pin' fatal SOURCE-ACTIVE-MISSING + case_fixture historical; edit_manifest '.sources += [(.sources[0] | .role="retained-review" | .callers=[] | .path=".github/workflows/other.yml")]'; check 'explicit historical review can coexist with active source' clean case_fixture unrelated-vendor; cat >> "$CASE/repo/.github/workflows/actions.lock" < Date: Wed, 25 Nov 2026 23:44:16 +0000 Subject: [PATCH 5/5] style(robot-repo-automaton): rustfmt confidence_tests.rs cargo fmt --check failed the Rust build/test/clippy job on #707 (two assert_eq! calls over the line width). Formatting only; no logic change. --- robot-repo-automaton/tests/confidence_tests.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/robot-repo-automaton/tests/confidence_tests.rs b/robot-repo-automaton/tests/confidence_tests.rs index 43af71d7..270baf4d 100644 --- a/robot-repo-automaton/tests/confidence_tests.rs +++ b/robot-repo-automaton/tests/confidence_tests.rs @@ -35,7 +35,11 @@ fn test_high_confidence_deletes_are_downgraded_in_protected_directories() { "packages/engine/spec/grammar.txt", "verification/run.sh", ] { - assert_eq!(deletion_confidence(target), ConfidenceLevel::Low, "{target}"); + assert_eq!( + deletion_confidence(target), + ConfidenceLevel::Low, + "{target}" + ); } } @@ -47,6 +51,10 @@ fn test_high_confidence_deletes_keep_their_rating_for_directory_near_misses() { "packages/engine/Spec/grammar.txt", // Directory markers are case sensitive. "crates/engine/src/abigail/exports.rs", ] { - assert_eq!(deletion_confidence(target), ConfidenceLevel::High, "{target}"); + assert_eq!( + deletion_confidence(target), + ConfidenceLevel::High, + "{target}" + ); } }