Prominently flag when Fund ST gains exceed harvested losses - #69
Merged
Merged
Conversation
When the Fund over-generates short-term gains relative to the collateral's
harvested ST losses (common with a manual Fund amount set too high, or with
Fixed sizing as loss rates decay), the unmatched excess is taxed at ST
rates — the opposite of the strategy's intent. This was only lightly
colored before; now it's surfaced three ways in the Workspace:
- An always-visible red alert banner above the results (warning icon, peak
excess year + dollar amount, total unmatched, estimated ST tax cost, and
guidance to reduce the Fund or switch to Dynamic sizing)
- A dedicated entry in the flags tray ("Excess ST gains")
- The inline rail note under the manual amount turns red (danger) with a ⚠
- Per-year Year-by-Year "Net ST Offset" cells that exceed losses get a red
tint, bold, ▲ marker, and an explanatory tooltip (both orientations)
Detection is engine-derived (stGainsGenerated − stLossesHarvested over
active years, $1 floor so auto-sizing's cent-level match never trips it);
the estimated tax cost sums remainingStGainCost. No engine change.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S9oJbhvHXD2pJqwobUyxno
Deploying enhanceddirectindexingcalc with
|
| Latest commit: |
e66770a
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://9e31ec6d.enhanceddirectindexingcalc.pages.dev |
| Branch Preview URL: | https://claude-manager-name-anonymiz.enhanceddirectindexingcalc.pages.dev |
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
Follow-up to the manual-QFAF feature. When the Fund generates more short-term gains than the collateral harvests in losses, the unmatched excess is taxed at short-term rates — the opposite of the strategy's intent. That state was only lightly colored before; this makes it impossible to miss in the Workspace.
Two common triggers: a manual Fund amount set too high, or Fixed sizing as the collateral's loss rate decays over the years while the Fund is held constant.
What changed (all Workspace, additive)
Detection
Engine-derived, no engine change: for each active year,
stGainsGenerated − stLossesHarvested, with a $1 floor so auto-sizing's cent-level match never trips it (Dynamic stays silent). The estimated tax cost sums the existingremainingStGainCostfield.Testing
npm run build(tsc + vite) ✅, full suite 442/442 ✅, lint 0 warnings ✅,format:check✅.npm run dev: banner hidden on the Dynamic default; with a manual $3M amount it appears red (border-left: rgb(196,60,45)) reading "Fund ST gains exceed harvested losses by $4,050,000 in year 5 … About $9,656,850 of short-term tax…", the flags tray shows the new entry, and 5 Year-by-Year cells get the excess highlight.🤖 Generated with Claude Code
https://claude.ai/code/session_01S9oJbhvHXD2pJqwobUyxno
Generated by Claude Code