Skip to content

examples: synergy_market.py (anomalyx + agent-calc)#67

Merged
copyleftdev merged 1 commit into
mainfrom
example-synergy-market
Jun 2, 2026
Merged

examples: synergy_market.py (anomalyx + agent-calc)#67
copyleftdev merged 1 commit into
mainfrom
example-synergy-market

Conversation

@copyleftdev

Copy link
Copy Markdown
Owner

Adds examples/synergy_market.py — a worked example chaining two contract-first CLIs on the live market through their typed JSON envelopes:

  • anomalyx (descriptive, assumption-free) finds the anomalous trading days and the price regime shift — point.modz / mv.mahalanobis / coll.cusum.
  • agent-calc (exact) then computes deterministic statistics on those findings:
    • describe_sample — the return distribution (its fat-tailed kurtosis is the story);
    • normal_cdf — the worst day's tail probability under a fitted Gaussian (routinely "1-in-millions", i.e. the model is what's broken, not the market);
    • two_sample_t — a Welch test across the detected CUSUM break (is it a real shift in mean return, or only in trajectory?);
    • correlation — exact Pearson r of each basket name to the market proxy.

The point of the pairing: both halves emit machine-readable contracts, so the detector's output feeds the math kernel with no prose and no float drift.

Read-only public data (yfinance), no API key. Lives outside the Cargo workspace (shells out to the anomalyx and agent-calc binaries via $ANOMALYX / $AGENT_CALC), so no build or gate impact. examples/README.md and CHANGELOG.md updated.

🤖 Generated with Claude Code

Chains two contract-first CLIs through their typed JSON envelopes on the live
market: anomalyx finds the anomalous days and the price regime shift
(point.modz / mv.mahalanobis / coll.cusum), then agent-calc computes exact
statistics on those findings — describe_sample (fat-tailed kurtosis), the worst
day's tail probability under a fitted Gaussian (normal_cdf), a two-sample Welch
t-test across the detected CUSUM break, and exact Pearson r of each basket name
to the market.

Read-only public data (yfinance), no key. Lives outside the Cargo workspace
(shells out to both binaries), so no build or gate impact.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 2, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@copyleftdev, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 2 minutes and 2 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 22560ea6-247c-4343-8c23-5ea07f11944c

📥 Commits

Reviewing files that changed from the base of the PR and between e2db91d and 9946b51.

📒 Files selected for processing (3)
  • CHANGELOG.md
  • examples/README.md
  • examples/synergy_market.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch example-synergy-market

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@copyleftdev copyleftdev merged commit 9130a57 into main Jun 2, 2026
2 checks passed
@copyleftdev copyleftdev deleted the example-synergy-market branch June 2, 2026 02:27
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