CtrlK
BlogDocsLog inGet started
Tessl Logo

jpc0/provably-correct-software

Build provably correct software using formal methods like Hoare Logic, Weakest Preconditions, and Design-by-Contract.

99

1.45x

Quality

100%

Does it follow best practices?

Impact

99%

1.45x

Average score across 5 eval scenarios

Overview
Skills
Evals
Files

task.mdevals/scenario-4/

Reliable Financial Transaction Engine

Problem Description

You are building a banking system for a financial institution. Each Account object has a balance that must always be non-negative.

Implement a process_transfer(source: Account, destination: Account, amount: float) method in a FinancialService class.

Requirements:

  • A transfer consists of two primary sub-tasks: a withdrawal from the source account and a deposit into the destination account.
  • The system must be robust against failures in these sub-tasks (e.g., if a deposit to a specific account type is temporarily blocked).
  • If any part of the transaction fails, the entire operation must be reversed to ensure all accounts remain in a valid and consistent state.
  • You must demonstrate that your error-handling logic guarantees the system returns to a stable, valid state before reporting the failure.
  • All core financial rules must be enforced using built-in language mechanisms.

Output Specification

Produce a Python file transactions.py containing the Account and FinancialService classes. The process_transfer method must be robust and include the logic for guaranteed state restoration in the comments.

Install with Tessl CLI

npx tessl i jpc0/provably-correct-software@0.1.0

evals

SKILL.md

tile.json