CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl-labs/intent-integrity-kit

Closing the intent-to-code chasm - specification-driven development with BDD verification chain

86

1.82x
Quality

92%

Does it follow best practices?

Impact

86%

1.82x

Average score across 14 eval scenarios

SecuritybySnyk

Advisory

Suggest reviewing before use

Overview
Quality
Evals
Security
Files

task.mdevals/scenario-5/

Acceptance Test Suite for a User Notifications Feature

Problem/Feature Description

A fintech startup is building a user notifications service that will alert customers about account events (new transactions, low balance, login from new device). The backend team has finished writing up the requirements in their specification format and now needs executable test scenarios before any implementation begins. They follow a test-first approach and need proper BDD-style test files that can be wired up to their testing framework.

The product owner has provided a completed specification file and technical plan (see below) and wants the QA engineer to translate the requirements into Gherkin .feature files.

Output Specification

Produce one or more .feature files in a tests/features/ directory. Each file should contain Gherkin scenarios derived from the acceptance criteria in the spec. Output a brief generation-report.md summarizing how many scenarios were generated, how they are organized, and any traceability notes.

Input Files

The following files are provided as inputs. Extract them before beginning.

=============== FILE: specs/001-notifications/spec.md ===============

Feature Specification: User Notifications

Overview

Allow users to receive real-time and email notifications for important account events.

User Stories

US-1: Transaction Alerts (Priority: P1)

As a bank customer, I want to receive a notification when a transaction occurs on my account so I can monitor my finances in real time.

Acceptance Scenarios:

  1. Given a user with notifications enabled, When a debit transaction over $10 occurs, Then the user receives an in-app notification within 5 seconds.
  2. Given a user with email alerts enabled, When any transaction occurs, Then the user receives an email notification within 2 minutes.
  3. Given a user with notifications disabled, When a transaction occurs, Then no notification is sent.

Functional Requirements:

  • FR-001: The system must detect transactions and trigger notification dispatch within 5 seconds.
  • FR-002: The system must support both in-app and email notification channels.
  • FR-003: Users must be able to disable notifications globally.

Success Criteria:

  • SC-001: 99% of triggered in-app notifications are delivered within 5 seconds under normal load.
  • SC-002: Email notifications are delivered within 2 minutes in 95% of cases.

US-2: Low Balance Alert (Priority: P2)

As a bank customer, I want to be alerted when my account balance falls below a threshold I configure so I can avoid overdrafts.

Acceptance Scenarios:

  1. Given a user who has set a low-balance threshold of $100, When a transaction causes the balance to drop to $80, Then a low-balance alert is sent immediately.
  2. Given a user who has not set a threshold, When the balance drops below $50 (system default), Then a low-balance alert is sent.
  3. Given a user who already received a low-balance alert today, When another transaction drops the balance further, Then no duplicate alert is sent.

Functional Requirements:

  • FR-004: Users must be able to configure a custom low-balance threshold.
  • FR-005: A default threshold of $50 applies when none is configured.
  • FR-006: Low-balance alerts must not be sent more than once per 24-hour period.

Success Criteria:

  • SC-003: Low-balance alerts are sent within 10 seconds of the triggering transaction.
  • SC-004: Zero duplicate low-balance alerts sent within a 24-hour window.

US-3: Security Alerts (Priority: P1)

As a bank customer, I want to be notified immediately when a login occurs from an unrecognized device so I can take action if my account is compromised.

Acceptance Scenarios:

  1. Given a user logging in from a new device, When the login is successful, Then a security alert is sent to the user's registered email and phone number.
  2. Given a user who dismisses a security alert, When the same device logs in again within 7 days, Then no security alert is sent.

Functional Requirements:

  • FR-007: New device detection must compare against the user's registered devices list.
  • FR-008: Security alerts must be sent via both email and SMS simultaneously.
  • FR-009: Users can whitelist devices to suppress future alerts.

Success Criteria:

  • SC-005: Security alerts are delivered within 30 seconds of a new-device login event.

=============== FILE: specs/001-notifications/plan.md ===============

Technical Plan: User Notifications

Technical Context

  • Language/Version: Python 3.12
  • Primary Framework: FastAPI 0.109
  • Storage: PostgreSQL 16 with SQLAlchemy 2.0
  • Message Queue: Redis Streams for async notification dispatch
  • Testing: pytest with pytest-asyncio
  • Target Platform: Linux/Docker

Project Structure

src/
  models/notification.py       # Notification domain model
  models/preference.py         # User notification preferences
  models/device.py             # Registered device tracking
  services/dispatcher.py       # Notification dispatch orchestrator
  services/channels/email.py   # Email channel handler
  services/channels/sms.py     # SMS channel handler
  services/channels/inapp.py   # In-app channel handler
  services/detector.py         # Transaction and device event detection
  routes/notifications.py      # API endpoints
  routes/preferences.py        # User preference management
tests/
  features/                    # BDD .feature files (to be generated)
  integration/
    test_dispatch.py
    test_preferences.py

Data Model Summary

  • Notification: id, userId, type (transaction|low_balance|security), channel (email|sms|inapp), status, sentAt, createdAt
  • UserPreference: id, userId, notificationsEnabled, emailAlertsEnabled, lowBalanceThreshold, customThresholdSet
  • RegisteredDevice: id, userId, deviceFingerprint, whitelisted, firstSeenAt

=============== FILE: CONSTITUTION.md ===============

Project Constitution v1.0.0

Principles

P1: Test-Driven Development

Test-first development MUST be used for all features. Test specifications MUST be written before implementation begins.

P2: Data Privacy

User notification preferences and device data MUST be encrypted at rest.

P3: Reliability

Notification delivery failures MUST be retried with exponential backoff. Failed deliveries MUST be logged.

Amendment Procedure

Amendments require team lead approval and version increment.

=============== FILE: .specify/context.json =============== { "tdd_determination": "mandatory", "active_feature": "001-notifications" }

evals

README.md

tile.json