Add manual QFAF dollar amount with explicit ST offset-gap reporting - #68
Merged
Merged
Conversation
Advisors can now enter an exact QFAF position alongside a fixed collateral amount instead of relying on auto-sizing, and see by how much the two fail to offset: - New 'Manual amount' sizing option in the Workspace rail and a 'Manual $' radio in the Classic calculator, both exposing the existing qfafOverride input (seeded from the current auto-sized value) - A manual amount is exact: the sizing cushion no longer shaves it, and dynamic yearly resizing never replaces it (core + sensitivity mirrored) - Offset-gap readout under the Workspace input (excess ST gains taxed / excess ST losses carried), reusing the SizingSummary Net ST Position row in Classic - New per-year 'Net ST Offset' column/row in ResultsTable (both orientations) with popup entries; Excel assumptions sheet reports the sizing mode - 6 new engine tests covering exactness, fixed hold, dynamic-override precedence, both gap directions, and total-budget allocation Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S9oJbhvHXD2pJqwobUyxno
Deploying enhanceddirectindexingcalc with
|
| Latest commit: |
d648ecc
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://1e85e6e8.enhanceddirectindexingcalc.pages.dev |
| Branch Preview URL: | https://claude-manager-name-anonymiz.enhanceddirectindexingcalc.pages.dev |
The dark-theme navigation test asserted visibility of the first .year-breakdown-table, which since the mobile redesign is the mobile copy of the audit table — hidden on desktop and behind a closed disclosure on mobile. It now asserts the project-appropriate wrapper (desktop table, or mobile detail panel + opened disclosure). The mobile-drawer test edited income $3M→$4M and expected total savings to change, but at $3M income the NOL is already fully consumed (80% x income exceeds it), so the totals are identical — verified with equal engine outputs. The test now edits collateral, which always rescales savings. Product code was correct; both were test-only fixes. Logged as bug #10 in docs/DECISIONS.md. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S9oJbhvHXD2pJqwobUyxno
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
Advisors can now enter an exact QFAF dollar amount alongside a fixed collateral amount, instead of relying on auto-sizing — and the app explicitly shows by how much the QFAF ST gains and collateral ST losses fail to offset at that level.
What changed
Inputs (both surfaces)
Manual $X.qfafOverrideengine input (already CSV round-tripped), so no new serialization surface.Engine semantics (one-engine rule preserved —
calculate()only)sizing.ts).isDynamicnow requiresqfafOverride === undefined, mirrored identically incore.tsandsensitivity.ts.solveCollateralForTotalalready allocatedtotal − overrideto collateral (unchanged, now tested).Offset-gap visibility
ST gains − ST lossesper year, colored by direction. Derived from already-surfaced engine fields.qfaf-manual-amountandcol-net-st-offsetentries;auto-sized-qfaf/net-st-positionupdated (audit-complete directive).Manual ($X)/ Dynamic / Fixed).All new user-visible strings route through
brandText()so they respect the public-anonymization toggle ("Fund"/"Manager" by default).Testing
npm run build, lint (0 errors), andformat:checkclean.npm run devon both surfaces: manual option appears, seeds correctly, gap note updates in both directions ($1M manual vs $1.65M losses → $150K gap ✓), switching back to Dynamic clears the override, and Classic shows "Net ST Position $900,000 excess ST losses" for a $500K manual amount ✓.🤖 Generated with Claude Code
https://claude.ai/code/session_01S9oJbhvHXD2pJqwobUyxno
Generated by Claude Code