Skip to content

AssetClass cleanup: rename treasury_note → treasury + add adr/cash/etn/forward/swap/warrant (0.5.0)#10

Merged
mwlang merged 6 commits into
mainfrom
T4b-asset-class-cleanup
May 23, 2026
Merged

AssetClass cleanup: rename treasury_note → treasury + add adr/cash/etn/forward/swap/warrant (0.5.0)#10
mwlang merged 6 commits into
mainfrom
T4b-asset-class-cleanup

Conversation

@mwlang

@mwlang mwlang commented May 22, 2026

Copy link
Copy Markdown
Owner

Summary

  • Renames :treasury_note:treasury in Quant::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).
  • Adds six new entries: :adr, :cash, :etn, :forward, :swap, :warrant.
  • Final 19-entry catalog (alphabetical): adr, bond, cash, commodity, cryptocurrency, etf, etn, forex, forward, future, mbs, mutual_fund, option, preferred_stock, reit, stock, swap, treasury, warrant.
  • Version bump 0.4.10.5.0 (pre-1.0 SemVer minor signals breaking).

Why this is breaking

Removing :treasury_note from CLASSES is breaking for consumers that exhaustively switch on the set or pattern-match on the retired symbol.

Migration: s/:treasury_note/:treasury/g across consumer code. Where maturity-aware behavior is needed (e.g., yield-curve segmentation), consult the listing metadata rather than the AssetClass label.

Commits

SHA Subject
700e23d T4b: AssetClass::CLASSES cleanup
97aed22 T4b: AssetClass specs for cleanup
4d9af33 T4b: version bump to 0.5.0
2490498 T4b: CHANGELOG — 0.5.0 entry + baseline capture
b0c9e1b T4b: regenerate Gemfile.lock for quantitative 0.5.0
64e17f4 ci: bump codecov-action v4.0.1 → v5 + continue-on-error

Spec coverage

spec/lib/quant/asset_class_spec.rb gains:

  • 19-count invariant assertion.
  • Per-class acceptance: each of the 19 catalog entries initializes without raising and round-trips through #asset_class.
  • Regression guard: :treasury_note (removed) now raises Quant::Errors::AssetClassError — protects against re-introducing the retired symbol.

Test plan

  • Local suite: 1401 examples / 0 failures / 2 pending on this branch tip.
  • After merge: tag v0.5.0 is already pushed; run gem build quantitative.gemspec && gem push quantitative-0.5.0.gem to publish to RubyGems.
  • After publish: downstream consumers (virtuoso pinned to quantitative 0.5.0 on its main) resolve cleanly via bundle install.

Notes

  • CHANGELOG.md is added in this PR; the file existed locally untracked from a prior session (the 0.4.1 entry documented the float-volume regression fix). The baseline [0.4.1] + [0.4.0] sections are captured alongside the new [0.5.0] entry in commit 2490498 so the file lands with full lineage.
  • Tag v0.5.0 was created locally and pushed to origin before this PR was opened, so the GitHub release page already shows the tag.
  • b0c9e1b regenerates Gemfile.lock's PATH section to quantitative (0.5.0) so CI's bundle install --frozen doesn't reject the gemspec/lockfile mismatch.
  • 64e17f4 is unrelated to AssetClass cleanup but landed here because codecov/codecov-action@v4.0.1 had 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; added continue-on-error: true so 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.

mwlang added 5 commits May 21, 2026 23:02
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

codecov Bot commented May 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.15%. Comparing base (98173af) to head (64e17f4).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.
@mwlang
mwlang merged commit a519301 into main May 23, 2026
5 checks passed
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