A generated change can pass tests, look professional, and still violate an important invariant. Trust debt is the hidden cost incurred when code enters a system without adequate verification. The shortcut is immediate; the work of understanding and checking the code often falls on someone else later, under pressure. section 1.3 section 1.4
Unlike a knowingly accepted technical shortcut, trust debt can accumulate without the team recognizing it. Its savings are visible and immediate, while its costs are deferred and shared. Cognitive debt describes the related cost of rebuilding understanding that the team never acquired; trust debt also accounts for the cost to users when nobody does. section 1.4 section 1.8 section 8.1.2
Plausible code makes the debt easy to miss. Familiar names and structure can disguise missing edge cases or broken invariants. Automation bias encourages reviewers to accept the output, while large generated diffs and late handoffs force them to reconstruct intent at the worst moment. Green tests alone are not a safety case. section 8.1.2 section 1.3 section 1.4
A validator that looks finished
One generated ISBN-13 validator rejects hyphenated input and refers to an undefined variable, s, when checking the final digit. A test for a valid hyphenated ISBN exposes the first mismatch; a valid unhyphenated case reaches the erroneous reference. Professional-looking code still needs an explicit contract and execution against it. section 1.4
def is_valid_isbn13(isbn_string: str) -> bool:
if not isinstance(isbn_string, str):
return False
if len(isbn_string) != 13 or not isbn_string.isdigit():
return False
weights = [1, 3] * 6
try:
total = sum(int(d) * w for d, w in zip(isbn_string[:12], weights))
expected_check = (10 - (total % 10)) % 10
return int(s[-1]) == expected_check
except ValueError:
return FalseInspect the generated validator’s input check and final-digit reference. section 1.4
import pytest
# Assume is_valid_isbn13 is the function to be generated
def test_valid_isbn_with_hyphens():
assert is_valid_isbn13("978-0-306-40615-7") is True
def test_valid_isbn_without_hyphens():
assert is_valid_isbn13("9780306406157") is True
def test_invalid_checksum():
assert is_valid_isbn13("978-0-306-40615-0") is False
def test_invalid_length():
assert is_valid_isbn13("978-0-306-40615") is False
def test_contains_non_numeric_characters():
assert is_valid_isbn13("978-0-306-40615-X") is FalseCompare the validator with tests for accepted formats, checksums, length, and nonnumeric characters. section 1.4
Reduce the debt before merging:
- Write tests and contracts before generation, then verify the change against them rather than handing a large diff to a reviewer as the first check. section 1.8
- Separate mechanical checks from semantic review: passing types, tests, and contracts does not establish that the change matches the business intent. section 1.8
- Use adversarial or cross-model review to surface defects, but end with human judgment. Overlapping model blind spots remain, and no technique eliminates the debt entirely. section 1.5
- Refactor and own the result so the team can explain and maintain it without relying on the generation transcript. section 1.3 section 1.8
