refactor(init_db): remove demo data file and implement structured seeding

- Delete `demo_data.json` replaced by structured logic for better modularity.
- Add support for seeding default agent types and new demo data structure.
- Ensure demo mode only executes when explicitly enabled (settings.DEMO_MODE).
- Enhance logging for improved debugging during DB initialization.
This commit is contained in:
2026-01-06 02:34:34 +01:00
parent 1dcf99ee38
commit 92782bcb05
4 changed files with 1096 additions and 424 deletions

View File

@@ -0,0 +1,122 @@
[
{
"name": "Product Owner",
"slug": "product-owner",
"description": "Requirements discovery, stakeholder communication, and product vision. Leads the team in defining what to build and why.",
"expertise": ["requirements", "stakeholder-management", "product-strategy", "user-stories", "acceptance-criteria", "prioritization"],
"personality_prompt": "You are a skilled Product Owner focused on delivering maximum value to stakeholders. You excel at:\n- Understanding and articulating business needs\n- Writing clear user stories with acceptance criteria\n- Prioritizing features based on value and effort\n- Facilitating discussions between stakeholders and technical teams\n- Making trade-off decisions when scope conflicts arise\n\nYou communicate clearly and concisely, always keeping the end user and business goals in mind. You ask clarifying questions to ensure requirements are complete before passing them to the team.",
"primary_model": "claude-sonnet-4-20250514",
"fallback_models": ["claude-haiku-3-5-20241022"],
"model_params": {
"temperature": 0.7,
"max_tokens": 4096
},
"mcp_servers": ["gitea", "knowledge-base"],
"tool_permissions": {
"allowed": ["*"],
"denied": [],
"require_approval": ["gitea:delete_*"]
},
"is_active": true
},
{
"name": "Business Analyst",
"slug": "business-analyst",
"description": "Analysis, documentation, and detailed specifications. Bridges the gap between business needs and technical implementation.",
"expertise": ["analysis", "documentation", "specifications", "process-modeling", "data-analysis", "requirements-engineering"],
"personality_prompt": "You are a meticulous Business Analyst who excels at turning vague requirements into precise specifications. You:\n- Create detailed functional and technical specifications\n- Model business processes and data flows\n- Identify edge cases and potential issues early\n- Document assumptions and dependencies clearly\n- Ensure traceability between requirements and implementation\n\nYou are thorough and detail-oriented, always considering the implications of decisions. You create documentation that developers can follow without ambiguity.",
"primary_model": "claude-sonnet-4-20250514",
"fallback_models": ["claude-haiku-3-5-20241022"],
"model_params": {
"temperature": 0.5,
"max_tokens": 8192
},
"mcp_servers": ["gitea", "knowledge-base"],
"tool_permissions": {
"allowed": ["*"],
"denied": [],
"require_approval": []
},
"is_active": true
},
{
"name": "Solutions Architect",
"slug": "solutions-architect",
"description": "System design, architecture decisions, and technical leadership. Defines the technical vision and ensures system coherence.",
"expertise": ["system-design", "architecture", "adrs", "technical-decisions", "integration", "scalability", "security"],
"personality_prompt": "You are an experienced Solutions Architect who designs robust, scalable systems. You:\n- Create architecture diagrams and technical documentation\n- Write Architecture Decision Records (ADRs) for key decisions\n- Evaluate technology choices based on requirements and constraints\n- Identify potential bottlenecks and security concerns\n- Ensure consistency across the system design\n\nYou think holistically about systems, considering maintainability, scalability, and operational concerns. You document your decisions with clear rationale and trade-off analysis.",
"primary_model": "claude-sonnet-4-20250514",
"fallback_models": ["claude-haiku-3-5-20241022"],
"model_params": {
"temperature": 0.6,
"max_tokens": 8192
},
"mcp_servers": ["gitea", "knowledge-base", "filesystem"],
"tool_permissions": {
"allowed": ["*"],
"denied": [],
"require_approval": ["gitea:create_pull_request"]
},
"is_active": true
},
{
"name": "Senior Engineer",
"slug": "senior-engineer",
"description": "Implementation, code review, and refactoring. Writes high-quality, maintainable code following best practices.",
"expertise": ["implementation", "code-review", "refactoring", "testing", "debugging", "performance", "clean-code"],
"personality_prompt": "You are a Senior Software Engineer who writes clean, maintainable code. You:\n- Implement features following established patterns and standards\n- Write comprehensive tests (unit, integration, e2e)\n- Review code for correctness, performance, and maintainability\n- Refactor code to improve quality without changing behavior\n- Debug complex issues systematically\n\nYou prioritize code quality and follow SOLID principles. You write code that other developers can easily understand and maintain. You always consider edge cases and error handling.",
"primary_model": "claude-sonnet-4-20250514",
"fallback_models": ["claude-haiku-3-5-20241022"],
"model_params": {
"temperature": 0.3,
"max_tokens": 16384
},
"mcp_servers": ["gitea", "knowledge-base", "filesystem"],
"tool_permissions": {
"allowed": ["*"],
"denied": [],
"require_approval": ["gitea:create_pull_request", "gitea:delete_*"]
},
"is_active": true
},
{
"name": "QA Engineer",
"slug": "qa-engineer",
"description": "Testing, quality assurance, and bug verification. Ensures the product meets quality standards before release.",
"expertise": ["testing", "quality-assurance", "test-automation", "bug-verification", "test-planning", "regression-testing"],
"personality_prompt": "You are a thorough QA Engineer who ensures product quality. You:\n- Design comprehensive test plans and test cases\n- Write automated tests (unit, integration, e2e)\n- Verify bug fixes and perform regression testing\n- Identify edge cases and boundary conditions\n- Document defects clearly with reproduction steps\n\nYou have a critical eye for quality and think like a user who might break things. You balance thoroughness with efficiency, focusing on high-risk areas while ensuring broad coverage.",
"primary_model": "claude-sonnet-4-20250514",
"fallback_models": ["claude-haiku-3-5-20241022"],
"model_params": {
"temperature": 0.4,
"max_tokens": 8192
},
"mcp_servers": ["gitea", "knowledge-base", "filesystem"],
"tool_permissions": {
"allowed": ["*"],
"denied": [],
"require_approval": []
},
"is_active": true
},
{
"name": "DevOps Engineer",
"slug": "devops-engineer",
"description": "CI/CD, deployment, and infrastructure. Ensures reliable, automated delivery pipelines and operational excellence.",
"expertise": ["ci-cd", "deployment", "infrastructure", "docker", "kubernetes", "monitoring", "automation"],
"personality_prompt": "You are a skilled DevOps Engineer who builds reliable delivery pipelines. You:\n- Design and maintain CI/CD pipelines\n- Configure infrastructure as code\n- Set up monitoring, logging, and alerting\n- Automate repetitive operational tasks\n- Ensure security and compliance in deployments\n\nYou think about reliability, observability, and automation. You design systems that fail gracefully and are easy to troubleshoot. You document runbooks and operational procedures clearly.",
"primary_model": "claude-sonnet-4-20250514",
"fallback_models": ["claude-haiku-3-5-20241022"],
"model_params": {
"temperature": 0.4,
"max_tokens": 8192
},
"mcp_servers": ["gitea", "knowledge-base", "filesystem"],
"tool_permissions": {
"allowed": ["*"],
"denied": [],
"require_approval": ["gitea:create_release", "gitea:delete_*"]
},
"is_active": true
}
]

644
backend/data/demo_data.json Normal file
View File

@@ -0,0 +1,644 @@
{
"organizations": [
{
"name": "Acme Corp",
"slug": "acme-corp",
"description": "A leading provider of coyote-catching equipment."
},
{
"name": "Globex Corporation",
"slug": "globex",
"description": "We own the East Coast."
},
{
"name": "Soylent Corp",
"slug": "soylent",
"description": "Making food for the future."
},
{
"name": "Initech",
"slug": "initech",
"description": "Software for the soul."
},
{
"name": "Umbrella Corporation",
"slug": "umbrella",
"description": "Our business is life itself."
},
{
"name": "Massive Dynamic",
"slug": "massive-dynamic",
"description": "What don't we do?"
}
],
"users": [
{
"email": "demo@example.com",
"password": "DemoPass1234!",
"first_name": "Demo",
"last_name": "User",
"is_superuser": false,
"organization_slug": "acme-corp",
"role": "member",
"is_active": true
},
{
"email": "alice@acme.com",
"password": "Demo123!",
"first_name": "Alice",
"last_name": "Smith",
"is_superuser": false,
"organization_slug": "acme-corp",
"role": "admin",
"is_active": true
},
{
"email": "bob@acme.com",
"password": "Demo123!",
"first_name": "Bob",
"last_name": "Jones",
"is_superuser": false,
"organization_slug": "acme-corp",
"role": "member",
"is_active": true
},
{
"email": "charlie@acme.com",
"password": "Demo123!",
"first_name": "Charlie",
"last_name": "Brown",
"is_superuser": false,
"organization_slug": "acme-corp",
"role": "member",
"is_active": false
},
{
"email": "diana@acme.com",
"password": "Demo123!",
"first_name": "Diana",
"last_name": "Prince",
"is_superuser": false,
"organization_slug": "acme-corp",
"role": "member",
"is_active": true
},
{
"email": "carol@globex.com",
"password": "Demo123!",
"first_name": "Carol",
"last_name": "Williams",
"is_superuser": false,
"organization_slug": "globex",
"role": "owner",
"is_active": true
},
{
"email": "dan@globex.com",
"password": "Demo123!",
"first_name": "Dan",
"last_name": "Miller",
"is_superuser": false,
"organization_slug": "globex",
"role": "member",
"is_active": true
},
{
"email": "ellen@globex.com",
"password": "Demo123!",
"first_name": "Ellen",
"last_name": "Ripley",
"is_superuser": false,
"organization_slug": "globex",
"role": "member",
"is_active": true
},
{
"email": "fred@globex.com",
"password": "Demo123!",
"first_name": "Fred",
"last_name": "Flintstone",
"is_superuser": false,
"organization_slug": "globex",
"role": "member",
"is_active": true
},
{
"email": "dave@soylent.com",
"password": "Demo123!",
"first_name": "Dave",
"last_name": "Brown",
"is_superuser": false,
"organization_slug": "soylent",
"role": "member",
"is_active": true
},
{
"email": "gina@soylent.com",
"password": "Demo123!",
"first_name": "Gina",
"last_name": "Torres",
"is_superuser": false,
"organization_slug": "soylent",
"role": "member",
"is_active": true
},
{
"email": "harry@soylent.com",
"password": "Demo123!",
"first_name": "Harry",
"last_name": "Potter",
"is_superuser": false,
"organization_slug": "soylent",
"role": "admin",
"is_active": true
},
{
"email": "eve@initech.com",
"password": "Demo123!",
"first_name": "Eve",
"last_name": "Davis",
"is_superuser": false,
"organization_slug": "initech",
"role": "admin",
"is_active": true
},
{
"email": "iris@initech.com",
"password": "Demo123!",
"first_name": "Iris",
"last_name": "West",
"is_superuser": false,
"organization_slug": "initech",
"role": "member",
"is_active": true
},
{
"email": "jack@initech.com",
"password": "Demo123!",
"first_name": "Jack",
"last_name": "Sparrow",
"is_superuser": false,
"organization_slug": "initech",
"role": "member",
"is_active": false
},
{
"email": "frank@umbrella.com",
"password": "Demo123!",
"first_name": "Frank",
"last_name": "Miller",
"is_superuser": false,
"organization_slug": "umbrella",
"role": "member",
"is_active": true
},
{
"email": "george@umbrella.com",
"password": "Demo123!",
"first_name": "George",
"last_name": "Costanza",
"is_superuser": false,
"organization_slug": "umbrella",
"role": "member",
"is_active": false
},
{
"email": "kate@umbrella.com",
"password": "Demo123!",
"first_name": "Kate",
"last_name": "Bishop",
"is_superuser": false,
"organization_slug": "umbrella",
"role": "member",
"is_active": true
},
{
"email": "leo@massive.com",
"password": "Demo123!",
"first_name": "Leo",
"last_name": "Messi",
"is_superuser": false,
"organization_slug": "massive-dynamic",
"role": "owner",
"is_active": true
},
{
"email": "mary@massive.com",
"password": "Demo123!",
"first_name": "Mary",
"last_name": "Jane",
"is_superuser": false,
"organization_slug": "massive-dynamic",
"role": "member",
"is_active": true
},
{
"email": "nathan@massive.com",
"password": "Demo123!",
"first_name": "Nathan",
"last_name": "Drake",
"is_superuser": false,
"organization_slug": "massive-dynamic",
"role": "member",
"is_active": true
},
{
"email": "olivia@massive.com",
"password": "Demo123!",
"first_name": "Olivia",
"last_name": "Dunham",
"is_superuser": false,
"organization_slug": "massive-dynamic",
"role": "admin",
"is_active": true
},
{
"email": "peter@massive.com",
"password": "Demo123!",
"first_name": "Peter",
"last_name": "Parker",
"is_superuser": false,
"organization_slug": "massive-dynamic",
"role": "member",
"is_active": true
},
{
"email": "quinn@massive.com",
"password": "Demo123!",
"first_name": "Quinn",
"last_name": "Mallory",
"is_superuser": false,
"organization_slug": "massive-dynamic",
"role": "member",
"is_active": true
},
{
"email": "grace@example.com",
"password": "Demo123!",
"first_name": "Grace",
"last_name": "Hopper",
"is_superuser": false,
"organization_slug": null,
"role": null,
"is_active": true
},
{
"email": "heidi@example.com",
"password": "Demo123!",
"first_name": "Heidi",
"last_name": "Klum",
"is_superuser": false,
"organization_slug": null,
"role": null,
"is_active": true
},
{
"email": "ivan@example.com",
"password": "Demo123!",
"first_name": "Ivan",
"last_name": "Drago",
"is_superuser": false,
"organization_slug": null,
"role": null,
"is_active": false
},
{
"email": "rachel@example.com",
"password": "Demo123!",
"first_name": "Rachel",
"last_name": "Green",
"is_superuser": false,
"organization_slug": null,
"role": null,
"is_active": true
},
{
"email": "sam@example.com",
"password": "Demo123!",
"first_name": "Sam",
"last_name": "Wilson",
"is_superuser": false,
"organization_slug": null,
"role": null,
"is_active": true
},
{
"email": "tony@example.com",
"password": "Demo123!",
"first_name": "Tony",
"last_name": "Stark",
"is_superuser": false,
"organization_slug": null,
"role": null,
"is_active": true
},
{
"email": "una@example.com",
"password": "Demo123!",
"first_name": "Una",
"last_name": "Chin-Riley",
"is_superuser": false,
"organization_slug": null,
"role": null,
"is_active": false
},
{
"email": "victor@example.com",
"password": "Demo123!",
"first_name": "Victor",
"last_name": "Von Doom",
"is_superuser": false,
"organization_slug": null,
"role": null,
"is_active": true
},
{
"email": "wanda@example.com",
"password": "Demo123!",
"first_name": "Wanda",
"last_name": "Maximoff",
"is_superuser": false,
"organization_slug": null,
"role": null,
"is_active": true
}
],
"projects": [
{
"name": "E-Commerce Platform Redesign",
"slug": "ecommerce-redesign",
"description": "Complete redesign of the e-commerce platform with modern UX, improved checkout flow, and mobile-first approach.",
"owner_email": "demo@example.com",
"autonomy_level": "milestone",
"status": "active",
"complexity": "complex",
"client_mode": "technical",
"settings": {
"mcp_servers": ["gitea", "knowledge-base"],
"notification_email": "demo@example.com"
}
},
{
"name": "Mobile Banking App",
"slug": "mobile-banking",
"description": "Secure mobile banking application with biometric authentication, transaction history, and real-time notifications.",
"owner_email": "alice@acme.com",
"autonomy_level": "full_control",
"status": "active",
"complexity": "complex",
"client_mode": "technical",
"settings": {
"mcp_servers": ["gitea", "knowledge-base"],
"security_level": "high"
}
},
{
"name": "Internal HR Portal",
"slug": "hr-portal",
"description": "Employee self-service portal for leave requests, performance reviews, and document management.",
"owner_email": "carol@globex.com",
"autonomy_level": "autonomous",
"status": "active",
"complexity": "medium",
"client_mode": "auto",
"settings": {
"mcp_servers": ["gitea", "knowledge-base"]
}
}
],
"sprints": [
{
"project_slug": "ecommerce-redesign",
"name": "Sprint 1: Foundation",
"number": 1,
"goal": "Set up project infrastructure, design system, and core navigation components.",
"start_date": "2026-01-06",
"end_date": "2026-01-20",
"status": "active",
"planned_points": 21
},
{
"project_slug": "ecommerce-redesign",
"name": "Sprint 2: Product Catalog",
"number": 2,
"goal": "Implement product listing, filtering, search, and detail pages.",
"start_date": "2026-01-20",
"end_date": "2026-02-03",
"status": "planned",
"planned_points": 34
},
{
"project_slug": "mobile-banking",
"name": "Sprint 1: Authentication",
"number": 1,
"goal": "Implement secure login, biometric authentication, and session management.",
"start_date": "2026-01-06",
"end_date": "2026-01-20",
"status": "active",
"planned_points": 26
},
{
"project_slug": "hr-portal",
"name": "Sprint 1: Core Features",
"number": 1,
"goal": "Build employee dashboard, leave request system, and basic document management.",
"start_date": "2026-01-06",
"end_date": "2026-01-20",
"status": "active",
"planned_points": 18
}
],
"agent_instances": [
{
"project_slug": "ecommerce-redesign",
"agent_type_slug": "product-owner",
"name": "Aria",
"status": "idle"
},
{
"project_slug": "ecommerce-redesign",
"agent_type_slug": "solutions-architect",
"name": "Marcus",
"status": "idle"
},
{
"project_slug": "ecommerce-redesign",
"agent_type_slug": "senior-engineer",
"name": "Zara",
"status": "working",
"current_task": "Implementing responsive navigation component"
},
{
"project_slug": "mobile-banking",
"agent_type_slug": "product-owner",
"name": "Felix",
"status": "waiting",
"current_task": "Awaiting security requirements clarification"
},
{
"project_slug": "mobile-banking",
"agent_type_slug": "senior-engineer",
"name": "Luna",
"status": "working",
"current_task": "Implementing biometric authentication flow"
},
{
"project_slug": "mobile-banking",
"agent_type_slug": "qa-engineer",
"name": "Rex",
"status": "idle"
},
{
"project_slug": "hr-portal",
"agent_type_slug": "business-analyst",
"name": "Nova",
"status": "working",
"current_task": "Documenting leave request workflow"
},
{
"project_slug": "hr-portal",
"agent_type_slug": "senior-engineer",
"name": "Atlas",
"status": "working",
"current_task": "Building employee dashboard API"
}
],
"issues": [
{
"project_slug": "ecommerce-redesign",
"sprint_number": 1,
"type": "story",
"title": "Design responsive navigation component",
"body": "As a user, I want a navigation menu that works seamlessly on both desktop and mobile devices.\n\n## Acceptance Criteria\n- Hamburger menu on mobile viewports\n- Sticky header on scroll\n- Keyboard accessible\n- Screen reader compatible",
"status": "in_progress",
"priority": "high",
"labels": ["frontend", "design-system"],
"story_points": 5,
"assigned_agent_name": "Zara"
},
{
"project_slug": "ecommerce-redesign",
"sprint_number": 1,
"type": "task",
"title": "Set up Tailwind CSS configuration",
"body": "Configure Tailwind CSS with custom design tokens for the e-commerce platform.\n\n- Define color palette\n- Set up typography scale\n- Configure breakpoints\n- Add custom utilities",
"status": "closed",
"priority": "high",
"labels": ["frontend", "infrastructure"],
"story_points": 3
},
{
"project_slug": "ecommerce-redesign",
"sprint_number": 1,
"type": "task",
"title": "Create base component library structure",
"body": "Set up the foundational component library with:\n- Button variants\n- Form inputs\n- Card component\n- Modal system",
"status": "open",
"priority": "medium",
"labels": ["frontend", "design-system"],
"story_points": 8
},
{
"project_slug": "ecommerce-redesign",
"sprint_number": 1,
"type": "story",
"title": "Implement user authentication flow",
"body": "As a user, I want to sign up, log in, and manage my account.\n\n## Features\n- Email/password registration\n- Social login (Google, GitHub)\n- Password reset flow\n- Email verification",
"status": "open",
"priority": "critical",
"labels": ["auth", "backend", "frontend"],
"story_points": 13
},
{
"project_slug": "ecommerce-redesign",
"sprint_number": 2,
"type": "epic",
"title": "Product Catalog System",
"body": "Complete product catalog implementation including:\n- Product listing with pagination\n- Advanced filtering and search\n- Product detail pages\n- Category navigation",
"status": "open",
"priority": "high",
"labels": ["catalog", "backend", "frontend"],
"story_points": null
},
{
"project_slug": "mobile-banking",
"sprint_number": 1,
"type": "story",
"title": "Implement biometric authentication",
"body": "As a user, I want to log in using Face ID or Touch ID for quick and secure access.\n\n## Requirements\n- Support Face ID on iOS\n- Support fingerprint on Android\n- Fallback to PIN/password\n- Secure keychain storage",
"status": "in_progress",
"priority": "critical",
"labels": ["auth", "security", "mobile"],
"story_points": 8,
"assigned_agent_name": "Luna"
},
{
"project_slug": "mobile-banking",
"sprint_number": 1,
"type": "task",
"title": "Set up secure session management",
"body": "Implement secure session handling with:\n- JWT tokens with short expiry\n- Refresh token rotation\n- Session timeout handling\n- Multi-device session management",
"status": "open",
"priority": "critical",
"labels": ["auth", "security", "backend"],
"story_points": 5
},
{
"project_slug": "mobile-banking",
"sprint_number": 1,
"type": "bug",
"title": "Fix token refresh race condition",
"body": "When multiple API calls happen simultaneously after token expiry, multiple refresh requests are made causing 401 errors.\n\n## Steps to Reproduce\n1. Wait for token to expire\n2. Trigger multiple API calls at once\n3. Observe multiple 401 errors",
"status": "open",
"priority": "high",
"labels": ["bug", "auth", "backend"],
"story_points": 3
},
{
"project_slug": "mobile-banking",
"sprint_number": 1,
"type": "task",
"title": "Implement PIN entry screen",
"body": "Create secure PIN entry component with:\n- Masked input display\n- Haptic feedback\n- Brute force protection (lockout after 5 attempts)\n- Secure PIN storage",
"status": "open",
"priority": "high",
"labels": ["auth", "mobile", "frontend"],
"story_points": 5
},
{
"project_slug": "hr-portal",
"sprint_number": 1,
"type": "story",
"title": "Build employee dashboard",
"body": "As an employee, I want a dashboard showing my key information at a glance.\n\n## Dashboard Widgets\n- Leave balance\n- Pending approvals\n- Upcoming holidays\n- Recent announcements",
"status": "in_progress",
"priority": "high",
"labels": ["frontend", "dashboard"],
"story_points": 5,
"assigned_agent_name": "Atlas"
},
{
"project_slug": "hr-portal",
"sprint_number": 1,
"type": "story",
"title": "Implement leave request system",
"body": "As an employee, I want to submit and track leave requests.\n\n## Features\n- Submit leave request with date range\n- View leave balance by type\n- Track request status\n- Manager approval workflow",
"status": "in_progress",
"priority": "high",
"labels": ["backend", "frontend", "workflow"],
"story_points": 8,
"assigned_agent_name": "Nova"
},
{
"project_slug": "hr-portal",
"sprint_number": 1,
"type": "task",
"title": "Set up document storage integration",
"body": "Integrate with S3-compatible storage for employee documents:\n- Secure upload/download\n- File type validation\n- Size limits\n- Virus scanning",
"status": "open",
"priority": "medium",
"labels": ["backend", "infrastructure", "storage"],
"story_points": 5
}
]
}