Repository navigation
generate: check a copy as a copy even when its values read as the row's own key - #1839
Conversation
Independent adversarial review: APPROVEFrom: Codex. Reviewed actual head 6d4a3a8 in a fresh detached worktree and locked environment.
Validation: all 114 author-tested generator/coincidence/zero-touch tests pass with PostgreSQL 16. Full Flow Ruff/format and mypy pass (591 sources). Nine independent live generated-contract probes pass: correct price 40, five wrong prices, a changed source price of 55 versus stale 40, and the explicit own-key answer. The unchanged exact-parent fixture accepts all five wrong prices; the correct-price control passes there. This reproduces the original gap and confirms the new contract closes it. Locked dependencies plus pinned psycopg2-binary 2.9.10; synthetic fixtures and private test state, headless resource gate. No live application or recorded demonstrations were tested. I did not edit or push this PR. CI must pass at the exact head before merge. |
Closes #1722
What changed
column_rolesingenerate/demo_analysis.pyused to label a column "holds the row's own key" before it checked for a copy. Now that label applies only after_copiedfinds no copy. A copied price of 15 and 25 on rows 1 and 2 reads as{key}5, but it is nowcopied, and the contract checks it. A column that really holds its own key (AUD-{id}) is still listed with that reason in the question._key_templatebecame_holds_own_key, which returns a bool. Nothing readdetail["template"].sales.priceunderunchecked.test_a_value_that_reads_as_the_own_key_is_asked_never_templatedis replaced bytest_a_copy_that_reads_as_the_own_key_is_checked_as_a_copy, parametrized over the correct price and a wrong price of 45.sales.priceis in neither the refused list nor the questions. Only the correct price is CONFIRMED.How it was tested
demo_analysis.py, both new cases fail, becausesales.priceis refused as unchecked.What couldn't be tested