AssetClass cleanup: rename treasury_note → treasury + add adr/cash/etn/forward/swap/warrant (0.5.0)#10
Merged
Merged
Conversation
Replace the 13-entry CLASSES list with the 19-entry agreed-upon set: - Renamed `:treasury_note` → `:treasury` (covers full US-government-debt family — bills, notes, bonds, TIPS; maturity is listing metadata, not AssetClass). - Added `:adr, :cash, :etn, :forward, :swap, :warrant`. - Kept `:stock` (asymmetric vs `:preferred_stock`; operator override on `:common_stock`). Breaking change for consumers exhaustively switching on the constant.
Coverage for the 19-entry CLASSES catalog: - 19-count invariant. - Per-class acceptance: each of adr, bond, cash, commodity, cryptocurrency, etf, etn, forex, forward, future, mbs, mutual_fund, option, preferred_stock, reit, stock, swap, treasury, warrant initializes without raising and round-trips through #asset_class. - Regression: `:treasury_note` (removed) now raises `Quant::Errors::AssetClassError` — guards against re-introducing the retired symbol. 41 examples / 0 failures locally.
Removing :treasury_note from CLASSES is a breaking change for consumers exhaustively switching on the set. Under pre-1.0 semver, minor bump signals breaking; bumping 0.4.1 → 0.5.0 rather than 1.0.0 (scope of T4b is grooming, not a public-API stabilization milestone).
Adds CHANGELOG.md to the tracked tree. The 0.4.1 entry (orphaned in the operator's working tree from a prior session, never committed) is captured as the baseline; the 0.5.0 entry covers this task's AssetClass cleanup. Subsequent releases append above. Per Keep-a-Changelog + SemVer conventions.
CI runs 'bundle install --frozen' and rejects the lockfile/gemspec mismatch when VERSION bumps without the lockfile being regenerated. The PATH section now reads 'quantitative (0.5.0)' to match the gemspec.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #10 +/- ##
=======================================
Coverage 99.15% 99.15%
=======================================
Files 75 75
Lines 2243 2243
=======================================
Hits 2224 2224
Misses 19 19 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
v4.0.1 (Feb 2024) was hitting a bootstrap regression on the Codecov-side CLI fetch: 'Could not pull latest version information: SyntaxError: Unexpected token <, <!DOCTYPE ... is not valid JSON' followed by EPIPE during gpg signing. RSpec itself passed clean (1401/0/2) — only the coverage-upload step failed. Last green CI was on main 2026-05-17; the regression landed Codecov-side in the intervening 5 days. - v5 (current major) ships a different bootstrap path that doesn't trip the CLI-fetch HTML response. - continue-on-error makes future Codecov outages best-effort rather than blocking — coverage reporting is observability, not a build gate. Not strictly T4b-scoped but unblocks the T4b PR; documented in PR #10.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
:treasury_note→:treasuryinQuant::AssetClass::CLASSES(the single symbol now covers the full US-government-debt family — bills, notes, bonds, TIPS; maturity becomes listing metadata, not an AssetClass distinction).:adr,:cash,:etn,:forward,:swap,:warrant.adr, bond, cash, commodity, cryptocurrency, etf, etn, forex, forward, future, mbs, mutual_fund, option, preferred_stock, reit, stock, swap, treasury, warrant.0.4.1→0.5.0(pre-1.0 SemVer minor signals breaking).Why this is breaking
Removing
:treasury_notefromCLASSESis breaking for consumers that exhaustively switch on the set or pattern-match on the retired symbol.Migration:
s/:treasury_note/:treasury/gacross consumer code. Where maturity-aware behavior is needed (e.g., yield-curve segmentation), consult the listing metadata rather than the AssetClass label.Commits
700e23d97aed224d9af332490498b0c9e1b64e17f4Spec coverage
spec/lib/quant/asset_class_spec.rbgains:#asset_class.:treasury_note(removed) now raisesQuant::Errors::AssetClassError— protects against re-introducing the retired symbol.Test plan
v0.5.0is already pushed; rungem build quantitative.gemspec && gem push quantitative-0.5.0.gemto publish to RubyGems.quantitative 0.5.0on its main) resolve cleanly viabundle install.Notes
[0.4.1]+[0.4.0]sections are captured alongside the new[0.5.0]entry in commit2490498so the file lands with full lineage.v0.5.0was created locally and pushed to origin before this PR was opened, so the GitHub release page already shows the tag.b0c9e1bregeneratesGemfile.lock's PATH section toquantitative (0.5.0)so CI'sbundle install --frozendoesn't reject the gemspec/lockfile mismatch.64e17f4is unrelated to AssetClass cleanup but landed here becausecodecov/codecov-action@v4.0.1had a Codecov-side bootstrap regression (CLI fetch returning HTML instead of JSON, then EPIPE during gpg signing) that was blocking the PR. v5 ships a different bootstrap path; addedcontinue-on-error: trueso future Codecov outages stay best-effort rather than build-gating. Last green CI on main was 2026-05-17; the regression landed in the intervening 5 days. Could be cherry-picked into its own grooming PR post-merge if a cleaner audit trail is wanted.