Skip to content

Prominently flag when Fund ST gains exceed harvested losses - #69

Merged
HouseofTyrell merged 1 commit into
mainfrom
claude/manager-name-anonymization-c5puc7
Jul 23, 2026
Merged

HouseofTyrell merged 1 commit into
mainfrom
claude/manager-name-anonymization-c5puc7

Conversation

@HouseofTyrell

Copy link
Copy Markdown
Owner

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)

  • Always-visible red alert banner above the results (not tucked in the flags tray): warning icon + peak excess year and dollar amount, total unmatched across years, estimated ST tax cost, and guidance ("Reduce the Fund size or use Dynamic sizing").
  • Flags-tray entry ("Excess ST gains") so it's also captured in the consolidated attention list and dot summary.
  • Inline rail note under the manual amount now turns red (danger) with a ⚠ prefix in the excess direction (was amber).
  • Year-by-Year "Net ST Offset" cells that exceed losses get a red tint, bold, ▲ marker, and tooltip — in both the rows and transposed orientations.

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 existing remainingStGainCost field.

Testing

  • npm run build (tsc + vite) ✅, full suite 442/442 ✅, lint 0 warnings ✅, format:check ✅.
  • Playwright-verified against 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

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
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying enhanceddirectindexingcalc with  Cloudflare Pages  Cloudflare Pages

Latest commit: e66770a
Status: ✅  Deploy successful!
Preview URL: https://9e31ec6d.enhanceddirectindexingcalc.pages.dev
Branch Preview URL: https://claude-manager-name-anonymiz.enhanceddirectindexingcalc.pages.dev

View logs

@HouseofTyrell
HouseofTyrell merged commit d033eb3 into main Jul 23, 2026
2 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.

2 participants