Skip to content

Demo seed data — the product working on first boot #7

Description

@os-warren

pnpm dev on an empty database should show a system that is obviously working, not five empty grids. This is the first thing every evaluator sees.

Blocked-by: #1 (period keys must be spelled by the shared engine, not hand-written).

Files you own

  • src/data/*.seed.ts (new), added to dulySeeds in src/data/index.ts
  • test/seed.test.ts (new)

Use defineSeed. Do not touch objectstack.config.ts.

What to seed

Org. A three-level sys_business_unit tree — one company, three sites, two teams under one of them — with manager_user_id set at each level so hierarchy scopes have something to resolve.

People. ~12 sys_user records with manager_id set, spread across the units. Ordinary names, plausible emails on a clearly fictional domain.

Catalog. ~20 duly_catalog_item rows across 3 position codes, with a realistic frequency mix: several monthly, a few weekly, two quarterly, one semiannual, two annual, and two standing. Fill regulation_ref on most of them — it is what makes the catalog read as an audit answer rather than a to-do list.

Duties. Instantiate the catalog onto the people. Include a handful of source: 'self' duties so the caliber split is visible, and at least one paused duty.

Tasks. Backfill roughly 6 months so the views are not all empty. Deliberately include:

  • a majority done, so the on-time rate is plausible rather than either 0% or 100%
  • 3–4 late tasks (past due_date, still open) so the Late view has content
  • 2–3 stalled tasks (open, last_update_at older than 14 days) so the Not-moving view has content
  • one skipped with a real reason
  • tasks spread across units, so unit rollups differ from each other

Assignments. Two, one fanned out to four people with mixed completion, one with needs_collection.

Work log. ~15 duly_log_entry rows for two of the people, mostly private. They exist to show the module, and to demonstrate that nothing about them feeds a metric.

Rules

  • Period keys must come from the period engine (Period engine — period keys, boundaries and due dates, timezone-correct #1), not be typed by hand. A seed with a hand-spelled 2026-W4 instead of 2026-W04 teaches the wrong spelling to everyone who copies it.
  • Standing duties must have zero tasks. If your seed produces one, the dispatcher contract is being broken in the fixture.
  • No real company, person or regulation names.
  • Nothing in the seed may imply a ranking or comparison of item counts between people.

Acceptance

  • pnpm dev on an empty DB renders every view in the app with non-trivial content
  • My week, Late, Not moving and Calendar are each non-empty for at least one seeded user
  • no duly_task exists whose duty is form: 'standing'
  • re-running the seed on a populated DB does not duplicate

Gates

pnpm validate && pnpm typecheck && pnpm test && pnpm build.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions