Repository navigation
feat: seed the local stack with a demo company - #417
Conversation
`vp run seed` fills what `vp run dev` runs with a demo company after the prototype's Noordkade fixtures: 12 people in five teams and three roles, four engines with released, tested workflows, 30 days of their runs (completed, failed, and waiting on decisions, most answered), four Knowledge collections and five chats. Everything goes through core's API as the person who would do it; only run times, names, join dates and chat transcripts are written into the local state. It only reaches localhost, stops unless core signs people in through the local fake IdP, and adds only what is missing when run again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DGjkfKxJZ9eCUeQ9YexmJF
|
…he same Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DGjkfKxJZ9eCUeQ9YexmJF
|
The other 4,599 tests passed. This PR changes only I'm re-running the failed job once. If it fails again, I'll treat it as real and look into it. Generated by Claude Code |
… only to this checkout's stack - complaint-acknowledgement takes the day a complaint came in and counts two working days from it; weekly-report runs get their own Monday, so results match when the runs are shown to start - an open decision keeps the deadline its engine waits until - a Monday's scheduled run counts only once its 7:00 has passed - the admin's sign-in checks the stack is this checkout's before anyone else signs in Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DGjkfKxJZ9eCUeQ9YexmJF
What and why
GRA-430. A fresh
vp run devshows empty pages, so nobody can judge the dashboard, Workflows, Engines or Knowledge against the prototype.vp run seedfills the running local stack with a demo company modelled on the prototype's Noordkade fixtures (mortgage and lending advice). All the data is made up and atacme.test.What it seeds (
scripts/seed/):company.ts): 12 people. 2 are admins (the configuredadmin@acme.testbecomes Sanne de Wit, COO), 4 are builders and 6 are users. They sit in five teams: Client onboarding, Mortgage advice, Customer service, Finance and Compliance.engines.ts): four engines, Client onboarding, Service desk, Finance and Compliance, with seven released workflows between them. Each workflow is real@grasp-os/sdkcode with its ownworkflow-tests, and it makes no external calls: the run's input stands in for what a connection would bring. Five of them ask a team to decide (person params set to the team).weekly-reporthas a schedule trigger. Each engine has anAGENTS.md, so the Apps collection fills too, and each is shared with its teams.runs.ts): 163 runs over the last 30 days. Most completed, 13 failed on bad input (an empty email, an invoice without a VAT number, an application without an identity document), and 5 are still waiting on a decision. About 30 decisions are answered, some of them rejected. Each run is real: started through the API by the person the plan names, run by the engine, and answered through the API by a member of the deciding team. Only the times are then moved back in core's local D1, the way core's tests write to it: runs, decisions, failure reports and notifications. Runs fall on working days and keep realistic answer delays; the waiting ones are from the last day and a half, so their deadlines are still ahead.knowledge.ts): four collections, everyone's Procedures plus Finance, Client files and Compliance (sensitive) for teams, with 11 documents. Some have a second version, and some are past their review date.chats.ts): five chats, each created through the API. Their transcripts are written into the person's Workspace object, because asking would call a model. Answers are marked as no model's, the way core marks its own (interruptedMessage).Safety
http://localhost:5173. The address is hardcoded, never read from the environment.devIdpOrigin).Idempotent: running it again adds only what's missing: people, teams, collections, documents, engines, sharing, params, permissions and chats. An engine gets runs only while it has none. To start over, stop dev and delete
apps/core/.wrangler/state. AGENTS.md says this next tovp run dev, andscripts/dev.tspoints to the seed.What's written straight into local state (no API does it): full names and join dates (the fake IdP names people by their email's first word), the run times, and chat transcripts.
Follow-ups, as other streams land: workflow owners and weekly counts (GRA-398/399), Settings sections (GRA-433), and the dashboard layout (#374).
How it was tested
apps/core/.wrangler/statedeleted, thenvp run devstarted fresh):vp run seedfinished in about a minute. Engines got 50, 57, 34 and 22 runs, and 5 chats were created.vp run seedon the same state added nothing: every engine reported "has its runs already" and 0 new chats. No collections, teams or permissions were duplicated (checked in D1).vp checkpasses (format, lint, types).admin@acme.test, at 1440×1000. The session's network policy wouldn't let me upload them, so here is what they show:Running it locally needs
vp run devto start. In a container without Cloudflare credentials, start core with--localthe wayplaywright.config.tsdoes: core'sAIbinding is remote.Checklist
vp checkandvp testpass.vp checkpasses; no tests change, and the seed is dev tooling verified by running it.acme.test.@greptileai review
🤖 Generated with Claude Code
https://claude.ai/code/session_01DGjkfKxJZ9eCUeQ9YexmJF
Generated by Claude Code