Skip to content

test(quota): gate the capture-failure case on private capture support - #9559

Open
gcl-coder wants to merge 1 commit into
loopx-project:mainfrom
gcl-coder:codex/capture-failure-test-guard
Open

gcl-coder wants to merge 1 commit into
loopx-project:mainfrom
gcl-coder:codex/capture-failure-test-guard

Conversation

@gcl-coder

Copy link
Copy Markdown
Contributor

Goal And Delivered Outcome

Author Declaration

Written by: model_agent (GPT family, OpenAI) working from the post-merge native Windows evidence on #9490.

Implemented against

  • docs/reference/required-work-context.md section "Bounded settlement results": a host without private capture keeps the evaluated result inline, adds result_delivery_error (quota_decision_capture_unsupported), and lets the evaluated outcome decide the exit code. The Chinese half states the same contract.
Criterion Disposition Symbol / path Test or command
The privacy-failure case runs only where chmod can revoke capture implemented tests/control_plane/test_refresh_settle_turn.py test_receipt_capture_failure_keeps_committed_receipts_and_exact_retry
Unsupported capture keeps cross-platform coverage preserved test_composed_settlement_keeps_commit_when_private_capture_is_unsupported already selected in the native Windows workflow

Validation

  • python3 -m pytest tests/control_plane/test_refresh_settle_turn.py -q -k "receipt_capture_failure and file or composed_settlement and file" -> 2 passed on this POSIX host.
  • SQLite variants on this host are blocked by the unqualified local SQLite 3.49.1 driver; clean main fails the same way. The file provider covers the changed test body.
  • Native Windows was not re-run here; the Windows report that motivated this change is the evidence for the gap.

Risks

  • Test-only; no production behavior changes and no exit-code change.
  • Windows no longer attempts a case it cannot simulate. The cross-platform unsupported-capture contract remains covered and is selected in the Windows workflow.
  • The two exit codes for "settled but no bounded receipt" stay intentional: result_delivery_error.error_code distinguishes quota_decision_capture_unsupported (exit 0) from a transport failure (nonzero), as the required-work context documents.

Checklist

The regression models a POSIX privacy failure by loosening directory mode bits, which Windows cannot enforce, so the composed settlement correctly returns its unsupported-capture result and the test's nonzero-exit premise cannot hold. Skip the case where private capture is unavailable; the cross-platform unsupported contract remains covered by test_composed_settlement_keeps_commit_when_private_capture_is_unsupported. Refs loopx-project#9398.

Signed-off-by: ChengLong GU <88359731+gcl-coder@users.noreply.github.com>
@gcl-coder

Copy link
Copy Markdown
Contributor Author

补一条独立验证记录,供后续评审参考。

9559 的 CI 状态:最新 head 06af05e30 上 9 项检查通过、11 项跳过,唯一失败是 kernel-contracts(Type-check kernel contracts 步骤)。同一时段的 #9521 / #9522 / #9523 都是同一个 kernel-contracts: failure,日志里的首条报错在 loopx/capabilities/value_connectors/planner.py 等与本次测试改动无关的文件;本分支相对 main 只改一个测试文件的 10 行。属仓库既有失败。

本地结果:POSIX 上 tests/control_plane/test_refresh_settle_turn.py 非 SQLite 变体 39 passed / 5 skipped / 40 deselected,其中 test_receipt_capture_failure_keeps_committed_receipts_and_exact_retry[file] 仍走原来的失败路径。SQLite 变体因本机 SQLite 3.49.1 未资格化无法启动,干净 main 同样失败,与改动无关。

关于双退出码:#9490 的取舍是有意的——capture 不支持时 result_delivery_error.error_code=quota_decision_capture_unsupported 且退出 0,capture 传输失败时非零。docs/reference/required-work-context.md 的中英两段都写明了这一点,宿主按 error_code 区分。本 PR 只把这个无法在 Windows 复现的用例改为跳过,不改行为。

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant