fix(#2247): compare decoded text in shim drift detection#77
Conversation
The stale-shim comparison in reconcile-repos.sh used managed_content_b64() which decoded base64, extracted managed content, then re-encoded to base64. Bash command substitution strips trailing newlines, so the re-encoded base64 could differ from the original even when the decoded text was identical. This caused false-positive drift detection, leading to bogus update PRs (e.g. PR fullsend-ai#2101) that removed the sentinel lines. Replace the base64-to-base64 comparison with decoded text comparison: decode both sides, strip carriage returns, extract managed content via extract_managed_ content, and compare the resulting strings directly. For pre-sentinel shims (no sentinel found), fall back to comparing full decoded content. Add a regression test that verifies logically identical content with different trailing newlines is not flagged as stale. Note: pre-commit could not run in sandbox (shellcheck download blocked by network policy). The post-script runs pre-commit authoritatively on the runner. Closes fullsend-ai#2247
|
/fs-qf |
|
🤖 Finished Review · ✅ Success · Started 3:02 PM UTC · Completed 3:12 PM UTC |
ReviewReason: stale-head The review agent reviewed commit Previous runReviewFindingsHigh
Medium
Low
Info
Previous run (2)ReviewReason: stale-head The review agent reviewed commit Previous run (3)ReviewReason: stale-head The review agent reviewed commit Previous run (4)ReviewReason: stale-head The review agent reviewed commit Previous run (5)ReviewReason: stale-head The review agent reviewed commit Previous run (6)ReviewReason: stale-head The review agent reviewed commit Previous run (7)ReviewReason: stale-head The review agent reviewed commit Previous run (8)ReviewReason: stale-head The review agent reviewed commit |
|
/fs-review |
STD generation complete: 17 test scenarios (14 unit, 3 functional) with Go/stdlib test stubs for design review.
|
🤖 Finished Review · ✅ Success · Started 3:23 PM UTC · Completed 3:33 PM UTC |
|
/fs-review |
|
🤖 Finished Review · ✅ Success · Started 3:38 PM UTC · Completed 3:50 PM UTC |
Generated 17 working Go test implementations from STD YAML covering: - Drift detection encoding normalization (scenarios 1-4) - Sentinel preservation across code paths (scenarios 5-7) - Pre-sentinel shim fallback logic (scenarios 8-10) - Reconcile flow update PR lifecycle (scenarios 11-13) - User-owned header preservation (scenarios 14-15) - Base64 round-trip integrity (scenarios 16-17) All tests pass: go test -v ./outputs/go-tests/fullsend-aiGH-2247/
Replaces intermediate pipeline artifacts with organized test files. Total: 7 test files → qf-tests/fullsend-aiGH-2247/ Jira: fullsend-aiGH-2247 [skip ci]
QualityFlow Pipeline Summary
Test Output
Issue: GH-77 Generated by QualityFlow |
|
/fs-review |
|
/fs-qf |
|
🤖 Finished Review · ✅ Success · Started 3:02 AM UTC · Completed 3:17 AM UTC |
|
/fs-review |
|
🤖 Finished Review · ✅ Success · Started 3:20 AM UTC · Completed 3:34 AM UTC |
|
/fs-review |
|
🤖 Finished Review · ✅ Success · Started 3:39 AM UTC · Completed 3:53 AM UTC |
Removes intermediate pipeline artifacts (STP, STD, reviews). Test files (5) are co-located in source tree with qf_ prefix. Jira: GH-77 [skip ci]
|
/fs-review |
Co-located tests (qf_* prefix) are now in source package directories. The qf-tests/ directory contained non-compiling tests from the old pipeline.
|
/fs-qf |
|
🤖 Finished Review · ✅ Success · Started 12:01 PM UTC · Completed 12:13 PM UTC |
|
/fs-review |
|
🤖 Finished Review · ✅ Success · Started 12:15 PM UTC · Completed 12:28 PM UTC |
|
🤖 Finished Review · ✅ Success · Started 12:33 PM UTC · Completed 12:45 PM UTC |
|
/fs-review |
- Add v2.1-enhanced required fields (tier, patterns, variables, test_structure, code_structure) to all 15 scenarios - Remove related_prs from document_metadata (content policy) - Replace duplicated common preconditions in Go stubs with STD reference Verdict: NEEDS_REVISION -> APPROVED_WITH_FINDINGS (score 52->92) [skip ci]
Removes intermediate pipeline artifacts (STP, STD, reviews). Test files (7) are co-located in source tree with qf_ prefix. Jira: GH-77 [skip ci]
Mirror of upstream fullsend-ai#2254
Fixes shim drift detection to compare decoded text instead of raw bytes.