Skip to content

[TODO Import][Server][Backlog] Problem contribution pipeline completion #11

Description

@ferneediaz

Imported from server/TODO.md.

Kanban

  • Column: Backlog
  • Area: Server

📋 TODO - Problem Contribution Pipeline (LOW PRIORITY)

Import community-contributed problems from the repo.

Task Breakdown:

1. Problem Format in Repo

problems/
  two-sum/
    description.md       # Title, description, constraints, hints, complexity
    testcases.json       # Array of { input, expectedOutput, isHidden }
    starter-code/
      javascript.js
      python.py
      typescript.ts
      java.java
      cpp.cpp
      c.c
      rust.rs
    solution/
      editorial.md       # Solution explanation
      solution.py        # Reference solution

2. Import Script

  • Create scripts/import-problems.ts — CLI script to import from problems/ directory
  • Parse description.md frontmatter (title, difficulty, tags, constraints, complexity)
  • Import test cases from testcases.json
  • Import starter code from starter-code/ directory
  • Upsert logic (update if problem with same slug exists)
  • Dry-run mode (show what would be imported)
  • Success Criteria: Script imports problems into DB ✅

3. Validation

  • Validate test cases have input + expectedOutput
  • Validate at least 1 starter code file exists
  • Validate description.md has required frontmatter fields
  • Run reference solution against test cases to verify correctness
  • Success Criteria: Invalid problems rejected with clear errors ✅

4. Admin Review Integration

  • GET /api/problems/pending — List problems in DRAFT status (admin only)
  • POST /api/problems/:id/approve — Approve problem (move to ACTIVE)
  • POST /api/problems/:id/reject — Reject problem with reason
  • Add status field to Problem model (DRAFT, ACTIVE, REJECTED)
  • Success Criteria: Review workflow works ✅

5. Tests

  • Import script tests (valid problem, invalid problem, upsert)
  • Review workflow tests
  • Success Criteria: All import tests passing ✅

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions