CapStackGP
Engineering & Assurance
← Back to App

Deconstruct the Guts

Functional, technical, security, privacy, and operational specification for CapStack GP as shipped today. Stats, function counts, and line metrics are computed on load from /index.html and /welcome.html. Narrative sections below were verified on 2026-10-08 against commit 9979de3 (committed 2026-10-07): schema 1.4, financial engine, Rule of 40, Excel import, screener, Vercel routes, APIs, agent service, tests, and CI. Architecture diagrams are shown as auditable Mermaid notation; this same-origin page intentionally executes no third-party diagram code.
Live — analyzed from source Analyzing... Schema v1.4
Local-first by design. Ordinary edits and calculations run in the browser and do not send model state to CapStack APIs. Network calls are limited to explicit, user-initiated actions (feedback, survey, optional screener and agent URLs). For data-classification guidance and operating conditions, see the Safety & Operations tab.
01 What is CapStack GP?
A single-user, offline-first browser tool for venture capital GPs and Partners to model exit waterfall scenarios, ownership dilution, and fund-level MOIC on company cap tables.
Product Identity
Purpose
Pre-decision modeling for GPs evaluating term sheets, exit scenarios, and fund returns
Target User
Venture capital General Partners, Managing Directors, Partners, Principals
Value Proposition
Run pre-decision exit, dilution, and fund-return scenarios in the browser without creating an account. “Local-first” describes the core modeling data flow; it is not a claim that the hosted page is offline, immutable, or risk-free.
Live URL
Canonical host is www.capstack.space (apex still serves). All public pages set rel=canonical on the www host.
Pricing
Modeling app: free, no auth, no paywall. Website embed: free tier shows CapStack attribution; a premium tier is planned and not yet offered. The optional remote agent must be deployed and governed by its operator.
Data plane
Core model state persists in localStorage; JSON and Excel imports are parsed in-browser. Ordinary modeling makes no model-data POST. Network-capable exceptions are explicit: feedback text → POST /api/feedback; survey answers → POST /api/survey-waterfall-pain; a job description → a screener URL the user supplies; and the complete model plus question → an optional agent URL the user saves. Page loads still contact Vercel, Vercel Web Analytics, and Google Fonts. See the Assurance tab for the complete inventory.
02 Feature Map
Every feature in the app, organized by input/output/utility category.
Input Pages
PagePurposeKey Fields
Assumptions47 discrete model assumptions across 6 domainsOption pool, vesting, anti-dilution, carry structure, governance
Company & FundCompany identity + fund economicsName, stage, jurisdiction, fund size, carry %, hurdle, fees
Capital StructureShareholders, financing rounds, convertiblesSecurity type, shares, OIP, pref multiple, seniority, vesting
Exit ScenariosMultiple exit price scenarios + dividend/note as-of yearLabel, total proceeds ($M), notes, exitP.asOfYear
Output Pages
PageOutputVisualization
Cap TableIssued FD vs as-converted FD + liquidation overhangData table + Ownership grid; dual-FD copy in BLUF
WaterfallProceeds allocation per scenario, including converted syntheticsSVG curve + crosshair tooltip + bars
DecayInvestor dilution across rounds, optional pro-rata overlayHiDPI canvas line chart
Fund MOICSimplified single-deal return proxy: aggregates every holder marked investor against one fund investment, then estimates hurdle, carry, and management-fee dragHiDPI canvas + metric cards
Utilities
FeatureDescription
Glossary112 searchable, categorized VC terms with plain-English definitions
AI PromptsCopy-paste research prompts plus on-device Model BLUF & Ask (modeled numbers, not an LLM). Optional self-hosted agent-service is operators-only.
BLUF PanelsBottom-Line-Up-Front summaries, copy-to-clipboard for IC memos
JSON I/OImport/Export portable model files; schema 1.4 (writes ran, Rule of 40 state, and written claims). JSON import resets ran and asks you to ▶ Run Model.
Excel I/OClient-side .xlsx / .xlsm import (zip + DecompressionStream, no CDN). Drag-drop, mapping UI, ?import=xlsx|excel|1. Workbook never uploaded.
Rule of 40 / XScenario planner projects ARR and EV/revenue bands; shared standalone calculator uses rule-of-40.js. Results can be added to exit scenarios.
Written claimsRecords a stated ownership percentage and as-of date for later reconciliation; it does not override computed ownership.
FeedbackFAB → sanitize/redact → /api/feedback → private Blob + Slack; public summaries at /feedback
Print / Undo / ThemePrint CSS for Cap Table + Waterfall + Fund MOIC, Ctrl+Z (50-deep), dark/light with system preference + localStorage
Site surfaces (not in the app shell)
URLWhat it is
/welcomeShort GP landing. Linked from the app as Overview. Opt-in via ?welcome=1 / #welcome. Rewrite /welcome → welcome.html.
/whyWhy CapStack exists. Linked from welcome and /i.
/faqUser-facing Q&A aligned to the shipped engine (faq.html + faq.md).
/privacy, /termsPrivacy and terms. Linked from welcome.
/demoPublic walkthrough + social unfurl (/demo/social).
/demo/excel-ingestExcel import walkthrough. Aliases: /demo/onboarding/excel/ingest/sample.
/embed/*Fictional $3B-AUM waterfall dashboard, snippet loader, visual generator. Not your model data.
/iScript-free quick-link hub. Rewrite also serves /i without trailing slash.
/feedbackPublic AI/extractive summaries only. Noindex. Full text stays private.
/survey/waterfall-painInstant survey (answers only). Noindex. UTM redirect if utm_campaign is missing.
/rule-of-40, /rule-of-40-explainedStandalone calculator and explanation using shared rule-of-40.js math.
/screenerLocal-first analyst/engineer candidate screens. Candidate names, answers, ratings, notes, and a SHA-256 PIN hash persist in browser storage. The PIN is a convenience gate for shared screens; use a dedicated device for live screens.
03 User Flow
The critical path from first visit to usable output.
flowchart LR
  A["/"] -->|index.html| C[Modeling app]
  C -->|no saved model| D[Demo data seeded]
  C -->|saved model| E[Hydrate schema 1.4]
  A -->|Overview / ?welcome=1| B[welcome.html]
  A -->|?import=xlsx| XL[Excel importer]
  B -->|CTA ?app=1| C
  D --> F{User Action}
  E --> F
  XL --> F
  F -->|Add/Edit| G[Shareholders\nRounds\nConvertibles]
  F -->|Configure| H[47 Assumptions\nCompany & Fund\nExit Scenarios]
  F -->|"▶ Run Model"| I[Engine]
  G --> I
  H --> I
  I --> J[recalcAntiDilution]
  J --> K[convertInstruments]
  K --> L[computeWaterfall ≤10 iter]
  L --> M[Cap Table / Curve / Decay / MOIC]
  M --> N[BLUF / Print / JSON]
  C -->|FAB| O[POST /api/feedback]
  C -->|optional| P[agent-service]

  style A fill:#d4a843,color:#0d0f14,stroke:none
  style I fill:#4dd4a0,color:#0d0f14,stroke:none
  style N fill:#5b9cf0,color:#0d0f14,stroke:none
  style O fill:#a06df0,color:#0d0f14,stroke:none
      
Step-by-Step
App loads at / — There is no first-visit redirect to marketing. welcome.html is opt-in (Overview link, ?welcome=1, or #welcome). Bookmarks use index.html?app=1, which sets cs-visited=1 and lands on Assumptions once per tab (sessionStorage cs-app1-tab). ?import=xlsx opens the Excel importer.
Hydrate or seed — loadSaved() restores capstack-gp-model (schema 1.4). Restores source.ran; if missing, infers ran when the last session page was an output view. Missing exitP.asOfYear defaults to the current year. If nothing is saved, demo holders + two rounds are seeded.
Configure inputs — Shareholders (incl. accel override, pro-rata, per-series issueYear, per-holder capMul), rounds, convertibles (optional convertAs), 47 assumptions (13 demoted keys are disabled), company/fund, exit scenarios + as-of year.
Run Model — ▶ Run Model calls recalcAntiDilution(), then the pure waterfall engine (synthetics + iterated conversion). Allocations are derived, never stored. S.ran is persisted so outputs re-render on reload. Navigates to Waterfall.
Analyze outputs — Cap Table (issued FD vs as-converted FD), SVG waterfall curve (crosshair), canvas Decay / Fund MOIC, BLUF copy. AI Prompts are copy-paste; Model BLUF & Ask run on-device from modeled numbers unless an operator saves a reachable self-hosted agent URL.
Iterate, export, or feedback — Dirty-state “rerun” indicator. JSON import/export (import resets ran). Excel import stays local. Print (Cap Table, Waterfall, Fund MOIC). Feedback FAB posts a sanitized message to /api/feedback (not the cap table).
04 The 47 Assumptions
The UI ships 47 assumption rows: domain counts 8+11+7+9+6+6. D2’s 11 includes numeric a10b (dividend rate), not an extra 48th row. DEFAULTS also has a19 outside the 47-row UI. Eight keys in DEMOTE_KEYS (a17, a22, a23, a28–a30, a33, a34) remain visible but have no direct engine effect. Domain cards below are parsed from ASSUMPTION_DOMAINS in live source when analysis succeeds.
pie title Assumptions by Domain
  "D1 — Share Count & Dilution" : 8
  "D2 — Preferred Stock Terms" : 11
  "D3 — Convertible Instruments" : 7
  "D4 — Exit Event" : 9
  "D5 — Fund-Level" : 6
  "D6 — Operational & Governance" : 6
      
05 Data Model (State Schema)
The entire app state lives in a single global object S. Allocations and charts are never persisted — they recompute from source when S.ran is true. Schema 1.4 stores that boolean (and session page/theme) so returning GPs see outputs after reload. Source state also includes Rule of 40 inputs and written ownership claims.
erDiagram
  STATE ||--|| ASSUMPTIONS : contains
  STATE ||--|| COMPANY : contains
  STATE ||--|| FUND : contains
  STATE ||--o{ SHAREHOLDER : has
  STATE ||--o{ ROUND : has
  STATE ||--o{ CONVERTIBLE : has
  STATE ||--|| EXIT_PARAMS : contains
  STATE ||--o{ EXIT_SCENARIO : has
  STATE ||--|| RULE40 : contains
  STATE ||--o{ WRITTEN_CLAIM : records
  STATE {
    boolean ran "Outputs eligible to re-render"
    int nid "Next unique ID"
  }

  ASSUMPTIONS {
    string uiRows "47 ASSUMPTION_DOMAINS items"
    number a10b "D2 dividend percent, 1 of 47"
    string a19 "in DEFAULTS only, hidden from UI"
    string defaults "built-in enum and number defaults"
  }
  COMPANY {
    string name "Acme Technologies, Inc. (fictional sample)"
    string stage "series-a"
    string jur "delaware"
    int yr "2021"
    int authC "Authorized common"
    int authP "Authorized preferred"
  }
  FUND {
    string name "Fund LP name"
    number size "$M committed"
    number carry "Carry %"
    number hurdle "Hurdle rate %"
    number fee "Mgmt fee %"
    number gp "GP commit %"
    number inv "Investment per deal $M"
    number period "Investment period years"
    number life "Total fund life years"
  }
  SHAREHOLDER {
    int id "Unique ID"
    string name "Holder name"
    string role "founder/investor/employee/advisor"
    string type "common/preferred/option/rsu/warrant"
    int shares "Share count"
    string series "Seed/A/B/C"
    number oip "Original issue price"
    number prefMul "Preference multiple"
    string part "none/full/capped"
    number capMul "Per-holder participation cap x OIP"
    int sen "Seniority level"
    number strike "Strike price"
    int vest "Vested %"
    string color "Hex color"
    number convR "Conversion ratio (anti-dilution)"
    int issueYear "Pref issue year"
    string accelOverride "Per-holder accel policy"
    boolean proRata "Investor follow-on rights"
  }
  ROUND {
    int id "Unique ID"
    string name "Round name"
    number preMoney "Pre-money valuation"
    number inv "Investment amount"
    number postMoney "Post-money valuation"
    number pool "Option pool expansion"
    string date "ISO date"
    string lead "Lead investor"
  }
  CONVERTIBLE {
    int id "Unique ID"
    string type "safe or note"
    string investor "Investor name"
    number amount "Principal dollars"
    number cap "Valuation cap dollars, UI enters millions"
    number disc "Discount 0-1, UI enters percent"
    number interest "Interest 0-1, UI enters percent"
    string dayCount "Optional override, else a25"
    string convertAs "Override a24: pref/common/cash"
    int sen "Optional seniority override"
    string issueDate "ISO date"
    string maturity "Notes only"
  }
  EXIT_PARAMS {
    number fees "Transaction fees %"
    number escrow "Escrow holdback %"
    number debt "Outstanding debt $M"
    number ret "Retention/earnout $M"
    int asOfYear "Dividend / note accrual end year"
  }
  EXIT_SCENARIO {
    int id "Unique ID"
    string label "Scenario name"
    number proceeds "Total proceeds $M"
    string notes "Description"
  }
  RULE40 {
    number arr "Current ARR $M"
    number yrs "Years to exit"
    boolean weighted "1.33g + 0.67m mode"
    number gx "Rule of X growth multiplier"
    array profiles "Growth/margin cases"
  }
  WRITTEN_CLAIM {
    int id "Unique ID"
    string date "Claim date"
    string text "Free-form statement parsed into a percent series"
  }
      
06 Known Limitations (v1)
Gaps that are documented and intentional. Matches /faq and the shipped capstack-app.js engine — not the May 2026 guts-page snapshot.
LimitationWhat the engine actually does
American (deal-by-deal) carryEuropean waterfall math is the supported computation. Do not use the output as an American-carry or clawback model.
Cap table vs waterfall FDUI labels issued FD vs as-converted FD (issued + converting instruments via getExitIdentity()). Waterfall claim% is post-election residual weights — a third number. Do not paste one unlabeled FD% into a memo.
SAFE / note conversionConverted at exit (cap, discount, note interest) when caps/rounds allow. Per-instrument convertAs overrides a24 (pref / common / cash). Banner when convertibles are present; flagged if conversion cannot be computed.
Anti-dilutionrecalcAntiDilution() runs before outputs from down-round history. Global defaults support none / BBWA / NBWA / full ratchet, with a per-holder override and carve-out handling. It is not a complete legal interpretation of financing documents.
Conversion electionsIterated up to 10 passes near breakevens (electionConverged flag). Capped participation uses per-holder capMul (else a12) and redistributes surplus in up to 20 inner passes.
Proceeds conservationIdentity is day-1 allocs + escrow + fees + debt + retention + unallocated = gross. UI warns if |unallocated| > $1.
Demoted assumptionsEight DEMOTE_KEYS (a17, a22, a23, a28–a30, a33, a34) are disabled and have no direct engine effect.
Escrow and mixed considerationPreferences run on the full post-deduction equity pot; escrow is then split from each equity allocation as a holdback. It is not an NVCA two-pass Additional Consideration re-run. The waterfall curve’s “preference covered” annotation still grosses up for escrow and may not align with the allocation engine. Stock scenarios may apply the configured haircut; probability-weighted earnout adds earnout × probability.
Rule of 40 / XConstant growth and midpoint multiple projections are scenario-generation aids, not valuations. Rule of X ranks profiles but has no published pass/fail cutoff in this implementation.
Fund return outputAll holders marked investor are attributed to one fund; holders are not linked to a specific fund. Full-fund management fees are applied to one deal, and the hurdle uses total fund life. Treat this as a directional deal-return proxy, not a European fund waterfall or administrator-grade fund model. “Top quartile” labels are internal heuristics, not benchmark evidence.
Conversion electionsThe engine iterates, but non-participating preferred holders are evaluated sequentially. Near a conversion boundary, record order can change elections and allocations even when electionConverged is true.
Historical replayAnti-dilution and decay start from the current cap table and replay entered rounds; they do not reconstruct dated historical cap tables. Results can double-count issuance or depend on present-day unrelated shares. The pro-rata overlay is an approximation and does not guarantee exact ownership maintenance.
Assumption coverageEight controls are explicitly demoted. Additional enabled keys without direct dollar-engine consumption include a1, a2, a8, a15, a36, a38, a39, a41, and a42–a47; some drive warnings/UI only. In particular, authorized-share “enforcement” (a45) warns rather than blocking issuance. Verify code consumption before relying on any assumption.
Schema and importschema_version is recorded but not enforced through a migration/compatibility layer. JSON import is not transactional and does not fully reject duplicate IDs, malformed arrays, invalid enums, or negative/nonnumeric values.
Convertible and option approximationsAn unpriceable convertible can be omitted while other instruments continue. SAFE denominators/latest PPS are reconstructed approximations. Double-trigger awards accelerate at exit without a termination condition, and treasury-method PPS is bootstrapped rather than solved iteratively.
Excel defaults and unitsImport warnings do not block commit. Missing security type may default to common; missing preferred terms receive defaults; unreadable shares can become zero after warning. Small exit values may be interpreted as already denominated in millions. Review every mapping and preview.
Exotic termsSide letters, MFN stacks, pay-to-play are not a complete legal model. Flags cover some issues (full ratchet, participating pref, preference overhang, low GP commit).
01 Live Codebase Analysis
These metrics are computed in real-time by fetching and analyzing the deployed source files on page load.
—
Total Lines
—
JS Functions
—
CSS Lines
—
welcome.html Lines
—
HTML Tags
—
DOM IDs
—
Glossary Terms
—
Model Assumptions
ℹ All stats above are live. They're recomputed on every page load by fetching /model, /capstack-app.js, /capstack.css, and /welcome.html from the same origin and parsing them in-browser.
02 Architecture Overview
How the shell, stylesheet, and classic script fit together.
flowchart LR
  A[index.html] --> B[capstack.css + capstack-app.js]
  B -->|model + ran| D[localStorage]
  A -->|POST| F["/api/feedback"]
  F --> G[Vercel Blob private]
  F --> H[Slack]
  F -.-> I[AI Gateway summarize]
  A -.-> J[optional agent-service]
  SUR["/survey/waterfall-pain"] -->|POST| SP["/api/survey-waterfall-pain"]
  SP --> G
  MANUAL["authorized manual call"] --> WO["/api/weekly-ops"]
  K[Static pages] --> E[Vercel CDN]
  K --- L[welcome / why / faq / privacy / terms / demo / survey / embed / screener / Rule of 40 / i / feedback]
  E --> M[www.capstack.space]
  A --> E
  F --> E
  WO --> E

  style A fill:#d4a843,color:#0d0f14
  style D fill:#4dd4a0,color:#0d0f14
  style F fill:#a06df0,color:#0d0f14
  style M fill:#4dd4a0,color:#0d0f14
      
Architecture Decisions
Why a single HTML file with no framework?
The modeling app is still ~10 views, no user accounts, and no required backend. One file means zero build step for the calculator, works after first load without a server, and deploys as static HTML. The site around it now has extra static pages plus Vercel Functions for feedback, the waterfall-pain survey, and an authorized weekly-ops endpoint. No Vercel cron is configured in the current vercel.json; a scheduled GitHub production smoke still runs Mondays. The calculator does not need those functions to run.
Why no React/Vue/Svelte?
The DOM is the UI layer. Vanilla JS directly manipulates it; the financial functions are deterministic for a given global S but are not pure functions (computeWaterfall, convertInstruments, recalcAntiDilution) still ships inline. Charting is mixed: SVG for the waterfall curve (crosshair), canvas for Decay and Fund MOIC.
Why localStorage instead of a database?
Cap tables stay in the browser. Feedback is a separate path: the FAB sends a sanitized message (not the model) to /api/feedback. The waterfall-pain survey POSTs answers only. Optional agent POSTs model JSON only to the URL you type. JSON and Excel import/export are the portability story. IndexedDB remains a future path; browser storage quotas vary and are not guaranteed.
Why Vercel?
The repository is designed for a Vercel project whose Git integration deploys main; that external project setting was not inspected. Static files plus Vercel Functions: api/feedback.js, api/survey-waterfall-pain.js, api/weekly-ops.js (implemented but not scheduled by vercel.json). Blob, Slack, optional AI Gateway summaries. vercel.json rewrites welcome/why/faq/privacy/terms/demo/excel-ingest/Rule-of-40/screener/i/feedback/survey, noindexes /docs/*, /feedback, and /survey/*, and sets clickjacking headers on / and welcome. GitHub Pages workflow is disabled (if: false) so routes do not drift. Canonical URLs use the www host.
03 File Structure
Production surfaces on Vercel. The model is a shell plus capstack.css and capstack-app.js.
capstack/ ├── index.html — Modeling shell. Bare / redirects to /welcome; /model and /?app=1 serve this file ├── capstack-app.js Classic script the shell loads. One script, so let state stays in one scope ├── capstack.css Stylesheet the shell loads ├── capstack-boot.js Blocking head script that hides a dismissed hint before first paint ├── welcome.html — Short GP landing at /welcome ├── why.html Why CapStack exists at /why ├── faq.html / faq.md User FAQ at /faq ├── privacy.html / terms.html Legal at /privacy, /terms ├── og-image.svg / og-image.png OG mark; app meta points at /og-image.png ├── vercel.json Rewrites, noindex, and clickjacking headers on HTML except embeds; no active cron ├── robots.txt Disallow /docs/ ├── package.json npm test + Function deps (@vercel/blob, ai, @vercel/connect) ├── api/ │ ├── feedback.js Sanitize, store, Slack, optional summarize │ ├── survey-waterfall-pain.js POST answers / GET CSV export │ ├── weekly-ops.js Authorized ops report endpoint — currently unscheduled │ └── _lib/ sanitize.mjs, weekly-ops.mjs ├── feedback/index.html Public summaries at /feedback (noindex) ├── survey/waterfall-pain/ Instant survey UI (noindex) ├── i/index.html Quick-link hub at /i ├── demo/ Walkthrough, social unfurl, excel-ingest ├── embed/ Dashboard, loader, generator — fictional sample, not live models ├── screener/ Local candidate match desk, analyst/engineer rooms, questions and scoring ├── rule-of-40.js Shared Rule of 40 / X scenario math ├── agent-service/ Optional durable AI service (localhost:8787). Not required for modeling. ├── docs/xlsx-import/ Excel import notes + reader spike ├── scripts/ browser-smoke.mjs for post-deploy Playwright ├── tests/ waterfall goldens, xlsx*, weekly-ops, canonical-hosts, ux-hardening ├── .github/workflows/ │ ├── frontend-tests.yml npm test on app/embed/api changes │ ├── production-smoke.yml Post-deploy HTTP + browser smoke on www │ ├── agent-service-ci.yml Agent tests + golden eval │ ├── feedback-notify.yml Issue triage on bug/enhancement/feedback labels │ └── deploy.yml GitHub Pages — disabled; Vercel is canonical └── docs/dev/learn/deconstruct-the-guts/ └── index.html This page (noindexed)
04 Tech Stack
Every technology used in the project, with rationale.
mindmap
  root((CapStack GP))
    Frontend
      HTML5
        Semantic elements
        Inline SVG favicon
        JSON-LD structured data
      CSS3
        CSS Custom Properties
        CSS Grid layout
        Media queries
        Print stylesheet
        Dark/Light theming
      JavaScript ES6+
        Global-state financial engine
        DOM manipulation
        localStorage API
        Clipboard API
        FileReader API
        DecompressionStream
        Canvas 2D + SVG
        fetch (feedback + optional agent)
        Drag and drop
    External
      Google Fonts
        DM Mono
        Fraunces
    Deployment
      Vercel CDN
      vercel.json rewrites + headers
      Vercel Functions
        /api/feedback
        /api/survey-waterfall-pain
        /api/weekly-ops
      Vercel Blob (private)
    Optional
      agent-service (Express, Zod)
      AI Gateway (feedback summaries)
    Design
      Monospace-first typography
      CSS variable theming
      Responsive breakpoints
      Accessibility ARIA
      
TechnologyRoleWhy This ChoiceVersion / Notes
HTML5Document structureZero-build static delivery with partial semantic/accessibility coverageLiving standard
CSS3Styling + themingCustom properties for dark/light toggle; Grid for 3-column layoutCSS Variables, Grid, color-mix()
Vanilla JS (ES6+)Logic + interactivityNo framework/build runtime; engine reads and sometimes mutates global stateNo automated cross-browser support matrix; Excel requires DecompressionStream
localStorageModel persistenceCore model stays local unless a configured remote agent is used. Excel workbooks never upload. Survey/feedback are separate paths.Browser-dependent quota; no guaranteed capacity
SVG + CanvasChartsWaterfall curve is SVG (crosshair tooltip). Decay and Fund MOIC are HiDPI <canvas>.Mixed on purpose after chart-hardening
Google FontsTypographyDM Mono + FrauncesCDN, display=swap
GitHub ActionsCIFrontend node --test, agent-service CI, issue triage, post-deploy production smoke (HTTP + Playwright on www). Pages deploy is off.Node 20
VercelHost + FunctionsStatic CDN + feedback / survey / weekly-ops + Blob + optional AI GatewayRewrites and route-specific headers; no active Vercel cron
CSPPartial browser policyMeta CSP on index.html sets script-src 'self' plus the Insights host, with no 'unsafe-inline' and no 'unsafe-eval'. There is no script-src-attr exception: handlers are data-cs-* attributes dispatched from capstack-app.js. style-src is 'self' only. connect-src https: permits operator-hosted agents. The walkthrough page keeps 'unsafe-eval' because it evaluates sliced regions. This policy is a meta tag, not a response header.index.html head
05 JavaScript Architecture
How capstack-app.js is organized. The shell is index.html. Exact size and function metrics above are extracted live from source.
graph LR
  subgraph UI["UI Layer"]
    NAV["Navigation
nav(), togAcc()"] FORMS["Form Handlers
updCo(), updFund(), setA()"] RENDER["Renderers
renderCapTable()
renderWaterfall()
renderDecay()
renderFund()"] MODAL["Modal System
showModal(), closeModal()"] end subgraph ENGINE["Computation Engine (Pure Functions)"] FD["computeFD()
Fully diluted shares"] AD["recalcAntiDilution()
convR from down rounds"] CV["convertInstruments()
SAFE/note synthetics"] WF["computeWaterfall()
≤10 election passes"] PC["prefClaim()
OIP × shares × prefMul + divs"] DC["computeDecay()
Ownership dilution"] CURVE["genWFCurve() + drawWFCurve()"] LP["getTotalLP()
Liquidation preference"] XI["getExitIdentity()
issued vs as-converted FD"] end subgraph STATE["State Management"] S["Global S object"] UNDO["Undo stack
pushUndo(), undo()"] SAVE["Persistence
autoSave(), loadSaved()"] IO["Import/Export
exportJSON(), importJSON()
xlsx* client-side"] end FORMS -->|"mutate"| S S -->|"read"| ENGINE ENGINE -->|"results"| RENDER UNDO -->|"snapshot"| S SAVE -->|"serialize"| S style NAV fill:#5b9cf0,color:#0d0f14,stroke:none style FD fill:#4dd4a0,color:#0d0f14,stroke:none style WF fill:#4dd4a0,color:#0d0f14,stroke:none style S fill:#d4a843,color:#0d0f14,stroke:none
Function Registry
Named function declarations in capstack-app.js, auto-extracted from deployed source. Arrow functions and other files are not counted.
Analyzing source...
06 Computation Engine
The waterfall engine is the core of the app. Production v1.2 allocates the full post-deduction equity pot, then splits each equity allocation into day-one and escrow amounts.
flowchart TB
  A["Gross Exit Proceeds
($M × 1,000,000)"] --> B{"Deduct Fees?
(a27 = gross)"} B -->|Yes| C["− Transaction Fees
(exitP.fees %)"] B -->|No| D[Skip] C --> E["− Outstanding Debt
(exitP.debt × $1M)"] D --> E E --> F{"Deduct Retention?
(a32 = deduct)"} F -->|Yes| G["− Retention/Earnout
(exitP.ret × $1M)"] F -->|No| H[Skip] G --> I["Post-deduction Equity Pot"] H --> I I --> SYN["Merge convertInstruments()\nsynthetics + optional cash payout"] SYN --> L["Step 1: Seniority Stack"] L --> M["For each seniority level
(ascending):"] M --> N["Pay liquidation preference
prefClaim() = OIP × shares × prefMul
+ accrued dividends to asOfYear"] N --> O{"Pool sufficient?"} O -->|Yes| P["Full pref paid.
Deduct from pool."] O -->|No| Q["Pro-rata split
among level. Pool = 0."] P --> R["Step 2: Residual Split"] Q --> S["No residual.
Common gets $0."] R --> T["Non-participating pref:
Compare convert vs. pref.
Iterate ≤10 passes."] R --> U["Participating pref:
Gets pref + pro-rata
of residual (double dip)"] R --> V["Capped pref:
Participate up to cap;
redistribute surplus ≤20 passes"] R --> W["Common + Options + RSUs:
Pro-rata by FD shares"] W --> X["Post-allocation split:
Day-1 = equity × (1 − escrow%)
Escrow = equity × escrow%"] style A fill:#d4a843,color:#0d0f14,stroke:none style I fill:#4dd4a0,color:#0d0f14,stroke:none style S fill:#e05870,color:#0d0f14,stroke:none style W fill:#5b9cf0,color:#0d0f14,stroke:none
Key Formulas
// Fully Diluted Shares — computeFD(shareholder, exitPPS) common → shares preferred → shares × convR // convR from recalcAntiDilution() rsu → vested + (unvested if accel ≠ 'none'; per-holder accelOverride wins) option → vested × (1 − strike/exitPPS) // treasury method option → vested // gross method // Liquidation Preference — prefClaim() / getTotalLP() base = OIP × shares × prefMul + accrued = base × rate × years // simple; rate = a10b; years = asOfYear − issueYear + accrued = base × ((1+rate)^years − 1) // compound // Waterfall — computeWaterfall(proceedsM) // production engine v1.2 synthetics = convertInstruments() // SAFEs/notes → pref/common/cash; convertAs overrides a24 remaining = gross − fees − debt − retention − cashPayouts pool = remaining // preferences run on full equity pot // → Pay seniority stack via prefClaim() (ascending levels) // → Residual: convert vs. pref election, ≤10 passes // → Capped participation: holderCapMul() surplus recycle ≤20 passes // → Split equity allocations into day-one and escrow holdback // conservation: allocs + fees + debt + ret + unallocated = gross // returns {allocs, escrow, fees, debt, ret, remaining, day1, gross, unallocated, // cashPayouts, pool, decisions, resWeights, electionConverged, _synthetics}
07 CSS Architecture
Design system built on CSS custom properties with zero external frameworks.
graph TB
  subgraph Tokens["Design Tokens (CSS Variables)"]
    INK["Ink (Backgrounds)
--ink through --ink4"] RIM["Rim (Borders)
--rim through --rim2"] CHALK["Chalk (Text)
--chalk through --chalk4"] ACCENT["Accent Colors
--amber --cyan --rose
--jade --sky --violet"] end subgraph Layout["Layout System"] GRID["CSS Grid Shell
topbar | sidenav | main | rpanel"] RESP["Responsive Breakpoints
1100px, 900px, 768px, 500px"] PRINT["Print CSS
Cap Table + Waterfall + Fund MOIC"] end subgraph Components["Component Styles"] CARDS[".card"] FORMS[".field, .fg"] TABLES[".dt"] PILLS[".pill"] BTNS[".btn"] ALERTS[".alert"] end Tokens --> Layout Tokens --> Components style INK fill:#1a1e2a,color:#e8eaf5,stroke:#323655 style ACCENT fill:#d4a843,color:#0d0f14,stroke:none style GRID fill:#5b9cf0,color:#0d0f14,stroke:none
Color System
Amber
Primary accent
Jade
Success / positive
Sky
Info / employees
Rose
Error / danger
Violet
Preferred stock
Cyan
Convertibles
Grid Layout
/* Main app shell — 3-column CSS Grid */ #shell { display: grid; grid-template-rows: 52px 1fr; grid-template-columns: 240px 1fr 280px; height: 100vh; } /* Collapsible columns via state classes */ #shell.nav-collapsed { grid-template-columns: 0px 1fr 280px; } #shell.rpanel-collapsed { grid-template-columns: 240px 1fr 0px; } /* Responsive: hide right panel below 1100px, mobile below 900px */
08 State Management & Persistence
How data flows from user input → state → localStorage → hydration.
sequenceDiagram
  participant U as User
  participant DOM as DOM Forms
  participant S as State (S)
  participant LS as localStorage
  participant E as Engine
  participant R as Renderers

  U->>DOM: Edit input field
  DOM->>S: pushUndo() + mutate S
  S->>LS: autoSave() → JSON.stringify
  Note over S: _inputsDirty = true

  U->>DOM: Click "▶ Run Model"
  DOM->>E: runModel()
  E->>E: recalcAntiDilution()
  E->>E: convertInstruments() inside computeWaterfall()
  E->>E: computeWaterfall() ≤10 election passes
  E->>E: computeDecay()
  E->>S: S.ran = true
  E->>R: renderOut(page)
  R->>DOM: innerHTML update
  S->>LS: autoSave() includes ran

  Note over LS: On next page load:
  LS->>S: loadSaved() → JSON.parse, restore ran
  S->>DOM: hydrateUI()
  alt ran is true
    S->>R: re-render last output page
  end
      
Persistence Schema
// localStorage key: 'capstack-gp-model' — SCHEMA_VERSION = '1.4' { "schema_version": "1.4", "source": { "a": { /* 47 UI rows: a1–a18 + a10b + a20–a47; a19 in DEFAULTS only */ }, "co": { name, stage, jur, yr, authC, authP }, "fund": { name, size, carry, hurdle, fee, gp, inv, period, life }, "shareholders": [ /* + issueYear, accelOverride, proRata, capMul */ ], "rounds": [ /* Array of round objects */ ], "convs": [ /* + dayCount, maturity, convertAs, sen; cap in dollars */ ], "exitP": { fees, escrow, debt, ret, asOfYear }, "exitScens": [ /* Array of scenario objects */ ], "r40": { /* Rule of 40 / X profiles and valuation-band inputs */ }, "writtenClaims":[ /* stated ownership claims for reconciliation */ ], "writtenAsOf": "2026-10-08", "nid": 100, // next unique ID; demo seed sets 200 "ran": true // allocations not stored; flag lets outputs re-render }, "session": { "page": "waterfall", "theme": "dark" } } // loadSaved: restore ran; if missing and last page was an output view, set ran=true // loadSaved / importJSON: missing exitP.asOfYear defaults to the current calendar year // importJSON / Excel commit: S.ran = false until ▶ Run Model
09 Deployment Pipeline
The intended production path is Vercel Git integration from main; the repository does not prove that external setting or gate deployment on CI. Modeling is static; feedback, survey, and weekly-ops are Functions.
flowchart LR
  A["git push main"] --> B["Vercel webhook"]
  B --> C["Static files + api/*.js"]
  C --> D["vercel.json rewrites + headers"]
  D --> G["www.capstack.space"]

  style A fill:#d4a843,color:#0d0f14,stroke:none
  style G fill:#4dd4a0,color:#0d0f14,stroke:none
      
Canonical routes
/
index.html — modeling app. Canonical https://www.capstack.space
/welcome
Rewrite → short GP landing
/why
Rewrite → why CapStack exists
/faq, /privacy, /terms
Rewrites → matching HTML
/demo, /demo/social
Walkthrough + social card
/demo/excel-ingest
Excel import walkthrough (+ onboarding aliases)
/rule-of-40, /rule-of-40-explained
Standalone shared-math calculator and explanation
/screener, /screener/analyst, /screener/engineer
Local-first match desk and role rooms
/i
Rewrite → i/index.html
/feedback
Rewrite + noindex → public summaries
/survey/waterfall-pain
Rewrite + noindex. UTM redirect if utm_campaign missing
/api/feedback
GET list / POST create (origin allowlist, rate limit 5/min)
/api/survey-waterfall-pain
POST answers (rate 8/min); GET CSV export (authorized)
/api/weekly-ops
Authorized ops report endpoint. Implemented, but no Vercel cron is active in the current deployment configuration.
/docs/*
Noindex (this page)
/screener/*
Noindex local-first candidate screening; records use separate browser-storage keys
Local
python3 -m http.server 8000 — Functions need vercel dev
GitHub Pages
Workflow disabled (if: false) so /i rewrites do not drift
10 Browser APIs Used
Every Web API the app touches, with compatibility notes.
APIUsageFallback
localStorageModel (capstack-gp-model incl. ran), corrupt-model backup, theme, optional agent URL, local feedback log, visit marker, and separate screener configuration/sessions. The agent API key is session-scoped, not stored here.Model save is guarded; storage is unencrypted and readable by same-origin script and anyone with browser-profile access. Reset purges CapStack and screener keys on this origin.
Clipboard APIBLUF copyToast on denied permission
FileReader / ArrayBufferJSON import; Excel .xlsx zip parsetry/catch + toast. Excel needs DecompressionStream
DecompressionStreamInflate deflate-raw zip entries for xlsxThrows XLSX_NO_INFLATE_SUPPORT
Drag and dropWorkbook drop onto the importerFile picker still works
URL.createObjectURLJSON export blob downloadStandard
matchMediaSystem themeDefaults dark
window.print()printModel() shows Cap Table, Waterfall, Fund MOIC—
Canvas 2DDecay + Fund MOIC (devicePixelRatio)Empty-state copy if no data
fetchPOST /api/feedback; optional agent /api/agent/runAgent is off unless URL is set
sessionStoragecs-app1-tab so ?app=1 lands on Assumptions once per tabIgnored if storage blocked
11 How to Make Changes
A practical guide for engineers making their first edits to the codebase.
Common Tasks
Add a new assumption
1. Add the key/default to DEFAULTS (~line 1290)
2. Add the definition to the correct domain in ASSUMPTION_DOMAINS (~line 5436)
3. Reference S.a.yourKey in the engine — or add it to DEMOTE_KEYS if it is display-only
4. Update that domain’s count and the sidenav badge #nb-ass if the 47 total changes. a10b already counts as one of the 47.
Add a new shareholder field
1. Add the field to the default structure in openAddSh() (~line 1704)
2. Add the field to the _modalAction push in the same function
3. Reference it in computeFD(), recalcAntiDilution(), prefClaim(), or computeWaterfall() as needed
4. Add it to renderShList() and renderCapTable()
Add a new output page
1. Add a new <div id="pg-yourpage" class="pg"> in the HTML
2. Add nav buttons in topbar (#tb-nav), sidenav (#sidenav), and mobile nav
3. Create a renderYourPage() function
4. Add the page to the render switch in renderOut() (~line 2432)
5. Add the page name to nav in topbar, sidenav, and mobile nav
Change the color theme
1. All colors are CSS custom properties in the [data-theme] blocks (~line 48)
2. Dark and light themes are independent — both must be updated
3. Semantic names: --ink (bg), --chalk (text), --rim (borders), then accent colors
Debug the waterfall computation
1. computeWaterfall(proceedsM) is a pure function (~line 2208). runModel() (~2422) calls recalcAntiDilution() first, then sets S.ran.
2. Console: computeWaterfall(100)
3. Returns {allocs, escrow, fees, debt, ret, remaining, day1, gross, unallocated, cashPayouts, pool, decisions, resWeights, electionConverged, _synthetics}
4. allocs is keyed by shareholder (and synthetic) ID
5. Pref stack uses prefClaim() (~1944). Conversion loop is maxIter=10. Conservation miss surfaces when |unallocated| > 1.
What NOT to Do
Don'tWhy
Add a bundler for the modeling appThe model is index.html, capstack.css, and one classic script, capstack-app.js. There is no bundler. Root package.json deps exist for Vercel Functions (api/*.js). npm run build:engine only slices the free-tool copy. Excel parsing lives in capstack-app.js, not SheetJS from a CDN.
Store computed allocations in stateAllocations must always be derived from source. Persist only ran (and inputs) so reload re-renders — do not snapshot allocs.
Use innerHTML with unescaped user inputXSS risk. Always use esc() helper for any user-provided string.
Remove the pushUndo() call before mutationsBreaks Ctrl+Z. Every state mutation must snapshot first.
Forget to call autoSave() after mutationsUser loses work if they close the tab. Always save after state changes.
12 Testing & Validation
Automated tests live in tests/ and run with npm test (Node built-in runner). CI includes frontend-tests.yml, agent-service-ci.yml, and post-deploy production-smoke.yml. Root HTML/JS/API changes are covered, but nested screener JS/question JSON are not direct frontend-workflow path triggers. Production smoke is Chromium-only, runs after deployment, and covers the core app/Excel walkthrough—not APIs, agent integration, screener, Rule of 40, embed, rollback, quota failure, or performance budgets.
Automated
FileGuards
tests/waterfall-moic.test.mjsPorted waterfall + MOIC math (multi-pass capped pref)
tests/waterfall-golden.test.mjsInternal hand-authored fixtures for preferences, conversion, residual allocation, and conservation; not an external NVCA/YC certification
tests/prod-waterfall-loader.test.mjsPins production engine by slicing capstack-app.js into Node
tests/embed-waterfall.test.mjsFictional $3B embed dashboard numbers
tests/feedback.test.mjsSanitize / PII redact / type clamp for api/_lib/sanitize.mjs
tests/weekly-ops.test.mjsWeekly ops report + cron auth helpers
tests/xlsx-*.test.mjsReader, detect, plan, commit, template, demo page, entry
tests/ux-hardening.test.mjsPersist ran, sanitize colors/roles, save-fail toast
tests/canonical-hosts.test.mjswww canonical URLs
tests/welcome-links.test.mjsWelcome / why / overview links
tests/rule-of-40.test.mjsShared standalone and embedded Rule of 40 / X math
tests/screener.test.mjs, tests/sim-pack.test.mjsRole banks/scoring/routes/shell disclosures; sim-pack guards destructive forgotten-PIN recovery
tests/written-claim.test.mjsStated ownership claim persistence and reconciliation
✓Verified 2026-10-08: the root suite passed 405 tests across 118 top-level tests / 45 suites. The optional agent service passed 11 tests and its deterministic golden evaluation.
Manual Test Checklist
Fresh state — Clear localStorage, reload /. App should load (no auto-redirect to welcome). Demo data appears. Overview still opens welcome.html.
Add data — Mix of common, preferred, options; 2+ rounds; 1 convertible. Banner should mention conversion. Badges update.
Run model — ▶ Run Model. Waterfall SVG + crosshair, cap table dual FD, decay canvas, fund MOIC canvas. Convertibles show in waterfall allocs when conversion computes. Reload should keep outputs (ran).
Modify + rerun — Dirty indicator. Rerun. Outputs update. Down-round should change preferred convR.
Undo / JSON / Excel / theme / print — Ctrl+Z; export→clear→import (must re-run); Excel picker / ?import=xlsx; dark↔light redraws charts; print CSS (Cap Table, Waterfall, Fund MOIC).
Feedback / survey — FAB sends a message; /feedback lists summaries only. Survey at /survey/waterfall-pain stores answers, not the model. Needs Function env on Vercel (or vercel dev locally).
Responsive — 900px then 600px: mobile nav, hidden panels, readable tables. Bottom bar should not leak onto desktop.
Edge case — $0 exit: no JS errors, common $0, warnings appear. Conservation identity Δ ~ $0.
01 Scoped Safety Verdict
The answer depends on the data classification, execution environment, and optional features enabled.
Decision
!Conditionally suitable for pre-decision modeling; not approved here for unrestricted highly sensitive MNPI.
Use caseAssessmentConditions
Fictional, public, or de-identified scenariosSuitableUse a supported browser; independently reconcile material outputs.
Confidential cap-table modeling on a firm-managed deviceConditionalFirm approves the mutable hosted application and browser storage; dedicated profile/device; remote agent off; no shared workstation; clear/export under firm policy.
Highly restricted MNPI or regulated personal dataNot yet defensibleStill requires a pinned/self-hosted artifact, a CSP without inline script, encrypted or non-browser storage, and a formal security review. Import bounds and session-only agent keys do not close that gap.
Closing, legal, tax, accounting, valuation, or fund-administration system of recordOut of scopeUse counsel, administrators, source documents, and independently controlled models.

Basis: index.html CSP, persistence, import, feedback, and agent regions; vercel.json; privacy.html; terms.html; API and agent-service source; automated tests. No penetration test, dependency audit service, production configuration inspection, SOC report, or legal review was performed.

02 Threat Model & Trust Boundaries
Assets, attackers, boundaries, controls, and the failure modes a firm reviewer should evaluate.
Protected assets
Company and holder identity, security terms, financing history, exit scenarios, fund economics, written ownership claims, and exported files.
Optional agent API key; candidate names, answers, ratings, notes, and host PIN hash; submitted feedback and survey responses.
Decision integrity: waterfall allocations, dilution, MOIC, scenario projections, and warnings must not silently misstate economics.
Relevant adversaries
A person or extension with access to the browser profile, device, downloads, clipboard, print output, or developer tools.
A compromised deployment account, repository/workflow, CDN/host, third-party resource, dependency, or future same-origin script.
A malicious JSON/XLSX file, feedback/API abuser, hostile remote-agent endpoint, or model provider receiving intentionally transmitted state.
BoundaryCrossingImplemented controlResidual risk
Browser ↔ static hostHTML, fonts, analytics script and eventsHTTPS is supplied by Vercel; app CSP restricts most source classesHosted code is mutable; no signed/pinned release or subresource integrity; response headers are incomplete.
DOM ↔ model stateUser strings rendered through templatesesc(), safeColor(), sanitization testsLarge inline-render surface means every future interpolation must preserve escaping; CSP allows inline script.
Browser ↔ local storageModel, settings, optional key, screener reportsSame-origin browser isolation; guarded model save/load; corrupt backupNo encryption, expiry, lock, or user-facing complete-data purge. Same-origin script/profile access can read it.
File ↔ importerJSON text; XLSX ZIP/XMLNo upload. JSON is schema-allowlisted (1.0–1.4), size-capped at 2 MB, collection-capped, and rejected before undo/state mutation. XLSX rejects files over 32 MB, more than 400 entries, an entry over 8 MB, aggregate claimed inflation over 32 MB, or a compression ratio over 100:1.Excel row/column ceilings are still coarser than the zip ceilings. A validated string can still contain markup; render paths that forget esc() remain an XSS risk under the current inline CSP.
Browser ↔ CapStack APIsFeedback or survey onlyBody limits, validation/redaction, origin checks, private Blob, basic rate limitsNo-Origin clients are allowed; in-memory limits are per instance; retention/deletion SLA is unspecified.
Browser ↔ optional remote serviceComplete browser sourceState, question, metadata, API keyUser opt-in; HTTPS required from hosted app; service key, CORS including www, schema, body limit, rate limit, metadata-only logger. The API key is stored in sessionStorage and removed from localStorage on read.Any HTTPS host is still permitted by the app CSP. The agent URL remains in localStorage. Agent Zod schemas strip undeclared model fields before provider prompting. Operator owns retention and security.
03 Complete Data & Network Inventory
“Local-first” applies to the core model—not to every request the site can make.
TriggerDestinationPayload / observable dataDefault?Evidence
Load public pagesVercel / CapStack originNormal HTTP metadata such as IP, user agent, route, and timing; static filesYesvercel.json, deployed static pages
Load typographyThis origin /fonts/ (Fraunces, DM Mono). Screener pages still request fonts.googleapis.com and fonts.gstatic.com (Inter, Source Serif).Font request metadata; no model stateYesPage <link> elements, fonts/fonts.css
Web AnalyticsVercel InsightsAggregate page analytics; named export event on JSON export; code sends no model fieldsYes/_vercel/insights/script.js, exportJSON()
Edit/run/print/on-device BLUFNone beyond already loaded pageModel remains in memory/localStorage; print/clipboard go to OS facilitiesYesgetSource(), engine/render functions
Import JSON/XLSXNoneFile bytes parsed in the browserUser actionhandleImport(), xlsxReadWorkbook()
Send feedback/api/feedback → private Vercel Blob, Slack, optional AI GatewayChosen type and message after regex-based email/phone/common-secret redaction; summary may be publicly listedUser actionsubmitFeedback(), api/feedback.js, sanitize.mjs
Submit survey/api/survey-waterfall-pain → private Vercel BlobEnumerated answers, one short free-text answer, and UTM/source fields; no model stateUser actionsurvey/waterfall-pain/index.html, API route
Remote model BLUF / AskUser-saved agent base URL; provider chosen by operatorComplete current model state reaches the agent endpoint with question/workflow metadata and API-key header; agent schema then strips undeclared fields before provider promptingOffbuildAgentRequest(), AgentRequestSchema, runAgentWorkflow()
Screener “deeper help”User-entered hosted URLFull pasted job descriptionOffscreener/desk.js hostedExtract()
View this engineering pageCapStack origin, Vercel InsightsStatic spec, same-origin typography, aggregate analytics; diagrams remain inert notationYesThis file intentionally has no third-party executable diagram dependency
04 Storage, Retention & Deletion
The repository defines storage behavior; production provider retention settings were not independently inspected.
DataLocationRetentionDeletion / recovery
Model inputs and ranlocalStorage: capstack-gp-modelUntil site data is cleared, Reset runs, or the value is overwritten; no expiryReset calls purgeCapstackStorage(), which removes model, corrupt backup, agent URL, feedback log, Excel profiles, theme/visit markers, and screener.* keys. JSON export remains the backup path.
Agent URLlocalStorage: cs-agent-baseurlUntil cleared or ResetNot encrypted. The API key is not stored here.
Agent API keysessionStorage: cs-agent-apikeyCurrent tab onlyClosing the tab drops it. A previously stored localStorage copy is deleted on the next read.
Screener sessions and PIN hashRole-specific localStorage keys and shared configUntil deleted/cleared; no expiryPer-report delete; forgotten PIN flow deletes PIN and all reports. SHA-256 PIN hash is not password-hardening and is not a device security boundary.
FeedbackPrivate Vercel Blob; excerpt in Slack; optional model-provider processing; public summaryNo retention period encodedNo user self-service deletion or repository-defined deletion workflow.
Survey answersPrivate Vercel BlobNo retention period encodedAuthorized CSV export exists; no user self-service deletion.
Ops reportsPrivate Vercel Blob plus configured Slack/emailNo retention period encodedOperator/provider administration; endpoint currently unscheduled.
!Clearing only capstack-gp-model is not a complete purge: the corrupt backup, agent settings, feedback history, screener records, theme, and visit keys are separate.
05 Endpoint & Service Controls
Authentication, validation, storage, and failure behavior as implemented—not as presumed from hosting.
SurfaceAccess controlValidation / limitsStorage / outputImportant caveat
GET /api/feedbackPresent Origin must be an allowed host; a missing Origin is still accepted on this public listLists up to 50 summariesPublic summary, type, timestamp, IDNo authentication; noindex is not access control.
POST /api/feedbackOrigin check; in-memory 5/min/IP8 KB raw body, including when Content-Length is absent; 8–2,000-char retained message; type clamp; regex redaction; honeypotPrivate Blob and Slack independently; returns partial-delivery flagsRate limits are process-local. Regex redaction is not a DLP guarantee. A missing Origin is rejected on POST.
POST /api/survey-waterfall-painOrigin check; in-memory 8/min/IP8 KB declared body; enums; bounded/normalized UTM and free text; honeypotPrivate BlobRate limits reset per cold instance and are not a distributed abuse control.
GET /api/survey-waterfall-painBearer SURVEY_EXPORT_SECRET or CRON_SECRETReads up to 500 records; CSV escapingCSV with attachment/no-store headersShared fallback secret expands blast radius.
GET /api/weekly-opsCron bearer authorizationProvider timeouts and bounded list sizesReport to configured email/Slack and private archive; dry-run can return detailed reportNot scheduled in current vercel.json; production env and provider permissions were not inspected.
Agent GET /healthPublicNo request bodyProvider/model/configured statusOperational metadata is intentionally exposed.
Agent workflow/runRequired API key; configured CORS; key+IP in-memory rate limitExpress 1 MB body; Zod request/output schemas; configurable 200k-char state; one JSON repair attemptProvider output; allowlisted metadata logsSource schema strips preference/participation/seniority/conversion/vesting/strike and Rule of 40/written-claim fields before provider prompts. Default CORS includes the apex host but not canonical www, so production requires an explicit override. No per-user identity, durable quota, retention control, or hosted deployment is supplied.
06 Security, Reliability & Performance Posture
What is strong, what is only partial, and what remains unverified.
Demonstrated strengths
  • Core calculations and file parsing run in-browser; no account or application database is required.
  • Financial engine tests execute production functions, include golden cases and conservation checks, and currently pass.
  • Input strings are generally escaped before HTML interpolation; colors/roles are constrained and regression-tested.
  • Feedback validates, normalizes, redacts common PII/secrets, escapes Slack markup, and stores Blob objects privately.
  • Agent service fails closed without an API key, validates requests/outputs, limits bodies, and logs allowlisted metadata by default.
  • CI runs on HTML/API/test changes; production smoke verifies the deployed byte count and drives Excel import in Chromium.
  • XLSX parsing uses cached values, avoids macros and formula execution, rejects encryption/legacy OLE, and yields periodically during row processing.
Material residual gaps
  • Hosted-code trust: a future same-origin deployment can read stored models. There is no immutable offline release, signature, checksum workflow, or service worker.
  • CSP/headers: app CSP permits inline code and all HTTPS connections. Most routes lack a response-header CSP, HSTS declaration, Referrer-Policy, Permissions-Policy, and X-Content-Type-Options in repo config.
  • Storage: confidential data and optional API key are unencrypted, have no TTL, and lack a complete one-click purge/inventory.
  • Persistence recovery: quota/blocked-storage failures show a rate-limited toast but do not enter a durable failure state or offer immediate export. Undo can retain 50 full snapshots, and a corrupt backup is attempted in the same potentially full store.
  • Imported-model XSS: JSON import now rejects unknown schemas, unknown assumptions, duplicate ids, and non-allowlisted enums before state changes, and the previously identified type/flag sinks pass through esc(). Residual risk remains wherever a later template interpolates a stored string without escaping, because the CSP still allows inline script.
  • Import availability: XLSX caps each declared entry at 256 MB but not aggregate output/count/rows; inflation output is not checked against declared size. JSON has no explicit file/collection/depth limit.
  • API abuse: serverless in-memory rate limits are non-durable; accepting missing Origin supports non-browser clients; feedback GET is deliberately public.
  • Supply chain: 2026-10-08 npm audit --omit=dev reports one high-severity undici advisory in the root and critical proxy-addr, moderate qs, and low body-parser advisories in the agent service. Fixes are available; no SBOM, provenance, or deploy attestation is evidenced.
  • CI action pinning: GitHub Actions use mutable major-version tags rather than immutable commit SHAs.
  • Disclosure drift: privacy.html describes remote BLUF/Ask as a digest, while current buildAgentRequest() transmits complete sourceState. The implementation and this specification are authoritative until that public notice is corrected.
  • Feedback disclosure: the compose UI does not clearly disclose private Blob storage, Slack delivery, optional AI processing, or possible public summary publication. Regex redaction does not remove names, companies, URLs, deal terms, or financial details.
  • Computation scaling: waterfall allocation contains repeated linear holder lookups and up to 20 redistribution passes; the curve invokes the waterfall 61 times synchronously. There are no holder/scenario/round caps, worker, cancellation, or elapsed-time budget.
  • Memory amplification: undo retains up to 50 full serialized source snapshots and autosave serializes the complete model after mutations, multiplying cost for large imported models.
  • Network/concurrency: browser agent calls, feedback Blob/Slack calls, and agent-provider calls lack consistent abort timeouts/concurrency bounds. Feedback listing and survey export read many private records sequentially.
  • Availability: localStorage quota/private-mode behavior can lose persistence; no transactional state store, cross-device backup, SLA, RTO/RPO, or incident process is defined.
  • Accessibility/browser coverage: responsive and accessibility regressions exist, but no full WCAG audit or multi-browser production automation is evidenced. DecompressionStream remains an Excel-import requirement.
  • Metadata/configuration: root social metadata references /og-image.png, generated from og-image.svg and tracked beside it. The apex domain redirect status is also set on the Vercel project domain, outside this file.
07 Financial Decision Integrity
Security includes preventing a correct-looking but economically wrong decision.
Purpose: scenario analysis and internal decision support. It is not a cap-table system of record, valuation opinion, LPA engine, legal-document parser, fund administrator, or substitute for counsel.
Reconcile inputs: verify holder names, share classes, OIP, conversion ratios, preference multiples, participation, caps, seniority, issue dates, option treatment, convertibles, fees, debt, escrow, retention, and fund basis against source documents.
Reconcile outputs: distinguish issued FD, as-converted FD, residual claim weight, day-one cash, escrow, and total allocation. Confirm conservation delta and conversion convergence.
Known model boundaries: European carry; simplified escrow; modeled—not legally interpreted—anti-dilution and convertible behavior; incomplete exotic terms; constant-growth Rule of 40 projections; no tax or currency model.
Approval rule: no investment, term-sheet, reserve, valuation, legal, tax, or distribution decision should rely solely on CapStack output. A qualified reviewer must reproduce material results in an independently controlled source.
08 Venture-Firm Operating Checklist
A reviewer should be able to answer every item before approving confidential use.
Control questionRequired answer
Has the firm classified the model data and accepted browser localStorage for that class?Yes
Is the device managed, patched, encrypted at rest, access-controlled, and free of unapproved extensions?Yes
Is the browser profile dedicated/non-shared, with screen locking and controlled cloud sync?Yes
Has the firm approved trusting the current hosted artifact, or deployed a reviewed immutable copy?Yes
Will real names/identifiers be minimized where they are not necessary?Yes
Is the remote agent unset unless the firm operates and has reviewed the complete service/provider path?Yes
Are feedback and survey avoided for confidential, personal, legal, or deal-specific content?Yes
Are imported files from a trusted source and below firm-approved size/complexity limits?Yes
Are exports, printouts, downloads, clipboard contents, and backups governed as confidential records?Yes
Will material inputs and outputs be independently reconciled before a decision?Yes
Is there a defined end-of-use purge process covering all CapStack and screener storage keys and downloaded artifacts?Yes
!If any required answer is “no,” this assessment does not approve confidential use.
09 Evidence & Verification Register
Claims are tied to inspectable code. Absence of evidence is not converted into a positive assurance claim.
Claim areaPrimary evidenceVerification status
Core data stays local by defaultindex.html: persistence, engine, import/export, agent mode; network-call searchSource inspected; root tests passed
Waterfall / dilution / MOIC behaviorProduction functions plus waterfall-*.test.mjs, prod-waterfall-loader.test.mjsAutomated tests passed; no independent financial certification
Import behaviorcapstack-app.js XLSX regions, tests/xlsx-*.test.mjsAutomated tests passed; adversarial resource-exhaustion limits incomplete
Feedback and surveyapi/*.js, api/_lib/sanitize.mjs, corresponding testsSource/tests inspected; provider configuration and stored production records not inspected
Agent serviceagent-service/src/*, README, tests, golden eval11 tests + eval passed; no hosted instance or provider retention inspected
Deployment controlsvercel.json, GitHub workflows, production-smoke scriptRepository configuration inspected; current Vercel/GitHub account controls not inspected
DependenciesRoot and agent package.json/package-lock.json; npm audit --omit=devAudit run 2026-10-08: 1 high root advisory; 1 critical, 1 moderate, 1 low agent advisory. No provenance verification.
Revision9979de38db858a5496a3b009328dc1bcc3c65420Verified 2026-10-08