Add Modular Submission Evaluation Pipeline (Validation → Execution → Scoring)#152
Conversation
|
@aviralsaxena16 is attempting to deploy a commit to the aviralsaxena16's projects Team on Vercel. A member of the Team first needs to authorize it. |
🎉 Thanks for Your Contribution to CanonForces!
|
|
Caution Review failedPull request was closed or merged during review WalkthroughThis pull request introduces a modular pipeline system for code submission processing. Four new TypeScript modules are created to handle submission validation, sandbox execution, test case scoring, and orchestration. The Dockerfile adds a runtime environment variable, and the question submission handler is refactored to delegate logic to the new pipeline system instead of handling it inline. Changes
Sequence DiagramsequenceDiagram
participant Client as Client<br/>(QuestionBar)
participant Pipeline as runPipeline
participant Validator as validateSubmission
participant Executor as executeInSandbox
participant Scorer as scoreSubmission
participant API as /api/hello
Client->>Pipeline: runPipeline({code, language, testCases})
Pipeline->>Validator: validateSubmission({code, language})
Validator-->>Pipeline: {valid, error?}
alt Validation Failed
Pipeline-->>Client: {stage: "validation", error}
else Validation Passed
loop For each testCase
Pipeline->>Executor: executeInSandbox({language, code, input})
Executor->>API: POST {language, codeValue, input}
API-->>Executor: {data: {run}}
Executor-->>Pipeline: ExecutionResult | null
end
alt Execution Failed
Pipeline-->>Client: {stage: "execution", error}
else Execution Passed
Pipeline->>Scorer: scoreSubmission(executionOutputs, testCases)
Scorer-->>Pipeline: ScoreResult {passed, total, score, results}
Pipeline-->>Client: {stage: "completed", data: ScoreResult}
end
end
Estimated Code Review Effort🎯 4 (Complex) | ⏱️ ~75 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Tip You can disable sequence diagrams in the walkthrough.Disable the |
🚀 Add Modular Submission Evaluation Pipeline (Validation → Execution → Scoring)
🔍 Overview
This PR introduces a structured evaluation pipeline for Canonforces submissions, transforming the existing submission flow into a modular, extensible system.
The pipeline now processes each submission through clearly defined stages:
This improves reliability, maintainability, and aligns the system with real-world evaluation pipelines used in research and benchmarking systems.
✨ Key Changes
1️⃣ Validation Layer
Added a dedicated validation module to verify:
Prevents invalid submissions before execution
📁
src/lib/pipeline/validation.ts2️⃣ Sandbox Execution Layer
📁
src/lib/pipeline/execution.ts3️⃣ Scoring Layer
Added structured scoring system:
📁
src/lib/pipeline/scoring.tsExample output:
{ "total": 5, "passed": 4, "score": 80, "results": [ { "status": "Accepted" }, { "status": "Wrong Answer" } ] }4️⃣ Unified Pipeline Orchestrator
📁
src/lib/pipeline/index.tsHandles:
Returns structured responses with stage-level feedback
5️⃣ UI Integration
Updated submission flow to reflect pipeline stages:
Displays structured results in existing Output component
🧠 Why This Matters
This refactor introduces pipeline-based architecture, which:
🔬 Alignment with Advanced Evaluation Systems
The new architecture aligns with systems that:
This makes Canonforces closer to a general-purpose evaluation framework, not just a CP platform.
📦 New File Structure
🧪 Future Improvements
✅ Result
Canonforces now includes a modular, extensible evaluation pipeline that:
This significantly enhances the platform's engineering depth and scalability.
Summary by CodeRabbit