Skip to content

Commit 2f21075

Browse files
authored
Merge pull request #179 from QuantStrategyLab/fix/binance-reconciliation-artifact-retention
fix: align Binance reconciliation artifact retention
2 parents 72a2208 + e8ddc31 commit 2f21075

3 files changed

Lines changed: 11 additions & 2 deletions

File tree

.github/workflows/main.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,9 @@ jobs:
250250
name: binance-reconciliation-candidate-${{ github.run_id }}
251251
path: reports/binance-reconciliation-candidate.json
252252
if-no-files-found: error
253-
retention-days: 30
253+
# Repository policy caps Actions artifacts at seven days. Keep the
254+
# setting aligned so a successful read-only run is annotation-free.
255+
retention-days: 7
254256

255257
- name: 6. Notify Telegram on runtime workflow failure
256258
if: ${{ failure() && github.event.inputs.validate_only != 'true' && env.RUNTIME_TARGET_ENABLED == 'true' }}

docs/binance_reconciliation_recovery.zh-CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ workflow,并选择 `reconcile_only=true`。它运行独立的
1111
时间范围最多 24 小时,因此系统按不重叠的日窗口查询并去重;任一窗口达到 API 的 1,000 条
1212
上限时会失败关闭,而不会猜测分页而遗漏成交。它同时只读本地执行状态。账户
1313
UID、余额、订单和成交永不写入日志、报告或 artifact。artifact 只保留
14-
`binance_reconciliation_candidate.v1` 的摘要和稳定阻断码,保存 30 天。
14+
`binance_reconciliation_candidate.v1` 的摘要和稳定阻断码,保存 7 天。
1515

1616
若交易所未返回账户 UID、受管交易对未配置、任一读取失败、私有预期摘要不存在或任一摘要
1717
不一致,运行成功完成为“候选被阻断”,而不是重试、降级或恢复交易。

tests/test_runtime_workflow_security.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ def test_reconciliation_run_does_not_try_to_publish_a_regular_execution_report()
4444
assert "github.event.inputs.reconcile_only != 'true'" in log_job
4545

4646

47+
def test_reconciliation_artifact_retention_matches_repository_policy() -> None:
48+
workflow = WORKFLOW.read_text(encoding="utf-8")
49+
reconciliation_step = workflow[workflow.index(" - name: 5b. Retain redacted reconciliation candidate") :]
50+
51+
assert "retention-days: 7" in reconciliation_step
52+
53+
4754
def test_oidc_and_notification_workflows_pin_remote_actions() -> None:
4855
for path in (WATCHDOG_WORKFLOW, HEARTBEAT_WORKFLOW):
4956
workflow = path.read_text(encoding="utf-8")

0 commit comments

Comments
 (0)