fix(seed): reconcile the Acme narrative, and flag a non-customer - #1657
Merged
Conversation
Two corrections to `src/data/sales.seed.ts`, both answering one question: does a hand-written assertion in the seed book agree with the rows sitting next to it. #1646 and #1647. The Acme description is the longest piece of hand-written narrative in the seed book and the one an evaluator is most likely to read end to end. Three of its lines had drifted off the records they name. "Renewal due in 45 days" matched nothing. The renewal closed_won 15 days ago, the contract runs another 335 days and auto-renews, and the AI governance workshop belongs to the OPEN platform upgrade 30 days out. The line had folded an open upgrade into a renewal already won; it now names the upgrade, its horizon, and the workshop that gates the signature. Checking the card's claim that every other line reconciled turned up two more. The $75K add-on was not "slipped due to a slow procurement cycle on their side": it is closed_lost on loss_reason 'timing', with loss_details naming a two-year HubSpot contract on their marketing org. And the login ticket is not "approaching its SLA": since due dates became derived from the priority x tier matrix, a high-priority case on an enterprise account is due 8 hours after creation, so that clock ran out about 40 hours before the demo boots. Both lines now state what the records state. The rest of the description reconciles and is untouched. Stark Medical now carries health_score 'at_risk'. csm_flagged_accounts groups by type to separate a flagged customer from a flagged prospect or partner, which the at_risk_accounts grid cannot show because it filters type == 'customer' first. Every flagged account was a customer, so the panel rendered one group row and demonstrated none of that. A partner whose pilot was won and whose expansion died on a capital freeze can be at risk, while churning would describe a subscription it never had, so the honest severity is also the matching one. Computed with the panel's own criterion read off the report metadata: before customer: 2 -> 1 group row after customer: 2, partner: 1 -> 2 group rows The health_score doctrine block records the third row and states why the three prospects stay blank. No guard is added: free prose has no mechanical relation to the rows it narrates. The territory partition (6 NA / 2 EMEA / 1 other) and the 41 / 72 / 104-day activity bands are unchanged — no address and no activity clock moved. No report, panel criterion, object, view or test changed. Co-authored-by: Claude <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
os-steve
marked this pull request as ready for review
September 6, 2026 06:12
This was referenced Sep 6, 2026
Closed
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.
Closes #1646
Closes #1647
Description
Two corrections to
src/data/sales.seed.ts, folded because they answer onequestion: does a hand-written assertion in the seed book agree with the rows
sitting next to it.
#1646 — the Acme description. The card named one sentence. Verifying its
claim that every other sentence reconciles turned up two more, so all three
are corrected here (the card's own reasoning applies unchanged to each: it is
the longest piece of hand-written narrative in the seed book, and nothing
mechanical will ever find a false line in it).
#1647 — the flagged panel that could only render one row.
Stark Medicalnow carries
health_score: 'at_risk', taking the route the grading rulingpicked: an
at_riskpartner satisfies the panel criterion and issemantically sound, so the card's "invent bad data or soften the comment"
dilemma does not bind. The block's comment is true and is untouched.
Type of Change
Changes Made
1. "Renewal due in 45 days" (#1646, the named sentence)
No seeded record carries a 45-day renewal horizon. Measured on this branch:
Acme Annual Renewal 2025closed_won,close_date=daysAgo(15)revenue.seed.tsend_date=daysFromNow(335),auto_renewal: trueAcme Platform Upgrade(OPEN)close_date=daysFromNow(30),next_stepnames the workshopThe sentence had folded the open upgrade into a renewal that was already won.
It now names the upgrade, its real horizon, and the workshop that gates
signature — the shape the ruling asked for.
2. "Slipped one opportunity ($75K add-on) ... due to slow procurement cycle"
Acme Add-on (Lost)isclosed_lostwithloss_reason: 'timing'andloss_detailsnaming a two-year HubSpot contract on Acme's marketing org.Procurement appears nowhere on that deal, and the deal did not slip — it was
lost. The line now states the loss and the reason the record gives.
3. "Login issues ticket is approaching its SLA"
sla_due_dateis derived from the priority x tier matrix(
src/objects/_case-sla.ts). That case ishighon anenterpriseaccountand two days old, so it is due 8 hours after creation — its clock ran out
roughly 40 hours before the demo boots. It is past its SLA, not approaching
it;
case_sla_monitorflags it on its first sweep.needs eyes todayis keptbecause it is still true.
Everything else in that description reconciles and is byte-identical: the
$220K ARR and 22% uplift match the closed renewal, the open $150K upgrade
matches the opportunity, and the open ticket and the billing dispute match
seeded cases.
4.
Stark Medicalis flaggedat_risk(#1647)csm_flagged_accountsgroups bytypeto separate a flagged customer from aflagged prospect or partner — the one thing the grid view
crm_account.at_risk_accountscannot show. That is not a matter of comment:the view's
filtercarries{ field: 'type', operator: 'equals', value: 'customer' }ahead of the health term, verified in the implementation.
at_riskrather thanchurningis the honest severity as well as thematching one: Stark's pilot was won, its expansion died on
no_budget60days ago, and the partnership contract is still in legal review — a partner
can be at risk, but was never a subscription that could churn.
FLAGGED grouping, computed with the panel's own criterion read off the report
metadata (
is_active: trueANDhealth_score $in ['at_risk','churning'],rows: ['type']):Stark's clock stays at
today(), so like Wayne it is outside every windowedpanel: it reaches
csm_flagged_accountsand no other block, and thetype == 'customer'grid view still cannot see it. That is the report-blockversus grid-view difference demonstrated on data for the first time.
5. The doctrine block records the third row and the blanks
Only five of nine accounts carried
health_scorebefore this PR, and the fourblanks are exactly the four non-customers. Judged not a stated convention:
this file writes its deliberate omissions down (
billing_country/territory"deliberately NOT authored here", Apex's
otherbucket "a statedclassification here, not a blank", Lattice's missing
state), and no comment,guard roster or field constraint mentions these. The
health_scoreblock nowsays why Stark is filled and why the three prospects stay blank — a CSM
asserts something about a relationship, and nobody has been in the room with
an account that was never won.
No guard is added, on either card: free prose has no mechanical relation to the
rows it narrates, and pinning a seeded distribution here was ruled out twice.
Testing
pnpm verifyfully green on the final commit —validate,typecheck,lint,lint:i18n-gate,hygiene,hygiene:tokens,build,test:Specifically re-verified after the change:
No seeded account carries a billing_address, so both territory sharing rules match zero records on the demo dataset #638 territory partition intact — 6 NA (5 US + 1 CA) / 2 EMEA (DE, UK) /
1 other (SG), identical before and after. No address was touched.
Demo seeds for the activity model: crm_event / crm_event_attendee rows + a last_activity_date distribution (follow-up to #592) #671 activity bands intact — 104 / 72 / 41 days plus six accounts inside
30, identical before and after. No activity clock was touched.
test/churn-health-score-block.test.ts's header comment still holds. Itsthree claims are about the criterion, about rows being non-zero, and about
Initech overlapping
at_risk_accountswhile achurningaccount workeddaily lands nowhere else. Adding an
at_riskpartner with a live clocktouches none of them: Initech's overlap is unchanged, the synthetic
churningrow is unchanged, and the block still returns rows. The suitepasses unchanged.
Unit tests pass
Linting passes
Build succeeds
I have added a changeset
Out of scope — found while measuring, not fixed here
Three record-to-record contradictions turned up around Acme that are not
in either card's description. None is touched by this PR; they need their own
cards (the dedup search could not run — see the report).
next_stepsays "the week ofclose_date - 14d" (=daysFromNow(16)); theseeded event is
plannedfordaysFromNow(6)with invitations already out;and the task asking someone to schedule it is
not_started, duedaysFromNow(7)— a day after the workshop it plans.activatedcontract for a deal still inproposal. The Acme contractis
status: 'activated',signed_date: daysAgo(32),contract_value: 150000,and it links
crm_opportunity: 'Acme Platform Upgrade'— an opportunity thatcloses in 30 days at 60%.
service.seed.tsthe 30-case generator indexes both a 5-element account listand a 5-element status list by
i % 5, so every Acme demo case isnew,every Globex one
in_progress, every Wayne oneresolved, every Initech oneclosedand every Stark oneescalated. No account shows a status mix.Generated by Claude Code