Topic: How the code-expert workflow generates testertest*.py from specs (referenced at topics.json:1987), and whether regeneration preserves hand-edits

Date: 2026-05-29

Time: 11:30

The testertest*.py Files Are Not Generated by Code-Expert

The premise of the topic at topics.json:1987 is a question to investigate, not documentation of an existing pipeline. The observations show definitively that the code-expert workflow does not generate testertest*.py files:

Evidence

1. No generation code exists. The grep for testertest across all code-expert tooling returned zero matches (greptestergeneration.totalcount: 0). The .code-expert/ directory contains only topics.json — no templates, specs, or generation scripts.

2. No auto-generation markers. The grep for DO NOT EDIT|auto.generated across all tester files found zero hits. The only matches for the broader pattern were natural uses of the word "preserves" in test docstrings (e.g., b-tree-storage-engine/testertestbtree.py:75"Test crash recovery: close and reopen preserves data.").

3. The topic was exploratory, not descriptive. The entry at topics.json:1987 reads: *"How the code-expert workflow generates testertest*.py files from specs, and whether they're regenerated when specs change"* — with "status": "done". This means the topic was investigated and resolved. The investigation likely concluded the same thing: there is no generation pipeline.

What These Files Actually Are

The testertest*.py files live in the target repository (/Users/ben/git/ddia-implementations), not in this knowledge base. Comparing b-tree-storage-engine/testbtree.py and b-tree-storage-engine/testertest_btree.py:

| Trait | testbtree.py | testertest_btree.py |

|-------|-----------------|------------------------|

| Framework | pytest (discovered by runner) | Standalone (print("PASSED")) |

| Test names | Terse (testbasic) | Descriptive (testbasicputget) |

| Docstrings | None | Present on every test |

| Structure | Monolithic tests | Decomposed (separate testrangescan, test_persistence) |

The tester files are hand-written standalone test suites — a parallel convention to pytest, designed to run without a test framework. The print("testxxx PASSED") pattern (visible at testertest_btree.py:44) suggests they're invoked by a simple runner that parses stdout, not by pytest.

The Hand-Edit Question Is Moot

Since there is no generation pipeline, the question of whether regeneration preserves hand-edits doesn't apply. These files are the canonical hand-written versions — they are the hand-edits.

What's Missing

To fully close this out, you'd want to check:

Beliefs