CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl-labs/structured-logging

Every backend service MUST use structured logging — pino/structlog/slog, JSON format, request IDs, proper log levels. console.log is never acceptable.

88

3.03x
Quality

85%

Does it follow best practices?

Impact

97%

3.03x

Average score across 4 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

task.mdevals/scenario-2/

Email Notification Job Processor

Problem/Feature Description

A SaaS company needs a Node.js background job processor that consumes email notification jobs from a queue and sends them. The processor runs as a standalone process (not an HTTP server) in a Docker container on ECS.

The processor should:

  1. On startup, connect to a simulated job queue (use an in-memory array pre-populated with sample jobs for demonstration).
  2. Process jobs one at a time in a loop. Each job has: job_id, type (one of: "welcome", "password_reset", "invoice"), recipient_email, template_data, and priority (1-3).
  3. Simulate sending the email (just a 100ms delay). Mark the job as "completed" or "failed" based on a simple rule: if recipient_email contains "invalid", mark as failed.
  4. Track success/failure counts.
  5. Shut down gracefully when receiving SIGTERM — finish the current job, then exit with a summary of processed/failed counts.

The processor needs to be operationally solid since it runs unattended in production with no human watching the output.

Output Specification

Produce:

  • output/package.json with dependencies
  • output/src/processor.ts — The main job processor
  • output/src/types.ts — TypeScript interfaces for jobs
  • Any additional files needed

Complete TypeScript code, no placeholders.

evals

tile.json