pytest-leak-scan-collides-with-generated-namespace-name
Done. The verified solution is at ~/solution.md, with a runnable reproduction in ~/repro.
Root cause. The gate test's leak scan is a raw substring check (assert "-1" not in output). The test generates a namespace auger-pytest-<random hex> and the CLI embeds it verbatim. When the random hex begins with 1, the namespace token literally contains -1 (prefix dash + leading 1) — a ~1/16 collision. The echo scan already stripped the namespace; the dump-header scan did not, so the second assertion was the one that kept firing.
Fix. Route every free-text sentinel scan through one helper that normalizes the generated identifier out of the scan surface:
def assert_no_sentinel_leak(output, *generated_ids):
scrubbed = output
for ident in generated_ids:
scrubbed = scrubbed.replace(ident, "<id>")
assert SENTINEL not in scrubbed, ...
Alternative: generate namespaces from an alphabet excluding sentinel characters.
Verified:
- Buggy test reproduces the failure deterministically on 1abc0000deadbeef; fixed test passes.
- 200k-sample simulation: buggy false-positive rate 0.06288 (matches theoretical 1/16 = 0.0625), fixed rate 0.00000, safe-alphabet 0.00000.
- Negative check confirms the fixed assertion still catches a real sentinel leak in a rendered field, so the scrub doesn't blind the gate.
The doc includes exact before/after code, grep commands to find every un-scrubbed scan site, the reproduction, verification commands with observed output, and an acceptance checklist.
# Evidence - Problem class: pytest-leak-scan-collides-with-generated-namespace-name - Model: openrouter/deepseek/deepseek-v4.1-flash - Solved: 2026-09-25T17:46:16.231Z - Verification: solution produced by pi in sandbox; see signatures.json
{"description": "A gate test asserting a sentinel string (e.g. '-1') is absent from CLI output fails on roughly 1 of 16 runs when the test suite generates a fresh namespace name like <prefix>-<random hex>: CLI output (dump header, echo lines) embeds the namespace name verbatim, so when the hex happens to start with digit 1 the literal sentinel '-1' appears inside the namespace token and the substring leak-scan assertion trips a false positive. The assertion is correct about the product (no sentinel leaks into rendered fields) but its scan surface includes an uncontrollable generated identifier. Fix pattern: strip the generated namespace from captured output before the substring assertion (out.replace(ns, '<ns>')) in EVERY assertion that scans free text for the sentinel, not just the first one \u2014 the second scan (dump output) is the one that keeps firing. Alternative: generate test namespaces from a hex alphabet excluding sentinel characters. Cost when it fires: a full 16-minute gate rerun blocks the commit. Seen in coding-hermes/auger test_confidence_sentinel_stays_in_the_store_and_never_renders where the dump-header scan lacked the strip the echo scan already had; the namespace name 'auger-pytest-1abc...' starts with '-1' after the prefix dash.", "environment": "", "language": "", "model": "openrouter/deepseek/deepseek-v4.1-flash", "problem_class": "pytest-leak-scan-collides-with-generated-namespace-name", "provider": "openrouter", "solved_at": "2026-09-25T17:46:16.234Z", "version": ""}Done. The verified solution is at ~/solution.md, with a runnable reproduction in ~/repro.
Root cause. The gate test's leak scan is a raw substring check (assert "-1" not in output). The test generates a namespace auger-pytest-<random hex> and the CLI embeds it verbatim. When the random hex begins with 1, the namespace token literally contains -1 (prefix dash + leading 1) — a ~1/16 collision. The echo scan already stripped the namespace; the dump-header scan did not, so the second assertion was the one that kept firing.
Fix. Route every free-text sentinel scan through one helper that normalizes the generated identifier out of the scan surface:
def assert_no_sentinel_leak(output, *generated_ids):
scrubbed = output
for ident in generated_ids:
scrubbed = scrubbed.replace(ident, "<id>")
assert SENTINEL not in scrubbed, ...
Alternative: generate namespaces from an alphabet excluding sentinel characters.
Verified:
- Buggy test reproduces the failure deterministically on 1abc0000deadbeef; fixed test passes.
- 200k-sample simulation: buggy false-positive rate 0.06288 (matches theoretical 1/16 = 0.0625), fixed rate 0.00000, safe-alphabet 0.00000.
- Negative check confirms the fixed assertion still catches a real sentinel leak in a rendered field, so the scrub doesn't blind the gate.
The doc includes exact before/after code, grep commands to find every un-scrubbed scan site, the reproduction, verification commands with observed output, and an acceptance checklist.
# Evidence - Problem class: pytest-leak-scan-collides-with-generated-namespace-name - Model: openrouter/deepseek/deepseek-v4.1-flash - Solved: 2026-09-25T17:46:16.231Z - Verification: solution produced by pi in sandbox; see signatures.json
{"description": "A gate test asserting a sentinel string (e.g. '-1') is absent from CLI output fails on roughly 1 of 16 runs when the test suite generates a fresh namespace name like <prefix>-<random hex>: CLI output (dump header, echo lines) embeds the namespace name verbatim, so when the hex happens to start with digit 1 the literal sentinel '-1' appears inside the namespace token and the substring leak-scan assertion trips a false positive. The assertion is correct about the product (no sentinel leaks into rendered fields) but its scan surface includes an uncontrollable generated identifier. Fix pattern: strip the generated namespace from captured output before the substring assertion (out.replace(ns, '<ns>')) in EVERY assertion that scans free text for the sentinel, not just the first one \u2014 the second scan (dump output) is the one that keeps firing. Alternative: generate test namespaces from a hex alphabet excluding sentinel characters. Cost when it fires: a full 16-minute gate rerun blocks the commit. Seen in coding-hermes/auger test_confidence_sentinel_stays_in_the_store_and_never_renders where the dump-header scan lacked the strip the echo scan already had; the namespace name 'auger-pytest-1abc...' starts with '-1' after the prefix dash.", "environment": "", "language": "", "model": "openrouter/deepseek/deepseek-v4.1-flash", "problem_class": "pytest-leak-scan-collides-with-generated-namespace-name", "provider": "openrouter", "solved_at": "2026-09-25T17:46:16.234Z", "version": ""}