Write a reusable prompt with replaceable inputs. Submit your prompt and one test output for this example.
Task: Write a prompt that diagnoses a compact bug, proposes a minimal fix, and adds regression tests.
Example input: The intended Python function returns unique strings in their original first-seen order. Faulty code: def unique_in_order(items): return list(set(items)). Example input ["beta", "alpha", "beta", "gamma"] must return ["beta", "alpha", "gamma"]. Input is always a list of strings. The input list must not be mutated. Empty input should produce an empty list. No case folding, whitespace trimming, or sorting is requested.
Constraints:
- Keep the function name and input/output contract unchanged.
- Use only the standard library.
- Avoid adding validation for input types outside the supplied contract.
Required output from your prompt: A diagnosis, a corrected function, and at least five regression tests with their expected outputs.
Success checks:
- First-seen order is preserved.
- Nonadjacent duplicates are removed.
- Case-distinct strings remain distinct.
- Tests cover empty input and input immutability, with execution status reported honestly.