fix(ack): preserve archive bytes in Kubernetes downloads #3144
All Vouch review confidence checks passed
Residual risk 0.34 = Change Risk (0.60) × (1 − Review Confidence (0.43)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.60 · 224 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.324
Sensitive Paths
sensitive_paths
0.060
Real PR Conversation Timeline
1 comments
"Review active on #3144"
general
weight: 0.35
KunWuLuan
ACK downloads currently decode tar stdout as UTF-8 per WebSocket frame. Binary bytes and UTF-8 characters split across frames are replaced irreversibly, corrupting file contents and potentially hiding later archive members such as
reward.json.Set
binary=Truefor both download streams and consume stdout directly as bytes. Accumulate directory stderr as bytes and decode it after collection so the existing missing-directory diagnostics still work. This keeps the fix within the two download methods; extraction behavior and retry policy are unchanged.Regression tests feed real tar archives through the Kubernetes
WSClientdecoder with a mocked socket and deterministic 1,021-byte frames. They check Chinese/emoji text, arbitrary binary data, a trailing reward file, benign stderr, and a split UTF-8 directory error.Validation (Python 3.13):
uv run --no-sync pytest tests/unit/environments/— 1,862 passed, 16 skipped.uv run --no-sync ruff check --fix .,uv run --no-sync ruff format .,uv run --no-sync ty check, andgit diff --checkpass.Fixes #3143.
This PR was developed with AI assistance.
<!-- devin-review-badge-begin -->
---
<a href="https://app.devin.ai/review/harbor-framework/harbor/pull/3144" target="_blank">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-devin-review-dark.svg?v=3">
<img src="https://static.devin.ai/assets/gh-devin-review-light.svg?v=3" alt="Devin Review">
</picture>
</a>
<!-- devin-review-badge-end -->