Skip to content

fix(seed): price the active pipeline so the demo kanban is draggable - #1961

Merged
os-warren merged 1 commit into
mainfrom
claude/issue-1902-seed-pipeline-pricing
Sep 25, 2026
Merged

os-warren merged 1 commit into
mainfrom
claude/issue-1902-seed-pipeline-pricing

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #1902

What

Re-price the seeded active pipeline (ruling B, comment 5826849592) so that exactly two open deals sit at or above LARGE_DEAL_AMOUNT (100,000) and every other open deal is under it. The approval flow and both threshold constants are untouched.

Kept over the line Amount Tier exhibited
Acme Platform Upgrade (proposal) 150,000 Sales Manager review only ($100K–$500K)
Wayne Enterprise License (negotiation) 1,200,000 Manager review, then Director sign-off (over HIGH_VALUE_DEAL_AMOUNT)

Why these two: one per approval tier, and they are the two deals whose amounts other seed prose already quotes, so they stay as they are. The Acme account description says "$150K platform upgrade", and the Wayne in_approval contract carries contract_value: 1200000. Keeping them means neither of those needs a second edit.

Re-scoped under the line (the source of truth is OPPORTUNITY_LINES; dealValue() still derives amount and expected_revenue):

Deal Stage Before After
Globex Manufacturing Suite qualification 500,000 95,000
Northwind Grid Modernization prospecting 240,000 86,500
Lattice Student Success Platform prospecting 125,000 53,000
Vertex Analytics Expansion qualification 320,000 79,000
Apex Logistics Data Hub needs_analysis 275,000 93,000
Lattice Education Renewal proposal 210,000 87,000
Vertex Enterprise Rollout negotiation 675,000 94,000

Line descriptions were rewritten to fit the new scope. For example, Globex is now one shared tenant serving all six sites, so the seeded "six-site rollout" demo activity still reads true. Vertex Enterprise Rollout is now "phase one", and its record description says so. It keeps a discount: 20 line, so "the deepest discount HotCRM seeds anywhere is 20%" (_thresholds.ts, quote.object.ts, quote-discount-ceiling.test.ts) stays true and non-vacuous.

Consumers checked

  • src/revenue/data/revenue.seed.ts: the Globex Manufacturing Suite Proposal quote clones its deal's lines. Updated the tax to 7,220 (8% of the post-discount subtotal, the rate every non-Acme quote bills) and the description (it no longer includes implementation services). Its quote line items follow automatically through QUOTE_LINES. The Acme, Wayne and Initech quotes and the Wayne contract are unchanged, because their deals are unchanged.
  • test/seed-consistency.test.ts: the rollup, expected-revenue and quote-total checks re-derive from the seed and stayed green. Added one seed-row pin: the two over-the-line open deals by name and tier, and every active stage keeps a card under the line.
  • Docs (content/**, src/docs/**): I searched for the seven deal names and their amounts and found no hits outside the seeds. Every $100K / $500K in the docs is a threshold, not a seeded figure.
  • src/sales/data/forecast.seed.ts: the forecast rows are hand-authored snapshot figures and are not derived from opportunity amounts, so I left them unchanged (see Acceptance notes).
  • Campaign actual_revenue / num_*: the derived block counts won deals only, and all re-priced deals are open, so nothing changed.

Measured on a fresh database (objectstack start, empty .objectstack/data)

Before (1551914) After (521de4e)
Opportunities total / non-pending 23 / 14 23 / 21
Open deals 10 10
Open deals at or above 100K 9 2
Open deals locked by a pending approval 9 2
Draggable open cards 1 (Initech) 8
  • Before, API: PATCH stage on Northwind Grid Modernization returned RECORD_LOCKED.
  • After, headless Chromium on the Sales Pipeline view: dragging Northwind Grid Modernization from Prospecting to Qualification sent PATCH 200, and the API read-back shows stage: qualification.
  • Control leg, same session: dragging the still-locked Acme Platform Upgrade returned PATCH 409 RECORD_LOCKED, the toast showed "locked while an approval is in progress", and the stage stayed proposal.
  • The board shows 2 cards in each of the 5 active stages.

Gates (all at 521de4e)

pnpm validate 0 · typecheck 0 · lint 0 · lint:i18n-gate 0 · hygiene 0 · hygiene:tokens 0 · build 0 · test 0 (173 files, 3716 passed, 1 skipped).

Token ratchet: every measured line is identical before (1551914) and after. Only the excluded bucket moved (src/*/data, outside the ratchet by ruling): about 96,270 before and about 96,254 after.

Ablation of the new pin: ablation-replace raised Lattice Student Success Platform from 2 to 7 SMB tenants (126,000). The pin went red (expected [ …(3) ] to deeply equal [ …(2) ], 1 failed / 39 passed). The file was restored, with blob equal to HEAD and git diff HEAD empty.

Acceptance notes

  • An existing demo database is not re-priced in place. Re-seeding upserts on (opportunity, product), so line items for products a deal no longer carries would stay behind, and approval requests already open stay open. The changeset says to use pnpm demo:reset. I did not measure the existing-database path.
  • The current-month forecast snapshot (pipeline_amount: 760000) is a positional, hand-typed demo figure. It never tracked the seeded open pipeline (about 3.8M before), and it does not now (about 2.02M after). It is noted here and not changed, because it is outside this card.

Generated by Claude Code

…1902)

Nine of the ten open seeded deals sat at or above LARGE_DEAL_AMOUNT, so
each was born into opportunity_approval_on_create and locked by its
approval node; on a fresh database only one open kanban card could move.

Re-scope the line items of the seven curated active-pipeline deals so
each derives an amount under $100K. Two open deals keep exhibiting the
approval flow, one per tier: Acme Platform Upgrade (manager review) and
Wayne Enterprise License (manager + director). The Globex quote follows
its deal's new lines (tax re-derived at the 8% the other quotes bill).
A seed-row pin in seed-consistency names the two deals.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X8U3asekbiC7yWoEPWR4Dg
@vercel

vercel Bot commented Sep 25, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
hotcrm Ignored Ignored Sep 25, 2026 2:34pm UTC

Request Review

@github-actions github-actions Bot added ci/cd CI plumbing and the verification pipeline metadata Declarative metadata — schema, security posture, UI surfaces labels Sep 25, 2026
@os-warren
os-warren marked this pull request as ready for review September 25, 2026 14:39
@os-warren
os-warren added this pull request to the merge queue Sep 25, 2026
Merged via the queue into main with commit 2f7b232 Sep 25, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/cd CI plumbing and the verification pipeline metadata Declarative metadata — schema, security posture, UI surfaces

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[finding] Seed data puts every ≥$100K opportunity into a pending approval — ~90% of open kanban cards are undraggable in a fresh demo database

2 participants