fix(bybit-options): pass SHADOW_SPOOL to the shadow gate receipt jq - #744
Conversation
The gate receipt jq program references $SHADOW_SPOOL in the service block, but the argument was never passed, so after a full passing 3600-second observation window the gate died with 'jq: $SHADOW_SPOOL is not defined' (exit 3) instead of writing its receipt. Host evidence: shadow gate run d9c9196ae1e14ee69749573c19762c62 on 2026-08-08, candidate 55664299, where the shadow collector itself collected and uploaded with verified OSS readback for the whole hour. Pass --arg SHADOW_SPOOL and add a contract assertion so the missing-arg class fails CI instead of the host gate.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
📝 WalkthroughWalkthroughThe shadow-gate script passes ChangesShadow-gate evidence generation
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
deployment/aliyun/test-bybit-options-shadow-gate.sh (1)
149-153: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winScope the contract assertion to the receipt
jqinvocation.
grep -Fqonly checks that the file contains this text. It can pass if the text appears in a comment or a different command. Check the evidence-generationjqblock, or stubjqand assert the recorded arguments.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@deployment/aliyun/test-bybit-options-shadow-gate.sh` around lines 149 - 153, Scope the assertion in the test around the receipt evidence-generation jq invocation rather than searching the entire shadow_gate file with grep. Stub or intercept jq and verify that the receipt jq call receives the SHADOW_SPOOL argument, ensuring comments or unrelated commands cannot satisfy the contract.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@deployment/aliyun/test-bybit-options-shadow-gate.sh`:
- Around line 149-153: Scope the assertion in the test around the receipt
evidence-generation jq invocation rather than searching the entire shadow_gate
file with grep. Stub or intercept jq and verify that the receipt jq call
receives the SHADOW_SPOOL argument, ensuring comments or unrelated commands
cannot satisfy the contract.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 350bcefa-963a-4438-a6f8-c3147650a25a
📒 Files selected for processing (2)
deployment/aliyun/host-bybit-options-shadow-gate.shdeployment/aliyun/test-bybit-options-shadow-gate.sh
Change contract
host-bybit-options-shadow-gate.shbuilds its final gate receipt with a jq program that references$SHADOW_SPOOLin the service block, but never passes--arg SHADOW_SPOOL. Result: after a full passing 3600-second observation window, the gate died withjq: $SHADOW_SPOOL is not defined(exit 3) instead of writing the receipt — the second never-executed-on-host startup defect in contract #4's scripts (the first was the deploy script'sreadonly SCRIPT_DIRordering, fixed in #742).Host evidence (gate run
d9c9196ae1e14ee69749573c19762c62, candidate55664299…, 2026-08-08 00:46–01:48 CST): the shadow collector ran the entire hour, collected symbols, and uploaded 2 segments to OSS with verified readback (uploaded=2,upload-onlyoneshot success) — only the receipt step failed.Issue relationship
None
Out of scope
Dependencies and merge order
None
Focused validation
--arg SHADOW_SPOOL "$SHADOW_SPOOL"precedes the jq program;bash -nclean.test-bybit-options-shadow-gate.shnow asserts the argument is passed (same literal-grep style as the existing host-script contract block) and passes;test-bybit-options-release-contract.shpasses;git diff --checkclean.Rollout and rollback
No production impact at merge. The fixed script ships to the host as deploy assets; the staged release
55664299…is re-installed with the new bundle (candidate-only, no production unit references it) and the 1-hour gate reruns. Rollback is revert.Scope exception
None
Summary by CodeRabbit
Bug Fixes
Tests