CtrlK
BlogDocsLog inGet started
Tessl Logo

pantheon-ai/design-principles

Strategic architecture, tactical design, and testable code principles (SOLID, Clean Architecture, Design Patterns, Testable Design)

97

Quality

97%

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

criteria.jsontestable-design/evals/scenario-3/

{
  "context": "Agent must apply the Humble Object pattern, placing all business logic in a testable use case and keeping the controller as a thin infrastructure adapter",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "CheckoutUseCase file produced",
      "description": "A file named CheckoutUseCase.ts exists and exports a class or function named CheckoutUseCase",
      "max_score": 10
    },
    {
      "name": "Use case has no express/db/stripe imports",
      "description": "CheckoutUseCase.ts does not import express, the db singleton, or the stripe singleton at the top level",
      "max_score": 20
    },
    {
      "name": "Use case accepts dependencies via constructor",
      "description": "CheckoutUseCase receives its cart repository and payment gateway as constructor parameters",
      "max_score": 20
    },
    {
      "name": "Business logic in use case",
      "description": "The total calculation (reduce over items) and the empty-cart validation are present in CheckoutUseCase, not in the controller",
      "max_score": 20
    },
    {
      "name": "Controller is thin",
      "description": "CheckoutController.ts contains no arithmetic or validation logic — it only maps req.body to use case input and maps the output to res.json",
      "max_score": 20
    },
    {
      "name": "Controller delegates to use case",
      "description": "CheckoutController.ts instantiates or receives a CheckoutUseCase and calls its execute (or equivalent) method",
      "max_score": 10
    }
  ]
}

tile.json